@gen3/frontend 0.10.98 → 0.10.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/dist/cjs/index.js +532 -663
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/api/staticNotebook/index.d.ts +4 -0
  4. package/dist/dts/api/staticNotebook/index.d.ts.map +1 -0
  5. package/dist/dts/api/staticNotebook/index.js +118 -0
  6. package/dist/dts/api/staticNotebook/index.js.map +1 -0
  7. package/dist/dts/api/staticNotebooks/index.d.ts +4 -0
  8. package/dist/dts/api/staticNotebooks/index.d.ts.map +1 -0
  9. package/dist/dts/api/staticNotebooks/index.js +118 -0
  10. package/dist/dts/api/staticNotebooks/index.js.map +1 -0
  11. package/dist/dts/components/Protected/ProtectedContent.d.ts.map +1 -1
  12. package/dist/dts/components/Protected/ProtectedContent.js +9 -4
  13. package/dist/dts/components/Protected/ProtectedContent.js.map +1 -1
  14. package/dist/dts/components/charts/CollapsableCharts.d.ts +3 -0
  15. package/dist/dts/components/charts/CollapsableCharts.d.ts.map +1 -1
  16. package/dist/dts/components/charts/CollapsableCharts.js +2 -2
  17. package/dist/dts/components/charts/CollapsableCharts.js.map +1 -1
  18. package/dist/dts/components/charts/index.d.ts +2 -1
  19. package/dist/dts/components/charts/index.d.ts.map +1 -1
  20. package/dist/dts/components/charts/index.js +2 -1
  21. package/dist/dts/components/charts/index.js.map +1 -1
  22. package/dist/dts/components/charts/types.d.ts +9 -0
  23. package/dist/dts/components/charts/types.d.ts.map +1 -1
  24. package/dist/dts/components/facets/FacetSelector.d.ts.map +1 -1
  25. package/dist/dts/components/facets/FacetSelector.js +7 -4
  26. package/dist/dts/components/facets/FacetSelector.js.map +1 -1
  27. package/dist/dts/features/Analysis/AnalysisBreadcrumbs.d.ts +11 -0
  28. package/dist/dts/features/Analysis/AnalysisBreadcrumbs.d.ts.map +1 -0
  29. package/dist/dts/features/Analysis/AnalysisBreadcrumbs.js +20 -0
  30. package/dist/dts/features/Analysis/AnalysisBreadcrumbs.js.map +1 -0
  31. package/dist/dts/features/Analysis/AnalysisBreadcrumbs.unit.test.d.ts +3 -0
  32. package/dist/dts/features/Analysis/AnalysisBreadcrumbs.unit.test.d.ts.map +1 -0
  33. package/dist/dts/features/Analysis/AnalysisBreadcrumbs.unit.test.js +78 -0
  34. package/dist/dts/features/Analysis/AnalysisBreadcrumbs.unit.test.js.map +1 -0
  35. package/dist/dts/features/Analysis/AnalysisCard.d.ts.map +1 -1
  36. package/dist/dts/features/Analysis/AnalysisCard.js +6 -4
  37. package/dist/dts/features/Analysis/AnalysisCard.js.map +1 -1
  38. package/dist/dts/features/Analysis/AnalysisCard.stories.d.ts +34 -0
  39. package/dist/dts/features/Analysis/AnalysisCard.stories.d.ts.map +1 -0
  40. package/dist/dts/features/Analysis/AnalysisCard.stories.js +25 -0
  41. package/dist/dts/features/Analysis/AnalysisCard.stories.js.map +1 -0
  42. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +22 -10
  43. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts.map +1 -1
  44. package/dist/dts/features/Analysis/AnalysisCenter.js +2 -2
  45. package/dist/dts/features/Analysis/AnalysisCenter.js.map +1 -1
  46. package/dist/dts/features/Analysis/AnalysisPanel.stories.d.ts +22 -0
  47. package/dist/dts/features/Analysis/AnalysisPanel.stories.d.ts.map +1 -0
  48. package/dist/dts/features/Analysis/AnalysisPanel.stories.js +28 -0
  49. package/dist/dts/features/Analysis/AnalysisPanel.stories.js.map +1 -0
  50. package/dist/dts/features/Analysis/AnalysisWorkspace.d.ts +29 -0
  51. package/dist/dts/features/Analysis/AnalysisWorkspace.d.ts.map +1 -0
  52. package/dist/dts/features/Analysis/AnalysisWorkspace.js +37 -0
  53. package/dist/dts/features/Analysis/AnalysisWorkspace.js.map +1 -0
  54. package/dist/dts/features/Analysis/TextDescription.js +1 -1
  55. package/dist/dts/features/Analysis/context.d.ts +29 -0
  56. package/dist/dts/features/Analysis/context.d.ts.map +1 -0
  57. package/dist/dts/features/Analysis/context.js +34 -0
  58. package/dist/dts/features/Analysis/context.js.map +1 -0
  59. package/dist/dts/features/Analysis/types.d.ts +6 -0
  60. package/dist/dts/features/Analysis/types.d.ts.map +1 -1
  61. package/dist/dts/features/Analysis/types.js.map +1 -1
  62. package/dist/dts/features/CohortBuilder/CohortPanel.d.ts +22 -3
  63. package/dist/dts/features/CohortBuilder/CohortPanel.d.ts.map +1 -1
  64. package/dist/dts/features/CohortBuilder/CohortPanel.js +47 -17
  65. package/dist/dts/features/CohortBuilder/CohortPanel.js.map +1 -1
  66. package/dist/dts/features/CohortBuilder/types.d.ts +2 -1
  67. package/dist/dts/features/CohortBuilder/types.d.ts.map +1 -1
  68. package/dist/dts/features/CohortBuilder/types.js.map +1 -1
  69. package/dist/dts/features/CohortDiscovery/CohortDiscovery.d.ts.map +1 -1
  70. package/dist/dts/features/CohortDiscovery/CohortDiscovery.js +10 -9
  71. package/dist/dts/features/CohortDiscovery/CohortDiscovery.js.map +1 -1
  72. package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.d.ts.map +1 -1
  73. package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.js +1 -2
  74. package/dist/dts/features/CohortDiscovery/Requests/RequestsPanel.js.map +1 -1
  75. package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.d.ts.map +1 -1
  76. package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.js +1 -0
  77. package/dist/dts/features/CohortDiscovery/api/analysisApiCohortDiscovery.js.map +1 -1
  78. package/dist/dts/features/CohortDiscovery/queryApi.js +0 -380
  79. package/dist/dts/features/CohortDiscovery/queryApi.js.map +1 -1
  80. package/dist/dts/features/Dictionary/types.d.ts +3 -3
  81. package/dist/dts/features/Dictionary/types.d.ts.map +1 -1
  82. package/dist/dts/features/Discovery/DiscoveryIndexPanel.js +2 -2
  83. package/dist/dts/features/Discovery/DiscoveryIndexPanel.js.map +1 -1
  84. package/dist/dts/features/Discovery/types.d.ts +4 -16
  85. package/dist/dts/features/Discovery/types.d.ts.map +1 -1
  86. package/dist/dts/features/Discovery/types.js.map +1 -1
  87. package/dist/dts/features/Navigation/NavPageLayout.d.ts +3 -3
  88. package/dist/dts/features/Navigation/NavPageLayout.d.ts.map +1 -1
  89. package/dist/dts/features/Navigation/NavPageLayout.js +2 -2
  90. package/dist/dts/features/Navigation/NavPageLayout.js.map +1 -1
  91. package/dist/dts/features/Navigation/TopBar/TopBar.d.ts.map +1 -1
  92. package/dist/dts/features/Navigation/TopBar/TopBar.js +3 -2
  93. package/dist/dts/features/Navigation/TopBar/TopBar.js.map +1 -1
  94. package/dist/dts/features/Navigation/index.d.ts +2 -2
  95. package/dist/dts/features/Navigation/index.d.ts.map +1 -1
  96. package/dist/dts/features/Navigation/index.js +2 -1
  97. package/dist/dts/features/Navigation/index.js.map +1 -1
  98. package/dist/dts/features/Navigation/types.d.ts +7 -1
  99. package/dist/dts/features/Navigation/types.d.ts.map +1 -1
  100. package/dist/dts/features/Navigation/types.js +19 -1
  101. package/dist/dts/features/Navigation/types.js.map +1 -1
  102. package/dist/dts/features/StaticNotebook/StaticNotebook.d.ts +4 -0
  103. package/dist/dts/features/StaticNotebook/StaticNotebook.d.ts.map +1 -0
  104. package/dist/dts/features/StaticNotebook/StaticNotebook.js +79 -0
  105. package/dist/dts/features/StaticNotebook/StaticNotebook.js.map +1 -0
  106. package/dist/dts/features/StaticNotebook/StaticNotebookIFrame.d.ts +6 -0
  107. package/dist/dts/features/StaticNotebook/StaticNotebookIFrame.d.ts.map +1 -0
  108. package/dist/dts/features/StaticNotebook/StaticNotebookIFrame.js +10 -0
  109. package/dist/dts/features/StaticNotebook/StaticNotebookIFrame.js.map +1 -0
  110. package/dist/dts/features/StaticNotebook/StaticNotebookViewer.d.ts +6 -0
  111. package/dist/dts/features/StaticNotebook/StaticNotebookViewer.d.ts.map +1 -0
  112. package/dist/dts/features/StaticNotebook/StaticNotebookViewer.js +91 -0
  113. package/dist/dts/features/StaticNotebook/StaticNotebookViewer.js.map +1 -0
  114. package/dist/dts/features/StaticNotebook/api/staticNotebookAPI.d.ts +4 -0
  115. package/dist/dts/features/StaticNotebook/api/staticNotebookAPI.d.ts.map +1 -0
  116. package/dist/dts/features/StaticNotebook/api/staticNotebookAPI.js +129 -0
  117. package/dist/dts/features/StaticNotebook/api/staticNotebookAPI.js.map +1 -0
  118. package/dist/dts/features/StaticNotebook/constants.d.ts +4 -0
  119. package/dist/dts/features/StaticNotebook/constants.d.ts.map +1 -0
  120. package/dist/dts/features/StaticNotebook/constants.js +5 -0
  121. package/dist/dts/features/StaticNotebook/constants.js.map +1 -0
  122. package/dist/dts/features/StaticNotebook/index.d.ts +4 -0
  123. package/dist/dts/features/StaticNotebook/index.d.ts.map +1 -0
  124. package/dist/dts/features/StaticNotebook/index.js +4 -0
  125. package/dist/dts/features/StaticNotebook/index.js.map +1 -0
  126. package/dist/dts/index.d.ts +3 -1
  127. package/dist/dts/index.d.ts.map +1 -1
  128. package/dist/dts/index.js +4 -2
  129. package/dist/dts/index.js.map +1 -1
  130. package/dist/dts/lib/common/staticProps.d.ts.map +1 -1
  131. package/dist/dts/lib/common/staticProps.js +28 -8
  132. package/dist/dts/lib/common/staticProps.js.map +1 -1
  133. package/dist/dts/lib/content/types.d.ts +2 -2
  134. package/dist/dts/lib/content/types.d.ts.map +1 -1
  135. package/dist/dts/lib/notebooks/index.d.ts +3 -0
  136. package/dist/dts/lib/notebooks/index.d.ts.map +1 -0
  137. package/dist/dts/lib/notebooks/index.js +96 -0
  138. package/dist/dts/lib/notebooks/index.js.map +1 -0
  139. package/dist/dts/pages/AiSearch/AiSearch.js +1 -1
  140. package/dist/dts/pages/AiSearch/AiSearch.js.map +1 -1
  141. package/dist/dts/pages/AiSearch/data.js +1 -1
  142. package/dist/dts/pages/AiSearch/data.js.map +1 -1
  143. package/dist/dts/pages/Analysis/Analysis.js +1 -1
  144. package/dist/dts/pages/Analysis/Analysis.js.map +1 -1
  145. package/dist/dts/pages/Crosswalk/Crosswalk.js +1 -1
  146. package/dist/dts/pages/Crosswalk/Crosswalk.js.map +1 -1
  147. package/dist/dts/pages/DataDictionary/DataDictionary.js +1 -1
  148. package/dist/dts/pages/DataDictionary/DataDictionary.js.map +1 -1
  149. package/dist/dts/pages/DataLibrary/DataLibrary.js +1 -1
  150. package/dist/dts/pages/DataLibrary/DataLibrary.js.map +1 -1
  151. package/dist/dts/pages/Discovery/Discovery.js +1 -1
  152. package/dist/dts/pages/Discovery/Discovery.js.map +1 -1
  153. package/dist/dts/pages/Explorer/Explorer.js +1 -1
  154. package/dist/dts/pages/Explorer/Explorer.js.map +1 -1
  155. package/dist/dts/pages/Explorer/data.d.ts.map +1 -1
  156. package/dist/dts/pages/Explorer/data.js +17 -4
  157. package/dist/dts/pages/Explorer/data.js.map +1 -1
  158. package/dist/dts/pages/Landing/Landing.js +1 -1
  159. package/dist/dts/pages/Landing/Landing.js.map +1 -1
  160. package/dist/dts/pages/Landing/about-us.js +1 -1
  161. package/dist/dts/pages/Landing/about-us.js.map +1 -1
  162. package/dist/dts/pages/Landing/contact.js +1 -1
  163. package/dist/dts/pages/Landing/contact.js.map +1 -1
  164. package/dist/dts/pages/Landing/resource.js +1 -1
  165. package/dist/dts/pages/Landing/resource.js.map +1 -1
  166. package/dist/dts/pages/Login/Login.js +1 -1
  167. package/dist/dts/pages/Login/Login.js.map +1 -1
  168. package/dist/dts/pages/NotebookLite/NotebookLite.js +1 -1
  169. package/dist/dts/pages/NotebookLite/NotebookLite.js.map +1 -1
  170. package/dist/dts/pages/Profile/Profile.js +1 -1
  171. package/dist/dts/pages/Profile/Profile.js.map +1 -1
  172. package/dist/dts/pages/Query/Query.js +1 -1
  173. package/dist/dts/pages/Query/Query.js.map +1 -1
  174. package/dist/dts/pages/Submission/Submission.js +1 -1
  175. package/dist/dts/pages/Submission/Submission.js.map +1 -1
  176. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.js +1 -1
  177. package/dist/dts/pages/TabbedCohortBuilder/TabbedCohortBuilderPage.js.map +1 -1
  178. package/dist/dts/pages/Theme/Colors.js +1 -1
  179. package/dist/dts/pages/Theme/Colors.js.map +1 -1
  180. package/dist/dts/pages/Workspace/Workspace.js +1 -1
  181. package/dist/dts/pages/Workspace/Workspace.js.map +1 -1
  182. package/dist/dts/pages/Workspace/WorkspaceNoAccess.js +1 -1
  183. package/dist/dts/pages/Workspace/WorkspaceNoAccess.js.map +1 -1
  184. package/dist/dts/pages/admin/Workspace/WorkspaceNotebooks.js +1 -1
  185. package/dist/dts/pages/admin/Workspace/WorkspaceNotebooks.js.map +1 -1
  186. package/dist/dts/pages/admin/analysis/Analysis.js +1 -1
  187. package/dist/dts/pages/admin/analysis/Analysis.js.map +1 -1
  188. package/dist/dts/pages/admin/analysis/data.d.ts +1 -1
  189. package/dist/dts/pages/admin/authz/Authz.js +1 -1
  190. package/dist/dts/pages/admin/authz/Authz.js.map +1 -1
  191. package/dist/dts/pages/admin/authz/data.d.ts +1 -1
  192. package/dist/dts/types/icons.d.ts +2 -2
  193. package/dist/dts/types/icons.d.ts.map +1 -1
  194. package/dist/dts/types/icons.js +2 -2
  195. package/dist/dts/types/icons.js.map +1 -1
  196. package/dist/esm/index.js +529 -665
  197. package/dist/esm/index.js.map +1 -1
  198. package/dist/index.d.ts +55 -23
  199. package/dist/tsconfig.tsbuildinfo +1 -1
  200. package/package.json +4 -3
