@projectcor/maia-components 2.49.1-1 → 2.50.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/lib/App.js +19 -44
- package/lib/components/atoms/AttachmentCard/AttachmentCardAudio.helpers.js +1 -3
- package/lib/components/atoms/AttachmentCard/AttachmentCardImage.js +1 -3
- package/lib/components/atoms/AttachmentPreviewModal/AttachmentPreviewModal.js +14 -24
- package/lib/components/atoms/AttachmentPreviewModal/ExcelPreview.js +10 -28
- package/lib/components/atoms/AttachmentPreviewModal/PptPreview.js +15 -19
- package/lib/components/atoms/AttachmentPreviewModal/WordPreview.js +4 -8
- package/lib/components/atoms/ClientSelector/ClientSelector.js +13 -15
- package/lib/components/atoms/ContextCompactedNotice/ContextCompactedNotice.js +53 -0
- package/lib/components/atoms/ContextCompactedNotice/ContextCompactedNotice.styles.js +8 -0
- package/lib/components/atoms/ContextCompactedNotice/index.js +2 -0
- package/lib/components/atoms/Fade/Fade.js +6 -10
- package/lib/components/atoms/FrequentlyUsedActions/FrequentlyUsedActions.js +1 -3
- package/lib/components/atoms/FrequentlyUsedActions/FrequentlyUsedActions.styles.js +7 -19
- package/lib/components/atoms/MAIAInput/MAIAInput.attachments.helpers.js +2 -3
- package/lib/components/atoms/MAIAInput/MAIAInput.helpers.js +2 -3
- package/lib/components/atoms/MAIAInput/MAIAInput.js +7 -14
- package/lib/components/atoms/MaiaWrapper/MaiaWrapperBase.js +4 -9
- package/lib/components/atoms/OptionAccessibility/OptionAccessibility.js +5 -4
- package/lib/components/atoms/ReasoningBlock/ReasoningBlock.js +2 -7
- package/lib/components/atoms/ReasoningBlock/ReasoningBlock.styles.js +24 -41
- package/lib/components/atoms/ReasoningBlock/ReasoningSteps.js +10 -25
- package/lib/components/atoms/ReasoningBlock/ReasoningTimeline.js +43 -78
- package/lib/components/atoms/ReasoningBlock/groupParallelSteps.js +11 -9
- package/lib/components/atoms/ReasoningBlock/reasoningLiveNarration.js +15 -37
- package/lib/components/index.js +1 -2
- package/lib/components/molecules/AbmSection/AbmAccessibilitySection/AbmAccessibilitySection.js +2 -3
- package/lib/components/molecules/AbmSection/AbmKnowledgeSection.helpers.js +4 -6
- package/lib/components/molecules/AbmSection/AbmKnowledgeSection.js +16 -25
- package/lib/components/molecules/ChatAIContent/ChatAIContent.js +3 -7
- package/lib/components/molecules/ChatAIHome/ChatAIHome.js +72 -93
- package/lib/components/molecules/ChatAIHome/styles.js +78 -85
- package/lib/components/molecules/ChatAIMessages/ChatAIMessages.js +35 -42
- package/lib/components/molecules/ChatAIMessages/newStyles.js +35 -32
- package/lib/components/molecules/ChatAIModal/ChatAIModal.helpers.js +1 -8
- package/lib/components/molecules/ChatAIModal/ChatAIModal.js +8 -25
- package/lib/components/molecules/ChatAIModal/ChatAIModal.styles.js +2 -2
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalFooter/ChatAiModalFooter.js +153 -15
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalFooter/ChatAiModalFooter.styles.js +26 -2
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalHeader/ChatAiModalHeader.js +367 -63
- package/lib/components/molecules/ChatFooter/ChatFooter.js +4 -10
- package/lib/components/molecules/ChatFooter/ChatFooterFaqs.js +2 -5
- package/lib/components/molecules/Sidebar/Sidebar.js +23 -41
- package/lib/components/organisms/AbmAgentModal/AbmAgentModal.js +2 -2
- package/lib/components/organisms/ProjectSummary/ProjectSummary.js +7 -11
- package/lib/components/organisms/SourcesInformation/SourcesInformationModal.js +1 -4
- package/lib/constants/formatExtensions.js +8 -7
- package/lib/constants/permissions/index.js +2 -2
- package/lib/constants/permissions/utils.js +1 -4
- package/lib/dev/DevReasoningTimeline.js +86 -75
- package/lib/dev/Providers.js +3 -5
- package/lib/hooks/useAgentModel/useUpdateAgent.js +6 -7
- package/lib/hooks/useChatManager/useChatManager.helpers.js +20 -9
- package/lib/hooks/useChatManager/useChatManager.js +21 -15
- package/lib/hooks/useEntitySearch.js +1 -3
- package/lib/hooks/useFrequentlyUsedActions.js +22 -60
- package/lib/hooks/useKnowledge/downloadKnowledge.js +4 -4
- package/lib/hooks/useKnowledge/useKnowledgeOperations.js +15 -16
- package/lib/hooks/useProjectSummaryConfig.js +5 -10
- package/lib/hooks/useReasoningTrace/reasoningStore.js +39 -8
- package/lib/index.js +2 -5
- package/lib/lang/br/index.js +7 -26
- package/lib/lang/en/index.js +7 -26
- package/lib/lang/es/index.js +7 -26
- package/lib/lang/fr/index.js +7 -26
- package/lib/services/maia/Actions/getFrequentlyUsedActions.js +1 -1
- package/lib/services/maia/Agents/connectors.js +1 -3
- package/lib/services/utils/mapChatMessages.helpers.js +12 -7
- package/lib/store/sessions/sessionStreamManager.js +101 -94
- package/lib/store/useChatsStore.js +3 -4
- package/lib/styles/cascade.js +3 -29
- package/lib/styles/transitions.js +1 -3
- package/lib/types/Chat.js +1 -1
- package/lib/types/contextCompaction.js +48 -0
- package/lib/types/global.d.js +1 -1
- package/lib/types/jest-dom.d.js +2 -0
- package/lib/types/reasoning.js +1 -1
- package/lib/utils/hoursPlannerQuickActionType.js +1 -74
- package/lib/utils/imagePreprocessor.js +3 -14
- package/lib/utils/navigateContextEntity.js +2 -2
- package/lib/utils/openTaskInCorPanel.js +2 -2
- package/lib/utils/streamActivityMessages.helpers.js +4 -5
- package/lib/utils/streamActivityMessages.js +20 -32
- package/package.json +2 -2
- package/lib/components/atoms/ActionableButton.spec.js +0 -111
- package/lib/components/atoms/AgentActivityIndicator/AgentActivityIndicator.spec.js +0 -52
- package/lib/components/atoms/AgentActivityIndicator/AgentActivityIndicator.utils.spec.js +0 -11
- package/lib/components/atoms/ApprovalBox/ApprovalBox.helpers.spec.js +0 -63
- package/lib/components/atoms/ApprovalBox/ApprovalBox.spec.js +0 -183
- package/lib/components/atoms/AttachmentCard/AttachmentCard.spec.js +0 -123
- package/lib/components/atoms/AttachmentCard/AttachmentCardAudio.helpers.spec.js +0 -139
- package/lib/components/atoms/AttachmentCard/AttachmentCardAudio.spec.js +0 -385
- package/lib/components/atoms/AttachmentCard/AttachmentCardImage.spec.js +0 -78
- package/lib/components/atoms/AttachmentPreviewModal/AttachmentPreviewModal.helpers.spec.js +0 -94
- package/lib/components/atoms/AttachmentPreviewModal/AttachmentPreviewModal.spec.js +0 -396
- package/lib/components/atoms/AttachmentPreviewModal/ExcelPreview.spec.js +0 -80
- package/lib/components/atoms/AttachmentPreviewModal/PptPreview.helpers.spec.js +0 -526
- package/lib/components/atoms/AttachmentPreviewModal/PptPreview.spec.js +0 -169
- package/lib/components/atoms/AttachmentPreviewModal/WordPreview.helpers.spec.js +0 -11
- package/lib/components/atoms/AttachmentPreviewModal/WordPreview.spec.js +0 -77
- package/lib/components/atoms/Backdrop/Backdrop.spec.js +0 -28
- package/lib/components/atoms/CardMenu/CardMenu.spec.js +0 -56
- package/lib/components/atoms/ChatClientSelector/ChatClientSelector.spec.js +0 -67
- package/lib/components/atoms/Checkbox/Checkbox.spec.js +0 -27
- package/lib/components/atoms/Chip/Chip.spec.js +0 -82
- package/lib/components/atoms/ChipLlm/ChipLlm.spec.js +0 -26
- package/lib/components/atoms/ClientSelector/ClientSelector.helpers.spec.js +0 -45
- package/lib/components/atoms/ClientSelector/ClientSelector.spec.js +0 -133
- package/lib/components/atoms/ContextMentionChip/ContextMentionChip.spec.js +0 -29
- package/lib/components/atoms/ContextMentionChip/MentionOverflowLabel.spec.js +0 -46
- package/lib/components/atoms/ContextMentionChip/buildChipElement.helpers.spec.js +0 -109
- package/lib/components/atoms/ContextMentionChip/buildChipElement.spec.js +0 -81
- package/lib/components/atoms/ContextMentionEditor/ContextMentionEditor.helpers.spec.js +0 -92
- package/lib/components/atoms/ContextMentionEditor/ContextMentionEditor.spec.js +0 -319
- package/lib/components/atoms/ContextMentionItem/ContextMentionItem.spec.js +0 -107
- package/lib/components/atoms/ContextMentionPopover/ContextMentionPopover.spec.js +0 -136
- package/lib/components/atoms/CopyToClipboard.spec.js +0 -74
- package/lib/components/atoms/EditableLabel/EditableLabel.spec.js +0 -76
- package/lib/components/atoms/EntitySelector/EntitySelector.spec.js +0 -86
- package/lib/components/atoms/Expand/Expand.spec.js +0 -57
- package/lib/components/atoms/Fade/Fade.spec.js +0 -66
- package/lib/components/atoms/FeedbackButton/FeedbackButton.spec.js +0 -75
- package/lib/components/atoms/FrequentlyAskedQuestions/FrequentlyAskedQuestions.spec.js +0 -104
- package/lib/components/atoms/FrequentlyUsedActions/FrequentlyUsedActions.spec.js +0 -91
- package/lib/components/atoms/HelpButton.spec.js +0 -87
- package/lib/components/atoms/ImagePreview/ImagePreview.spec.js +0 -96
- package/lib/components/atoms/ListMenuOption/ListMenuOption.spec.js +0 -54
- package/lib/components/atoms/LoadingFaqs/LoadingFaqs.spec.js +0 -21
- package/lib/components/atoms/LoadingSearchClients/LoadingSearchClients.spec.js +0 -20
- package/lib/components/atoms/LoadingSearchProjects/LoadingSearchProjects.spec.js +0 -26
- package/lib/components/atoms/LoadingText/LoadingText.spec.js +0 -25
- package/lib/components/atoms/MAIAButton/MAIAButton.spec.js +0 -42
- package/lib/components/atoms/MAIAError/MAIAError.spec.js +0 -27
- package/lib/components/atoms/MAIAInput/MAIAInput.attachments.helpers.spec.js +0 -113
- package/lib/components/atoms/MAIAInput/MAIAInput.helpers.spec.js +0 -381
- package/lib/components/atoms/MAIAInput/MAIAInput.spec.js +0 -641
- package/lib/components/atoms/MAIAInput/MAIAInputEditor.helpers.spec.js +0 -92
- package/lib/components/atoms/MAIAInput/MAIAInputEditor.spec.js +0 -193
- package/lib/components/atoms/MAIAInput/maiaInputLayout.spec.js +0 -32
- package/lib/components/atoms/MaiaStreamdown/MaiaStreamdown.spec.js +0 -64
- package/lib/components/atoms/MaiaWrapper/MaiaWrapper.spec.js +0 -43
- package/lib/components/atoms/MaiaWrapper/MaiaWrapperBase.spec.js +0 -114
- package/lib/components/atoms/MaiaWrapper/ModernMaiaWrapper.spec.js +0 -51
- package/lib/components/atoms/ModalClientAccess/ModalClientAccess.spec.js +0 -48
- package/lib/components/atoms/ModalProject/ModalProject.spec.js +0 -66
- package/lib/components/atoms/NextPageLoader.spec.js +0 -37
- package/lib/components/atoms/OnboardingModalButton/OnboardingModal.spec.js +0 -20
- package/lib/components/atoms/OnboardingModalButton/OnboardingModalButton.helpers.spec.js +0 -35
- package/lib/components/atoms/OnboardingModalButton/OnboardingModalButton.spec.js +0 -47
- package/lib/components/atoms/OptionAccessibility/OptionAccessibility.spec.js +0 -146
- package/lib/components/atoms/PrimaryButton.spec.js +0 -42
- package/lib/components/atoms/ProjectSelector/ProjectSelector.spec.js +0 -69
- package/lib/components/atoms/ReasoningBlock/ReasoningBlock.spec.js +0 -69
- package/lib/components/atoms/ReasoningBlock/ReasoningSteps.spec.js +0 -59
- package/lib/components/atoms/ReasoningBlock/ReasoningTimeline.spec.js +0 -170
- package/lib/components/atoms/ReasoningBlock/groupParallelSteps.spec.js +0 -199
- package/lib/components/atoms/ReasoningBlock/reasoningLeading.spec.js +0 -70
- package/lib/components/atoms/ReasoningBlock/reasoningLiveNarration.spec.js +0 -120
- package/lib/components/atoms/ReasoningBlock/reasoningMotion.js +0 -8
- package/lib/components/atoms/ReasoningBlock/reasoningTimeline.helpers.spec.js +0 -31
- package/lib/components/atoms/ReasoningBlock/useCollapsibleHeight.js +0 -52
- package/lib/components/atoms/ReasoningBlock/useCollapsibleHeight.spec.js +0 -90
- package/lib/components/atoms/ReasoningBlock/useReasoningMarkerHandoff.js +0 -29
- package/lib/components/atoms/ReasoningBlock/useReasoningMarkerHandoff.spec.js +0 -38
- package/lib/components/atoms/SessionGeneratingDot/SessionGeneratingDot.spec.js +0 -16
- package/lib/components/atoms/SkillsDropdown/SkillsDropdown.spec.js +0 -107
- package/lib/components/atoms/SlashCommandChip/SlashCommandChip.spec.js +0 -24
- package/lib/components/atoms/SlashCommandDropdown/SlashCommandDropdown.helpers.spec.js +0 -71
- package/lib/components/atoms/SlashCommandDropdown/SlashCommandDropdown.spec.js +0 -120
- package/lib/components/atoms/Switch/Switch.spec.js +0 -41
- package/lib/components/atoms/TextArea/CustomTextArea.spec.js +0 -52
- package/lib/components/atoms/TextArea/TextArea.helpers.spec.js +0 -25
- package/lib/components/atoms/TextArea/TextArea.spec.js +0 -126
- package/lib/components/atoms/ThirdButton.spec.js +0 -29
- package/lib/components/atoms/VideoModal/VideoModal.spec.js +0 -68
- package/lib/components/atoms/WithAppCfg.spec.js +0 -82
- package/lib/components/molecules/AbmSection/AbmAccessibilitySection/AbmAccessibilitySection.helpers.spec.js +0 -53
- package/lib/components/molecules/AbmSection/AbmAccessibilitySection/AbmAccessibilitySection.spec.js +0 -742
- package/lib/components/molecules/AbmSection/AbmGeneralSection.helpers.spec.js +0 -107
- package/lib/components/molecules/AbmSection/AbmGeneralSection.spec.js +0 -256
- package/lib/components/molecules/AbmSection/AbmKnowledgeSection.helpers.spec.js +0 -175
- package/lib/components/molecules/AbmSection/AbmKnowledgeSection.spec.js +0 -318
- package/lib/components/molecules/AbmSection/AbmLoaderFiles.helpers.spec.js +0 -50
- package/lib/components/molecules/AbmSection/AbmLoaderFiles.spec.js +0 -94
- package/lib/components/molecules/AgentInputBlock/AgentInputBlockMessage.js +0 -83
- package/lib/components/molecules/AgentInputBlock/AgentInputBlockMessage.styles.js +0 -30
- package/lib/components/molecules/AgentInputBlock/index.js +0 -5
- package/lib/components/molecules/AgentInputBlock/resolveAgentInputBlock.js +0 -52
- package/lib/components/molecules/AgentInputBlock/resolveAgentInputBlock.spec.js +0 -76
- package/lib/components/molecules/AgentInputBlock/resolveLegacyContextSession.js +0 -20
- package/lib/components/molecules/AgentInputBlock/resolveLegacyContextSession.spec.js +0 -34
- package/lib/components/molecules/AgentInputBlock/useAgentChangeModelAction.js +0 -36
- package/lib/components/molecules/ChatAIClientSelector/ChatAIClientSelector.spec.js +0 -66
- package/lib/components/molecules/ChatAIContent/ChatAIContent.spec.js +0 -145
- package/lib/components/molecules/ChatAIHistory/ChatAIHistory.spec.js +0 -204
- package/lib/components/molecules/ChatAIHome/ChatAIHome.helpers.spec.js +0 -622
- package/lib/components/molecules/ChatAIHome/ChatAIHome.spec.js +0 -264
- package/lib/components/molecules/ChatAIHome/ChatAIHomeMaiaker.spec.js +0 -86
- package/lib/components/molecules/ChatAIMessages/ChatAICreateAgentActions.spec.js +0 -104
- package/lib/components/molecules/ChatAIMessages/ChatAIMessages.helpers.spec.js +0 -742
- package/lib/components/molecules/ChatAIMessages/ChatAIMessages.spec.js +0 -541
- package/lib/components/molecules/ChatAIMessages/ChatAISuggestions.spec.js +0 -46
- package/lib/components/molecules/ChatAIModal/ChatAIModal.helpers.spec.js +0 -1394
- package/lib/components/molecules/ChatAIModal/ChatAIModal.spec.js +0 -1401
- package/lib/components/molecules/ChatAIModal/components/ChatAiAgentOptions/ChatAiAgentOptions.helpers.spec.js +0 -33
- package/lib/components/molecules/ChatAIModal/components/ChatAiAgentOptions/ChatAiAgentOptions.spec.js +0 -116
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalFooter/ChatAiModalFooter.spec.js +0 -134
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalHeader/ChatAiModalHeader.helpers.spec.js +0 -142
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalHeader/ChatAiModalHeader.spec.js +0 -241
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalHeader/ChatAiModalHeader.utils.js +0 -69
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalHeader/ChatAiModalHeader.utils.spec.js +0 -144
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalHeader/ChatAiModalHeaderAgentDropdown.js +0 -95
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalHeader/ChatAiModalHeaderAgentSelector.js +0 -174
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalHeader/ChatAiModalHeaderLayoutMenu.js +0 -99
- package/lib/components/molecules/ChatAIModal/components/ChatAiModalHeader/ChatAiModalHeaderLayoutMenu.spec.js +0 -65
- package/lib/components/molecules/ChatAIModal/components/MaiaMinimizedPill/MaiaMinimizedPill.spec.js +0 -37
- package/lib/components/molecules/ChatAIModal/constants.spec.js +0 -16
- package/lib/components/molecules/ChatAIModal/floatingPanelMotion/FloatingPanelMotion.spec.js +0 -22
- package/lib/components/molecules/ChatAIModal/floatingPanelMotion/useFloatingPanelDragTilt.spec.js +0 -67
- package/lib/components/molecules/ChatAIModal/layout.spec.js +0 -72
- package/lib/components/molecules/ChatAIMyAgents/ChatAIMyAgents.helpers.spec.js +0 -93
- package/lib/components/molecules/ChatAIMyAgents/ChatAIMyAgents.spec.js +0 -297
- package/lib/components/molecules/ChatAIMySkills/ChatAIMySkills.helpers.spec.js +0 -62
- package/lib/components/molecules/ChatAIMySkills/ChatAIMySkills.spec.js +0 -221
- package/lib/components/molecules/ChatAIProjectSelector/ChatAIProjectSelector.spec.js +0 -66
- package/lib/components/molecules/ChatFooter/ChatFooter.spec.js +0 -369
- package/lib/components/molecules/ChatFooter/ChatFooterCorAccess.spec.js +0 -10
- package/lib/components/molecules/ChatFooter/ChatFooterFaqs.helpers.spec.js +0 -104
- package/lib/components/molecules/ChatFooter/ChatFooterFaqs.spec.js +0 -139
- package/lib/components/molecules/ContextMentionInput/ContextMentionInput.spec.js +0 -84
- package/lib/components/molecules/MessageFeedback/MessageFeedback.spec.js +0 -116
- package/lib/components/molecules/ProjectSummaryChat/ProjectSummaryChat.spec.js +0 -126
- package/lib/components/molecules/ProjectSummaryConfig/ProjectSummaryConfig.spec.js +0 -115
- package/lib/components/molecules/ProjectSummaryContent/ProjectSummaryContent.spec.js +0 -79
- package/lib/components/molecules/ProjectSummaryModal/ProjectSummaryModal.spec.js +0 -37
- package/lib/components/molecules/Sidebar/Sidebar.helpers.spec.js +0 -119
- package/lib/components/molecules/Sidebar/Sidebar.spec.js +0 -464
- package/lib/components/organisms/AbmAgentModal/AbmAgentModal.helpers.spec.js +0 -1067
- package/lib/components/organisms/AbmAgentModal/AbmAgentModal.spec.js +0 -1236
- package/lib/components/organisms/AbmSkillGenerateModal/AbmSkillGenerateModal.spec.js +0 -112
- package/lib/components/organisms/AbmSkillModal/AbmSkillModal.helpers.spec.js +0 -77
- package/lib/components/organisms/AbmSkillModal/AbmSkillModal.spec.js +0 -503
- package/lib/components/organisms/ChatAI/ChatAI.spec.js +0 -174
- package/lib/components/organisms/ChatAIPage/ChatAIPage.js +0 -525
- package/lib/components/organisms/ChatAIPage/ChatAIPage.spec.js +0 -246
- package/lib/components/organisms/ChatAIPage/ChatAIPage.styles.js +0 -16
- package/lib/components/organisms/ChatAIPage/ChatAIPageHeader.js +0 -253
- package/lib/components/organisms/ChatAIPage/ChatAIPageHeader.spec.js +0 -139
- package/lib/components/organisms/ChatAIPage/ChatAIPageHeader.styles.js +0 -13
- package/lib/components/organisms/ChatAIPage/ChatAIPageHome.js +0 -284
- package/lib/components/organisms/ChatAIPage/ChatAIPageHome.spec.js +0 -275
- package/lib/components/organisms/ChatAIPage/ChatAIPageHome.styles.js +0 -196
- package/lib/components/organisms/ChatAIPage/ChatAIPageHomeActionCardSlot.js +0 -94
- package/lib/components/organisms/ChatAIPage/ChatAIPageHomeActionCardSlot.spec.js +0 -69
- package/lib/components/organisms/ChatAIPage/ChatAIPageHomeActionCards.skeleton.js +0 -38
- package/lib/components/organisms/ChatAIPage/getDaypart.js +0 -9
- package/lib/components/organisms/ChatAIPage/getDaypart.spec.js +0 -19
- package/lib/components/organisms/ChatAIPage/index.js +0 -3
- package/lib/components/organisms/ClientAIButton/ClientAIButton.spec.js +0 -53
- package/lib/components/organisms/DeleteAgentModal/DeleteAgentModal.spec.js +0 -59
- package/lib/components/organisms/DeleteQuestionModal/DeleteQuestionModal.spec.js +0 -79
- package/lib/components/organisms/EditQuestionModal/EditQuestionModal.spec.js +0 -86
- package/lib/components/organisms/ModalFileExceeds/ModalFileExceeds.spec.js +0 -49
- package/lib/components/organisms/ProjectAIButton/ProjectAIButton.spec.js +0 -67
- package/lib/components/organisms/ProjectSummary/ProjectSummary.spec.js +0 -117
- package/lib/components/organisms/SnackBar/Snackbar.spec.js +0 -66
- package/lib/components/organisms/SourcesInformation/SourceItem.spec.js +0 -19
- package/lib/components/organisms/SourcesInformation/SourcesInformationModal.spec.js +0 -52
- package/lib/constants/formatExtensions.spec.js +0 -14
- package/lib/constants/maiaExternalConnectorsAccess.spec.js +0 -29
- package/lib/constants/maiaFeatureAccess.spec.js +0 -30
- package/lib/constants/maiaHourAgentAccess.spec.js +0 -30
- package/lib/constants/maiaTaskPanelAccess.spec.js +0 -41
- package/lib/constants/permissions/clientRoleAccess.spec.js +0 -65
- package/lib/constants/permissions/utils.spec.js +0 -128
- package/lib/constants/plannerSyncEvents.spec.js +0 -31
- package/lib/constants/taskUrls.spec.js +0 -9
- package/lib/dev/DevMaiaPage.js +0 -30
- package/lib/hooks/frequentlyUsedActionsCache.js +0 -17
- package/lib/hooks/frequentlyUsedActionsCache.spec.js +0 -25
- package/lib/hooks/useAccessClient/useAccessClient.spec.js +0 -149
- package/lib/hooks/useAgentModel/useAgentModel.spec.js +0 -83
- package/lib/hooks/useAgentModel/useCreateAgent.helpers.spec.js +0 -268
- package/lib/hooks/useAgentModel/useCreateAgent.spec.js +0 -314
- package/lib/hooks/useAgentModel/useDeleteAgent.spec.js +0 -183
- package/lib/hooks/useAgentModel/useUpdateAgent.spec.js +0 -374
- package/lib/hooks/useAgentSuggestions.spec.js +0 -89
- package/lib/hooks/useCaretPosition.spec.js +0 -58
- package/lib/hooks/useChatManager/useChatManager.helpers.spec.js +0 -2027
- package/lib/hooks/useChatManager/useChatManager.spec.js +0 -2409
- package/lib/hooks/useChatMessages/useChatMessages.helpers.spec.js +0 -491
- package/lib/hooks/useChatMessages/useChatMessages.spec.js +0 -729
- package/lib/hooks/useChats/useChats.spec.js +0 -208
- package/lib/hooks/useClientSearch.helpers.spec.js +0 -52
- package/lib/hooks/useClientSearch.spec.js +0 -86
- package/lib/hooks/useContextMentions.helpers.spec.js +0 -267
- package/lib/hooks/useContextMentions.spec.js +0 -338
- package/lib/hooks/useContextPinPopover.helpers.spec.js +0 -183
- package/lib/hooks/useContextPinPopover.spec.js +0 -159
- package/lib/hooks/useContinueLegacyContextInNewChat/index.js +0 -2
- package/lib/hooks/useContinueLegacyContextInNewChat/useContinueLegacyContextInNewChat.js +0 -93
- package/lib/hooks/useDebounce.spec.js +0 -42
- package/lib/hooks/useEntitySearch.helpers.spec.js +0 -723
- package/lib/hooks/useEntitySearch.spec.js +0 -718
- package/lib/hooks/useEvent.spec.js +0 -45
- package/lib/hooks/useFrequentlyAskedQuestions.spec.js +0 -222
- package/lib/hooks/useFrequentlyUsedActions.spec.js +0 -135
- package/lib/hooks/useIsMaiaPageRoute.js +0 -26
- package/lib/hooks/useIsMaiaPageRoute.spec.js +0 -26
- package/lib/hooks/useKnowledge/deleteKnowledge.spec.js +0 -122
- package/lib/hooks/useKnowledge/downloadKnowledge.spec.js +0 -148
- package/lib/hooks/useKnowledge/saveKnowledge.spec.js +0 -104
- package/lib/hooks/useKnowledge/useKnowledgeOperations.spec.js +0 -178
- package/lib/hooks/useMaiaChatSessionMeta/index.js +0 -2
- package/lib/hooks/useMaiaChatSessionMeta/useMaiaChatSessionMeta.js +0 -24
- package/lib/hooks/useMentionAllowedTypes.spec.js +0 -89
- package/lib/hooks/useMentionPopover.helpers.spec.js +0 -100
- package/lib/hooks/useMentionPopover.spec.js +0 -392
- package/lib/hooks/useMinimizedPillBottomOffset.helpers.spec.js +0 -176
- package/lib/hooks/useMinimizedPillBottomOffset.spec.js +0 -89
- package/lib/hooks/useMinimizedPillNoveltyDot/useMinimizedPillNoveltyDot.spec.js +0 -67
- package/lib/hooks/useModal/useModal.spec.js +0 -73
- package/lib/hooks/useOrchestratorStream/useOrchestratorStream.helpers.spec.js +0 -138
- package/lib/hooks/useOrchestratorStream/useOrchestratorStream.spec.js +0 -417
- package/lib/hooks/useProjectSearch.helpers.spec.js +0 -89
- package/lib/hooks/useProjectSearch.spec.js +0 -91
- package/lib/hooks/useProjectSummary.spec.js +0 -193
- package/lib/hooks/useProjectSummaryConfig.helpers.spec.js +0 -151
- package/lib/hooks/useProjectSummaryConfig.spec.js +0 -133
- package/lib/hooks/useReasoningTrace/reasoningStore.spec.js +0 -112
- package/lib/hooks/useRecentClientsSearch.helpers.spec.js +0 -33
- package/lib/hooks/useRecentClientsSearch.spec.js +0 -85
- package/lib/hooks/useRecentContexts.spec.js +0 -139
- package/lib/hooks/useResize.spec.js +0 -37
- package/lib/hooks/useSkillsCatalog.spec.js +0 -88
- package/lib/hooks/useSlashCommands.spec.js +0 -139
- package/lib/hooks/useSmoothStreamText/useSmoothStreamText.spec.js +0 -101
- package/lib/hooks/useSnackBarManager/useSnackBarManager.spec.js +0 -33
- package/lib/hooks/useStreamResponse.spec.js +0 -199
- package/lib/hooks/useT.spec.js +0 -20
- package/lib/hooks/useToggle.spec.js +0 -33
- package/lib/hooks/useToggleFavorite/useToggleFavorite.spec.js +0 -171
- package/lib/services/appcues.spec.js +0 -37
- package/lib/services/maia/Access/updateAccess.spec.js +0 -137
- package/lib/services/maia/Actions/getFrequentlyUsedActions.spec.js +0 -56
- package/lib/services/maia/Actions/getSlashCommands.spec.js +0 -91
- package/lib/services/maia/Agents/connectors.spec.js +0 -496
- package/lib/services/maia/Agents/createAgent.spec.js +0 -55
- package/lib/services/maia/Agents/deleteAgent.spec.js +0 -57
- package/lib/services/maia/Agents/fetchAgentDetail.spec.js +0 -108
- package/lib/services/maia/Agents/getAgentById.spec.js +0 -190
- package/lib/services/maia/Agents/getAgentModels.spec.js +0 -190
- package/lib/services/maia/Agents/getAgentSuggestions.spec.js +0 -89
- package/lib/services/maia/Agents/getAgents.helpers.spec.js +0 -325
- package/lib/services/maia/Agents/getAgents.spec.js +0 -1135
- package/lib/services/maia/Agents/setAgentToolGroups.spec.js +0 -45
- package/lib/services/maia/Agents/toggleFavorite.spec.js +0 -59
- package/lib/services/maia/Agents/updateAgent.spec.js +0 -48
- package/lib/services/maia/Chats/deleteChat.spec.js +0 -31
- package/lib/services/maia/Chats/getChatMessages.spec.js +0 -150
- package/lib/services/maia/Chats/getChatsByUserId.spec.js +0 -149
- package/lib/services/maia/Chats/markSessionAsRead.spec.js +0 -30
- package/lib/services/maia/Chats/patchChat.spec.js +0 -41
- package/lib/services/maia/Chats/wasHelpfulChat.spec.js +0 -28
- package/lib/services/maia/Faqs/getFrequentlyAskedQuestions.spec.js +0 -58
- package/lib/services/maia/Knowledge/delete.spec.js +0 -45
- package/lib/services/maia/Knowledge/download.spec.js +0 -78
- package/lib/services/maia/Knowledge/save.spec.js +0 -58
- package/lib/services/maia/Orchestrator/orchestrator.helpers.spec.js +0 -225
- package/lib/services/maia/Orchestrator/orchestrator.spec.js +0 -181
- package/lib/services/maia/RecentClients/getRecentClients.spec.js +0 -52
- package/lib/services/maia/RecentContexts/getRecentContexts.spec.js +0 -103
- package/lib/services/maia/RecentProjects/getRecentProjects.spec.js +0 -82
- package/lib/services/maia/RecentTasks/getRecentTasks.spec.js +0 -63
- package/lib/services/maia/RecentUsers/getRecentUsers.spec.js +0 -82
- package/lib/services/maia/Skills/createSkill.spec.js +0 -68
- package/lib/services/maia/Skills/deleteSkill.spec.js +0 -42
- package/lib/services/maia/Skills/generateSkill.spec.js +0 -48
- package/lib/services/maia/Skills/getSkills.spec.js +0 -152
- package/lib/services/maia/Skills/updateSkill.spec.js +0 -62
- package/lib/services/maia/client.spec.js +0 -56
- package/lib/services/utils/fetchCOR.spec.js +0 -211
- package/lib/services/utils/getCookie.spec.js +0 -20
- package/lib/services/utils/mapChatMessages.helpers.spec.js +0 -336
- package/lib/services/utils/mapChatMessages.spec.js +0 -254
- package/lib/store/chatsSidebarOptimistic.spec.js +0 -145
- package/lib/store/maiaLastChatPersistence.spec.js +0 -22
- package/lib/store/maiaPanelSessionPersistence.spec.js +0 -62
- package/lib/store/sessions/sessionNotificationSound.spec.js +0 -145
- package/lib/store/sessions/sessionNotifications.helpers.spec.js +0 -63
- package/lib/store/sessions/sessionNotifications.spec.js +0 -106
- package/lib/store/sessions/sessionStreamManager.helpers.spec.js +0 -177
- package/lib/store/sessions/sessionStreamManager.spec.js +0 -939
- package/lib/store/sessions/sessions.types.spec.js +0 -16
- package/lib/store/sessions/useSessionsStore.spec.js +0 -135
- package/lib/store/useChatsStore.spec.js +0 -619
- package/lib/store/useFaqsStore.spec.js +0 -57
- package/lib/utils/actionCategoryMap.spec.js +0 -18
- package/lib/utils/agentDisplayName.spec.js +0 -48
- package/lib/utils/autoApproveStorage.spec.js +0 -25
- package/lib/utils/chatInputFiles.spec.js +0 -39
- package/lib/utils/contextMentionIcons.spec.js +0 -41
- package/lib/utils/contextMentionLabel.spec.js +0 -13
- package/lib/utils/contextMentionTriggers.spec.js +0 -44
- package/lib/utils/contextMentionTypeLabel.spec.js +0 -14
- package/lib/utils/corConnectorMentionTypes.spec.js +0 -23
- package/lib/utils/entityLinkRender.spec.js +0 -72
- package/lib/utils/fileDownloadHelper.spec.js +0 -67
- package/lib/utils/formatQuickActionMessage.spec.js +0 -27
- package/lib/utils/formatUnreadCount.spec.js +0 -12
- package/lib/utils/getUnitFileSize.spec.js +0 -18
- package/lib/utils/hitlAnalytics.spec.js +0 -136
- package/lib/utils/hoursPlannerQuickActionType.spec.js +0 -64
- package/lib/utils/imagePreprocessor.helpers.spec.js +0 -28
- package/lib/utils/imagePreprocessor.spec.js +0 -112
- package/lib/utils/maiaPageRoute.js +0 -24
- package/lib/utils/maiaPageRoute.spec.js +0 -23
- package/lib/utils/mapBackendLang.spec.js +0 -19
- package/lib/utils/navigateContextEntity.spec.js +0 -50
- package/lib/utils/normalizeAgentConnectors.spec.js +0 -98
- package/lib/utils/openTaskInCorPanel.spec.js +0 -43
- package/lib/utils/orchestratorSubagents.spec.js +0 -32
- package/lib/utils/reasoningMappers.spec.js +0 -103
- package/lib/utils/recentContextsHomeLimit.spec.js +0 -32
- package/lib/utils/renderContextMentions.helpers.spec.js +0 -87
- package/lib/utils/renderContextMentions.spec.js +0 -268
- package/lib/utils/retryCompletion.spec.js +0 -181
- package/lib/utils/skillContentSize.spec.js +0 -13
- package/lib/utils/slashCommandMarker.spec.js +0 -43
- package/lib/utils/sortManagerHoursHomeFuas.spec.js +0 -51
- package/lib/utils/sseStreamContent.spec.js +0 -31
- package/lib/utils/streamActivityMessages.helpers.spec.js +0 -84
- package/lib/utils/streamActivityMessages.spec.js +0 -336
- package/lib/utils/validateTrimmedFields.spec.js +0 -26
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import { act, renderHook } from '@testing-library/react';
|
|
4
|
-
import { getAgentSuggestions } from '../services/maia/Agents/getAgentSuggestions';
|
|
5
|
-
import { useAgentSuggestions } from './useAgentSuggestions';
|
|
6
|
-
jest.mock('../services/maia/Agents/getAgentSuggestions', function () {
|
|
7
|
-
return {
|
|
8
|
-
getAgentSuggestions: jest.fn()
|
|
9
|
-
};
|
|
10
|
-
});
|
|
11
|
-
var getAgentSuggestionsMock = getAgentSuggestions;
|
|
12
|
-
describe('useAgentSuggestions', function () {
|
|
13
|
-
beforeEach(function () {
|
|
14
|
-
jest.clearAllMocks();
|
|
15
|
-
getAgentSuggestionsMock.mockResolvedValue([{
|
|
16
|
-
id: '1',
|
|
17
|
-
title: 'Legal',
|
|
18
|
-
subtitle: 'Help',
|
|
19
|
-
order: 1,
|
|
20
|
-
language: 'es',
|
|
21
|
-
category: null
|
|
22
|
-
}]);
|
|
23
|
-
});
|
|
24
|
-
it('loads suggestions for the given language', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
25
|
-
var _renderHook, result;
|
|
26
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
27
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
28
|
-
case 0:
|
|
29
|
-
_renderHook = renderHook(function () {
|
|
30
|
-
return useAgentSuggestions('es');
|
|
31
|
-
}), result = _renderHook.result;
|
|
32
|
-
_context2.next = 1;
|
|
33
|
-
return act(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
34
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
35
|
-
while (1) switch (_context.prev = _context.next) {
|
|
36
|
-
case 0:
|
|
37
|
-
_context.next = 1;
|
|
38
|
-
return result.current.handleGetAgentSuggestions();
|
|
39
|
-
case 1:
|
|
40
|
-
case "end":
|
|
41
|
-
return _context.stop();
|
|
42
|
-
}
|
|
43
|
-
}, _callee);
|
|
44
|
-
})));
|
|
45
|
-
case 1:
|
|
46
|
-
expect(getAgentSuggestionsMock).toHaveBeenCalledWith({
|
|
47
|
-
lang: 'es'
|
|
48
|
-
});
|
|
49
|
-
expect(result.current.suggestions).toHaveLength(1);
|
|
50
|
-
expect(result.current.error).toBeNull();
|
|
51
|
-
case 2:
|
|
52
|
-
case "end":
|
|
53
|
-
return _context2.stop();
|
|
54
|
-
}
|
|
55
|
-
}, _callee2);
|
|
56
|
-
})));
|
|
57
|
-
it('stores an error when the request fails', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
58
|
-
var _renderHook2, result;
|
|
59
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
60
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
61
|
-
case 0:
|
|
62
|
-
getAgentSuggestionsMock.mockRejectedValue(new Error('Unavailable'));
|
|
63
|
-
_renderHook2 = renderHook(function () {
|
|
64
|
-
return useAgentSuggestions('en');
|
|
65
|
-
}), result = _renderHook2.result;
|
|
66
|
-
_context4.next = 1;
|
|
67
|
-
return act(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
68
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
69
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
70
|
-
case 0:
|
|
71
|
-
_context3.next = 1;
|
|
72
|
-
return result.current.handleGetAgentSuggestions();
|
|
73
|
-
case 1:
|
|
74
|
-
case "end":
|
|
75
|
-
return _context3.stop();
|
|
76
|
-
}
|
|
77
|
-
}, _callee3);
|
|
78
|
-
})));
|
|
79
|
-
case 1:
|
|
80
|
-
expect(result.current.error).toBe('Unavailable');
|
|
81
|
-
expect(result.current.suggestions).toEqual([]);
|
|
82
|
-
case 2:
|
|
83
|
-
case "end":
|
|
84
|
-
return _context4.stop();
|
|
85
|
-
}
|
|
86
|
-
}, _callee4);
|
|
87
|
-
})));
|
|
88
|
-
});
|
|
89
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJhY3QiLCJyZW5kZXJIb29rIiwiZ2V0QWdlbnRTdWdnZXN0aW9ucyIsInVzZUFnZW50U3VnZ2VzdGlvbnMiLCJqZXN0IiwibW9jayIsImZuIiwiZ2V0QWdlbnRTdWdnZXN0aW9uc01vY2siLCJkZXNjcmliZSIsImJlZm9yZUVhY2giLCJjbGVhckFsbE1vY2tzIiwibW9ja1Jlc29sdmVkVmFsdWUiLCJpZCIsInRpdGxlIiwic3VidGl0bGUiLCJvcmRlciIsImxhbmd1YWdlIiwiY2F0ZWdvcnkiLCJpdCIsIl9hc3luY1RvR2VuZXJhdG9yIiwiX3JlZ2VuZXJhdG9yUnVudGltZSIsIm1hcmsiLCJfY2FsbGVlMiIsIl9yZW5kZXJIb29rIiwicmVzdWx0Iiwid3JhcCIsIl9jb250ZXh0MiIsInByZXYiLCJuZXh0IiwiX2NhbGxlZSIsIl9jb250ZXh0IiwiY3VycmVudCIsImhhbmRsZUdldEFnZW50U3VnZ2VzdGlvbnMiLCJzdG9wIiwiZXhwZWN0IiwidG9IYXZlQmVlbkNhbGxlZFdpdGgiLCJsYW5nIiwic3VnZ2VzdGlvbnMiLCJ0b0hhdmVMZW5ndGgiLCJlcnJvciIsInRvQmVOdWxsIiwiX2NhbGxlZ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UMsQ0FBQ1MsSUFBSSxDQUFDLGFBQWEsQ0FBQztVQUNoRGQsTUFBTSxDQUFDVixNQUFNLENBQUNPLE9BQU8sQ0FBQ00sV0FBVyxDQUFDLENBQUNZLE9BQU8sQ0FBQyxFQUFFLENBQUM7UUFBQTtRQUFBO1VBQUEsT0FBQU4sU0FBQSxDQUFBVixJQUFBO01BQUE7SUFBQSxHQUFBUSxRQUFBO0VBQUEsQ0FDL0MsR0FBQztBQUNKLENBQUMsQ0FBQyIsImlnbm9yZUxpc3QiOltdfQ==
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { renderHook } from '@testing-library/react';
|
|
2
|
-
import { useCaretPosition } from './useCaretPosition';
|
|
3
|
-
describe('useCaretPosition', function () {
|
|
4
|
-
afterEach(function () {
|
|
5
|
-
var _window$getSelection;
|
|
6
|
-
(_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 || _window$getSelection.removeAllRanges();
|
|
7
|
-
jest.restoreAllMocks();
|
|
8
|
-
});
|
|
9
|
-
it('returns null without a selection', function () {
|
|
10
|
-
var _renderHook = renderHook(function () {
|
|
11
|
-
return useCaretPosition();
|
|
12
|
-
}),
|
|
13
|
-
result = _renderHook.result;
|
|
14
|
-
expect(result.current('@')).toBeNull();
|
|
15
|
-
});
|
|
16
|
-
it('returns the rect of the opener character', function () {
|
|
17
|
-
var fakeRect = {
|
|
18
|
-
top: 10,
|
|
19
|
-
left: 20,
|
|
20
|
-
bottom: 26,
|
|
21
|
-
right: 28,
|
|
22
|
-
height: 16,
|
|
23
|
-
width: 8
|
|
24
|
-
};
|
|
25
|
-
Range.prototype.getClientRects = function () {
|
|
26
|
-
return {
|
|
27
|
-
length: 1,
|
|
28
|
-
item: function item() {
|
|
29
|
-
return fakeRect;
|
|
30
|
-
},
|
|
31
|
-
0: fakeRect
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
var node = document.createElement('div');
|
|
35
|
-
node.textContent = 'hola @maia';
|
|
36
|
-
document.body.appendChild(node);
|
|
37
|
-
var range = document.createRange();
|
|
38
|
-
range.setStart(node.firstChild, 10);
|
|
39
|
-
range.collapse(true);
|
|
40
|
-
var selection = window.getSelection();
|
|
41
|
-
selection === null || selection === void 0 || selection.removeAllRanges();
|
|
42
|
-
selection === null || selection === void 0 || selection.addRange(range);
|
|
43
|
-
var _renderHook2 = renderHook(function () {
|
|
44
|
-
return useCaretPosition();
|
|
45
|
-
}),
|
|
46
|
-
result = _renderHook2.result;
|
|
47
|
-
var rect = result.current('@');
|
|
48
|
-
expect(rect).toEqual({
|
|
49
|
-
top: 10,
|
|
50
|
-
left: 20,
|
|
51
|
-
bottom: 26,
|
|
52
|
-
right: 28,
|
|
53
|
-
height: 16
|
|
54
|
-
});
|
|
55
|
-
node.remove();
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJyZW5kZXJIb29rIiwidXNlQ2FyZXRQb3NpdGlvbiIsImRlc2NyaWJlIiwiYWZ0ZXJFYWNoIiwiX3dpbmRvdyRnZXRTZWxlY3Rpb24iLCJ3aW5kb3ciLCJnZXRTZWxlY3Rpb24iLCJyZW1vdmVBbGxSYW5nZXMiLCJqZXN0IiwicmVzdG9yZUFsbE1vY2tzIiwiaXQiLCJfcmVuZGVySG9vayIsInJlc3VsdCIsImV4cGVjdCIsImN1cnJlbnQiLCJ0b0JlTnVsbCIsImZha2VSZWN0IiwidG9wIiwibGVmdCIsImJvdHRvbSIsInJpZ2h0IiwiaGVpZ2h0Iiwid2lkdGgiLCJSYW5nZSIsInByb3RvdHlwZSIsImdldENsaWVudFJlY3RzIiwibGVuZ3RoIiwiaXRlbSIsIm5vZGUiLCJkb2N1bWVudCIsImNyZWF0ZUVsZW1lbnQiLCJ0ZXh0Q29udGVudCIsImJvZHkiLCJhcHBlbmRDaGlsZCIsInJhbmdlIiwiY3JlYXRlUmFuZ2UiLCJzZXRTdG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