synapse-react-client 4.0.17 → 4.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/README.md +5 -3
  2. package/dist/SWC.index.d.ts.map +1 -1
  3. package/dist/SWC.index.js +1 -1
  4. package/dist/SWC.index.js.map +1 -1
  5. package/dist/assets/homepage/BlinkingLiveIcon.d.ts +1 -1
  6. package/dist/components/AccessRequirementAclEditor/AccessRequirementAclEditor.d.ts.map +1 -1
  7. package/dist/components/AccessRequirementAclEditor/AccessRequirementAclEditor.js.map +1 -1
  8. package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
  9. package/dist/components/AccessRequirementList/RequirementItem/CertificationRequirement.js.map +1 -1
  10. package/dist/components/AccessRequirementList/RequirementItem/SelfSignAccessRequirementItem.js.map +1 -1
  11. package/dist/components/AccessRequirementList/RequirementItem/UnmanagedACTAccessRequirementItem.js.map +1 -1
  12. package/dist/components/AccessRequirementList/RequirementItem/ValidationRequirement.js.map +1 -1
  13. package/dist/components/AccessTokenPage/CreateAccessTokenModal.d.ts.map +1 -1
  14. package/dist/components/AccessTokenPage/CreateAccessTokenModal.js +56 -54
  15. package/dist/components/AccessTokenPage/CreateAccessTokenModal.js.map +1 -1
  16. package/dist/components/Authentication/PasswordField.d.ts +1 -1
  17. package/dist/components/Authentication/PasswordField.d.ts.map +1 -1
  18. package/dist/components/Authentication/PasswordField.js.map +1 -1
  19. package/dist/components/Authentication/TwoFactorEnrollmentForm.d.ts.map +1 -1
  20. package/dist/components/Authentication/TwoFactorEnrollmentForm.js +1 -2
  21. package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
  22. package/dist/components/Authentication/UsernamePasswordForm.d.ts.map +1 -1
  23. package/dist/components/Authentication/UsernamePasswordForm.js +32 -29
  24. package/dist/components/Authentication/UsernamePasswordForm.js.map +1 -1
  25. package/dist/components/CardContainer/CardLink.d.ts +2 -2
  26. package/dist/components/CardContainer/CardLink.d.ts.map +1 -1
  27. package/dist/components/CardDeck/CardDeckCardProps.d.ts.map +1 -1
  28. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
  29. package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.d.ts.map +1 -1
  30. package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.js +106 -103
  31. package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.js.map +1 -1
  32. package/dist/components/ChallengeTeamWizard/MembershipRequestForm.d.ts.map +1 -1
  33. package/dist/components/ChallengeTeamWizard/MembershipRequestForm.js.map +1 -1
  34. package/dist/components/ChallengeTeamWizard/useCreateAndRegisterChallengeTeam.d.ts.map +1 -1
  35. package/dist/components/ChallengeTeamWizard/useCreateAndRegisterChallengeTeam.js.map +1 -1
  36. package/dist/components/CreateProjectModal/CreateProjectModal.d.ts.map +1 -1
  37. package/dist/components/CreateProjectModal/CreateProjectModal.js +4 -4
  38. package/dist/components/CreateProjectModal/CreateProjectModal.js.map +1 -1
  39. package/dist/components/CreateTableViewWizard/TableNameForm.js +6 -6
  40. package/dist/components/CreateTableViewWizard/TableNameForm.js.map +1 -1
  41. package/dist/components/CrispChat/CrispChat.js +4 -4
  42. package/dist/components/CrispChat/CrispChat.js.map +1 -1
  43. package/dist/components/DataGrid/utils/json-rx/JsonRxResponseComplete.js.map +1 -1
  44. package/dist/components/DownloadCart/RequestDownloadCard.js +14 -14
  45. package/dist/components/DownloadCart/RequestDownloadCard.js.map +1 -1
  46. package/dist/components/EntityAclEditor/EntityAclEditor.d.ts.map +1 -1
  47. package/dist/components/EntityAclEditor/EntityAclEditor.js.map +1 -1
  48. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.d.ts.map +1 -1
  49. package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js.map +1 -1
  50. package/dist/components/EntityCitation/EntityCitationUtils.js.map +1 -1
  51. package/dist/components/EntityDownloadConfirmation/EntityDownloadConfirmation.js.map +1 -1
  52. package/dist/components/EntityFinder/EntityFinder.js.map +1 -1
  53. package/dist/components/EntityFinder/EntityIdTextField.d.ts +17 -0
  54. package/dist/components/EntityFinder/EntityIdTextField.d.ts.map +1 -0
  55. package/dist/components/EntityFinder/EntityIdTextField.js +35 -0
  56. package/dist/components/EntityFinder/EntityIdTextField.js.map +1 -0
  57. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptions.d.ts.map +1 -1
  58. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptions.js +22 -16
  59. package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptions.js.map +1 -1
  60. package/dist/components/FeaturedDataTabs/FacetPlotsCardGrid.js.map +1 -1
  61. package/dist/components/Forum/ForumThreadEditor.js.map +1 -1
  62. package/dist/components/FullWidthAlert/FullWidthAlert.d.ts.map +1 -1
  63. package/dist/components/FullWidthAlert/FullWidthAlert.js.map +1 -1
  64. package/dist/components/GenericCard/PortalDOI/PortalDOIUtils.d.ts.map +1 -1
  65. package/dist/components/GenericCard/PortalDOI/PortalDOIUtils.js.map +1 -1
  66. package/dist/components/Markdown/widget/MarkdownSynapsePlot.js.map +1 -1
  67. package/dist/components/OAuthClientAclEditor/OAuthClientAclEditor.d.ts.map +1 -1
  68. package/dist/components/OAuthClientAclEditor/OAuthClientAclEditor.js.map +1 -1
  69. package/dist/components/PortalAclEditor/PortalAclEditor.d.ts.map +1 -1
  70. package/dist/components/PortalAclEditor/PortalAclEditor.js.map +1 -1
  71. package/dist/components/PortalHomePageHeader/PortalHomePageHeader.d.ts +1 -1
  72. package/dist/components/PortalHomePageHeader/PortalHomePageHeader.d.ts.map +1 -1
  73. package/dist/components/PortalHomePageHeader/PortalHomePageHeader.js +1 -1
  74. package/dist/components/PortalHomePageHeader/PortalHomePageHeader.js.map +1 -1
  75. package/dist/components/PortalList/CreatePortalModal.d.ts.map +1 -1
  76. package/dist/components/PortalList/CreatePortalModal.js +34 -33
  77. package/dist/components/PortalList/CreatePortalModal.js.map +1 -1
  78. package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.d.ts.map +1 -1
  79. package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js.map +1 -1
  80. package/dist/components/QueryWrapperPlotNav/RowSetView.d.ts.map +1 -1
  81. package/dist/components/QueryWrapperPlotNav/RowSetView.js.map +1 -1
  82. package/dist/components/Resources/Resources.Desktop.js.map +1 -1
  83. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
  84. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.d.ts.map +1 -1
  85. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map +1 -1
  86. package/dist/components/SetBasicAccessRequirementFields/SetBasicAccessRequirementFields.d.ts.map +1 -1
  87. package/dist/components/SetBasicAccessRequirementFields/SetBasicAccessRequirementFields.js.map +1 -1
  88. package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.d.ts.map +1 -1
  89. package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js.map +1 -1
  90. package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
  91. package/dist/components/SynapsePortalBanners/SynapsePortalBanners.d.ts.map +1 -1
  92. package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js +1 -1
  93. package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js.map +1 -1
  94. package/dist/components/SynapseTable/SearchV2.js.map +1 -1
  95. package/dist/components/SynapseTable/SynapseTable.js.map +1 -1
  96. package/dist/components/SynapseTable/SynapseTableUtils.d.ts.map +1 -1
  97. package/dist/components/SynapseTable/SynapseTableUtils.js.map +1 -1
  98. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
  99. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js.map +1 -1
  100. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.d.ts.map +1 -1
  101. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
  102. package/dist/components/TanStackTable/TanStackTableUtils.js.map +1 -1
  103. package/dist/components/TextField/TextField.css +1 -1
  104. package/dist/components/TextField/TextField.d.ts +14 -3
  105. package/dist/components/TextField/TextField.d.ts.map +1 -1
  106. package/dist/components/TextField/TextField.js +41 -43
  107. package/dist/components/TextField/TextField.js.map +1 -1
  108. package/dist/components/TextField/TextField.module.js +3 -4
  109. package/dist/components/TextField/TextField.module.js.map +1 -1
  110. package/dist/components/TextField/TextField.module.scss +18 -10
  111. package/dist/components/TimelinePlot/TimelinePlotSpeciesSelector.d.ts.map +1 -1
  112. package/dist/components/TimelinePlot/TimelinePlotSpeciesSelector.js +20 -16
  113. package/dist/components/TimelinePlot/TimelinePlotSpeciesSelector.js.map +1 -1
  114. package/dist/components/UserCardList/UserCardList.d.ts.map +1 -1
  115. package/dist/components/UserCardList/UserCardList.js.map +1 -1
  116. package/dist/components/UserCardList/UserCardListGroups/UserCardListGroups.Desktop.js.map +1 -1
  117. package/dist/components/UserOrTeamBadge/useUserOrTeam.js.map +1 -1
  118. package/dist/components/UserSearchBox/UserSearchBox.d.ts.map +1 -1
  119. package/dist/components/UserSearchBox/UserSearchBox.js.map +1 -1
  120. package/dist/components/WikiMarkdownEditorButton/WikiMarkdownEditorButton.js.map +1 -1
  121. package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js.map +1 -1
  122. package/dist/components/doi/CreateOrUpdateDoiModal.js +13 -13
  123. package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
  124. package/dist/components/entity/page/title_bar/TitleBarProperties.js +23 -23
  125. package/dist/components/entity/page/title_bar/TitleBarProperties.js.map +1 -1
  126. package/dist/components/entity/page/title_bar/useGetMentions.js.map +1 -1
  127. package/dist/components/index.js +17 -17
  128. package/dist/components/styled/StyledFormControl.d.ts +15 -0
  129. package/dist/components/styled/StyledFormControl.d.ts.map +1 -1
  130. package/dist/components/styled/StyledFormControl.js +1 -0
  131. package/dist/components/styled/StyledFormControl.js.map +1 -1
  132. package/dist/components/styled/index.js +3 -3
  133. package/dist/components/utils/ConditionalWrapper.d.ts.map +1 -1
  134. package/dist/components/utils/ConditionalWrapper.js.map +1 -1
  135. package/dist/components/widgets/ElementWithTooltip.js.map +1 -1
  136. package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
  137. package/dist/components/widgets/facet-nav/FacetNavPanel.js +69 -62
  138. package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
  139. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts +1 -0
  140. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts.map +1 -1
  141. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js +27 -26
  142. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
  143. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterDropdown.d.ts +1 -0
  144. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterDropdown.d.ts.map +1 -1
  145. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterDropdown.js +2 -1
  146. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterDropdown.js.map +1 -1
  147. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts +1 -0
  148. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts.map +1 -1
  149. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js +44 -43
  150. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js.map +1 -1
  151. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts +13 -0
  152. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map +1 -0
  153. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +398 -0
  154. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -0
  155. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.d.ts.map +1 -1
  156. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js +49 -19
  157. package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js.map +1 -1
  158. package/dist/features/entity/metadata-task/components/MetadataTasksPage.d.ts.map +1 -1
  159. package/dist/features/entity/metadata-task/components/MetadataTasksPage.js +46 -25
  160. package/dist/features/entity/metadata-task/components/MetadataTasksPage.js.map +1 -1
  161. package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask.d.ts +0 -1
  162. package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask.d.ts.map +1 -1
  163. package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask.js +20 -22
  164. package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask.js.map +1 -1
  165. package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.d.ts.map +1 -1
  166. package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js +25 -27
  167. package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js.map +1 -1
  168. package/dist/features/entity/metadata-task/utils/constants.d.ts +26 -0
  169. package/dist/features/entity/metadata-task/utils/constants.d.ts.map +1 -1
  170. package/dist/features/entity/metadata-task/utils/constants.js +2 -2
  171. package/dist/features/entity/metadata-task/utils/constants.js.map +1 -1
  172. package/dist/index.js +17 -17
  173. package/dist/mockServiceWorker.js +6 -8
  174. package/dist/mocks/curation/mockCurationTask.d.ts +2 -2
  175. package/dist/mocks/curation/mockCurationTask.d.ts.map +1 -1
  176. package/dist/mocks/curation/mockCurationTask.js +9 -5
  177. package/dist/mocks/curation/mockCurationTask.js.map +1 -1
  178. package/dist/mocks/msw/handlers/featureFlagHandlers.d.ts +1 -1
  179. package/dist/mocks/msw/handlers/featureFlagHandlers.d.ts.map +1 -1
  180. package/dist/mocks/msw/handlers/featureFlagHandlers.js +1 -1
  181. package/dist/mocks/msw/handlers/featureFlagHandlers.js.map +1 -1
  182. package/dist/style/components/_cards.scss +0 -3
  183. package/dist/style/components/_data-grid-extra.scss +2 -2
  184. package/dist/style/components/_login.scss +6 -2
  185. package/dist/style/main.css +1 -1
  186. package/dist/synapse-client/SynapseClient.d.ts +2 -1
  187. package/dist/synapse-client/SynapseClient.d.ts.map +1 -1
  188. package/dist/synapse-client/SynapseClient.js.map +1 -1
  189. package/dist/synapse-queries/QueryFilterUtils.js.map +1 -1
  190. package/dist/synapse-queries/curation/task/useCurationTask.d.ts +1 -0
  191. package/dist/synapse-queries/curation/task/useCurationTask.d.ts.map +1 -1
  192. package/dist/synapse-queries/curation/task/useCurationTask.js +16 -6
  193. package/dist/synapse-queries/curation/task/useCurationTask.js.map +1 -1
  194. package/dist/synapse-queries/dataaccess/useAccessRequirements.d.ts.map +1 -1
  195. package/dist/synapse-queries/dataaccess/useAccessRequirements.js.map +1 -1
  196. package/dist/synapse-queries/entity/useGetQueryResultBundle.js.map +1 -1
  197. package/dist/synapse-queries/featureflags/useGetFeatureFlag.d.ts +1 -1
  198. package/dist/synapse-queries/featureflags/useGetFeatureFlag.d.ts.map +1 -1
  199. package/dist/synapse-queries/featureflags/useGetFeatureFlag.js.map +1 -1
  200. package/dist/synapse-queries/file/useFiles.d.ts.map +1 -1
  201. package/dist/synapse-queries/file/useFiles.js.map +1 -1
  202. package/dist/synapse-queries/termsOfService/useTermsOfService.d.ts.map +1 -1
  203. package/dist/synapse-queries/termsOfService/useTermsOfService.js.map +1 -1
  204. package/dist/synapse-queries/user/useGetUserChallenges.d.ts.map +1 -1
  205. package/dist/synapse-queries/user/useGetUserChallenges.js.map +1 -1
  206. package/dist/testutils/ReactQueryMockUtils.js.map +1 -1
  207. package/dist/theme/palette/Palettes.d.ts +2 -2
  208. package/dist/theme/palette/Palettes.d.ts.map +1 -1
  209. package/dist/theme/palette/Palettes.js +2 -2
  210. package/dist/theme/palette/Palettes.js.map +1 -1
  211. package/dist/tsconfig.build.tsbuildinfo +1 -1
  212. package/dist/types/ThemeTypes.d.ts +5 -6
  213. package/dist/utils/AppUtils/session/SynapseSessionManager.d.ts.map +1 -1
  214. package/dist/utils/AppUtils/session/SynapseSessionManager.js.map +1 -1
  215. package/dist/utils/featureflag/FeatureFlags.d.ts +12 -0
  216. package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -0
  217. package/dist/utils/featureflag/FeatureFlags.js +8 -0
  218. package/dist/utils/featureflag/FeatureFlags.js.map +1 -0
  219. package/dist/utils/functions/SanitizeHtmlUtils.js.map +1 -1
  220. package/dist/utils/functions/queryUtils.js.map +1 -1
  221. package/dist/utils/hooks/useGetInfoFromIds.d.ts.map +1 -1
  222. package/dist/utils/hooks/useGetInfoFromIds.js.map +1 -1
  223. package/dist/utils/slots/SlotUtils.d.ts.map +1 -1
  224. package/dist/utils/slots/SlotUtils.js.map +1 -1
  225. package/package.json +7 -8
