@gen-epix/ui-client-casedb 4.0.0 → 4.0.1
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.
- package/dist/@types/mui.d.ts +1 -1
- package/dist/@types/{ui-casedb.d.ts → ui-client-casedb.d.ts} +1 -1
- package/dist/_chunks/AddCasesToEventDialog.js +74 -74
- package/dist/_chunks/AddCasesToEventDialog.js.map +1 -1
- package/dist/_chunks/CaseContentForm.js +2 -2
- package/dist/_chunks/CaseContentForm.js.map +1 -1
- package/dist/_chunks/CaseDbDownloadUtil.js +40 -35
- package/dist/_chunks/CaseDbDownloadUtil.js.map +1 -1
- package/dist/_chunks/CaseInfoDialog.js +195 -195
- package/dist/_chunks/CaseInfoDialog.js.map +1 -1
- package/dist/_chunks/CaseSetInfoDialog.js +131 -131
- package/dist/_chunks/CaseSetInfoDialog.js.map +1 -1
- package/dist/_chunks/CaseTypeInfoDialog.js +63 -61
- package/dist/_chunks/CaseTypeInfoDialog.js.map +1 -1
- package/dist/_chunks/CasesAlreadyInCaseSetWarning.js +6 -6
- package/dist/_chunks/CasesAlreadyInCaseSetWarning.js.map +1 -1
- package/dist/_chunks/CompletCaseTypeLoader.js +3 -3
- package/dist/_chunks/CompletCaseTypeLoader.js.map +1 -1
- package/dist/_chunks/CreateEventDialogSuccessNotificationMessage.js +1 -1
- package/dist/_chunks/CreateEventDialogSuccessNotificationMessage.js.map +1 -1
- package/dist/_chunks/CustomTabPanel.js.map +1 -1
- package/dist/_chunks/Dashboard.js +399 -386
- package/dist/_chunks/Dashboard.js.map +1 -1
- package/dist/_chunks/DashboardStoreLoader.js +5 -5
- package/dist/_chunks/DashboardStoreLoader.js.map +1 -1
- package/dist/_chunks/DataCollectionAccessInfo.js +21 -21
- package/dist/_chunks/DataCollectionAccessInfo.js.map +1 -1
- package/dist/_chunks/EpiCurveUtil.js +4 -4
- package/dist/_chunks/EpiCurveUtil.js.map +1 -1
- package/dist/_chunks/EpiCurveWidget.js +189 -183
- package/dist/_chunks/EpiCurveWidget.js.map +1 -1
- package/dist/_chunks/FilterUtil.js +103 -101
- package/dist/_chunks/FilterUtil.js.map +1 -1
- package/dist/_chunks/FindSimilarCasesDialog.js +16 -16
- package/dist/_chunks/FindSimilarCasesDialog.js.map +1 -1
- package/dist/_chunks/FindSimilarCasesUtil.js +9 -9
- package/dist/_chunks/FindSimilarCasesUtil.js.map +1 -1
- package/dist/_chunks/HomePageTrends.js +8 -8
- package/dist/_chunks/HomePageTrends.js.map +1 -1
- package/dist/_chunks/LegendaItem.js +3 -3
- package/dist/_chunks/LegendaItem.js.map +1 -1
- package/dist/_chunks/LineListWidget.js +23 -21
- package/dist/_chunks/LineListWidget.js.map +1 -1
- package/dist/_chunks/PanelSeparator.js +374 -384
- package/dist/_chunks/PanelSeparator.js.map +1 -1
- package/dist/_chunks/Upload.js +222 -207
- package/dist/_chunks/Upload.js.map +1 -1
- package/dist/_chunks/UploadUtil.js +1970 -841
- package/dist/_chunks/UploadUtil.js.map +1 -1
- package/dist/_chunks/UserRightsDialog.js +12 -12
- package/dist/_chunks/UserRightsDialog.js.map +1 -1
- package/dist/_chunks/_MapCache.js +2 -2
- package/dist/_chunks/_baseGet.js +1 -1
- package/dist/_chunks/_baseGet.js.map +1 -1
- package/dist/_chunks/_baseIteratee.js +1 -1
- package/dist/_chunks/_baseIteratee.js.map +1 -1
- package/dist/_chunks/_setToString.js.map +1 -1
- package/dist/_chunks/{chunk-KS7C4IRE.js → chunk-BV7QT456.js} +330 -495
- package/dist/_chunks/chunk-BV7QT456.js.map +1 -0
- package/dist/_chunks/cloneDeep.js +11 -9
- package/dist/_chunks/cloneDeep.js.map +1 -1
- package/dist/_chunks/dashboardStore.js +259 -261
- package/dist/_chunks/dashboardStore.js.map +1 -1
- package/dist/_chunks/esm.js +2900 -2868
- package/dist/_chunks/esm.js.map +1 -1
- package/dist/_chunks/format.js +8 -8
- package/dist/_chunks/format.js.map +1 -1
- package/dist/_chunks/index.esm.js +919 -796
- package/dist/_chunks/index.esm.js.map +1 -1
- package/dist/_chunks/index.module.js +1 -1
- package/dist/_chunks/index.module.js.map +1 -1
- package/dist/_chunks/protectedTokens.js +79 -81
- package/dist/_chunks/protectedTokens.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/round.js +1 -1
- package/dist/_chunks/round.js.map +1 -1
- package/dist/_chunks/shallow.js +2 -2
- package/dist/_chunks/shallow.js.map +1 -1
- package/dist/_chunks/sync.js +198 -161
- package/dist/_chunks/sync.js.map +1 -1
- package/dist/_chunks/toDate.js +1 -1
- package/dist/_chunks/toDate.js.map +1 -1
- package/dist/_chunks/toString.js +1 -1
- package/dist/_chunks/toString.js.map +1 -1
- package/dist/_chunks/useUnit.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +5 -5
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/filters/SelectionFilter.d.ts +2 -2
- package/dist/classes/filters/TreeFilter.d.ts +2 -2
- package/dist/classes/services/DataService/index.js +3 -3
- package/dist/classes/services/DataService/index.js.map +1 -1
- package/dist/classes/services/EventBusService/EventBusService.d.ts +1 -1
- package/dist/classes/services/EventBusService/index.js.map +1 -1
- package/dist/classes/services/LineListService/LineListServiceAbstract/index.js +1 -1
- package/dist/classes/services/LineListService/LineListServiceAbstract/index.js.map +1 -1
- package/dist/components/app/CaseDbApp/index.js +8 -5
- package/dist/components/app/CaseDbApp/index.js.map +1 -1
- package/dist/components/form/fields/ArrangementEditor/index.js +83 -83
- package/dist/components/form/fields/ArrangementEditor/index.js.map +1 -1
- package/dist/components/ui/AddCasesToEventDialog/AddCasesToEventDialog.d.ts +2 -2
- package/dist/components/ui/CaseContentFormDialog/CaseContentFormDialog.d.ts +2 -2
- package/dist/components/ui/CaseContentFormDialog/index.js +1 -1
- package/dist/components/ui/CaseContentFormDialog/index.js.map +1 -1
- package/dist/components/ui/CaseInfoDialog/CaseInfoDialog.d.ts +2 -2
- package/dist/components/ui/CaseSetInfoDialog/CaseSetInfoDialog.d.ts +2 -2
- package/dist/components/ui/CaseSummary/index.js +1 -1
- package/dist/components/ui/CaseSummary/index.js.map +1 -1
- package/dist/components/ui/CaseTypeInfoDialog/CaseTypeInfoDialog.d.ts +2 -2
- package/dist/components/ui/CaseTypeInfoDialog/CaseTypeInfoDialogContent.d.ts +1 -1
- package/dist/components/ui/CaseTypeInfoDialog/CaseTypeInfoDialogWithLoader.d.ts +2 -2
- package/dist/components/ui/ContextMenu/index.js.map +1 -1
- package/dist/components/ui/CreateEventDialog/CreateEventDialog.d.ts +2 -2
- package/dist/components/ui/CreateEventDialog/index.js +9 -9
- package/dist/components/ui/CreateEventDialog/index.js.map +1 -1
- package/dist/components/ui/Dashboard/DashboardDownloadSidebarItem.d.ts +1 -1
- package/dist/components/ui/Dashboard/DashboardSettingsSidebarItem.d.ts +1 -1
- package/dist/components/ui/Dashboard/DashboardWidget.d.ts +1 -1
- package/dist/components/ui/DashboardEditCases/index.js +1 -1
- package/dist/components/ui/DashboardEditCases/index.js.map +1 -1
- package/dist/components/ui/FileSelector/index.js +46 -46
- package/dist/components/ui/FileSelector/index.js.map +1 -1
- package/dist/components/ui/FindSimilarCasesDialog/FindSimilarCasesDialog.d.ts +2 -2
- package/dist/components/ui/Grouping/index.js +50 -50
- package/dist/components/ui/Grouping/index.js.map +1 -1
- package/dist/components/ui/HistogramWidget/index.js +1 -1
- package/dist/components/ui/HistogramWidget/index.js.map +1 -1
- package/dist/components/ui/MapWidget/index.js +7 -3
- package/dist/components/ui/MapWidget/index.js.map +1 -1
- package/dist/components/ui/RemoveCasesFromEventDialog/RemoveCasesFromEventDialog.d.ts +2 -2
- package/dist/components/ui/RemoveCasesFromEventDialog/index.js +6 -6
- package/dist/components/ui/RemoveCasesFromEventDialog/index.js.map +1 -1
- package/dist/components/ui/RemoveFindSimilarCasesResultDialog/RemoveFindSimilarCasesResultDialog.d.ts +2 -2
- package/dist/components/ui/SequenceDownloadDialog/SequenceDownloadDialog.d.ts +2 -2
- package/dist/components/ui/SequenceDownloadDialog/index.js +22 -22
- package/dist/components/ui/SequenceDownloadDialog/index.js.map +1 -1
- package/dist/components/ui/TreeDescription/index.js.map +1 -1
- package/dist/components/ui/TreeWidget/index.js +11 -11
- package/dist/components/ui/TreeWidget/index.js.map +1 -1
- package/dist/components/ui/Upload/UploadCaseResultTable.d.ts +2 -2
- package/dist/components/ui/Upload/UploadEditColumnValuesDialog.d.ts +2 -2
- package/dist/components/ui/UserRightsDialog/UserRightsDialog.d.ts +2 -2
- package/dist/components/ui/UsersEffectiveRightsDetailsDialog/UsersEffectiveRightsDetailsDialog.d.ts +2 -2
- package/dist/components/ui/UsersEffectiveRightsDetailsDialog/index.js +25 -11
- package/dist/components/ui/UsersEffectiveRightsDetailsDialog/index.js.map +1 -1
- package/dist/components/ui/Warning/index.js.map +1 -1
- package/dist/components/ui/WidgetHeaderIconButton/index.js.map +1 -1
- package/dist/components/ui/WidgetMenu/WidgetMenu.d.ts +1 -1
- package/dist/components/ui/WidgetMenu/index.js +2 -2
- package/dist/components/ui/WidgetMenu/index.js.map +1 -1
- package/dist/components/ui/WidgetUnavailable/index.js.map +1 -1
- package/dist/constants/query.d.ts +1 -1
- package/dist/constants/query.js +1 -1
- package/dist/constants/query.js.map +1 -1
- package/dist/context/caseAbac/CaseAbacContext.d.ts +1 -1
- package/dist/dataHooks/useAssemblyProtocolsQuery/index.js +3 -3
- package/dist/dataHooks/useAssemblyProtocolsQuery/index.js.map +1 -1
- package/dist/dataHooks/useAssemblyProtocolsQuery/useAssemblyProtocolsQuery.d.ts +1 -1
- package/dist/dataHooks/useCaseRightsQuery/index.js +2 -2
- package/dist/dataHooks/useCaseRightsQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseSetCategoriesQuery/index.js +3 -3
- package/dist/dataHooks/useCaseSetCategoriesQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseSetCategoriesQuery/useCaseSetCategoriesQuery.d.ts +1 -1
- package/dist/dataHooks/useCaseSetRightsQuery/index.js +2 -2
- package/dist/dataHooks/useCaseSetRightsQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseSetStatsQuery/index.js +3 -3
- package/dist/dataHooks/useCaseSetStatsQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseSetStatsQuery/useCaseSetStatsQuery.d.ts +1 -1
- package/dist/dataHooks/useCaseSetStatusesQuery/index.js +3 -3
- package/dist/dataHooks/useCaseSetStatusesQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseSetStatusesQuery/useCaseSetStatusesQuery.d.ts +1 -1
- package/dist/dataHooks/useCaseSetsQuery/index.js +3 -3
- package/dist/dataHooks/useCaseSetsQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseSetsQuery/useCaseSetsQuery.d.ts +1 -1
- package/dist/dataHooks/useCaseTypeSetCategoriesQuery/index.js +3 -3
- package/dist/dataHooks/useCaseTypeSetCategoriesQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseTypeSetCategoriesQuery/useCaseTypeSetCategoriesQuery.d.ts +1 -1
- package/dist/dataHooks/useCaseTypeSetCategoryPurposeQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseTypeSetCategoryPurposeQuery/useCaseTypeSetCategoryPurposeQuery.d.ts +1 -1
- package/dist/dataHooks/useCaseTypeSetMembersQuery/index.js +2 -2
- package/dist/dataHooks/useCaseTypeSetMembersQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseTypeSetsQuery/index.js +3 -3
- package/dist/dataHooks/useCaseTypeSetsQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseTypeSetsQuery/useCaseTypeSetsQuery.d.ts +1 -1
- package/dist/dataHooks/useCaseTypeStatsQuery/index.js +2 -2
- package/dist/dataHooks/useCaseTypeStatsQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseTypesQuery/index.js +3 -3
- package/dist/dataHooks/useCaseTypesQuery/index.js.map +1 -1
- package/dist/dataHooks/useCaseTypesQuery/useCaseTypesQuery.d.ts +1 -1
- package/dist/dataHooks/useColSetMembersQuery/index.js +2 -2
- package/dist/dataHooks/useColSetMembersQuery/index.js.map +1 -1
- package/dist/dataHooks/useColSetsQuery/index.js +3 -3
- package/dist/dataHooks/useColSetsQuery/index.js.map +1 -1
- package/dist/dataHooks/useColSetsQuery/useColSetsQuery.d.ts +1 -1
- package/dist/dataHooks/useColTypesQuery/index.js.map +1 -1
- package/dist/dataHooks/useColTypesQuery/useColTypesQuery.d.ts +1 -1
- package/dist/dataHooks/useColsQuery/index.js +3 -3
- package/dist/dataHooks/useColsQuery/index.js.map +1 -1
- package/dist/dataHooks/useColsQuery/useColsQuery.d.ts +1 -1
- package/dist/dataHooks/useConceptQuery/index.js +3 -3
- package/dist/dataHooks/useConceptQuery/index.js.map +1 -1
- package/dist/dataHooks/useConceptQuery/useConceptQuery.d.ts +1 -1
- package/dist/dataHooks/useConceptRelationTypeQuery/index.js.map +1 -1
- package/dist/dataHooks/useConceptRelationTypeQuery/useConceptRelationTypeQuery.d.ts +1 -1
- package/dist/dataHooks/useConceptSetTypeQuery/index.js.map +1 -1
- package/dist/dataHooks/useConceptSetTypeQuery/useConceptSetTypeQuery.d.ts +1 -1
- package/dist/dataHooks/useConceptSetsQuery/index.js +3 -3
- package/dist/dataHooks/useConceptSetsQuery/index.js.map +1 -1
- package/dist/dataHooks/useConceptSetsQuery/useConceptSetsQuery.d.ts +1 -1
- package/dist/dataHooks/useDataCollectionSetMembersQuery/index.js +2 -2
- package/dist/dataHooks/useDataCollectionSetMembersQuery/index.js.map +1 -1
- package/dist/dataHooks/useDataCollectionsQuery/index.js +3 -3
- package/dist/dataHooks/useDataCollectionsQuery/index.js.map +1 -1
- package/dist/dataHooks/useDataCollectionsQuery/useDataCollectionsQuery.d.ts +1 -1
- package/dist/dataHooks/useDimTypesQuery/index.js.map +1 -1
- package/dist/dataHooks/useDimTypesQuery/useDimTypesQuery.d.ts +1 -1
- package/dist/dataHooks/useDimsQuery/index.js +3 -3
- package/dist/dataHooks/useDimsQuery/index.js.map +1 -1
- package/dist/dataHooks/useDimsQuery/useDimsQuery.d.ts +1 -1
- package/dist/dataHooks/useDiseasesQuery/index.js +3 -3
- package/dist/dataHooks/useDiseasesQuery/index.js.map +1 -1
- package/dist/dataHooks/useDiseasesQuery/useDiseasesQuery.d.ts +1 -1
- package/dist/dataHooks/useEtiologicalAgentsQuery/index.js +3 -3
- package/dist/dataHooks/useEtiologicalAgentsQuery/index.js.map +1 -1
- package/dist/dataHooks/useEtiologicalAgentsQuery/useEtiologicalAgentsQuery.d.ts +1 -1
- package/dist/dataHooks/useGeneticDistanceProtocolsQuery/index.js +3 -3
- package/dist/dataHooks/useGeneticDistanceProtocolsQuery/index.js.map +1 -1
- package/dist/dataHooks/useGeneticDistanceProtocolsQuery/useGeneticDistanceProtocolsQuery.d.ts +1 -1
- package/dist/dataHooks/useOrganizationAccessCasePoliciesQuery/index.js +2 -2
- package/dist/dataHooks/useOrganizationAccessCasePoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationShareCasePoliciesQuery/index.js +2 -2
- package/dist/dataHooks/useOrganizationShareCasePoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useRefColsQuery/index.js +3 -3
- package/dist/dataHooks/useRefColsQuery/index.js.map +1 -1
- package/dist/dataHooks/useRefColsQuery/useRefColsQuery.d.ts +1 -1
- package/dist/dataHooks/useRefColsValidationRulesQuery/index.js +2 -2
- package/dist/dataHooks/useRefColsValidationRulesQuery/index.js.map +1 -1
- package/dist/dataHooks/useRefDimsQuery/index.js +3 -3
- package/dist/dataHooks/useRefDimsQuery/index.js.map +1 -1
- package/dist/dataHooks/useRefDimsQuery/useRefDimsQuery.d.ts +1 -1
- package/dist/dataHooks/useRegionQuery/index.js +3 -3
- package/dist/dataHooks/useRegionQuery/index.js.map +1 -1
- package/dist/dataHooks/useRegionQuery/useRegionQuery.d.ts +1 -1
- package/dist/dataHooks/useRegionRelationTypeQuery/index.js.map +1 -1
- package/dist/dataHooks/useRegionRelationTypeQuery/useRegionRelationTypeQuery.d.ts +1 -1
- package/dist/dataHooks/useRegionSetsQuery/index.js +3 -3
- package/dist/dataHooks/useRegionSetsQuery/index.js.map +1 -1
- package/dist/dataHooks/useRegionSetsQuery/useRegionSetsQuery.d.ts +1 -1
- package/dist/dataHooks/useSequencingProtocolsQuery/index.js +3 -3
- package/dist/dataHooks/useSequencingProtocolsQuery/index.js.map +1 -1
- package/dist/dataHooks/useSequencingProtocolsQuery/useSequencingProtocolsQuery.d.ts +1 -1
- package/dist/dataHooks/useTreeAlgorithmCodesQuery/index.js.map +1 -1
- package/dist/dataHooks/useTreeAlgorithmCodesQuery/useTreeAlgorithmCodesQuery.d.ts +1 -1
- package/dist/dataHooks/useUnitQuery/useUnit.d.ts +1 -1
- package/dist/dataHooks/useUserAccessCasePoliciesQuery/index.js +2 -2
- package/dist/dataHooks/useUserAccessCasePoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useUserEffectiveRightsQuery/index.js +3 -3
- package/dist/dataHooks/useUserEffectiveRightsQuery/index.js.map +1 -1
- package/dist/dataHooks/useUserEffectiveRightsQuery/useUserEffectiveRightsQuery.d.ts +1 -1
- package/dist/dataHooks/useUserShareCasePoliciesQuery/index.js +2 -2
- package/dist/dataHooks/useUserShareCasePoliciesQuery/index.js.map +1 -1
- package/dist/hooks/useOrganizationCasePolicyNameFactory/index.js +2 -2
- package/dist/hooks/useOrganizationCasePolicyNameFactory/index.js.map +1 -1
- package/dist/hooks/useOrganizationCasePolicyNameFactory/useOrganizationCasePolicyNameFactory.d.ts +1 -1
- package/dist/hooks/useUserCasePolicyNameFactory/index.js +3 -3
- package/dist/hooks/useUserCasePolicyNameFactory/index.js.map +1 -1
- package/dist/hooks/useUserCasePolicyNameFactory/useUserCasePolicyNameFactory.d.ts +1 -1
- package/dist/locale/nl.json +1 -1
- package/dist/models/config.d.ts +1 -1
- package/dist/models/dashboard.d.ts +1 -1
- package/dist/models/dashboard.js.map +1 -1
- package/dist/models/theme.d.ts +2 -2
- package/dist/pages/CaseDbUsersAdminPage/index.js +5 -5
- package/dist/pages/CaseDbUsersAdminPage/index.js.map +1 -1
- package/dist/pages/CaseSetCategoryAdminPage/index.js +4 -4
- package/dist/pages/CaseSetCategoryAdminPage/index.js.map +1 -1
- package/dist/pages/CaseSetStatusAdminPage/index.js +4 -4
- package/dist/pages/CaseSetStatusAdminPage/index.js.map +1 -1
- package/dist/pages/CaseTypeSetCategoriesAdminPage/index.js +4 -4
- package/dist/pages/CaseTypeSetCategoriesAdminPage/index.js.map +1 -1
- package/dist/pages/CaseTypeSetsAdminPage/index.js +6 -6
- package/dist/pages/CaseTypeSetsAdminPage/index.js.map +1 -1
- package/dist/pages/CaseTypesAdminPage/index.js +5 -5
- package/dist/pages/CaseTypesAdminPage/index.js.map +1 -1
- package/dist/pages/CasesDetailPage/index.js +5 -5
- package/dist/pages/CasesDetailPage/index.js.map +1 -1
- package/dist/pages/CasesPage/index.js +10 -10
- package/dist/pages/CasesPage/index.js.map +1 -1
- package/dist/pages/ColSetsAdminPage/index.js +6 -6
- package/dist/pages/ColSetsAdminPage/index.js.map +1 -1
- package/dist/pages/ColsAdminPage/index.js +5 -5
- package/dist/pages/ColsAdminPage/index.js.map +1 -1
- package/dist/pages/ConceptRelationsAdminPage/index.js +19 -19
- package/dist/pages/ConceptRelationsAdminPage/index.js.map +1 -1
- package/dist/pages/ConceptSetsAdminPage/index.js +5 -5
- package/dist/pages/ConceptSetsAdminPage/index.js.map +1 -1
- package/dist/pages/ConceptsAdminPage/index.js +5 -5
- package/dist/pages/ConceptsAdminPage/index.js.map +1 -1
- package/dist/pages/DataCollectionSetsAdminPage/index.js +12 -12
- package/dist/pages/DataCollectionSetsAdminPage/index.js.map +1 -1
- package/dist/pages/DataCollectionVisualizationPage/index.js +4 -4
- package/dist/pages/DataCollectionVisualizationPage/index.js.map +1 -1
- package/dist/pages/DataCollectionsAdminPage/index.js +4 -4
- package/dist/pages/DataCollectionsAdminPage/index.js.map +1 -1
- package/dist/pages/DimsAdminPage/index.js +6 -6
- package/dist/pages/DimsAdminPage/index.js.map +1 -1
- package/dist/pages/DiseasesAdminPage/index.js +4 -4
- package/dist/pages/DiseasesAdminPage/index.js.map +1 -1
- package/dist/pages/EtiologicalAgentsAdminPage/index.js +4 -4
- package/dist/pages/EtiologicalAgentsAdminPage/index.js.map +1 -1
- package/dist/pages/EtiologiesAdminPage/index.js +3 -3
- package/dist/pages/EtiologiesAdminPage/index.js.map +1 -1
- package/dist/pages/EventsDetailPage/index.js +5 -5
- package/dist/pages/EventsDetailPage/index.js.map +1 -1
- package/dist/pages/EventsPage/index.js +11 -11
- package/dist/pages/EventsPage/index.js.map +1 -1
- package/dist/pages/HomePage/index.js +2 -2
- package/dist/pages/HomePage/index.js.map +1 -1
- package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js +4 -4
- package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationShareCasePoliciesAdminPage/index.js +4 -4
- package/dist/pages/OrganizationShareCasePoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/RefColsAdminPage/index.js +7 -7
- package/dist/pages/RefColsAdminPage/index.js.map +1 -1
- package/dist/pages/RefDimsAdminPage/index.js +5 -5
- package/dist/pages/RefDimsAdminPage/index.js.map +1 -1
- package/dist/pages/RegionRelationsAdminPage/index.js +3 -3
- package/dist/pages/RegionRelationsAdminPage/index.js.map +1 -1
- package/dist/pages/RegionSetShapesAdminPage/index.js +4 -4
- package/dist/pages/RegionSetShapesAdminPage/index.js.map +1 -1
- package/dist/pages/RegionSetsAdminPage/index.js +5 -5
- package/dist/pages/RegionSetsAdminPage/index.js.map +1 -1
- package/dist/pages/RegionsAdminPage/index.js +5 -5
- package/dist/pages/RegionsAdminPage/index.js.map +1 -1
- package/dist/pages/TrendsPage/index.js +1 -1
- package/dist/pages/TrendsPage/index.js.map +1 -1
- package/dist/pages/UploadPage/index.js +1 -1
- package/dist/pages/UploadPage/index.js.map +1 -1
- package/dist/pages/UserAccessCasePoliciesAdminPage/index.js +4 -4
- package/dist/pages/UserAccessCasePoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/UserEffectiveRightsAdminPage/index.js +12 -12
- package/dist/pages/UserEffectiveRightsAdminPage/index.js.map +1 -1
- package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js +8 -8
- package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js.map +1 -1
- package/dist/pages/UserShareCasePoliciesAdminPage/index.js +4 -4
- package/dist/pages/UserShareCasePoliciesAdminPage/index.js.map +1 -1
- package/dist/routes/adminRoutes.d.ts +1 -1
- package/dist/routes/index.js +11 -8
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/routes.d.ts +1 -1
- package/dist/setup/setup.js +5 -5
- package/dist/setup/setup.js.map +1 -1
- package/dist/stores/dashboardStore/dashboardStore.d.ts +1 -1
- package/dist/stores/uploadStore/index.js +2 -2
- package/dist/stores/uploadStore/index.js.map +1 -1
- package/dist/stores/uploadStore/uploadStore.d.ts +1 -1
- package/dist/stores/userProfileStore/index.js +2 -2
- package/dist/stores/userProfileStore/index.js.map +1 -1
- package/dist/theme/demoTheme/index.js +2 -2
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/CaseDbDataUtil/CaseDbDataUtil.d.ts +1 -1
- package/dist/utils/CaseDbDataUtil/index.js +1 -1
- package/dist/utils/CaseDbDataUtil/index.js.map +1 -1
- package/dist/utils/CaseDbStandardConfigUtil/index.js +2488 -1408
- package/dist/utils/CaseDbStandardConfigUtil/index.js.map +1 -1
- package/dist/utils/CaseDbTableUtil/CaseDbTableUtil.d.ts +1 -1
- package/dist/utils/CaseDbTableUtil/index.js +1 -1
- package/dist/utils/CaseDbTableUtil/index.js.map +1 -1
- package/dist/utils/CaseSelectionUtil/index.js.map +1 -1
- package/dist/utils/CaseTypeFormUtil/CaseTypeFormUtil.d.ts +1 -1
- package/dist/utils/CaseTypeFormUtil/index.js +7 -10
- package/dist/utils/CaseTypeFormUtil/index.js.map +1 -1
- package/dist/utils/CaseTypeUtil/index.js +1 -1
- package/dist/utils/CaseTypeUtil/index.js.map +1 -1
- package/dist/utils/CaseUtil/index.js +3 -3
- package/dist/utils/CaseUtil/index.js.map +1 -1
- package/dist/utils/DashboardUtil/index.js +1 -1
- package/dist/utils/DashboardUtil/index.js.map +1 -1
- package/dist/utils/DataSetUtil/index.js.map +1 -1
- package/dist/utils/FileUtil/index.js +1 -1
- package/dist/utils/FileUtil/index.js.map +1 -1
- package/dist/utils/FilterUtil/FilterUtil.d.ts +2 -2
- package/dist/utils/HistogramUtil/index.js +1 -1
- package/dist/utils/HistogramUtil/index.js.map +1 -1
- package/dist/utils/MapUtil/index.js +1 -1
- package/dist/utils/MapUtil/index.js.map +1 -1
- package/dist/utils/StratificationUtil/index.js +3 -2
- package/dist/utils/StratificationUtil/index.js.map +1 -1
- package/dist/utils/UploadUtil/UploadUtil.d.ts +1 -1
- package/package.json +11 -11
- package/dist/_chunks/chunk-KS7C4IRE.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.js","names":["l","y","d"],"sources":["../../src/components/ui/RemoveFindSimilarCasesResultDialog/RemoveFindSimilarCasesResultDialog.tsx","../../src/components/ui/Dashboard/DashboardGeneralSettingsForm.tsx","../../src/components/ui/Dashboard/DashboardLayoutSettingsForm.tsx","../../src/components/ui/Dashboard/DashboardWidgetSettingsForm.tsx","../../src/components/ui/Dashboard/DashboardSettingsSidebarItem.tsx","../../../../node_modules/.pnpm/react-error-boundary@6.1.2_react@19.2.7/node_modules/react-error-boundary/dist/react-error-boundary.js","../../src/components/ui/Dashboard/DashboardZoneContext.ts","../../src/components/ui/Dashboard/DashboardWidgetPlaceHolder.tsx","../../src/components/ui/Dashboard/DashboardLayoutRenderer.tsx","../../src/components/ui/Dashboard/DashboardDownloadSidebarItem.tsx","../../../../node_modules/.pnpm/fuse.js@7.4.2/node_modules/fuse.js/dist/fuse.mjs","../../src/components/ui/Dashboard/DashboardSearchSettings.tsx","../../src/components/ui/Dashboard/DashboardSearch.tsx","../../src/components/ui/Dashboard/DashboardContent.tsx","../../src/components/ui/Dashboard/context/DashboardContextProvider.tsx","../../src/components/ui/Dashboard/Dashboard.tsx","../../src/components/ui/Dashboard/DashboardWidget.tsx"],"sourcesContent":["import {\n use,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport type { ReactElement } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport { useStore } from 'zustand';\nimport { produce } from 'immer';\nimport type { CaseDbCompleteCaseType } from '@gen-epix/api-casedb';\nimport type { DialogAction } from '@gen-epix/ui/components/ui/Dialog';\nimport type { Step } from '@gen-epix/ui/components/ui/Stepper';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui/hoc/withDialog';\nimport {\n Stepper,\n STEPPER_DIRECTION,\n} from '@gen-epix/ui/components/ui/Stepper';\nimport { withDialog } from '@gen-epix/ui/hoc/withDialog';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { TreeWidgetUtil } from '../../../utils/TreeWidgetUtil';\n\n\nexport interface RemoveFindSimilarCasesResultDialogOpenProps {\n completeCaseType: CaseDbCompleteCaseType;\n}\n\nexport interface RemoveFindSimilarCasesResultDialogProps extends WithDialogRenderProps<RemoveFindSimilarCasesResultDialogOpenProps> {\n //\n}\n\nexport type RemoveFindSimilarCasesResultDialogRefMethods = WithDialogRefMethods<RemoveFindSimilarCasesResultDialogProps, RemoveFindSimilarCasesResultDialogOpenProps>;\n\nexport const RemoveFindSimilarCasesResultDialog = withDialog<RemoveFindSimilarCasesResultDialogProps, RemoveFindSimilarCasesResultDialogOpenProps>((\n {\n onActionsChange,\n onClose,\n onTitleChange,\n openProps,\n }: RemoveFindSimilarCasesResultDialogProps,\n): ReactElement => {\n const { t } = useTranslation();\n const formId = useId();\n const dashboardStore = use(DashboardStoreContext);\n const setFindSimilarCasesResults = useStore(dashboardStore, (state) => state.setFindSimilarCasesResults);\n const treeConfigurations = useMemo(() => TreeWidgetUtil.getTreeConfigurations(openProps.completeCaseType), [openProps.completeCaseType]);\n const findSimilarCasesResults = useStore(dashboardStore, (state) => state.findSimilarCasesResults);\n const [intermediateFindSimilarCasesResults, setIntermediateFindSimilarCasesResults] = useState(findSimilarCasesResults);\n\n useEffect(() => {\n onTitleChange(t`Remove similar cases from results`);\n }, [t, onTitleChange]);\n\n const onApplyIntermediateResultsButtonClick = useCallback(() => {\n void setFindSimilarCasesResults(intermediateFindSimilarCasesResults);\n onClose();\n\n }, [setFindSimilarCasesResults, intermediateFindSimilarCasesResults, onClose]);\n\n const onUndoButtonClick = useCallback(() => {\n setIntermediateFindSimilarCasesResults(findSimilarCasesResults);\n }, [findSimilarCasesResults]);\n\n const onRemoveAllAndCloseButtonClick = useCallback(() => {\n void setFindSimilarCasesResults([]);\n onClose();\n }, [setFindSimilarCasesResults, onClose]);\n\n useEffect(() => {\n const actions: DialogAction[] = [];\n actions.push({\n ...TestIdUtil.createAttributes('RemoveFindSimilarCasesResultDialog-closeButton'),\n color: 'primary',\n label: t`Close`,\n onClick: onClose,\n variant: 'outlined',\n });\n if (findSimilarCasesResults.length !== intermediateFindSimilarCasesResults.length) {\n actions.push({\n ...TestIdUtil.createAttributes('RemoveFindSimilarCasesResultDialog-undoButton'),\n color: 'secondary',\n label: t`Undo`,\n onClick: onUndoButtonClick,\n variant: 'outlined',\n });\n }\n if (findSimilarCasesResults.length !== intermediateFindSimilarCasesResults.length) {\n actions.push({\n ...TestIdUtil.createAttributes('RemoveFindSimilarCasesResultDialog-applyButton'),\n color: 'secondary',\n label: t`Apply and close`,\n onClick: onApplyIntermediateResultsButtonClick,\n variant: 'contained',\n });\n }\n onActionsChange(actions);\n }, [formId, onActionsChange, onClose, t, findSimilarCasesResults, intermediateFindSimilarCasesResults, onApplyIntermediateResultsButtonClick, onUndoButtonClick]);\n\n const onRemoveCasesButtonClick = useCallback((index: number) => {\n setIntermediateFindSimilarCasesResults(produce(intermediateFindSimilarCasesResults, draft => {\n draft.splice(index, 1);\n return draft;\n }));\n }, [intermediateFindSimilarCasesResults]);\n\n const steps = useMemo((): Step[] => {\n return [\n {\n content: (\n <Box\n sx={{\n marginBottom: 2,\n marginTop: 1,\n }}\n >\n <Button\n color={'primary'}\n onClick={onRemoveAllAndCloseButtonClick}\n variant={'outlined'}\n >\n {t('Remove all similar cases from result')}\n </Button>\n </Box>\n ),\n index: '',\n key: 'start',\n label: t('Result without similar cases ({{numberOfCases}} cases)', {\n numberOfCases: findSimilarCasesResults?.[0]?.originalCaseIds.length || 0,\n }),\n },\n ...intermediateFindSimilarCasesResults.map((item, index) => ({\n content: (\n <Box>\n <Box component={'ul'}>\n <Box component={'li'}>\n {t('Tree: {{treeLabel}}', {\n treeLabel: treeConfigurations.find((config) => config.col.id === item.colId)?.col?.label || item.colId,\n })}\n </Box>\n <Box component={'li'}>\n {t('Distance: {{distance}}', {\n distance: item.distance,\n })}\n </Box>\n <Box component={'li'}>\n {t('Found similar cases: {{foundCases}}', {\n foundCases: item.similarCaseIds.length,\n })}\n </Box>\n <Box component={'li'}>\n {t('New number of cases: {{numberOfCases}}', {\n numberOfCases: item.similarCaseIds.length + item.originalCaseIds.length,\n })}\n </Box>\n </Box>\n <Box\n sx={{\n marginBottom: 2,\n marginTop: 1,\n }}\n >\n <Button\n color={'primary'}\n disabled={index !== intermediateFindSimilarCasesResults.length - 1}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => onRemoveCasesButtonClick(index)}\n variant={'outlined'}\n >\n {t('Remove')}\n </Button>\n </Box>\n </Box>\n ),\n index: (index + 1).toString(),\n key: item.key,\n label: t('Searched {{numberOfInputCases}} cases for similar cases.', {\n numberOfInputCases: item.originalCaseIds.length,\n }),\n }))];\n }, [findSimilarCasesResults, intermediateFindSimilarCasesResults, onRemoveAllAndCloseButtonClick, onRemoveCasesButtonClick, t, treeConfigurations]);\n\n return (\n <Box\n sx={{\n position: 'relative',\n }}\n >\n {steps.length === 0 && (\n <Typography>\n {t('No similar cases results to remove.')}\n </Typography>\n )}\n {steps.length > 0 && (\n <Stepper\n activeStep={steps[steps.length - 1].key}\n direction={STEPPER_DIRECTION.VERTICAL}\n hideCompletedIndicator\n steps={steps}\n />\n )}\n </Box>\n );\n\n}, {\n defaultTitle: '',\n fullWidth: true,\n maxWidth: 'lg',\n testId: 'RemoveFindSimilarCasesResultDialog',\n});\n","import {\n Box,\n Button,\n FormGroup,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport RestartAltIcon from '@mui/icons-material/RestartAlt';\nimport {\n FormProvider,\n useForm,\n useWatch,\n} from 'react-hook-form';\nimport {\n use,\n useCallback,\n useEffect,\n} from 'react';\nimport { useStore } from 'zustand';\nimport { useShallow } from 'zustand/shallow';\nimport { Switch } from '@gen-epix/ui-form/components/fields/Switch';\n\nimport type { DashboardGeneralSettings } from '../../../stores/userProfileStore';\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\n\nexport const DashboardGeneralSettingsForm = () => {\n const { t } = useTranslation();\n const userProfileStore = use(UserProfileStoreContext);\n\n const resetDashboardGeneralSettings = useStore(userProfileStore, useShallow((state) => state.resetDashboardGeneralSettings));\n const dashboardGeneralSettings = useStore(userProfileStore, useShallow((state) => state.dashboardGeneralSettings));\n const setDashboardGeneralSettings = useStore(userProfileStore, useShallow((state) => state.setDashboardGeneralSettings));\n\n const formMethods = useForm<DashboardGeneralSettings>({\n defaultValues: dashboardGeneralSettings,\n values: dashboardGeneralSettings,\n });\n const { control } = formMethods;\n\n const formValues = useWatch({ control });\n\n const onResetButtonClick = useCallback(() => {\n resetDashboardGeneralSettings();\n }, [resetDashboardGeneralSettings]);\n\n useEffect(() => {\n setDashboardGeneralSettings(formValues as DashboardGeneralSettings);\n }, [formValues, setDashboardGeneralSettings]);\n\n const onSubmit = useCallback(() => {\n // noop, as the form only contains switches that update the state on change\n }, []);\n\n return (\n <FormProvider {...formMethods}>\n <form\n autoComplete={'off'}\n onSubmit={onSubmit}\n >\n <Box\n sx={{\n marginY: 1,\n }}\n >\n <FormGroup>\n <Switch<DashboardGeneralSettings>\n label={t`Enable highlighting across widgets`}\n name={'isHighlightingEnabled'}\n />\n </FormGroup>\n </Box>\n </form>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <Box\n sx={{\n marginX: 1,\n }}\n >\n <Button\n color={'primary'}\n onClick={onResetButtonClick}\n startIcon={<RestartAltIcon />}\n variant={'outlined'}\n >\n {t`Reset general settings`}\n </Button>\n </Box>\n </Box>\n </FormProvider>\n );\n};\n","import {\n Box,\n Button,\n FormGroup,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport RestartAltIcon from '@mui/icons-material/RestartAlt';\nimport {\n FormProvider,\n useForm,\n useWatch,\n} from 'react-hook-form';\nimport {\n use,\n useCallback,\n useEffect,\n} from 'react';\nimport { useStore } from 'zustand';\nimport { useShallow } from 'zustand/shallow';\nimport { ConfigService } from '@gen-epix/ui/classes/services/ConfigService';\nimport noop from 'lodash/noop';\n\nimport { ArrangementEditor } from '../../form/fields/ArrangementEditor';\nimport type { CaseDbConfig } from '../../../models/config';\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\nimport { DashboardUtil } from '../../../utils/DashboardUtil';\n\nexport type DashboardLayoutSettingsFormProps = {\n readonly onReset: () => void;\n};\n\ntype FormValues = {\n arrangementKey: string;\n};\n\nexport const DashboardLayoutSettingsForm = ({ onReset }: DashboardLayoutSettingsFormProps) => {\n const { t } = useTranslation();\n const userProfileStore = use(UserProfileStoreContext);\n\n const resetDashboardLayout = useStore(userProfileStore, useShallow((state) => state.resetDashboardLayout));\n const dashboardArrangementConfig = useStore(userProfileStore, useShallow((state) => state.dashboardArrangementConfig));\n const setDashboardLayoutUserConfig = useStore(userProfileStore, useShallow((state) => state.setDashboardArrangementConfig));\n\n const formMethods = useForm<FormValues>({\n values: {\n arrangementKey: dashboardArrangementConfig.arrangementKey,\n },\n });\n const { control } = formMethods;\n\n const formValues = useWatch({ control });\n\n const onResetButtonClick = useCallback(() => {\n resetDashboardLayout();\n if (onReset) {\n onReset();\n }\n }, [onReset, resetDashboardLayout]);\n\n useEffect(() => {\n const { arrangementKey } = formValues;\n if (!arrangementKey) {\n return;\n }\n const arrangementOptions = ConfigService.getInstance<CaseDbConfig>().config.dashboard.ARRANGEMENT_OPTIONS;\n const arrangement = arrangementOptions[arrangementKey];\n if (!arrangement) {\n return;\n }\n\n setDashboardLayoutUserConfig({\n arrangementKey,\n arrangementWidgetAssignments: DashboardUtil.getArrangementWidgetAssignments(arrangement, ConfigService.getInstance<CaseDbConfig>().config.dashboard.DEFAULT_WIDGET_ASSIGNMENTS[arrangementKey]),\n });\n }, [formValues, setDashboardLayoutUserConfig]);\n\n const onSubmit = noop;\n\n return (\n <FormProvider {...formMethods}>\n <form\n autoComplete={'off'}\n onSubmit={onSubmit}\n >\n <Box\n sx={{\n marginY: 1,\n }}\n >\n <FormGroup>\n <ArrangementEditor\n label={t`Arrangement`}\n name={'arrangementKey'}\n options={ConfigService.getInstance<CaseDbConfig>().config.dashboard.ARRANGEMENT_OPTIONS}\n />\n </FormGroup>\n </Box>\n </form>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <Box\n sx={{\n marginX: 1,\n }}\n >\n <Button\n color={'primary'}\n onClick={onResetButtonClick}\n startIcon={<RestartAltIcon />}\n variant={'outlined'}\n >\n {t`Reset dashboard layout`}\n </Button>\n </Box>\n </Box>\n </FormProvider>\n );\n};\n","import {\n Box,\n Button,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport RestartAltIcon from '@mui/icons-material/RestartAlt';\nimport type { FieldValues } from 'react-hook-form';\nimport {\n useForm,\n useWatch,\n} from 'react-hook-form';\nimport {\n use,\n useCallback,\n useEffect,\n useId,\n useMemo,\n} from 'react';\nimport { useStore } from 'zustand';\nimport { useShallow } from 'zustand/shallow';\nimport { ConfigService } from '@gen-epix/ui/classes/services/ConfigService';\nimport { GenericForm } from '@gen-epix/ui-form/components/helpers/GenericForm';\nimport { FormUtil } from '@gen-epix/ui-form/utils/FormUtil';\n\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\nimport type { CaseDbConfig } from '../../../models/config';\n\nexport type DashboardEpiCurveSettingsFormProps = {\n readonly widgetName: string;\n};\n\nexport const DashboardWidgetSettingsForm = ({ widgetName }: DashboardEpiCurveSettingsFormProps) => {\n const { t } = useTranslation();\n const userProfileStore = use(UserProfileStoreContext);\n const formId = useId();\n\n const resetWidgetSettings = useStore(userProfileStore, useShallow((state) => state.resetWidgetSettings));\n const setWidgetSettings = useStore(userProfileStore, useShallow((state) => state.setWidgetSettings));\n const formFieldDefinitions = ConfigService.getInstance<CaseDbConfig>().config.dashboard.WIDGETS[widgetName].configFormFieldsDefinitions;\n const defaultFormValues = ConfigService.getInstance<CaseDbConfig>().config.dashboard.WIDGETS[widgetName].configDefaultValues;\n\n const schema = useMemo(() => {\n if (!formFieldDefinitions) {\n return undefined;\n }\n return FormUtil.createYupSchemaFromFormFieldDefinitions(formFieldDefinitions);\n }, [formFieldDefinitions]);\n\n const formMethods = useForm<FieldValues>({\n defaultValues: defaultFormValues,\n values: defaultFormValues,\n });\n const { control } = formMethods;\n\n const formValues = useWatch({ control });\n\n const onResetButtonClick = useCallback(() => {\n resetWidgetSettings(widgetName);\n }, [resetWidgetSettings, widgetName]);\n\n useEffect(() => {\n setWidgetSettings(widgetName, formValues);\n }, [formValues, setWidgetSettings, widgetName]);\n\n const onSubmit = useCallback(() => {\n // No submit action needed since changes are applied immediately\n }, []);\n\n return (\n <Box>\n <Box\n sx={{\n marginY: 1,\n }}\n >\n <GenericForm<FieldValues>\n formFieldDefinitions={formFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={onSubmit}\n schema={schema}\n />\n </Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <Box\n sx={{\n marginX: 1,\n }}\n >\n <Button\n color={'primary'}\n onClick={onResetButtonClick}\n startIcon={<RestartAltIcon />}\n variant={'outlined'}\n >\n {t('Reset {widgetName} settings', { widgetName })}\n </Button>\n </Box>\n </Box>\n </Box>\n );\n};\n","import {\n Box,\n Divider,\n Typography,\n useTheme,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport SettingsIcon from '@mui/icons-material/Settings';\nimport { useMemo } from 'react';\nimport type { SidebarItemSharedProps } from '@gen-epix/ui/components/ui/Sidebar';\nimport { ConfigService } from '@gen-epix/ui/classes/services/ConfigService';\nimport { SidebarItem } from '@gen-epix/ui/components/ui/Sidebar';\n\nimport type { CaseDbConfig } from '../../../models/config';\n\nimport { DashboardGeneralSettingsForm } from './DashboardGeneralSettingsForm';\nimport { DashboardLayoutSettingsForm } from './DashboardLayoutSettingsForm';\nimport { DashboardWidgetSettingsForm } from './DashboardWidgetSettingsForm';\n\nexport type DashboardSettingsSidebarItemProps = {\n readonly onReset: () => void;\n} & SidebarItemSharedProps;\ntype DashboardSettingsSidebarItemContentProps = Pick<DashboardSettingsSidebarItemProps, 'onReset'>;\n\nexport const DashboardSettingsSidebarItemIcon = SettingsIcon;\n\nconst DashboardSettingsSidebarItemContent = ({ onReset }: DashboardSettingsSidebarItemContentProps) => {\n const theme = useTheme();\n const { t } = useTranslation();\n\n const items = useMemo(() => {\n const x = [\n {\n component: <DashboardLayoutSettingsForm onReset={onReset} />,\n label: t`Dashboard layout`,\n },\n {\n component: <DashboardGeneralSettingsForm />,\n label: t`General`,\n },\n ];\n Object.entries(ConfigService.getInstance<CaseDbConfig>().config.dashboard.WIDGETS).forEach(([widgetName, widgetConfig]) => {\n if (widgetConfig.configFormFieldsDefinitions) {\n x.push({\n component: <DashboardWidgetSettingsForm widgetName={widgetName} />,\n label: widgetConfig.widgetLabel,\n });\n }\n });\n return x;\n }, [onReset, t]);\n\n return (\n <Box\n sx={{\n width: theme.spacing(59),\n }}\n >\n {items.map(({ component, label }, index) => (\n <Box\n key={label}\n sx={{\n marginTop: index !== 0 ? 2 : 0,\n paddingTop: index !== items.length - 1 ? 1 : 0,\n }}\n >\n <Box\n sx={{\n marginBottom: 2,\n }}\n >\n <Typography variant={'h5'}>\n {label}\n </Typography>\n </Box>\n <Box\n sx={{\n marginBottom: 2,\n marginRight: 1,\n }}\n >\n {component}\n </Box>\n <Divider\n flexItem\n orientation={'horizontal'}\n sx={{\n marginLeft: 0,\n marginRight: 1,\n }}\n variant={'middle'}\n />\n </Box>\n ))}\n </Box>\n );\n};\n\n// eslint-disable-next-line @eslint-react/kit/no-multi-comp\nexport const DashboardSettingsSidebarItem = ({ onClose, onReset, open }: DashboardSettingsSidebarItemProps) => {\n const { t } = useTranslation();\n\n return (\n <SidebarItem\n closeIcon={<DashboardSettingsSidebarItemIcon />}\n closeIconTooltipText={t`Close settings`}\n onClose={onClose}\n open={open}\n testIdAttributes={{ name: 'DashboardSettingsSidebarItem' }}\n title={t`Settings`}\n width={60}\n >\n {open && <DashboardSettingsSidebarItemContent onReset={onReset} />}\n </SidebarItem>\n );\n};\n","\"use client\";\nimport { createContext as l, Component as y, createElement as d, useContext as f, useState as p, useMemo as E, forwardRef as B } from \"react\";\nconst h = l(null), c = {\n didCatch: !1,\n error: null\n};\nclass m extends y {\n constructor(e) {\n super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = c;\n }\n static getDerivedStateFromError(e) {\n return { didCatch: !0, error: e };\n }\n resetErrorBoundary(...e) {\n const { error: t } = this.state;\n t !== null && (this.props.onReset?.({\n args: e,\n reason: \"imperative-api\"\n }), this.setState(c));\n }\n componentDidCatch(e, t) {\n this.props.onError?.(e, t);\n }\n componentDidUpdate(e, t) {\n const { didCatch: o } = this.state, { resetKeys: s } = this.props;\n o && t.error !== null && C(e.resetKeys, s) && (this.props.onReset?.({\n next: s,\n prev: e.resetKeys,\n reason: \"keys\"\n }), this.setState(c));\n }\n render() {\n const { children: e, fallbackRender: t, FallbackComponent: o, fallback: s } = this.props, { didCatch: n, error: a } = this.state;\n let i = e;\n if (n) {\n const u = {\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof t == \"function\")\n i = t(u);\n else if (o)\n i = d(o, u);\n else if (s !== void 0)\n i = s;\n else\n throw a;\n }\n return d(\n h.Provider,\n {\n value: {\n didCatch: n,\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n }\n },\n i\n );\n }\n}\nfunction C(r = [], e = []) {\n return r.length !== e.length || r.some((t, o) => !Object.is(t, e[o]));\n}\nfunction g(r) {\n return r !== null && typeof r == \"object\" && \"didCatch\" in r && typeof r.didCatch == \"boolean\" && \"error\" in r && \"resetErrorBoundary\" in r && typeof r.resetErrorBoundary == \"function\";\n}\nfunction x(r) {\n if (!g(r))\n throw new Error(\"ErrorBoundaryContext not found\");\n}\nfunction k() {\n const r = f(h);\n x(r);\n const { error: e, resetErrorBoundary: t } = r, [o, s] = p({\n error: null,\n hasError: !1\n }), n = E(\n () => ({\n error: e,\n resetBoundary: () => {\n t(), s({ error: null, hasError: !1 });\n },\n showBoundary: (a) => s({\n error: a,\n hasError: !0\n })\n }),\n [e, t]\n );\n if (o.hasError)\n throw o.error;\n return n;\n}\nfunction S(r) {\n switch (typeof r) {\n case \"object\": {\n if (r !== null && \"message\" in r && typeof r.message == \"string\")\n return r.message;\n break;\n }\n case \"string\":\n return r;\n }\n}\nfunction w(r, e) {\n const t = B(\n (s, n) => d(\n m,\n e,\n d(r, { ...s, ref: n })\n )\n ), o = r.displayName || r.name || \"Unknown\";\n return t.displayName = `withErrorBoundary(${o})`, t;\n}\nexport {\n m as ErrorBoundary,\n h as ErrorBoundaryContext,\n S as getErrorMessage,\n k as useErrorBoundary,\n w as withErrorBoundary\n};\n//# sourceMappingURL=react-error-boundary.js.map\n","import { createContext } from 'react';\n\nexport const DashboardZoneContext = createContext<null | string>(null);\n","import {\n Box,\n Button,\n Menu,\n MenuItem,\n} from '@mui/material';\nimport WidgetsIcon from '@mui/icons-material/Widgets';\nimport { useTranslation } from 'react-i18next';\nimport type { MouseEvent } from 'react';\nimport {\n use,\n useCallback,\n useState,\n} from 'react';\nimport { useStore } from 'zustand';\nimport { ConfigService } from '@gen-epix/ui/classes/services/ConfigService';\n\nimport type { CaseDbConfig } from '../../../models/config';\nimport { DashboardUtil } from '../../../utils/DashboardUtil';\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\n\nimport { DashboardZoneContext } from './DashboardZoneContext';\n\nexport const DashboardWidgetPlaceHolder = () => {\n const { t } = useTranslation();\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n\n const userProfileStore = use(UserProfileStoreContext);\n const zoneName = use(DashboardZoneContext);\n const dashboardArrangementConfig = useStore(userProfileStore, (state) => state.dashboardArrangementConfig);\n const setDashboardArrangementConfig = useStore(userProfileStore, (state) => state.setDashboardArrangementConfig);\n\n const widgetsConfig = ConfigService.getInstance<CaseDbConfig>().config.dashboard.WIDGETS;\n const availableWidgets = zoneName\n ? DashboardUtil.getAvailableWidgets(dashboardArrangementConfig, zoneName, widgetsConfig)\n : [];\n\n const onButtonClick = useCallback((event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n }, []);\n\n const onMenuClose = useCallback(() => {\n setAnchorEl(null);\n }, []);\n\n const onWidgetSelect = useCallback((widgetName: string) => {\n if (!zoneName) {\n return;\n }\n const { dashboardArrangementConfig: config } = userProfileStore.getState();\n setDashboardArrangementConfig({\n ...config,\n arrangementWidgetAssignments: {\n ...config.arrangementWidgetAssignments,\n [zoneName]: widgetName,\n },\n });\n setAnchorEl(null);\n }, [setDashboardArrangementConfig, userProfileStore, zoneName]);\n\n const onWidgetMenuItemClick = useCallback((event: MouseEvent<HTMLLIElement>) => {\n const widgetName = (event.currentTarget as HTMLElement).dataset['widgetName'];\n if (widgetName) {\n onWidgetSelect(widgetName);\n }\n }, [onWidgetSelect]);\n\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n }}\n >\n <Button\n onClick={onButtonClick}\n startIcon={<WidgetsIcon />}\n variant={'outlined'}\n >\n {t('Add a widget')}\n </Button>\n <Menu\n anchorEl={anchorEl}\n onClose={onMenuClose}\n open={Boolean(anchorEl)}\n >\n {availableWidgets.length === 0 && (\n <MenuItem disabled>\n {t('No widgets available')}\n </MenuItem>\n )}\n {availableWidgets.map(widgetName => (\n <MenuItem\n data-widget-name={widgetName}\n key={widgetName}\n onClick={onWidgetMenuItemClick}\n >\n {widgetsConfig[widgetName].widgetLabel}\n </MenuItem>\n ))}\n </Menu>\n </Box>\n );\n};\n","import type {\n ReactElement,\n Ref,\n} from 'react';\nimport {\n createElement,\n Fragment,\n use,\n useImperativeHandle,\n useMemo,\n} from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport type { LayoutStorage } from 'react-resizable-panels';\nimport {\n Group,\n Panel,\n useDefaultLayout,\n useGroupRef,\n} from 'react-resizable-panels';\nimport type { StoreApi } from 'zustand';\nimport { useStore } from 'zustand';\nimport { ConfigService } from '@gen-epix/ui/classes/services/ConfigService';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { DashboardUtil } from '../../../utils/DashboardUtil';\nimport type { CaseDbConfig } from '../../../models/config';\nimport {\n PanelSeparatorHorizontal,\n PanelSeparatorVertical,\n} from '../PanelSeparator';\nimport { WidgetUnavailable } from '../WidgetUnavailable';\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\nimport type { UserProfileStore } from '../../../stores/userProfileStore';\nimport type { DashboardArrangement } from '../../../models/dashboard';\n\nimport { DashboardZoneContext } from './DashboardZoneContext';\nimport { DashboardWidgetPlaceHolder } from './DashboardWidgetPlaceHolder';\n\n// Maximum number of resizable groups supported simultaneously = 16.\n// With a 9-widget maximum, the DFS group tree has at most 9 internal nodes;\n// 16 gives headroom for any configuration.\nexport type DashboardLayoutRendererProps = {\n readonly disabled?: boolean;\n readonly ref?: Ref<ForwardRefDashboardLayoutRendererRefMethods>;\n};\n\nconst panelStorageFactory = (userProfileStore: StoreApi<UserProfileStore>, panelNamePrefix: string): LayoutStorage => ({\n getItem: (name: string) => {\n return userProfileStore.getState().dashboardPanels[`${panelNamePrefix}-${name}`];\n },\n setItem: (name: string, value: string) => {\n userProfileStore.getState().setDashboardPanelConfiguration(`${panelNamePrefix}-${name}`, value);\n },\n});\n\nexport type ForwardRefDashboardLayoutRendererRefMethods = {\n reset: () => void;\n};\n\nexport const DashboardLayoutRenderer = ({\n disabled,\n ref,\n}: DashboardLayoutRendererProps) => {\n const userProfileStore = use(UserProfileStoreContext);\n const dashboardStore = use(DashboardStoreContext);\n const dashboardArrangementConfig = useStore(userProfileStore, (state) => state.dashboardArrangementConfig);\n const expandedZone = useStore(dashboardStore, (state) => state.expandedZone);\n const { MIN_PANEL_HEIGHT, MIN_PANEL_WIDTH } = ConfigService.getInstance<CaseDbConfig>().config.dashboard;\n\n const { arrangementKey, arrangementWidgetAssignments } = dashboardArrangementConfig;\n const arrangement = ConfigService.getInstance<CaseDbConfig>().config.dashboard.ARRANGEMENT_OPTIONS[arrangementKey];\n\n const storagePrefix = arrangementKey;\n\n const groupInfos = useMemo(\n () => arrangement?.cells ? DashboardUtil.getArrangementGroupInfos(arrangement, storagePrefix) : [],\n [arrangement, storagePrefix],\n );\n\n const storage = useMemo(\n () => panelStorageFactory(userProfileStore, 'epi-dashboard'),\n [userProfileStore],\n );\n\n // Pre-call MAX_GROUPS useDefaultLayout hooks (hooks must be called unconditionally).\n // Each is indexed by DFS traversal order to match getArrangementGroupInfos.\n const groupLayout0 = useDefaultLayout({ groupId: groupInfos[0]?.groupId ?? `${storagePrefix}-ph-0`, storage });\n const groupLayout1 = useDefaultLayout({ groupId: groupInfos[1]?.groupId ?? `${storagePrefix}-ph-1`, storage });\n const groupLayout2 = useDefaultLayout({ groupId: groupInfos[2]?.groupId ?? `${storagePrefix}-ph-2`, storage });\n const groupLayout3 = useDefaultLayout({ groupId: groupInfos[3]?.groupId ?? `${storagePrefix}-ph-3`, storage });\n const groupLayout4 = useDefaultLayout({ groupId: groupInfos[4]?.groupId ?? `${storagePrefix}-ph-4`, storage });\n const groupLayout5 = useDefaultLayout({ groupId: groupInfos[5]?.groupId ?? `${storagePrefix}-ph-5`, storage });\n const groupLayout6 = useDefaultLayout({ groupId: groupInfos[6]?.groupId ?? `${storagePrefix}-ph-6`, storage });\n const groupLayout7 = useDefaultLayout({ groupId: groupInfos[7]?.groupId ?? `${storagePrefix}-ph-7`, storage });\n const groupLayout8 = useDefaultLayout({ groupId: groupInfos[8]?.groupId ?? `${storagePrefix}-ph-8`, storage });\n const groupLayout9 = useDefaultLayout({ groupId: groupInfos[9]?.groupId ?? `${storagePrefix}-ph-9`, storage });\n const groupLayout10 = useDefaultLayout({ groupId: groupInfos[10]?.groupId ?? `${storagePrefix}-ph-10`, storage });\n const groupLayout11 = useDefaultLayout({ groupId: groupInfos[11]?.groupId ?? `${storagePrefix}-ph-11`, storage });\n const groupLayout12 = useDefaultLayout({ groupId: groupInfos[12]?.groupId ?? `${storagePrefix}-ph-12`, storage });\n const groupLayout13 = useDefaultLayout({ groupId: groupInfos[13]?.groupId ?? `${storagePrefix}-ph-13`, storage });\n const groupLayout14 = useDefaultLayout({ groupId: groupInfos[14]?.groupId ?? `${storagePrefix}-ph-14`, storage });\n const groupLayout15 = useDefaultLayout({ groupId: groupInfos[15]?.groupId ?? `${storagePrefix}-ph-15`, storage });\n\n // Pre-call MAX_GROUPS useGroupRef hooks for imperative reset support.\n const groupRef0 = useGroupRef();\n const groupRef1 = useGroupRef();\n const groupRef2 = useGroupRef();\n const groupRef3 = useGroupRef();\n const groupRef4 = useGroupRef();\n const groupRef5 = useGroupRef();\n const groupRef6 = useGroupRef();\n const groupRef7 = useGroupRef();\n const groupRef8 = useGroupRef();\n const groupRef9 = useGroupRef();\n const groupRef10 = useGroupRef();\n const groupRef11 = useGroupRef();\n const groupRef12 = useGroupRef();\n const groupRef13 = useGroupRef();\n const groupRef14 = useGroupRef();\n const groupRef15 = useGroupRef();\n\n const allGroupLayouts = [\n groupLayout0, groupLayout1, groupLayout2, groupLayout3,\n groupLayout4, groupLayout5, groupLayout6, groupLayout7,\n groupLayout8, groupLayout9, groupLayout10, groupLayout11,\n groupLayout12, groupLayout13, groupLayout14, groupLayout15,\n ];\n\n const allGroupRefs = useMemo(() => [\n groupRef0, groupRef1, groupRef2, groupRef3,\n groupRef4, groupRef5, groupRef6, groupRef7,\n groupRef8, groupRef9, groupRef10, groupRef11,\n groupRef12, groupRef13, groupRef14, groupRef15,\n ], [groupRef0, groupRef1, groupRef2, groupRef3, groupRef4, groupRef5, groupRef6, groupRef7, groupRef8, groupRef9, groupRef10, groupRef11, groupRef12, groupRef13, groupRef14, groupRef15]);\n\n useImperativeHandle(ref, () => ({\n reset: () => {\n try {\n allGroupRefs.forEach((groupRef) => {\n if (groupRef.current) {\n const layout = groupRef.current.getLayout();\n const ids = Object.keys(layout);\n if (ids.length > 0) {\n const equalSize = 100 / ids.length;\n groupRef.current.setLayout(Object.fromEntries(ids.map((id) => [id, equalSize])));\n }\n }\n });\n } catch (_error) {\n // allow to fail (it doesn't change functionality)\n }\n },\n }), [allGroupRefs]);\n\n const panelMap = useMemo(() => {\n const widgetsConfig = ConfigService.getInstance<CaseDbConfig>().config.dashboard.WIDGETS;\n return Object.fromEntries(\n Object.entries(widgetsConfig).map(([widgetName, { component, widgetLabel }]) => [\n widgetName,\n <ErrorBoundary\n fallback={<WidgetUnavailable widgetLabel={widgetLabel} />}\n key={widgetName}\n >\n {createElement(component)}\n </ErrorBoundary>,\n ]),\n );\n }, []);\n\n if (expandedZone) {\n const widgetName = arrangementWidgetAssignments[expandedZone];\n return (\n <DashboardZoneContext value={expandedZone}>\n {panelMap[widgetName as keyof typeof panelMap] ?? null}\n </DashboardZoneContext>\n );\n }\n\n if (!arrangement?.cells) {\n return null;\n }\n\n // counter.value increments with each group visited in DFS pre-order,\n // matching the order produced by DashboardUtil.getArrangementGroupInfos.\n const counter = { value: 0 };\n\n const renderArrangement = (arr: DashboardArrangement): ReactElement => {\n const index = counter.value++;\n const groupId = groupInfos[index]?.groupId ?? `${storagePrefix}-group-${index}`;\n const orientation = arr.orientation as 'horizontal' | 'vertical';\n const { defaultLayout, onLayoutChanged } = allGroupLayouts[index] ?? {};\n const groupRef = allGroupRefs[index];\n\n return (\n <Group\n defaultLayout={defaultLayout}\n groupRef={groupRef}\n id={groupId}\n onLayoutChanged={onLayoutChanged}\n orientation={orientation}\n style={{ height: '100%', width: '100%' }}\n >\n {arr.cells.map((cell, cellIndex) => {\n const isLast = cellIndex === arr.cells.length - 1;\n const panelId = `${groupId}-panel-${cellIndex}`;\n\n return (\n <Fragment key={'name' in cell ? cell.name : StringUtil.createHash(JSON.stringify(cell))}>\n <Panel\n defaultSize={cell.size}\n id={panelId}\n minSize={orientation === 'vertical' ? MIN_PANEL_HEIGHT : MIN_PANEL_WIDTH}\n style={{ overflow: 'hidden' }}\n >\n {'name' in cell\n ? (\n <DashboardZoneContext value={cell.name}>\n {panelMap[arrangementWidgetAssignments[cell.name] as keyof typeof panelMap] ?? <DashboardWidgetPlaceHolder />}\n </DashboardZoneContext>\n )\n : renderArrangement(cell)}\n </Panel>\n {!isLast && orientation === 'horizontal' && <PanelSeparatorVertical disabled={disabled} />}\n {!isLast && orientation === 'vertical' && <PanelSeparatorHorizontal disabled={disabled} />}\n </Fragment>\n );\n })}\n </Group>\n );\n };\n\n return renderArrangement(arrangement);\n};\n","import {\n Box,\n Link,\n Typography,\n useTheme,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport DownloadIcon from '@mui/icons-material/Download';\nimport {\n Fragment,\n useCallback,\n useEffect,\n useState,\n} from 'react';\nimport type { SidebarItemSharedProps } from '@gen-epix/ui/components/ui/Sidebar';\nimport { ConfigService } from '@gen-epix/ui/classes/services/ConfigService';\nimport { SidebarItem } from '@gen-epix/ui/components/ui/Sidebar';\n\nimport type {\n DownloadConfig,\n DownloadConfigItem,\n DownloadConfigSection,\n} from '../../../classes/services/EventBusService';\nimport { EventBusService } from '../../../classes/services/EventBusService';\nimport type { CaseDbConfig } from '../../../models/config';\n\n\nexport type DashboardDownloadSidebarItemProps = SidebarItemSharedProps;\n\nexport const DashboardDownloadSidebarItemIcon = DownloadIcon;\n\nconst DashboardDownloadSidebarItemContent = () => {\n const theme = useTheme();\n const { t } = useTranslation();\n const [downloadConfigs, setDownloadConfigs] = useState<DownloadConfig[]>([]);\n\n useEffect(() => {\n const onDownloadOptionsChanged = (payload: DownloadConfig) => {\n if (!payload?.zone) {\n return;\n }\n setDownloadConfigs(prevDownloadOptions => {\n if (payload.items === null) {\n return prevDownloadOptions.filter(item => item.zone !== payload.zone);\n }\n return [\n ...prevDownloadOptions.filter(item => item.zone !== payload.zone),\n payload,\n ].sort((a, b) => {\n return ConfigService.getInstance<CaseDbConfig>().config.dashboard.DOWNLOAD_SECTION_ORDER.indexOf(a.zone) - ConfigService.getInstance<CaseDbConfig>().config.dashboard.DOWNLOAD_SECTION_ORDER.indexOf(b.zone);\n });\n });\n };\n const eventBusService = EventBusService.getInstance();\n eventBusService.addEventListener('onDownloadOptionsChanged', onDownloadOptionsChanged);\n eventBusService.emit('onDownloadOptionsRequested');\n\n return () => {\n eventBusService.removeEventListener('onDownloadOptionsChanged', onDownloadOptionsChanged);\n };\n }, []);\n\n const renderDownloadItem = useCallback((item: DownloadConfigItem, forceDisabled?: boolean) => {\n return (\n <Box\n key={item.label}\n sx={{ marginLeft: 1 }}\n >\n {(forceDisabled || item.disabled || !item.callback) ? (\n <Typography>\n {item.label}\n </Typography>\n ) : (\n <Link\n component={'button'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => item.callback()}\n tabIndex={0}\n >\n {item.label}\n </Link>\n )}\n </Box>\n );\n }, []);\n\n const renderDownloadSection = useCallback((section: DownloadConfigSection) => {\n return (\n <Box key={section.label}>\n <Typography variant={'h6'}>\n {section.label}\n </Typography>\n {section.items.map(item => renderDownloadItem(item, section.disabled))}\n </Box>\n );\n }, [renderDownloadItem]);\n\n return (\n <Box\n sx={{\n width: theme.spacing(59),\n }}\n >\n {downloadConfigs.map((config) => (\n <Box\n key={config.zone}\n sx={{\n borderBottom: `1px solid ${theme.palette.divider}`,\n padding: theme.spacing(1),\n }}\n >\n <Box>\n <Typography\n color={config.disabled ? theme.palette.text.disabled : undefined}\n variant={'h5'}\n >\n {config.zoneLabel}\n </Typography>\n </Box>\n {config.disabled && (\n <Box sx={{ padding: theme.spacing(1) }}>\n <Typography>\n {t`No data available for download.`}\n </Typography>\n </Box>\n )}\n {!config.disabled && config.items.map((item) => {\n if ('items' in item && item.disabled) {\n return null;\n }\n return (\n <Fragment key={item.label}>\n {'items' in item\n ? renderDownloadSection(item)\n : renderDownloadItem(item)}\n </Fragment>\n );\n })}\n </Box>\n ))}\n </Box>\n );\n};\n\n// eslint-disable-next-line @eslint-react/kit/no-multi-comp\nexport const DashboardDownloadSidebarItem = ({ onClose, open }: DashboardDownloadSidebarItemProps) => {\n const { t } = useTranslation();\n\n return (\n <SidebarItem\n closeIcon={<DashboardDownloadSidebarItemIcon />}\n closeIconTooltipText={t`Close download`}\n onClose={onClose}\n open={open}\n testIdAttributes={{ name: 'DashboardDownloadSidebarItem' }}\n title={t`Download`}\n width={60}\n >\n {open && <DashboardDownloadSidebarItemContent />}\n </SidebarItem>\n );\n};\n","/**\n * Fuse.js v7.4.2 - Lightweight fuzzy-search (http://fusejs.io)\n *\n * Copyright (c) 2026 Kiro Risk (http://kiro.me)\n * All Rights Reserved. Apache Software License 2.0\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n//#region src/helpers/typeGuards.ts\nfunction isArray(value) {\n\treturn !Array.isArray ? getTag(value) === \"[object Array]\" : Array.isArray(value);\n}\nfunction baseToString(value) {\n\tif (typeof value == \"string\") return value;\n\tif (typeof value === \"bigint\") return value.toString();\n\tconst result = value + \"\";\n\treturn result == \"0\" && 1 / value == -Infinity ? \"-0\" : result;\n}\nfunction toString(value) {\n\treturn value == null ? \"\" : baseToString(value);\n}\nfunction isString(value) {\n\treturn typeof value === \"string\";\n}\nfunction isNumber(value) {\n\treturn typeof value === \"number\";\n}\nfunction isBoolean(value) {\n\treturn value === true || value === false || isObjectLike(value) && getTag(value) == \"[object Boolean]\";\n}\nfunction isObject(value) {\n\treturn typeof value === \"object\";\n}\nfunction isObjectLike(value) {\n\treturn isObject(value) && value !== null;\n}\nfunction isDefined(value) {\n\treturn value !== void 0 && value !== null;\n}\nfunction isBlank(value) {\n\treturn !value.trim().length;\n}\nfunction getTag(value) {\n\treturn value == null ? value === void 0 ? \"[object Undefined]\" : \"[object Null]\" : Object.prototype.toString.call(value);\n}\n\n//#endregion\n//#region src/core/errorMessages.ts\nconst INCORRECT_INDEX_TYPE = \"Incorrect 'index' type\";\nconst INVALID_DOC_INDEX = \"Invalid doc index: must be a non-negative integer within the bounds of the docs array\";\nconst LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) => `Invalid value for key ${key}`;\nconst PATTERN_LENGTH_TOO_LARGE = (max) => `Pattern length exceeds max of ${max}.`;\nconst MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;\nconst INVALID_KEY_WEIGHT_VALUE = (key) => `Property 'weight' in key '${key}' must be a positive integer`;\nconst FUSE_MATCH_TOKEN_SEARCH_UNSUPPORTED = \"Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.\";\n\n//#endregion\n//#region src/tools/KeyStore.ts\nconst hasOwn = Object.prototype.hasOwnProperty;\nvar KeyStore = class {\n\tconstructor(keys) {\n\t\tthis._keys = [];\n\t\tthis._keyMap = {};\n\t\tlet totalWeight = 0;\n\t\tkeys.forEach((key) => {\n\t\t\tconst obj = createKey(key);\n\t\t\tthis._keys.push(obj);\n\t\t\tthis._keyMap[obj.id] = obj;\n\t\t\ttotalWeight += obj.weight;\n\t\t});\n\t\tthis._keys.forEach((key) => {\n\t\t\tkey.weight /= totalWeight;\n\t\t});\n\t}\n\tget(keyId) {\n\t\treturn this._keyMap[keyId];\n\t}\n\tkeys() {\n\t\treturn this._keys;\n\t}\n\ttoJSON() {\n\t\treturn JSON.stringify(this._keys);\n\t}\n};\nfunction createKey(key) {\n\tlet path = null;\n\tlet id = null;\n\tlet src = null;\n\tlet weight = 1;\n\tlet getFn = null;\n\tif (isString(key) || isArray(key)) {\n\t\tsrc = key;\n\t\tpath = createKeyPath(key);\n\t\tid = createKeyId(key);\n\t} else {\n\t\tif (!hasOwn.call(key, \"name\")) throw new Error(MISSING_KEY_PROPERTY(\"name\"));\n\t\tconst name = key.name;\n\t\tsrc = name;\n\t\tif (hasOwn.call(key, \"weight\") && key.weight !== void 0) {\n\t\t\tweight = key.weight;\n\t\t\tif (weight <= 0) throw new Error(INVALID_KEY_WEIGHT_VALUE(createKeyId(name)));\n\t\t}\n\t\tpath = createKeyPath(name);\n\t\tid = createKeyId(name);\n\t\tgetFn = key.getFn ?? null;\n\t}\n\treturn {\n\t\tpath,\n\t\tid,\n\t\tweight,\n\t\tsrc,\n\t\tgetFn\n\t};\n}\nfunction createKeyPath(key) {\n\treturn isArray(key) ? key : key.split(\".\");\n}\nfunction createKeyId(key) {\n\treturn isArray(key) ? key.join(\".\") : key;\n}\n\n//#endregion\n//#region src/helpers/get.ts\nfunction get(obj, path) {\n\tconst list = [];\n\tlet arr = false;\n\tconst deepGet = (obj, path, index, arrayIndex) => {\n\t\tif (!isDefined(obj)) return;\n\t\tif (!path[index]) list.push(arrayIndex !== void 0 ? {\n\t\t\tv: obj,\n\t\t\ti: arrayIndex\n\t\t} : obj);\n\t\telse {\n\t\t\tconst value = obj[path[index]];\n\t\t\tif (!isDefined(value)) return;\n\t\t\tif (index === path.length - 1 && (isString(value) || isNumber(value) || isBoolean(value) || typeof value === \"bigint\")) list.push(arrayIndex !== void 0 ? {\n\t\t\t\tv: toString(value),\n\t\t\t\ti: arrayIndex\n\t\t\t} : toString(value));\n\t\t\telse if (isArray(value)) {\n\t\t\t\tarr = true;\n\t\t\t\tfor (let i = 0, len = value.length; i < len; i += 1) deepGet(value[i], path, index + 1, i);\n\t\t\t} else if (path.length) deepGet(value, path, index + 1, arrayIndex);\n\t\t}\n\t};\n\tdeepGet(obj, isString(path) ? path.split(\".\") : path, 0);\n\treturn arr ? list : list[0];\n}\n\n//#endregion\n//#region src/core/config.ts\nconst MatchOptions = {\n\tincludeMatches: false,\n\tfindAllMatches: false,\n\tminMatchCharLength: 1\n};\nconst BasicOptions = {\n\tisCaseSensitive: false,\n\tignoreDiacritics: false,\n\tincludeScore: false,\n\tkeys: [],\n\tshouldSort: true,\n\tsortFn: (a, b) => a.score === b.score ? a.idx < b.idx ? -1 : 1 : a.score < b.score ? -1 : 1\n};\nconst FuzzyOptions = {\n\tlocation: 0,\n\tthreshold: .6,\n\tdistance: 100\n};\nconst AdvancedOptions = {\n\tuseExtendedSearch: false,\n\tuseTokenSearch: false,\n\ttokenize: void 0,\n\ttokenMatch: \"any\",\n\tgetFn: get,\n\tignoreLocation: false,\n\tignoreFieldNorm: false,\n\tfieldNormWeight: 1\n};\nconst Config = Object.freeze({\n\t...BasicOptions,\n\t...MatchOptions,\n\t...FuzzyOptions,\n\t...AdvancedOptions\n});\n\n//#endregion\n//#region src/tools/fieldNorm.ts\nfunction norm(weight = 1, mantissa = 3) {\n\tconst cache = /* @__PURE__ */ new Map();\n\tconst m = Math.pow(10, mantissa);\n\treturn {\n\t\tget(value) {\n\t\t\tlet numTokens = 1;\n\t\t\tlet inSpace = false;\n\t\t\tfor (let i = 0; i < value.length; i++) if (value.charCodeAt(i) === 32) {\n\t\t\t\tif (!inSpace) {\n\t\t\t\t\tnumTokens++;\n\t\t\t\t\tinSpace = true;\n\t\t\t\t}\n\t\t\t} else inSpace = false;\n\t\t\tif (cache.has(numTokens)) return cache.get(numTokens);\n\t\t\tconst n = Math.round(m / Math.pow(numTokens, .5 * weight)) / m;\n\t\t\tcache.set(numTokens, n);\n\t\t\treturn n;\n\t\t},\n\t\tclear() {\n\t\t\tcache.clear();\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/tools/FuseIndex.ts\nvar FuseIndex = class {\n\tconstructor({ getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {\n\t\tthis.norm = norm(fieldNormWeight, 3);\n\t\tthis.getFn = getFn;\n\t\tthis.isCreated = false;\n\t\tthis.docs = [];\n\t\tthis.keys = [];\n\t\tthis._keysMap = {};\n\t\tthis.setIndexRecords();\n\t}\n\tsetSources(docs = []) {\n\t\tthis.docs = docs;\n\t}\n\tsetIndexRecords(records = []) {\n\t\tthis.records = records;\n\t}\n\tsetKeys(keys = []) {\n\t\tthis.keys = keys;\n\t\tthis._keysMap = {};\n\t\tkeys.forEach((key, idx) => {\n\t\t\tthis._keysMap[key.id] = idx;\n\t\t});\n\t}\n\tcreate() {\n\t\tif (this.isCreated || !this.docs.length) return;\n\t\tthis.isCreated = true;\n\t\tconst len = this.docs.length;\n\t\tthis.records = new Array(len);\n\t\tlet recordCount = 0;\n\t\tif (isString(this.docs[0])) for (let i = 0; i < len; i++) {\n\t\t\tconst record = this._createStringRecord(this.docs[i], i);\n\t\t\tif (record) this.records[recordCount++] = record;\n\t\t}\n\t\telse for (let i = 0; i < len; i++) this.records[recordCount++] = this._createObjectRecord(this.docs[i], i);\n\t\tthis.records.length = recordCount;\n\t\tthis.norm.clear();\n\t}\n\tadd(doc, docIndex) {\n\t\tif (!Number.isInteger(docIndex) || docIndex < 0) throw new Error(INVALID_DOC_INDEX);\n\t\tif (isString(doc)) {\n\t\t\tconst record = this._createStringRecord(doc, docIndex);\n\t\t\tif (record) this.records.push(record);\n\t\t\treturn record;\n\t\t}\n\t\tconst record = this._createObjectRecord(doc, docIndex);\n\t\tthis.records.push(record);\n\t\treturn record;\n\t}\n\tremoveAt(idx) {\n\t\tif (!Number.isInteger(idx) || idx < 0) throw new Error(INVALID_DOC_INDEX);\n\t\tfor (let i = 0, len = this.records.length; i < len; i += 1) if (this.records[i].i === idx) {\n\t\t\tthis.records.splice(i, 1);\n\t\t\tbreak;\n\t\t}\n\t\tfor (let i = 0, len = this.records.length; i < len; i += 1) if (this.records[i].i > idx) this.records[i].i -= 1;\n\t}\n\tremoveAll(indices) {\n\t\tconst toRemove = /* @__PURE__ */ new Set();\n\t\tfor (const v of indices) if (Number.isInteger(v) && v >= 0) toRemove.add(v);\n\t\tif (toRemove.size === 0) return;\n\t\tthis.records = this.records.filter((r) => !toRemove.has(r.i));\n\t\tconst sorted = Array.from(toRemove).sort((a, b) => a - b);\n\t\tfor (const record of this.records) {\n\t\t\tlet lo = 0;\n\t\t\tlet hi = sorted.length;\n\t\t\twhile (lo < hi) {\n\t\t\t\tconst mid = lo + hi >>> 1;\n\t\t\t\tif (sorted[mid] < record.i) lo = mid + 1;\n\t\t\t\telse hi = mid;\n\t\t\t}\n\t\t\trecord.i -= lo;\n\t\t}\n\t}\n\tgetValueForItemAtKeyId(item, keyId) {\n\t\treturn item[this._keysMap[keyId]];\n\t}\n\tsize() {\n\t\treturn this.records.length;\n\t}\n\t_createStringRecord(doc, docIndex) {\n\t\tif (!isDefined(doc) || isBlank(doc)) return null;\n\t\treturn {\n\t\t\tv: doc,\n\t\t\ti: docIndex,\n\t\t\tn: this.norm.get(doc)\n\t\t};\n\t}\n\t_createObjectRecord(doc, docIndex) {\n\t\tconst record = {\n\t\t\ti: docIndex,\n\t\t\t$: {}\n\t\t};\n\t\tfor (let keyIndex = 0, keyLen = this.keys.length; keyIndex < keyLen; keyIndex++) {\n\t\t\tconst key = this.keys[keyIndex];\n\t\t\tconst value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);\n\t\t\tif (!isDefined(value)) continue;\n\t\t\tif (isArray(value)) {\n\t\t\t\tconst subRecords = [];\n\t\t\t\tfor (let i = 0, len = value.length; i < len; i += 1) {\n\t\t\t\t\tconst item = value[i];\n\t\t\t\t\tif (!isDefined(item)) continue;\n\t\t\t\t\tif (isString(item)) {\n\t\t\t\t\t\tif (!isBlank(item)) {\n\t\t\t\t\t\t\tconst subRecord = {\n\t\t\t\t\t\t\t\tv: item,\n\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\tn: this.norm.get(item)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsubRecords.push(subRecord);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (isDefined(item.v)) {\n\t\t\t\t\t\tconst text = isString(item.v) ? item.v : toString(item.v);\n\t\t\t\t\t\tif (!isBlank(text)) {\n\t\t\t\t\t\t\tconst subRecord = {\n\t\t\t\t\t\t\t\tv: text,\n\t\t\t\t\t\t\t\ti: item.i,\n\t\t\t\t\t\t\t\tn: this.norm.get(text)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsubRecords.push(subRecord);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trecord.$[keyIndex] = subRecords;\n\t\t\t} else if (isString(value) && !isBlank(value)) {\n\t\t\t\tconst subRecord = {\n\t\t\t\t\tv: value,\n\t\t\t\t\tn: this.norm.get(value)\n\t\t\t\t};\n\t\t\t\trecord.$[keyIndex] = subRecord;\n\t\t\t}\n\t\t}\n\t\treturn record;\n\t}\n\ttoJSON() {\n\t\treturn {\n\t\t\tkeys: this.keys.map(({ getFn, ...key }) => key),\n\t\t\trecords: this.records\n\t\t};\n\t}\n};\nfunction createIndex(keys, docs, { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {\n\tconst myIndex = new FuseIndex({\n\t\tgetFn,\n\t\tfieldNormWeight\n\t});\n\tmyIndex.setKeys(keys.map(createKey));\n\tmyIndex.setSources(docs);\n\tmyIndex.create();\n\treturn myIndex;\n}\nfunction parseIndex(data, { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {\n\tconst { keys, records } = data;\n\tconst myIndex = new FuseIndex({\n\t\tgetFn,\n\t\tfieldNormWeight\n\t});\n\tmyIndex.setKeys(keys);\n\tmyIndex.setIndexRecords(records);\n\treturn myIndex;\n}\n\n//#endregion\n//#region src/search/bitap/convertMaskToIndices.ts\nfunction convertMaskToIndices(matchmask = [], minMatchCharLength = Config.minMatchCharLength) {\n\tconst indices = [];\n\tlet start = -1;\n\tlet end = -1;\n\tlet i = 0;\n\tfor (let len = matchmask.length; i < len; i += 1) {\n\t\tconst match = matchmask[i];\n\t\tif (match && start === -1) start = i;\n\t\telse if (!match && start !== -1) {\n\t\t\tend = i - 1;\n\t\t\tif (end - start + 1 >= minMatchCharLength) indices.push([start, end]);\n\t\t\tstart = -1;\n\t\t}\n\t}\n\tif (matchmask[i - 1] && i - start >= minMatchCharLength) indices.push([start, i - 1]);\n\treturn indices;\n}\n\n//#endregion\n//#region src/search/bitap/search.ts\nfunction search(text, pattern, patternAlphabet, { location = Config.location, distance = Config.distance, threshold = Config.threshold, findAllMatches = Config.findAllMatches, minMatchCharLength = Config.minMatchCharLength, includeMatches = Config.includeMatches, ignoreLocation = Config.ignoreLocation } = {}) {\n\tif (pattern.length > 32) throw new Error(PATTERN_LENGTH_TOO_LARGE(32));\n\tconst patternLen = pattern.length;\n\tconst textLen = text.length;\n\tconst expectedLocation = Math.max(0, Math.min(location, textLen));\n\tlet currentThreshold = threshold;\n\tlet bestLocation = expectedLocation;\n\tconst calcScore = (errors, currentLocation) => {\n\t\tconst accuracy = errors / patternLen;\n\t\tif (ignoreLocation) return accuracy;\n\t\tconst proximity = Math.abs(expectedLocation - currentLocation);\n\t\tif (!distance) return proximity ? 1 : accuracy;\n\t\treturn accuracy + proximity / distance;\n\t};\n\tconst computeMatches = minMatchCharLength > 1 || includeMatches;\n\tconst matchMask = computeMatches ? Array(textLen) : [];\n\tlet index;\n\twhile ((index = text.indexOf(pattern, bestLocation)) > -1) {\n\t\tconst score = calcScore(0, index);\n\t\tcurrentThreshold = Math.min(score, currentThreshold);\n\t\tbestLocation = index + patternLen;\n\t\tif (computeMatches) {\n\t\t\tlet i = 0;\n\t\t\twhile (i < patternLen) {\n\t\t\t\tmatchMask[index + i] = 1;\n\t\t\t\ti += 1;\n\t\t\t}\n\t\t}\n\t}\n\tbestLocation = -1;\n\tlet lastBitArr = [];\n\tlet finalScore = 1;\n\tlet bestErrors = 0;\n\tlet binMax = patternLen + textLen;\n\tconst mask = 1 << patternLen - 1;\n\tfor (let i = 0; i < patternLen; i += 1) {\n\t\tlet binMin = 0;\n\t\tlet binMid = binMax;\n\t\twhile (binMin < binMid) {\n\t\t\tif (calcScore(i, expectedLocation + binMid) <= currentThreshold) binMin = binMid;\n\t\t\telse binMax = binMid;\n\t\t\tbinMid = Math.floor((binMax - binMin) / 2 + binMin);\n\t\t}\n\t\tbinMax = binMid;\n\t\tlet start = Math.max(1, expectedLocation - binMid + 1);\n\t\tconst finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen;\n\t\tconst bitArr = Array(finish + 2);\n\t\tbitArr[finish + 1] = (1 << i) - 1;\n\t\tfor (let j = finish; j >= start; j -= 1) {\n\t\t\tconst currentLocation = j - 1;\n\t\t\tconst charMatch = patternAlphabet[text[currentLocation]];\n\t\t\tbitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch;\n\t\t\tif (i) bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1];\n\t\t\tif (bitArr[j] & mask) {\n\t\t\t\tfinalScore = calcScore(i, currentLocation);\n\t\t\t\tif (finalScore <= currentThreshold) {\n\t\t\t\t\tcurrentThreshold = finalScore;\n\t\t\t\t\tbestLocation = currentLocation;\n\t\t\t\t\tbestErrors = i;\n\t\t\t\t\tif (bestLocation <= expectedLocation) break;\n\t\t\t\t\tstart = Math.max(1, 2 * expectedLocation - bestLocation);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (calcScore(i + 1, expectedLocation) > currentThreshold) break;\n\t\tlastBitArr = bitArr;\n\t}\n\tif (computeMatches && bestLocation >= 0) {\n\t\tconst matchEnd = Math.min(textLen - 1, bestLocation + patternLen - 1 + bestErrors);\n\t\tfor (let k = bestLocation; k <= matchEnd; k += 1) if (patternAlphabet[text[k]]) matchMask[k] = 1;\n\t}\n\tconst result = {\n\t\tisMatch: bestLocation >= 0,\n\t\tscore: Math.max(.001, finalScore)\n\t};\n\tif (computeMatches) {\n\t\tconst indices = convertMaskToIndices(matchMask, minMatchCharLength);\n\t\tif (!indices.length) result.isMatch = false;\n\t\telse if (includeMatches) result.indices = indices;\n\t}\n\treturn result;\n}\n\n//#endregion\n//#region src/search/bitap/createPatternAlphabet.ts\nfunction createPatternAlphabet(pattern) {\n\tconst mask = {};\n\tfor (let i = 0, len = pattern.length; i < len; i += 1) {\n\t\tconst char = pattern.charAt(i);\n\t\tmask[char] = (mask[char] || 0) | 1 << len - i - 1;\n\t}\n\treturn mask;\n}\n\n//#endregion\n//#region src/helpers/mergeIndices.ts\nfunction mergeIndices(indices) {\n\tif (indices.length <= 1) return indices;\n\tindices.sort((a, b) => a[0] - b[0] || a[1] - b[1]);\n\tconst merged = [indices[0]];\n\tfor (let i = 1, len = indices.length; i < len; i += 1) {\n\t\tconst last = merged[merged.length - 1];\n\t\tconst curr = indices[i];\n\t\tif (curr[0] <= last[1] + 1) last[1] = Math.max(last[1], curr[1]);\n\t\telse merged.push(curr);\n\t}\n\treturn merged;\n}\n\n//#endregion\n//#region src/helpers/diacritics.ts\nconst NON_DECOMPOSABLE_MAP = {\n\t\"ł\": \"l\",\n\t\"Ł\": \"L\",\n\t\"đ\": \"d\",\n\t\"Đ\": \"D\",\n\t\"ø\": \"o\",\n\t\"Ø\": \"O\",\n\t\"ħ\": \"h\",\n\t\"Ħ\": \"H\",\n\t\"ŧ\": \"t\",\n\t\"Ŧ\": \"T\",\n\t\"ı\": \"i\",\n\t\"ß\": \"ss\"\n};\nconst NON_DECOMPOSABLE_RE = new RegExp(\"[\" + Object.keys(NON_DECOMPOSABLE_MAP).join(\"\") + \"]\", \"g\");\nconst stripDiacritics = typeof String.prototype.normalize === \"function\" ? (str) => str.normalize(\"NFD\").replace(/[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F]/g, \"\").replace(NON_DECOMPOSABLE_RE, (ch) => NON_DECOMPOSABLE_MAP[ch]) : (str) => str;\n\n//#endregion\n//#region src/search/bitap/index.ts\nvar BitapSearch = class {\n\tconstructor(pattern, { location = Config.location, threshold = Config.threshold, distance = Config.distance, includeMatches = Config.includeMatches, findAllMatches = Config.findAllMatches, minMatchCharLength = Config.minMatchCharLength, isCaseSensitive = Config.isCaseSensitive, ignoreDiacritics = Config.ignoreDiacritics, ignoreLocation = Config.ignoreLocation } = {}) {\n\t\tthis.options = {\n\t\t\tlocation,\n\t\t\tthreshold,\n\t\t\tdistance,\n\t\t\tincludeMatches,\n\t\t\tfindAllMatches,\n\t\t\tminMatchCharLength,\n\t\t\tisCaseSensitive,\n\t\t\tignoreDiacritics,\n\t\t\tignoreLocation\n\t\t};\n\t\tpattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n\t\tpattern = ignoreDiacritics ? stripDiacritics(pattern) : pattern;\n\t\tthis.pattern = pattern;\n\t\tthis.chunks = [];\n\t\tif (!this.pattern.length) return;\n\t\tconst addChunk = (pattern, startIndex) => {\n\t\t\tthis.chunks.push({\n\t\t\t\tpattern,\n\t\t\t\talphabet: createPatternAlphabet(pattern),\n\t\t\t\tstartIndex\n\t\t\t});\n\t\t};\n\t\tconst len = this.pattern.length;\n\t\tif (len > 32) {\n\t\t\tlet i = 0;\n\t\t\tconst remainder = len % 32;\n\t\t\tconst end = len - remainder;\n\t\t\twhile (i < end) {\n\t\t\t\taddChunk(this.pattern.substr(i, 32), i);\n\t\t\t\ti += 32;\n\t\t\t}\n\t\t\tif (remainder) {\n\t\t\t\tconst startIndex = len - 32;\n\t\t\t\taddChunk(this.pattern.substr(startIndex), startIndex);\n\t\t\t}\n\t\t} else addChunk(this.pattern, 0);\n\t}\n\tsearchIn(text) {\n\t\tconst { isCaseSensitive, ignoreDiacritics, includeMatches } = this.options;\n\t\ttext = isCaseSensitive ? text : text.toLowerCase();\n\t\ttext = ignoreDiacritics ? stripDiacritics(text) : text;\n\t\tif (this.pattern === text) {\n\t\t\tconst result = {\n\t\t\t\tisMatch: true,\n\t\t\t\tscore: 0\n\t\t\t};\n\t\t\tif (includeMatches) result.indices = [[0, text.length - 1]];\n\t\t\treturn result;\n\t\t}\n\t\tconst { location, distance, threshold, findAllMatches, minMatchCharLength, ignoreLocation } = this.options;\n\t\tconst allIndices = [];\n\t\tlet totalScore = 0;\n\t\tlet hasMatches = false;\n\t\tthis.chunks.forEach(({ pattern, alphabet, startIndex }) => {\n\t\t\tconst { isMatch, score, indices } = search(text, pattern, alphabet, {\n\t\t\t\tlocation: location + startIndex,\n\t\t\t\tdistance,\n\t\t\t\tthreshold,\n\t\t\t\tfindAllMatches,\n\t\t\t\tminMatchCharLength,\n\t\t\t\tincludeMatches,\n\t\t\t\tignoreLocation\n\t\t\t});\n\t\t\tif (isMatch) hasMatches = true;\n\t\t\ttotalScore += score;\n\t\t\tif (isMatch && indices) allIndices.push(...indices);\n\t\t});\n\t\tconst result = {\n\t\t\tisMatch: hasMatches,\n\t\t\tscore: hasMatches ? totalScore / this.chunks.length : 1\n\t\t};\n\t\tif (hasMatches && includeMatches) result.indices = mergeIndices(allIndices);\n\t\treturn result;\n\t}\n};\n\n//#endregion\n//#region src/search/extended/matchers.ts\nconst MULTI_MATCH_TYPES = new Set([\"fuzzy\", \"include\"]);\nfunction isInverse(type) {\n\treturn type.startsWith(\"inverse\");\n}\nconst matchers = [\n\t{\n\t\ttype: \"exact\",\n\t\tmultiRegex: /^=\"(.*)\"$/,\n\t\tsingleRegex: /^=(.*)$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = text === pattern;\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [0, pattern.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"include\",\n\t\tmultiRegex: /^'\"(.*)\"$/,\n\t\tsingleRegex: /^'(.*)$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"include\",\n\t\t\tsearch(text) {\n\t\t\t\tlet location = 0;\n\t\t\t\tlet index;\n\t\t\t\tconst indices = [];\n\t\t\t\tconst patternLen = pattern.length;\n\t\t\t\twhile ((index = text.indexOf(pattern, location)) > -1) {\n\t\t\t\t\tlocation = index + patternLen;\n\t\t\t\t\tindices.push([index, location - 1]);\n\t\t\t\t}\n\t\t\t\tconst isMatch = !!indices.length;\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"prefix-exact\",\n\t\tmultiRegex: /^\\^\"(.*)\"$/,\n\t\tsingleRegex: /^\\^(.*)$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"prefix-exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = text.startsWith(pattern);\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [0, pattern.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"inverse-prefix-exact\",\n\t\tmultiRegex: /^!\\^\"(.*)\"$/,\n\t\tsingleRegex: /^!\\^(.*)$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"inverse-prefix-exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = !text.startsWith(pattern);\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [0, text.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"inverse-suffix-exact\",\n\t\tmultiRegex: /^!\"(.*)\"\\$$/,\n\t\tsingleRegex: /^!(.*)\\$$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"inverse-suffix-exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = !text.endsWith(pattern);\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [0, text.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"suffix-exact\",\n\t\tmultiRegex: /^\"(.*)\"\\$$/,\n\t\tsingleRegex: /^(.*)\\$$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"suffix-exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = text.endsWith(pattern);\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [text.length - pattern.length, text.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"inverse-exact\",\n\t\tmultiRegex: /^!\"(.*)\"$/,\n\t\tsingleRegex: /^!(.*)$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"inverse-exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = text.indexOf(pattern) === -1;\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [0, text.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"fuzzy\",\n\t\tmultiRegex: /^\"(.*)\"$/,\n\t\tsingleRegex: /^(.*)$/,\n\t\tcreate: (pattern, options = {}) => {\n\t\t\tconst bitap = new BitapSearch(pattern, {\n\t\t\t\tlocation: options.location ?? Config.location,\n\t\t\t\tthreshold: options.threshold ?? Config.threshold,\n\t\t\t\tdistance: options.distance ?? Config.distance,\n\t\t\t\tincludeMatches: options.includeMatches ?? Config.includeMatches,\n\t\t\t\tfindAllMatches: options.findAllMatches ?? Config.findAllMatches,\n\t\t\t\tminMatchCharLength: options.minMatchCharLength ?? Config.minMatchCharLength,\n\t\t\t\tisCaseSensitive: options.isCaseSensitive ?? Config.isCaseSensitive,\n\t\t\t\tignoreDiacritics: options.ignoreDiacritics ?? Config.ignoreDiacritics,\n\t\t\t\tignoreLocation: options.ignoreLocation ?? Config.ignoreLocation\n\t\t\t});\n\t\t\treturn {\n\t\t\t\ttype: \"fuzzy\",\n\t\t\t\tsearch(text) {\n\t\t\t\t\treturn bitap.searchIn(text);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n];\n\n//#endregion\n//#region src/search/extended/parseQuery.ts\nconst matchersLen = matchers.length;\nconst ESCAPED_PIPE = \"\\0\";\nconst OR_TOKEN = \"|\";\nfunction tokenize(pattern) {\n\tconst tokens = [];\n\tconst len = pattern.length;\n\tlet i = 0;\n\twhile (i < len) {\n\t\twhile (i < len && pattern[i] === \" \") i++;\n\t\tif (i >= len) break;\n\t\tlet j = i;\n\t\twhile (j < len && pattern[j] !== \" \" && pattern[j] !== \"\\\"\") j++;\n\t\tif (j < len && pattern[j] === \"\\\"\") {\n\t\t\tj++;\n\t\t\twhile (j < len) {\n\t\t\t\tif (pattern[j] === \"\\\"\") {\n\t\t\t\t\tconst next = j + 1;\n\t\t\t\t\tif (next >= len || pattern[next] === \" \") {\n\t\t\t\t\t\tj++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (pattern[next] === \"$\" && (next + 1 >= len || pattern[next + 1] === \" \")) {\n\t\t\t\t\t\tj += 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ttokens.push(pattern.substring(i, j));\n\t\t\ti = j;\n\t\t} else {\n\t\t\twhile (j < len && pattern[j] !== \" \") j++;\n\t\t\ttokens.push(pattern.substring(i, j));\n\t\t\ti = j;\n\t\t}\n\t}\n\treturn tokens;\n}\nfunction getMatch(pattern, exp) {\n\tconst matches = pattern.match(exp);\n\treturn matches ? matches[1] : null;\n}\nfunction parseQuery(pattern, options = {}) {\n\treturn pattern.replace(/\\\\\\|/g, ESCAPED_PIPE).split(OR_TOKEN).map((item) => {\n\t\tconst query = tokenize(item.replace(/\\u0000/g, \"|\").trim()).filter((item) => item && !!item.trim());\n\t\tconst results = [];\n\t\tfor (let i = 0, len = query.length; i < len; i += 1) {\n\t\t\tconst queryItem = query[i];\n\t\t\tlet found = false;\n\t\t\tlet idx = -1;\n\t\t\twhile (!found && ++idx < matchersLen) {\n\t\t\t\tconst def = matchers[idx];\n\t\t\t\tconst token = getMatch(queryItem, def.multiRegex);\n\t\t\t\tif (token) {\n\t\t\t\t\tresults.push(def.create(token, options));\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (found) continue;\n\t\t\tidx = -1;\n\t\t\twhile (++idx < matchersLen) {\n\t\t\t\tconst def = matchers[idx];\n\t\t\t\tconst token = getMatch(queryItem, def.singleRegex);\n\t\t\t\tif (token) {\n\t\t\t\t\tresults.push(def.create(token, options));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t});\n}\n\n//#endregion\n//#region src/search/extended/index.ts\nvar ExtendedSearch = class {\n\tconstructor(pattern, { isCaseSensitive = Config.isCaseSensitive, ignoreDiacritics = Config.ignoreDiacritics, includeMatches = Config.includeMatches, minMatchCharLength = Config.minMatchCharLength, ignoreLocation = Config.ignoreLocation, findAllMatches = Config.findAllMatches, location = Config.location, threshold = Config.threshold, distance = Config.distance } = {}) {\n\t\tthis.query = null;\n\t\tthis.options = {\n\t\t\tisCaseSensitive,\n\t\t\tignoreDiacritics,\n\t\t\tincludeMatches,\n\t\t\tminMatchCharLength,\n\t\t\tfindAllMatches,\n\t\t\tignoreLocation,\n\t\t\tlocation,\n\t\t\tthreshold,\n\t\t\tdistance\n\t\t};\n\t\tpattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n\t\tpattern = ignoreDiacritics ? stripDiacritics(pattern) : pattern;\n\t\tthis.pattern = pattern;\n\t\tthis.query = parseQuery(this.pattern, this.options);\n\t}\n\tstatic condition(_, options) {\n\t\treturn options.useExtendedSearch;\n\t}\n\tsearchIn(text) {\n\t\tconst query = this.query;\n\t\tif (!query) return {\n\t\t\tisMatch: false,\n\t\t\tscore: 1\n\t\t};\n\t\tconst { includeMatches, isCaseSensitive, ignoreDiacritics } = this.options;\n\t\ttext = isCaseSensitive ? text : text.toLowerCase();\n\t\ttext = ignoreDiacritics ? stripDiacritics(text) : text;\n\t\tlet numMatches = 0;\n\t\tconst allIndices = [];\n\t\tlet totalScore = 0;\n\t\tlet hasInverse = false;\n\t\tfor (let i = 0, qLen = query.length; i < qLen; i += 1) {\n\t\t\tconst searchers = query[i];\n\t\t\tallIndices.length = 0;\n\t\t\tnumMatches = 0;\n\t\t\thasInverse = false;\n\t\t\tfor (let j = 0, pLen = searchers.length; j < pLen; j += 1) {\n\t\t\t\tconst matcher = searchers[j];\n\t\t\t\tconst { isMatch, indices, score } = matcher.search(text);\n\t\t\t\tif (isMatch) {\n\t\t\t\t\tnumMatches += 1;\n\t\t\t\t\ttotalScore += score;\n\t\t\t\t\tif (isInverse(matcher.type)) hasInverse = true;\n\t\t\t\t\tif (includeMatches) if (MULTI_MATCH_TYPES.has(matcher.type)) allIndices.push(...indices);\n\t\t\t\t\telse allIndices.push(indices);\n\t\t\t\t} else {\n\t\t\t\t\ttotalScore = 0;\n\t\t\t\t\tnumMatches = 0;\n\t\t\t\t\tallIndices.length = 0;\n\t\t\t\t\thasInverse = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (numMatches) {\n\t\t\t\tconst result = {\n\t\t\t\t\tisMatch: true,\n\t\t\t\t\tscore: totalScore / numMatches\n\t\t\t\t};\n\t\t\t\tif (hasInverse) result.hasInverse = true;\n\t\t\t\tif (includeMatches) result.indices = mergeIndices(allIndices);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tisMatch: false,\n\t\t\tscore: 1\n\t\t};\n\t}\n};\n\n//#endregion\n//#region src/core/register.ts\nconst registeredSearchers = [];\nfunction register(...args) {\n\tregisteredSearchers.push(...args);\n}\nfunction createSearcher(pattern, options) {\n\tfor (let i = 0, len = registeredSearchers.length; i < len; i += 1) {\n\t\tconst searcherClass = registeredSearchers[i];\n\t\tif (searcherClass.condition(pattern, options)) return new searcherClass(pattern, options);\n\t}\n\treturn new BitapSearch(pattern, options);\n}\n\n//#endregion\n//#region src/core/queryParser.ts\nconst LogicalOperator = {\n\tAND: \"$and\",\n\tOR: \"$or\"\n};\nconst KeyType = {\n\tPATH: \"$path\",\n\tPATTERN: \"$val\"\n};\nconst isExpression = (query) => !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);\nconst isPath = (query) => !!query[KeyType.PATH];\nconst isLeaf = (query) => !isArray(query) && isObject(query) && !isExpression(query);\nconst convertToExplicit = (query) => ({ [LogicalOperator.AND]: Object.keys(query).map((key) => ({ [key]: query[key] })) });\nfunction parse(query, options, { auto = true } = {}) {\n\tconst next = (query) => {\n\t\tif (isString(query)) {\n\t\t\tconst obj = {\n\t\t\t\tkeyId: null,\n\t\t\t\tpattern: query\n\t\t\t};\n\t\t\tif (auto) obj.searcher = createSearcher(query, options);\n\t\t\treturn obj;\n\t\t}\n\t\tconst keys = Object.keys(query);\n\t\tconst isQueryPath = isPath(query);\n\t\tif (!isQueryPath && keys.length > 1 && !isExpression(query)) return next(convertToExplicit(query));\n\t\tif (isLeaf(query)) {\n\t\t\tconst key = isQueryPath ? query[KeyType.PATH] : keys[0];\n\t\t\tconst pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];\n\t\t\tif (!isString(pattern)) throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));\n\t\t\tconst obj = {\n\t\t\t\tkeyId: createKeyId(key),\n\t\t\t\tpattern\n\t\t\t};\n\t\t\tif (auto) obj.searcher = createSearcher(pattern, options);\n\t\t\treturn obj;\n\t\t}\n\t\tconst node = {\n\t\t\tchildren: [],\n\t\t\toperator: keys[0]\n\t\t};\n\t\tkeys.forEach((key) => {\n\t\t\tconst value = query[key];\n\t\t\tif (isArray(value)) value.forEach((item) => {\n\t\t\t\tnode.children.push(next(item));\n\t\t\t});\n\t\t});\n\t\treturn node;\n\t};\n\tif (!isExpression(query)) query = convertToExplicit(query);\n\treturn next(query);\n}\n\n//#endregion\n//#region src/core/computeScore.ts\nfunction computeScoreSingle(matches, { ignoreFieldNorm = Config.ignoreFieldNorm }) {\n\tlet totalScore = 1;\n\tmatches.forEach(({ key, norm, score }) => {\n\t\tconst weight = key ? key.weight : null;\n\t\ttotalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm));\n\t});\n\treturn totalScore;\n}\nfunction computeScore(results, { ignoreFieldNorm = Config.ignoreFieldNorm }) {\n\tresults.forEach((result) => {\n\t\tresult.score = computeScoreSingle(result.matches, { ignoreFieldNorm });\n\t});\n}\n\n//#endregion\n//#region src/tools/MaxHeap.ts\nvar MaxHeap = class {\n\tconstructor(limit) {\n\t\tthis.limit = limit;\n\t\tthis.heap = [];\n\t}\n\tget size() {\n\t\treturn this.heap.length;\n\t}\n\tshouldInsert(score) {\n\t\treturn this.size < this.limit || score < this.heap[0].score;\n\t}\n\tinsert(item) {\n\t\tif (this.size < this.limit) {\n\t\t\tthis.heap.push(item);\n\t\t\tthis._bubbleUp(this.size - 1);\n\t\t} else if (item.score < this.heap[0].score) {\n\t\t\tthis.heap[0] = item;\n\t\t\tthis._sinkDown(0);\n\t\t}\n\t}\n\textractSorted(sortFn) {\n\t\treturn this.heap.sort(sortFn);\n\t}\n\t_bubbleUp(i) {\n\t\tconst heap = this.heap;\n\t\twhile (i > 0) {\n\t\t\tconst parent = i - 1 >> 1;\n\t\t\tif (heap[i].score <= heap[parent].score) break;\n\t\t\tconst tmp = heap[i];\n\t\t\theap[i] = heap[parent];\n\t\t\theap[parent] = tmp;\n\t\t\ti = parent;\n\t\t}\n\t}\n\t_sinkDown(i) {\n\t\tconst heap = this.heap;\n\t\tconst len = heap.length;\n\t\tlet largest = i;\n\t\tdo {\n\t\t\ti = largest;\n\t\t\tconst left = 2 * i + 1;\n\t\t\tconst right = 2 * i + 2;\n\t\t\tif (left < len && heap[left].score > heap[largest].score) largest = left;\n\t\t\tif (right < len && heap[right].score > heap[largest].score) largest = right;\n\t\t\tif (largest !== i) {\n\t\t\t\tconst tmp = heap[i];\n\t\t\t\theap[i] = heap[largest];\n\t\t\t\theap[largest] = tmp;\n\t\t\t}\n\t\t} while (largest !== i);\n\t}\n};\n\n//#endregion\n//#region src/core/formatMatches.ts\nfunction formatMatches(result) {\n\tconst matches = [];\n\tresult.matches.forEach((match) => {\n\t\tif (!isDefined(match.indices) || !match.indices.length) return;\n\t\tconst obj = {\n\t\t\tindices: match.indices,\n\t\t\tvalue: match.value\n\t\t};\n\t\tif (match.key) obj.key = match.key.id;\n\t\tif (match.idx > -1) obj.refIndex = match.idx;\n\t\tmatches.push(obj);\n\t});\n\treturn matches;\n}\n\n//#endregion\n//#region src/core/format.ts\nfunction format(results, docs, { includeMatches = Config.includeMatches, includeScore = Config.includeScore } = {}) {\n\treturn results.map((result) => {\n\t\tconst { idx } = result;\n\t\tconst data = {\n\t\t\titem: docs[idx],\n\t\t\trefIndex: idx\n\t\t};\n\t\tif (includeMatches) data.matches = formatMatches(result);\n\t\tif (includeScore) data.score = result.score;\n\t\treturn data;\n\t});\n}\n\n//#endregion\n//#region src/search/token/analyzer.ts\nconst DEFAULT_TOKEN = /[\\p{L}\\p{M}\\p{N}_]+/gu;\nconst warned = /* @__PURE__ */ new WeakSet();\nfunction warnNonGlobal(regex) {\n\tif (!warned.has(regex)) {\n\t\twarned.add(regex);\n\t\tconsole.warn(`[Fuse] tokenize regex ${regex} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`);\n\t}\n}\nfunction resolveTokenize(tokenize) {\n\tif (typeof tokenize === \"function\") {\n\t\tlet validated = false;\n\t\treturn (text) => {\n\t\t\tconst result = tokenize(text);\n\t\t\tif (!validated) {\n\t\t\t\tvalidated = true;\n\t\t\t\tif (!Array.isArray(result) || result.some((t) => typeof t !== \"string\")) throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(result) ? \"array containing non-strings\" : typeof result}.`);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t}\n\tif (tokenize instanceof RegExp) {\n\t\tif (!tokenize.global) warnNonGlobal(tokenize);\n\t\treturn (text) => text.match(tokenize) || [];\n\t}\n\treturn (text) => text.match(DEFAULT_TOKEN) || [];\n}\nfunction createAnalyzer({ isCaseSensitive = false, ignoreDiacritics = false, tokenize } = {}) {\n\tconst tokenizeFn = resolveTokenize(tokenize);\n\treturn { tokenize(text) {\n\t\tif (!isCaseSensitive) text = text.toLowerCase();\n\t\tif (ignoreDiacritics) text = stripDiacritics(text);\n\t\treturn tokenizeFn(text);\n\t} };\n}\n\n//#endregion\n//#region src/search/token/index.ts\nconst MAX_MASK_TERMS = 31;\nvar TokenSearch = class {\n\tstatic condition(_, options) {\n\t\treturn options.useTokenSearch;\n\t}\n\tconstructor(pattern, options) {\n\t\tthis.options = options;\n\t\tthis.analyzer = createAnalyzer({\n\t\t\tisCaseSensitive: options.isCaseSensitive,\n\t\t\tignoreDiacritics: options.ignoreDiacritics,\n\t\t\ttokenize: options.tokenize\n\t\t});\n\t\tconst queryTerms = this.analyzer.tokenize(pattern);\n\t\tconst { df, fieldCount } = options._invertedIndex;\n\t\tthis.termSearchers = [];\n\t\tthis.idfWeights = [];\n\t\tfor (const term of queryTerms) {\n\t\t\tthis.termSearchers.push(new BitapSearch(term, {\n\t\t\t\tlocation: options.location,\n\t\t\t\tthreshold: options.threshold,\n\t\t\t\tdistance: options.distance,\n\t\t\t\tincludeMatches: options.includeMatches,\n\t\t\t\tfindAllMatches: options.findAllMatches,\n\t\t\t\tminMatchCharLength: options.minMatchCharLength,\n\t\t\t\tisCaseSensitive: options.isCaseSensitive,\n\t\t\t\tignoreDiacritics: options.ignoreDiacritics,\n\t\t\t\tignoreLocation: true\n\t\t\t}));\n\t\t\tconst docFreq = df.get(term) || 0;\n\t\t\tconst idf = Math.log(1 + (fieldCount - docFreq + .5) / (docFreq + .5));\n\t\t\tthis.idfWeights.push(idf);\n\t\t}\n\t\tthis.combineAll = options.tokenMatch === \"all\";\n\t\tthis.numTerms = this.termSearchers.length;\n\t\tthis.useMask = this.numTerms <= 31;\n\t}\n\tsearchIn(text) {\n\t\tif (!this.termSearchers.length) return {\n\t\t\tisMatch: false,\n\t\t\tscore: 1\n\t\t};\n\t\tconst allIndices = [];\n\t\tlet weightedScore = 0;\n\t\tlet maxPossibleScore = 0;\n\t\tlet matchedCount = 0;\n\t\tlet matchedMask = 0;\n\t\tconst matchedTerms = this.combineAll && !this.useMask ? /* @__PURE__ */ new Set() : null;\n\t\tfor (let i = 0; i < this.termSearchers.length; i++) {\n\t\t\tconst result = this.termSearchers[i].searchIn(text);\n\t\t\tconst idf = this.idfWeights[i];\n\t\t\tmaxPossibleScore += idf;\n\t\t\tif (result.isMatch) {\n\t\t\t\tmatchedCount++;\n\t\t\t\tweightedScore += idf * (1 - result.score);\n\t\t\t\tif (result.indices) allIndices.push(...result.indices);\n\t\t\t\tif (this.combineAll) if (this.useMask) matchedMask |= 1 << i;\n\t\t\t\telse matchedTerms.add(i);\n\t\t\t}\n\t\t}\n\t\tif (matchedCount === 0) return {\n\t\t\tisMatch: false,\n\t\t\tscore: 1\n\t\t};\n\t\tconst normalized = maxPossibleScore > 0 ? 1 - weightedScore / maxPossibleScore : 0;\n\t\tconst searchResult = {\n\t\t\tisMatch: true,\n\t\t\tscore: Math.max(.001, normalized)\n\t\t};\n\t\tif (this.options.includeMatches && allIndices.length) searchResult.indices = mergeIndices(allIndices);\n\t\tif (this.combineAll) {\n\t\t\tif (this.useMask) searchResult.matchedMask = matchedMask;\n\t\t\telse searchResult.matchedTerms = matchedTerms;\n\t\t\tsearchResult.termCount = this.numTerms;\n\t\t}\n\t\treturn searchResult;\n\t}\n};\n\n//#endregion\n//#region src/search/token/InvertedIndex.ts\nfunction addField(index, text, docIdx, analyzer) {\n\tconst tokens = analyzer.tokenize(text);\n\tif (!tokens.length) return;\n\tindex.fieldCount++;\n\tindex.docFieldCount.set(docIdx, (index.docFieldCount.get(docIdx) || 0) + 1);\n\tconst distinctTerms = new Set(tokens);\n\tlet perDocTerms = index.docTermFieldHits.get(docIdx);\n\tif (!perDocTerms) {\n\t\tperDocTerms = /* @__PURE__ */ new Map();\n\t\tindex.docTermFieldHits.set(docIdx, perDocTerms);\n\t}\n\tfor (const term of distinctTerms) {\n\t\tperDocTerms.set(term, (perDocTerms.get(term) || 0) + 1);\n\t\tindex.df.set(term, (index.df.get(term) || 0) + 1);\n\t}\n}\nfunction ingestRecord(index, record, keyCount, analyzer) {\n\tconst { i: docIdx, v, $: fields } = record;\n\tif (v !== void 0) {\n\t\taddField(index, v, docIdx, analyzer);\n\t\treturn;\n\t}\n\tif (!fields) return;\n\tfor (let keyIdx = 0; keyIdx < keyCount; keyIdx++) {\n\t\tconst value = fields[keyIdx];\n\t\tif (!value) continue;\n\t\tif (Array.isArray(value)) for (const sub of value) addField(index, sub.v, docIdx, analyzer);\n\t\telse addField(index, value.v, docIdx, analyzer);\n\t}\n}\nfunction buildInvertedIndex(records, keyCount, analyzer) {\n\tconst index = {\n\t\tfieldCount: 0,\n\t\tdf: /* @__PURE__ */ new Map(),\n\t\tdocFieldCount: /* @__PURE__ */ new Map(),\n\t\tdocTermFieldHits: /* @__PURE__ */ new Map()\n\t};\n\tfor (const record of records) ingestRecord(index, record, keyCount, analyzer);\n\treturn index;\n}\nfunction addToInvertedIndex(index, record, keyCount, analyzer) {\n\tingestRecord(index, record, keyCount, analyzer);\n}\nfunction removeFromInvertedIndex(index, docIdx) {\n\tconst fieldCount = index.docFieldCount.get(docIdx);\n\tif (fieldCount === void 0) return;\n\tindex.fieldCount -= fieldCount;\n\tindex.docFieldCount.delete(docIdx);\n\tconst perDocTerms = index.docTermFieldHits.get(docIdx);\n\tif (!perDocTerms) return;\n\tfor (const [term, hits] of perDocTerms) {\n\t\tconst next = (index.df.get(term) || 0) - hits;\n\t\tif (next <= 0) index.df.delete(term);\n\t\telse index.df.set(term, next);\n\t}\n\tindex.docTermFieldHits.delete(docIdx);\n}\nfunction removeAndShiftInvertedIndex(index, removedIndices) {\n\tif (removedIndices.length === 0) return;\n\tconst sorted = Array.from(new Set(removedIndices)).sort((a, b) => a - b);\n\tfor (const idx of sorted) removeFromInvertedIndex(index, idx);\n\tconst shift = (oldIdx) => {\n\t\tlet lo = 0;\n\t\tlet hi = sorted.length;\n\t\twhile (lo < hi) {\n\t\t\tconst mid = lo + hi >>> 1;\n\t\t\tif (sorted[mid] < oldIdx) lo = mid + 1;\n\t\t\telse hi = mid;\n\t\t}\n\t\treturn oldIdx - lo;\n\t};\n\tconst firstRemoved = sorted[0];\n\tconst shiftedDocFieldCount = /* @__PURE__ */ new Map();\n\tfor (const [oldKey, count] of index.docFieldCount) shiftedDocFieldCount.set(oldKey > firstRemoved ? shift(oldKey) : oldKey, count);\n\tindex.docFieldCount = shiftedDocFieldCount;\n\tconst shiftedDocTermFieldHits = /* @__PURE__ */ new Map();\n\tfor (const [oldKey, terms] of index.docTermFieldHits) shiftedDocTermFieldHits.set(oldKey > firstRemoved ? shift(oldKey) : oldKey, terms);\n\tindex.docTermFieldHits = shiftedDocTermFieldHits;\n}\n\n//#endregion\n//#region src/core/index.ts\nvar Fuse = class {\n\tconstructor(docs, options, index) {\n\t\tthis.options = {\n\t\t\t...Config,\n\t\t\t...options\n\t\t};\n\t\tif (this.options.useExtendedSearch && false);\n\t\tif (this.options.useTokenSearch && false);\n\t\tthis._keyStore = new KeyStore(this.options.keys);\n\t\tthis._docs = docs;\n\t\tthis._myIndex = null;\n\t\tthis._invertedIndex = null;\n\t\tthis.setCollection(docs, index);\n\t\tthis._lastQuery = null;\n\t\tthis._lastSearcher = null;\n\t}\n\t_getSearcher(query) {\n\t\tif (this._lastQuery === query) return this._lastSearcher;\n\t\tconst searcher = createSearcher(query, this._invertedIndex ? {\n\t\t\t...this.options,\n\t\t\t_invertedIndex: this._invertedIndex\n\t\t} : this.options);\n\t\tthis._lastQuery = query;\n\t\tthis._lastSearcher = searcher;\n\t\treturn searcher;\n\t}\n\tsetCollection(docs, index) {\n\t\tthis._docs = docs;\n\t\tif (index && !(index instanceof FuseIndex)) throw new Error(INCORRECT_INDEX_TYPE);\n\t\tthis._myIndex = index || createIndex(this.options.keys, this._docs, {\n\t\t\tgetFn: this.options.getFn,\n\t\t\tfieldNormWeight: this.options.fieldNormWeight\n\t\t});\n\t\tif (this.options.useTokenSearch) {\n\t\t\tconst analyzer = createAnalyzer({\n\t\t\t\tisCaseSensitive: this.options.isCaseSensitive,\n\t\t\t\tignoreDiacritics: this.options.ignoreDiacritics,\n\t\t\t\ttokenize: this.options.tokenize\n\t\t\t});\n\t\t\tthis._invertedIndex = buildInvertedIndex(this._myIndex.records, this._myIndex.keys.length, analyzer);\n\t\t}\n\t\tthis._invalidateSearcherCache();\n\t}\n\tadd(doc) {\n\t\tif (!isDefined(doc)) return;\n\t\tthis._docs.push(doc);\n\t\tconst record = this._myIndex.add(doc, this._docs.length - 1);\n\t\tif (this._invertedIndex && record) {\n\t\t\tconst analyzer = createAnalyzer({\n\t\t\t\tisCaseSensitive: this.options.isCaseSensitive,\n\t\t\t\tignoreDiacritics: this.options.ignoreDiacritics,\n\t\t\t\ttokenize: this.options.tokenize\n\t\t\t});\n\t\t\taddToInvertedIndex(this._invertedIndex, record, this._myIndex.keys.length, analyzer);\n\t\t}\n\t\tthis._invalidateSearcherCache();\n\t}\n\tremove(predicate = () => false) {\n\t\tconst results = [];\n\t\tconst indicesToRemove = [];\n\t\tfor (let i = 0, len = this._docs.length; i < len; i += 1) if (predicate(this._docs[i], i)) {\n\t\t\tresults.push(this._docs[i]);\n\t\t\tindicesToRemove.push(i);\n\t\t}\n\t\tif (indicesToRemove.length) {\n\t\t\tif (this._invertedIndex) removeAndShiftInvertedIndex(this._invertedIndex, indicesToRemove);\n\t\t\tconst toRemove = new Set(indicesToRemove);\n\t\t\tthis._docs = this._docs.filter((_, i) => !toRemove.has(i));\n\t\t\tthis._myIndex.removeAll(indicesToRemove);\n\t\t\tthis._invalidateSearcherCache();\n\t\t}\n\t\treturn results;\n\t}\n\tremoveAt(idx) {\n\t\tif (!Number.isInteger(idx) || idx < 0 || idx >= this._docs.length) throw new Error(INVALID_DOC_INDEX);\n\t\tif (this._invertedIndex) removeAndShiftInvertedIndex(this._invertedIndex, [idx]);\n\t\tconst doc = this._docs.splice(idx, 1)[0];\n\t\tthis._myIndex.removeAt(idx);\n\t\tthis._invalidateSearcherCache();\n\t\treturn doc;\n\t}\n\t_invalidateSearcherCache() {\n\t\tthis._lastQuery = null;\n\t\tthis._lastSearcher = null;\n\t}\n\tgetIndex() {\n\t\treturn this._myIndex;\n\t}\n\tsearch(query, options) {\n\t\tconst { limit = -1 } = options || {};\n\t\tconst { includeMatches, includeScore, shouldSort, sortFn, ignoreFieldNorm } = this.options;\n\t\tif (isString(query) && !query.trim()) {\n\t\t\tlet docs = this._docs.map((item, idx) => ({\n\t\t\t\titem,\n\t\t\t\trefIndex: idx\n\t\t\t}));\n\t\t\tif (isNumber(limit) && limit > -1) docs = docs.slice(0, limit);\n\t\t\treturn docs;\n\t\t}\n\t\tconst useHeap = isNumber(limit) && limit > 0 && isString(query);\n\t\tlet results;\n\t\tif (useHeap) {\n\t\t\tconst heap = new MaxHeap(limit);\n\t\t\tif (isString(this._docs[0])) this._searchStringList(query, {\n\t\t\t\theap,\n\t\t\t\tignoreFieldNorm\n\t\t\t});\n\t\t\telse this._searchObjectList(query, {\n\t\t\t\theap,\n\t\t\t\tignoreFieldNorm\n\t\t\t});\n\t\t\tresults = heap.extractSorted(sortFn);\n\t\t} else {\n\t\t\tresults = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);\n\t\t\tcomputeScore(results, { ignoreFieldNorm });\n\t\t\tif (shouldSort) results.sort(sortFn);\n\t\t\tif (isNumber(limit) && limit > -1) results = results.slice(0, limit);\n\t\t}\n\t\treturn format(results, this._docs, {\n\t\t\tincludeMatches,\n\t\t\tincludeScore\n\t\t});\n\t}\n\t_searchStringList(query, { heap, ignoreFieldNorm } = {}) {\n\t\tconst searcher = this._getSearcher(query);\n\t\tconst requireAllTokens = this.options.useTokenSearch && this.options.tokenMatch === \"all\";\n\t\tconst { records } = this._myIndex;\n\t\tconst results = heap ? null : [];\n\t\trecords.forEach(({ v: text, i: idx, n: norm }) => {\n\t\t\tif (!isDefined(text)) return;\n\t\t\tconst searchResult = searcher.searchIn(text);\n\t\t\tif (searchResult.isMatch) {\n\t\t\t\tconst match = {\n\t\t\t\t\tscore: searchResult.score,\n\t\t\t\t\tvalue: text,\n\t\t\t\t\tnorm,\n\t\t\t\t\tindices: searchResult.indices\n\t\t\t\t};\n\t\t\t\tif (requireAllTokens) {\n\t\t\t\t\tmatch.matchedMask = searchResult.matchedMask;\n\t\t\t\t\tmatch.matchedTerms = searchResult.matchedTerms;\n\t\t\t\t\tmatch.termCount = searchResult.termCount;\n\t\t\t\t}\n\t\t\t\tconst matches = [match];\n\t\t\t\tif (!requireAllTokens || this._coversAllTokens(matches)) {\n\t\t\t\t\tconst result = {\n\t\t\t\t\t\titem: text,\n\t\t\t\t\t\tidx,\n\t\t\t\t\t\tmatches\n\t\t\t\t\t};\n\t\t\t\t\tif (heap) {\n\t\t\t\t\t\tresult.score = computeScoreSingle(result.matches, { ignoreFieldNorm });\n\t\t\t\t\t\tif (heap.shouldInsert(result.score)) heap.insert(result);\n\t\t\t\t\t} else results.push(result);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn results;\n\t}\n\t_searchLogical(query) {\n\t\tconst expression = parse(query, this.options);\n\t\tconst evaluate = (node, item, idx) => {\n\t\t\tif (!(\"children\" in node)) {\n\t\t\t\tconst { keyId, searcher } = node;\n\t\t\t\tlet matches;\n\t\t\t\tif (keyId === null) {\n\t\t\t\t\tmatches = [];\n\t\t\t\t\tthis._myIndex.keys.forEach((key, keyIndex) => {\n\t\t\t\t\t\tmatches.push(...this._findMatches({\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: item[keyIndex],\n\t\t\t\t\t\t\tsearcher\n\t\t\t\t\t\t}));\n\t\t\t\t\t});\n\t\t\t\t} else matches = this._findMatches({\n\t\t\t\t\tkey: this._keyStore.get(keyId),\n\t\t\t\t\tvalue: this._myIndex.getValueForItemAtKeyId(item, keyId),\n\t\t\t\t\tsearcher\n\t\t\t\t});\n\t\t\t\tif (matches && matches.length) return [{\n\t\t\t\t\tidx,\n\t\t\t\t\titem,\n\t\t\t\t\tmatches\n\t\t\t\t}];\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { children, operator } = node;\n\t\t\tconst res = [];\n\t\t\tfor (let i = 0, len = children.length; i < len; i += 1) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tconst result = evaluate(child, item, idx);\n\t\t\t\tif (result.length) res.push(...result);\n\t\t\t\telse if (operator === LogicalOperator.AND) return [];\n\t\t\t}\n\t\t\treturn res;\n\t\t};\n\t\tconst records = this._myIndex.records;\n\t\tconst resultMap = /* @__PURE__ */ new Map();\n\t\tconst results = [];\n\t\trecords.forEach(({ $: item, i: idx }) => {\n\t\t\tif (isDefined(item)) {\n\t\t\t\tconst expResults = evaluate(expression, item, idx);\n\t\t\t\tif (expResults.length) {\n\t\t\t\t\tif (!resultMap.has(idx)) {\n\t\t\t\t\t\tresultMap.set(idx, {\n\t\t\t\t\t\t\tidx,\n\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\tmatches: []\n\t\t\t\t\t\t});\n\t\t\t\t\t\tresults.push(resultMap.get(idx));\n\t\t\t\t\t}\n\t\t\t\t\texpResults.forEach(({ matches }) => {\n\t\t\t\t\t\tresultMap.get(idx).matches.push(...matches);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn results;\n\t}\n\t_searchObjectList(query, { heap, ignoreFieldNorm } = {}) {\n\t\tconst searcher = this._getSearcher(query);\n\t\tconst requireAllTokens = this.options.useTokenSearch && this.options.tokenMatch === \"all\";\n\t\tconst { keys, records } = this._myIndex;\n\t\tconst results = heap ? null : [];\n\t\trecords.forEach(({ $: item, i: idx }) => {\n\t\t\tif (!isDefined(item)) return;\n\t\t\tconst matches = [];\n\t\t\tlet anyKeyFailed = false;\n\t\t\tlet hasInverse = false;\n\t\t\tkeys.forEach((key, keyIndex) => {\n\t\t\t\tconst keyMatches = this._findMatches({\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: item[keyIndex],\n\t\t\t\t\tsearcher\n\t\t\t\t});\n\t\t\t\tif (keyMatches.length) {\n\t\t\t\t\tmatches.push(...keyMatches);\n\t\t\t\t\tif (keyMatches[0].hasInverse) hasInverse = true;\n\t\t\t\t} else anyKeyFailed = true;\n\t\t\t});\n\t\t\tif (hasInverse && anyKeyFailed) return;\n\t\t\tif (matches.length && (!requireAllTokens || this._coversAllTokens(matches))) {\n\t\t\t\tconst result = {\n\t\t\t\t\tidx,\n\t\t\t\t\titem,\n\t\t\t\t\tmatches\n\t\t\t\t};\n\t\t\t\tif (heap) {\n\t\t\t\t\tresult.score = computeScoreSingle(result.matches, { ignoreFieldNorm });\n\t\t\t\t\tif (heap.shouldInsert(result.score)) heap.insert(result);\n\t\t\t\t} else results.push(result);\n\t\t\t}\n\t\t});\n\t\treturn results;\n\t}\n\t_findMatches({ key, value, searcher }) {\n\t\tif (!isDefined(value)) return [];\n\t\tconst matches = [];\n\t\tif (isArray(value)) value.forEach(({ v: text, i: idx, n: norm }) => {\n\t\t\tif (!isDefined(text)) return;\n\t\t\tconst searchResult = searcher.searchIn(text);\n\t\t\tif (searchResult.isMatch) {\n\t\t\t\tconst match = {\n\t\t\t\t\tscore: searchResult.score,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: text,\n\t\t\t\t\tidx,\n\t\t\t\t\tnorm,\n\t\t\t\t\tindices: searchResult.indices,\n\t\t\t\t\thasInverse: searchResult.hasInverse\n\t\t\t\t};\n\t\t\t\tif (searchResult.termCount !== void 0) {\n\t\t\t\t\tmatch.matchedMask = searchResult.matchedMask;\n\t\t\t\t\tmatch.matchedTerms = searchResult.matchedTerms;\n\t\t\t\t\tmatch.termCount = searchResult.termCount;\n\t\t\t\t}\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t});\n\t\telse {\n\t\t\tconst { v: text, n: norm } = value;\n\t\t\tconst searchResult = searcher.searchIn(text);\n\t\t\tif (searchResult.isMatch) {\n\t\t\t\tconst match = {\n\t\t\t\t\tscore: searchResult.score,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: text,\n\t\t\t\t\tnorm,\n\t\t\t\t\tindices: searchResult.indices,\n\t\t\t\t\thasInverse: searchResult.hasInverse\n\t\t\t\t};\n\t\t\t\tif (searchResult.termCount !== void 0) {\n\t\t\t\t\tmatch.matchedMask = searchResult.matchedMask;\n\t\t\t\t\tmatch.matchedTerms = searchResult.matchedTerms;\n\t\t\t\t\tmatch.termCount = searchResult.termCount;\n\t\t\t\t}\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t}\n\t\treturn matches;\n\t}\n\t_coversAllTokens(matches) {\n\t\tconst termCount = matches.length ? matches[0].termCount : void 0;\n\t\tif (termCount === void 0) return true;\n\t\tif (termCount <= 31) {\n\t\t\tlet coverage = 0;\n\t\t\tfor (let i = 0; i < matches.length; i++) coverage |= matches[i].matchedMask || 0;\n\t\t\treturn coverage === 2 ** termCount - 1;\n\t\t}\n\t\tconst coverage = /* @__PURE__ */ new Set();\n\t\tfor (let i = 0; i < matches.length; i++) {\n\t\t\tconst terms = matches[i].matchedTerms;\n\t\t\tif (terms) for (const t of terms) coverage.add(t);\n\t\t}\n\t\treturn coverage.size === termCount;\n\t}\n};\n\n//#endregion\n//#region src/entry.ts\nFuse.version = \"7.4.2\";\nFuse.createIndex = createIndex;\nFuse.parseIndex = parseIndex;\nFuse.config = Config;\nFuse.match = function(pattern, text, options) {\n\tif (options && options.useTokenSearch) throw new Error(FUSE_MATCH_TOKEN_SEARCH_UNSUPPORTED);\n\treturn createSearcher(pattern, {\n\t\t...Config,\n\t\t...options\n\t}).searchIn(text);\n};\nFuse.parseQuery = parse;\nregister(ExtendedSearch);\nregister(TokenSearch);\nFuse.use = function(...plugins) {\n\tplugins.forEach((plugin) => register(plugin));\n};\nvar entry_default = Fuse;\n\n//#endregion\nexport { entry_default as default };","import {\n Box,\n ClickAwayListener,\n Divider,\n ListItemIcon,\n ListItemText,\n MenuItem,\n MenuList,\n Paper,\n Popper,\n Typography,\n} from '@mui/material';\nimport CheckIcon from '@mui/icons-material/Check';\nimport { useTranslation } from 'react-i18next';\nimport type {\n KeyboardEvent,\n MouseEvent,\n} from 'react';\nimport { useCallback } from 'react';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nexport type DashboardSearchMode = 'exact-match' | 'fuzzy-match' | 'include-match' | 'prefix-exact-match' | 'suffix-exact-match';\n\nexport type DashboardSearchSettingsProps = {\n readonly anchorEl: HTMLElement | null;\n readonly onChange: (searchMode: DashboardSearchMode) => void;\n readonly onClose: () => void;\n readonly onEscapeKeyDown: () => void;\n readonly open: boolean;\n readonly searchMode: DashboardSearchMode;\n};\n\ntype DashboardSearchModeOption = {\n readonly label: string;\n readonly searchMode: DashboardSearchMode;\n};\n\nexport const DashboardSearchSettings = ({ anchorEl, onChange, onClose, onEscapeKeyDown, open, searchMode }: DashboardSearchSettingsProps) => {\n const { t } = useTranslation();\n\n const searchModeOptions: DashboardSearchModeOption[] = [\n {\n label: t`Include match`,\n searchMode: 'include-match',\n },\n {\n label: t`Fuzzy match`,\n searchMode: 'fuzzy-match',\n },\n {\n label: t`Exact match`,\n searchMode: 'exact-match',\n },\n {\n label: t`Starts with`,\n searchMode: 'prefix-exact-match',\n },\n {\n label: t`Ends with`,\n searchMode: 'suffix-exact-match',\n },\n ];\n\n const onMenuItemClick = useCallback((event: MouseEvent<HTMLLIElement>) => {\n const nextSearchMode = event.currentTarget.dataset['searchMode'] as DashboardSearchMode | undefined;\n if (!nextSearchMode) {\n return;\n }\n onChange(nextSearchMode);\n onClose();\n }, [onChange, onClose]);\n\n const onMenuListKeyDown = useCallback((event: KeyboardEvent<HTMLUListElement>) => {\n if (event.key !== 'Escape') {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n onEscapeKeyDown();\n }, [onEscapeKeyDown]);\n\n return (\n <Popper\n anchorEl={anchorEl}\n open={open}\n placement={'bottom-end'}\n sx={{\n zIndex: theme => theme.zIndex.modal + 1,\n }}\n >\n <ClickAwayListener onClickAway={onClose}>\n <Paper\n elevation={8}\n sx={{ width: 280 }}\n {...TestIdUtil.createAttributes('DashboardSearchSettings')}\n >\n <MenuList\n autoFocusItem={open}\n onKeyDown={onMenuListKeyDown}\n >\n {searchModeOptions.map(option => (\n <MenuItem\n data-search-mode={option.searchMode}\n key={option.searchMode}\n onClick={onMenuItemClick}\n selected={option.searchMode === searchMode}\n >\n <ListItemIcon>\n {option.searchMode === searchMode && <CheckIcon fontSize={'small'} />}\n </ListItemIcon>\n <ListItemText>\n {option.label}\n </ListItemText>\n </MenuItem>\n ))}\n </MenuList>\n <Divider />\n <Box sx={{ p: 1.5 }}>\n <Typography variant={'subtitle2'}>\n {t`Operators`}\n </Typography>\n <Typography variant={'body2'}>\n {t`Spaces combine terms with AND.`}\n </Typography>\n <Typography variant={'body2'}>\n {t`Use | between groups for OR.`}\n </Typography>\n <Typography variant={'body2'}>\n {t`Use double quotes for phrases with spaces.`}\n </Typography>\n </Box>\n </Paper>\n </ClickAwayListener>\n </Popper>\n );\n};\n","import {\n Box,\n IconButton,\n InputAdornment,\n OutlinedInput,\n useTheme,\n} from '@mui/material';\nimport SearchIcon from '@mui/icons-material/Search';\nimport KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';\nimport KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';\nimport TuneIcon from '@mui/icons-material/Tune';\nimport CloseIcon from '@mui/icons-material/Close';\nimport type {\n ChangeEvent,\n KeyboardEvent,\n} from 'react';\nimport {\n use,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useStore } from 'zustand';\nimport type { FuseResult } from 'fuse.js';\nimport Fuse from 'fuse.js';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { CaseUtil } from '../../../utils/CaseUtil';\nimport { DASHBOARD_COMPONENT_NAME } from '../../../constants/dashboard';\n\nimport { DashboardContext } from './context/DashboardContext';\nimport type { DashboardSearchMode } from './DashboardSearchSettings';\nimport { DashboardSearchSettings } from './DashboardSearchSettings';\n\ntype FuseData = {\n [key: string]: string;\n id: string;\n};\n\nconst getExtendedSearchText = (searchText: string, searchMode: DashboardSearchMode) => {\n switch (searchMode) {\n case 'exact-match':\n return `=${searchText}`;\n case 'fuzzy-match':\n return searchText;\n case 'include-match':\n return `'${searchText}`;\n case 'prefix-exact-match':\n return `^${searchText}`;\n case 'suffix-exact-match':\n return `${searchText}$`;\n default:\n return `'${searchText}`;\n }\n};\n\nexport const DashboardSearch = () => {\n const inputRef = useRef<HTMLInputElement>(null);\n const searchButtonRef = useRef<HTMLButtonElement>(null);\n const settingsButtonRef = useRef<HTMLButtonElement>(null);\n const shouldRestoreSearchButtonFocusRef = useRef(false);\n const arrowUpButtonRef = useRef<HTMLButtonElement>(null);\n const arrowDownButtonRef = useRef<HTMLButtonElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const dashboardStore = use(DashboardStoreContext);\n const sortedData = useStore(dashboardStore, (state) => state.sortedData);\n const completeCaseType = useStore(dashboardStore, (state) => state.completeCaseType);\n const theme = useTheme();\n const { t } = useTranslation();\n const [searchText, setSearchText] = useState('');\n const [fuse, setFuse] = useState<Fuse<FuseData> | null>(null);\n const [fuseResults, setFuseResults] = useState<FuseResult<FuseData>[]>([]);\n const [isActive, setIsActive] = useState(false);\n const [highlightedIndex, setHighlightedIndex] = useState<number>(-1);\n const [searchMode, setSearchMode] = useState<DashboardSearchMode>('include-match');\n const [settingsAnchorEl, setSettingsAnchorEl] = useState<HTMLElement | null>(null);\n const dashboardContext = use(DashboardContext);\n let searchResultStatusText: null | string = null;\n if (searchText) {\n if (!fuseResults.length) {\n searchResultStatusText = t`No results`;\n } else if (highlightedIndex < 0) {\n searchResultStatusText = t('{{numResults}} results', { numResults: fuseResults.length });\n } else {\n searchResultStatusText = t('{{current}}/{{numResults}} results', { current: highlightedIndex + 1, numResults: fuseResults.length });\n }\n }\n\n const createFuse = useCallback(() => {\n const fuseData: FuseData[] = [];\n sortedData.forEach((caseCbCase) => {\n const fuseDataItem: FuseData = {\n id: caseCbCase.id,\n };\n Object.entries(caseCbCase.content).forEach(([key, value]) => {\n const col = completeCaseType.cols[key];\n if (!col) {\n return;\n }\n const refCol = completeCaseType.ref_cols[col.ref_col_id];\n if (!refCol) {\n return;\n }\n\n const rowValue = CaseUtil.getRowValue({ [key]: value }, col, completeCaseType);\n if (rowValue.isMissing) {\n return;\n }\n if (!refCol.concept_set_id) {\n fuseDataItem[`${key}-raw`] = rowValue.raw;\n }\n if (rowValue.full !== rowValue.raw) {\n fuseDataItem[`${key}-full`] = rowValue.full;\n }\n if (rowValue.long !== rowValue.raw && rowValue.long !== rowValue.full) {\n fuseDataItem[`${key}-long`] = rowValue.long;\n }\n if (rowValue.short !== rowValue.raw && rowValue.short !== rowValue.full && rowValue.short !== rowValue.long) {\n fuseDataItem[`${key}-short`] = rowValue.short;\n }\n });\n fuseData.push(fuseDataItem);\n });\n\n return new Fuse(fuseData, {\n ignoreDiacritics: true,\n ignoreLocation: false,\n includeMatches: true,\n includeScore: true,\n isCaseSensitive: false,\n keys: [\n 'id',\n ...Object.keys(completeCaseType.cols).map(x => [`${x}-raw`, `${x}-full`, `${x}-long`, `${x}-short`]).flat(),\n ],\n threshold: 0.3,\n useExtendedSearch: true,\n });\n }, [completeCaseType, sortedData]);\n\n const getFuse = useCallback(() => {\n if (fuse) {\n return fuse;\n }\n const nextFuse = createFuse();\n setFuse(nextFuse);\n return nextFuse;\n }, [createFuse, fuse]);\n\n const onTextInputChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const nextSearchText = event.target.value;\n setSearchText(nextSearchText);\n if (nextSearchText) {\n getFuse();\n }\n }, [getFuse]);\n\n useEffect(() => {\n setSearchText('');\n setIsActive(false);\n setFuse(null);\n setFuseResults([]);\n setHighlightedIndex(-1);\n }, [completeCaseType, sortedData]);\n\n useEffect(() => {\n if (!searchText) {\n setFuseResults([]);\n setHighlightedIndex(-1);\n dashboardContext.highlight({\n caseIds: [],\n origin: DASHBOARD_COMPONENT_NAME.SEARCH_BOX,\n });\n return;\n }\n if (!fuse) {\n return;\n }\n const extendedSearchText = getExtendedSearchText(searchText, searchMode);\n const results = fuse.search(extendedSearchText).sort((a, b) => a.refIndex - b.refIndex);\n setFuseResults(results);\n setHighlightedIndex(-1);\n }, [dashboardContext, fuse, searchMode, searchText]);\n\n const onSearchButtonClick = useCallback(() => {\n setIsActive(true);\n }, []);\n\n useEffect(() => {\n if (isActive) {\n inputRef.current?.focus();\n } else if (shouldRestoreSearchButtonFocusRef.current) {\n shouldRestoreSearchButtonFocusRef.current = false;\n searchButtonRef.current?.focus();\n }\n }, [isActive]);\n\n const handleClose = useCallback(() => {\n shouldRestoreSearchButtonFocusRef.current = true;\n setIsActive(false);\n setSearchText('');\n setFuseResults([]);\n setHighlightedIndex(-1);\n dashboardContext.highlight({\n caseIds: [],\n origin: DASHBOARD_COMPONENT_NAME.SEARCH_BOX,\n });\n }, [dashboardContext]);\n\n const onCloseButtonClick = useCallback(() => {\n handleClose();\n }, [handleClose]);\n\n const onContainerKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n handleClose();\n }\n }, [handleClose]);\n\n const onTextInputKeyDown = useCallback((event: KeyboardEvent<HTMLInputElement>) => {\n // on enter press, highlight the first result and focus the down arrow button\n if (event.key === 'Enter') {\n if (!fuseResults?.length) {\n return;\n }\n event.preventDefault();\n setHighlightedIndex(0);\n arrowDownButtonRef.current?.focus();\n }\n }, [fuseResults]);\n\n const onUpArrowButtonClick = useCallback(() => {\n // goto previous result\n if (!fuseResults?.length) {\n return;\n }\n setHighlightedIndex((prev) => {\n const newHighlightedIndex = prev <= 0 ? fuseResults.length - 1 : prev - 1;\n return newHighlightedIndex;\n });\n }, [fuseResults]);\n\n const onDownArrowButtonClick = useCallback(() => {\n // goto next result\n if (!fuseResults?.length) {\n return;\n }\n setHighlightedIndex((prev) => {\n const newHighlightedIndex = prev >= fuseResults.length - 1 ? 0 : prev + 1;\n return newHighlightedIndex;\n });\n }, [fuseResults]);\n\n useEffect(() => {\n if (!fuseResults?.length || highlightedIndex < 0 || highlightedIndex >= fuseResults.length) {\n dashboardContext.highlight({\n caseIds: [],\n origin: DASHBOARD_COMPONENT_NAME.SEARCH_BOX,\n });\n return;\n }\n dashboardContext.highlight({\n caseIds: [fuseResults[highlightedIndex].item.id],\n origin: DASHBOARD_COMPONENT_NAME.SEARCH_BOX,\n scrollIntoView: true,\n });\n }, [dashboardContext, fuseResults, highlightedIndex]);\n\n const onGenericKeyDown = useCallback((event: KeyboardEvent<HTMLButtonElement>) => {\n // arrow right, focus the next focusable element\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n const nextFocusableElement = event.currentTarget.nextElementSibling as HTMLElement;\n if (nextFocusableElement) {\n nextFocusableElement.focus();\n }\n }\n // arrow left, focus the previous focusable element\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (event.target === arrowUpButtonRef.current) {\n inputRef.current?.focus();\n return;\n }\n const previousFocusableElement = event.currentTarget.previousElementSibling as HTMLElement;\n if (previousFocusableElement) {\n previousFocusableElement.focus();\n }\n }\n }, []);\n\n const onSettingsButtonClick = useCallback(() => {\n setSettingsAnchorEl(settingsButtonRef.current);\n }, []);\n\n const onSettingsClose = useCallback(() => {\n setSettingsAnchorEl(null);\n }, []);\n\n const onSettingsEscapeKeyDown = useCallback(() => {\n setSettingsAnchorEl(null);\n settingsButtonRef.current?.focus();\n }, []);\n\n const onChangeSearchMode = useCallback((nextSearchMode: DashboardSearchMode) => {\n setSearchMode(nextSearchMode);\n inputRef.current?.focus();\n }, []);\n\n return (\n <Box\n sx={{\n height: theme.spacing(4),\n maxWidth: theme.spacing(60),\n overflow: 'hidden',\n width: 'calc(100% / 2)',\n }}\n {...TestIdUtil.createAttributes('DashboardSearch')}\n >\n {isActive ? (\n <Box\n onKeyDown={onContainerKeyDown}\n >\n <OutlinedInput\n endAdornment={(\n <InputAdornment position={'end'}>\n {searchResultStatusText && (\n <Box\n aria-atomic={'true'}\n aria-live={'polite'}\n role={'status'}\n >\n {searchResultStatusText}\n </Box>\n )}\n <IconButton\n {...TestIdUtil.createAttributes('DashboardSearch-PreviousButton')}\n aria-label={t`Goto previous search result`}\n disabled={!fuseResults?.length}\n edge={'end'}\n onClick={onUpArrowButtonClick}\n onKeyDown={onGenericKeyDown}\n ref={arrowUpButtonRef}\n sx={{ color: theme.palette.primary.main }}\n >\n <KeyboardArrowUpIcon />\n </IconButton>\n <IconButton\n {...TestIdUtil.createAttributes('DashboardSearch-NextButton')}\n aria-label={t`Goto next search result`}\n disabled={!fuseResults?.length}\n edge={'end'}\n onClick={onDownArrowButtonClick}\n onKeyDown={onGenericKeyDown}\n ref={arrowDownButtonRef}\n sx={{ color: theme.palette.primary.main }}\n >\n <KeyboardArrowDownIcon />\n </IconButton>\n <IconButton\n {...TestIdUtil.createAttributes('DashboardSearch-SettingsButton')}\n aria-label={t`Open settings`}\n edge={'end'}\n onClick={onSettingsButtonClick}\n onKeyDown={onGenericKeyDown}\n ref={settingsButtonRef}\n >\n <TuneIcon />\n </IconButton>\n <DashboardSearchSettings\n anchorEl={settingsAnchorEl}\n onChange={onChangeSearchMode}\n onClose={onSettingsClose}\n onEscapeKeyDown={onSettingsEscapeKeyDown}\n open={Boolean(settingsAnchorEl)}\n searchMode={searchMode}\n />\n <IconButton\n {...TestIdUtil.createAttributes('DashboardSearch-CloseButton')}\n aria-label={t`Close search`}\n edge={'end'}\n onClick={onCloseButtonClick}\n onKeyDown={onGenericKeyDown}\n ref={closeButtonRef}\n >\n <CloseIcon />\n </IconButton>\n </InputAdornment>\n )}\n fullWidth\n inputRef={inputRef}\n name={t`Search listed cases`}\n onChange={onTextInputChange}\n onKeyDown={onTextInputKeyDown}\n placeholder={t`Search listed cases`}\n size={'small'}\n slotProps={{\n input: {\n 'aria-label': t`Search listed cases`,\n sx: {\n '&::-webkit-search-cancel-button': {\n display: 'none',\n },\n height: '32px',\n outline: 'none !important',\n paddingBottom: '0 !important',\n paddingTop: '0 !important',\n },\n },\n }}\n sx={{\n backgroundColor: theme.palette.background.paper,\n height: '32px',\n }}\n type={'search'}\n value={searchText}\n />\n </Box>\n ) : (\n <Box\n sx={{\n justifySelf: 'flex-end',\n marginRight: theme.spacing(0.6),\n marginTop: theme.spacing(0.5),\n }}\n >\n <IconButton\n aria-label={t`Search`}\n edge={'end'}\n onClick={onSearchButtonClick}\n ref={searchButtonRef}\n sx={{\n color: theme.palette.primary.main,\n margin: 0,\n padding: 0,\n }}\n >\n <SearchIcon />\n </IconButton>\n </Box>\n )}\n </Box>\n );\n};\n","import {\n Alert,\n AlertTitle,\n Box,\n useTheme,\n} from '@mui/material';\nimport {\n use,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useStore } from 'zustand';\nimport { useShallow } from 'zustand/shallow';\nimport InfoIcon from '@mui/icons-material/Info';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport type { EpiContactDetailsDialogRefMethods } from '@gen-epix/ui/components/epi/EpiContactDetailsDialog';\nimport { ConfigService } from '@gen-epix/ui/classes/services/ConfigService';\nimport { EpiContactDetailsDialog } from '@gen-epix/ui/components/epi/EpiContactDetailsDialog';\nimport {\n SidebarMenu,\n SidebarMenuItem,\n} from '@gen-epix/ui/components/ui/Sidebar';\nimport {\n TableFiltersSidebarItem,\n TableFiltersSidebarItemIcon,\n} from '@gen-epix/ui/components/ui/Table';\nimport { KeyboardShortcutService } from '@gen-epix/ui-core/classes/services/KeyboardShortcutService';\n\nimport CollectionIcon from '../../../assets/icons/CollectionIcon.svg?react';\nimport type { CaseSetInfoDialogRefMethods } from '../CaseSetInfoDialog';\nimport { CaseSetInfoDialog } from '../CaseSetInfoDialog';\nimport type { CaseTypeInfoDialogRefMethods } from '../CaseTypeInfoDialog';\nimport { CaseTypeInfoDialog } from '../CaseTypeInfoDialog';\nimport { AddCasesToEventDialog } from '../AddCasesToEventDialog';\nimport type { AddCasesToEventDialogRefMethods } from '../AddCasesToEventDialog';\nimport { CaseInfoDialog } from '../CaseInfoDialog';\nimport type { CaseInfoDialogRefMethods } from '../CaseInfoDialog';\nimport { CreateEventDialog } from '../CreateEventDialog';\nimport type { CreateEventDialogRefMethods } from '../CreateEventDialog';\nimport { RemoveCasesFromEventDialog } from '../RemoveCasesFromEventDialog';\nimport type { RemoveCasesFromEventDialogRefMethods } from '../RemoveCasesFromEventDialog';\nimport { SequenceDownloadDialog } from '../SequenceDownloadDialog';\nimport type { SequenceDownloadDialogRefMethods } from '../SequenceDownloadDialog';\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { Grouping } from '../Grouping';\nimport { FindSimilarCasesDialog } from '../FindSimilarCasesDialog';\nimport type { FindSimilarCasesDialogRefMethods } from '../FindSimilarCasesDialog';\nimport { RemoveFindSimilarCasesResultDialog } from '../RemoveFindSimilarCasesResultDialog/RemoveFindSimilarCasesResultDialog';\nimport type { RemoveFindSimilarCasesResultDialogRefMethods } from '../RemoveFindSimilarCasesResultDialog/RemoveFindSimilarCasesResultDialog';\nimport { EventBusService } from '../../../classes/services/EventBusService';\n\nimport {\n DashboardSettingsSidebarItem,\n DashboardSettingsSidebarItemIcon,\n} from './DashboardSettingsSidebarItem';\nimport { DashboardLayoutRenderer } from './DashboardLayoutRenderer';\nimport type { ForwardRefDashboardLayoutRendererRefMethods } from './DashboardLayoutRenderer';\nimport {\n DashboardDownloadSidebarItem,\n DashboardDownloadSidebarItemIcon,\n} from './DashboardDownloadSidebarItem';\nimport { DashboardSearch } from './DashboardSearch';\n\ntype DashboardProps = {\n readonly caseSet?: CaseDbCaseSet;\n};\n\nexport const DashboardContent = ({ caseSet }: DashboardProps) => {\n const { t } = useTranslation();\n const theme = useTheme();\n const dashboardLayoutRendererRef = useRef<ForwardRefDashboardLayoutRendererRefMethods>(null);\n const caseSetInfoDialogRef = useRef<CaseSetInfoDialogRefMethods>(null);\n const caseTypeInfoDialogRef = useRef<CaseTypeInfoDialogRefMethods>(null);\n const contactDetailsDialogRef = useRef<EpiContactDetailsDialogRefMethods>(null);\n const sequenceDownloadDialogRef = useRef<SequenceDownloadDialogRefMethods>(null);\n const caseInfoDialogRef = useRef<CaseInfoDialogRefMethods>(null);\n const findSimilarCasesDialogRef = useRef<FindSimilarCasesDialogRefMethods>(null);\n const createEventDialogRef = useRef<CreateEventDialogRefMethods>(null);\n const removeCasesFromEventDialogRef = useRef<RemoveCasesFromEventDialogRefMethods>(null);\n const addCasesToEventDialogRef = useRef<AddCasesToEventDialogRefMethods>(null);\n const removeFindSimilarCasesResultDialogRef = useRef<RemoveFindSimilarCasesResultDialogRefMethods>(null);\n const [isFilterSidebarOpen, setIsFilterSidebarOpen] = useState(false);\n const [isSettingsSidebarOpen, setIsSettingsSidebarOpen] = useState(false);\n const [isDownloadSidebarOpen, setIsDownloadSidebarOpen] = useState(false);\n const dashboardStore = use(DashboardStoreContext);\n const fetchData = useStore(dashboardStore, useShallow((state) => state.fetchData));\n const completeCaseType = useStore(dashboardStore, (state) => state.completeCaseType);\n const activeFiltersCount = useStore(dashboardStore, (state) => state.filters.filter(f => !f.isInitialFilterValue()).length);\n const isMaxResultsExceeded = useStore(dashboardStore, (state) => state.isMaxResultsExceeded);\n const isMaxResultsExceededDismissed = useStore(dashboardStore, (state) => state.isMaxResultsExceededDismissed);\n\n const onMaxResultsExceededButtonClose = useCallback(() => {\n dashboardStore.setState({ isMaxResultsExceededDismissed: true });\n }, [dashboardStore]);\n\n useEffect(() => {\n const eventBus = EventBusService.getInstance();\n const removers = [\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('onEventCreated', () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n fetchData();\n }),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openAddCasesToEventDialog', (...args) => addCasesToEventDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openCaseInfoDialog', (...args) => caseInfoDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openContactDetailsDialog', (...args) => contactDetailsDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openCreateEventDialog', (...args) => createEventDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openFindSimilarCasesDialog', (...args) => findSimilarCasesDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openRemoveFindSimilarCasesResultDialog', (...args) => removeFindSimilarCasesResultDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openRemoveCasesFromEventDialog', (...args) => removeCasesFromEventDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openSequenceDownloadDialog', (...args) => sequenceDownloadDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openFiltersMenu', () => setIsFilterSidebarOpen(true)),\n ];\n return () => {\n removers.forEach(callbackfn => callbackfn());\n };\n }, [fetchData]);\n\n useEffect(() => {\n const removers = [\n KeyboardShortcutService.getInstance().registerShortcut({ callback: () => {\n setIsFilterSidebarOpen(x => !x);\n }, key: 'f', modifier: null }),\n KeyboardShortcutService.getInstance().registerShortcut({ callback: () => {\n setIsSettingsSidebarOpen(x => !x);\n }, key: 's', modifier: null }),\n KeyboardShortcutService.getInstance().registerShortcut({ callback: () => {\n caseTypeInfoDialogRef.current.open();\n }, key: 'i', modifier: null }),\n ];\n return () => {\n removers.forEach(callbackfn => callbackfn());\n };\n }, []);\n\n const onDashboardFilterSidebarClose = useCallback(() => {\n setIsFilterSidebarOpen(false);\n }, []);\n\n const onDashboardOpenFilterSidebarButtonClick = useCallback(() => {\n setIsFilterSidebarOpen(true);\n }, []);\n\n const onDashboardSettingsSidebarClose = useCallback(() => {\n setIsSettingsSidebarOpen(false);\n }, []);\n\n const onDashboardDownloadSidebarClose = useCallback(() => {\n setIsDownloadSidebarOpen(false);\n }, []);\n\n const onDashboardLayoutSelectorSidebarButtonClick = useCallback(() => {\n setIsSettingsSidebarOpen(true);\n }, []);\n\n const onDashboardOpenDownloadButtonClick = useCallback(() => {\n setIsDownloadSidebarOpen(true);\n }, []);\n\n const onDashboardOpenInfoSidebarButtonClick = useCallback(() => {\n caseTypeInfoDialogRef.current.open();\n }, []);\n\n const onDashboardOpenCaseSetDescriptionButtonClick = useCallback(() => {\n caseSetInfoDialogRef.current.open({\n caseSetId: caseSet?.id,\n caseTypeId: completeCaseType?.id,\n });\n }, [caseSet?.id, completeCaseType?.id]);\n\n const onDashboardLayoutSelectorSidebarReset = useCallback(() => {\n dashboardLayoutRendererRef.current?.reset();\n }, []);\n\n const shouldShowMaxResultsExceededAlert = useMemo(() => {\n return !!isMaxResultsExceeded && !isMaxResultsExceededDismissed;\n }, [isMaxResultsExceededDismissed, isMaxResultsExceeded]);\n\n return (\n <>\n {/* Sidebar */}\n <SidebarMenu>\n <SidebarMenuItem\n badgeColor={'secondary'}\n badgeContent={activeFiltersCount}\n first\n icon={<TableFiltersSidebarItemIcon />}\n onClick={onDashboardOpenFilterSidebarButtonClick}\n testIdAttributes={{ name: 'filters' }}\n title={t`Open filters`}\n />\n <SidebarMenuItem\n badgeColor={'secondary'}\n icon={<DashboardSettingsSidebarItemIcon />}\n onClick={onDashboardLayoutSelectorSidebarButtonClick}\n testIdAttributes={{ name: 'dashboard' }}\n title={t`Change dashboard layout`}\n />\n <SidebarMenuItem\n icon={<InfoIcon />}\n onClick={onDashboardOpenInfoSidebarButtonClick}\n testIdAttributes={{ name: 'case' }}\n title={t`Show case type information`}\n />\n {caseSet && (\n <SidebarMenuItem\n icon={<CollectionIcon />}\n onClick={onDashboardOpenCaseSetDescriptionButtonClick}\n testIdAttributes={{ name: 'event' }}\n title={t`Show event information`}\n />\n )}\n <SidebarMenuItem\n icon={<DashboardDownloadSidebarItemIcon />}\n onClick={onDashboardOpenDownloadButtonClick}\n testIdAttributes={{ name: 'download' }}\n title={t`Download`}\n />\n <TableFiltersSidebarItem\n onClose={onDashboardFilterSidebarClose}\n open={isFilterSidebarOpen}\n />\n <DashboardSettingsSidebarItem\n onClose={onDashboardSettingsSidebarClose}\n onReset={onDashboardLayoutSelectorSidebarReset}\n open={isSettingsSidebarOpen}\n />\n <CaseTypeInfoDialog\n ref={caseTypeInfoDialogRef}\n />\n {caseSet && (\n <CaseSetInfoDialog ref={caseSetInfoDialogRef} />\n )}\n <DashboardDownloadSidebarItem\n onClose={onDashboardDownloadSidebarClose}\n open={isDownloadSidebarOpen}\n />\n </SidebarMenu>\n {/* Content */}\n <Box\n sx={{\n display: 'grid',\n gridTemplateRows: `${shouldShowMaxResultsExceededAlert ? 'max-content ' : ''}max-content auto`,\n height: '100%',\n paddingLeft: theme.spacing(ConfigService.getInstance().config.layout.SIDEBAR_MENU_WIDTH + 1),\n width: '100%',\n }}\n >\n {shouldShowMaxResultsExceededAlert && (\n <Box\n sx={{\n marginY: theme.spacing(1),\n }}\n >\n <Alert\n onClose={onMaxResultsExceededButtonClose}\n severity={'warning'}\n sx={{\n width: '100%',\n }}\n >\n <AlertTitle>\n {t`Maximum number of results exceeded`}\n </AlertTitle>\n {t('The maximum number of results for {{caseTypeName}} ({{maxResultsForCaseType}}) has been exceeded. Refine your filters to reduce the number of results.', { caseTypeName: completeCaseType.name, maxResultsForCaseType: completeCaseType.props.read_max_n_cases })}\n </Alert>\n </Box>\n )}\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n }}\n >\n <Grouping />\n <DashboardSearch />\n </Box>\n <Box>\n <DashboardLayoutRenderer\n disabled={isFilterSidebarOpen || isSettingsSidebarOpen}\n ref={dashboardLayoutRendererRef}\n />\n </Box>\n </Box>\n <EpiContactDetailsDialog ref={contactDetailsDialogRef} />\n <FindSimilarCasesDialog ref={findSimilarCasesDialogRef} />\n <RemoveFindSimilarCasesResultDialog ref={removeFindSimilarCasesResultDialogRef} />\n <SequenceDownloadDialog ref={sequenceDownloadDialogRef} />\n <CaseInfoDialog ref={caseInfoDialogRef} />\n <CreateEventDialog ref={createEventDialogRef} />\n <RemoveCasesFromEventDialog ref={removeCasesFromEventDialogRef} />\n <AddCasesToEventDialog ref={addCasesToEventDialogRef} />\n </>\n );\n};\n","import {\n use,\n useCallback,\n useMemo,\n} from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport { Subject } from '@gen-epix/ui-core/classes/Subject';\n\nimport type {\n Highlighting,\n LineListRangeSubjectValue,\n LinkedScrollSubjectValue,\n} from '../../../../models/caseDb';\nimport { UserProfileStoreContext } from '../../../../stores/userProfileStore/userProfileStoreContext';\n\nimport { DashboardContext } from './DashboardContext';\n\nexport type DashboardContextProviderProps = PropsWithChildren<{\n caseSet: CaseDbCaseSet;\n}>;\n\nexport const DashboardContextProvider = ({ caseSet, children }: DashboardContextProviderProps) => {\n const userProfileStore = use(UserProfileStoreContext);\n const highlightSubject = useMemo<Subject<Highlighting>>(() => new Subject({\n caseIds: [],\n origin: null,\n }), []);\n const lineListRangeSubject = useMemo<Subject<LineListRangeSubjectValue>>(() => new Subject(), []);\n const linkedScrollSubject = useMemo<Subject<LinkedScrollSubjectValue>>(() => new Subject(), []);\n\n const reset = useCallback(() => {\n highlightSubject.next({\n caseIds: [],\n origin: null,\n });\n lineListRangeSubject.next(undefined);\n linkedScrollSubject.next(undefined);\n }, [highlightSubject, lineListRangeSubject, linkedScrollSubject]);\n\n const highlight = useCallback((highlighting: Highlighting) => {\n if (userProfileStore.getState().dashboardGeneralSettings.isHighlightingEnabled) {\n highlightSubject.next(highlighting);\n }\n }, [highlightSubject, userProfileStore]);\n\n const contextValue = useMemo(() => {\n return {\n caseSet,\n highlight,\n highlightSubject,\n lineListRangeSubject,\n linkedScrollSubject,\n reset,\n };\n }, [caseSet, highlight, highlightSubject, lineListRangeSubject, linkedScrollSubject, reset]);\n return (\n <DashboardContext value={contextValue}>\n {children}\n </DashboardContext>\n );\n};\n","import type {\n CaseDbCase,\n CaseDbCaseSet,\n} from '@gen-epix/api-casedb';\nimport { ResponseHandler } from '@gen-epix/ui/components/ui/ResponseHandler';\nimport { Box } from '@mui/system';\nimport {\n use,\n useCallback,\n useEffect,\n useState,\n} from 'react';\nimport { useStore } from 'zustand';\n\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { withEpiDashboardStore } from '../DashboardStoreLoader';\nimport { EventBusService } from '../../../classes/services/EventBusService';\nimport { DashboardEditCases } from '../DashboardEditCases';\n\nimport { DashboardContent } from './DashboardContent';\nimport { DashboardContextProvider } from './context/DashboardContextProvider';\n\ntype DashboardProps = {\n readonly caseSet?: CaseDbCaseSet;\n};\n\nexport const Dashboard = withEpiDashboardStore(({ caseSet }: DashboardProps) => {\n const dashboardStore = use(DashboardStoreContext);\n const dataError = useStore(dashboardStore, (state) => state.dataError);\n const [casesToEdit, setCasesToEdit] = useState<CaseDbCase[] | null>(null);\n\n const onDashboardEditCasesClose = useCallback(() => {\n setCasesToEdit(null);\n }, []);\n\n useEffect(() => {\n const eventBus = EventBusService.getInstance();\n const removers = [\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openEditCases', (cases: CaseDbCase[]) => {\n setCasesToEdit(cases);\n }),\n ];\n return () => {\n removers.forEach(callbackfn => callbackfn());\n };\n }, []);\n\n return (\n <DashboardContextProvider caseSet={caseSet}>\n <Box\n sx={{\n height: '100%',\n position: 'relative',\n width: '100%',\n }}\n >\n <ResponseHandler\n error={dataError}\n isLoading={false}\n >\n {casesToEdit ? (\n <DashboardEditCases\n cases={casesToEdit}\n onClose={onDashboardEditCasesClose}\n />\n ) : (\n <DashboardContent caseSet={caseSet} />\n )}\n </ResponseHandler>\n </Box>\n </DashboardContextProvider>\n );\n});\n","import {\n Box,\n Divider,\n styled,\n Tooltip,\n Typography,\n useTheme,\n} from '@mui/material';\nimport CloseIcon from '@mui/icons-material/Close';\nimport ZoomInMapIcon from '@mui/icons-material/ZoomInMap';\nimport ZoomOutMapIcon from '@mui/icons-material/ZoomOutMap';\nimport { useTranslation } from 'react-i18next';\nimport { useStore } from 'zustand';\nimport type {\n PropsWithChildren,\n ReactNode,\n} from 'react';\nimport {\n isValidElement,\n use,\n useCallback,\n useMemo,\n} from 'react';\nimport type { MenuItemData } from '@gen-epix/ui/models/nestedMenu';\nimport { MenuDataUtil } from '@gen-epix/ui/utils/MenuDataUtil';\nimport { NestedDropdown } from '@gen-epix/ui/components/ui/NestedMenu';\nimport { Spinner } from '@gen-epix/ui/components/ui/Spinner';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { WidgetMenu } from '../WidgetMenu';\nimport { WidgetHeaderIconButton } from '../WidgetHeaderIconButton';\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { DashboardUtil } from '../../../utils/DashboardUtil';\nimport { Warning } from '../Warning';\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\n\nimport { DashboardZoneContext } from './DashboardZoneContext';\n\n\nexport type DashboardWidgetProps = PropsWithChildren<{\n readonly expandDisabled?: boolean;\n readonly isLoading?: boolean;\n readonly primaryMenu?: MenuItemData[] | ReactNode;\n readonly secondaryMenu?: MenuItemData[] | ReactNode;\n readonly title: MenuItemData | ReactNode | string;\n readonly warningMessage?: string;\n readonly widgetName?: string;\n}>;\n\nconst StyledDivider = styled(Divider)(({ theme }) => ({\n marginBottom: theme.spacing(0.5),\n marginTop: theme.spacing(0.5),\n}));\n\nexport const DashboardWidget = ({ children, expandDisabled, isLoading, primaryMenu, secondaryMenu, title, warningMessage, widgetName }: DashboardWidgetProps) => {\n const theme = useTheme();\n const { t } = useTranslation();\n\n const userProfileStore = use(UserProfileStoreContext);\n const dashboardStore = use(DashboardStoreContext);\n const zoneKey = use(DashboardZoneContext);\n const expandZone = useStore(dashboardStore, (state) => state.expandZone);\n const expandedZone = useStore(dashboardStore, (state) => state.expandedZone);\n const enabledLayoutZoneCount = useStore(userProfileStore, (state) => DashboardUtil.getEnabledWidgets(state.dashboardArrangementConfig).length);\n const setDashboardArrangementConfig = useStore(userProfileStore, (state) => state.setDashboardArrangementConfig);\n\n const isExpanded = expandedZone === zoneKey;\n\n const onExpandButtonClick = useCallback(() => {\n expandZone(expandedZone === zoneKey ? null : zoneKey);\n }, [expandZone, expandedZone, zoneKey]);\n\n const onRemoveButtonClick = useCallback(() => {\n const { dashboardArrangementConfig } = userProfileStore.getState();\n setDashboardArrangementConfig({\n ...dashboardArrangementConfig,\n arrangementWidgetAssignments: {\n ...dashboardArrangementConfig.arrangementWidgetAssignments,\n [zoneKey]: null,\n },\n });\n }, [setDashboardArrangementConfig, userProfileStore, zoneKey]);\n\n\n const titleInnerElement = useMemo(() => {\n if (typeof title === 'string') {\n return (\n <Tooltip\n arrow\n placement={'right'}\n title={title}\n >\n <Typography\n component={'h2'}\n sx={{\n display: 'inline-block',\n fontWeight: 'bold',\n lineHeight: theme.spacing(3),\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n variant={'body1'}\n >\n {title}\n </Typography>\n </Tooltip>\n );\n }\n if (isValidElement(title)) {\n return title;\n }\n if (MenuDataUtil.isMenuItemData(title)) {\n return (\n <NestedDropdown\n ButtonProps={{\n color: 'inherit',\n size: 'small',\n sx: {\n '& span': {\n margin: 0,\n },\n background: 'none !important',\n margin: 0,\n padding: 0,\n textTransform: 'none',\n },\n variant: 'text',\n }}\n menuItemsData={title}\n showTopLevelTooltip\n />\n );\n }\n }, [theme, title]);\n\n const titleElement = useMemo(() => (\n <Box\n sx={{\n height: theme.spacing(3),\n position: 'relative',\n width: '100%',\n }}\n >\n <Box\n sx={{\n height: theme.spacing(3),\n left: 0,\n maxWidth: '100%',\n position: 'absolute',\n }}\n >\n {titleInnerElement}\n </Box>\n </Box>\n ), [theme, titleInnerElement]);\n\n return (\n <Box\n {...TestIdUtil.createAttributes('DashboardWidget', { 'widget-name': widgetName })}\n sx={{\n height: '100%',\n }}\n >\n\n {/* Widget header bar */}\n <Box\n sx={{\n display: 'flex',\n height: theme.spacing(3),\n justifyContent: 'space-between',\n }}\n >\n {/* Title */}\n {titleElement}\n <Box\n sx={{\n display: 'flex',\n }}\n >\n {/* primary menu */}\n <Box\n sx={{\n display: 'flex',\n height: `calc(${theme.spacing(3)} - 1px)`,\n justifySelf: 'right',\n marginTop: '1px',\n }}\n >\n {primaryMenu && <WidgetMenu menu={primaryMenu} />}\n {primaryMenu && (\n <StyledDivider\n aria-hidden={'true'}\n flexItem\n orientation={'vertical'}\n variant={'middle'}\n />\n )}\n </Box>\n {/* secondary menu */}\n <Box\n sx={{\n display: 'flex',\n height: `calc(${theme.spacing(3)} - 1px)`,\n justifySelf: 'right',\n marginTop: '1px',\n }}\n >\n {secondaryMenu && <WidgetMenu menu={secondaryMenu} />}\n {secondaryMenu && (\n <StyledDivider\n aria-hidden={'true'}\n flexItem\n orientation={'vertical'}\n variant={'middle'}\n />\n )}\n {enabledLayoutZoneCount > 1 && (\n <WidgetHeaderIconButton\n disabled={expandDisabled}\n label={isExpanded ? t`Collapse` : t`Expand`}\n onClick={onExpandButtonClick}\n >\n {isExpanded && (\n <ZoomInMapIcon />\n )}\n {!isExpanded && (\n <ZoomOutMapIcon />\n )}\n </WidgetHeaderIconButton>\n )}\n {!isExpanded && (\n <WidgetHeaderIconButton\n label={t`Remove widget`}\n onClick={onRemoveButtonClick}\n sx={{\n marginRight: theme.spacing(-1),\n }}\n >\n <CloseIcon />\n </WidgetHeaderIconButton>\n )}\n </Box>\n </Box>\n\n </Box>\n {/* Widget content */}\n <Box\n sx={{\n height: `calc(100% - ${theme.spacing(3)})`,\n position: 'relative',\n }}\n >\n {warningMessage && (\n <Box\n sx={{\n height: theme.spacing(3),\n }}\n >\n <Warning warningMessage={warningMessage} />\n </Box>\n )}\n <Box\n sx={{\n height: warningMessage ? `calc(100% - ${theme.spacing(3)})` : '100%',\n }}\n >\n {isLoading && (\n <Spinner\n label={t`Loading`}\n />\n )}\n {!isLoading && children}\n </Box>\n </Box>\n </Box>\n );\n};\n"],"x_google_ignoreList":[5,10],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAa,KAAqC,IAChD,EACE,oBACA,YACA,kBACA,mBAEe;CACjB,IAAM,EAAE,SAAM,EAAe,GACvB,IAAS,GAAM,GACf,IAAiB,EAAI,CAAqB,GAC1C,IAA6B,EAAS,IAAiB,MAAU,EAAM,0BAA0B,GACjG,IAAqB,QAAc,EAAe,sBAAsB,EAAU,gBAAgB,GAAG,CAAC,EAAU,gBAAgB,CAAC,GACjI,IAA0B,EAAS,IAAiB,MAAU,EAAM,uBAAuB,GAC3F,CAAC,GAAqC,KAA0C,EAAS,CAAuB;CAEtH,QAAgB;EACd,EAAc,CAAC,mCAAmC;CACpD,GAAG,CAAC,GAAG,CAAa,CAAC;CAErB,IAAM,IAAwC,QAAkB;EAE9D,AADA,EAAgC,CAAmC,GACnE,EAAQ;CAEV,GAAG;EAAC;EAA4B;EAAqC;CAAO,CAAC,GAEvE,IAAoB,QAAkB;EAC1C,EAAuC,CAAuB;CAChE,GAAG,CAAC,CAAuB,CAAC,GAEtB,IAAiC,QAAkB;EAEvD,AADA,EAAgC,CAAC,CAAC,GAClC,EAAQ;CACV,GAAG,CAAC,GAA4B,CAAO,CAAC;CAExC,QAAgB;EACd,IAAM,IAA0B,CAAC;EA0BjC,AAzBA,EAAQ,KAAK;GACX,GAAG,EAAW,iBAAiB,gDAAgD;GAC/E,OAAO;GACP,OAAO,CAAC;GACR,SAAS;GACT,SAAS;EACX,CAAC,GACG,EAAwB,WAAW,EAAoC,UACzE,EAAQ,KAAK;GACX,GAAG,EAAW,iBAAiB,+CAA+C;GAC9E,OAAO;GACP,OAAO,CAAC;GACR,SAAS;GACT,SAAS;EACX,CAAC,GAEC,EAAwB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GACZ;aAJF,CAMG,KACC,kBAAC,GAAD;IACE,IAAI,EACF,QAAQ,EAAM,QAAQ,CAAC,EACzB;cAEA,kBAAC,IAAD,EAAyB,kBAAiB,CAAA;GACvC,CAAA,GAEP,kBAAC,GAAD;IACE,IAAI,EACF,QAAQ,IAAiB,eAAe,EAAM,QAAQ,CAAC,EAAE,KAAK,OAChE;cAHF,CAKG,KACC,kBAAC,IAAD,EACE,OAAO,CAAC,UACT,CAAA,GAEF,CAAC,KAAa,CACZ;KACF;IACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"Dashboard.js","names":["y","f","d"],"sources":["../../src/components/ui/RemoveFindSimilarCasesResultDialog/RemoveFindSimilarCasesResultDialog.tsx","../../src/components/ui/Dashboard/DashboardGeneralSettingsForm.tsx","../../src/components/ui/Dashboard/DashboardLayoutSettingsForm.tsx","../../src/components/ui/Dashboard/DashboardWidgetSettingsForm.tsx","../../src/components/ui/Dashboard/DashboardSettingsSidebarItem.tsx","../../../../node_modules/.pnpm/react-error-boundary@6.1.4_@types+react@19.2.18_react@19.2.8/node_modules/react-error-boundary/dist/react-error-boundary.js","../../src/components/ui/Dashboard/DashboardZoneContext.ts","../../src/components/ui/Dashboard/DashboardWidgetPlaceHolder.tsx","../../src/components/ui/Dashboard/DashboardLayoutRenderer.tsx","../../src/components/ui/Dashboard/DashboardDownloadSidebarItem.tsx","../../../../node_modules/.pnpm/fuse.js@7.5.0/node_modules/fuse.js/dist/fuse.mjs","../../src/components/ui/Dashboard/DashboardSearchSettings.tsx","../../src/components/ui/Dashboard/DashboardSearch.tsx","../../src/components/ui/Dashboard/DashboardContent.tsx","../../src/components/ui/Dashboard/context/DashboardContextProvider.tsx","../../src/components/ui/Dashboard/Dashboard.tsx","../../src/components/ui/Dashboard/DashboardWidget.tsx"],"sourcesContent":["import {\n use,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport type { ReactElement } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport { useStore } from 'zustand';\nimport { produce } from 'immer';\nimport type { CaseDbCompleteCaseType } from '@gen-epix/api-casedb';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\nimport type { Step } from '@gen-epix/ui-core-components/components/Stepper';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport {\n Stepper,\n STEPPER_DIRECTION,\n} from '@gen-epix/ui-core-components/components/Stepper';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { TreeWidgetUtil } from '../../../utils/TreeWidgetUtil';\n\n\nexport interface RemoveFindSimilarCasesResultDialogOpenProps {\n completeCaseType: CaseDbCompleteCaseType;\n}\n\nexport interface RemoveFindSimilarCasesResultDialogProps extends WithDialogRenderProps<RemoveFindSimilarCasesResultDialogOpenProps> {\n //\n}\n\nexport type RemoveFindSimilarCasesResultDialogRefMethods = WithDialogRefMethods<RemoveFindSimilarCasesResultDialogProps, RemoveFindSimilarCasesResultDialogOpenProps>;\n\nexport const RemoveFindSimilarCasesResultDialog = withDialog<RemoveFindSimilarCasesResultDialogProps, RemoveFindSimilarCasesResultDialogOpenProps>((\n {\n onActionsChange,\n onClose,\n onTitleChange,\n openProps,\n }: RemoveFindSimilarCasesResultDialogProps,\n): ReactElement => {\n const { t } = useTranslation();\n const formId = useId();\n const dashboardStore = use(DashboardStoreContext);\n const setFindSimilarCasesResults = useStore(dashboardStore, (state) => state.setFindSimilarCasesResults);\n const treeConfigurations = useMemo(() => TreeWidgetUtil.getTreeConfigurations(openProps.completeCaseType), [openProps.completeCaseType]);\n const findSimilarCasesResults = useStore(dashboardStore, (state) => state.findSimilarCasesResults);\n const [intermediateFindSimilarCasesResults, setIntermediateFindSimilarCasesResults] = useState(findSimilarCasesResults);\n\n useEffect(() => {\n onTitleChange(t`Remove similar cases from results`);\n }, [t, onTitleChange]);\n\n const onApplyIntermediateResultsButtonClick = useCallback(() => {\n void setFindSimilarCasesResults(intermediateFindSimilarCasesResults);\n onClose();\n\n }, [setFindSimilarCasesResults, intermediateFindSimilarCasesResults, onClose]);\n\n const onUndoButtonClick = useCallback(() => {\n setIntermediateFindSimilarCasesResults(findSimilarCasesResults);\n }, [findSimilarCasesResults]);\n\n const onRemoveAllAndCloseButtonClick = useCallback(() => {\n void setFindSimilarCasesResults([]);\n onClose();\n }, [setFindSimilarCasesResults, onClose]);\n\n useEffect(() => {\n const actions: DialogAction[] = [];\n actions.push({\n ...TestIdUtil.createAttributes('RemoveFindSimilarCasesResultDialog-closeButton'),\n color: 'primary',\n label: t`Close`,\n onClick: onClose,\n variant: 'outlined',\n });\n if (findSimilarCasesResults.length !== intermediateFindSimilarCasesResults.length) {\n actions.push({\n ...TestIdUtil.createAttributes('RemoveFindSimilarCasesResultDialog-undoButton'),\n color: 'secondary',\n label: t`Undo`,\n onClick: onUndoButtonClick,\n variant: 'outlined',\n });\n }\n if (findSimilarCasesResults.length !== intermediateFindSimilarCasesResults.length) {\n actions.push({\n ...TestIdUtil.createAttributes('RemoveFindSimilarCasesResultDialog-applyButton'),\n color: 'secondary',\n label: t`Apply and close`,\n onClick: onApplyIntermediateResultsButtonClick,\n variant: 'contained',\n });\n }\n onActionsChange(actions);\n }, [formId, onActionsChange, onClose, t, findSimilarCasesResults, intermediateFindSimilarCasesResults, onApplyIntermediateResultsButtonClick, onUndoButtonClick]);\n\n const onRemoveCasesButtonClick = useCallback((index: number) => {\n setIntermediateFindSimilarCasesResults(produce(intermediateFindSimilarCasesResults, draft => {\n draft.splice(index, 1);\n return draft;\n }));\n }, [intermediateFindSimilarCasesResults]);\n\n const steps = useMemo((): Step[] => {\n return [\n {\n content: (\n <Box\n sx={{\n marginBottom: 2,\n marginTop: 1,\n }}\n >\n <Button\n color={'primary'}\n onClick={onRemoveAllAndCloseButtonClick}\n variant={'outlined'}\n >\n {t('Remove all similar cases from result')}\n </Button>\n </Box>\n ),\n index: '',\n key: 'start',\n label: t('Result without similar cases ({{numberOfCases}} cases)', {\n numberOfCases: findSimilarCasesResults?.[0]?.originalCaseIds.length || 0,\n }),\n },\n ...intermediateFindSimilarCasesResults.map((item, index) => ({\n content: (\n <Box>\n <Box component={'ul'}>\n <Box component={'li'}>\n {t('Tree: {{treeLabel}}', {\n treeLabel: treeConfigurations.find((config) => config.col.id === item.colId)?.col?.label || item.colId,\n })}\n </Box>\n <Box component={'li'}>\n {t('Distance: {{distance}}', {\n distance: item.distance,\n })}\n </Box>\n <Box component={'li'}>\n {t('Found similar cases: {{foundCases}}', {\n foundCases: item.similarCaseIds.length,\n })}\n </Box>\n <Box component={'li'}>\n {t('New number of cases: {{numberOfCases}}', {\n numberOfCases: item.similarCaseIds.length + item.originalCaseIds.length,\n })}\n </Box>\n </Box>\n <Box\n sx={{\n marginBottom: 2,\n marginTop: 1,\n }}\n >\n <Button\n color={'primary'}\n disabled={index !== intermediateFindSimilarCasesResults.length - 1}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => onRemoveCasesButtonClick(index)}\n variant={'outlined'}\n >\n {t('Remove')}\n </Button>\n </Box>\n </Box>\n ),\n index: (index + 1).toString(),\n key: item.key,\n label: t('Searched {{numberOfInputCases}} cases for similar cases.', {\n numberOfInputCases: item.originalCaseIds.length,\n }),\n }))];\n }, [findSimilarCasesResults, intermediateFindSimilarCasesResults, onRemoveAllAndCloseButtonClick, onRemoveCasesButtonClick, t, treeConfigurations]);\n\n return (\n <Box\n sx={{\n position: 'relative',\n }}\n >\n {steps.length === 0 && (\n <Typography>\n {t('No similar cases results to remove.')}\n </Typography>\n )}\n {steps.length > 0 && (\n <Stepper\n activeStep={steps[steps.length - 1].key}\n direction={STEPPER_DIRECTION.VERTICAL}\n hideCompletedIndicator\n steps={steps}\n />\n )}\n </Box>\n );\n\n}, {\n defaultTitle: '',\n fullWidth: true,\n maxWidth: 'lg',\n testId: 'RemoveFindSimilarCasesResultDialog',\n});\n","import {\n Box,\n Button,\n FormGroup,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport RestartAltIcon from '@mui/icons-material/RestartAlt';\nimport {\n FormProvider,\n useForm,\n useWatch,\n} from 'react-hook-form';\nimport {\n use,\n useCallback,\n useEffect,\n} from 'react';\nimport { useStore } from 'zustand';\nimport { useShallow } from 'zustand/shallow';\nimport { Switch } from '@gen-epix/ui-core-form/components/fields/Switch';\n\nimport type { DashboardGeneralSettings } from '../../../stores/userProfileStore';\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\n\nexport const DashboardGeneralSettingsForm = () => {\n const { t } = useTranslation();\n const userProfileStore = use(UserProfileStoreContext);\n\n const resetDashboardGeneralSettings = useStore(userProfileStore, useShallow((state) => state.resetDashboardGeneralSettings));\n const dashboardGeneralSettings = useStore(userProfileStore, useShallow((state) => state.dashboardGeneralSettings));\n const setDashboardGeneralSettings = useStore(userProfileStore, useShallow((state) => state.setDashboardGeneralSettings));\n\n const formMethods = useForm<DashboardGeneralSettings>({\n defaultValues: dashboardGeneralSettings,\n values: dashboardGeneralSettings,\n });\n const { control } = formMethods;\n\n const formValues = useWatch({ control });\n\n const onResetButtonClick = useCallback(() => {\n resetDashboardGeneralSettings();\n }, [resetDashboardGeneralSettings]);\n\n useEffect(() => {\n setDashboardGeneralSettings(formValues as DashboardGeneralSettings);\n }, [formValues, setDashboardGeneralSettings]);\n\n const onSubmit = useCallback(() => {\n // noop, as the form only contains switches that update the state on change\n }, []);\n\n return (\n <FormProvider {...formMethods}>\n <form\n autoComplete={'off'}\n onSubmit={onSubmit}\n >\n <Box\n sx={{\n marginY: 1,\n }}\n >\n <FormGroup>\n <Switch<DashboardGeneralSettings>\n label={t`Enable highlighting across widgets`}\n name={'isHighlightingEnabled'}\n />\n </FormGroup>\n </Box>\n </form>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <Box\n sx={{\n marginX: 1,\n }}\n >\n <Button\n color={'primary'}\n onClick={onResetButtonClick}\n startIcon={<RestartAltIcon />}\n variant={'outlined'}\n >\n {t`Reset general settings`}\n </Button>\n </Box>\n </Box>\n </FormProvider>\n );\n};\n","import {\n Box,\n Button,\n FormGroup,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport RestartAltIcon from '@mui/icons-material/RestartAlt';\nimport {\n FormProvider,\n useForm,\n useWatch,\n} from 'react-hook-form';\nimport {\n use,\n useCallback,\n useEffect,\n} from 'react';\nimport { useStore } from 'zustand';\nimport { useShallow } from 'zustand/shallow';\nimport { ConfigService } from '@gen-epix/ui-client-common/classes/services/ConfigService';\nimport noop from 'lodash/noop';\n\nimport { ArrangementEditor } from '../../form/fields/ArrangementEditor';\nimport type { CaseDbConfig } from '../../../models/config';\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\nimport { DashboardUtil } from '../../../utils/DashboardUtil';\n\nexport type DashboardLayoutSettingsFormProps = {\n readonly onReset: () => void;\n};\n\ntype FormValues = {\n arrangementKey: string;\n};\n\nexport const DashboardLayoutSettingsForm = ({ onReset }: DashboardLayoutSettingsFormProps) => {\n const { t } = useTranslation();\n const userProfileStore = use(UserProfileStoreContext);\n\n const resetDashboardLayout = useStore(userProfileStore, useShallow((state) => state.resetDashboardLayout));\n const dashboardArrangementConfig = useStore(userProfileStore, useShallow((state) => state.dashboardArrangementConfig));\n const setDashboardLayoutUserConfig = useStore(userProfileStore, useShallow((state) => state.setDashboardArrangementConfig));\n\n const formMethods = useForm<FormValues>({\n values: {\n arrangementKey: dashboardArrangementConfig.arrangementKey,\n },\n });\n const { control } = formMethods;\n\n const formValues = useWatch({ control });\n\n const onResetButtonClick = useCallback(() => {\n resetDashboardLayout();\n if (onReset) {\n onReset();\n }\n }, [onReset, resetDashboardLayout]);\n\n useEffect(() => {\n const { arrangementKey } = formValues;\n if (!arrangementKey) {\n return;\n }\n const arrangementOptions = ConfigService.getInstance<CaseDbConfig>().config.dashboard.ARRANGEMENT_OPTIONS;\n const arrangement = arrangementOptions[arrangementKey];\n if (!arrangement) {\n return;\n }\n\n setDashboardLayoutUserConfig({\n arrangementKey,\n arrangementWidgetAssignments: DashboardUtil.getArrangementWidgetAssignments(arrangement, ConfigService.getInstance<CaseDbConfig>().config.dashboard.DEFAULT_WIDGET_ASSIGNMENTS[arrangementKey]),\n });\n }, [formValues, setDashboardLayoutUserConfig]);\n\n const onSubmit = noop;\n\n return (\n <FormProvider {...formMethods}>\n <form\n autoComplete={'off'}\n onSubmit={onSubmit}\n >\n <Box\n sx={{\n marginY: 1,\n }}\n >\n <FormGroup>\n <ArrangementEditor\n label={t`Arrangement`}\n name={'arrangementKey'}\n options={ConfigService.getInstance<CaseDbConfig>().config.dashboard.ARRANGEMENT_OPTIONS}\n />\n </FormGroup>\n </Box>\n </form>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <Box\n sx={{\n marginX: 1,\n }}\n >\n <Button\n color={'primary'}\n onClick={onResetButtonClick}\n startIcon={<RestartAltIcon />}\n variant={'outlined'}\n >\n {t`Reset dashboard layout`}\n </Button>\n </Box>\n </Box>\n </FormProvider>\n );\n};\n","import {\n Box,\n Button,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport RestartAltIcon from '@mui/icons-material/RestartAlt';\nimport type { FieldValues } from 'react-hook-form';\nimport {\n useForm,\n useWatch,\n} from 'react-hook-form';\nimport {\n use,\n useCallback,\n useEffect,\n useId,\n useMemo,\n} from 'react';\nimport { useStore } from 'zustand';\nimport { useShallow } from 'zustand/shallow';\nimport { ConfigService } from '@gen-epix/ui-client-common/classes/services/ConfigService';\nimport { GenericForm } from '@gen-epix/ui-core-form/components/helpers/GenericForm';\nimport { FormUtil } from '@gen-epix/ui-core-form/utils/FormUtil';\n\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\nimport type { CaseDbConfig } from '../../../models/config';\n\nexport type DashboardEpiCurveSettingsFormProps = {\n readonly widgetName: string;\n};\n\nexport const DashboardWidgetSettingsForm = ({ widgetName }: DashboardEpiCurveSettingsFormProps) => {\n const { t } = useTranslation();\n const userProfileStore = use(UserProfileStoreContext);\n const formId = useId();\n\n const resetWidgetSettings = useStore(userProfileStore, useShallow((state) => state.resetWidgetSettings));\n const setWidgetSettings = useStore(userProfileStore, useShallow((state) => state.setWidgetSettings));\n const formFieldDefinitions = ConfigService.getInstance<CaseDbConfig>().config.dashboard.WIDGETS[widgetName].configFormFieldsDefinitions;\n const defaultFormValues = ConfigService.getInstance<CaseDbConfig>().config.dashboard.WIDGETS[widgetName].configDefaultValues;\n\n const schema = useMemo(() => {\n if (!formFieldDefinitions) {\n return undefined;\n }\n return FormUtil.createYupSchemaFromFormFieldDefinitions(formFieldDefinitions);\n }, [formFieldDefinitions]);\n\n const formMethods = useForm<FieldValues>({\n defaultValues: defaultFormValues,\n values: defaultFormValues,\n });\n const { control } = formMethods;\n\n const formValues = useWatch({ control });\n\n const onResetButtonClick = useCallback(() => {\n resetWidgetSettings(widgetName);\n }, [resetWidgetSettings, widgetName]);\n\n useEffect(() => {\n setWidgetSettings(widgetName, formValues);\n }, [formValues, setWidgetSettings, widgetName]);\n\n const onSubmit = useCallback(() => {\n // No submit action needed since changes are applied immediately\n }, []);\n\n return (\n <Box>\n <Box\n sx={{\n marginY: 1,\n }}\n >\n <GenericForm<FieldValues>\n formFieldDefinitions={formFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={onSubmit}\n schema={schema}\n />\n </Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <Box\n sx={{\n marginX: 1,\n }}\n >\n <Button\n color={'primary'}\n onClick={onResetButtonClick}\n startIcon={<RestartAltIcon />}\n variant={'outlined'}\n >\n {t('Reset {widgetName} settings', { widgetName })}\n </Button>\n </Box>\n </Box>\n </Box>\n );\n};\n","import {\n Box,\n Divider,\n Typography,\n useTheme,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport SettingsIcon from '@mui/icons-material/Settings';\nimport { useMemo } from 'react';\nimport type { SidebarItemSharedProps } from '@gen-epix/ui-client-common/components/ui/Sidebar';\nimport { ConfigService } from '@gen-epix/ui-client-common/classes/services/ConfigService';\nimport { SidebarItem } from '@gen-epix/ui-client-common/components/ui/Sidebar';\n\nimport type { CaseDbConfig } from '../../../models/config';\n\nimport { DashboardGeneralSettingsForm } from './DashboardGeneralSettingsForm';\nimport { DashboardLayoutSettingsForm } from './DashboardLayoutSettingsForm';\nimport { DashboardWidgetSettingsForm } from './DashboardWidgetSettingsForm';\n\nexport type DashboardSettingsSidebarItemProps = {\n readonly onReset: () => void;\n} & SidebarItemSharedProps;\ntype DashboardSettingsSidebarItemContentProps = Pick<DashboardSettingsSidebarItemProps, 'onReset'>;\n\nexport const DashboardSettingsSidebarItemIcon = SettingsIcon;\n\nconst DashboardSettingsSidebarItemContent = ({ onReset }: DashboardSettingsSidebarItemContentProps) => {\n const theme = useTheme();\n const { t } = useTranslation();\n\n const items = useMemo(() => {\n const x = [\n {\n component: <DashboardLayoutSettingsForm onReset={onReset} />,\n label: t`Dashboard layout`,\n },\n {\n component: <DashboardGeneralSettingsForm />,\n label: t`General`,\n },\n ];\n Object.entries(ConfigService.getInstance<CaseDbConfig>().config.dashboard.WIDGETS).forEach(([widgetName, widgetConfig]) => {\n if (widgetConfig.configFormFieldsDefinitions) {\n x.push({\n component: <DashboardWidgetSettingsForm widgetName={widgetName} />,\n label: widgetConfig.widgetLabel,\n });\n }\n });\n return x;\n }, [onReset, t]);\n\n return (\n <Box\n sx={{\n width: theme.spacing(59),\n }}\n >\n {items.map(({ component, label }, index) => (\n <Box\n key={label}\n sx={{\n marginTop: index !== 0 ? 2 : 0,\n paddingTop: index !== items.length - 1 ? 1 : 0,\n }}\n >\n <Box\n sx={{\n marginBottom: 2,\n }}\n >\n <Typography variant={'h5'}>\n {label}\n </Typography>\n </Box>\n <Box\n sx={{\n marginBottom: 2,\n marginRight: 1,\n }}\n >\n {component}\n </Box>\n <Divider\n flexItem\n orientation={'horizontal'}\n sx={{\n marginLeft: 0,\n marginRight: 1,\n }}\n variant={'middle'}\n />\n </Box>\n ))}\n </Box>\n );\n};\n\n// eslint-disable-next-line @eslint-react/kit/no-multi-comp\nexport const DashboardSettingsSidebarItem = ({ onClose, onReset, open }: DashboardSettingsSidebarItemProps) => {\n const { t } = useTranslation();\n\n return (\n <SidebarItem\n closeIcon={<DashboardSettingsSidebarItemIcon />}\n closeIconTooltipText={t`Close settings`}\n onClose={onClose}\n open={open}\n testIdAttributes={{ name: 'DashboardSettingsSidebarItem' }}\n title={t`Settings`}\n width={60}\n >\n {open && <DashboardSettingsSidebarItemContent onReset={onReset} />}\n </SidebarItem>\n );\n};\n","\"use client\";\nimport { createContext as y, Component as f, createElement as d, useContext as l, useState as p, useMemo as E, forwardRef as B } from \"react\";\nconst h = y(null), c = {\n didCatch: !1,\n error: null\n};\nclass m extends f {\n constructor(e) {\n super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = c;\n }\n static getDerivedStateFromError(e) {\n return { didCatch: !0, error: e };\n }\n resetErrorBoundary(...e) {\n const { didCatch: t } = this.state;\n t && (this.props.onReset?.({\n args: e,\n reason: \"imperative-api\"\n }), this.setState(c));\n }\n componentDidCatch(e, t) {\n this.props.onError?.(e, t);\n }\n componentDidUpdate(e, t) {\n const { didCatch: o } = this.state, { resetKeys: s } = this.props;\n o && t.didCatch && C(e.resetKeys, s) && (this.props.onReset?.({\n next: s,\n prev: e.resetKeys,\n reason: \"keys\"\n }), this.setState(c));\n }\n render() {\n const { children: e, fallbackRender: t, FallbackComponent: o, fallback: s } = this.props, { didCatch: n, error: a } = this.state;\n let i = e;\n if (n) {\n const u = {\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof t == \"function\")\n i = t(u);\n else if (o)\n i = d(o, u);\n else if (s !== void 0)\n i = s;\n else\n throw a;\n }\n return d(\n h.Provider,\n {\n value: {\n didCatch: n,\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n }\n },\n i\n );\n }\n}\nfunction C(r = [], e = []) {\n return r.length !== e.length || r.some((t, o) => !Object.is(t, e[o]));\n}\nfunction g(r) {\n return r !== null && typeof r == \"object\" && \"didCatch\" in r && typeof r.didCatch == \"boolean\" && \"error\" in r && \"resetErrorBoundary\" in r && typeof r.resetErrorBoundary == \"function\";\n}\nfunction x(r) {\n if (!g(r))\n throw new Error(\"ErrorBoundaryContext not found\");\n}\nfunction k() {\n const r = l(h);\n x(r);\n const { error: e, resetErrorBoundary: t } = r, [o, s] = p({\n error: null,\n hasError: !1\n }), n = E(\n () => ({\n error: e,\n resetBoundary: () => {\n t(), s({ error: null, hasError: !1 });\n },\n showBoundary: (a) => s({\n error: a,\n hasError: !0\n })\n }),\n [e, t]\n );\n if (o.hasError)\n throw o.error;\n return n;\n}\nfunction S(r) {\n switch (typeof r) {\n case \"object\": {\n if (r !== null && \"message\" in r && typeof r.message == \"string\")\n return r.message;\n break;\n }\n case \"string\":\n return r;\n }\n}\nfunction w(r, e) {\n const t = B(\n (s, n) => d(\n m,\n e,\n d(r, { ...s, ref: n })\n )\n ), o = r.displayName || r.name || \"Unknown\";\n return t.displayName = `withErrorBoundary(${o})`, t;\n}\nexport {\n m as ErrorBoundary,\n h as ErrorBoundaryContext,\n S as getErrorMessage,\n k as useErrorBoundary,\n w as withErrorBoundary\n};\n//# sourceMappingURL=react-error-boundary.js.map\n","import { createContext } from 'react';\n\nexport const DashboardZoneContext = createContext<null | string>(null);\n","import {\n Box,\n Button,\n Menu,\n MenuItem,\n} from '@mui/material';\nimport WidgetsIcon from '@mui/icons-material/Widgets';\nimport { useTranslation } from 'react-i18next';\nimport type { MouseEvent } from 'react';\nimport {\n use,\n useCallback,\n useState,\n} from 'react';\nimport { useStore } from 'zustand';\nimport { ConfigService } from '@gen-epix/ui-client-common/classes/services/ConfigService';\n\nimport type { CaseDbConfig } from '../../../models/config';\nimport { DashboardUtil } from '../../../utils/DashboardUtil';\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\n\nimport { DashboardZoneContext } from './DashboardZoneContext';\n\nexport const DashboardWidgetPlaceHolder = () => {\n const { t } = useTranslation();\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n\n const userProfileStore = use(UserProfileStoreContext);\n const zoneName = use(DashboardZoneContext);\n const dashboardArrangementConfig = useStore(userProfileStore, (state) => state.dashboardArrangementConfig);\n const setDashboardArrangementConfig = useStore(userProfileStore, (state) => state.setDashboardArrangementConfig);\n\n const widgetsConfig = ConfigService.getInstance<CaseDbConfig>().config.dashboard.WIDGETS;\n const availableWidgets = zoneName\n ? DashboardUtil.getAvailableWidgets(dashboardArrangementConfig, zoneName, widgetsConfig)\n : [];\n\n const onButtonClick = useCallback((event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n }, []);\n\n const onMenuClose = useCallback(() => {\n setAnchorEl(null);\n }, []);\n\n const onWidgetSelect = useCallback((widgetName: string) => {\n if (!zoneName) {\n return;\n }\n const { dashboardArrangementConfig: config } = userProfileStore.getState();\n setDashboardArrangementConfig({\n ...config,\n arrangementWidgetAssignments: {\n ...config.arrangementWidgetAssignments,\n [zoneName]: widgetName,\n },\n });\n setAnchorEl(null);\n }, [setDashboardArrangementConfig, userProfileStore, zoneName]);\n\n const onWidgetMenuItemClick = useCallback((event: MouseEvent<HTMLLIElement>) => {\n const widgetName = (event.currentTarget as HTMLElement).dataset['widgetName'];\n if (widgetName) {\n onWidgetSelect(widgetName);\n }\n }, [onWidgetSelect]);\n\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n }}\n >\n <Button\n onClick={onButtonClick}\n startIcon={<WidgetsIcon />}\n variant={'outlined'}\n >\n {t('Add a widget')}\n </Button>\n <Menu\n anchorEl={anchorEl}\n onClose={onMenuClose}\n open={Boolean(anchorEl)}\n >\n {availableWidgets.length === 0 && (\n <MenuItem disabled>\n {t('No widgets available')}\n </MenuItem>\n )}\n {availableWidgets.map(widgetName => (\n <MenuItem\n data-widget-name={widgetName}\n key={widgetName}\n onClick={onWidgetMenuItemClick}\n >\n {widgetsConfig[widgetName].widgetLabel}\n </MenuItem>\n ))}\n </Menu>\n </Box>\n );\n};\n","import type {\n ReactElement,\n Ref,\n} from 'react';\nimport {\n createElement,\n Fragment,\n use,\n useImperativeHandle,\n useMemo,\n} from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport type { LayoutStorage } from 'react-resizable-panels';\nimport {\n Group,\n Panel,\n useDefaultLayout,\n useGroupRef,\n} from 'react-resizable-panels';\nimport type { StoreApi } from 'zustand';\nimport { useStore } from 'zustand';\nimport { ConfigService } from '@gen-epix/ui-client-common/classes/services/ConfigService';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { DashboardUtil } from '../../../utils/DashboardUtil';\nimport type { CaseDbConfig } from '../../../models/config';\nimport {\n PanelSeparatorHorizontal,\n PanelSeparatorVertical,\n} from '../PanelSeparator';\nimport { WidgetUnavailable } from '../WidgetUnavailable';\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\nimport type { UserProfileStore } from '../../../stores/userProfileStore';\nimport type { DashboardArrangement } from '../../../models/dashboard';\n\nimport { DashboardZoneContext } from './DashboardZoneContext';\nimport { DashboardWidgetPlaceHolder } from './DashboardWidgetPlaceHolder';\n\n// Maximum number of resizable groups supported simultaneously = 16.\n// With a 9-widget maximum, the DFS group tree has at most 9 internal nodes;\n// 16 gives headroom for any configuration.\nexport type DashboardLayoutRendererProps = {\n readonly disabled?: boolean;\n readonly ref?: Ref<ForwardRefDashboardLayoutRendererRefMethods>;\n};\n\nconst panelStorageFactory = (userProfileStore: StoreApi<UserProfileStore>, panelNamePrefix: string): LayoutStorage => ({\n getItem: (name: string) => {\n return userProfileStore.getState().dashboardPanels[`${panelNamePrefix}-${name}`];\n },\n setItem: (name: string, value: string) => {\n userProfileStore.getState().setDashboardPanelConfiguration(`${panelNamePrefix}-${name}`, value);\n },\n});\n\nexport type ForwardRefDashboardLayoutRendererRefMethods = {\n reset: () => void;\n};\n\nexport const DashboardLayoutRenderer = ({\n disabled,\n ref,\n}: DashboardLayoutRendererProps) => {\n const userProfileStore = use(UserProfileStoreContext);\n const dashboardStore = use(DashboardStoreContext);\n const dashboardArrangementConfig = useStore(userProfileStore, (state) => state.dashboardArrangementConfig);\n const expandedZone = useStore(dashboardStore, (state) => state.expandedZone);\n const { MIN_PANEL_HEIGHT, MIN_PANEL_WIDTH } = ConfigService.getInstance<CaseDbConfig>().config.dashboard;\n\n const { arrangementKey, arrangementWidgetAssignments } = dashboardArrangementConfig;\n const arrangement = ConfigService.getInstance<CaseDbConfig>().config.dashboard.ARRANGEMENT_OPTIONS[arrangementKey];\n\n const storagePrefix = arrangementKey;\n\n const groupInfos = useMemo(\n () => arrangement?.cells ? DashboardUtil.getArrangementGroupInfos(arrangement, storagePrefix) : [],\n [arrangement, storagePrefix],\n );\n\n const storage = useMemo(\n () => panelStorageFactory(userProfileStore, 'epi-dashboard'),\n [userProfileStore],\n );\n\n // Pre-call MAX_GROUPS useDefaultLayout hooks (hooks must be called unconditionally).\n // Each is indexed by DFS traversal order to match getArrangementGroupInfos.\n const groupLayout0 = useDefaultLayout({ groupId: groupInfos[0]?.groupId ?? `${storagePrefix}-ph-0`, storage });\n const groupLayout1 = useDefaultLayout({ groupId: groupInfos[1]?.groupId ?? `${storagePrefix}-ph-1`, storage });\n const groupLayout2 = useDefaultLayout({ groupId: groupInfos[2]?.groupId ?? `${storagePrefix}-ph-2`, storage });\n const groupLayout3 = useDefaultLayout({ groupId: groupInfos[3]?.groupId ?? `${storagePrefix}-ph-3`, storage });\n const groupLayout4 = useDefaultLayout({ groupId: groupInfos[4]?.groupId ?? `${storagePrefix}-ph-4`, storage });\n const groupLayout5 = useDefaultLayout({ groupId: groupInfos[5]?.groupId ?? `${storagePrefix}-ph-5`, storage });\n const groupLayout6 = useDefaultLayout({ groupId: groupInfos[6]?.groupId ?? `${storagePrefix}-ph-6`, storage });\n const groupLayout7 = useDefaultLayout({ groupId: groupInfos[7]?.groupId ?? `${storagePrefix}-ph-7`, storage });\n const groupLayout8 = useDefaultLayout({ groupId: groupInfos[8]?.groupId ?? `${storagePrefix}-ph-8`, storage });\n const groupLayout9 = useDefaultLayout({ groupId: groupInfos[9]?.groupId ?? `${storagePrefix}-ph-9`, storage });\n const groupLayout10 = useDefaultLayout({ groupId: groupInfos[10]?.groupId ?? `${storagePrefix}-ph-10`, storage });\n const groupLayout11 = useDefaultLayout({ groupId: groupInfos[11]?.groupId ?? `${storagePrefix}-ph-11`, storage });\n const groupLayout12 = useDefaultLayout({ groupId: groupInfos[12]?.groupId ?? `${storagePrefix}-ph-12`, storage });\n const groupLayout13 = useDefaultLayout({ groupId: groupInfos[13]?.groupId ?? `${storagePrefix}-ph-13`, storage });\n const groupLayout14 = useDefaultLayout({ groupId: groupInfos[14]?.groupId ?? `${storagePrefix}-ph-14`, storage });\n const groupLayout15 = useDefaultLayout({ groupId: groupInfos[15]?.groupId ?? `${storagePrefix}-ph-15`, storage });\n\n // Pre-call MAX_GROUPS useGroupRef hooks for imperative reset support.\n const groupRef0 = useGroupRef();\n const groupRef1 = useGroupRef();\n const groupRef2 = useGroupRef();\n const groupRef3 = useGroupRef();\n const groupRef4 = useGroupRef();\n const groupRef5 = useGroupRef();\n const groupRef6 = useGroupRef();\n const groupRef7 = useGroupRef();\n const groupRef8 = useGroupRef();\n const groupRef9 = useGroupRef();\n const groupRef10 = useGroupRef();\n const groupRef11 = useGroupRef();\n const groupRef12 = useGroupRef();\n const groupRef13 = useGroupRef();\n const groupRef14 = useGroupRef();\n const groupRef15 = useGroupRef();\n\n const allGroupLayouts = [\n groupLayout0, groupLayout1, groupLayout2, groupLayout3,\n groupLayout4, groupLayout5, groupLayout6, groupLayout7,\n groupLayout8, groupLayout9, groupLayout10, groupLayout11,\n groupLayout12, groupLayout13, groupLayout14, groupLayout15,\n ];\n\n const allGroupRefs = useMemo(() => [\n groupRef0, groupRef1, groupRef2, groupRef3,\n groupRef4, groupRef5, groupRef6, groupRef7,\n groupRef8, groupRef9, groupRef10, groupRef11,\n groupRef12, groupRef13, groupRef14, groupRef15,\n ], [groupRef0, groupRef1, groupRef2, groupRef3, groupRef4, groupRef5, groupRef6, groupRef7, groupRef8, groupRef9, groupRef10, groupRef11, groupRef12, groupRef13, groupRef14, groupRef15]);\n\n useImperativeHandle(ref, () => ({\n reset: () => {\n try {\n allGroupRefs.forEach((groupRef) => {\n if (groupRef.current) {\n const layout = groupRef.current.getLayout();\n const ids = Object.keys(layout);\n if (ids.length > 0) {\n const equalSize = 100 / ids.length;\n groupRef.current.setLayout(Object.fromEntries(ids.map((id) => [id, equalSize])));\n }\n }\n });\n } catch (_error) {\n // allow to fail (it doesn't change functionality)\n }\n },\n }), [allGroupRefs]);\n\n const panelMap = useMemo(() => {\n const widgetsConfig = ConfigService.getInstance<CaseDbConfig>().config.dashboard.WIDGETS;\n return Object.fromEntries(\n Object.entries(widgetsConfig).map(([widgetName, { component, widgetLabel }]) => [\n widgetName,\n <ErrorBoundary\n fallback={<WidgetUnavailable widgetLabel={widgetLabel} />}\n key={widgetName}\n >\n {createElement(component)}\n </ErrorBoundary>,\n ]),\n );\n }, []);\n\n if (expandedZone) {\n const widgetName = arrangementWidgetAssignments[expandedZone];\n return (\n <DashboardZoneContext value={expandedZone}>\n {panelMap[widgetName as keyof typeof panelMap] ?? null}\n </DashboardZoneContext>\n );\n }\n\n if (!arrangement?.cells) {\n return null;\n }\n\n // counter.value increments with each group visited in DFS pre-order,\n // matching the order produced by DashboardUtil.getArrangementGroupInfos.\n const counter = { value: 0 };\n\n const renderArrangement = (arr: DashboardArrangement): ReactElement => {\n const index = counter.value++;\n const groupId = groupInfos[index]?.groupId ?? `${storagePrefix}-group-${index}`;\n const orientation = arr.orientation as 'horizontal' | 'vertical';\n const { defaultLayout, onLayoutChanged } = allGroupLayouts[index] ?? {};\n const groupRef = allGroupRefs[index];\n\n return (\n <Group\n defaultLayout={defaultLayout}\n groupRef={groupRef}\n id={groupId}\n onLayoutChanged={onLayoutChanged}\n orientation={orientation}\n style={{ height: '100%', width: '100%' }}\n >\n {arr.cells.map((cell, cellIndex) => {\n const isLast = cellIndex === arr.cells.length - 1;\n const panelId = `${groupId}-panel-${cellIndex}`;\n\n return (\n <Fragment key={'name' in cell ? cell.name : StringUtil.createHash(JSON.stringify(cell))}>\n <Panel\n defaultSize={cell.size}\n id={panelId}\n minSize={orientation === 'vertical' ? MIN_PANEL_HEIGHT : MIN_PANEL_WIDTH}\n style={{ overflow: 'hidden' }}\n >\n {'name' in cell\n ? (\n <DashboardZoneContext value={cell.name}>\n {panelMap[arrangementWidgetAssignments[cell.name] as keyof typeof panelMap] ?? <DashboardWidgetPlaceHolder />}\n </DashboardZoneContext>\n )\n : renderArrangement(cell)}\n </Panel>\n {!isLast && orientation === 'horizontal' && <PanelSeparatorVertical disabled={disabled} />}\n {!isLast && orientation === 'vertical' && <PanelSeparatorHorizontal disabled={disabled} />}\n </Fragment>\n );\n })}\n </Group>\n );\n };\n\n return renderArrangement(arrangement);\n};\n","import {\n Box,\n Link,\n Typography,\n useTheme,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport DownloadIcon from '@mui/icons-material/Download';\nimport {\n Fragment,\n useCallback,\n useEffect,\n useState,\n} from 'react';\nimport type { SidebarItemSharedProps } from '@gen-epix/ui-client-common/components/ui/Sidebar';\nimport { ConfigService } from '@gen-epix/ui-client-common/classes/services/ConfigService';\nimport { SidebarItem } from '@gen-epix/ui-client-common/components/ui/Sidebar';\n\nimport type {\n DownloadConfig,\n DownloadConfigItem,\n DownloadConfigSection,\n} from '../../../classes/services/EventBusService';\nimport { EventBusService } from '../../../classes/services/EventBusService';\nimport type { CaseDbConfig } from '../../../models/config';\n\n\nexport type DashboardDownloadSidebarItemProps = SidebarItemSharedProps;\n\nexport const DashboardDownloadSidebarItemIcon = DownloadIcon;\n\nconst DashboardDownloadSidebarItemContent = () => {\n const theme = useTheme();\n const { t } = useTranslation();\n const [downloadConfigs, setDownloadConfigs] = useState<DownloadConfig[]>([]);\n\n useEffect(() => {\n const onDownloadOptionsChanged = (payload: DownloadConfig) => {\n if (!payload?.zone) {\n return;\n }\n setDownloadConfigs(prevDownloadOptions => {\n if (payload.items === null) {\n return prevDownloadOptions.filter(item => item.zone !== payload.zone);\n }\n return [\n ...prevDownloadOptions.filter(item => item.zone !== payload.zone),\n payload,\n ].sort((a, b) => {\n return ConfigService.getInstance<CaseDbConfig>().config.dashboard.DOWNLOAD_SECTION_ORDER.indexOf(a.zone) - ConfigService.getInstance<CaseDbConfig>().config.dashboard.DOWNLOAD_SECTION_ORDER.indexOf(b.zone);\n });\n });\n };\n const eventBusService = EventBusService.getInstance();\n eventBusService.addEventListener('onDownloadOptionsChanged', onDownloadOptionsChanged);\n eventBusService.emit('onDownloadOptionsRequested');\n\n return () => {\n eventBusService.removeEventListener('onDownloadOptionsChanged', onDownloadOptionsChanged);\n };\n }, []);\n\n const renderDownloadItem = useCallback((item: DownloadConfigItem, forceDisabled?: boolean) => {\n return (\n <Box\n key={item.label}\n sx={{ marginLeft: 1 }}\n >\n {(forceDisabled || item.disabled || !item.callback) ? (\n <Typography>\n {item.label}\n </Typography>\n ) : (\n <Link\n component={'button'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => item.callback()}\n tabIndex={0}\n >\n {item.label}\n </Link>\n )}\n </Box>\n );\n }, []);\n\n const renderDownloadSection = useCallback((section: DownloadConfigSection) => {\n return (\n <Box key={section.label}>\n <Typography variant={'h6'}>\n {section.label}\n </Typography>\n {section.items.map(item => renderDownloadItem(item, section.disabled))}\n </Box>\n );\n }, [renderDownloadItem]);\n\n return (\n <Box\n sx={{\n width: theme.spacing(59),\n }}\n >\n {downloadConfigs.map((config) => (\n <Box\n key={config.zone}\n sx={{\n borderBottom: `1px solid ${theme.palette.divider}`,\n padding: theme.spacing(1),\n }}\n >\n <Box>\n <Typography\n color={config.disabled ? theme.palette.text.disabled : undefined}\n variant={'h5'}\n >\n {config.zoneLabel}\n </Typography>\n </Box>\n {config.disabled && (\n <Box sx={{ padding: theme.spacing(1) }}>\n <Typography>\n {t`No data available for download.`}\n </Typography>\n </Box>\n )}\n {!config.disabled && config.items.map((item) => {\n if ('items' in item && item.disabled) {\n return null;\n }\n return (\n <Fragment key={item.label}>\n {'items' in item\n ? renderDownloadSection(item)\n : renderDownloadItem(item)}\n </Fragment>\n );\n })}\n </Box>\n ))}\n </Box>\n );\n};\n\n// eslint-disable-next-line @eslint-react/kit/no-multi-comp\nexport const DashboardDownloadSidebarItem = ({ onClose, open }: DashboardDownloadSidebarItemProps) => {\n const { t } = useTranslation();\n\n return (\n <SidebarItem\n closeIcon={<DashboardDownloadSidebarItemIcon />}\n closeIconTooltipText={t`Close download`}\n onClose={onClose}\n open={open}\n testIdAttributes={{ name: 'DashboardDownloadSidebarItem' }}\n title={t`Download`}\n width={60}\n >\n {open && <DashboardDownloadSidebarItemContent />}\n </SidebarItem>\n );\n};\n","/**\n * Fuse.js v7.5.0 - Lightweight fuzzy-search (http://fusejs.io)\n *\n * Copyright (c) 2026 Kiro Risk (http://kiro.me)\n * All Rights Reserved. Apache Software License 2.0\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n//#region src/helpers/typeGuards.ts\nfunction isArray(value) {\n\treturn !Array.isArray ? getTag(value) === \"[object Array]\" : Array.isArray(value);\n}\nfunction baseToString(value) {\n\tif (typeof value == \"string\") return value;\n\tif (typeof value === \"bigint\") return value.toString();\n\tconst result = value + \"\";\n\treturn result == \"0\" && 1 / value == -Infinity ? \"-0\" : result;\n}\nfunction toString(value) {\n\treturn value == null ? \"\" : baseToString(value);\n}\nfunction isString(value) {\n\treturn typeof value === \"string\";\n}\nfunction isNumber(value) {\n\treturn typeof value === \"number\";\n}\nfunction isBoolean(value) {\n\treturn value === true || value === false || isObjectLike(value) && getTag(value) == \"[object Boolean]\";\n}\nfunction isObject(value) {\n\treturn typeof value === \"object\";\n}\nfunction isObjectLike(value) {\n\treturn isObject(value) && value !== null;\n}\nfunction isDefined(value) {\n\treturn value !== void 0 && value !== null;\n}\nfunction isBlank(value) {\n\treturn !value.trim().length;\n}\nfunction getTag(value) {\n\treturn value == null ? value === void 0 ? \"[object Undefined]\" : \"[object Null]\" : Object.prototype.toString.call(value);\n}\n\n//#endregion\n//#region src/core/errorMessages.ts\nconst INCORRECT_INDEX_TYPE = \"Incorrect 'index' type\";\nconst INVALID_DOC_INDEX = \"Invalid doc index: must be a non-negative integer within the bounds of the docs array\";\nconst LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) => `Invalid value for key ${key}`;\nconst PATTERN_LENGTH_TOO_LARGE = (max) => `Pattern length exceeds max of ${max}.`;\nconst MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;\nconst INVALID_KEY_WEIGHT_VALUE = (key) => `Property 'weight' in key '${key}' must be a positive integer`;\nconst FUSE_MATCH_TOKEN_SEARCH_UNSUPPORTED = \"Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.\";\n\n//#endregion\n//#region src/tools/KeyStore.ts\nconst hasOwn = Object.prototype.hasOwnProperty;\nvar KeyStore = class {\n\tconstructor(keys) {\n\t\tthis._keys = [];\n\t\tthis._keyMap = {};\n\t\tlet totalWeight = 0;\n\t\tkeys.forEach((key) => {\n\t\t\tconst obj = createKey(key);\n\t\t\tthis._keys.push(obj);\n\t\t\tthis._keyMap[obj.id] = obj;\n\t\t\ttotalWeight += obj.weight;\n\t\t});\n\t\tthis._keys.forEach((key) => {\n\t\t\tkey.weight /= totalWeight;\n\t\t});\n\t}\n\tget(keyId) {\n\t\treturn this._keyMap[keyId];\n\t}\n\tkeys() {\n\t\treturn this._keys;\n\t}\n\ttoJSON() {\n\t\treturn JSON.stringify(this._keys);\n\t}\n};\nfunction createKey(key) {\n\tlet path = null;\n\tlet id = null;\n\tlet src = null;\n\tlet weight = 1;\n\tlet getFn = null;\n\tif (isString(key) || isArray(key)) {\n\t\tsrc = key;\n\t\tpath = createKeyPath(key);\n\t\tid = createKeyId(key);\n\t} else {\n\t\tif (!hasOwn.call(key, \"name\")) throw new Error(MISSING_KEY_PROPERTY(\"name\"));\n\t\tconst name = key.name;\n\t\tsrc = name;\n\t\tif (hasOwn.call(key, \"weight\") && key.weight !== void 0) {\n\t\t\tweight = key.weight;\n\t\t\tif (weight <= 0) throw new Error(INVALID_KEY_WEIGHT_VALUE(createKeyId(name)));\n\t\t}\n\t\tpath = createKeyPath(name);\n\t\tid = createKeyId(name);\n\t\tgetFn = key.getFn ?? null;\n\t}\n\treturn {\n\t\tpath,\n\t\tid,\n\t\tweight,\n\t\tsrc,\n\t\tgetFn\n\t};\n}\nfunction createKeyPath(key) {\n\treturn isArray(key) ? key : key.split(\".\");\n}\nfunction createKeyId(key) {\n\treturn isArray(key) ? key.join(\".\") : key;\n}\n\n//#endregion\n//#region src/helpers/get.ts\nfunction get(obj, path) {\n\tconst list = [];\n\tlet arr = false;\n\tconst deepGet = (obj, path, index, arrayIndex) => {\n\t\tif (!isDefined(obj)) return;\n\t\tif (!path[index]) list.push(arrayIndex !== void 0 ? {\n\t\t\tv: obj,\n\t\t\ti: arrayIndex\n\t\t} : obj);\n\t\telse {\n\t\t\tconst value = obj[path[index]];\n\t\t\tif (!isDefined(value)) return;\n\t\t\tif (index === path.length - 1 && (isString(value) || isNumber(value) || isBoolean(value) || typeof value === \"bigint\")) list.push(arrayIndex !== void 0 ? {\n\t\t\t\tv: toString(value),\n\t\t\t\ti: arrayIndex\n\t\t\t} : toString(value));\n\t\t\telse if (isArray(value)) {\n\t\t\t\tarr = true;\n\t\t\t\tfor (let i = 0, len = value.length; i < len; i += 1) deepGet(value[i], path, index + 1, i);\n\t\t\t} else if (path.length) deepGet(value, path, index + 1, arrayIndex);\n\t\t}\n\t};\n\tdeepGet(obj, isString(path) ? path.split(\".\") : path, 0);\n\treturn arr ? list : list[0];\n}\n\n//#endregion\n//#region src/core/config.ts\nconst MatchOptions = {\n\tincludeMatches: false,\n\tfindAllMatches: false,\n\tminMatchCharLength: 1\n};\nconst BasicOptions = {\n\tisCaseSensitive: false,\n\tignoreDiacritics: false,\n\tincludeScore: false,\n\tkeys: [],\n\tshouldSort: true,\n\tsortFn: (a, b) => a.score === b.score ? a.idx < b.idx ? -1 : 1 : a.score < b.score ? -1 : 1\n};\nconst FuzzyOptions = {\n\tlocation: 0,\n\tthreshold: .6,\n\tdistance: 100\n};\nconst AdvancedOptions = {\n\tuseExtendedSearch: false,\n\tuseTokenSearch: false,\n\ttokenize: void 0,\n\ttokenMatch: \"any\",\n\tgetFn: get,\n\tignoreLocation: false,\n\tignoreFieldNorm: false,\n\tfieldNormWeight: 1\n};\nconst Config = Object.freeze({\n\t...BasicOptions,\n\t...MatchOptions,\n\t...FuzzyOptions,\n\t...AdvancedOptions\n});\n\n//#endregion\n//#region src/tools/fieldNorm.ts\nfunction isWordSeparator(code) {\n\treturn code >= 9 && code <= 13 || code === 32 || code === 160;\n}\nfunction norm(weight = 1, mantissa = 3) {\n\tconst cache = /* @__PURE__ */ new Map();\n\tconst m = Math.pow(10, mantissa);\n\treturn {\n\t\tget(value) {\n\t\t\tlet numTokens = 0;\n\t\t\tlet inWord = false;\n\t\t\tfor (let i = 0; i < value.length; i++) if (!isWordSeparator(value.charCodeAt(i))) {\n\t\t\t\tif (!inWord) {\n\t\t\t\t\tnumTokens++;\n\t\t\t\t\tinWord = true;\n\t\t\t\t}\n\t\t\t} else inWord = false;\n\t\t\tif (numTokens === 0) numTokens = 1;\n\t\t\tif (cache.has(numTokens)) return cache.get(numTokens);\n\t\t\tconst n = Math.round(m / Math.pow(numTokens, .5 * weight)) / m;\n\t\t\tcache.set(numTokens, n);\n\t\t\treturn n;\n\t\t},\n\t\tclear() {\n\t\t\tcache.clear();\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/tools/FuseIndex.ts\nvar FuseIndex = class {\n\tconstructor({ getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {\n\t\tthis.norm = norm(fieldNormWeight, 3);\n\t\tthis.getFn = getFn;\n\t\tthis.isCreated = false;\n\t\tthis.docs = [];\n\t\tthis.keys = [];\n\t\tthis._keysMap = {};\n\t\tthis.setIndexRecords();\n\t}\n\tsetSources(docs = []) {\n\t\tthis.docs = docs;\n\t}\n\tsetIndexRecords(records = []) {\n\t\tthis.records = records;\n\t}\n\tsetKeys(keys = []) {\n\t\tthis.keys = keys;\n\t\tthis._keysMap = {};\n\t\tkeys.forEach((key, idx) => {\n\t\t\tthis._keysMap[key.id] = idx;\n\t\t});\n\t}\n\tcreate() {\n\t\tif (this.isCreated || !this.docs.length) return;\n\t\tthis.isCreated = true;\n\t\tconst len = this.docs.length;\n\t\tthis.records = new Array(len);\n\t\tlet recordCount = 0;\n\t\tif (isString(this.docs[0])) for (let i = 0; i < len; i++) {\n\t\t\tconst record = this._createStringRecord(this.docs[i], i);\n\t\t\tif (record) this.records[recordCount++] = record;\n\t\t}\n\t\telse for (let i = 0; i < len; i++) this.records[recordCount++] = this._createObjectRecord(this.docs[i], i);\n\t\tthis.records.length = recordCount;\n\t\tthis.norm.clear();\n\t}\n\tadd(doc, docIndex) {\n\t\tif (!Number.isInteger(docIndex) || docIndex < 0) throw new Error(INVALID_DOC_INDEX);\n\t\tif (isString(doc)) {\n\t\t\tconst record = this._createStringRecord(doc, docIndex);\n\t\t\tif (record) this.records.push(record);\n\t\t\treturn record;\n\t\t}\n\t\tconst record = this._createObjectRecord(doc, docIndex);\n\t\tthis.records.push(record);\n\t\treturn record;\n\t}\n\tremoveAt(idx) {\n\t\tif (!Number.isInteger(idx) || idx < 0) throw new Error(INVALID_DOC_INDEX);\n\t\tfor (let i = 0, len = this.records.length; i < len; i += 1) if (this.records[i].i === idx) {\n\t\t\tthis.records.splice(i, 1);\n\t\t\tbreak;\n\t\t}\n\t\tfor (let i = 0, len = this.records.length; i < len; i += 1) if (this.records[i].i > idx) this.records[i].i -= 1;\n\t}\n\tremoveAll(indices) {\n\t\tconst toRemove = /* @__PURE__ */ new Set();\n\t\tfor (const v of indices) if (Number.isInteger(v) && v >= 0) toRemove.add(v);\n\t\tif (toRemove.size === 0) return;\n\t\tthis.records = this.records.filter((r) => !toRemove.has(r.i));\n\t\tconst sorted = Array.from(toRemove).sort((a, b) => a - b);\n\t\tfor (const record of this.records) {\n\t\t\tlet lo = 0;\n\t\t\tlet hi = sorted.length;\n\t\t\twhile (lo < hi) {\n\t\t\t\tconst mid = lo + hi >>> 1;\n\t\t\t\tif (sorted[mid] < record.i) lo = mid + 1;\n\t\t\t\telse hi = mid;\n\t\t\t}\n\t\t\trecord.i -= lo;\n\t\t}\n\t}\n\tgetValueForItemAtKeyId(item, keyId) {\n\t\treturn item[this._keysMap[keyId]];\n\t}\n\tsize() {\n\t\treturn this.records.length;\n\t}\n\t_createStringRecord(doc, docIndex) {\n\t\tif (!isDefined(doc) || isBlank(doc)) return null;\n\t\treturn {\n\t\t\tv: doc,\n\t\t\ti: docIndex,\n\t\t\tn: this.norm.get(doc)\n\t\t};\n\t}\n\t_createObjectRecord(doc, docIndex) {\n\t\tconst record = {\n\t\t\ti: docIndex,\n\t\t\t$: {}\n\t\t};\n\t\tfor (let keyIndex = 0, keyLen = this.keys.length; keyIndex < keyLen; keyIndex++) {\n\t\t\tconst key = this.keys[keyIndex];\n\t\t\tconst value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);\n\t\t\tif (!isDefined(value)) continue;\n\t\t\tif (isArray(value)) {\n\t\t\t\tconst subRecords = [];\n\t\t\t\tfor (let i = 0, len = value.length; i < len; i += 1) {\n\t\t\t\t\tconst item = value[i];\n\t\t\t\t\tif (!isDefined(item)) continue;\n\t\t\t\t\tif (isString(item)) {\n\t\t\t\t\t\tif (!isBlank(item)) {\n\t\t\t\t\t\t\tconst subRecord = {\n\t\t\t\t\t\t\t\tv: item,\n\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\tn: this.norm.get(item)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsubRecords.push(subRecord);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (isDefined(item.v)) {\n\t\t\t\t\t\tconst text = isString(item.v) ? item.v : toString(item.v);\n\t\t\t\t\t\tif (!isBlank(text)) {\n\t\t\t\t\t\t\tconst subRecord = {\n\t\t\t\t\t\t\t\tv: text,\n\t\t\t\t\t\t\t\ti: item.i,\n\t\t\t\t\t\t\t\tn: this.norm.get(text)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsubRecords.push(subRecord);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trecord.$[keyIndex] = subRecords;\n\t\t\t} else if (isString(value) && !isBlank(value)) {\n\t\t\t\tconst subRecord = {\n\t\t\t\t\tv: value,\n\t\t\t\t\tn: this.norm.get(value)\n\t\t\t\t};\n\t\t\t\trecord.$[keyIndex] = subRecord;\n\t\t\t}\n\t\t}\n\t\treturn record;\n\t}\n\ttoJSON() {\n\t\treturn {\n\t\t\tkeys: this.keys.map(({ getFn, ...key }) => key),\n\t\t\trecords: this.records\n\t\t};\n\t}\n};\nfunction createIndex(keys, docs, { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {\n\tconst myIndex = new FuseIndex({\n\t\tgetFn,\n\t\tfieldNormWeight\n\t});\n\tmyIndex.setKeys(keys.map(createKey));\n\tmyIndex.setSources(docs);\n\tmyIndex.create();\n\treturn myIndex;\n}\nfunction parseIndex(data, { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) {\n\tconst { keys, records } = data;\n\tconst myIndex = new FuseIndex({\n\t\tgetFn,\n\t\tfieldNormWeight\n\t});\n\tmyIndex.setKeys(keys);\n\tmyIndex.setIndexRecords(records);\n\treturn myIndex;\n}\n\n//#endregion\n//#region src/search/bitap/convertMaskToIndices.ts\nfunction convertMaskToIndices(matchmask = [], minMatchCharLength = Config.minMatchCharLength) {\n\tconst indices = [];\n\tlet start = -1;\n\tlet end = -1;\n\tlet i = 0;\n\tfor (let len = matchmask.length; i < len; i += 1) {\n\t\tconst match = matchmask[i];\n\t\tif (match && start === -1) start = i;\n\t\telse if (!match && start !== -1) {\n\t\t\tend = i - 1;\n\t\t\tif (end - start + 1 >= minMatchCharLength) indices.push([start, end]);\n\t\t\tstart = -1;\n\t\t}\n\t}\n\tif (matchmask[i - 1] && i - start >= minMatchCharLength) indices.push([start, i - 1]);\n\treturn indices;\n}\n\n//#endregion\n//#region src/search/bitap/search.ts\nfunction search(text, pattern, patternAlphabet, { location = Config.location, distance = Config.distance, threshold = Config.threshold, findAllMatches = Config.findAllMatches, minMatchCharLength = Config.minMatchCharLength, includeMatches = Config.includeMatches, ignoreLocation = Config.ignoreLocation } = {}) {\n\tif (pattern.length > 32) throw new Error(PATTERN_LENGTH_TOO_LARGE(32));\n\tconst patternLen = pattern.length;\n\tconst textLen = text.length;\n\tconst expectedLocation = Math.max(0, Math.min(location, textLen));\n\tlet currentThreshold = threshold;\n\tlet bestLocation = expectedLocation;\n\tconst calcScore = (errors, currentLocation) => {\n\t\tconst accuracy = errors / patternLen;\n\t\tif (ignoreLocation) return accuracy;\n\t\tconst proximity = Math.abs(expectedLocation - currentLocation);\n\t\tif (!distance) return proximity ? 1 : accuracy;\n\t\treturn accuracy + proximity / distance;\n\t};\n\tconst computeMatches = minMatchCharLength > 1 || includeMatches;\n\tconst matchMask = computeMatches ? Array(textLen) : [];\n\tlet index;\n\twhile ((index = text.indexOf(pattern, bestLocation)) > -1) {\n\t\tconst score = calcScore(0, index);\n\t\tcurrentThreshold = Math.min(score, currentThreshold);\n\t\tbestLocation = index + patternLen;\n\t\tif (computeMatches) {\n\t\t\tlet i = 0;\n\t\t\twhile (i < patternLen) {\n\t\t\t\tmatchMask[index + i] = 1;\n\t\t\t\ti += 1;\n\t\t\t}\n\t\t}\n\t}\n\tbestLocation = -1;\n\tlet lastBitArr = [];\n\tlet finalScore = 1;\n\tlet bestErrors = 0;\n\tlet binMax = patternLen + textLen;\n\tconst mask = 1 << patternLen - 1;\n\tfor (let i = 0; i < patternLen; i += 1) {\n\t\tlet binMin = 0;\n\t\tlet binMid = binMax;\n\t\twhile (binMin < binMid) {\n\t\t\tif (calcScore(i, expectedLocation + binMid) <= currentThreshold) binMin = binMid;\n\t\t\telse binMax = binMid;\n\t\t\tbinMid = Math.floor((binMax - binMin) / 2 + binMin);\n\t\t}\n\t\tbinMax = binMid;\n\t\tlet start = Math.max(1, expectedLocation - binMid + 1);\n\t\tconst finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen;\n\t\tconst bitArr = Array(finish + 2);\n\t\tbitArr[finish + 1] = (1 << i) - 1;\n\t\tfor (let j = finish; j >= start; j -= 1) {\n\t\t\tconst currentLocation = j - 1;\n\t\t\tconst charMatch = patternAlphabet[text[currentLocation]];\n\t\t\tbitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch;\n\t\t\tif (i) bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1];\n\t\t\tif (bitArr[j] & mask) {\n\t\t\t\tfinalScore = calcScore(i, currentLocation);\n\t\t\t\tif (finalScore <= currentThreshold) {\n\t\t\t\t\tcurrentThreshold = finalScore;\n\t\t\t\t\tbestLocation = currentLocation;\n\t\t\t\t\tbestErrors = i;\n\t\t\t\t\tif (bestLocation <= expectedLocation) break;\n\t\t\t\t\tstart = Math.max(1, 2 * expectedLocation - bestLocation);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (calcScore(i + 1, expectedLocation) > currentThreshold) break;\n\t\tlastBitArr = bitArr;\n\t}\n\tif (computeMatches && bestLocation >= 0) {\n\t\tconst matchEnd = Math.min(textLen - 1, bestLocation + patternLen - 1 + bestErrors);\n\t\tfor (let k = bestLocation; k <= matchEnd; k += 1) if (patternAlphabet[text[k]]) matchMask[k] = 1;\n\t}\n\tconst result = {\n\t\tisMatch: bestLocation >= 0,\n\t\tscore: Math.max(.001, finalScore)\n\t};\n\tif (computeMatches) {\n\t\tconst indices = convertMaskToIndices(matchMask, minMatchCharLength);\n\t\tif (!indices.length) result.isMatch = false;\n\t\telse if (includeMatches) result.indices = indices;\n\t}\n\treturn result;\n}\n\n//#endregion\n//#region src/search/bitap/createPatternAlphabet.ts\nfunction createPatternAlphabet(pattern) {\n\tconst mask = {};\n\tfor (let i = 0, len = pattern.length; i < len; i += 1) {\n\t\tconst char = pattern.charAt(i);\n\t\tmask[char] = (mask[char] || 0) | 1 << len - i - 1;\n\t}\n\treturn mask;\n}\n\n//#endregion\n//#region src/helpers/mergeIndices.ts\nfunction mergeIndices(indices) {\n\tif (indices.length <= 1) return indices;\n\tindices.sort((a, b) => a[0] - b[0] || a[1] - b[1]);\n\tconst merged = [indices[0]];\n\tfor (let i = 1, len = indices.length; i < len; i += 1) {\n\t\tconst last = merged[merged.length - 1];\n\t\tconst curr = indices[i];\n\t\tif (curr[0] <= last[1] + 1) last[1] = Math.max(last[1], curr[1]);\n\t\telse merged.push(curr);\n\t}\n\treturn merged;\n}\n\n//#endregion\n//#region src/helpers/diacritics.ts\nconst NON_DECOMPOSABLE_MAP = {\n\t\"ł\": \"l\",\n\t\"Ł\": \"L\",\n\t\"đ\": \"d\",\n\t\"Đ\": \"D\",\n\t\"ø\": \"o\",\n\t\"Ø\": \"O\",\n\t\"ħ\": \"h\",\n\t\"Ħ\": \"H\",\n\t\"ŧ\": \"t\",\n\t\"Ŧ\": \"T\",\n\t\"ı\": \"i\",\n\t\"ß\": \"ss\"\n};\nconst NON_DECOMPOSABLE_RE = new RegExp(\"[\" + Object.keys(NON_DECOMPOSABLE_MAP).join(\"\") + \"]\", \"g\");\nconst stripDiacritics = typeof String.prototype.normalize === \"function\" ? (str) => str.normalize(\"NFD\").replace(/[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F]/g, \"\").replace(NON_DECOMPOSABLE_RE, (ch) => NON_DECOMPOSABLE_MAP[ch]) : (str) => str;\n\n//#endregion\n//#region src/search/bitap/index.ts\nvar BitapSearch = class {\n\tconstructor(pattern, { location = Config.location, threshold = Config.threshold, distance = Config.distance, includeMatches = Config.includeMatches, findAllMatches = Config.findAllMatches, minMatchCharLength = Config.minMatchCharLength, isCaseSensitive = Config.isCaseSensitive, ignoreDiacritics = Config.ignoreDiacritics, ignoreLocation = Config.ignoreLocation } = {}) {\n\t\tthis.options = {\n\t\t\tlocation,\n\t\t\tthreshold,\n\t\t\tdistance,\n\t\t\tincludeMatches,\n\t\t\tfindAllMatches,\n\t\t\tminMatchCharLength,\n\t\t\tisCaseSensitive,\n\t\t\tignoreDiacritics,\n\t\t\tignoreLocation\n\t\t};\n\t\tpattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n\t\tpattern = ignoreDiacritics ? stripDiacritics(pattern) : pattern;\n\t\tthis.pattern = pattern;\n\t\tthis.chunks = [];\n\t\tif (!this.pattern.length) return;\n\t\tconst addChunk = (pattern, startIndex) => {\n\t\t\tthis.chunks.push({\n\t\t\t\tpattern,\n\t\t\t\talphabet: createPatternAlphabet(pattern),\n\t\t\t\tstartIndex\n\t\t\t});\n\t\t};\n\t\tconst len = this.pattern.length;\n\t\tif (len > 32) {\n\t\t\tlet i = 0;\n\t\t\tconst remainder = len % 32;\n\t\t\tconst end = len - remainder;\n\t\t\twhile (i < end) {\n\t\t\t\taddChunk(this.pattern.substr(i, 32), i);\n\t\t\t\ti += 32;\n\t\t\t}\n\t\t\tif (remainder) {\n\t\t\t\tconst startIndex = len - 32;\n\t\t\t\taddChunk(this.pattern.substr(startIndex), startIndex);\n\t\t\t}\n\t\t} else addChunk(this.pattern, 0);\n\t}\n\tsearchIn(text) {\n\t\tconst { isCaseSensitive, ignoreDiacritics, includeMatches } = this.options;\n\t\ttext = isCaseSensitive ? text : text.toLowerCase();\n\t\ttext = ignoreDiacritics ? stripDiacritics(text) : text;\n\t\tif (this.pattern === text) {\n\t\t\tif (text.length < this.options.minMatchCharLength) return {\n\t\t\t\tisMatch: false,\n\t\t\t\tscore: 1\n\t\t\t};\n\t\t\tconst result = {\n\t\t\t\tisMatch: true,\n\t\t\t\tscore: 0\n\t\t\t};\n\t\t\tif (includeMatches) result.indices = [[0, text.length - 1]];\n\t\t\treturn result;\n\t\t}\n\t\tconst { location, distance, threshold, findAllMatches, minMatchCharLength, ignoreLocation } = this.options;\n\t\tconst allIndices = [];\n\t\tlet totalScore = 0;\n\t\tlet hasMatches = false;\n\t\tthis.chunks.forEach(({ pattern, alphabet, startIndex }) => {\n\t\t\tconst { isMatch, score, indices } = search(text, pattern, alphabet, {\n\t\t\t\tlocation: location + startIndex,\n\t\t\t\tdistance,\n\t\t\t\tthreshold,\n\t\t\t\tfindAllMatches,\n\t\t\t\tminMatchCharLength,\n\t\t\t\tincludeMatches,\n\t\t\t\tignoreLocation\n\t\t\t});\n\t\t\tif (isMatch) hasMatches = true;\n\t\t\ttotalScore += score;\n\t\t\tif (isMatch && indices) allIndices.push(...indices);\n\t\t});\n\t\tconst result = {\n\t\t\tisMatch: hasMatches,\n\t\t\tscore: hasMatches ? totalScore / this.chunks.length : 1\n\t\t};\n\t\tif (hasMatches && includeMatches) result.indices = mergeIndices(allIndices);\n\t\treturn result;\n\t}\n};\n\n//#endregion\n//#region src/search/extended/matchers.ts\nconst MULTI_MATCH_TYPES = new Set([\"fuzzy\", \"include\"]);\nfunction isInverse(type) {\n\treturn type.startsWith(\"inverse\");\n}\nconst matchers = [\n\t{\n\t\ttype: \"exact\",\n\t\tmultiRegex: /^=\"(.*)\"$/,\n\t\tsingleRegex: /^=(.*)$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = text === pattern;\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [0, pattern.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"include\",\n\t\tmultiRegex: /^'\"(.*)\"$/,\n\t\tsingleRegex: /^'(.*)$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"include\",\n\t\t\tsearch(text) {\n\t\t\t\tlet location = 0;\n\t\t\t\tlet index;\n\t\t\t\tconst indices = [];\n\t\t\t\tconst patternLen = pattern.length;\n\t\t\t\twhile ((index = text.indexOf(pattern, location)) > -1) {\n\t\t\t\t\tlocation = index + patternLen;\n\t\t\t\t\tindices.push([index, location - 1]);\n\t\t\t\t}\n\t\t\t\tconst isMatch = !!indices.length;\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"prefix-exact\",\n\t\tmultiRegex: /^\\^\"(.*)\"$/,\n\t\tsingleRegex: /^\\^(.*)$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"prefix-exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = text.startsWith(pattern);\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [0, pattern.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"inverse-prefix-exact\",\n\t\tmultiRegex: /^!\\^\"(.*)\"$/,\n\t\tsingleRegex: /^!\\^(.*)$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"inverse-prefix-exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = !text.startsWith(pattern);\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [0, text.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"inverse-suffix-exact\",\n\t\tmultiRegex: /^!\"(.*)\"\\$$/,\n\t\tsingleRegex: /^!(.*)\\$$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"inverse-suffix-exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = !text.endsWith(pattern);\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [0, text.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"suffix-exact\",\n\t\tmultiRegex: /^\"(.*)\"\\$$/,\n\t\tsingleRegex: /^(.*)\\$$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"suffix-exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = text.endsWith(pattern);\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [text.length - pattern.length, text.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"inverse-exact\",\n\t\tmultiRegex: /^!\"(.*)\"$/,\n\t\tsingleRegex: /^!(.*)$/,\n\t\tcreate: (pattern) => ({\n\t\t\ttype: \"inverse-exact\",\n\t\t\tsearch(text) {\n\t\t\t\tconst isMatch = text.indexOf(pattern) === -1;\n\t\t\t\treturn {\n\t\t\t\t\tisMatch,\n\t\t\t\t\tscore: isMatch ? 0 : 1,\n\t\t\t\t\tindices: [0, text.length - 1]\n\t\t\t\t};\n\t\t\t}\n\t\t})\n\t},\n\t{\n\t\ttype: \"fuzzy\",\n\t\tmultiRegex: /^\"(.*)\"$/,\n\t\tsingleRegex: /^(.*)$/,\n\t\tcreate: (pattern, options = {}) => {\n\t\t\tconst bitap = new BitapSearch(pattern, {\n\t\t\t\tlocation: options.location ?? Config.location,\n\t\t\t\tthreshold: options.threshold ?? Config.threshold,\n\t\t\t\tdistance: options.distance ?? Config.distance,\n\t\t\t\tincludeMatches: options.includeMatches ?? Config.includeMatches,\n\t\t\t\tfindAllMatches: options.findAllMatches ?? Config.findAllMatches,\n\t\t\t\tminMatchCharLength: options.minMatchCharLength ?? Config.minMatchCharLength,\n\t\t\t\tisCaseSensitive: options.isCaseSensitive ?? Config.isCaseSensitive,\n\t\t\t\tignoreDiacritics: options.ignoreDiacritics ?? Config.ignoreDiacritics,\n\t\t\t\tignoreLocation: options.ignoreLocation ?? Config.ignoreLocation\n\t\t\t});\n\t\t\treturn {\n\t\t\t\ttype: \"fuzzy\",\n\t\t\t\tsearch(text) {\n\t\t\t\t\treturn bitap.searchIn(text);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n];\n\n//#endregion\n//#region src/search/extended/parseQuery.ts\nconst matchersLen = matchers.length;\nconst ESCAPED_PIPE = \"\\0\";\nconst OR_TOKEN = \"|\";\nfunction tokenize(pattern) {\n\tconst tokens = [];\n\tconst len = pattern.length;\n\tlet i = 0;\n\twhile (i < len) {\n\t\twhile (i < len && pattern[i] === \" \") i++;\n\t\tif (i >= len) break;\n\t\tlet j = i;\n\t\twhile (j < len && pattern[j] !== \" \" && pattern[j] !== \"\\\"\") j++;\n\t\tif (j < len && pattern[j] === \"\\\"\") {\n\t\t\tj++;\n\t\t\twhile (j < len) {\n\t\t\t\tif (pattern[j] === \"\\\"\") {\n\t\t\t\t\tconst next = j + 1;\n\t\t\t\t\tif (next >= len || pattern[next] === \" \") {\n\t\t\t\t\t\tj++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (pattern[next] === \"$\" && (next + 1 >= len || pattern[next + 1] === \" \")) {\n\t\t\t\t\t\tj += 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ttokens.push(pattern.substring(i, j));\n\t\t\ti = j;\n\t\t} else {\n\t\t\twhile (j < len && pattern[j] !== \" \") j++;\n\t\t\ttokens.push(pattern.substring(i, j));\n\t\t\ti = j;\n\t\t}\n\t}\n\treturn tokens;\n}\nfunction getMatch(pattern, exp) {\n\tconst matches = pattern.match(exp);\n\treturn matches ? matches[1] : null;\n}\nfunction parseQuery(pattern, options = {}) {\n\treturn pattern.replace(/\\\\\\|/g, ESCAPED_PIPE).split(OR_TOKEN).map((item) => {\n\t\tconst query = tokenize(item.replace(/\\u0000/g, \"|\").trim()).filter((item) => item && !!item.trim());\n\t\tconst results = [];\n\t\tfor (let i = 0, len = query.length; i < len; i += 1) {\n\t\t\tconst queryItem = query[i];\n\t\t\tlet found = false;\n\t\t\tlet idx = -1;\n\t\t\twhile (!found && ++idx < matchersLen) {\n\t\t\t\tconst def = matchers[idx];\n\t\t\t\tconst token = getMatch(queryItem, def.multiRegex);\n\t\t\t\tif (token) {\n\t\t\t\t\tresults.push(def.create(token, options));\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (found) continue;\n\t\t\tidx = -1;\n\t\t\twhile (++idx < matchersLen) {\n\t\t\t\tconst def = matchers[idx];\n\t\t\t\tconst token = getMatch(queryItem, def.singleRegex);\n\t\t\t\tif (token) {\n\t\t\t\t\tresults.push(def.create(token, options));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t});\n}\n\n//#endregion\n//#region src/search/extended/index.ts\nvar ExtendedSearch = class {\n\tconstructor(pattern, { isCaseSensitive = Config.isCaseSensitive, ignoreDiacritics = Config.ignoreDiacritics, includeMatches = Config.includeMatches, minMatchCharLength = Config.minMatchCharLength, ignoreLocation = Config.ignoreLocation, findAllMatches = Config.findAllMatches, location = Config.location, threshold = Config.threshold, distance = Config.distance } = {}) {\n\t\tthis.query = null;\n\t\tthis.options = {\n\t\t\tisCaseSensitive,\n\t\t\tignoreDiacritics,\n\t\t\tincludeMatches,\n\t\t\tminMatchCharLength,\n\t\t\tfindAllMatches,\n\t\t\tignoreLocation,\n\t\t\tlocation,\n\t\t\tthreshold,\n\t\t\tdistance\n\t\t};\n\t\tpattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n\t\tpattern = ignoreDiacritics ? stripDiacritics(pattern) : pattern;\n\t\tthis.pattern = pattern;\n\t\tthis.query = parseQuery(this.pattern, this.options);\n\t}\n\tstatic condition(_, options) {\n\t\treturn options.useExtendedSearch;\n\t}\n\tsearchIn(text) {\n\t\tconst query = this.query;\n\t\tif (!query) return {\n\t\t\tisMatch: false,\n\t\t\tscore: 1\n\t\t};\n\t\tconst { includeMatches, isCaseSensitive, ignoreDiacritics } = this.options;\n\t\ttext = isCaseSensitive ? text : text.toLowerCase();\n\t\ttext = ignoreDiacritics ? stripDiacritics(text) : text;\n\t\tlet numMatches = 0;\n\t\tconst allIndices = [];\n\t\tlet totalScore = 0;\n\t\tlet hasInverse = false;\n\t\tfor (let i = 0, qLen = query.length; i < qLen; i += 1) {\n\t\t\tconst searchers = query[i];\n\t\t\tallIndices.length = 0;\n\t\t\tnumMatches = 0;\n\t\t\thasInverse = false;\n\t\t\tfor (let j = 0, pLen = searchers.length; j < pLen; j += 1) {\n\t\t\t\tconst matcher = searchers[j];\n\t\t\t\tconst { isMatch, indices, score } = matcher.search(text);\n\t\t\t\tif (isMatch) {\n\t\t\t\t\tnumMatches += 1;\n\t\t\t\t\ttotalScore += score;\n\t\t\t\t\tif (isInverse(matcher.type)) hasInverse = true;\n\t\t\t\t\tif (includeMatches) if (MULTI_MATCH_TYPES.has(matcher.type)) allIndices.push(...indices);\n\t\t\t\t\telse allIndices.push(indices);\n\t\t\t\t} else {\n\t\t\t\t\ttotalScore = 0;\n\t\t\t\t\tnumMatches = 0;\n\t\t\t\t\tallIndices.length = 0;\n\t\t\t\t\thasInverse = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (numMatches) {\n\t\t\t\tconst result = {\n\t\t\t\t\tisMatch: true,\n\t\t\t\t\tscore: totalScore / numMatches\n\t\t\t\t};\n\t\t\t\tif (hasInverse) result.hasInverse = true;\n\t\t\t\tif (includeMatches) result.indices = mergeIndices(allIndices);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tisMatch: false,\n\t\t\tscore: 1\n\t\t};\n\t}\n};\n\n//#endregion\n//#region src/core/register.ts\nconst registeredSearchers = [];\nfunction register(...args) {\n\tregisteredSearchers.push(...args);\n}\nfunction createSearcher(pattern, options) {\n\tfor (let i = 0, len = registeredSearchers.length; i < len; i += 1) {\n\t\tconst searcherClass = registeredSearchers[i];\n\t\tif (searcherClass.condition(pattern, options)) return new searcherClass(pattern, options);\n\t}\n\treturn new BitapSearch(pattern, options);\n}\n\n//#endregion\n//#region src/core/queryParser.ts\nconst LogicalOperator = {\n\tAND: \"$and\",\n\tOR: \"$or\"\n};\nconst KeyType = {\n\tPATH: \"$path\",\n\tPATTERN: \"$val\"\n};\nconst isExpression = (query) => !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);\nconst isPath = (query) => !!query[KeyType.PATH];\nconst isLeaf = (query) => !isArray(query) && isObject(query) && !isExpression(query);\nconst convertToExplicit = (query) => ({ [LogicalOperator.AND]: Object.keys(query).map((key) => ({ [key]: query[key] })) });\nfunction parse(query, options, { auto = true } = {}) {\n\tconst next = (query) => {\n\t\tif (isString(query)) {\n\t\t\tconst obj = {\n\t\t\t\tkeyId: null,\n\t\t\t\tpattern: query\n\t\t\t};\n\t\t\tif (auto) obj.searcher = createSearcher(query, options);\n\t\t\treturn obj;\n\t\t}\n\t\tconst keys = Object.keys(query);\n\t\tconst isQueryPath = isPath(query);\n\t\tif (!isQueryPath && keys.length > 1 && !isExpression(query)) return next(convertToExplicit(query));\n\t\tif (isLeaf(query)) {\n\t\t\tconst key = isQueryPath ? query[KeyType.PATH] : keys[0];\n\t\t\tconst pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];\n\t\t\tif (!isString(pattern)) throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));\n\t\t\tconst obj = {\n\t\t\t\tkeyId: createKeyId(key),\n\t\t\t\tpattern\n\t\t\t};\n\t\t\tif (auto) obj.searcher = createSearcher(pattern, options);\n\t\t\treturn obj;\n\t\t}\n\t\tconst node = {\n\t\t\tchildren: [],\n\t\t\toperator: keys[0]\n\t\t};\n\t\tkeys.forEach((key) => {\n\t\t\tconst value = query[key];\n\t\t\tif (isArray(value)) value.forEach((item) => {\n\t\t\t\tnode.children.push(next(item));\n\t\t\t});\n\t\t});\n\t\treturn node;\n\t};\n\tif (!isExpression(query)) query = convertToExplicit(query);\n\treturn next(query);\n}\n\n//#endregion\n//#region src/core/computeScore.ts\nfunction computeScoreSingle(matches, { ignoreFieldNorm = Config.ignoreFieldNorm }) {\n\tlet totalScore = 1;\n\tmatches.forEach(({ key, norm, score }) => {\n\t\tconst weight = key ? key.weight : null;\n\t\ttotalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm));\n\t});\n\treturn totalScore;\n}\nfunction computeScore(results, { ignoreFieldNorm = Config.ignoreFieldNorm }) {\n\tresults.forEach((result) => {\n\t\tresult.score = computeScoreSingle(result.matches, { ignoreFieldNorm });\n\t});\n}\n\n//#endregion\n//#region src/tools/MaxHeap.ts\nvar MaxHeap = class {\n\tconstructor(limit, comparator) {\n\t\tthis.limit = limit;\n\t\tthis.heap = [];\n\t\tthis.comparator = comparator;\n\t}\n\tget size() {\n\t\treturn this.heap.length;\n\t}\n\tinsert(item) {\n\t\tif (this.size < this.limit) {\n\t\t\tthis.heap.push(item);\n\t\t\tthis._bubbleUp(this.size - 1);\n\t\t} else if (this.comparator(item, this.heap[0]) < 0) {\n\t\t\tthis.heap[0] = item;\n\t\t\tthis._sinkDown(0);\n\t\t}\n\t}\n\textractSorted() {\n\t\treturn this.heap.sort(this.comparator);\n\t}\n\t_bubbleUp(i) {\n\t\tconst heap = this.heap;\n\t\twhile (i > 0) {\n\t\t\tconst parent = i - 1 >> 1;\n\t\t\tif (this.comparator(heap[i], heap[parent]) <= 0) break;\n\t\t\tconst tmp = heap[i];\n\t\t\theap[i] = heap[parent];\n\t\t\theap[parent] = tmp;\n\t\t\ti = parent;\n\t\t}\n\t}\n\t_sinkDown(i) {\n\t\tconst heap = this.heap;\n\t\tconst len = heap.length;\n\t\tlet largest = i;\n\t\tdo {\n\t\t\ti = largest;\n\t\t\tconst left = 2 * i + 1;\n\t\t\tconst right = 2 * i + 2;\n\t\t\tif (left < len && this.comparator(heap[left], heap[largest]) > 0) largest = left;\n\t\t\tif (right < len && this.comparator(heap[right], heap[largest]) > 0) largest = right;\n\t\t\tif (largest !== i) {\n\t\t\t\tconst tmp = heap[i];\n\t\t\t\theap[i] = heap[largest];\n\t\t\t\theap[largest] = tmp;\n\t\t\t}\n\t\t} while (largest !== i);\n\t}\n};\n\n//#endregion\n//#region src/core/formatMatches.ts\nfunction formatMatches(result) {\n\tconst matches = [];\n\tresult.matches.forEach((match) => {\n\t\tif (!isDefined(match.indices) || !match.indices.length) return;\n\t\tconst obj = {\n\t\t\tindices: match.indices,\n\t\t\tvalue: match.value\n\t\t};\n\t\tif (match.key) obj.key = match.key.id;\n\t\tif (match.idx > -1) obj.refIndex = match.idx;\n\t\tmatches.push(obj);\n\t});\n\treturn matches;\n}\n\n//#endregion\n//#region src/core/format.ts\nfunction format(results, docs, { includeMatches = Config.includeMatches, includeScore = Config.includeScore } = {}) {\n\treturn results.map((result) => {\n\t\tconst { idx } = result;\n\t\tconst data = {\n\t\t\titem: docs[idx],\n\t\t\trefIndex: idx\n\t\t};\n\t\tif (includeMatches) data.matches = formatMatches(result);\n\t\tif (includeScore) data.score = result.score;\n\t\treturn data;\n\t});\n}\n\n//#endregion\n//#region src/search/token/analyzer.ts\nconst DEFAULT_TOKEN = /[\\p{L}\\p{M}\\p{N}_]+/gu;\nconst warned = /* @__PURE__ */ new WeakSet();\nfunction warnNonGlobal(regex) {\n\tif (!warned.has(regex)) {\n\t\twarned.add(regex);\n\t\tconsole.warn(`[Fuse] tokenize regex ${regex} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`);\n\t}\n}\nfunction resolveTokenize(tokenize) {\n\tif (typeof tokenize === \"function\") {\n\t\tlet validated = false;\n\t\treturn (text) => {\n\t\t\tconst result = tokenize(text);\n\t\t\tif (!validated) {\n\t\t\t\tvalidated = true;\n\t\t\t\tif (!Array.isArray(result) || result.some((t) => typeof t !== \"string\")) throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(result) ? \"array containing non-strings\" : typeof result}.`);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t}\n\tif (tokenize instanceof RegExp) {\n\t\tif (!tokenize.global) warnNonGlobal(tokenize);\n\t\treturn (text) => text.match(tokenize) || [];\n\t}\n\treturn (text) => text.match(DEFAULT_TOKEN) || [];\n}\nfunction createAnalyzer({ isCaseSensitive = false, ignoreDiacritics = false, tokenize } = {}) {\n\tconst tokenizeFn = resolveTokenize(tokenize);\n\treturn { tokenize(text) {\n\t\tif (!isCaseSensitive) text = text.toLowerCase();\n\t\tif (ignoreDiacritics) text = stripDiacritics(text);\n\t\treturn tokenizeFn(text);\n\t} };\n}\n\n//#endregion\n//#region src/search/token/index.ts\nconst MAX_MASK_TERMS = 31;\nvar TokenSearch = class {\n\tstatic condition(_, options) {\n\t\treturn options.useTokenSearch;\n\t}\n\tconstructor(pattern, options) {\n\t\tthis.options = options;\n\t\tthis.analyzer = createAnalyzer({\n\t\t\tisCaseSensitive: options.isCaseSensitive,\n\t\t\tignoreDiacritics: options.ignoreDiacritics,\n\t\t\ttokenize: options.tokenize\n\t\t});\n\t\tconst queryTerms = this.analyzer.tokenize(pattern);\n\t\tconst { df, fieldCount } = options._invertedIndex;\n\t\tthis.termSearchers = [];\n\t\tthis.idfWeights = [];\n\t\tfor (const term of queryTerms) {\n\t\t\tthis.termSearchers.push(new BitapSearch(term, {\n\t\t\t\tlocation: options.location,\n\t\t\t\tthreshold: options.threshold,\n\t\t\t\tdistance: options.distance,\n\t\t\t\tincludeMatches: options.includeMatches,\n\t\t\t\tfindAllMatches: options.findAllMatches,\n\t\t\t\tminMatchCharLength: options.minMatchCharLength,\n\t\t\t\tisCaseSensitive: options.isCaseSensitive,\n\t\t\t\tignoreDiacritics: options.ignoreDiacritics,\n\t\t\t\tignoreLocation: true\n\t\t\t}));\n\t\t\tconst docFreq = df.get(term) || 0;\n\t\t\tconst idf = Math.log(1 + (fieldCount - docFreq + .5) / (docFreq + .5));\n\t\t\tthis.idfWeights.push(idf);\n\t\t}\n\t\tthis.combineAll = options.tokenMatch === \"all\";\n\t\tthis.numTerms = this.termSearchers.length;\n\t\tthis.useMask = this.numTerms <= 31;\n\t}\n\tsearchIn(text) {\n\t\tif (!this.termSearchers.length) return {\n\t\t\tisMatch: false,\n\t\t\tscore: 1\n\t\t};\n\t\tconst allIndices = [];\n\t\tlet weightedScore = 0;\n\t\tlet maxPossibleScore = 0;\n\t\tlet matchedCount = 0;\n\t\tlet matchedMask = 0;\n\t\tconst matchedTerms = this.combineAll && !this.useMask ? /* @__PURE__ */ new Set() : null;\n\t\tfor (let i = 0; i < this.termSearchers.length; i++) {\n\t\t\tconst result = this.termSearchers[i].searchIn(text);\n\t\t\tconst idf = this.idfWeights[i];\n\t\t\tmaxPossibleScore += idf;\n\t\t\tif (result.isMatch) {\n\t\t\t\tmatchedCount++;\n\t\t\t\tweightedScore += idf * (1 - result.score);\n\t\t\t\tif (result.indices) allIndices.push(...result.indices);\n\t\t\t\tif (this.combineAll) if (this.useMask) matchedMask |= 1 << i;\n\t\t\t\telse matchedTerms.add(i);\n\t\t\t}\n\t\t}\n\t\tif (matchedCount === 0) return {\n\t\t\tisMatch: false,\n\t\t\tscore: 1\n\t\t};\n\t\tconst normalized = maxPossibleScore > 0 ? 1 - weightedScore / maxPossibleScore : 0;\n\t\tconst searchResult = {\n\t\t\tisMatch: true,\n\t\t\tscore: Math.max(.001, normalized)\n\t\t};\n\t\tif (this.options.includeMatches && allIndices.length) searchResult.indices = mergeIndices(allIndices);\n\t\tif (this.combineAll) {\n\t\t\tif (this.useMask) searchResult.matchedMask = matchedMask;\n\t\t\telse searchResult.matchedTerms = matchedTerms;\n\t\t\tsearchResult.termCount = this.numTerms;\n\t\t}\n\t\treturn searchResult;\n\t}\n};\n\n//#endregion\n//#region src/search/token/InvertedIndex.ts\nfunction addField(index, text, docIdx, analyzer) {\n\tconst tokens = analyzer.tokenize(text);\n\tif (!tokens.length) return;\n\tindex.fieldCount++;\n\tindex.docFieldCount.set(docIdx, (index.docFieldCount.get(docIdx) || 0) + 1);\n\tconst distinctTerms = new Set(tokens);\n\tlet perDocTerms = index.docTermFieldHits.get(docIdx);\n\tif (!perDocTerms) {\n\t\tperDocTerms = /* @__PURE__ */ new Map();\n\t\tindex.docTermFieldHits.set(docIdx, perDocTerms);\n\t}\n\tfor (const term of distinctTerms) {\n\t\tperDocTerms.set(term, (perDocTerms.get(term) || 0) + 1);\n\t\tindex.df.set(term, (index.df.get(term) || 0) + 1);\n\t}\n}\nfunction ingestRecord(index, record, keyCount, analyzer) {\n\tconst { i: docIdx, v, $: fields } = record;\n\tif (v !== void 0) {\n\t\taddField(index, v, docIdx, analyzer);\n\t\treturn;\n\t}\n\tif (!fields) return;\n\tfor (let keyIdx = 0; keyIdx < keyCount; keyIdx++) {\n\t\tconst value = fields[keyIdx];\n\t\tif (!value) continue;\n\t\tif (Array.isArray(value)) for (const sub of value) addField(index, sub.v, docIdx, analyzer);\n\t\telse addField(index, value.v, docIdx, analyzer);\n\t}\n}\nfunction buildInvertedIndex(records, keyCount, analyzer) {\n\tconst index = {\n\t\tfieldCount: 0,\n\t\tdf: /* @__PURE__ */ new Map(),\n\t\tdocFieldCount: /* @__PURE__ */ new Map(),\n\t\tdocTermFieldHits: /* @__PURE__ */ new Map()\n\t};\n\tfor (const record of records) ingestRecord(index, record, keyCount, analyzer);\n\treturn index;\n}\nfunction addToInvertedIndex(index, record, keyCount, analyzer) {\n\tingestRecord(index, record, keyCount, analyzer);\n}\nfunction removeFromInvertedIndex(index, docIdx) {\n\tconst fieldCount = index.docFieldCount.get(docIdx);\n\tif (fieldCount === void 0) return;\n\tindex.fieldCount -= fieldCount;\n\tindex.docFieldCount.delete(docIdx);\n\tconst perDocTerms = index.docTermFieldHits.get(docIdx);\n\tif (!perDocTerms) return;\n\tfor (const [term, hits] of perDocTerms) {\n\t\tconst next = (index.df.get(term) || 0) - hits;\n\t\tif (next <= 0) index.df.delete(term);\n\t\telse index.df.set(term, next);\n\t}\n\tindex.docTermFieldHits.delete(docIdx);\n}\nfunction removeAndShiftInvertedIndex(index, removedIndices) {\n\tif (removedIndices.length === 0) return;\n\tconst sorted = Array.from(new Set(removedIndices)).sort((a, b) => a - b);\n\tfor (const idx of sorted) removeFromInvertedIndex(index, idx);\n\tconst shift = (oldIdx) => {\n\t\tlet lo = 0;\n\t\tlet hi = sorted.length;\n\t\twhile (lo < hi) {\n\t\t\tconst mid = lo + hi >>> 1;\n\t\t\tif (sorted[mid] < oldIdx) lo = mid + 1;\n\t\t\telse hi = mid;\n\t\t}\n\t\treturn oldIdx - lo;\n\t};\n\tconst firstRemoved = sorted[0];\n\tconst shiftedDocFieldCount = /* @__PURE__ */ new Map();\n\tfor (const [oldKey, count] of index.docFieldCount) shiftedDocFieldCount.set(oldKey > firstRemoved ? shift(oldKey) : oldKey, count);\n\tindex.docFieldCount = shiftedDocFieldCount;\n\tconst shiftedDocTermFieldHits = /* @__PURE__ */ new Map();\n\tfor (const [oldKey, terms] of index.docTermFieldHits) shiftedDocTermFieldHits.set(oldKey > firstRemoved ? shift(oldKey) : oldKey, terms);\n\tindex.docTermFieldHits = shiftedDocTermFieldHits;\n}\n\n//#endregion\n//#region src/core/index.ts\nvar Fuse = class {\n\tconstructor(docs, options, index) {\n\t\tthis.options = {\n\t\t\t...Config,\n\t\t\t...options\n\t\t};\n\t\tif (this.options.useExtendedSearch && false);\n\t\tif (this.options.useTokenSearch && false);\n\t\tthis._keyStore = new KeyStore(this.options.keys);\n\t\tthis._docs = docs;\n\t\tthis._myIndex = null;\n\t\tthis._invertedIndex = null;\n\t\tthis.setCollection(docs, index);\n\t\tthis._lastQuery = null;\n\t\tthis._lastSearcher = null;\n\t}\n\t_getSearcher(query) {\n\t\tif (this._lastQuery === query) return this._lastSearcher;\n\t\tconst searcher = createSearcher(query, this._invertedIndex ? {\n\t\t\t...this.options,\n\t\t\t_invertedIndex: this._invertedIndex\n\t\t} : this.options);\n\t\tthis._lastQuery = query;\n\t\tthis._lastSearcher = searcher;\n\t\treturn searcher;\n\t}\n\tsetCollection(docs, index) {\n\t\tthis._docs = docs;\n\t\tif (index && !(index instanceof FuseIndex)) throw new Error(INCORRECT_INDEX_TYPE);\n\t\tthis._myIndex = index || createIndex(this.options.keys, this._docs, {\n\t\t\tgetFn: this.options.getFn,\n\t\t\tfieldNormWeight: this.options.fieldNormWeight\n\t\t});\n\t\tif (this.options.useTokenSearch) {\n\t\t\tconst analyzer = createAnalyzer({\n\t\t\t\tisCaseSensitive: this.options.isCaseSensitive,\n\t\t\t\tignoreDiacritics: this.options.ignoreDiacritics,\n\t\t\t\ttokenize: this.options.tokenize\n\t\t\t});\n\t\t\tthis._invertedIndex = buildInvertedIndex(this._myIndex.records, this._myIndex.keys.length, analyzer);\n\t\t}\n\t\tthis._invalidateSearcherCache();\n\t}\n\tadd(doc) {\n\t\tif (!isDefined(doc)) return;\n\t\tthis._docs.push(doc);\n\t\tconst record = this._myIndex.add(doc, this._docs.length - 1);\n\t\tif (this._invertedIndex && record) {\n\t\t\tconst analyzer = createAnalyzer({\n\t\t\t\tisCaseSensitive: this.options.isCaseSensitive,\n\t\t\t\tignoreDiacritics: this.options.ignoreDiacritics,\n\t\t\t\ttokenize: this.options.tokenize\n\t\t\t});\n\t\t\taddToInvertedIndex(this._invertedIndex, record, this._myIndex.keys.length, analyzer);\n\t\t}\n\t\tthis._invalidateSearcherCache();\n\t}\n\tremove(predicate = () => false) {\n\t\tconst results = [];\n\t\tconst indicesToRemove = [];\n\t\tfor (let i = 0, len = this._docs.length; i < len; i += 1) if (predicate(this._docs[i], i)) {\n\t\t\tresults.push(this._docs[i]);\n\t\t\tindicesToRemove.push(i);\n\t\t}\n\t\tif (indicesToRemove.length) {\n\t\t\tif (this._invertedIndex) removeAndShiftInvertedIndex(this._invertedIndex, indicesToRemove);\n\t\t\tconst toRemove = new Set(indicesToRemove);\n\t\t\tthis._docs = this._docs.filter((_, i) => !toRemove.has(i));\n\t\t\tthis._myIndex.removeAll(indicesToRemove);\n\t\t\tthis._invalidateSearcherCache();\n\t\t}\n\t\treturn results;\n\t}\n\tremoveAt(idx) {\n\t\tif (!Number.isInteger(idx) || idx < 0 || idx >= this._docs.length) throw new Error(INVALID_DOC_INDEX);\n\t\tif (this._invertedIndex) removeAndShiftInvertedIndex(this._invertedIndex, [idx]);\n\t\tconst doc = this._docs.splice(idx, 1)[0];\n\t\tthis._myIndex.removeAt(idx);\n\t\tthis._invalidateSearcherCache();\n\t\treturn doc;\n\t}\n\t_invalidateSearcherCache() {\n\t\tthis._lastQuery = null;\n\t\tthis._lastSearcher = null;\n\t}\n\tgetIndex() {\n\t\treturn this._myIndex;\n\t}\n\t_normalizedKeys() {\n\t\treturn this._myIndex.keys.map((key) => this._keyStore.get(key.id) || key);\n\t}\n\tsearch(query, options) {\n\t\tconst { limit = -1 } = options || {};\n\t\tconst { includeMatches, includeScore, shouldSort, sortFn, ignoreFieldNorm } = this.options;\n\t\tif (isString(query) && !query.trim()) {\n\t\t\tlet docs = this._docs.map((item, idx) => ({\n\t\t\t\titem,\n\t\t\t\trefIndex: idx\n\t\t\t}));\n\t\t\tif (isNumber(limit) && limit > -1) docs = docs.slice(0, limit);\n\t\t\treturn docs;\n\t\t}\n\t\tconst useHeap = shouldSort && isNumber(limit) && limit > 0 && isString(query);\n\t\tconst comparator = sortFn;\n\t\tconst stable = (a, b) => comparator(a, b) || a.idx - b.idx;\n\t\tlet results;\n\t\tif (useHeap) {\n\t\t\tconst heap = new MaxHeap(limit, stable);\n\t\t\tif (isString(this._docs[0])) this._searchStringList(query, {\n\t\t\t\theap,\n\t\t\t\tignoreFieldNorm\n\t\t\t});\n\t\t\telse this._searchObjectList(query, {\n\t\t\t\theap,\n\t\t\t\tignoreFieldNorm\n\t\t\t});\n\t\t\tresults = heap.extractSorted();\n\t\t} else {\n\t\t\tresults = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);\n\t\t\tcomputeScore(results, { ignoreFieldNorm });\n\t\t\tif (shouldSort) results.sort(isString(query) ? stable : comparator);\n\t\t\tif (isNumber(limit) && limit > -1) results = results.slice(0, limit);\n\t\t}\n\t\treturn format(results, this._docs, {\n\t\t\tincludeMatches,\n\t\t\tincludeScore\n\t\t});\n\t}\n\t_searchStringList(query, { heap, ignoreFieldNorm } = {}) {\n\t\tconst searcher = this._getSearcher(query);\n\t\tconst requireAllTokens = this.options.useTokenSearch && this.options.tokenMatch === \"all\";\n\t\tconst { records } = this._myIndex;\n\t\tconst results = heap ? null : [];\n\t\trecords.forEach(({ v: text, i: idx, n: norm }) => {\n\t\t\tif (!isDefined(text)) return;\n\t\t\tconst searchResult = searcher.searchIn(text);\n\t\t\tif (searchResult.isMatch) {\n\t\t\t\tconst match = {\n\t\t\t\t\tscore: searchResult.score,\n\t\t\t\t\tvalue: text,\n\t\t\t\t\tnorm,\n\t\t\t\t\tindices: searchResult.indices\n\t\t\t\t};\n\t\t\t\tif (requireAllTokens) {\n\t\t\t\t\tmatch.matchedMask = searchResult.matchedMask;\n\t\t\t\t\tmatch.matchedTerms = searchResult.matchedTerms;\n\t\t\t\t\tmatch.termCount = searchResult.termCount;\n\t\t\t\t}\n\t\t\t\tconst matches = [match];\n\t\t\t\tif (!requireAllTokens || this._coversAllTokens(matches)) {\n\t\t\t\t\tconst result = {\n\t\t\t\t\t\titem: text,\n\t\t\t\t\t\tidx,\n\t\t\t\t\t\tmatches\n\t\t\t\t\t};\n\t\t\t\t\tif (heap) {\n\t\t\t\t\t\tresult.score = computeScoreSingle(result.matches, { ignoreFieldNorm });\n\t\t\t\t\t\theap.insert(result);\n\t\t\t\t\t} else results.push(result);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn results;\n\t}\n\t_searchLogical(query) {\n\t\tconst expression = parse(query, this.options);\n\t\tconst keys = this._normalizedKeys();\n\t\tconst evaluate = (node, item, idx) => {\n\t\t\tif (!(\"children\" in node)) {\n\t\t\t\tconst { keyId, searcher } = node;\n\t\t\t\tlet matches;\n\t\t\t\tif (keyId === null) {\n\t\t\t\t\tmatches = [];\n\t\t\t\t\tkeys.forEach((key, keyIndex) => {\n\t\t\t\t\t\tmatches.push(...this._findMatches({\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: item[keyIndex],\n\t\t\t\t\t\t\tsearcher\n\t\t\t\t\t\t}));\n\t\t\t\t\t});\n\t\t\t\t} else matches = this._findMatches({\n\t\t\t\t\tkey: this._keyStore.get(keyId),\n\t\t\t\t\tvalue: this._myIndex.getValueForItemAtKeyId(item, keyId),\n\t\t\t\t\tsearcher\n\t\t\t\t});\n\t\t\t\tif (matches && matches.length) return [{\n\t\t\t\t\tidx,\n\t\t\t\t\titem,\n\t\t\t\t\tmatches\n\t\t\t\t}];\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { children, operator } = node;\n\t\t\tconst res = [];\n\t\t\tfor (let i = 0, len = children.length; i < len; i += 1) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tconst result = evaluate(child, item, idx);\n\t\t\t\tif (result.length) res.push(...result);\n\t\t\t\telse if (operator === LogicalOperator.AND) return [];\n\t\t\t}\n\t\t\treturn res;\n\t\t};\n\t\tconst records = this._myIndex.records;\n\t\tconst resultMap = /* @__PURE__ */ new Map();\n\t\tconst results = [];\n\t\trecords.forEach(({ $: item, i: idx }) => {\n\t\t\tif (isDefined(item)) {\n\t\t\t\tconst expResults = evaluate(expression, item, idx);\n\t\t\t\tif (expResults.length) {\n\t\t\t\t\tif (!resultMap.has(idx)) {\n\t\t\t\t\t\tresultMap.set(idx, {\n\t\t\t\t\t\t\tidx,\n\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\tmatches: []\n\t\t\t\t\t\t});\n\t\t\t\t\t\tresults.push(resultMap.get(idx));\n\t\t\t\t\t}\n\t\t\t\t\texpResults.forEach(({ matches }) => {\n\t\t\t\t\t\tresultMap.get(idx).matches.push(...matches);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn results;\n\t}\n\t_searchObjectList(query, { heap, ignoreFieldNorm } = {}) {\n\t\tconst searcher = this._getSearcher(query);\n\t\tconst requireAllTokens = this.options.useTokenSearch && this.options.tokenMatch === \"all\";\n\t\tconst { records } = this._myIndex;\n\t\tconst keys = this._normalizedKeys();\n\t\tconst results = heap ? null : [];\n\t\trecords.forEach(({ $: item, i: idx }) => {\n\t\t\tif (!isDefined(item)) return;\n\t\t\tconst matches = [];\n\t\t\tlet anyKeyFailed = false;\n\t\t\tlet hasInverse = false;\n\t\t\tkeys.forEach((key, keyIndex) => {\n\t\t\t\tconst keyMatches = this._findMatches({\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: item[keyIndex],\n\t\t\t\t\tsearcher\n\t\t\t\t});\n\t\t\t\tif (keyMatches.length) {\n\t\t\t\t\tmatches.push(...keyMatches);\n\t\t\t\t\tif (keyMatches[0].hasInverse) hasInverse = true;\n\t\t\t\t} else anyKeyFailed = true;\n\t\t\t});\n\t\t\tif (hasInverse && anyKeyFailed) return;\n\t\t\tif (matches.length && (!requireAllTokens || this._coversAllTokens(matches))) {\n\t\t\t\tconst result = {\n\t\t\t\t\tidx,\n\t\t\t\t\titem,\n\t\t\t\t\tmatches\n\t\t\t\t};\n\t\t\t\tif (heap) {\n\t\t\t\t\tresult.score = computeScoreSingle(result.matches, { ignoreFieldNorm });\n\t\t\t\t\theap.insert(result);\n\t\t\t\t} else results.push(result);\n\t\t\t}\n\t\t});\n\t\treturn results;\n\t}\n\t_findMatches({ key, value, searcher }) {\n\t\tif (!isDefined(value)) return [];\n\t\tconst matches = [];\n\t\tif (isArray(value)) value.forEach(({ v: text, i: idx, n: norm }) => {\n\t\t\tif (!isDefined(text)) return;\n\t\t\tconst searchResult = searcher.searchIn(text);\n\t\t\tif (searchResult.isMatch) {\n\t\t\t\tconst match = {\n\t\t\t\t\tscore: searchResult.score,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: text,\n\t\t\t\t\tidx,\n\t\t\t\t\tnorm,\n\t\t\t\t\tindices: searchResult.indices,\n\t\t\t\t\thasInverse: searchResult.hasInverse\n\t\t\t\t};\n\t\t\t\tif (searchResult.termCount !== void 0) {\n\t\t\t\t\tmatch.matchedMask = searchResult.matchedMask;\n\t\t\t\t\tmatch.matchedTerms = searchResult.matchedTerms;\n\t\t\t\t\tmatch.termCount = searchResult.termCount;\n\t\t\t\t}\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t});\n\t\telse {\n\t\t\tconst { v: text, n: norm } = value;\n\t\t\tconst searchResult = searcher.searchIn(text);\n\t\t\tif (searchResult.isMatch) {\n\t\t\t\tconst match = {\n\t\t\t\t\tscore: searchResult.score,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: text,\n\t\t\t\t\tnorm,\n\t\t\t\t\tindices: searchResult.indices,\n\t\t\t\t\thasInverse: searchResult.hasInverse\n\t\t\t\t};\n\t\t\t\tif (searchResult.termCount !== void 0) {\n\t\t\t\t\tmatch.matchedMask = searchResult.matchedMask;\n\t\t\t\t\tmatch.matchedTerms = searchResult.matchedTerms;\n\t\t\t\t\tmatch.termCount = searchResult.termCount;\n\t\t\t\t}\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t}\n\t\treturn matches;\n\t}\n\t_coversAllTokens(matches) {\n\t\tconst termCount = matches.length ? matches[0].termCount : void 0;\n\t\tif (termCount === void 0) return true;\n\t\tif (termCount <= 31) {\n\t\t\tlet coverage = 0;\n\t\t\tfor (let i = 0; i < matches.length; i++) coverage |= matches[i].matchedMask || 0;\n\t\t\treturn coverage === 2 ** termCount - 1;\n\t\t}\n\t\tconst coverage = /* @__PURE__ */ new Set();\n\t\tfor (let i = 0; i < matches.length; i++) {\n\t\t\tconst terms = matches[i].matchedTerms;\n\t\t\tif (terms) for (const t of terms) coverage.add(t);\n\t\t}\n\t\treturn coverage.size === termCount;\n\t}\n};\n\n//#endregion\n//#region src/entry.ts\nFuse.version = \"7.5.0\";\nFuse.createIndex = createIndex;\nFuse.parseIndex = parseIndex;\nFuse.config = Config;\nFuse.match = function(pattern, text, options) {\n\tif (options && options.useTokenSearch) throw new Error(FUSE_MATCH_TOKEN_SEARCH_UNSUPPORTED);\n\treturn createSearcher(pattern, {\n\t\t...Config,\n\t\t...options\n\t}).searchIn(text);\n};\nFuse.parseQuery = parse;\nregister(ExtendedSearch);\nregister(TokenSearch);\nFuse.use = function(...plugins) {\n\tplugins.forEach((plugin) => register(plugin));\n};\nvar entry_default = Fuse;\n\n//#endregion\nexport { entry_default as default };","import {\n Box,\n ClickAwayListener,\n Divider,\n ListItemIcon,\n ListItemText,\n MenuItem,\n MenuList,\n Paper,\n Popper,\n Typography,\n} from '@mui/material';\nimport CheckIcon from '@mui/icons-material/Check';\nimport { useTranslation } from 'react-i18next';\nimport type {\n KeyboardEvent,\n MouseEvent,\n} from 'react';\nimport { useCallback } from 'react';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nexport type DashboardSearchMode = 'exact-match' | 'fuzzy-match' | 'include-match' | 'prefix-exact-match' | 'suffix-exact-match';\n\nexport type DashboardSearchSettingsProps = {\n readonly anchorEl: HTMLElement | null;\n readonly onChange: (searchMode: DashboardSearchMode) => void;\n readonly onClose: () => void;\n readonly onEscapeKeyDown: () => void;\n readonly open: boolean;\n readonly searchMode: DashboardSearchMode;\n};\n\ntype DashboardSearchModeOption = {\n readonly label: string;\n readonly searchMode: DashboardSearchMode;\n};\n\nexport const DashboardSearchSettings = ({ anchorEl, onChange, onClose, onEscapeKeyDown, open, searchMode }: DashboardSearchSettingsProps) => {\n const { t } = useTranslation();\n\n const searchModeOptions: DashboardSearchModeOption[] = [\n {\n label: t`Include match`,\n searchMode: 'include-match',\n },\n {\n label: t`Fuzzy match`,\n searchMode: 'fuzzy-match',\n },\n {\n label: t`Exact match`,\n searchMode: 'exact-match',\n },\n {\n label: t`Starts with`,\n searchMode: 'prefix-exact-match',\n },\n {\n label: t`Ends with`,\n searchMode: 'suffix-exact-match',\n },\n ];\n\n const onMenuItemClick = useCallback((event: MouseEvent<HTMLLIElement>) => {\n const nextSearchMode = event.currentTarget.dataset['searchMode'] as DashboardSearchMode | undefined;\n if (!nextSearchMode) {\n return;\n }\n onChange(nextSearchMode);\n onClose();\n }, [onChange, onClose]);\n\n const onMenuListKeyDown = useCallback((event: KeyboardEvent<HTMLUListElement>) => {\n if (event.key !== 'Escape') {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n onEscapeKeyDown();\n }, [onEscapeKeyDown]);\n\n return (\n <Popper\n anchorEl={anchorEl}\n open={open}\n placement={'bottom-end'}\n sx={{\n zIndex: theme => theme.zIndex.modal + 1,\n }}\n >\n <ClickAwayListener onClickAway={onClose}>\n <Paper\n elevation={8}\n sx={{ width: 280 }}\n {...TestIdUtil.createAttributes('DashboardSearchSettings')}\n >\n <MenuList\n autoFocusItem={open}\n onKeyDown={onMenuListKeyDown}\n >\n {searchModeOptions.map(option => (\n <MenuItem\n data-search-mode={option.searchMode}\n key={option.searchMode}\n onClick={onMenuItemClick}\n selected={option.searchMode === searchMode}\n >\n <ListItemIcon>\n {option.searchMode === searchMode && <CheckIcon fontSize={'small'} />}\n </ListItemIcon>\n <ListItemText>\n {option.label}\n </ListItemText>\n </MenuItem>\n ))}\n </MenuList>\n <Divider />\n <Box sx={{ p: 1.5 }}>\n <Typography variant={'subtitle2'}>\n {t`Operators`}\n </Typography>\n <Typography variant={'body2'}>\n {t`Spaces combine terms with AND.`}\n </Typography>\n <Typography variant={'body2'}>\n {t`Use | between groups for OR.`}\n </Typography>\n <Typography variant={'body2'}>\n {t`Use double quotes for phrases with spaces.`}\n </Typography>\n </Box>\n </Paper>\n </ClickAwayListener>\n </Popper>\n );\n};\n","import {\n Box,\n IconButton,\n InputAdornment,\n OutlinedInput,\n useTheme,\n} from '@mui/material';\nimport SearchIcon from '@mui/icons-material/Search';\nimport KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';\nimport KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';\nimport TuneIcon from '@mui/icons-material/Tune';\nimport CloseIcon from '@mui/icons-material/Close';\nimport type {\n ChangeEvent,\n KeyboardEvent,\n} from 'react';\nimport {\n use,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useStore } from 'zustand';\nimport type { FuseResult } from 'fuse.js';\nimport Fuse from 'fuse.js';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { CaseUtil } from '../../../utils/CaseUtil';\nimport { DASHBOARD_COMPONENT_NAME } from '../../../constants/dashboard';\n\nimport { DashboardContext } from './context/DashboardContext';\nimport type { DashboardSearchMode } from './DashboardSearchSettings';\nimport { DashboardSearchSettings } from './DashboardSearchSettings';\n\ntype FuseData = {\n [key: string]: string;\n id: string;\n};\n\nconst getExtendedSearchText = (searchText: string, searchMode: DashboardSearchMode) => {\n switch (searchMode) {\n case 'exact-match':\n return `=${searchText}`;\n case 'fuzzy-match':\n return searchText;\n case 'include-match':\n return `'${searchText}`;\n case 'prefix-exact-match':\n return `^${searchText}`;\n case 'suffix-exact-match':\n return `${searchText}$`;\n default:\n return `'${searchText}`;\n }\n};\n\nexport const DashboardSearch = () => {\n const inputRef = useRef<HTMLInputElement>(null);\n const searchButtonRef = useRef<HTMLButtonElement>(null);\n const settingsButtonRef = useRef<HTMLButtonElement>(null);\n const shouldRestoreSearchButtonFocusRef = useRef(false);\n const arrowUpButtonRef = useRef<HTMLButtonElement>(null);\n const arrowDownButtonRef = useRef<HTMLButtonElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const dashboardStore = use(DashboardStoreContext);\n const sortedData = useStore(dashboardStore, (state) => state.sortedData);\n const completeCaseType = useStore(dashboardStore, (state) => state.completeCaseType);\n const theme = useTheme();\n const { t } = useTranslation();\n const [searchText, setSearchText] = useState('');\n const [fuse, setFuse] = useState<Fuse<FuseData> | null>(null);\n const [fuseResults, setFuseResults] = useState<FuseResult<FuseData>[]>([]);\n const [isActive, setIsActive] = useState(false);\n const [highlightedIndex, setHighlightedIndex] = useState<number>(-1);\n const [searchMode, setSearchMode] = useState<DashboardSearchMode>('include-match');\n const [settingsAnchorEl, setSettingsAnchorEl] = useState<HTMLElement | null>(null);\n const dashboardContext = use(DashboardContext);\n let searchResultStatusText: null | string = null;\n if (searchText) {\n if (!fuseResults.length) {\n searchResultStatusText = t`No results`;\n } else if (highlightedIndex < 0) {\n searchResultStatusText = t('{{numResults}} results', { numResults: fuseResults.length });\n } else {\n searchResultStatusText = t('{{current}}/{{numResults}} results', { current: highlightedIndex + 1, numResults: fuseResults.length });\n }\n }\n\n const createFuse = useCallback(() => {\n const fuseData: FuseData[] = [];\n sortedData.forEach((caseCbCase) => {\n const fuseDataItem: FuseData = {\n id: caseCbCase.id,\n };\n Object.entries(caseCbCase.content).forEach(([key, value]) => {\n const col = completeCaseType.cols[key];\n if (!col) {\n return;\n }\n const refCol = completeCaseType.ref_cols[col.ref_col_id];\n if (!refCol) {\n return;\n }\n\n const rowValue = CaseUtil.getRowValue({ [key]: value }, col, completeCaseType);\n if (rowValue.isMissing) {\n return;\n }\n if (!refCol.concept_set_id) {\n fuseDataItem[`${key}-raw`] = rowValue.raw;\n }\n if (rowValue.full !== rowValue.raw) {\n fuseDataItem[`${key}-full`] = rowValue.full;\n }\n if (rowValue.long !== rowValue.raw && rowValue.long !== rowValue.full) {\n fuseDataItem[`${key}-long`] = rowValue.long;\n }\n if (rowValue.short !== rowValue.raw && rowValue.short !== rowValue.full && rowValue.short !== rowValue.long) {\n fuseDataItem[`${key}-short`] = rowValue.short;\n }\n });\n fuseData.push(fuseDataItem);\n });\n\n return new Fuse(fuseData, {\n ignoreDiacritics: true,\n ignoreLocation: false,\n includeMatches: true,\n includeScore: true,\n isCaseSensitive: false,\n keys: [\n 'id',\n ...Object.keys(completeCaseType.cols).map(x => [`${x}-raw`, `${x}-full`, `${x}-long`, `${x}-short`]).flat(),\n ],\n threshold: 0.3,\n useExtendedSearch: true,\n });\n }, [completeCaseType, sortedData]);\n\n const getFuse = useCallback(() => {\n if (fuse) {\n return fuse;\n }\n const nextFuse = createFuse();\n setFuse(nextFuse);\n return nextFuse;\n }, [createFuse, fuse]);\n\n const onTextInputChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const nextSearchText = event.target.value;\n setSearchText(nextSearchText);\n if (nextSearchText) {\n getFuse();\n }\n }, [getFuse]);\n\n useEffect(() => {\n setSearchText('');\n setIsActive(false);\n setFuse(null);\n setFuseResults([]);\n setHighlightedIndex(-1);\n }, [completeCaseType, sortedData]);\n\n useEffect(() => {\n if (!searchText) {\n setFuseResults([]);\n setHighlightedIndex(-1);\n dashboardContext.highlight({\n caseIds: [],\n origin: DASHBOARD_COMPONENT_NAME.SEARCH_BOX,\n });\n return;\n }\n if (!fuse) {\n return;\n }\n const extendedSearchText = getExtendedSearchText(searchText, searchMode);\n const results = fuse.search(extendedSearchText).sort((a, b) => a.refIndex - b.refIndex);\n setFuseResults(results);\n setHighlightedIndex(-1);\n }, [dashboardContext, fuse, searchMode, searchText]);\n\n const onSearchButtonClick = useCallback(() => {\n setIsActive(true);\n }, []);\n\n useEffect(() => {\n if (isActive) {\n inputRef.current?.focus();\n } else if (shouldRestoreSearchButtonFocusRef.current) {\n shouldRestoreSearchButtonFocusRef.current = false;\n searchButtonRef.current?.focus();\n }\n }, [isActive]);\n\n const handleClose = useCallback(() => {\n shouldRestoreSearchButtonFocusRef.current = true;\n setIsActive(false);\n setSearchText('');\n setFuseResults([]);\n setHighlightedIndex(-1);\n dashboardContext.highlight({\n caseIds: [],\n origin: DASHBOARD_COMPONENT_NAME.SEARCH_BOX,\n });\n }, [dashboardContext]);\n\n const onCloseButtonClick = useCallback(() => {\n handleClose();\n }, [handleClose]);\n\n const onContainerKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n handleClose();\n }\n }, [handleClose]);\n\n const onTextInputKeyDown = useCallback((event: KeyboardEvent<HTMLInputElement>) => {\n // on enter press, highlight the first result and focus the down arrow button\n if (event.key === 'Enter') {\n if (!fuseResults?.length) {\n return;\n }\n event.preventDefault();\n setHighlightedIndex(0);\n arrowDownButtonRef.current?.focus();\n }\n }, [fuseResults]);\n\n const onUpArrowButtonClick = useCallback(() => {\n // goto previous result\n if (!fuseResults?.length) {\n return;\n }\n setHighlightedIndex((prev) => {\n const newHighlightedIndex = prev <= 0 ? fuseResults.length - 1 : prev - 1;\n return newHighlightedIndex;\n });\n }, [fuseResults]);\n\n const onDownArrowButtonClick = useCallback(() => {\n // goto next result\n if (!fuseResults?.length) {\n return;\n }\n setHighlightedIndex((prev) => {\n const newHighlightedIndex = prev >= fuseResults.length - 1 ? 0 : prev + 1;\n return newHighlightedIndex;\n });\n }, [fuseResults]);\n\n useEffect(() => {\n if (!fuseResults?.length || highlightedIndex < 0 || highlightedIndex >= fuseResults.length) {\n dashboardContext.highlight({\n caseIds: [],\n origin: DASHBOARD_COMPONENT_NAME.SEARCH_BOX,\n });\n return;\n }\n dashboardContext.highlight({\n caseIds: [fuseResults[highlightedIndex].item.id],\n origin: DASHBOARD_COMPONENT_NAME.SEARCH_BOX,\n scrollIntoView: true,\n });\n }, [dashboardContext, fuseResults, highlightedIndex]);\n\n const onGenericKeyDown = useCallback((event: KeyboardEvent<HTMLButtonElement>) => {\n // arrow right, focus the next focusable element\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n const nextFocusableElement = event.currentTarget.nextElementSibling as HTMLElement;\n if (nextFocusableElement) {\n nextFocusableElement.focus();\n }\n }\n // arrow left, focus the previous focusable element\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (event.target === arrowUpButtonRef.current) {\n inputRef.current?.focus();\n return;\n }\n const previousFocusableElement = event.currentTarget.previousElementSibling as HTMLElement;\n if (previousFocusableElement) {\n previousFocusableElement.focus();\n }\n }\n }, []);\n\n const onSettingsButtonClick = useCallback(() => {\n setSettingsAnchorEl(settingsButtonRef.current);\n }, []);\n\n const onSettingsClose = useCallback(() => {\n setSettingsAnchorEl(null);\n }, []);\n\n const onSettingsEscapeKeyDown = useCallback(() => {\n setSettingsAnchorEl(null);\n settingsButtonRef.current?.focus();\n }, []);\n\n const onChangeSearchMode = useCallback((nextSearchMode: DashboardSearchMode) => {\n setSearchMode(nextSearchMode);\n inputRef.current?.focus();\n }, []);\n\n return (\n <Box\n sx={{\n height: theme.spacing(4),\n maxWidth: theme.spacing(60),\n overflow: 'hidden',\n width: 'calc(100% / 2)',\n }}\n {...TestIdUtil.createAttributes('DashboardSearch')}\n >\n {isActive ? (\n <Box\n onKeyDown={onContainerKeyDown}\n >\n <OutlinedInput\n endAdornment={(\n <InputAdornment position={'end'}>\n {searchResultStatusText && (\n <Box\n aria-atomic={'true'}\n aria-live={'polite'}\n role={'status'}\n >\n {searchResultStatusText}\n </Box>\n )}\n <IconButton\n {...TestIdUtil.createAttributes('DashboardSearch-PreviousButton')}\n aria-label={t`Goto previous search result`}\n disabled={!fuseResults?.length}\n edge={'end'}\n onClick={onUpArrowButtonClick}\n onKeyDown={onGenericKeyDown}\n ref={arrowUpButtonRef}\n sx={{ color: theme.palette.primary.main }}\n >\n <KeyboardArrowUpIcon />\n </IconButton>\n <IconButton\n {...TestIdUtil.createAttributes('DashboardSearch-NextButton')}\n aria-label={t`Goto next search result`}\n disabled={!fuseResults?.length}\n edge={'end'}\n onClick={onDownArrowButtonClick}\n onKeyDown={onGenericKeyDown}\n ref={arrowDownButtonRef}\n sx={{ color: theme.palette.primary.main }}\n >\n <KeyboardArrowDownIcon />\n </IconButton>\n <IconButton\n {...TestIdUtil.createAttributes('DashboardSearch-SettingsButton')}\n aria-label={t`Open settings`}\n edge={'end'}\n onClick={onSettingsButtonClick}\n onKeyDown={onGenericKeyDown}\n ref={settingsButtonRef}\n >\n <TuneIcon />\n </IconButton>\n <DashboardSearchSettings\n anchorEl={settingsAnchorEl}\n onChange={onChangeSearchMode}\n onClose={onSettingsClose}\n onEscapeKeyDown={onSettingsEscapeKeyDown}\n open={Boolean(settingsAnchorEl)}\n searchMode={searchMode}\n />\n <IconButton\n {...TestIdUtil.createAttributes('DashboardSearch-CloseButton')}\n aria-label={t`Close search`}\n edge={'end'}\n onClick={onCloseButtonClick}\n onKeyDown={onGenericKeyDown}\n ref={closeButtonRef}\n >\n <CloseIcon />\n </IconButton>\n </InputAdornment>\n )}\n fullWidth\n inputRef={inputRef}\n name={t`Search listed cases`}\n onChange={onTextInputChange}\n onKeyDown={onTextInputKeyDown}\n placeholder={t`Search listed cases`}\n size={'small'}\n slotProps={{\n input: {\n 'aria-label': t`Search listed cases`,\n sx: {\n '&::-webkit-search-cancel-button': {\n display: 'none',\n },\n height: '32px',\n outline: 'none !important',\n paddingBottom: '0 !important',\n paddingTop: '0 !important',\n },\n },\n }}\n sx={{\n backgroundColor: theme.palette.background.paper,\n height: '32px',\n }}\n type={'search'}\n value={searchText}\n />\n </Box>\n ) : (\n <Box\n sx={{\n justifySelf: 'flex-end',\n marginRight: theme.spacing(0.6),\n marginTop: theme.spacing(0.5),\n }}\n >\n <IconButton\n aria-label={t`Search`}\n edge={'end'}\n onClick={onSearchButtonClick}\n ref={searchButtonRef}\n sx={{\n color: theme.palette.primary.main,\n margin: 0,\n padding: 0,\n }}\n >\n <SearchIcon />\n </IconButton>\n </Box>\n )}\n </Box>\n );\n};\n","import {\n Alert,\n AlertTitle,\n Box,\n useTheme,\n} from '@mui/material';\nimport {\n use,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useStore } from 'zustand';\nimport { useShallow } from 'zustand/shallow';\nimport InfoIcon from '@mui/icons-material/Info';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport type { EpiContactDetailsDialogRefMethods } from '@gen-epix/ui-client-common/components/epi/EpiContactDetailsDialog';\nimport { ConfigService } from '@gen-epix/ui-client-common/classes/services/ConfigService';\nimport { EpiContactDetailsDialog } from '@gen-epix/ui-client-common/components/epi/EpiContactDetailsDialog';\nimport {\n SidebarMenu,\n SidebarMenuItem,\n} from '@gen-epix/ui-client-common/components/ui/Sidebar';\nimport {\n TableFiltersSidebarItem,\n TableFiltersSidebarItemIcon,\n} from '@gen-epix/ui-client-common/components/ui/Table';\nimport { KeyboardShortcutService } from '@gen-epix/ui-core/classes/services/KeyboardShortcutService';\n\nimport CollectionIcon from '../../../assets/icons/CollectionIcon.svg?react';\nimport type { CaseSetInfoDialogRefMethods } from '../CaseSetInfoDialog';\nimport { CaseSetInfoDialog } from '../CaseSetInfoDialog';\nimport type { CaseTypeInfoDialogRefMethods } from '../CaseTypeInfoDialog';\nimport { CaseTypeInfoDialog } from '../CaseTypeInfoDialog';\nimport { AddCasesToEventDialog } from '../AddCasesToEventDialog';\nimport type { AddCasesToEventDialogRefMethods } from '../AddCasesToEventDialog';\nimport { CaseInfoDialog } from '../CaseInfoDialog';\nimport type { CaseInfoDialogRefMethods } from '../CaseInfoDialog';\nimport { CreateEventDialog } from '../CreateEventDialog';\nimport type { CreateEventDialogRefMethods } from '../CreateEventDialog';\nimport { RemoveCasesFromEventDialog } from '../RemoveCasesFromEventDialog';\nimport type { RemoveCasesFromEventDialogRefMethods } from '../RemoveCasesFromEventDialog';\nimport { SequenceDownloadDialog } from '../SequenceDownloadDialog';\nimport type { SequenceDownloadDialogRefMethods } from '../SequenceDownloadDialog';\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { Grouping } from '../Grouping';\nimport { FindSimilarCasesDialog } from '../FindSimilarCasesDialog';\nimport type { FindSimilarCasesDialogRefMethods } from '../FindSimilarCasesDialog';\nimport { RemoveFindSimilarCasesResultDialog } from '../RemoveFindSimilarCasesResultDialog/RemoveFindSimilarCasesResultDialog';\nimport type { RemoveFindSimilarCasesResultDialogRefMethods } from '../RemoveFindSimilarCasesResultDialog/RemoveFindSimilarCasesResultDialog';\nimport { EventBusService } from '../../../classes/services/EventBusService';\n\nimport {\n DashboardSettingsSidebarItem,\n DashboardSettingsSidebarItemIcon,\n} from './DashboardSettingsSidebarItem';\nimport { DashboardLayoutRenderer } from './DashboardLayoutRenderer';\nimport type { ForwardRefDashboardLayoutRendererRefMethods } from './DashboardLayoutRenderer';\nimport {\n DashboardDownloadSidebarItem,\n DashboardDownloadSidebarItemIcon,\n} from './DashboardDownloadSidebarItem';\nimport { DashboardSearch } from './DashboardSearch';\n\ntype DashboardProps = {\n readonly caseSet?: CaseDbCaseSet;\n};\n\nexport const DashboardContent = ({ caseSet }: DashboardProps) => {\n const { t } = useTranslation();\n const theme = useTheme();\n const dashboardLayoutRendererRef = useRef<ForwardRefDashboardLayoutRendererRefMethods>(null);\n const caseSetInfoDialogRef = useRef<CaseSetInfoDialogRefMethods>(null);\n const caseTypeInfoDialogRef = useRef<CaseTypeInfoDialogRefMethods>(null);\n const contactDetailsDialogRef = useRef<EpiContactDetailsDialogRefMethods>(null);\n const sequenceDownloadDialogRef = useRef<SequenceDownloadDialogRefMethods>(null);\n const caseInfoDialogRef = useRef<CaseInfoDialogRefMethods>(null);\n const findSimilarCasesDialogRef = useRef<FindSimilarCasesDialogRefMethods>(null);\n const createEventDialogRef = useRef<CreateEventDialogRefMethods>(null);\n const removeCasesFromEventDialogRef = useRef<RemoveCasesFromEventDialogRefMethods>(null);\n const addCasesToEventDialogRef = useRef<AddCasesToEventDialogRefMethods>(null);\n const removeFindSimilarCasesResultDialogRef = useRef<RemoveFindSimilarCasesResultDialogRefMethods>(null);\n const [isFilterSidebarOpen, setIsFilterSidebarOpen] = useState(false);\n const [isSettingsSidebarOpen, setIsSettingsSidebarOpen] = useState(false);\n const [isDownloadSidebarOpen, setIsDownloadSidebarOpen] = useState(false);\n const dashboardStore = use(DashboardStoreContext);\n const fetchData = useStore(dashboardStore, useShallow((state) => state.fetchData));\n const completeCaseType = useStore(dashboardStore, (state) => state.completeCaseType);\n const activeFiltersCount = useStore(dashboardStore, (state) => state.filters.filter(f => !f.isInitialFilterValue()).length);\n const isMaxResultsExceeded = useStore(dashboardStore, (state) => state.isMaxResultsExceeded);\n const isMaxResultsExceededDismissed = useStore(dashboardStore, (state) => state.isMaxResultsExceededDismissed);\n\n const onMaxResultsExceededButtonClose = useCallback(() => {\n dashboardStore.setState({ isMaxResultsExceededDismissed: true });\n }, [dashboardStore]);\n\n useEffect(() => {\n const eventBus = EventBusService.getInstance();\n const removers = [\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('onEventCreated', () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n fetchData();\n }),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openAddCasesToEventDialog', (...args) => addCasesToEventDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openCaseInfoDialog', (...args) => caseInfoDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openContactDetailsDialog', (...args) => contactDetailsDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openCreateEventDialog', (...args) => createEventDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openFindSimilarCasesDialog', (...args) => findSimilarCasesDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openRemoveFindSimilarCasesResultDialog', (...args) => removeFindSimilarCasesResultDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openRemoveCasesFromEventDialog', (...args) => removeCasesFromEventDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openSequenceDownloadDialog', (...args) => sequenceDownloadDialogRef.current?.open(...args)),\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openFiltersMenu', () => setIsFilterSidebarOpen(true)),\n ];\n return () => {\n removers.forEach(callbackfn => callbackfn());\n };\n }, [fetchData]);\n\n useEffect(() => {\n const removers = [\n KeyboardShortcutService.getInstance().registerShortcut({ callback: () => {\n setIsFilterSidebarOpen(x => !x);\n }, key: 'f', modifier: null }),\n KeyboardShortcutService.getInstance().registerShortcut({ callback: () => {\n setIsSettingsSidebarOpen(x => !x);\n }, key: 's', modifier: null }),\n KeyboardShortcutService.getInstance().registerShortcut({ callback: () => {\n caseTypeInfoDialogRef.current.open();\n }, key: 'i', modifier: null }),\n ];\n return () => {\n removers.forEach(callbackfn => callbackfn());\n };\n }, []);\n\n const onDashboardFilterSidebarClose = useCallback(() => {\n setIsFilterSidebarOpen(false);\n }, []);\n\n const onDashboardOpenFilterSidebarButtonClick = useCallback(() => {\n setIsFilterSidebarOpen(true);\n }, []);\n\n const onDashboardSettingsSidebarClose = useCallback(() => {\n setIsSettingsSidebarOpen(false);\n }, []);\n\n const onDashboardDownloadSidebarClose = useCallback(() => {\n setIsDownloadSidebarOpen(false);\n }, []);\n\n const onDashboardLayoutSelectorSidebarButtonClick = useCallback(() => {\n setIsSettingsSidebarOpen(true);\n }, []);\n\n const onDashboardOpenDownloadButtonClick = useCallback(() => {\n setIsDownloadSidebarOpen(true);\n }, []);\n\n const onDashboardOpenInfoSidebarButtonClick = useCallback(() => {\n caseTypeInfoDialogRef.current.open();\n }, []);\n\n const onDashboardOpenCaseSetDescriptionButtonClick = useCallback(() => {\n caseSetInfoDialogRef.current.open({\n caseSetId: caseSet?.id,\n caseTypeId: completeCaseType?.id,\n });\n }, [caseSet?.id, completeCaseType?.id]);\n\n const onDashboardLayoutSelectorSidebarReset = useCallback(() => {\n dashboardLayoutRendererRef.current?.reset();\n }, []);\n\n const shouldShowMaxResultsExceededAlert = useMemo(() => {\n return !!isMaxResultsExceeded && !isMaxResultsExceededDismissed;\n }, [isMaxResultsExceededDismissed, isMaxResultsExceeded]);\n\n return (\n <>\n {/* Sidebar */}\n <SidebarMenu>\n <SidebarMenuItem\n badgeColor={'secondary'}\n badgeContent={activeFiltersCount}\n first\n icon={<TableFiltersSidebarItemIcon />}\n onClick={onDashboardOpenFilterSidebarButtonClick}\n testIdAttributes={{ name: 'filters' }}\n title={t`Open filters`}\n />\n <SidebarMenuItem\n badgeColor={'secondary'}\n icon={<DashboardSettingsSidebarItemIcon />}\n onClick={onDashboardLayoutSelectorSidebarButtonClick}\n testIdAttributes={{ name: 'dashboard' }}\n title={t`Change dashboard layout`}\n />\n <SidebarMenuItem\n icon={<InfoIcon />}\n onClick={onDashboardOpenInfoSidebarButtonClick}\n testIdAttributes={{ name: 'case' }}\n title={t`Show case type information`}\n />\n {caseSet && (\n <SidebarMenuItem\n icon={<CollectionIcon />}\n onClick={onDashboardOpenCaseSetDescriptionButtonClick}\n testIdAttributes={{ name: 'event' }}\n title={t`Show event information`}\n />\n )}\n <SidebarMenuItem\n icon={<DashboardDownloadSidebarItemIcon />}\n onClick={onDashboardOpenDownloadButtonClick}\n testIdAttributes={{ name: 'download' }}\n title={t`Download`}\n />\n <TableFiltersSidebarItem\n onClose={onDashboardFilterSidebarClose}\n open={isFilterSidebarOpen}\n />\n <DashboardSettingsSidebarItem\n onClose={onDashboardSettingsSidebarClose}\n onReset={onDashboardLayoutSelectorSidebarReset}\n open={isSettingsSidebarOpen}\n />\n <CaseTypeInfoDialog\n ref={caseTypeInfoDialogRef}\n />\n {caseSet && (\n <CaseSetInfoDialog ref={caseSetInfoDialogRef} />\n )}\n <DashboardDownloadSidebarItem\n onClose={onDashboardDownloadSidebarClose}\n open={isDownloadSidebarOpen}\n />\n </SidebarMenu>\n {/* Content */}\n <Box\n sx={{\n display: 'grid',\n gridTemplateRows: `${shouldShowMaxResultsExceededAlert ? 'max-content ' : ''}max-content auto`,\n height: '100%',\n paddingLeft: theme.spacing(ConfigService.getInstance().config.layout.SIDEBAR_MENU_WIDTH + 1),\n width: '100%',\n }}\n >\n {shouldShowMaxResultsExceededAlert && (\n <Box\n sx={{\n marginY: theme.spacing(1),\n }}\n >\n <Alert\n onClose={onMaxResultsExceededButtonClose}\n severity={'warning'}\n sx={{\n width: '100%',\n }}\n >\n <AlertTitle>\n {t`Maximum number of results exceeded`}\n </AlertTitle>\n {t('The maximum number of results for {{caseTypeName}} ({{maxResultsForCaseType}}) has been exceeded. Refine your filters to reduce the number of results.', { caseTypeName: completeCaseType.name, maxResultsForCaseType: completeCaseType.props.read_max_n_cases })}\n </Alert>\n </Box>\n )}\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n }}\n >\n <Grouping />\n <DashboardSearch />\n </Box>\n <Box>\n <DashboardLayoutRenderer\n disabled={isFilterSidebarOpen || isSettingsSidebarOpen}\n ref={dashboardLayoutRendererRef}\n />\n </Box>\n </Box>\n <EpiContactDetailsDialog ref={contactDetailsDialogRef} />\n <FindSimilarCasesDialog ref={findSimilarCasesDialogRef} />\n <RemoveFindSimilarCasesResultDialog ref={removeFindSimilarCasesResultDialogRef} />\n <SequenceDownloadDialog ref={sequenceDownloadDialogRef} />\n <CaseInfoDialog ref={caseInfoDialogRef} />\n <CreateEventDialog ref={createEventDialogRef} />\n <RemoveCasesFromEventDialog ref={removeCasesFromEventDialogRef} />\n <AddCasesToEventDialog ref={addCasesToEventDialogRef} />\n </>\n );\n};\n","import {\n use,\n useCallback,\n useMemo,\n} from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport { Subject } from '@gen-epix/ui-core/classes/Subject';\n\nimport type {\n Highlighting,\n LineListRangeSubjectValue,\n LinkedScrollSubjectValue,\n} from '../../../../models/caseDb';\nimport { UserProfileStoreContext } from '../../../../stores/userProfileStore/userProfileStoreContext';\n\nimport { DashboardContext } from './DashboardContext';\n\nexport type DashboardContextProviderProps = PropsWithChildren<{\n caseSet: CaseDbCaseSet;\n}>;\n\nexport const DashboardContextProvider = ({ caseSet, children }: DashboardContextProviderProps) => {\n const userProfileStore = use(UserProfileStoreContext);\n const highlightSubject = useMemo<Subject<Highlighting>>(() => new Subject({\n caseIds: [],\n origin: null,\n }), []);\n const lineListRangeSubject = useMemo<Subject<LineListRangeSubjectValue>>(() => new Subject(), []);\n const linkedScrollSubject = useMemo<Subject<LinkedScrollSubjectValue>>(() => new Subject(), []);\n\n const reset = useCallback(() => {\n highlightSubject.next({\n caseIds: [],\n origin: null,\n });\n lineListRangeSubject.next(undefined);\n linkedScrollSubject.next(undefined);\n }, [highlightSubject, lineListRangeSubject, linkedScrollSubject]);\n\n const highlight = useCallback((highlighting: Highlighting) => {\n if (userProfileStore.getState().dashboardGeneralSettings.isHighlightingEnabled) {\n highlightSubject.next(highlighting);\n }\n }, [highlightSubject, userProfileStore]);\n\n const contextValue = useMemo(() => {\n return {\n caseSet,\n highlight,\n highlightSubject,\n lineListRangeSubject,\n linkedScrollSubject,\n reset,\n };\n }, [caseSet, highlight, highlightSubject, lineListRangeSubject, linkedScrollSubject, reset]);\n return (\n <DashboardContext value={contextValue}>\n {children}\n </DashboardContext>\n );\n};\n","import type {\n CaseDbCase,\n CaseDbCaseSet,\n} from '@gen-epix/api-casedb';\nimport { ResponseHandler } from '@gen-epix/ui-client-common/components/ui/ResponseHandler';\nimport { Box } from '@mui/system';\nimport {\n use,\n useCallback,\n useEffect,\n useState,\n} from 'react';\nimport { useStore } from 'zustand';\n\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { withEpiDashboardStore } from '../DashboardStoreLoader';\nimport { EventBusService } from '../../../classes/services/EventBusService';\nimport { DashboardEditCases } from '../DashboardEditCases';\n\nimport { DashboardContent } from './DashboardContent';\nimport { DashboardContextProvider } from './context/DashboardContextProvider';\n\ntype DashboardProps = {\n readonly caseSet?: CaseDbCaseSet;\n};\n\nexport const Dashboard = withEpiDashboardStore(({ caseSet }: DashboardProps) => {\n const dashboardStore = use(DashboardStoreContext);\n const dataError = useStore(dashboardStore, (state) => state.dataError);\n const [casesToEdit, setCasesToEdit] = useState<CaseDbCase[] | null>(null);\n\n const onDashboardEditCasesClose = useCallback(() => {\n setCasesToEdit(null);\n }, []);\n\n useEffect(() => {\n const eventBus = EventBusService.getInstance();\n const removers = [\n // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener\n eventBus.addEventListener('openEditCases', (cases: CaseDbCase[]) => {\n setCasesToEdit(cases);\n }),\n ];\n return () => {\n removers.forEach(callbackfn => callbackfn());\n };\n }, []);\n\n return (\n <DashboardContextProvider caseSet={caseSet}>\n <Box\n sx={{\n height: '100%',\n position: 'relative',\n width: '100%',\n }}\n >\n <ResponseHandler\n error={dataError}\n isLoading={false}\n >\n {casesToEdit ? (\n <DashboardEditCases\n cases={casesToEdit}\n onClose={onDashboardEditCasesClose}\n />\n ) : (\n <DashboardContent caseSet={caseSet} />\n )}\n </ResponseHandler>\n </Box>\n </DashboardContextProvider>\n );\n});\n","import {\n Box,\n Divider,\n styled,\n Tooltip,\n Typography,\n useTheme,\n} from '@mui/material';\nimport CloseIcon from '@mui/icons-material/Close';\nimport ZoomInMapIcon from '@mui/icons-material/ZoomInMap';\nimport ZoomOutMapIcon from '@mui/icons-material/ZoomOutMap';\nimport { useTranslation } from 'react-i18next';\nimport { useStore } from 'zustand';\nimport type {\n PropsWithChildren,\n ReactNode,\n} from 'react';\nimport {\n isValidElement,\n use,\n useCallback,\n useMemo,\n} from 'react';\nimport type { MenuItemData } from '@gen-epix/ui-core-components/models/nestedMenu';\nimport { MenuDataUtil } from '@gen-epix/ui-client-common/utils/MenuDataUtil';\nimport { NestedDropdown } from '@gen-epix/ui-core-components/components/NestedMenu';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { WidgetMenu } from '../WidgetMenu';\nimport { WidgetHeaderIconButton } from '../WidgetHeaderIconButton';\nimport { DashboardStoreContext } from '../../../stores/dashboardStore';\nimport { DashboardUtil } from '../../../utils/DashboardUtil';\nimport { Warning } from '../Warning';\nimport { UserProfileStoreContext } from '../../../stores/userProfileStore/userProfileStoreContext';\n\nimport { DashboardZoneContext } from './DashboardZoneContext';\n\n\nexport type DashboardWidgetProps = PropsWithChildren<{\n readonly expandDisabled?: boolean;\n readonly isLoading?: boolean;\n readonly primaryMenu?: MenuItemData[] | ReactNode;\n readonly secondaryMenu?: MenuItemData[] | ReactNode;\n readonly title: MenuItemData | ReactNode | string;\n readonly warningMessage?: string;\n readonly widgetName?: string;\n}>;\n\nconst StyledDivider = styled(Divider)(({ theme }) => ({\n marginBottom: theme.spacing(0.5),\n marginTop: theme.spacing(0.5),\n}));\n\nexport const DashboardWidget = ({ children, expandDisabled, isLoading, primaryMenu, secondaryMenu, title, warningMessage, widgetName }: DashboardWidgetProps) => {\n const theme = useTheme();\n const { t } = useTranslation();\n\n const userProfileStore = use(UserProfileStoreContext);\n const dashboardStore = use(DashboardStoreContext);\n const zoneKey = use(DashboardZoneContext);\n const expandZone = useStore(dashboardStore, (state) => state.expandZone);\n const expandedZone = useStore(dashboardStore, (state) => state.expandedZone);\n const enabledLayoutZoneCount = useStore(userProfileStore, (state) => DashboardUtil.getEnabledWidgets(state.dashboardArrangementConfig).length);\n const setDashboardArrangementConfig = useStore(userProfileStore, (state) => state.setDashboardArrangementConfig);\n\n const isExpanded = expandedZone === zoneKey;\n\n const onExpandButtonClick = useCallback(() => {\n expandZone(expandedZone === zoneKey ? null : zoneKey);\n }, [expandZone, expandedZone, zoneKey]);\n\n const onRemoveButtonClick = useCallback(() => {\n const { dashboardArrangementConfig } = userProfileStore.getState();\n setDashboardArrangementConfig({\n ...dashboardArrangementConfig,\n arrangementWidgetAssignments: {\n ...dashboardArrangementConfig.arrangementWidgetAssignments,\n [zoneKey]: null,\n },\n });\n }, [setDashboardArrangementConfig, userProfileStore, zoneKey]);\n\n\n const titleInnerElement = useMemo(() => {\n if (typeof title === 'string') {\n return (\n <Tooltip\n arrow\n placement={'right'}\n title={title}\n >\n <Typography\n component={'h2'}\n sx={{\n display: 'inline-block',\n fontWeight: 'bold',\n lineHeight: theme.spacing(3),\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n variant={'body1'}\n >\n {title}\n </Typography>\n </Tooltip>\n );\n }\n if (isValidElement(title)) {\n return title;\n }\n if (MenuDataUtil.isMenuItemData(title)) {\n return (\n <NestedDropdown\n ButtonProps={{\n color: 'inherit',\n size: 'small',\n sx: {\n '& span': {\n margin: 0,\n },\n background: 'none !important',\n margin: 0,\n padding: 0,\n textTransform: 'none',\n },\n variant: 'text',\n }}\n menuItemsData={title}\n showTopLevelTooltip\n />\n );\n }\n }, [theme, title]);\n\n const titleElement = useMemo(() => (\n <Box\n sx={{\n height: theme.spacing(3),\n position: 'relative',\n width: '100%',\n }}\n >\n <Box\n sx={{\n height: theme.spacing(3),\n left: 0,\n maxWidth: '100%',\n position: 'absolute',\n }}\n >\n {titleInnerElement}\n </Box>\n </Box>\n ), [theme, titleInnerElement]);\n\n return (\n <Box\n {...TestIdUtil.createAttributes('DashboardWidget', { 'widget-name': widgetName })}\n sx={{\n height: '100%',\n }}\n >\n\n {/* Widget header bar */}\n <Box\n sx={{\n display: 'flex',\n height: theme.spacing(3),\n justifyContent: 'space-between',\n }}\n >\n {/* Title */}\n {titleElement}\n <Box\n sx={{\n display: 'flex',\n }}\n >\n {/* primary menu */}\n <Box\n sx={{\n display: 'flex',\n height: `calc(${theme.spacing(3)} - 1px)`,\n justifySelf: 'right',\n marginTop: '1px',\n }}\n >\n {primaryMenu && <WidgetMenu menu={primaryMenu} />}\n {primaryMenu && (\n <StyledDivider\n aria-hidden={'true'}\n flexItem\n orientation={'vertical'}\n variant={'middle'}\n />\n )}\n </Box>\n {/* secondary menu */}\n <Box\n sx={{\n display: 'flex',\n height: `calc(${theme.spacing(3)} - 1px)`,\n justifySelf: 'right',\n marginTop: '1px',\n }}\n >\n {secondaryMenu && <WidgetMenu menu={secondaryMenu} />}\n {secondaryMenu && (\n <StyledDivider\n aria-hidden={'true'}\n flexItem\n orientation={'vertical'}\n variant={'middle'}\n />\n )}\n {enabledLayoutZoneCount > 1 && (\n <WidgetHeaderIconButton\n disabled={expandDisabled}\n label={isExpanded ? t`Collapse` : t`Expand`}\n onClick={onExpandButtonClick}\n >\n {isExpanded && (\n <ZoomInMapIcon />\n )}\n {!isExpanded && (\n <ZoomOutMapIcon />\n )}\n </WidgetHeaderIconButton>\n )}\n {!isExpanded && (\n <WidgetHeaderIconButton\n label={t`Remove widget`}\n onClick={onRemoveButtonClick}\n sx={{\n marginRight: theme.spacing(-1),\n }}\n >\n <CloseIcon />\n </WidgetHeaderIconButton>\n )}\n </Box>\n </Box>\n\n </Box>\n {/* Widget content */}\n <Box\n sx={{\n height: `calc(100% - ${theme.spacing(3)})`,\n position: 'relative',\n }}\n >\n {warningMessage && (\n <Box\n sx={{\n height: theme.spacing(3),\n }}\n >\n <Warning warningMessage={warningMessage} />\n </Box>\n )}\n <Box\n sx={{\n height: warningMessage ? `calc(100% - ${theme.spacing(3)})` : '100%',\n }}\n >\n {isLoading && (\n <Spinner\n label={t`Loading`}\n />\n )}\n {!isLoading && children}\n </Box>\n </Box>\n </Box>\n );\n};\n"],"x_google_ignoreList":[5,10],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAa,KAAqC,IAChD,EACE,oBACA,YACA,kBACA,mBAEe;CACjB,IAAM,EAAE,SAAM,EAAe,GACvB,IAAS,GAAM,GACf,IAAiB,EAAI,CAAqB,GAC1C,IAA6B,EAAS,IAAiB,MAAU,EAAM,0BAA0B,GACjG,IAAqB,QAAc,EAAe,sBAAsB,EAAU,gBAAgB,GAAG,CAAC,EAAU,gBAAgB,CAAC,GACjI,IAA0B,EAAS,IAAiB,MAAU,EAAM,uBAAuB,GAC3F,CAAC,GAAqC,KAA0C,EAAS,CAAuB;CAEtH,QAAgB;EACd,EAAc,CAAC,mCAAmC;CACpD,GAAG,CAAC,GAAG,CAAa,CAAC;CAErB,IAAM,IAAwC,QAAkB;EAE9D,AADA,EAAgC,CAAmC,GACnE,EAAQ;CAEV,GAAG;EAAC;EAA4B;EAAqC;CAAO,CAAC,GAEvE,IAAoB,QAAkB;EAC1C,EAAuC,CAAuB;CAChE,GAAG,CAAC,CAAuB,CAAC,GAEtB,IAAiC,QAAkB;EAEvD,AADA,EAAgC,CAAC,CAAC,GAClC,EAAQ;CACV,GAAG,CAAC,GAA4B,CAAO,CAAC;CAExC,QAAgB;EACd,IAAM,IAA0B,CAAC;EA0BjC,AAzBA,EAAQ,KAAK;GACX,GAAG,EAAW,iBAAiB,gDAAgD;GAC/E,OAAO;GACP,OAAO,CAAC;GACR,SAAS;GACT,SAAS;EACX,CAAC,GACG,EAAwB,WAAW,EAAoC,UACzE,EAAQ,KAAK;GACX,GAAG,EAAW,iBAAiB,+CAA+C;GAC9E,OAAO;GACP,OAAO,CAAC;GACR,SAAS;GACT,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