package/dist/esm/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default, { createContext, useState, useMemo, useEffect, useCallback, useContext, useRef, createElement, forwardRef, useReducer } from 'react';
4
- import { useUserAuth, useCoreSelector, selectUserDetails, useGetAuthzMappingsQuery, fetchFence, isFetchError, WorkspaceStatus, useGetWorkspaceStatusQuery, useGetWorkspacePayModelsQuery, useTerminateWorkspaceMutation, selectRequestedWorkspaceStatus, selectRequestedWorkspaceStatusTimestamp, useCoreDispatch, setActiveWorkspaceStatus, RequestedWorkspaceStatus, setRequestedWorkspaceStatus, isTimeGreaterThan, useGetCSRFQuery, useLazyFetchUserDetailsQuery, selectUserAuthStatus, GEN3_REDIRECT_URL, GEN3_FENCE_API, showModal, Modals, isAuthenticated, useGetLoginProvidersQuery, hideModal, selectCurrentModal, fieldNameToTitle, isOperationWithField, selectShouldShareFilters, selectSharedFilters, updateCohortFilter as updateCohortFilter$1, selectIndexedFilterByName, isUnion, isOperatorWithFieldAndArrayOfOperands, extractEnumFilterValue, removeCohortFilter as removeCohortFilter$1, trimFirstFieldNameToTitle, useIsUserLoggedIn, GEN3_DOMAIN, useDataLibrary, DataLibraryStoreMode, buildListItemsGroupedByDataset, extractFileDatasetsInRecords, useGetMDSQuery, selectAuthzMappingData, useGetAggMDSQuery, useAskQuestionMutation, useGetIndexAggMDSQuery, useGetTagsQuery, setCohortFilter as setCohortFilter$1, clearCohortFilters as clearCohortFilters$1, handleOperation, selectAvailableCohorts, selectCurrentCohortId as selectCurrentCohortId$1, selectCohortFilters, selectCurrentCohortModified, selectCurrentCohortSaved, setCohortIndexFilters, setActiveCohort, toggleCohortBuilderCategoryFilter, selectCohortFilterExpanded, setCohortFilterCombineMode, selectCohortFilterCombineMode, selectCurrentCohortName as selectCurrentCohortName$1, useGeneralGQLQuery, selectIndexFilters, useGetRawDataAndTotalCountsQuery, isJSONValue, downloadFromGuppyToBlob, downloadJSONDataFromGuppy, Accessibility, selectAllCohortFiltersCollapsed, toggleCohortBuilderAllFilters, setShouldShareFilters, useGetAggsQuery, useGetAggsNoFilterSelfQuery, isIntersection, useGetCountsQuery, setSharedFilters, usePrevious, selectHeadersWithCSRFToken, GEN3_GUPPY_API, useLaunchWorkspaceMutation, selectActiveWorkspaceStatus, isFetchBaseQueryError, setActiveWorkspace, getCurrentTimestamp, selectWorkspaceStatusFromService, selectActiveWorkspaceId, useGetWorkspaceOptionsQuery, GEN3_WORKSPACE_API, useGetExternalLoginsQuery, useSetCurrentPayModelMutation, PodStatus, PodConditionType, isWorkspaceRunningOrStopping, GEN3_COMMONS_NAME, getTimestamp, createAppStore, buildGetAggregationQuery, processHistogramResponse, getRemoteSupportServiceRegistry, isHttpStatusError, MissingServiceConfigurationError, useLazyGetAggsNoFilterSelfQuery, useCreateRequestMutation, useUserRequestQuery, getGen3AppId, createGen3AppWithOwnStore, createAppApiForRTKQ, useGetDictionaryQuery, useGetMetadataByIdQuery, createGen3App, CoreProvider, fetchJSONDataFromURL, HttpMethod, groupSharedFields, useGetCredentialsQuery, useRemoveCredentialMutation, useAddNewCredentialMutation, useGetProjectsDetailsQuery, useGetSubmissionsQuery, isCohortItem, isFileItem, fetchFencePresignedURL, HTTPError, getFederatedLoginStatus, queryMultipleMDSRecords, GEN3_MANIFEST_API, extractIndexFromDataLibraryCohort, isFilterSet, getNumberOfItemsInDatalist, isAdditionalDataItem, useLazyGetCrosswalkDataQuery, roundHistogramResponse } from '@gen3/core';
5
- import { LoadingOverlay, Card, Group, Avatar, Text, Checkbox, Stack, Center, Loader, Tooltip, UnstyledButton, ThemeIcon, Box, Select, Button, Divider, Textarea, FileButton, Anchor, Modal, Grid, Table, ColorSwatch, useMantineTheme, ActionIcon, Badge, TextInput, SegmentedControl, NumberInput, RangeSlider, MultiSelect, SimpleGrid, Highlight, MantineProvider, Tabs, Flex, Switch, Paper, Menu, Alert, Accordion, Drawer, CopyButton, factory, useProps, getStyleObject, useCombobox, Combobox, ScrollArea, Autocomplete, Title, Transition, rem, Stepper, Image as Image$1, NavLink, List, createTheme, Pagination, FileInput, CloseButton } from '@mantine/core';
4
+ import { useUserAuth, useCoreSelector, selectUserDetails, useGetAuthzMappingsQuery, fetchFence, isFetchError, WorkspaceStatus, useGetWorkspaceStatusQuery, useGetWorkspacePayModelsQuery, useTerminateWorkspaceMutation, selectRequestedWorkspaceStatus, selectRequestedWorkspaceStatusTimestamp, useCoreDispatch, setActiveWorkspaceStatus, RequestedWorkspaceStatus, setRequestedWorkspaceStatus, isTimeGreaterThan, useGetCSRFQuery, useLazyFetchUserDetailsQuery, selectUserAuthStatus, GEN3_REDIRECT_URL, GEN3_FENCE_API, showModal, Modals, isAuthenticated, useGetLoginProvidersQuery, hideModal, selectCurrentModal, fieldNameToTitle, isOperationWithField, selectShouldShareFilters, selectSharedFilters, updateCohortFilter as updateCohortFilter$1, selectIndexedFilterByName, isUnion, isOperatorWithFieldAndArrayOfOperands, extractEnumFilterValue, removeCohortFilter as removeCohortFilter$1, trimFirstFieldNameToTitle, useIsUserLoggedIn, GEN3_DOMAIN, useDataLibrary, DataLibraryStoreMode, buildListItemsGroupedByDataset, extractFileDatasetsInRecords, useGetMDSQuery, selectAuthzMappingData, useGetAggMDSQuery, useAskQuestionMutation, useGetIndexAggMDSQuery, useGetTagsQuery, setCohortFilter as setCohortFilter$1, clearCohortFilters as clearCohortFilters$1, handleOperation, selectAvailableCohorts, selectCurrentCohortId as selectCurrentCohortId$1, selectCohortFilters, selectCurrentCohortModified, selectCurrentCohortSaved, setCohortIndexFilters, setActiveCohort, toggleCohortBuilderCategoryFilter, selectCohortFilterExpanded, setCohortFilterCombineMode, selectCohortFilterCombineMode, selectCurrentCohortName as selectCurrentCohortName$1, useGeneralGQLQuery, selectIndexFilters, useGetRawDataAndTotalCountsQuery, isJSONValue, downloadFromGuppyToBlob, downloadJSONDataFromGuppy, Accessibility, selectAllCohortFiltersCollapsed, toggleCohortBuilderAllFilters, setShouldShareFilters, useGetAggsQuery, useGetAggsNoFilterSelfQuery, isIntersection, useGetCountsQuery, setSharedFilters, usePrevious, selectHeadersWithCSRFToken, GEN3_GUPPY_API, useLaunchWorkspaceMutation, selectActiveWorkspaceStatus, isFetchBaseQueryError, setActiveWorkspace, getCurrentTimestamp, selectWorkspaceStatusFromService, selectActiveWorkspaceId, useGetWorkspaceOptionsQuery, GEN3_WORKSPACE_API, useGetExternalLoginsQuery, useSetCurrentPayModelMutation, PodStatus, PodConditionType, isWorkspaceRunningOrStopping, GEN3_API, GEN3_COMMONS_NAME, getTimestamp, createAppStore, buildGetAggregationQuery, processHistogramResponse, getRemoteSupportServiceRegistry, isHttpStatusError, MissingServiceConfigurationError, useLazyGetAggsNoFilterSelfQuery, useCreateRequestMutation, useUserRequestQuery, getGen3AppId, createGen3AppWithOwnStore, createAppApiForRTKQ, useGetDictionaryQuery, useGetMetadataByIdQuery, createGen3App, CoreProvider, fetchJSONDataFromURL, HttpMethod, groupSharedFields, useGetCredentialsQuery, useRemoveCredentialMutation, useAddNewCredentialMutation, useGetProjectsDetailsQuery, useGetSubmissionsQuery, isCohortItem, isFileItem, fetchFencePresignedURL, HTTPError, getFederatedLoginStatus, queryMultipleMDSRecords, GEN3_MANIFEST_API, extractIndexFromDataLibraryCohort, isFilterSet, getNumberOfItemsInDatalist, isAdditionalDataItem, useLazyGetCrosswalkDataQuery, roundHistogramResponse } from '@gen3/core';
5
+ import { LoadingOverlay, Card, Group, Avatar, Text, Checkbox, Stack, Center, Loader, Tooltip, UnstyledButton, ThemeIcon, Box, Select, Button, Divider, Textarea, FileButton, Anchor, Modal, Grid, Table, ColorSwatch, useMantineTheme, Accordion, Switch, ActionIcon, Badge, TextInput, SegmentedControl, NumberInput, RangeSlider, MultiSelect, SimpleGrid, Highlight, MantineProvider, Tabs, Flex, Menu, Alert, Drawer, CopyButton, factory, useProps, getStyleObject, Paper, useCombobox, Combobox, ScrollArea, Autocomplete, Title, Transition, rem, Stepper, Image as Image$1, NavLink, List, createTheme, Pagination, FileInput, CloseButton } from '@mantine/core';
6
6
  import { useDeepCompareEffect, useDeepCompareMemo, useDeepCompareCallback } from 'use-deep-compare';
7
7
  import { useRouter } from 'next/router';
8
8
  import { usePathname } from 'next/navigation';
@@ -46,6 +46,7 @@ import { LuCircleSlash, LuClock, LuLock, LuUnlock } from 'react-icons/lu';
46
46
  import 'universal-cookie';
47
47
  import { modals, ModalsProvider } from '@mantine/modals';
48
48
  import GraphiQL from 'graphiql';
49
+ import { useRouter as useRouter$1 } from 'next/dist/client/router';
49
50
  import fs from 'fs';
50
51
  import path from 'path';
51
52
  import { PersistGate } from 'redux-persist/integration/react';
@@ -61,6 +62,7 @@ import { filesize } from 'filesize';
61
62
  import { DragDropContext, Droppable, Draggable } from '@hello-pangea/dnd';
62
63
  import plugin from 'tailwindcss/plugin';
63
64
  import cookie from 'cookie';
65
+ import DOMPurify from 'isomorphic-dompurify';
64
66
 
65
67
  const User = ()=>{
66
68
  const { data: userData, isFetching } = useUserAuth();
@@ -2757,6 +2759,69 @@ const Charts = ({ charts, data, counts, isSuccess, numCols = DEFAULT_COLS, style
2757
2759
  });
2758
2760
  };
2759
2761
 