@@ -1 +1 @@
1
- {"version":3,"file":"ReactQueryMockUtils.js","names":[],"sources":["../../src/testutils/ReactQueryMockUtils.ts"],"sourcesContent":["import type { InfiniteData } from '@tanstack/query-core'\nimport {\n QueryObserverLoadingResult,\n QueryObserverSuccessResult,\n UseInfiniteQueryResult,\n UseMutationResult,\n UseQueryResult,\n} from '@tanstack/react-query'\nimport type { Mock } from '@vitest/spy'\nimport { Dispatch, SetStateAction, useState } from 'react'\n\n/**\n * Returns a mock instance for useQuery, as well as functions to manipulate the mock hook's state, and\n * mocks for function(s) returned by the hook.\n *\n * Example usage:\n * ```tsx\n * const { mock, setSuccess } = getUseQueryMock<MyDataType, MyErrorType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n *\n * // ...optionally verify a loading state in your component/hook\n *\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseQueryMock<TData = unknown, TError = unknown>(): {\n mock: Mock<() => UseQueryResult<TData, TError>>\n mockRefetch: Mock\n setSuccess: (data: TData) => void\n setError: (error: TError) => void\n setLoading: () => void\n setIdle: () => void\n} {\n // Stable mock functions\n const mockRefetch = vi.fn()\n\n let currentSetValue: Dispatch<\n SetStateAction<UseQueryResult<TData, TError>>\n > | null = null\n\n const setSuccess = (data: TData) => {\n if (currentSetValue) {\n const successState: UseQueryResult<TData, TError> = {\n data: data,\n status: 'success',\n isSuccess: true,\n isPending: false,\n isLoading: false,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n refetch: mockRefetch,\n isPlaceholderData: false,\n isStale: false,\n promise: Promise.resolve(data),\n }\n\n currentSetValue(successState)\n } else {\n console.warn(\n 'setSuccess called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: 0,\n error: error,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: true,\n isFetched: false,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoadingError: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'error',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isLoading: false,\n isPending: false,\n promise: new Promise(() => {}),\n }\n\n currentSetValue(errorState)\n } else {\n console.warn(\n 'setError called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const setLoading = () => {\n if (currentSetValue) {\n const loadingState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: true,\n isLoading: true,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n failureReason: null,\n fetchStatus: 'fetching',\n isPending: true,\n isInitialLoading: true,\n isPaused: false,\n promise: new Promise(() => {}),\n }\n\n currentSetValue(loadingState)\n } else {\n console.warn(\n 'setError called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n function setIdle() {\n if (currentSetValue) {\n const idleState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: true,\n isLoading: false,\n isPending: true,\n promise: new Promise(() => {}),\n }\n currentSetValue(idleState)\n } else {\n console.warn(\n 'setIdle called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useQueryMocked() {\n const [value, setValue] = useState<UseQueryResult<TData, TError>>({\n data: undefined,\n fetchStatus: 'fetching',\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isInitialLoading: false,\n isLoading: true,\n isLoadingError: false,\n isPaused: false,\n isPending: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n promise: new Promise(() => {}),\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockRefetch: mockRefetch,\n setSuccess,\n setError,\n setLoading,\n setIdle,\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQuerySuccessMock<TData>(\n data: TData,\n): QueryObserverSuccessResult<TData, never> {\n return {\n data: data,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoading: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: true,\n refetch: vi.fn(),\n status: 'success',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isPending: false,\n promise: Promise.resolve(data),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryLoadingMock(): QueryObserverLoadingResult<\n never,\n never\n> {\n return {\n data: undefined,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: true,\n isLoading: true,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'pending',\n failureReason: null,\n fetchStatus: 'fetching',\n isPending: true,\n isInitialLoading: true,\n isPaused: false,\n promise: new Promise(() => {}),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryErrorMock<TError>(\n error: TError,\n): UseQueryResult<never, TError> {\n return {\n data: undefined,\n dataUpdatedAt: 0,\n error: error,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: true,\n isFetched: false,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoadingError: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'error',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isLoading: false,\n isPending: false,\n promise: new Promise<never>(() => {}),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryIdleMock(): UseQueryResult<never, never> {\n return {\n data: undefined,\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'pending',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: true,\n isLoading: false,\n isPending: true,\n promise: new Promise(() => {}),\n }\n}\n\n/**\n * Returns a mock instance for useMutation, as well as functions to manipulate the mock hook's state, and\n * mocks for function(s) returned by the hook.\n *\n * Example usage:\n * ```tsx\n * const { mock, setPending, setSuccess, mockMutate } = getUseMutationMockImpl<MyDataType, MyErrorType, MyVarsType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n *\n * // ...trigger the mutation using your component/hook interface, then\n * expect(mockMutate).toHaveBeenCalledWith(expectedVars);\n * act(() => { setPending(); })\n *\n * // ...verify the pending state in your component/hook, then resolve the mutation\n *\n *\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseMutationMock<\n TData = unknown,\n TError = unknown,\n TVariables = unknown,\n>(): {\n mock: Mock<() => UseMutationResult<TData, TError, TVariables>>\n mockMutate: Mock<(vars: TVariables) => void>\n mockMutateAsync: Mock<(vars: TVariables) => Promise<TData>>\n mockReset: Mock\n setSuccess: (data: TData) => void\n setError: (error: TError) => void\n setPending: () => void\n setIdle: () => void\n} {\n let currentSetValue: Dispatch<\n SetStateAction<UseMutationResult<TData, TError, TVariables>>\n > | null = null\n\n function setVars(vars: TVariables) {\n if (currentSetValue) {\n currentSetValue(\n prevState =>\n ({\n ...prevState,\n variables: vars,\n } as UseMutationResult<TData, TError, TVariables>),\n )\n } else {\n console.warn(\n 'mutate or mutateAsync called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n // Stable mock functions\n const mockMutate = vi.fn()\n const mockMutateAsync = vi.fn()\n const mockReset = vi.fn()\n const variables = (mockMutate.mock.lastCall?.[0] ??\n mockMutateAsync.mock.lastCall?.[0]) as TVariables | undefined\n\n function mutate(vars: TVariables): void {\n setVars(vars)\n mockMutate(vars)\n }\n\n function mutateAsync(vars: TVariables): Promise<TData> {\n setVars(vars)\n return mockMutateAsync(vars) as Promise<TData>\n }\n\n const setSuccess = (data: TData) => {\n if (currentSetValue) {\n const successState: UseMutationResult<TData, TError, TVariables> = {\n data: data,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: true,\n status: 'success',\n variables: variables!,\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n }\n\n currentSetValue(\n prev =>\n ({ ...successState, variables: prev.variables } as UseMutationResult<\n TData,\n TError,\n TVariables\n >),\n )\n } else {\n console.warn(\n 'setSuccess called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseMutationResult<TData, TError, TVariables> = {\n error: error,\n data: undefined,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n failureCount: 1,\n isError: true,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n status: 'error',\n variables: variables!,\n failureReason: error,\n isPending: false,\n submittedAt: 0,\n }\n\n currentSetValue(\n prev =>\n ({ ...errorState, variables: prev.variables } as UseMutationResult<\n TData,\n TError,\n TVariables\n >),\n )\n } else {\n console.warn(\n 'setError called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const setPending = () => {\n if (currentSetValue) {\n const pendingState: UseMutationResult<TData, TError, TVariables> = {\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n status: 'pending',\n failureReason: null,\n isPending: true,\n submittedAt: 0,\n variables: variables!,\n }\n\n currentSetValue(\n prev =>\n ({ ...pendingState, variables: prev.variables } as UseMutationResult<\n TData,\n TError,\n TVariables\n >),\n )\n } else {\n console.warn(\n 'setPending called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n function setIdle() {\n if (currentSetValue) {\n const idleState: UseMutationResult<TData, TError, TVariables> = {\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n variables: undefined,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n status: 'idle',\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n }\n currentSetValue(idleState)\n } else {\n console.warn(\n 'setIdle called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useMutationMocked() {\n const [value, setValue] = useState<\n UseMutationResult<TData, TError, TVariables>\n >({\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n variables: undefined,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n status: 'idle',\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockMutate,\n mockMutateAsync,\n mockReset,\n setSuccess,\n setError,\n setPending,\n setIdle,\n }\n}\n\n/**\n * @deprecated Use {@link getUseMutationMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseMutationIdleMock<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TError = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TVariables = any,\n>(data?: TData) {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n mutate: vi.fn(),\n mutateAsync: vi.fn().mockResolvedValue(data),\n reset: vi.fn(),\n status: 'idle',\n variables: undefined,\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n } satisfies UseMutationResult<TData, TError, TVariables>\n}\n\n/**\n * @deprecated Use {@link getUseMutationMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseMutationPendingMock<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TError = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TVariables = any,\n>(data?: TData, variables?: TVariables) {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n mutate: vi.fn(),\n mutateAsync: vi.fn().mockResolvedValue(data),\n reset: vi.fn(),\n status: 'pending',\n variables: variables!,\n failureReason: null,\n isPending: true,\n submittedAt: 0,\n } satisfies UseMutationResult<TData, TError, TVariables>\n}\n\n/**\n * @deprecated Use {@link getUseInfiniteQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseInfiniteQuerySuccessMock<TData>(\n pages: TData[],\n hasNextPage = false,\n): UseInfiniteQueryResult<{ pages: TData[] }, never> {\n return {\n data: {\n pages: pages,\n },\n error: null,\n isError: false,\n isPending: false,\n isLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isSuccess: true,\n status: 'success',\n fetchNextPage: vi.fn(),\n fetchPreviousPage: vi.fn(),\n hasNextPage: hasNextPage,\n hasPreviousPage: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n dataUpdatedAt: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n errorUpdateCount: 0,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isInitialLoading: false,\n isPaused: false,\n isPlaceholderData: false,\n isRefetching: false,\n isStale: false,\n refetch: vi.fn(),\n fetchStatus: 'idle',\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: Promise.resolve({ pages }),\n } satisfies UseInfiniteQueryResult<{ pages: TData[] }, never>\n}\n\n/**\n * Returns a mock instance for useInfiniteQuery, as well as functions to manipulate the mock hook's state, and\n * mock functions for fetchNextPage, fetchPreviousPage, and refetch.\n *\n * Example usage:\n * ```tsx\n * const { mock, setSuccess } = getUseInfiniteQueryMock<MyDataType, MyErrorType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseInfiniteQueryMock<TData = unknown, TError = unknown>(): {\n mock: Mock<() => UseInfiniteQueryResult<InfiniteData<TData>, TError>>\n mockFetchNextPage: Mock\n setSuccess: (\n data: TData[],\n hasNextPage?: boolean,\n isFetchingNextPage?: boolean,\n ) => void\n setError: (error: TError) => void\n setLoading: () => void\n} {\n // Stable mock functions\n const mockFetchNextPage = vi.fn()\n const mockFetchPreviousPage = vi.fn()\n const mockRefetch = vi.fn()\n\n let currentSetValue: Dispatch<\n SetStateAction<UseInfiniteQueryResult<InfiniteData<TData>, TError>>\n > | null = null\n\n const setSuccess = (\n data: TData[],\n hasNextPage = false,\n isFetchingNextPage = false,\n ) => {\n if (currentSetValue) {\n const successState: UseInfiniteQueryResult<\n InfiniteData<TData>,\n TError\n > = {\n data: { pages: data, pageParams: [] },\n hasNextPage: hasNextPage,\n status: 'success',\n isSuccess: true,\n isPending: false,\n isLoading: false,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: isFetchingNextPage ? 'fetching' : 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: isFetchingNextPage,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchPreviousPageError: false,\n isFetchNextPageError: false,\n promise: Promise.resolve({ pages: data, pageParams: [] }),\n }\n currentSetValue(successState)\n } else {\n console.warn(\n 'setSuccess called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseInfiniteQueryResult<InfiniteData<TData>, TError> = {\n data: undefined,\n hasNextPage: false,\n status: 'error',\n isSuccess: false,\n isPending: false,\n isLoading: false,\n isError: true,\n error: error,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: true,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n }\n currentSetValue(errorState)\n } else {\n console.warn(\n 'setError called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const setLoading = () => {\n if (currentSetValue) {\n const loadingState: UseInfiniteQueryResult<\n InfiniteData<TData>,\n TError\n > = {\n data: undefined,\n hasNextPage: false,\n status: 'pending',\n isSuccess: false,\n isPending: true,\n isLoading: true,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'fetching',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: true,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n }\n currentSetValue(loadingState)\n } else {\n console.warn(\n 'setError called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useMockInfiniteQuery() {\n const [value, setValue] = useState<\n UseInfiniteQueryResult<InfiniteData<TData>, TError>\n >({\n data: undefined,\n fetchStatus: 'fetching',\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n hasNextPage: false,\n hasPreviousPage: false,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n isInitialLoading: false,\n isLoading: true,\n isLoadingError: false,\n isPaused: false,\n isPending: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockFetchNextPage: mockFetchNextPage,\n setSuccess,\n setError,\n setLoading,\n }\n}\n"],"mappings":";;AA4BA,SAAgB,IAOd;CAEA,IAAM,IAAc,GAAG,IAAI,EAEvB,IAEO,MAEL,KAAc,MAAgB;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SAAS;KACT,sBAAsB;KACtB,0BAA0B;KAC1B,SAAS,IAAI,cAAc,GAAG;KAC/B;AACD,MAAgB,EAAW;SAE3B,SAAQ,KACN,qFACD;;EAoGH,kBAhGuB;AACvB,OAAI,GAAiB;IACnB,IAAM,IAGF;KACF,MAAM,KAAA;KACN,aAAa;KACb,QAAQ;KACR,WAAW;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,OAAO;KACP,WAAW;KACX,qBAAqB;KACrB,YAAY;KACZ,kBAAkB;KAClB,gBAAgB;KAChB,gBAAgB;KAChB,cAAc;KACd,aAAa;KACb,UAAU;KACV,eAAe,KAAK,KAAK;KACzB,gBAAgB;KAChB,kBAAkB;KAClB,cAAc;KACd,eAAe;KACf,eAAe;KACf,mBAAmB;KACnB,SAAS;KACT,iBAAiB;KACjB,oBAAoB;KACpB,wBAAwB;KACxB,mBAAmB;KACnB,SAAS;KACT,sBAAsB;KACtB,0BAA0B;KAC1B,SAAS,IAAI,cAAc,GAAG;KAC/B;AACD,MAAgB,EAAa;SAE7B,SAAQ,KACN,qFACD;;EAqDJ"}
1
+ {"version":3,"file":"ReactQueryMockUtils.js","names":[],"sources":["../../src/testutils/ReactQueryMockUtils.ts"],"sourcesContent":["import type { InfiniteData } from '@tanstack/query-core'\nimport {\n QueryObserverLoadingResult,\n QueryObserverSuccessResult,\n UseInfiniteQueryResult,\n UseMutationResult,\n UseQueryResult,\n} from '@tanstack/react-query'\nimport type { Mock } from '@vitest/spy'\nimport { Dispatch, SetStateAction, useState } from 'react'\n\n/**\n * Returns a mock instance for useQuery, as well as functions to manipulate the mock hook's state, and\n * mocks for function(s) returned by the hook.\n *\n * Example usage:\n * ```tsx\n * const { mock, setSuccess } = getUseQueryMock<MyDataType, MyErrorType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n *\n * // ...optionally verify a loading state in your component/hook\n *\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseQueryMock<TData = unknown, TError = unknown>(): {\n mock: Mock<() => UseQueryResult<TData, TError>>\n mockRefetch: Mock\n setSuccess: (data: TData) => void\n setError: (error: TError) => void\n setLoading: () => void\n setIdle: () => void\n} {\n // Stable mock functions\n const mockRefetch = vi.fn()\n\n let currentSetValue: Dispatch<\n SetStateAction<UseQueryResult<TData, TError>>\n > | null = null\n\n const setSuccess = (data: TData) => {\n if (currentSetValue) {\n const successState: UseQueryResult<TData, TError> = {\n data: data,\n status: 'success',\n isSuccess: true,\n isPending: false,\n isLoading: false,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n refetch: mockRefetch,\n isPlaceholderData: false,\n isStale: false,\n promise: Promise.resolve(data),\n }\n\n currentSetValue(successState)\n } else {\n console.warn(\n 'setSuccess called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: 0,\n error: error,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: true,\n isFetched: false,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoadingError: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'error',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isLoading: false,\n isPending: false,\n promise: new Promise(() => {}),\n }\n\n currentSetValue(errorState)\n } else {\n console.warn(\n 'setError called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const setLoading = () => {\n if (currentSetValue) {\n const loadingState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: true,\n isLoading: true,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n failureReason: null,\n fetchStatus: 'fetching',\n isPending: true,\n isInitialLoading: true,\n isPaused: false,\n promise: new Promise(() => {}),\n }\n\n currentSetValue(loadingState)\n } else {\n console.warn(\n 'setError called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n function setIdle() {\n if (currentSetValue) {\n const idleState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: true,\n isLoading: false,\n isPending: true,\n promise: new Promise(() => {}),\n }\n currentSetValue(idleState)\n } else {\n console.warn(\n 'setIdle called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useQueryMocked() {\n const [value, setValue] = useState<UseQueryResult<TData, TError>>({\n data: undefined,\n fetchStatus: 'fetching',\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isInitialLoading: false,\n isLoading: true,\n isLoadingError: false,\n isPaused: false,\n isPending: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n promise: new Promise(() => {}),\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockRefetch: mockRefetch,\n setSuccess,\n setError,\n setLoading,\n setIdle,\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQuerySuccessMock<TData>(\n data: TData,\n): QueryObserverSuccessResult<TData, never> {\n return {\n data: data,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoading: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: true,\n refetch: vi.fn(),\n status: 'success',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isPending: false,\n promise: Promise.resolve(data),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryLoadingMock(): QueryObserverLoadingResult<\n never,\n never\n> {\n return {\n data: undefined,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: true,\n isLoading: true,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'pending',\n failureReason: null,\n fetchStatus: 'fetching',\n isPending: true,\n isInitialLoading: true,\n isPaused: false,\n promise: new Promise(() => {}),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryErrorMock<TError>(\n error: TError,\n): UseQueryResult<never, TError> {\n return {\n data: undefined,\n dataUpdatedAt: 0,\n error: error,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: true,\n isFetched: false,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoadingError: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'error',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isLoading: false,\n isPending: false,\n promise: new Promise<never>(() => {}),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryIdleMock(): UseQueryResult<never, never> {\n return {\n data: undefined,\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'pending',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: true,\n isLoading: false,\n isPending: true,\n promise: new Promise(() => {}),\n }\n}\n\n/**\n * Returns a mock instance for useMutation, as well as functions to manipulate the mock hook's state, and\n * mocks for function(s) returned by the hook.\n *\n * Example usage:\n * ```tsx\n * const { mock, setPending, setSuccess, mockMutate } = getUseMutationMockImpl<MyDataType, MyErrorType, MyVarsType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n *\n * // ...trigger the mutation using your component/hook interface, then\n * expect(mockMutate).toHaveBeenCalledWith(expectedVars);\n * act(() => { setPending(); })\n *\n * // ...verify the pending state in your component/hook, then resolve the mutation\n *\n *\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseMutationMock<\n TData = unknown,\n TError = unknown,\n TVariables = unknown,\n>(): {\n mock: Mock<() => UseMutationResult<TData, TError, TVariables>>\n mockMutate: Mock<(vars: TVariables) => void>\n mockMutateAsync: Mock<(vars: TVariables) => Promise<TData>>\n mockReset: Mock\n setSuccess: (data: TData) => void\n setError: (error: TError) => void\n setPending: () => void\n setIdle: () => void\n} {\n let currentSetValue: Dispatch<\n SetStateAction<UseMutationResult<TData, TError, TVariables>>\n > | null = null\n\n function setVars(vars: TVariables) {\n if (currentSetValue) {\n currentSetValue(\n prevState =>\n ({\n ...prevState,\n variables: vars,\n }) as UseMutationResult<TData, TError, TVariables>,\n )\n } else {\n console.warn(\n 'mutate or mutateAsync called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n // Stable mock functions\n const mockMutate = vi.fn()\n const mockMutateAsync = vi.fn()\n const mockReset = vi.fn()\n const variables = (mockMutate.mock.lastCall?.[0] ??\n mockMutateAsync.mock.lastCall?.[0]) as TVariables | undefined\n\n function mutate(vars: TVariables): void {\n setVars(vars)\n mockMutate(vars)\n }\n\n function mutateAsync(vars: TVariables): Promise<TData> {\n setVars(vars)\n return mockMutateAsync(vars) as Promise<TData>\n }\n\n const setSuccess = (data: TData) => {\n if (currentSetValue) {\n const successState: UseMutationResult<TData, TError, TVariables> = {\n data: data,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: true,\n status: 'success',\n variables: variables!,\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n }\n\n currentSetValue(\n prev =>\n ({ ...successState, variables: prev.variables }) as UseMutationResult<\n TData,\n TError,\n TVariables\n >,\n )\n } else {\n console.warn(\n 'setSuccess called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseMutationResult<TData, TError, TVariables> = {\n error: error,\n data: undefined,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n failureCount: 1,\n isError: true,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n status: 'error',\n variables: variables!,\n failureReason: error,\n isPending: false,\n submittedAt: 0,\n }\n\n currentSetValue(\n prev =>\n ({ ...errorState, variables: prev.variables }) as UseMutationResult<\n TData,\n TError,\n TVariables\n >,\n )\n } else {\n console.warn(\n 'setError called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const setPending = () => {\n if (currentSetValue) {\n const pendingState: UseMutationResult<TData, TError, TVariables> = {\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n status: 'pending',\n failureReason: null,\n isPending: true,\n submittedAt: 0,\n variables: variables!,\n }\n\n currentSetValue(\n prev =>\n ({ ...pendingState, variables: prev.variables }) as UseMutationResult<\n TData,\n TError,\n TVariables\n >,\n )\n } else {\n console.warn(\n 'setPending called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n function setIdle() {\n if (currentSetValue) {\n const idleState: UseMutationResult<TData, TError, TVariables> = {\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n variables: undefined,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n status: 'idle',\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n }\n currentSetValue(idleState)\n } else {\n console.warn(\n 'setIdle called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useMutationMocked() {\n const [value, setValue] = useState<\n UseMutationResult<TData, TError, TVariables>\n >({\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n variables: undefined,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n status: 'idle',\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockMutate,\n mockMutateAsync,\n mockReset,\n setSuccess,\n setError,\n setPending,\n setIdle,\n }\n}\n\n/**\n * @deprecated Use {@link getUseMutationMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseMutationIdleMock<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TError = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TVariables = any,\n>(data?: TData) {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n mutate: vi.fn(),\n mutateAsync: vi.fn().mockResolvedValue(data),\n reset: vi.fn(),\n status: 'idle',\n variables: undefined,\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n } satisfies UseMutationResult<TData, TError, TVariables>\n}\n\n/**\n * @deprecated Use {@link getUseMutationMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseMutationPendingMock<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TError = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TVariables = any,\n>(data?: TData, variables?: TVariables) {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n mutate: vi.fn(),\n mutateAsync: vi.fn().mockResolvedValue(data),\n reset: vi.fn(),\n status: 'pending',\n variables: variables!,\n failureReason: null,\n isPending: true,\n submittedAt: 0,\n } satisfies UseMutationResult<TData, TError, TVariables>\n}\n\n/**\n * @deprecated Use {@link getUseInfiniteQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseInfiniteQuerySuccessMock<TData>(\n pages: TData[],\n hasNextPage = false,\n): UseInfiniteQueryResult<{ pages: TData[] }, never> {\n return {\n data: {\n pages: pages,\n },\n error: null,\n isError: false,\n isPending: false,\n isLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isSuccess: true,\n status: 'success',\n fetchNextPage: vi.fn(),\n fetchPreviousPage: vi.fn(),\n hasNextPage: hasNextPage,\n hasPreviousPage: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n dataUpdatedAt: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n errorUpdateCount: 0,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isInitialLoading: false,\n isPaused: false,\n isPlaceholderData: false,\n isRefetching: false,\n isStale: false,\n refetch: vi.fn(),\n fetchStatus: 'idle',\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: Promise.resolve({ pages }),\n } satisfies UseInfiniteQueryResult<{ pages: TData[] }, never>\n}\n\n/**\n * Returns a mock instance for useInfiniteQuery, as well as functions to manipulate the mock hook's state, and\n * mock functions for fetchNextPage, fetchPreviousPage, and refetch.\n *\n * Example usage:\n * ```tsx\n * const { mock, setSuccess } = getUseInfiniteQueryMock<MyDataType, MyErrorType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseInfiniteQueryMock<TData = unknown, TError = unknown>(): {\n mock: Mock<() => UseInfiniteQueryResult<InfiniteData<TData>, TError>>\n mockFetchNextPage: Mock\n setSuccess: (\n data: TData[],\n hasNextPage?: boolean,\n isFetchingNextPage?: boolean,\n ) => void\n setError: (error: TError) => void\n setLoading: () => void\n} {\n // Stable mock functions\n const mockFetchNextPage = vi.fn()\n const mockFetchPreviousPage = vi.fn()\n const mockRefetch = vi.fn()\n\n let currentSetValue: Dispatch<\n SetStateAction<UseInfiniteQueryResult<InfiniteData<TData>, TError>>\n > | null = null\n\n const setSuccess = (\n data: TData[],\n hasNextPage = false,\n isFetchingNextPage = false,\n ) => {\n if (currentSetValue) {\n const successState: UseInfiniteQueryResult<\n InfiniteData<TData>,\n TError\n > = {\n data: { pages: data, pageParams: [] },\n hasNextPage: hasNextPage,\n status: 'success',\n isSuccess: true,\n isPending: false,\n isLoading: false,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: isFetchingNextPage ? 'fetching' : 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: isFetchingNextPage,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchPreviousPageError: false,\n isFetchNextPageError: false,\n promise: Promise.resolve({ pages: data, pageParams: [] }),\n }\n currentSetValue(successState)\n } else {\n console.warn(\n 'setSuccess called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseInfiniteQueryResult<InfiniteData<TData>, TError> = {\n data: undefined,\n hasNextPage: false,\n status: 'error',\n isSuccess: false,\n isPending: false,\n isLoading: false,\n isError: true,\n error: error,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: true,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n }\n currentSetValue(errorState)\n } else {\n console.warn(\n 'setError called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const setLoading = () => {\n if (currentSetValue) {\n const loadingState: UseInfiniteQueryResult<\n InfiniteData<TData>,\n TError\n > = {\n data: undefined,\n hasNextPage: false,\n status: 'pending',\n isSuccess: false,\n isPending: true,\n isLoading: true,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'fetching',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: true,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n }\n currentSetValue(loadingState)\n } else {\n console.warn(\n 'setError called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useMockInfiniteQuery() {\n const [value, setValue] = useState<\n UseInfiniteQueryResult<InfiniteData<TData>, TError>\n >({\n data: undefined,\n fetchStatus: 'fetching',\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n hasNextPage: false,\n hasPreviousPage: false,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n isInitialLoading: false,\n isLoading: true,\n isLoadingError: false,\n isPaused: false,\n isPending: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockFetchNextPage: mockFetchNextPage,\n set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B;KAClB,cAAc;KACd,eAAe;KACf,eAAe;KACf,mBAAmB;KACnB,SAAS;KACT,iBAAiB;KACjB,oBAAoB;KACpB,wBAAwB;KACxB,mBAAmB;KACnB,SAAS;KACT,sBAAsB;KACtB,0BAA0B;KAC1B,SAAS,IAAI,cAAc,GAAG;KAC/B;AACD,MAAgB,EAAW;SAE3B,SAAQ,KACN,qFACD;;EAoGH,kBAhGuB;AACvB,OAAI,GAAiB;IACnB,IAAM,IAGF;KACF,MAAM,KAAA;KACN,aAAa;KACb,QAAQ;KACR,WAAW;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,OAAO;KACP,WAAW;KACX,qBAAqB;KACrB,YAAY;KACZ,kBAAkB;KAClB,gBAAgB;KAChB,gBAAgB;KAChB,cAAc;KACd,aAAa;KACb,UAAU;KACV,eAAe,KAAK,KAAK;KACzB,gBAAgB;KAChB,kBAAkB;KAClB,cAAc;KACd,eAAe;KACf,eAAe;KACf,mBAAmB;KACnB,SAAS;KACT,iBAAiB;KACjB,oBAAoB;KACpB,wBAAwB;KACxB,mBAAmB;KACnB,SAAS;KACT,sBAAsB;KACtB,0BAA0B;KAC1B,SAAS,IAAI,cAAc,GAAG;KAC/B;AACD,MAAgB,EAAa;SAE7B,SAAQ,KACN,qFACD;;EAqDJ"}
@@ -9,7 +9,7 @@ export declare const mtbPalette: PaletteOptions;
9
9
  export declare const arkPortalPalette: PaletteOptions;
10
10
  export declare const adKnowledgePortalPalette: PaletteOptions;
11
11
  export declare const elPortalPalette: PaletteOptions;
12
- export declare const namshubPortalPalette: PaletteOptions;
12
+ export declare const namhubPortalPalette: PaletteOptions;
13
13
  export declare const nfPortalPalette: PaletteOptions;
14
14
  export declare const bsmnPortalPalette: PaletteOptions;
15
15
  export declare const stopAdPortalPalette: PaletteOptions;
@@ -43,7 +43,7 @@ declare const _default: {
43
43
  ampalsPalette: PaletteOptions;
44
44
  classicPalette: PaletteOptions;
45
45
  arcusbioPalette: PaletteOptions;
46
- namshubPortalPalette: PaletteOptions;
46
+ namhubPortalPalette: PaletteOptions;
47
47
  };
48
48
  export default _default;
49
49
  //# sourceMappingURL=Palettes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Palettes.d.ts","sourceRoot":"","sources":["../../../src/theme/palette/Palettes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,SAAS,MAAM,YAAY,CAAA;AAElC,eAAO,MAAM,eAAe,GAC1B,WAAW,SAAS,CAAC,UAAU,EAC/B,iBAAiB,mBAAmB,KACnC,mBAqBF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,cA+DrB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,cAIxB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,cAI9B,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,cAItC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,cAI7B,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,cAIlC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,cAI7B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,cAI/B,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,cAIjC,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,cAIxC,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,cAIxC,CAAA;AAED,eAAO,MAAM,6BAA6B,EAAE,cAI3C,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,cAIpC,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,cAIpC,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,cAI1B,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,cAIpC,CAAA;AACD,eAAO,MAAM,aAAa,EAAE,cAI3B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,cAI5B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,cAI7B,CAAA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Y,SAAS,CAAC,UAAU,mBACd,mBAAmB,KACnC,mBAAmB;;;;;;;;;;;;;;;;;;;;AAsMtB,wBAqBC"}
@@ -181,9 +181,9 @@ var t = (t, n) => ({
181
181
  ampalsPalette: v,
182
182
  classicPalette: y,
183
183
  arcusbioPalette: b,
184
- namshubPortalPalette: s
184
+ namhubPortalPalette: s
185
185
  };
186
186
  //#endregion
187
- export { a as adKnowledgePortalPalette, v as ampalsPalette, b as arcusbioPalette, i as arkPortalPalette, l as bsmnPortalPalette, p as cancerComplexityPortalPalette, h as challengePortalPalette, y as classicPalette, f as crcResearcherPortalPalette, x as default, d as digitalHealthPortalPalette, o as elPortalPalette, t as generatePalette, g as geniePalette, r as mtbPalette, s as namshubPortalPalette, c as nfPortalPalette, n as palette, m as sageBionetworksPalette, _ as standardsPortalPalette, u as stopAdPortalPalette };
187
+ export { a as adKnowledgePortalPalette, v as ampalsPalette, b as arcusbioPalette, i as arkPortalPalette, l as bsmnPortalPalette, p as cancerComplexityPortalPalette, h as challengePortalPalette, y as classicPalette, f as crcResearcherPortalPalette, x as default, d as digitalHealthPortalPalette, o as elPortalPalette, t as generatePalette, g as geniePalette, r as mtbPalette, s as namhubPortalPalette, c as nfPortalPalette, n as palette, m as sageBionetworksPalette, _ as standardsPortalPalette, u as stopAdPortalPalette };
188
188
 
189
189
  //# sourceMappingURL=Palettes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Palettes.js","names":[],"sources":["../../../src/theme/palette/Palettes.ts"],"sourcesContent":["import { PaletteColorOptions, PaletteOptions } from '@mui/material/styles'\nimport tinycolor from 'tinycolor2'\n\nexport const generatePalette = (\n mainColor: tinycolor.ColorInput,\n specificColors?: PaletteColorOptions,\n): PaletteColorOptions => {\n return {\n 100: tinycolor(mainColor).desaturate(25).lighten(50).toString(),\n 200: tinycolor(mainColor).desaturate(13).lighten(20).toString(),\n 300: tinycolor(mainColor).desaturate(3).lighten(10).toString(),\n 400: tinycolor(mainColor).desaturate(1).lighten(5).toString(),\n 500: tinycolor(mainColor).toString(),\n 600: tinycolor(mainColor).saturate(5).darken(4).toString(),\n 700: tinycolor(mainColor).saturate(11).darken(8).toString(),\n 800: tinycolor(mainColor).saturate(18).darken(10).toString(),\n 900: tinycolor(mainColor).saturate(24).darken(18).toString(),\n light:\n (specificColors && 400 in specificColors && specificColors[400]) ||\n tinycolor(mainColor).desaturate(1).lighten(5).toString(), // 400\n main: tinycolor(mainColor).toString(), // 500\n dark:\n (specificColors && 600 in specificColors && specificColors[600]) ||\n tinycolor(mainColor).saturate(5).darken(4).toString(), // 600\n contrastText: '#fff',\n ...specificColors,\n }\n}\n\n/**\n * Default colors here match the default colors in _variables.scss. We now have a single point of control\n */\nexport const palette: PaletteOptions = {\n primary: generatePalette('#395979', {\n 100: '#d7dee4',\n 200: '#b0bdc9',\n 300: '#889baf',\n 400: '#617a94',\n 500: '#395979',\n 600: '#2e4761',\n 700: '#223549',\n 800: '#172430',\n 900: '#0b1218',\n }),\n secondary: generatePalette('#469285', {\n 100: '#dae9e7',\n 200: '#b5d3ce',\n 300: '#90beb6',\n 400: '#6ba89d',\n 500: '#469285',\n 600: '#38756a',\n 700: '#2a6960',\n 800: '#1c3a35',\n 900: '#0e1d1b',\n }),\n tertiary: generatePalette('#EDC766', {\n 100: '#fbf4e0',\n 200: '#f8e9c2',\n 300: '#f4dda3',\n 400: '#f1d285',\n 500: '#edc766',\n 600: '#be9f52',\n 700: '#8e773d',\n 800: '#5f5029',\n 900: '#2f2814',\n }),\n grey: {\n 1000: '#22252a',\n 900: '#353a3f',\n 800: '#4a5056',\n 700: '#71767F',\n 600: '#aeb5bc',\n 500: '#d0d4d9',\n 400: '#dfe2e6',\n 300: '#eaecee',\n 200: '#f1f3f5',\n 100: '#fbfbfc',\n },\n // The neutral palette can be used to color components like buttons in grayscale\n neutral: generatePalette('#71767F'), // grey-700\n darkPrimary: generatePalette('#164B6E'),\n lightPrimary: { ...generatePalette('#f8f9fa'), contrastText: '#164B6E' },\n light: { ...generatePalette('#f8f9fa'), contrastText: '#22252a' }, // grey-1000\n success: { main: '#32a330', contrastText: '#ffffff' },\n info: { main: '#017fa5' },\n warning: { main: '#cc9f00' },\n error: { main: '#c13415' },\n text: {\n primary: '#353a3f', // gray-900\n secondary: '#4a5056', // gray-800\n },\n // Set a minimum contrast of at least 4.5:1 as defined in WCAG 2.1 Rule 1.4.3.\n // https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html.\n // But the contrast text color is currently not updated when the colors are: https://github.com/mui/material-ui/issues/35895\n contrastThreshold: 4.5,\n}\n\nexport const mtbPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#4F527D'),\n secondary: generatePalette('#9499C7'),\n}\n\nexport const arkPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#e79776'),\n secondary: generatePalette('#e79776'),\n}\n\nexport const adKnowledgePortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#4d5491'),\n secondary: generatePalette('#2f8e94'),\n}\n\nexport const elPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#39AC97'),\n secondary: generatePalette('#39AC97'),\n}\n\nexport const namshubPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#526BB6'),\n secondary: generatePalette('#526BB6'),\n}\n\nexport const nfPortalPalette: PaletteOptions = {\n ...palette,\n primary: { ...generatePalette('#125e81'), contrastText: '#fff' },\n secondary: { ...generatePalette('#404b63'), contrastText: '#fff' },\n}\n\nexport const bsmnPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#00255c'),\n secondary: generatePalette('#2699a7'),\n}\n\nexport const stopAdPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#4d5491'),\n secondary: generatePalette('#4d5491'),\n}\n\nexport const digitalHealthPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#3e7293'),\n secondary: generatePalette('#164767'),\n}\n\nexport const crcResearcherPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#0085ff'),\n secondary: generatePalette('#0085ff'),\n}\n\nexport const cancerComplexityPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#38568e'),\n secondary: generatePalette('#47337d'),\n}\n\nexport const sageBionetworksPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#24AB9F'),\n secondary: generatePalette('#F5B33C'),\n}\n\nexport const challengePortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#407BA0'),\n secondary: generatePalette('#407BA0'),\n}\n\nexport const geniePalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#26881F'),\n secondary: generatePalette('#26881F'),\n}\n\nexport const standardsPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#395979'),\n secondary: generatePalette('#395979'),\n}\nexport const ampalsPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#2360A6'),\n secondary: generatePalette('#2360A6'),\n}\n\nexport const classicPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#098169'),\n secondary: generatePalette('#098169'),\n}\n\nexport const arcusbioPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#252861'),\n secondary: generatePalette('#252861'),\n}\n\nexport default {\n palette,\n generatePalette,\n adKnowledgePortalPalette,\n mtbPalette,\n arkPortalPalette,\n challengePortalPalette,\n elPortalPalette,\n nfPortalPalette,\n bsmnPortalPalette,\n stopAdPortalPalette,\n digitalHealthPortalPalette,\n crcResearcherPortalPalette,\n cancerComplexityPortalPalette,\n sageBionetworksPalette,\n geniePalette,\n standardsPortalPalette,\n ampalsPalette,\n classicPalette,\n arcusbioPalette,\n namshubPortalPalette,\n}\n"],"mappings":";;AAGA,IAAa,KACX,GACA,OAEO;CACL,KAAK,EAAU,EAAU,CAAC,WAAW,GAAG,CAAC,QAAQ,GAAG,CAAC,UAAU;CAC/D,KAAK,EAAU,EAAU,CAAC,WAAW,GAAG,CAAC,QAAQ,GAAG,CAAC,UAAU;CAC/D,KAAK,EAAU,EAAU,CAAC,WAAW,EAAE,CAAC,QAAQ,G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tC,EAEY,IAAgD;CAC3D,GAAG;CACH,SAAS,EAAgB,UAAU;CACnC,WAAW,EAAgB,UAAU;CACtC,EAEY,IAAyC;CACpD,GAAG;CACH,SAAS,EAAgB,UAAU;CACnC,WAAW,EAAgB,UAAU;CACtC,EAEY,IAAyC;CACpD,GAAG;CACH,SAAS,EAAgB,UAAU;CACnC,WAAW,EAAgB,UAAU;CACtC,EAEY,IAA+B;CAC1C,GAAG;CACH,SAAS,EAAgB,UAAU;CACnC,WAAW,EAAgB,UAAU;CACtC,EAEY,IAAyC;CACpD,GAAG;CACH,SAAS,EAAgB,UAAU;CACnC,WAAW,EAAgB,UAAU;CACtC,EACY,IAAgC;CAC3C,GAAG;CACH,SAAS,EAAgB,UAAU;CACnC,WAAW,EAAgB,UAAU;CACtC,EAEY,IAAiC;CAC5C,GAAG;CACH,SAAS,EAAgB,UAAU;CACnC,WAAW,EAAgB,UAAU;CACtC,EAEY,IAAkC;CAC7C,GAAG;CACH,SAAS,EAAgB,UAAU;CACnC,WAAW,EAAgB,UAAU;CACtC,EAED,IAAe;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
1
+ {"version":3,"file":"Palettes.js","names":[],"sources":["../../../src/theme/palette/Palettes.ts"],"sourcesContent":["import { PaletteColorOptions, PaletteOptions } from '@mui/material/styles'\nimport tinycolor from 'tinycolor2'\n\nexport const generatePalette = (\n mainColor: tinycolor.ColorInput,\n specificColors?: PaletteColorOptions,\n): PaletteColorOptions => {\n return {\n 100: tinycolor(mainColor).desaturate(25).lighten(50).toString(),\n 200: tinycolor(mainColor).desaturate(13).lighten(20).toString(),\n 300: tinycolor(mainColor).desaturate(3).lighten(10).toString(),\n 400: tinycolor(mainColor).desaturate(1).lighten(5).toString(),\n 500: tinycolor(mainColor).toString(),\n 600: tinycolor(mainColor).saturate(5).darken(4).toString(),\n 700: tinycolor(mainColor).saturate(11).darken(8).toString(),\n 800: tinycolor(mainColor).saturate(18).darken(10).toString(),\n 900: tinycolor(mainColor).saturate(24).darken(18).toString(),\n light:\n (specificColors && 400 in specificColors && specificColors[400]) ||\n tinycolor(mainColor).desaturate(1).lighten(5).toString(), // 400\n main: tinycolor(mainColor).toString(), // 500\n dark:\n (specificColors && 600 in specificColors && specificColors[600]) ||\n tinycolor(mainColor).saturate(5).darken(4).toString(), // 600\n contrastText: '#fff',\n ...specificColors,\n }\n}\n\n/**\n * Default colors here match the default colors in _variables.scss. We now have a single point of control\n */\nexport const palette: PaletteOptions = {\n primary: generatePalette('#395979', {\n 100: '#d7dee4',\n 200: '#b0bdc9',\n 300: '#889baf',\n 400: '#617a94',\n 500: '#395979',\n 600: '#2e4761',\n 700: '#223549',\n 800: '#172430',\n 900: '#0b1218',\n }),\n secondary: generatePalette('#469285', {\n 100: '#dae9e7',\n 200: '#b5d3ce',\n 300: '#90beb6',\n 400: '#6ba89d',\n 500: '#469285',\n 600: '#38756a',\n 700: '#2a6960',\n 800: '#1c3a35',\n 900: '#0e1d1b',\n }),\n tertiary: generatePalette('#EDC766', {\n 100: '#fbf4e0',\n 200: '#f8e9c2',\n 300: '#f4dda3',\n 400: '#f1d285',\n 500: '#edc766',\n 600: '#be9f52',\n 700: '#8e773d',\n 800: '#5f5029',\n 900: '#2f2814',\n }),\n grey: {\n 1000: '#22252a',\n 900: '#353a3f',\n 800: '#4a5056',\n 700: '#71767F',\n 600: '#aeb5bc',\n 500: '#d0d4d9',\n 400: '#dfe2e6',\n 300: '#eaecee',\n 200: '#f1f3f5',\n 100: '#fbfbfc',\n },\n // The neutral palette can be used to color components like buttons in grayscale\n neutral: generatePalette('#71767F'), // grey-700\n darkPrimary: generatePalette('#164B6E'),\n lightPrimary: { ...generatePalette('#f8f9fa'), contrastText: '#164B6E' },\n light: { ...generatePalette('#f8f9fa'), contrastText: '#22252a' }, // grey-1000\n success: { main: '#32a330', contrastText: '#ffffff' },\n info: { main: '#017fa5' },\n warning: { main: '#cc9f00' },\n error: { main: '#c13415' },\n text: {\n primary: '#353a3f', // gray-900\n secondary: '#4a5056', // gray-800\n },\n // Set a minimum contrast of at least 4.5:1 as defined in WCAG 2.1 Rule 1.4.3.\n // https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html.\n // But the contrast text color is currently not updated when the colors are: https://github.com/mui/material-ui/issues/35895\n contrastThreshold: 4.5,\n}\n\nexport const mtbPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#4F527D'),\n secondary: generatePalette('#9499C7'),\n}\n\nexport const arkPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#e79776'),\n secondary: generatePalette('#e79776'),\n}\n\nexport const adKnowledgePortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#4d5491'),\n secondary: generatePalette('#2f8e94'),\n}\n\nexport const elPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#39AC97'),\n secondary: generatePalette('#39AC97'),\n}\n\nexport const namhubPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#526BB6'),\n secondary: generatePalette('#526BB6'),\n}\n\nexport const nfPortalPalette: PaletteOptions = {\n ...palette,\n primary: { ...generatePalette('#125e81'), contrastText: '#fff' },\n secondary: { ...generatePalette('#404b63'), contrastText: '#fff' },\n}\n\nexport const bsmnPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#00255c'),\n secondary: generatePalette('#2699a7'),\n}\n\nexport const stopAdPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#4d5491'),\n secondary: generatePalette('#4d5491'),\n}\n\nexport const digitalHealthPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#3e7293'),\n secondary: generatePalette('#164767'),\n}\n\nexport const crcResearcherPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#0085ff'),\n secondary: generatePalette('#0085ff'),\n}\n\nexport const cancerComplexityPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#38568e'),\n secondary: generatePalette('#47337d'),\n}\n\nexport const sageBionetworksPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#24AB9F'),\n secondary: generatePalette('#F5B33C'),\n}\n\nexport const challengePortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#407BA0'),\n secondary: generatePalette('#407BA0'),\n}\n\nexport const geniePalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#26881F'),\n secondary: generatePalette('#26881F'),\n}\n\nexport const standardsPortalPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#395979'),\n secondary: generatePalette('#395979'),\n}\nexport const ampalsPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#2360A6'),\n secondary: generatePalette('#2360A6'),\n}\n\nexport const classicPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#098169'),\n secondary: generatePalette('#098169'),\n}\n\nexport const arcusbioPalette: PaletteOptions = {\n ...palette,\n primary: generatePalette('#252861'),\n secondary: generatePalette('#252861'),\n}\n\nexport default {\n palette,\n generatePalette,\n adKnowledgePortalPalette,\n mtbPalette,\n arkPortalPalette,\n challengePortalPalette,\n elPortalPalette,\n nfPortalPalette,\n bsmnPortalPalette,\n stopAdPortalPalette,\n digitalHealthPortalPalette,\n crcResearcherPortalPalette,\n cancerComplexityPortalPalette,\n sageBionetworksPalette,\n geniePalette,\n standardsPortalPalette,\n ampalsPalette,\n classicPalette,\n arcusbioPalette,\n namhubPortalPalette,\n}\n"],"mappings":";;AAGA,IAAa,KACX,GACA,OAEO;CACL,KAAK,EAAU,EAAU,CAAC,WAAW,GAAG,CAAC,QAAQ,GAAG,CAAC,UAAU;CAC/D,KAAK,EAAU,EAAU,CAAC,WAAW,GAAG,CAAC,QAAQ,GAAG,CAAC,UAAU;CAC/D,KAAK,EAAU,EAAU,CAAC,WAAW,EAAE,CAAC,QAAQ,GAAG,CAAC,UAAU;CAC9D,KAAK,EAAU,EAAU,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC,UAAU;CAC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