2762
+ const CollapsableCharts = ({ config, data })=>{
2763
+ const [showLegends, setShowLegends] = useState(config.showLegends?.enabled);
2764
+ if (!(config?.charts && Object.keys(config.charts).length > 0)) {
2765
+ return /*#__PURE__*/ jsx(Center, {
2766
+ children: /*#__PURE__*/ jsx(ErrorCard, {
2767
+ message: "Charts Section not setup properly"
2768
+ })
2769
+ });
2770
+ }
2771
+ return /*#__PURE__*/ jsx(Accordion, {
2772
+ unstyled: true,
2773
+ classNames: {
2774
+ root: 'mb-4 bg-base-max w-full rounded-lg',
2775
+ control: 'bg-secondary-lightest w-full px-4 py-2 rounded-lg data-active:rounded-b-none text-left group',
2776
+ label: 'pl-2 font-bold [text-shadow:_1px_0_#000]',
2777
+ chevron: 'rounded-full bg-secondary-dark text-white inline-block align-middle group-data-[active]:rotate-180 transition-all',
2778
+ panel: 'py-4'
2779
+ },
2780
+ chevronPosition: "left",
2781
+ defaultValue: "chartsAccordion",
2782
+ children: /*#__PURE__*/ jsxs(Accordion.Item, {
2783
+ value: 'chartsAccordion',
2784
+ children: [
2785
+ /*#__PURE__*/ jsx(Accordion.Control, {
2786
+ children: config.title || ''
2787
+ }),
2788
+ /*#__PURE__*/ jsxs(Accordion.Panel, {
2789
+ children: [
2790
+ config.showLegends?.enabled && config.showLegends?.showSwitch && /*#__PURE__*/ jsxs(React__default.Fragment, {
2791
+ children: [
2792
+ /*#__PURE__*/ jsx(Switch, {
2793
+ color: "accent",
2794
+ labelPosition: "left",
2795
+ label: "Show legends",
2796
+ size: "xs",
2797
+ px: "md",
2798
+ checked: showLegends,
2799
+ onChange: (event)=>setShowLegends(event.currentTarget.checked)
2800
+ }),
2801
+ /*#__PURE__*/ jsx(Divider, {
2802
+ my: "sm"
2803
+ })
2804
+ ]
2805
+ }),
2806
+ /*#__PURE__*/ jsx(Box, {
2807
+ px: "md",
2808
+ children: /*#__PURE__*/ jsx(Charts, {
2809
+ showLegends: showLegends,
2810
+ style: "box",
2811
+ charts: config.charts,
2812
+ data: data,
2813
+ counts: 2,
2814
+ isSuccess: true,
2815
+ numCols: 4
2816
+ })
2817
+ })
2818
+ ]
2819
+ })
2820
+ ]
2821
+ })
2822
+ });
2823
+ };
2824
+
2760
2825
  const ChartTitleBar = ({ divId, title, filename, jsonData })=>{
2761
2826
  return /*#__PURE__*/ jsx("div", {
2762
2827
  className: "flex justify-between items-center",
@@ -3304,7 +3369,7 @@ const useFieldNameToTitle = ()=>{
3304
3369
  return fieldToTitle;
3305
3370
  };
3306
3371
 
3307
- const DEFAULT_VISIBLE_ITEMS = 6;
3372
+ const DEFAULT_VISIBLE_ITEMS$1 = 6;
3308
3373
  const DEFAULT_MINIMUM = 0;
3309
3374
  const DEFAULT_MAXIMUM = 100;
3310
3375
  const BAD_DATA_MESSAGE = 'No data for this field';
@@ -3741,7 +3806,7 @@ const FacetEnumList = ({ field, facetName, hooks, valueLabel, isSettings = false
3741
3806
  }, [
3742
3807
  enumFilters
3743
3808
  ]);
3744
- const maxValuesToDisplay = DEFAULT_VISIBLE_ITEMS;
3809
+ const maxValuesToDisplay = DEFAULT_VISIBLE_ITEMS$1;
3745
3810
  // update filters when checkbox is selected
3746
3811
  const handleChange = (value, checked)=>{
3747
3812
  setFacetChartData({
@@ -4984,6 +5049,7 @@ const CustomFacetGroup = ({ hooks, customFacetHooks, queryOptions, getFacetLabel
4984
5049
  });
4985
5050
  };
4986
5051
 
5052
+ const DEFAULT_VISIBLE_ITEMS = 16;
4987
5053
  const FacetSelector = ({ category, facetName, hooks, width = 'w-full', description, fields, selectedFields, updateSelectedField, showSearch = true, showSettings = false, header = {
4988
5054
  Panel: FacetHeader,
4989
5055
  Label: FacetText,
@@ -5014,7 +5080,8 @@ const FacetSelector = ({ category, facetName, hooks, width = 'w-full', descripti
5014
5080
  searchTerm,
5015
5081
  fields
5016
5082
  ]);
5017
- const remainingValues = filteredFields.length - DEFAULT_VISIBLE_ITEMS;
5083
+ const remainingValues = filteredFields.length - DEFAULT_VISIBLE_ITEMS * 2;
5084
+ const visibleFields = filteredFields.slice(0, !isGroupExpanded ? DEFAULT_VISIBLE_ITEMS : undefined);
5018
5085
  return /*#__PURE__*/ jsxs("div", {
5019
5086
  className: `flex flex-col ${width ? width : 'mx-1'} bg-base-max relative border-base-light border-1 rounded-b-md transition`,
5020
5087
  id: category,
@@ -5063,11 +5130,11 @@ const FacetSelector = ({ category, facetName, hooks, width = 'w-full', descripti
5063
5130
  /*#__PURE__*/ jsx("div", {
5064
5131
  className: "card-face bg-base-max rounded-b-xs flex flex-col gap-y-1 justify-between",
5065
5132
  children: /*#__PURE__*/ jsx("div", {
5066
- children: filteredFields.length == 0 ? /*#__PURE__*/ jsx("div", {
5133
+ children: visibleFields.length == 0 ? /*#__PURE__*/ jsx("div", {
5067
5134
  className: "mx-4 font-content text-sm",
5068
5135
  children: BAD_DATA_MESSAGE
5069
- }) : filteredFields.map((facet)=>{
5070
- const label = fieldNameToTitle(facet.field);
5136
+ }) : visibleFields.map((facet)=>{
5137
+ const label = facet?.label ?? fieldNameToTitle(facet.field);
5071
5138
  return /*#__PURE__*/ jsxs("div", {
5072
5139
  className: "flex justify-between items-center px-2 my-1",
5073
5140
  children: [
@@ -5118,7 +5185,12 @@ const ProtectedContent = ({ children, referer })=>{
5118
5185
  }
5119
5186
  });
5120
5187
  };
5121
- const { status, pending } = useSession(true, onUnauthenticated);
5188
+ const delayRedirect = ()=>{
5189
+ setTimeout(()=>{
5190
+ onUnauthenticated();
5191
+ }, 2000);
5192
+ };
5193
+ const { status, pending } = useSession(true, delayRedirect);
5122
5194
  if (status !== 'issued') {
5123
5195
  // not logged in
5124
5196
  if (pending) return /*#__PURE__*/ jsx("div", {
@@ -5128,12 +5200,20 @@ const ProtectedContent = ({ children, referer })=>{
5128
5200
  else return /*#__PURE__*/ jsx("div", {
5129
5201
  className: "w-full h-full relative",
5130
5202
  children: /*#__PURE__*/ jsx(Center, {
5131
- children: /*#__PURE__*/ jsx(Paper, {
5132
- shadow: "md",
5133
- p: "md",
5134
- children: /*#__PURE__*/ jsx(Text, {
5135
- children: "You are not signed in and cannot access this protected content. Please login in."
5136
- })
5203
+ children: /*#__PURE__*/ jsxs(Stack, {
5204
+ h: 300,
5205
+ align: "center",
5206
+ justify: "center",
5207
+ gap: "md",
5208
+ className: "mt-24",
5209
+ children: [
5210
+ /*#__PURE__*/ jsx(Text, {
5211
+ children: "You are not logged in and cannot access this protected content."
5212
+ }),
5213
+ /*#__PURE__*/ jsx(Text, {
5214
+ children: "You will be redirected to the login page in a few seconds.."
5215
+ })
5216
+ ]
5137
5217
  })
5138
5218
  })
5139
5219
  });
@@ -5451,7 +5531,7 @@ const LoginButton = ({ name = 'login', leftIcon = undefined, rightIcon = undefin
5451
5531
  const processTopBarItems = (items, classNames, dividerClassname)=>{
5452
5532
  return items.reduce((acc, item, index)=>{
5453
5533
  const mergedClassnames = item?.classNames ? mergeDefaultTailwindClassnames(classNames, item.classNames) : classNames;
5454
- acc.push(/*#__PURE__*/ jsxs(Fragment, {
5534
+ acc.push(/*#__PURE__*/ jsxs(React__default.Fragment, {
5455
5535
  children: [
5456
5536
  /*#__PURE__*/ jsx("a", {
5457
5537
  className: "flex",
@@ -5463,7 +5543,7 @@ const processTopBarItems = (items, classNames, dividerClassname)=>{
5463
5543
  rightIcon: item.rightIcon,
5464
5544
  classNames: mergedClassnames
5465
5545
  })
5466
- }, `${item.href}_${item.name}`),
5546
+ }),
5467
5547
  /*#__PURE__*/ jsx(Divider, {
5468
5548
  size: "md",
5469
5549
  orientation: "vertical",
@@ -5472,7 +5552,7 @@ const processTopBarItems = (items, classNames, dividerClassname)=>{
5472
5552
  }
5473
5553
  })
5474
5554
  ]
5475
- }));
5555
+ }, `${item.href}_${item.name}-topbar-item`));
5476
5556
  return acc;
5477
5557
  }, []);
5478
5558
  };
@@ -5973,7 +6053,7 @@ const LeftSidePanel = ({ items = [], classNames = {} })=>{
5973
6053
  });
5974
6054
  };
5975
6055
 
5976
- const NavPageLayout = ({ headerProps, footerProps, mainProps, headerData, children })=>{
6056
+ const NavPageLayout = ({ headerProps, footerProps, mainProps, headerMetadata, children })=>{
5977
6057
  const mainContentStyle = mainProps?.fixed ? 'flex-1 flex overflow-hidden relative' : 'flex grow relative';
5978
6058
  return /*#__PURE__*/ jsxs("div", {
5979
6059
  className: "flex flex-col justify-between h-screen",
@@ -5981,24 +6061,24 @@ const NavPageLayout = ({ headerProps, footerProps, mainProps, headerData, childr
5981
6061
  /*#__PURE__*/ jsxs(Head, {
5982
6062
  children: [
5983
6063
  /*#__PURE__*/ jsx("title", {
5984
- children: headerData.title
6064
+ children: headerMetadata.title
5985
6065
  }),
5986
6066
  /*#__PURE__*/ jsx("meta", {
5987
6067
  property: "og:title",
5988
- content: headerData.content
5989
- }, headerData.key)
6068
+ content: headerMetadata.content
6069
+ }, headerMetadata.key)
5990
6070
  ]
5991
6071
  }),
5992
6072
  /*#__PURE__*/ jsxs(Header$1, {
5993
6073
  ...headerProps,
5994
6074
  children: [
5995
6075
  /*#__PURE__*/ jsx("title", {
5996
- children: headerData.title
6076
+ children: headerMetadata.title
5997
6077
  }),
5998
6078
  /*#__PURE__*/ jsx("meta", {
5999
6079
  property: "og:title",
6000
- content: headerData.content
6001
- }, headerData.key)
6080
+ content: headerMetadata.content
6081
+ }, headerMetadata.key)
6002
6082
  ]
6003
6083
  }),
6004
6084
  headerProps.type === 'vertical' ? /*#__PURE__*/ jsxs("div", {
@@ -6024,6 +6104,20 @@ const NavPageLayout = ({ headerProps, footerProps, mainProps, headerData, childr
6024
6104
  });
6025
6105
  };
6026
6106
 
6107
+ /**
6108
+ * Type guard to check if an object is of type HeaderMetadata
6109
+ * @param obj - The object to check
6110
+ * @returns True if the object is a valid HeaderMetadata
6111
+ */ const isHeaderMetadata = (obj)=>{
6112
+ // Check if obj is a non-null object
6113
+ if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
6114
+ return false;
6115
+ }
6116
+ const candidate = obj;
6117
+ // Check all required properties exist and are non-empty strings
6118
+ return typeof candidate.title === 'string' && candidate.title.trim().length > 0 && typeof candidate.content === 'string' && candidate.content.trim().length > 0 && typeof candidate.key === 'string' && candidate.key.trim().length > 0;
6119
+ };
6120
+
6027
6121
  var classes = {"tableRow":"DiscoveryTable-module_tableRow__yFUJZ"};
6028
6122
 
6029
6123
  const jsonPathAccessor$1 = (path)=>(row)=>{
@@ -7863,69 +7957,6 @@ const SummaryStatisticPanel = ({ summaries })=>{
7863
7957
  });
7864
7958
  };
7865
7959
 
7866
- const ChartsPanel = ({ config, data })=>{
7867
- const [showLegends, setShowLegends] = useState(config.showLegends?.enabled);
7868
- if (!(config?.charts && Object.keys(config.charts).length > 0)) {
7869
- return /*#__PURE__*/ jsx(Center, {
7870
- children: /*#__PURE__*/ jsx(ErrorCard, {
7871
- message: "Discovery Charts Section not setup properly"
7872
- })
7873
- });
7874
- }
7875
- return /*#__PURE__*/ jsx(Accordion, {
7876
- unstyled: true,
7877
- classNames: {
7878
- root: 'mb-4 bg-base-max w-full rounded-lg',
7879
- control: 'bg-secondary-lightest w-full px-4 py-2 rounded-lg data-active:rounded-b-none text-left group',
7880
- label: 'pl-2 font-bold [text-shadow:_1px_0_#000]',
7881
- chevron: 'rounded-full bg-secondary-dark text-white inline-block align-middle group-data-[active]:rotate-180 transition-all',
7882
- panel: 'py-4'
7883
- },
7884
- chevronPosition: "left",
7885
- defaultValue: "chartsAccordion",
7886
- children: /*#__PURE__*/ jsxs(Accordion.Item, {
7887
- value: 'chartsAccordion',
7888
- children: [
7889
- /*#__PURE__*/ jsx(Accordion.Control, {
7890
- children: config.title || ''
7891
- }),
7892
- /*#__PURE__*/ jsxs(Accordion.Panel, {
7893
- children: [
7894
- config.showLegends?.enabled && config.showLegends?.showSwitch && /*#__PURE__*/ jsxs(React__default.Fragment, {
7895
- children: [
7896
- /*#__PURE__*/ jsx(Switch, {
7897
- color: "accent",
7898
- labelPosition: "left",
7899
- label: "Show legends",
7900
- size: "xs",
7901
- px: "md",
7902
- checked: showLegends,
7903
- onChange: (event)=>setShowLegends(event.currentTarget.checked)
7904
- }),
7905
- /*#__PURE__*/ jsx(Divider, {
7906
- my: "sm"
7907
- })
7908
- ]
7909
- }),
7910
- /*#__PURE__*/ jsx(Box, {
7911
- px: "md",
7912
- children: /*#__PURE__*/ jsx(Charts, {
7913
- showLegends: showLegends,
7914
- style: "box",
7915
- charts: config.charts,
7916
- data: data,
7917
- counts: 2,
7918
- isSuccess: true,
7919
- numCols: 4
7920
- })
7921
- })
7922
- ]
7923
- })
7924
- ]
7925
- })
7926
- });
7927
- };
7928
-
7929
7960
  const isSearchKV = (obj)=>{
7930
7961
  return obj && obj.key && obj.value;
7931
7962
  };
@@ -9266,7 +9297,7 @@ registerDefaultDiscoveryDataLoaders();
9266
9297
  size: "xl",
9267
9298
  children: discoveryConfig?.features?.pageTitle.text
9268
9299
  }) : null,
9269
- discoveryConfig.features?.chartsSection?.enabled && /*#__PURE__*/ jsx(ChartsPanel, {
9300
+ discoveryConfig.features?.chartsSection?.enabled && /*#__PURE__*/ jsx(CollapsableCharts, {
9270
9301
  config: discoveryConfig.features?.chartsSection,
9271
9302
  data: chartData
9272
9303
  }),
@@ -12326,7 +12357,25 @@ const DropdownPanel = ({ index, filters, tabTitle, facetDefinitions, facetDataHo
12326
12357
  };
12327
12358
 
12328
12359
  const EmptyData = {};
12329
- const CohortPanel = ({ guppyConfig, filters, charts = {}, table, tabTitle, dropdowns, buttons, loginForDownload, showAccessLevel = false })=>{
12360
+ /**
12361
+ * CohortPanel is a React component that provides an interactive interface for cohort exploration and filtering.
12362
+ * It integrates with data services and facilitates visualization, filtering, and analysis tasks.
12363
+ *
12364
+ * @param {Object} props The properties required to configure the CohortPanel component.
12365
+ * @param {Object} props.guppyConfig Configuration object for Guppy, including field mappings and data type information.
12366
+ * @param {Object} props.filters Configuration for filter tabs, including filter fields and layout.
12367
+ * @param {Object} [props.charts={}] Optional set of chart configuration objects for rendering summaries.
12368
+ * @param {Object} [props.chartsSection] Optional configuration for an additional section of charts.
12369
+ * @param {Object} props.table Reference to the table configuration or component for displaying data.
12370
+ * @param {string} props.tabTitle Title for the filter tab section.
12371
+ * @param {Object[]|undefined} props.dropdowns Dropdown menu configuration, allowing for additional filter options or actions.
12372
+ * @param {Object[]|undefined} props.buttons List of button configurations for actions such as downloads.
12373
+ * @param {boolean} props.loginForDownload Determines whether login is required to enable download functionality.
12374
+ * @param {boolean} [props.showAccessLevel=false] Indicates if the user access level should be displayed on the panel.
12375
+ *
12376
+ * @returns {JSX.Element} Returns a JSX element rendering the CohortPanel. This includes filter options,
12377
+ * summary charts, cohort manager, and data display components.
12378
+ */ const CohortPanel = ({ guppyConfig, filters, charts = {}, chartsSection = undefined, table, tabTitle, dropdowns, buttons, loginForDownload, showAccessLevel = false })=>{
12330
12379
  const isSm = useMediaQuery('(min-width: 639px)');
12331
12380
  const isMd = useMediaQuery('(min-width: 1373px)');
12332
12381
  const isXl = useMediaQuery('(min-width: 1600px)');
@@ -12351,7 +12400,10 @@ const CohortPanel = ({ guppyConfig, filters, charts = {}, table, tabTitle, dropd
12351
12400
  });
12352
12401
  const { data: chartData, isSuccess: isChartSuccess, isFetching: isChartFetching, isError: isChartError } = useGetAggsNoFilterSelfQuery({
12353
12402
  type: index,
12354
- fields: Object.keys(charts),
12403
+ fields: [
12404
+ ...Object.keys(chartsSection?.charts ?? {}),
12405
+ ...Object.keys(charts)
12406
+ ],
12355
12407
  filters: cohortFilters,
12356
12408
  accessibility: accessLevel
12357
12409
  });
@@ -12457,7 +12509,8 @@ const CohortPanel = ({ guppyConfig, filters, charts = {}, table, tabTitle, dropd
12457
12509
  const facetDefs = classifyFacets(data, index, guppyConfig?.fieldMapping ?? [], configFacetDefs ?? {}, sharedFiltersMap);
12458
12510
  setFacetDefinitions(facetDefs);
12459
12511
  // setup summary charts since nested fields can be listed by the split field name
12460
- const summaryCharts = Object.keys(charts).reduce((acc, field)=>{
12512
+ const chartDefinitions = chartsSection?.charts ?? charts;
12513
+ const summaryCharts = Object.keys(chartDefinitions).reduce((acc, field)=>{
12461
12514
  let chartField = field;
12462
12515
  if (facetDefs?.[field] === undefined) {
12463
12516
  const res = Object.values(facetDefs).filter((def)=>{
@@ -12469,7 +12522,7 @@ const CohortPanel = ({ guppyConfig, filters, charts = {}, table, tabTitle, dropd
12469
12522
  }
12470
12523
  return {
12471
12524
  ...acc,
12472
- [chartField]: charts[field]
12525
+ [chartField]: chartDefinitions[field]
12473
12526
  };
12474
12527
  }, {});
12475
12528
  setSummaryCharts(summaryCharts);
@@ -12480,7 +12533,8 @@ const CohortPanel = ({ guppyConfig, filters, charts = {}, table, tabTitle, dropd
12480
12533
  facetDefinitions,
12481
12534
  index,
12482
12535
  guppyConfig.fieldMapping,
12483
- charts
12536
+ charts,
12537
+ chartsSection
12484
12538
  ]);
12485
12539
  const { data: counts, isSuccess: isCountSuccess, isError } = useGetCountsQuery({
12486
12540
  type: index,
@@ -12538,7 +12592,13 @@ const CohortPanel = ({ guppyConfig, filters, charts = {}, table, tabTitle, dropd
12538
12592
  })
12539
12593
  ]
12540
12594
  }),
12541
- /*#__PURE__*/ jsx(Charts, {
12595
+ chartsSection?.enabled ? /*#__PURE__*/ jsx(CollapsableCharts, {
12596
+ config: {
12597
+ ...chartsSection,
12598
+ charts: summaryCharts
12599
+ },
12600
+ data: chartData ?? EmptyData
12601
+ }) : /*#__PURE__*/ jsx(Charts, {
12542
12602
  charts: summaryCharts,
12543
12603
  data: chartData ?? EmptyData,
12544
12604
  counts: counts,
@@ -13739,11 +13799,11 @@ const TextDescription = ({ description })=>{
13739
13799
  children: [
13740
13800
  !extend ? /*#__PURE__*/ jsx(Text, {
13741
13801
  ref: textRef,
13742
- size: "md",
13802
+ size: "sm",
13743
13803
  lineClamp: 4,
13744
13804
  children: description
13745
13805
  }) : /*#__PURE__*/ jsx(Text, {
13746
- size: "md",
13806
+ size: "sm",
13747
13807
  children: description
13748
13808
  }),
13749
13809
  isClamped && /*#__PURE__*/ jsx("button", {
@@ -13765,86 +13825,91 @@ const TextDescription = ({ description })=>{
13765
13825
  };
13766
13826
 
13767
13827
  const AnalysisCard = ({ title, description, type, icon, image, hasDemo, loginRequired, href, btnText })=>{
13768
- return /*#__PURE__*/ jsx(Stack, {
13769
- children: /*#__PURE__*/ jsxs("div", {
13770
- className: "rounded-sm bg-base-max",
13771
- children: [
13772
- /*#__PURE__*/ jsx("div", {
13773
- className: "p-0 rounded-sm",
13774
- children: /*#__PURE__*/ jsx(Image$1, {
13775
- component: Image,
13776
- src: `${image}`,
13777
- alt: `${title} image`,
13778
- height: 1000,
13779
- width: 1000,
13780
- radius: "md"
13781
- })
13782
- }),
13783
- /*#__PURE__*/ jsxs("div", {
13784
- className: "flex -mt-5 relative z-10",
13785
- children: [
13786
- /*#__PURE__*/ jsx("div", {
13787
- className: "p-0.5 rounded-sm bg-base-lightest ml-5 border-2 border-base",
13788
- children: /*#__PURE__*/ jsx(Image$1, {
13789
- component: Image,
13790
- src: `${icon}`,
13791
- alt: `${title} logo`,
13792
- width: 40,
13793
- height: 40,
13794
- radius: "lg"
13828
+ return /*#__PURE__*/ jsxs(Stack, {
13829
+ align: "stretch",
13830
+ justify: "space-between",
13831
+ className: "rounded-sm rounded-t-md bg-base-max p-0",
13832
+ children: [
13833
+ /*#__PURE__*/ jsxs("div", {
13834
+ className: "h-full",
13835
+ children: [
13836
+ /*#__PURE__*/ jsx("div", {
13837
+ className: "p-0 rounded-sm h-1/2 h-max-1/2",
13838
+ children: /*#__PURE__*/ jsx(Image$1, {
13839
+ component: Image,
13840
+ src: `${image}`,
13841
+ alt: `${title} image`,
13842
+ height: 1000,
13843
+ width: 1000,
13844
+ radius: "md"
13845
+ })
13846
+ }),
13847
+ /*#__PURE__*/ jsxs("div", {
13848
+ className: "flex -mt-5 relative z-10",
13849
+ children: [
13850
+ /*#__PURE__*/ jsx("div", {
13851
+ className: "p-0.5 rounded-sm bg-base-lightest ml-5 border-2 border-base w-1/5 h-1/5",
13852
+ children: /*#__PURE__*/ jsx(Image$1, {
13853
+ component: Image,
13854
+ src: `${icon}`,
13855
+ alt: `${title} logo`,
13856
+ width: 40,
13857
+ height: 40,
13858
+ radius: "lg"
13859
+ })
13860
+ }),
13861
+ /*#__PURE__*/ jsx("div", {
13862
+ className: "relative mb-0 ml-2",
13863
+ children: /*#__PURE__*/ jsx("span", {
13864
+ className: "absolute bottom-0 left-0 text-xs text-gray-700 w-max",
13865
+ children: type === 'application' ? 'Application' : 'Jupyter Notebook'
13866
+ })
13795
13867
  })
13796
- }),
13797
- /*#__PURE__*/ jsx("div", {
13798
- className: "relative mb-0 ml-2",
13799
- children: /*#__PURE__*/ jsx("span", {
13800
- className: "absolute bottom-0 left-0 text-xs text-gray-700 w-max",
13801
- children: type === 'application' ? 'Application' : 'Jupyter Notebook'
13868
+ ]
13869
+ }),
13870
+ /*#__PURE__*/ jsxs("div", {
13871
+ className: "flex flex-col mt-2 ml-2",
13872
+ children: [
13873
+ /*#__PURE__*/ jsx("div", {
13874
+ className: "text-sm font-black h-6",
13875
+ children: title
13876
+ }),
13877
+ /*#__PURE__*/ jsx("div", {
13878
+ className: "text-xs text-gray-400 h-6",
13879
+ children: loginRequired ? 'Login Required' : ' '
13880
+ }),
13881
+ /*#__PURE__*/ jsx("div", {
13882
+ className: "text-sm p-2 h-fit mt-2",
13883
+ children: /*#__PURE__*/ jsx(TextDescription, {
13884
+ description: description
13885
+ })
13802
13886
  })
13803
- })
13804
- ]
13805
- }),
13806
- /*#__PURE__*/ jsxs("div", {
13807
- className: "flex flex-col mt-2 ml-2",
13887
+ ]
13888
+ })
13889
+ ]
13890
+ }),
13891
+ /*#__PURE__*/ jsx("div", {
13892
+ className: "flex mb-4 rounded-b-md",
13893
+ children: /*#__PURE__*/ jsxs("div", {
13894
+ className: "m-auto",
13808
13895
  children: [
13809
- /*#__PURE__*/ jsx("div", {
13810
- className: "text-sm font-black h-6",
13811
- children: title
13812
- }),
13813
- /*#__PURE__*/ jsx("div", {
13814
- className: "text-xs text-gray-400 h-6",
13815
- children: loginRequired ? 'Login Required' : ' '
13816
- }),
13817
- /*#__PURE__*/ jsx("div", {
13818
- className: "text-sm p-2 h-fit",
13819
- children: /*#__PURE__*/ jsx(TextDescription, {
13820
- description: description
13821
- })
13896
+ /*#__PURE__*/ jsx(NavLink, {
13897
+ component: Link,
13898
+ href: href ?? '_blank',
13899
+ classNames: {
13900
+ root: 'bg-accent text-accent-contrast hover:bg-accent-darker p-2 rounded-sm',
13901
+ label: 'text-sm font-semibold'
13902
+ },
13903
+ label: btnText ? btnText : `Run ${type === 'application' ? 'App' : 'Notebook'}`
13822
13904
  }),
13823
- /*#__PURE__*/ jsx("div", {
13824
- className: "flex mb-4 rounded-b-md",
13825
- children: /*#__PURE__*/ jsxs("div", {
13826
- className: "m-auto",
13827
- children: [
13828
- /*#__PURE__*/ jsx(NavLink, {
13829
- component: Link,
13830
- href: href ?? '_blank',
13831
- classNames: {
13832
- root: 'bg-accent text-accent-contrast hover:bg-accent-darker p-2 rounded-sm',
13833
- label: 'text-sm font-semibold'
13834
- },
13835
- label: btnText ? btnText : `Run ${type === 'application' ? 'App' : 'Notebook'}`
13836
- }),
13837
- hasDemo && /*#__PURE__*/ jsx("button", {
13838
- className: "ml-2 p-1.5 rounded-sm text-sm font-semibold",
13839
- children: "Demo"
13840
- })
13841
- ]
13842
- })
13905
+ hasDemo && /*#__PURE__*/ jsx("button", {
13906
+ className: "ml-2 p-1.5 rounded-sm text-sm font-semibold",
13907
+ children: "Demo"
13843
13908
  })
13844
13909
  ]
13845
13910
  })
13846
- ]
13847
- })
13911
+ })
13912
+ ]
13848
13913
  }, title);
13849
13914
  };
13850
13915
 
@@ -13865,7 +13930,7 @@ const AnalysisCenter = ({ tools, showFilterAndSort = false })=>{
13865
13930
  if (!keyword.length) return;
13866
13931
  };
13867
13932
  return /*#__PURE__*/ jsxs("div", {
13868
- className: "w-full bg-base-lighter",
13933
+ className: "w-full bg-base-light p-4",
13869
13934
  children: [
13870
13935
  showFilterAndSort ? /*#__PURE__*/ jsxs("div", {
13871
13936
  className: "flex justify-between items-center w-7/8 mt-2 mx-2",
@@ -13915,7 +13980,7 @@ const AnalysisCenter = ({ tools, showFilterAndSort = false })=>{
13915
13980
  }) : null,
13916
13981
  /*#__PURE__*/ jsx("div", {
13917
13982
  children: /*#__PURE__*/ jsx("div", {
13918
- className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 p-1 mx-4 overflow-y-scroll",
13983
+ className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 p-1 mx-4 overflow-y-auto",
13919
13984
  children: tools.map(({ title, description, type, icon, image, hasDemo, loginRequired, href, btnText }, key)=>{
13920
13985
  return /*#__PURE__*/ jsx(AnalysisCard, {
13921
13986
  title,
@@ -14072,6 +14137,80 @@ const AnalysisCardCompact = ({ title, description, type = 'application', icon, h
14072
14137
  });
14073
14138
  };
14074
14139
 
14140
+ const GEN3_STATIC_NOTEBOOK_API = process.env.GEN3_STATIC_NOTEBOOK_API || `${GEN3_API}/api/staticNotebook`;
14141
+ const GEN3_STATIC_NOTEBOOK_DIR = process.env.GEN3_STATIC_NOTEBOOK_DIR || 'htmlNotebooks';
14142
+ const GEN3_STATIC_NOTEBOOK_PATH = process.env.GEN3_STATIC_NOTEBOOK_PATH || '/public';
14143
+
14144
+ const StaticNotebookViewer = ({ notebook })=>{
14145
+ const [htmlContent, setHtmlContent] = useState('');
14146
+ const [isError, setIsError] = useState(false);
14147
+ const [isLoading, setIsLoading] = useState(false);
14148
+ useEffect(()=>{
14149
+ async function fetchHtml() {
14150
+ const headers = new Headers();
14151
+ headers.set('Content-Type', 'application/json');
14152
+ setIsLoading(true);
14153
+ try {
14154
+ const response = await fetch(`${GEN3_STATIC_NOTEBOOK_API}?notebook=${notebook}`, {
14155
+ headers: headers
14156
+ });
14157
+ const json = await response.json();
14158
+ setHtmlContent(json.content);
14159
+ } catch (error) {
14160
+ if (error instanceof Error) {
14161
+ console.error(error.message);
14162
+ }
14163
+ setIsError(true);
14164
+ } finally{
14165
+ setIsLoading(false);
14166
+ }
14167
+ }
14168
+ fetchHtml();
14169
+ }, [
14170
+ notebook
14171
+ ]);
14172
+ if (isError) {
14173
+ return /*#__PURE__*/ jsx("div", {
14174
+ className: "flex w-full h-full",
14175
+ children: /*#__PURE__*/ jsx(Center, {
14176
+ children: /*#__PURE__*/ jsx(ErrorCard, {
14177
+ message: `Error loading notebook ${notebook}`
14178
+ })
14179
+ })
14180
+ });
14181
+ }
14182
+ return /*#__PURE__*/ jsxs("div", {
14183
+ className: "flex w-full h-full",
14184
+ children: [
14185
+ /*#__PURE__*/ jsx(LoadingOverlay, {
14186
+ visible: isLoading
14187
+ }),
14188
+ /*#__PURE__*/ jsx("div", {
14189
+ dangerouslySetInnerHTML: {
14190
+ __html: htmlContent
14191
+ }
14192
+ })
14193
+ ]
14194
+ });
14195
+ };
14196
+
14197
+ const StaticNotebookIFrame = ({ notebook })=>{
14198
+ const router = useRouter$1();
14199
+ return /*#__PURE__*/ jsx("div", {
14200
+ className: "flex w-full h-full",
14201
+ children: /*#__PURE__*/ jsx("div", {
14202
+ className: "flex justify-items-center w-full",
14203
+ children: /*#__PURE__*/ jsx("iframe", {
14204
+ allow: "cross-origin",
14205
+ src: `${router.basePath}/${GEN3_STATIC_NOTEBOOK_DIR}/${notebook}`,
14206
+ width: "100%",
14207
+ height: "100%",
14208
+ title: "client notebook"
14209
+ })
14210
+ })
14211
+ });
14212
+ };
14213
+
14075
14214
  const myGlob = (dir, filter)=>{
14076
14215
  try {
14077
14216
  const files = fs.readdirSync(dir);
@@ -14154,10 +14293,25 @@ var ContentSource$1 = ContentSource.getInstance();
14154
14293
  let bannerConfigJSON = [];
14155
14294
  try {
14156
14295
  bannerConfigJSON = await ContentSource$1.getContentDatabase().get(`${GEN3_COMMONS_NAME}/banner.json`);
14157
- } catch (e) {
14296
+ } catch (error) {
14158
14297
  console.warn('No banner config found at: ', `${GEN3_COMMONS_NAME}/banner.json`);
14159
14298
  }
14160
14299
  const { topBar, navigation, type = 'original' } = navigationConfigJSON;
14300
+ let headerMetadata = {
14301
+ title: 'Gen3 Frontend Framework Page',
14302
+ content: 'Gen3 Frontend Framework Page',
14303
+ key: 'gen3-common-page'
14304
+ };
14305
+ try {
14306
+ const loadedHeaderMetadata = await ContentSource$1.getContentDatabase().get(`${GEN3_COMMONS_NAME}/headerMetadata.json`);
14307
+ if (isHeaderMetadata(loadedHeaderMetadata)) {
14308
+ headerMetadata = loadedHeaderMetadata;
14309
+ } else {
14310
+ console.warn('headerMetadata is not a valid HeaderMetadata object');
14311
+ }
14312
+ } catch (error) {
14313
+ console.warn('No headerMetadata config found at: ', `${GEN3_COMMONS_NAME}/headerMetadata.json`);
14314
+ }
14161
14315
  const headerProps = {
14162
14316
  top: topBar,
14163
14317
  navigation: navigation,
@@ -14168,11 +14322,7 @@ var ContentSource$1 = ContentSource.getInstance();
14168
14322
  return {
14169
14323
  headerProps,
14170
14324
  footerProps,
14171
- headerData: {
14172
- title: 'Gen3 Frontend Framework Page',
14173
- content: 'Gen3 Frontend Framework Page',
14174
- key: 'gen3-common-page'
14175
- }
14325
+ headerMetadata
14176
14326
  };
14177
14327
  };
14178
14328
 
@@ -15392,386 +15542,7 @@ const useRoundedAggsQuery = ({ type, fields, filters, accessibility = Accessibil
15392
15542
  ...response,
15393
15543
  data: response?.data?.data ? processHistogramResponse(response?.data.data?._aggregation[type] ?? {}) : {}
15394
15544
  };
15395
- }; // import { cohortDiscoveryApi } from './appApi';
15396
- //
15397
- // import {
15398
- // Accessibility,
15399
- // convertFilterSetToGqlFilter,
15400
- // FilterSet,
15401
- // isFilterEmpty,
15402
- // AggregationsData,
15403
- // RawDataAndTotalCountsParams,
15404
- // GraphQLQuery,
15405
- // } from '@gen3/core';
15406
- //
15407
- // /*
15408
- // returns all the fields for a given type
15409
- // @param type: the type to get fields for
15410
- // @returns: a list of fields for the given type
15411
- // */
15412
- //
15413
- // interface AccessibleDataSliceParams {
15414
- // type: string;
15415
- // fields: ReadonlyArray<string>;
15416
- // accessType: Accessibility;
15417
- // }
15418
- //
15419
- // interface QueryAggsParams {
15420
- // type: string;
15421
- // fields: ReadonlyArray<string>;
15422
- // filters: FilterSet;
15423
- // accessibility?: Accessibility;
15424
- // }
15425
- //
15426
- // interface QueryForSubAggsParams {
15427
- // type: string;
15428
- // mainField: string;
15429
- // numericAggAsText: boolean;
15430
- // termsFields?: ReadonlyArray<string>;
15431
- // missingFields?: ReadonlyArray<string>;
15432
- // gqlFilter?: FilterSet;
15433
- // accessibility?: Accessibility;
15434
- // }
15435
- //
15436
- // interface QueryCountsParams {
15437
- // type: string;
15438
- // filters: FilterSet;
15439
- // accessibility?: Accessibility;
15440
- // }
15441
- //
15442
- // interface QueryForFileCountSummaryParams {
15443
- // type: string;
15444
- // field: string;
15445
- // filters: FilterSet;
15446
- // accessibility?: Accessibility;
15447
- // }
15448
- //
15449
- // /**
15450
- // * The main endpoint used in templating Exploration page queries.
15451
- // * Includes table, filter and aggregation query types and leverages guppyApi defined in ./gupplApi.ts
15452
- // * Query templates support filters where applicable
15453
- // *
15454
- // * @param endpoints - Defines endpoints used in Exploration page:
15455
- // * @param getAllFieldsForType - A mapping query that returns all property key names vertex types specified.
15456
- // * @see https://github.com/uc-cdis/guppy/blob/master/doc/queries.md#mapping-query
15457
- // * @param getAccessibleData - An aggregation histogram counts query that filters based on access type
15458
- // * @see https://github.com/uc-cdis/guppy/blob/master/doc/queries.md#accessibility-argument-for-regular-tier-access-level
15459
- // * @param getRawDataAndTotalCounts - Queries both _totalCount for selected vertex types and
15460
- // * tabular results containing the raw data in the rows of selected vertex types
15461
- // * @see https://github.com/uc-cdis/guppy/blob/master/doc/queries.md#1-total-count-aggregation
15462
- // * @param getAggs - An aggregated histogram counts query which outputs vertex property frequencies
15463
- // * @param getSubAggs - TODO: not sure what this one does. Looks like nested aggregation
15464
- // * @param getCounts - Returns total counts of a vertex type
15465
- // * @returns: A guppy API endpoint for templating queryable data displayed on the exploration page
15466
- // */
15467
- // const explorerApi = cohortDiscoveryApi.injectEndpoints({
15468
- // endpoints: (builder) => ({
15469
- // getAllFieldsForType: builder.query({
15470
- // query: (type: { type: string }) => ({
15471
- // query: `{ _mapping ${type} } }`,
15472
- // }),
15473
- // transformResponse: (response: Record<string, any>, _meta, params) => {
15474
- // return response[params.type];
15475
- // },
15476
- // }),
15477
- // getAccessibleData: builder.query({
15478
- // query: ({ type, fields, accessType }: AccessibleDataSliceParams) => {
15479
- // const fieldParts = fields.map(
15480
- // (field) => `${field} { histogram { key count } }`,
15481
- // );
15482
- // },
15483
- // }),
15484
- // getRawDataAndTotalCounts: builder.query({
15485
- // query: ({
15486
- // type,
15487
- // fields,
15488
- // filters,
15489
- // sort,
15490
- // offset = 0,
15491
- // size = 20,
15492
- // accessibility = Accessibility.ALL,
15493
- // format = undefined,
15494
- // }: RawDataAndTotalCountsParams) => {
15495
- // const gqlFilter = convertFilterSetToGqlFilter(filters);
15496
- // const params = [
15497
- // ...(sort ? ['$sort: JSON'] : []),
15498
- // ...(gqlFilter ? ['$filter: JSON'] : []),
15499
- // ...(format ? ['$format: Format'] : []),
15500
- // ].join(',');
15501
- // const queryLine = `query getRawDataAndTotalCounts (${params}) {`;
15502
- //
15503
- // const dataParams = [
15504
- // ...(format ? ['format: $format'] : []),
15505
- // ...(sort ? ['sort: $sort'] : []),
15506
- // ...(gqlFilter ? ['filter: $filter'] : []),
15507
- // ].join(',');
15508
- // const dataTypeLine = `${type} (accessibility: ${accessibility}, offset: ${offset}, first: ${size},
15509
- // ${dataParams}) {`;
15510
- //
15511
- // const typeAggsLine = `${type} (${
15512
- // gqlFilter && 'filter: $filter,'
15513
- // } accessibility: ${accessibility}) {`;
15514
- //
15515
- // const processedFields = fields.map((field) =>
15516
- // rawDataQueryStrForEachField(field),
15517
- // );
15518
- //
15519
- // const query = `${queryLine}
15520
- // ${dataTypeLine}
15521
- // ${processedFields.join(' ')}
15522
- // }
15523
- // _aggregation {
15524
- // ${typeAggsLine}
15525
- // _totalCount
15526
- // }
15527
- // }
15528
- // }`;
15529
- // const variables = {
15530
- // ...(sort && { sort }),
15531
- // ...(gqlFilter && { filter: gqlFilter }),
15532
- // ...(format && { format }),
15533
- // };
15534
- // return { query, variables };
15535
- // },
15536
- // }),
15537
- // getAggs: builder.query<AggregationsData, QueryAggsParams>({
15538
- // query: ({
15539
- // type,
15540
- // fields,
15541
- // filters,
15542
- // accessibility = Accessibility.ALL,
15543
- // }: QueryAggsParams) => {
15544
- // const queryStart = isFilterEmpty(filters)
15545
- // ? `
15546
- // query getAggs {
15547
- // _aggregation {
15548
- // ${type} (accessibility: ${accessibility}) {`
15549
- // : `query getAggs ($filter: JSON) {
15550
- // _aggregation {
15551
- // ${type} (filter: $filter, filterSelf: false, accessibility: ${accessibility}) {`;
15552
- // const query = `${queryStart}
15553
- // ${fields.map((field: string) =>
15554
- // histogramQueryStrForEachField(field),
15555
- // )}
15556
- // }
15557
- // }
15558
- // }`;
15559
- // const queryBody: GraphQLQuery = {
15560
- // query: query,
15561
- // variables: { filter: convertFilterSetToGqlFilter(filters) },
15562
- // };
15563
- // return queryBody;
15564
- // },
15565
- // }),
15566
- // getAggsNoFilterSelf: builder.query<AggregationsData, QueryAggsParams>({
15567
- // query: ({
15568
- // type,
15569
- // fields,
15570
- // filters,
15571
- // accessibility = Accessibility.ALL,
15572
- // }: QueryAggsParams) => {
15573
- // const queryStart = isFilterEmpty(filters)
15574
- // ? `
15575
- // query getAggs {
15576
- // _aggregation {
15577
- // ${type} (accessibility: ${accessibility}) {`
15578
- // : `query getAggs ($filter: JSON) {
15579
- // _aggregation {
15580
- // ${type} (filter: $filter, filterSelf: true, accessibility: ${accessibility}) {`;
15581
- // const query = `${queryStart}
15582
- // ${fields.map((field: string) =>
15583
- // histogramQueryStrForEachField(field),
15584
- // )}
15585
- // }
15586
- // }
15587
- // }`;
15588
- // const queryBody: GraphQLQuery = {
15589
- // query: query,
15590
- // variables: { filter: convertFilterSetToGqlFilter(filters) },
15591
- // };
15592
- // return queryBody;
15593
- // },
15594
- // }),
15595
- // getSubAggs: builder.query<AggregationsData, QueryForSubAggsParams>({
15596
- // query: ({
15597
- // type,
15598
- // mainField,
15599
- // termsFields = undefined,
15600
- // missingFields = undefined,
15601
- // numericAggAsText = false,
15602
- // gqlFilter = undefined,
15603
- // accessibility = Accessibility.ALL,
15604
- // }: QueryForSubAggsParams) => {
15605
- // const nestedAggFields = {
15606
- // termsFields: termsFields,
15607
- // missingFields: missingFields,
15608
- // };
15609
- //
15610
- // const query = `query getSubAggs ( ${
15611
- // gqlFilter ?? '$filter: JSON,'
15612
- // } $nestedAggFields: JSON) {
15613
- // _aggregation {
15614
- // ${type} ( ${
15615
- // gqlFilter ?? 'filter: $filter, filterSelf: false,'
15616
- // } nestedAggFields: $nestedAggFields, accessibility: ${accessibility}) {
15617
- // ${nestedHistogramQueryStrForEachField(mainField, numericAggAsText)}
15618
- // }`;
15619
- //
15620
- // return {
15621
- // query: query,
15622
- // variables: {
15623
- // ...(gqlFilter && {
15624
- // filter: convertFilterSetToGqlFilter(gqlFilter),
15625
- // }),
15626
- // nestedAggFields: nestedAggFields,
15627
- // },
15628
- // };
15629
- // },
15630
- // }),
15631
- // getCounts: builder.query<number, QueryCountsParams>({
15632
- // query: ({
15633
- // type,
15634
- // filters,
15635
- // accessibility = Accessibility.ALL,
15636
- // }: QueryCountsParams) => {
15637
- // const gqlFilters = convertFilterSetToGqlFilter(filters);
15638
- // const queryLine = `query totalCounts ${
15639
- // gqlFilters ? '($filter: JSON)' : ''
15640
- // }{`;
15641
- // const typeAggsLine = `${type} ${
15642
- // gqlFilters ? '(filter: $filter, ' : '('
15643
- // } accessibility: ${accessibility}) {`;
15644
- //
15645
- // const query = `${queryLine} _aggregation {
15646
- // ${typeAggsLine}
15647
- // _totalCount
15648
- // }
15649
- // }
15650
- // }`;
15651
- // return {
15652
- // query: query,
15653
- // variables: {
15654
- // ...(gqlFilters && {
15655
- // filter: gqlFilters,
15656
- // }),
15657
- // },
15658
- // };
15659
- // },
15660
- // }),
15661
- // getFieldCountSummary: builder.query<
15662
- // Record<string, any>,
15663
- // QueryForFileCountSummaryParams
15664
- // >({
15665
- // query: ({
15666
- // type,
15667
- // field,
15668
- // filters,
15669
- // accessibility = Accessibility.ALL,
15670
- // }: QueryForFileCountSummaryParams) => {
15671
- // const gqlFilters = convertFilterSetToGqlFilter(filters);
15672
- // const query = `query summary ($filter: JSON) {
15673
- // _aggregation {
15674
- // ${type} (filter: $filter, accessibility: ${accessibility}) {
15675
- // ${field} {
15676
- // histogram {
15677
- // sum,
15678
- // }
15679
- // }
15680
- // }
15681
- // }
15682
- // }`;
15683
- // return {
15684
- // query: query,
15685
- // variables: {
15686
- // ...(gqlFilters && {
15687
- // filter: gqlFilters,
15688
- // }),
15689
- // },
15690
- // };
15691
- // },
15692
- // }),
15693
- // getFieldsForIndex: builder.query({
15694
- // query: (index: string) => {
15695
- // return {
15696
- // query: `{
15697
- // _mapping { ${index} }
15698
- // }`,
15699
- // };
15700
- // },
15701
- // }),
15702
- // }),
15703
- // });
15704
- //
15705
- // // query for aggregate data
15706
- // // convert the function below to typescript
15707
- //
15708
- // const histogramQueryStrForEachField = (field: string): string => {
15709
- // const splittedFieldArray = field.split('.');
15710
- // const splittedField = splittedFieldArray.shift();
15711
- // if (splittedFieldArray.length === 0) {
15712
- // return `
15713
- // ${splittedField} {
15714
- // histogram {
15715
- // key
15716
- // count
15717
- // }
15718
- // }`;
15719
- // }
15720
- // return `
15721
- // ${splittedField} {
15722
- // ${histogramQueryStrForEachField(splittedFieldArray.join('.'))}
15723
- // }`;
15724
- // };
15725
- //
15726
- // const nestedHistogramQueryStrForEachField = (
15727
- // mainField: string,
15728
- // numericAggAsText: boolean,
15729
- // ) => `
15730
- // ${mainField} {
15731
- // ${numericAggAsText ? 'asTextHistogram' : 'histogram'} {
15732
- // key
15733
- // count
15734
- // missingFields {
15735
- // field
15736
- // count
15737
- // }
15738
- // termsFields {
15739
- // field
15740
- // count
15741
- // terms {
15742
- // key
15743
- // count
15744
- // }
15745
- // }
15746
- // }
15747
- // }`;
15748
- //
15749
- // export const rawDataQueryStrForEachField = (field: string): string => {
15750
- // const splitFieldArray = field.split('.');
15751
- // const splitField = splitFieldArray.shift();
15752
- // if (splitFieldArray.length === 0) {
15753
- // return `
15754
- // ${splitField}
15755
- // `;
15756
- // }
15757
- // return `
15758
- // ${splitField} {
15759
- // ${rawDataQueryStrForEachField(splitFieldArray.join('.'))}
15760
- // }`;
15761
- // };
15762
- //
15763
- // export const {
15764
- // useGetRawDataAndTotalCountsQuery,
15765
- // useGetAccessibleDataQuery,
15766
- // useGetAllFieldsForTypeQuery,
15767
- // useGetAggsQuery,
15768
- // useGetAggsNoFilterSelfQuery,
15769
- // useLazyGetAggsQuery,
15770
- // useGetSubAggsQuery,
15771
- // useGetCountsQuery,
15772
- // useGetFieldCountSummaryQuery,
15773
- // useGetFieldsForIndexQuery,
15774
- // } = explorerApi;
15545
+ };
15775
15546
 
15776
15547
  const NUM_COLS = 2; // TODO: add to config
15777
15548
  /**
@@ -16972,13 +16743,11 @@ const RequestsTable = ()=>{
16972
16743
  };
16973
16744
 
16974
16745
  const RequestsPanel = ()=>{
16975
- return /*#__PURE__*/ jsx(ProtectedContent, {
16976
- children: /*#__PURE__*/ jsx(Stack, {
16977
- className: "w-100 m-2",
16978
- children: /*#__PURE__*/ jsx(Group, {
16979
- className: "w-100 bg-base-light p-4",
16980
- children: /*#__PURE__*/ jsx(RequestsTable, {})
16981
- })
16746
+ return /*#__PURE__*/ jsx(Stack, {
16747
+ className: "w-100 m-2",
16748
+ children: /*#__PURE__*/ jsx(Group, {
16749
+ className: "w-100 bg-base-light p-4",
16750
+ children: /*#__PURE__*/ jsx(RequestsTable, {})
16982
16751
  })
16983
16752
  });
16984
16753
  };
@@ -17034,79 +16803,81 @@ const CohortDiscovery = (config)=>{
17034
16803
  const indexResources = extractIndexResourceFromConfiguration(config);
17035
16804
  useAppDispatch(loadCohortsFromStorage());
17036
16805
  return /*#__PURE__*/ jsx(React__default.Fragment, {
17037
- children: /*#__PURE__*/ jsxs(PersistGate, {
17038
- persistor: persistor,
17039
- loading: /*#__PURE__*/ jsx(Loader, {
17040
- variant: "dots"
17041
- }),
17042
- children: [
17043
- /*#__PURE__*/ jsx(Title, {
17044
- order: 3,
17045
- className: "absolute top-6 left-[154px]",
17046
- children: "Cohort Discovery"
16806
+ children: /*#__PURE__*/ jsx(ProtectedContent, {
16807
+ children: /*#__PURE__*/ jsxs(PersistGate, {
16808
+ persistor: persistor,
16809
+ loading: /*#__PURE__*/ jsx(Loader, {
16810
+ variant: "dots"
17047
16811
  }),
17048
- /*#__PURE__*/ jsxs(Tabs, {
17049
- keepMounted: false,
17050
- defaultValue: "build",
17051
- orientation: "vertical",
17052
- classNames: {
17053
- root: 'w-full h-full',
17054
- list: 'bg-base-light before:content-none pt-20',
17055
- tab: 'border-0 border-l-4 rounded-none data-[active=true]:border-accent-warm data-[active=true]:bg-base-max text-center',
17056
- tabLabel: 'w-full',
17057
- panel: 'pt-16'
17058
- },
17059
- children: [
17060
- /*#__PURE__*/ jsx(Tabs.List, {
17061
- children: Object.keys(config.leftNav).map((key)=>{
17062
- return /*#__PURE__*/ jsxs(Tabs.Tab, {
17063
- value: key,
17064
- children: [
17065
- /*#__PURE__*/ jsx(Image, {
17066
- src: config.leftNav[key].image,
17067
- alt: config.leftNav[key].imageAlt,
17068
- width: 40,
17069
- height: 40,
17070
- className: "inline-block mb-1"
17071
- }),
17072
- /*#__PURE__*/ jsx("strong", {
17073
- className: "block",
17074
- children: config.leftNav[key].title
17075
- })
17076
- ]
17077
- }, key);
17078
- })
17079
- }),
17080
- /*#__PURE__*/ jsx(Tabs.Panel, {
17081
- value: "build",
17082
- children: config.dataIndexes.length === 1 ? /*#__PURE__*/ jsx(IndexPanel, {
17083
- dataConfig: config.dataIndexes[0].dataConfig,
17084
- tabTitle: config.dataIndexes[0].tabTitle,
17085
- tabs: config.dataIndexes[0].tabs,
17086
- emptySelection: config.emptySelection,
17087
- resourceField: config.dataIndexes[0].resourceField,
17088
- numColumns: config.dataIndexes[0].numColumns ?? 2,
17089
- indexResources: indexResources,
17090
- remoteSupportService: config.remoteSupportService
17091
- }) : /*#__PURE__*/ jsx(TabbedIndex, {
17092
- config: config,
17093
- indexResources: indexResources
17094
- })
17095
- }),
17096
- /*#__PURE__*/ jsx(Tabs.Panel, {
17097
- value: "saved",
17098
- children: /*#__PURE__*/ jsx(SavedCohortsPanel, {
17099
- indexResources: indexResources,
17100
- remoteSupportService: config.remoteSupportService
16812
+ children: [
16813
+ /*#__PURE__*/ jsx(Title, {
16814
+ order: 3,
16815
+ className: "absolute top-6 left-[154px]",
16816
+ children: "Cohort Discovery"
16817
+ }),
16818
+ /*#__PURE__*/ jsxs(Tabs, {
16819
+ keepMounted: false,
16820
+ defaultValue: "build",
16821
+ orientation: "vertical",
16822
+ classNames: {
16823
+ root: 'w-full h-full',
16824
+ list: 'bg-base-light before:content-none pt-20',
16825
+ tab: 'border-0 border-l-4 rounded-none data-[active=true]:border-accent-warm data-[active=true]:bg-base-max text-center',
16826
+ tabLabel: 'w-full',
16827
+ panel: 'pt-16'
16828
+ },
16829
+ children: [
16830
+ /*#__PURE__*/ jsx(Tabs.List, {
16831
+ children: Object.keys(config.leftNav).map((key)=>{
16832
+ return /*#__PURE__*/ jsxs(Tabs.Tab, {
16833
+ value: key,
16834
+ children: [
16835
+ /*#__PURE__*/ jsx(Image, {
16836
+ src: config.leftNav[key].image,
16837
+ alt: config.leftNav[key].imageAlt,
16838
+ width: 40,
16839
+ height: 40,
16840
+ className: "inline-block mb-1"
16841
+ }),
16842
+ /*#__PURE__*/ jsx("strong", {
16843
+ className: "block",
16844
+ children: config.leftNav[key].title
16845
+ })
16846
+ ]
16847
+ }, key);
16848
+ })
16849
+ }),
16850
+ /*#__PURE__*/ jsx(Tabs.Panel, {
16851
+ value: "build",
16852
+ children: config.dataIndexes.length === 1 ? /*#__PURE__*/ jsx(IndexPanel, {
16853
+ dataConfig: config.dataIndexes[0].dataConfig,
16854
+ tabTitle: config.dataIndexes[0].tabTitle,
16855
+ tabs: config.dataIndexes[0].tabs,
16856
+ emptySelection: config.emptySelection,
16857
+ resourceField: config.dataIndexes[0].resourceField,
16858
+ numColumns: config.dataIndexes[0].numColumns ?? 2,
16859
+ indexResources: indexResources,
16860
+ remoteSupportService: config.remoteSupportService
16861
+ }) : /*#__PURE__*/ jsx(TabbedIndex, {
16862
+ config: config,
16863
+ indexResources: indexResources
16864
+ })
16865
+ }),
16866
+ /*#__PURE__*/ jsx(Tabs.Panel, {
16867
+ value: "saved",
16868
+ children: /*#__PURE__*/ jsx(SavedCohortsPanel, {
16869
+ indexResources: indexResources,
16870
+ remoteSupportService: config.remoteSupportService
16871
+ })
16872
+ }),
16873
+ /*#__PURE__*/ jsx(Tabs.Panel, {
16874
+ value: "request",
16875
+ children: /*#__PURE__*/ jsx(RequestsPanel, {})
17101
16876
  })
17102
- }),
17103
- /*#__PURE__*/ jsx(Tabs.Panel, {
17104
- value: "request",
17105
- children: /*#__PURE__*/ jsx(RequestsPanel, {})
17106
- })
17107
- ]
17108
- })
17109
- ]
16877
+ ]
16878
+ })
16879
+ ]
16880
+ })
17110
16881
  })
17111
16882
  });
17112
16883
  };
@@ -19572,7 +19343,7 @@ const DiscoveryPage = ({ headerProps, footerProps, discoveryConfig })=>{
19572
19343
  return /*#__PURE__*/ jsx(NavPageLayout, {
19573
19344
  headerProps,
19574
19345
  footerProps,
19575
- headerData: {
19346
+ headerMetadata: {
19576
19347
  title: 'Gen3 Discovery Page',
19577
19348
  content: 'Discovery Data',
19578
19349
  key: 'gen3-discovery-page',
@@ -19628,7 +19399,7 @@ const QueryPage = ({ headerProps, footerProps, queryProps })=>{
19628
19399
  return /*#__PURE__*/ jsx(NavPageLayout, {
19629
19400
  headerProps,
19630
19401
  footerProps,
19631
- headerData: {
19402
+ headerMetadata: {
19632
19403
  title: 'Gen3 Query Page',
19633
19404
  content: 'Query page',
19634
19405
  key: 'gen3-query-page',
@@ -19801,7 +19572,7 @@ const LandingPage = ({ headerProps, footerProps, landingPage })=>{
19801
19572
  return /*#__PURE__*/ jsx(NavPageLayout, {
19802
19573
  footerProps,
19803
19574
  headerProps,
19804
- headerData: {
19575
+ headerMetadata: {
19805
19576
  title: 'Gen3 Home Page',
19806
19577
  content: 'Home page',
19807
19578
  key: 'gen3-home-page',
@@ -19842,7 +19613,7 @@ const ExplorerPage = ({ headerProps, footerProps, explorerConfig, headerMetadata
19842
19613
  return /*#__PURE__*/ jsx(NavPageLayout, {
19843
19614
  headerProps,
19844
19615
  footerProps,
19845
- headerData: {
19616
+ headerMetadata: {
19846
19617
  title: 'Gen3 Explorer Page',
19847
19618
  content: 'Explorer Page',
19848
19619
  key: 'gen3-explorer-page',
@@ -19864,6 +19635,11 @@ var GuppyDataAccessMode = /*#__PURE__*/ function(GuppyDataAccessMode) {
19864
19635
  return GuppyDataAccessMode;
19865
19636
  }({});
19866
19637
 
19638
+ const DefaultHeaderMetadata = {
19639
+ title: 'Gen3 Explorer Page',
19640
+ content: 'Explorer Page',
19641
+ key: 'gen3-explorer-page'
19642
+ };
19867
19643
  const GetSharedFieldMapping = async (cohortBuilderConfiguration)=>{
19868
19644
  let sharedFiltersMap = null;
19869
19645
  if (cohortBuilderConfiguration?.sharedFilters) {
@@ -19920,9 +19696,7 @@ const ExplorerPageGetServerSideProps = async ()=>{
19920
19696
  props: {
19921
19697
  ...await getNavPageLayoutPropsFromConfig(),
19922
19698
  explorerConfig: cohortBuilderConfiguration,
19923
- headerMetadata: {
19924
- ...cohortBuilderConfiguration?.headerMetadata
19925
- }
19699
+ headerMetadata: cohortBuilderConfiguration?.headerMetadata ? cohortBuilderConfiguration.headerMetadata : DefaultHeaderMetadata
19926
19700
  }
19927
19701
  };
19928
19702
  }
@@ -19933,7 +19707,7 @@ const ExplorerPageGetServerSideProps = async ()=>{
19933
19707
  sharedFiltersMap: sharedFiltersMap,
19934
19708
  tabsLayout: cohortBuilderConfiguration?.tabsLayout ?? 'left',
19935
19709
  explorerConfig: cohortBuilderConfiguration.explorerConfig,
19936
- headerMetadata: cohortBuilderConfiguration.headerMetadata,
19710
+ // headerMetadata: cohortBuilderConfiguration.headerMetadata,
19937
19711
  accessControl: {
19938
19712
  ...DefaultAccessControlConfiguration,
19939
19713
  ...cohortBuilderConfiguration.accessControl ?? {}
@@ -19963,9 +19737,7 @@ const ExplorerPageGetServerSidePropsForConfigId = async (context)=>{
19963
19737
  props: {
19964
19738
  ...await getNavPageLayoutPropsFromConfig(),
19965
19739
  explorerConfig: cohortBuilderConfiguration,
19966
- headerMetadata: {
19967
- ...cohortBuilderConfiguration?.headerMetadata
19968
- }
19740
+ headerMetadata: cohortBuilderConfiguration?.headerMetadata ? cohortBuilderConfiguration.headerMetadata : DefaultHeaderMetadata
19969
19741
  }
19970
19742
  };
19971
19743
  }
@@ -19976,7 +19748,7 @@ const ExplorerPageGetServerSidePropsForConfigId = async (context)=>{
19976
19748
  sharedFiltersMap: sharedFiltersMap,
19977
19749
  tabsLayout: cohortBuilderConfiguration?.tabsLayout ?? 'left',
19978
19750
  explorerConfig: cohortBuilderConfiguration.explorerConfig,
19979
- headerMetadata: cohortBuilderConfiguration.headerMetadata,
19751
+ // headerMetadata: { ...(cohortBuilderConfiguration?.headerMetadata ? cohortBuilderConfiguration.headerMetadata : {}) },
19980
19752
  accessControl: {
19981
19753
  ...DefaultAccessControlConfiguration,
19982
19754
  ...cohortBuilderConfiguration.accessControl ?? {}
@@ -20336,7 +20108,7 @@ const ColorThemePage = ({ headerProps, footerProps })=>{
20336
20108
  return /*#__PURE__*/ jsx(NavPageLayout, {
20337
20109
  headerProps,
20338
20110
  footerProps,
20339
- headerData: {
20111
+ headerMetadata: {
20340
20112
  title: 'Gen3 Theme Page',
20341
20113
  content: 'Theme page',
20342
20114
  key: 'gen3-theme-page'
@@ -20914,7 +20686,7 @@ const ProfilePage = ({ headerProps, footerProps, profileConfig })=>{
20914
20686
  return /*#__PURE__*/ jsx(NavPageLayout, {
20915
20687
  headerProps,
20916
20688
  footerProps,
20917
- headerData: {
20689
+ headerMetadata: {
20918
20690
  title: 'Gen3 Profile Page',
20919
20691
  content: 'Profile page',
20920
20692
  key: 'gen3-profile-page',
@@ -20942,7 +20714,7 @@ const LoginPage = ({ headerProps, footerProps, loginConfig })=>{
20942
20714
  return /*#__PURE__*/ jsx(NavPageLayout, {
20943
20715
  headerProps,
20944
20716
  footerProps,
20945
- headerData: {
20717
+ headerMetadata: {
20946
20718
  title: 'Gen3 Login Page',
20947
20719
  content: 'Login page',
20948
20720
  key: 'gen3-login-page',
@@ -20973,7 +20745,7 @@ const DictionaryPage = ({ headerProps, footerProps, config })=>{
20973
20745
  mainProps: {
20974
20746
  fixed: true
20975
20747
  },
20976
- headerData: {
20748
+ headerMetadata: {
20977
20749
  title: 'Gen3 DataDictionary Page',
20978
20750
  content: 'Data Dictionary',
20979
20751
  key: 'gen3-data-dictionary-page',
@@ -21698,7 +21470,7 @@ const AuthzPage = ({ headerProps, footerProps, authz })=>{
21698
21470
  headerProps,
21699
21471
  footerProps,
21700
21472
  headerProps: headerProps,
21701
- headerData: {
21473
+ headerMetadata: {
21702
21474
  title: 'Gen3 Authz Editor Page',
21703
21475
  content: 'Authz Editor page',
21704
21476
  key: 'gen3-authz-editor-page'
@@ -22025,7 +21797,7 @@ const SubmissionPage = ({ submissionConfig, headerProps, footerProps })=>{
22025
21797
  return /*#__PURE__*/ jsx(NavPageLayout, {
22026
21798
  footerProps: footerProps,
22027
21799
  headerProps: headerProps,
22028
- headerData: {
21800
+ headerMetadata: {
22029
21801
  title: 'Gen3 Submission Page',
22030
21802
  content: 'Submission page',
22031
21803
  key: 'gen3-submission-page'
@@ -22060,7 +21832,7 @@ const WorkspacePage = ({ headerProps, footerProps, workspaceProps })=>{
22060
21832
  return /*#__PURE__*/ jsx(NavPageLayout, {
22061
21833
  headerProps,
22062
21834
  footerProps,
22063
- headerData: {
21835
+ headerMetadata: {
22064
21836
  title: 'Gen3 Workspace Page',
22065
21837
  content: 'Workspace page',
22066
21838
  key: 'gen3-workspace-page',
@@ -22077,7 +21849,7 @@ const WorkspaceNoAccessPage = ({ headerProps, footerProps })=>{
22077
21849
  return /*#__PURE__*/ jsx(NavPageLayout, {
22078
21850
  headerProps,
22079
21851
  footerProps,
22080
- headerData: {
21852
+ headerMetadata: {
22081
21853
  title: 'Gen3 Workspace No Access Page',
22082
21854
  content: 'Workspace no access page',
22083
21855
  key: 'gen3-workspace-no-access-page'
@@ -22141,7 +21913,7 @@ const AnalysisPage = ({ headerProps, footerProps, tools, sections, classNames })
22141
21913
  return /*#__PURE__*/ jsxs(NavPageLayout, {
22142
21914
  headerProps,
22143
21915
  footerProps,
22144
- headerData: {
21916
+ headerMetadata: {
22145
21917
  title: 'Gen3 Analysis Center',
22146
21918
  content: 'Analysis Center',
22147
21919
  key: 'gen3-analysis-center'
@@ -22791,7 +22563,7 @@ const AnalysisEditorPage = ({ headerProps, footerProps })=>{
22791
22563
  headerProps,
22792
22564
  footerProps,
22793
22565
  headerProps: headerProps,
22794
- headerData: {
22566
+ headerMetadata: {
22795
22567
  title: 'Gen3 Analysis Editor Page',
22796
22568
  content: 'Analysis Editor page',
22797
22569
  key: 'gen3-analysis-editor-page'
@@ -22824,7 +22596,7 @@ const AISearchPage = ({ headerProps, footerProps })=>{
22824
22596
  return /*#__PURE__*/ jsx(NavPageLayout, {
22825
22597
  headerProps,
22826
22598
  footerProps,
22827
- headerData: {
22599
+ headerMetadata: {
22828
22600
  title: 'Gen3 AI Search Page',
22829
22601
  content: 'AI Search',
22830
22602
  key: 'gen3-ai-search-page'
@@ -22854,7 +22626,7 @@ const AISearchPageGetServerSideProps = async ()=>{
22854
22626
  navigation: {}
22855
22627
  },
22856
22628
  footerProps: {},
22857
- headerData: {
22629
+ headerMetadata: {
22858
22630
  title: 'Gen3 AI Search Page',
22859
22631
  content: 'AI Search',
22860
22632
  key: 'gen3-ai-search-page'
@@ -22869,7 +22641,7 @@ const NotebookLitePage = ({ headerProps, footerProps })=>{
22869
22641
  return /*#__PURE__*/ jsx(NavPageLayout, {
22870
22642
  footerProps,
22871
22643
  headerProps,
22872
- headerData: {
22644
+ headerMetadata: {
22873
22645
  title: 'Gen3 Notebooks Lite Page',
22874
22646
  content: 'Notebooks Lite',
22875
22647
  key: 'gen3-notebooks-lite-page'
@@ -24934,7 +24706,7 @@ const DataLibraryPage = ({ headerProps, footerProps, config })=>{
24934
24706
  return /*#__PURE__*/ jsx(NavPageLayout, {
24935
24707
  headerProps,
24936
24708
  footerProps,
24937
- headerData: {
24709
+ headerMetadata: {
24938
24710
  title: 'Gen3 DataLibrary Page',
24939
24711
  content: 'DataLibrary Data',
24940
24712
  key: 'gen3-data-library-page'
@@ -25226,7 +24998,7 @@ const CrosswalkPage = ({ headerProps, footerProps, config })=>{
25226
24998
  return /*#__PURE__*/ jsx(NavPageLayout, {
25227
24999
  headerProps,
25228
25000
  footerProps,
25229
- headerData: {
25001
+ headerMetadata: {
25230
25002
  title: 'Gen3 Crosswalk Page',
25231
25003
  content: 'Crosswalk Data',
25232
25004
  key: 'gen3-crosswalk-page',
@@ -25277,7 +25049,7 @@ const TabbedCohortBuilderPage = ({ headerProps, footerProps, configuration })=>{
25277
25049
  return /*#__PURE__*/ jsx(NavPageLayout, {
25278
25050
  headerProps,
25279
25051
  footerProps,
25280
- headerData: {
25052
+ headerMetadata: {
25281
25053
  title: 'Gen3 Tabbed Cohort Builder Page',
25282
25054
  content: 'Tabbed Cohort Builder Page',
25283
25055
  key: 'gen3-tabbed-cohort-builder-page'
@@ -25643,6 +25415,7 @@ async function analysisApiCohortDiscovery(req, res) {
25643
25415
  const redactedData = roundHistogramResponse(data, COHORT_DISCOVERY_LIMIT);
25644
25416
  res.status(200).json(redactedData);
25645
25417
  } catch (error) {
25418
+ console.error('CohortDiscovery API', error);
25646
25419
  if (error instanceof HTTPError) res.status(error.status).json({
25647
25420
  error: 'HTTP Error',
25648
25421
  details: error.message
@@ -25658,5 +25431,96 @@ async function analysisApiCohortDiscovery(req, res) {
25658
25431
  }
25659
25432
  }
25660
25433
 
25661
- export { AISearchPageGetServerSideProps, AccessLevel, ActionBar, ActionButton, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AnalysisCenter, AnalysisCenterWithSections, AnalysisEditorPage, AnalysisEditorPageGetServerSideProps, AnalysisPage, AnalysisPageGetServerSideProps, AuthzPage, BAD_DATA_MESSAGE, Banner, BaseModal, Charts, CohortBuilder, CohortManager$1 as CohortManager, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, ContentSource$1 as ContentSource, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom404Page, DAYS_IN_YEAR, DEFAULT_MAXIMUM, DEFAULT_MINIMUM, DEFAULT_VISIBLE_ITEMS, DataLibraryPage, DataLibraryPageGetServerSideProps, DictionaryPage, DictionaryPageGetServerSideProps, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DiscoveryRowRendererFactory, DropdownButton, EnumFacet, EnumFacetChart, ErrorCard, ExactValueFacet, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FacetControlsHeader, FacetExpander, FacetSelector, FacetSortPanel, FacetTabs, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor$1 as GqlQueryEditor, Header$1 as Header, HoverLink, LandingPage, LandingPageGetServerSideProps, LoginButton$1 as LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MinutesToMilliseconds, MultiSelectValueFacet, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, QueryExpression, QueryExpressionContext, QueryExpressionSection, QueryPage, QueryPageGetServerSideProps, RangeFacet, ReactECharts, ResourcesFilters, SPECIAL_CASE_FIELDS, SessionExpiredModal, StudyGroup, SubmissionPage, SubmissionPageGetServerSideProps, TabbedCohortBuilder, TabbedCohortBuilderPage, TabbedCohortBuilderPageGetServerSideProps, TagCloud, TailwindConfig, TopBar, UploadJSONButton, User, Workspace, WorkspaceNoAccessPage, WorkspaceNoAccessPageServerSideProps, WorkspacePage, WorkspacePageGetServerSideProps, accessibleFieldName, addIntersectionToIncludes, addUnion, analysisApiCohortDiscovery, buildNested, capitalize, classifyFacets, compareKeysAscending, compareKeysDescending, computeRowSpan, convertMinutesToMilliseconds, convertPathsToTree, convertSecondsToMilliseconds, convertToStringArray, create10ColorAccessibleContrast, create10ColorPallet, createMantineTheme, credentialsLogin, credentialsLogout, extractObjectKey, extractRangeValues, focusStyles, getAllFieldsFromFilterConfigs, getCurrentUnixTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isEnumFacetResponse, isPropertyKey, isTextTransform$1 as isTextTransform, mapFacetSortToSortType, processBucketData, processLabel$1 as processLabel, processRangeData, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, registerMetadataSchemaApp, removeIntersectionFromEnum, removeKey$1 as removeKey, removeUnion, resourcePathFromProjectID, sessionLogout, sessionToken, stripTrailingSlash, toDisplayName, truncateString, unixTimeToString, updateFacetEnum, useClearFilters$1 as useClearFilters, useDiscoveryContext, useExtractEnumFilterValues, useExtractRangeFilterValues, useFieldNameToTitle, useGetFacetFilters$1 as useGetFacetFilters, useUpdateFilters$1 as useUpdateFilters, userHasMethodForServiceOnResource$1 as userHasMethodForServiceOnResource };
25434
+ const staticNotebookAPI = async (req, res)=>{
25435
+ if (req.method === 'OPTIONS') {
25436
+ res.status(200).json({
25437
+ success: true
25438
+ });
25439
+ }
25440
+ if (req.method === 'GET') {
25441
+ try {
25442
+ // Validate that a notebook was provided
25443
+ const { notebook } = req.query;
25444
+ if (!notebook) {
25445
+ return res.status(400).json({
25446
+ error: 'notebook parameter is required'
25447
+ });
25448
+ }
25449
+ let filePath = '';
25450
+ if (isArray(notebook)) {
25451
+ filePath = notebook[0];
25452
+ } else {
25453
+ filePath = notebook;
25454
+ }
25455
+ // Security: Prevent directory traversal attacks
25456
+ const sanitizedPath = path.normalize(filePath).replace(/^(\.\.[/\\])+/, '');
25457
+ // Ensure the file is within the allowed directory and has .html extension
25458
+ if (!sanitizedPath.endsWith('.html')) {
25459
+ return Response.json({
25460
+ error: 'Only HTML files are allowed',
25461
+ success: false
25462
+ }, {
25463
+ status: 400
25464
+ });
25465
+ }
25466
+ // Construct the full file path within the data directory
25467
+ const fullPath = path.join(process.cwd(), GEN3_STATIC_NOTEBOOK_DIR, sanitizedPath);
25468
+ // Check if a file exists and is within the data directory
25469
+ const dataDir = path.join(process.cwd(), `${GEN3_STATIC_NOTEBOOK_PATH}/${GEN3_STATIC_NOTEBOOK_DIR}`);
25470
+ if (!fullPath.startsWith(dataDir)) {
25471
+ return res.status(403).json({
25472
+ error: 'File access denied',
25473
+ success: false
25474
+ });
25475
+ }
25476
+ const rawContent = fs.readFileSync(fullPath, 'utf8');
25477
+ const sanitizedContent = DOMPurify.sanitize(rawContent, {
25478
+ ALLOWED_TAGS: [
25479
+ 'p',
25480
+ 'br',
25481
+ 'strong',
25482
+ 'em',
25483
+ 'h1',
25484
+ 'h2',
25485
+ 'h3',
25486
+ 'ul',
25487
+ 'ol',
25488
+ 'li',
25489
+ 'a',
25490
+ 'img'
25491
+ ],
25492
+ ALLOWED_ATTR: [
25493
+ 'href',
25494
+ 'title',
25495
+ 'src',
25496
+ 'alt',
25497
+ 'target'
25498
+ ]
25499
+ });
25500
+ res.status(200).json({
25501
+ content: sanitizedContent,
25502
+ success: true,
25503
+ filePath: sanitizedPath
25504
+ });
25505
+ } catch (error) {
25506
+ if (error.code === 'ENOENT') {
25507
+ res.status(404).json({
25508
+ error: 'Notebook not found. Please check the notebook name and try again.',
25509
+ success: false
25510
+ });
25511
+ } else {
25512
+ console.error('Error reading or sanitizing HTML file:', error);
25513
+ res.status(500).json({
25514
+ error: 'Error reading or sanitizing HTML file',
25515
+ success: false
25516
+ });
25517
+ }
25518
+ }
25519
+ }
25520
+ return res.status(405).json({
25521
+ error: 'Only GET|OPTION requests are allowed'
25522
+ });
25523
+ };
25524
+
25525
+ export { AISearchPageGetServerSideProps, AccessLevel, ActionBar, ActionButton, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AnalysisCenter, AnalysisCenterWithSections, AnalysisEditorPage, AnalysisEditorPageGetServerSideProps, AnalysisPage, AnalysisPageGetServerSideProps, AuthzPage, BAD_DATA_MESSAGE, Banner, BaseModal, Charts, CohortBuilder, CohortManager$1 as CohortManager, CollapsableCharts, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, ContentSource$1 as ContentSource, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom404Page, DAYS_IN_YEAR, DEFAULT_MAXIMUM, DEFAULT_MINIMUM, DEFAULT_VISIBLE_ITEMS$1 as DEFAULT_VISIBLE_ITEMS, DataLibraryPage, DataLibraryPageGetServerSideProps, DictionaryPage, DictionaryPageGetServerSideProps, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DiscoveryRowRendererFactory, DropdownButton, EnumFacet, EnumFacetChart, ErrorCard, ExactValueFacet, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FacetControlsHeader, FacetExpander, FacetSelector, FacetSortPanel, FacetTabs, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor$1 as GqlQueryEditor, Header$1 as Header, HoverLink, LandingPage, LandingPageGetServerSideProps, LoginButton$1 as LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MinutesToMilliseconds, MultiSelectValueFacet, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, QueryExpression, QueryExpressionContext, QueryExpressionSection, QueryPage, QueryPageGetServerSideProps, RangeFacet, ReactECharts, ResourcesFilters, SPECIAL_CASE_FIELDS, SessionExpiredModal, StaticNotebookIFrame, StaticNotebookViewer, StudyGroup, SubmissionPage, SubmissionPageGetServerSideProps, TabbedCohortBuilder, TabbedCohortBuilderPage, TabbedCohortBuilderPageGetServerSideProps, TagCloud, TailwindConfig, TopBar, UploadJSONButton, User, Workspace, WorkspaceNoAccessPage, WorkspaceNoAccessPageServerSideProps, WorkspacePage, WorkspacePageGetServerSideProps, accessibleFieldName, addIntersectionToIncludes, addUnion, analysisApiCohortDiscovery, buildNested, capitalize, classifyFacets, compareKeysAscending, compareKeysDescending, computeRowSpan, convertMinutesToMilliseconds, convertPathsToTree, convertSecondsToMilliseconds, convertToStringArray, create10ColorAccessibleContrast, create10ColorPallet, createMantineTheme, credentialsLogin, credentialsLogout, extractObjectKey, extractRangeValues, focusStyles, getAllFieldsFromFilterConfigs, getCurrentUnixTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isEnumFacetResponse, isHeaderMetadata, isPropertyKey, isTextTransform$1 as isTextTransform, mapFacetSortToSortType, processBucketData, processLabel$1 as processLabel, processRangeData, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, registerMetadataSchemaApp, removeIntersectionFromEnum, removeKey$1 as removeKey, removeUnion, resourcePathFromProjectID, sessionLogout, sessionToken, staticNotebookAPI, stripTrailingSlash, toDisplayName, truncateString, unixTimeToString, updateFacetEnum, useClearFilters$1 as useClearFilters, useDiscoveryContext, useExtractEnumFilterValues, useExtractRangeFilterValues, useFieldNameToTitle, useGetFacetFilters$1 as useGetFacetFilters, useUpdateFilters$1 as useUpdateFilters, userHasMethodForServiceOnResource$1 as userHasMethodForServiceOnResource };
25662
25526
  //# sourceMappingURL=index.js.map