@e-llm-studio/requirement-ai 0.0.237 → 0.0.239

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 (491) hide show
  1. package/dist/cjs/features/CitationRenderer/CitationRenderer.js +1 -1
  2. package/dist/cjs/features/RequirementAI/components/CustomPopover/CustomPopover.js +1 -1
  3. package/dist/cjs/features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.js +1 -1
  4. package/dist/cjs/features/RequirementAI/components/GapRiskSidebar/components/GapItem/GapItem.js +1 -1
  5. package/dist/cjs/features/RequirementAI/components/GapRiskSidebar/components/RiskCategorySection/RiskCategorySection.js +1 -1
  6. package/dist/cjs/features/RequirementAI/components/GapRiskSidebar/components/RiskSidebarCategorySection/RiskSidebarCategorySection.js +1 -1
  7. package/dist/cjs/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.js +1 -1
  8. package/dist/cjs/features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithGap.js +1 -1
  9. package/dist/cjs/features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithRisk.js +1 -1
  10. package/dist/cjs/features/RequirementAI/components/RecommendationBlock/RecommendationBlock.js +1 -1
  11. package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  12. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/Editor.js +1 -1
  13. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/components/Context/ContextMenu.js +1 -1
  14. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/components/EditorContainer/EditorContainer.js +1 -1
  15. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/components/EditorPlaceholder/EditorPlaceholder.js +1 -1
  16. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/components/EditorToolbar/EditorToolbar.js +1 -1
  17. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/components/EditorToolbar/components/ToolbarButton/ToolbarButton.js +1 -1
  18. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/components/Icons/Icon.js +1 -1
  19. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.js +1 -1
  20. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/HighlightNode.js +1 -1
  21. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/InitialHtml.js +1 -1
  22. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.js +1 -1
  23. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/InvisibleNode.js +2 -0
  24. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/InvisibleNode.js.map +1 -0
  25. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js +2 -0
  26. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js.map +1 -0
  27. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/PreservedNode.js +2 -0
  28. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/PreservedNode.js.map +1 -0
  29. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js +2 -0
  30. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js.map +1 -0
  31. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/theme/theme.css.js +1 -1
  32. package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  33. package/dist/cjs/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.js +1 -1
  34. package/dist/cjs/features/RequirementAI/components/UserStoryCard/AttachedContext.js +1 -1
  35. package/dist/cjs/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.js +1 -1
  36. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  37. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  38. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/ResizableSplitPane.js +1 -1
  39. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  40. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js +2 -0
  41. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js.map +1 -0
  42. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  43. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +2 -0
  44. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js.map +1 -0
  45. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js +1 -1
  46. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  47. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.js +1 -1
  48. package/dist/cjs/features/RequirementAI/components/UserStoryCard/TitleEditor/TitleEditor.js +1 -1
  49. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  50. package/dist/cjs/features/RequirementAI/components/UserStoryCard/icons/PdfViewerIcons.js +1 -1
  51. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AIReasonAccordion.js +1 -1
  52. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  53. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
  54. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  55. package/dist/cjs/features/RequirementAI/components/ai-reasoning/BigEnoughComponent.js +1 -1
  56. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +1 -1
  57. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +1 -1
  58. package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
  59. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/AppmodCitationContent.js +1 -1
  60. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/AppmodCitationRenderer.js +1 -1
  61. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/components/CodeLinkHandler.js +1 -1
  62. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/icons/AppmodIcon.js +1 -1
  63. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/icons/ChatBubbleIcon.js +1 -1
  64. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/icons/SparkleIcon.js +1 -1
  65. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/SearchWaveFromWrapper.js +1 -1
  66. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/WaveformCitationRenderer.js +1 -1
  67. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/components/AudioCitationIcon.js +1 -1
  68. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/components/AudioTimeLineSlider.js +1 -1
  69. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/components/SegmentByWordsViral.js +1 -1
  70. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/components/videoPlayer.js +1 -1
  71. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/AudioLinesIcon.js +1 -1
  72. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/MaximizeIcon.js +1 -1
  73. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/MinimizeIcon.js +1 -1
  74. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/PauseIcon.js +1 -1
  75. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/PlayIcon.js +1 -1
  76. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/PlaybackSpeedIcon.js +1 -1
  77. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/VideoIcon.js +1 -1
  78. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/searchwaveform.js +1 -1
  79. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/store/autoplay.wavefrom.js +1 -1
  80. package/dist/cjs/features/RequirementAI/components/citations/big-enough/BigEnoughCitationRenderer.js +1 -1
  81. package/dist/cjs/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.js +1 -1
  82. package/dist/cjs/features/RequirementAI/components/citations/file-citation/DocumentCitationIcon.js +1 -1
  83. package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
  84. package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
  85. package/dist/cjs/features/RequirementAI/components/citations/gpt-web-citation/GptWebCitationRenderer.js +1 -1
  86. package/dist/cjs/features/RequirementAI/components/citations/gpt-web-citation/GptWebcitationPanel.js +1 -1
  87. package/dist/cjs/features/RequirementAI/components/citations/image-citation/ImageCitationContent.js +1 -1
  88. package/dist/cjs/features/RequirementAI/components/citations/image-citation/ImageCitationIcon.js +1 -1
  89. package/dist/cjs/features/RequirementAI/components/citations/image-citation/ImageCitationRenderer.js +1 -1
  90. package/dist/cjs/features/RequirementAI/components/citations/rca-citation/RCACitationContent.js +1 -1
  91. package/dist/cjs/features/RequirementAI/components/citations/rca-citation/RCACitationRenderer.js +1 -1
  92. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.js +1 -1
  93. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
  94. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationRenderer.js +1 -1
  95. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/icons/ExternalLinkIcon.js +1 -1
  96. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/icons/FileCodeIcon.js +1 -1
  97. package/dist/cjs/features/RequirementAI/components/citations/stormee-citation/StormeeCitationRenderer.js +1 -1
  98. package/dist/cjs/features/RequirementAI/components/citations/stormee-citation/StormeeContent.js +1 -1
  99. package/dist/cjs/features/RequirementAI/components/citations/stormee-citation/components/GradientButton.js +1 -1
  100. package/dist/cjs/features/RequirementAI/components/citations/stormee-citation/components/ProblemStatementCard.js +1 -1
  101. package/dist/cjs/features/RequirementAI/components/citations/web-citation/FullScreenIcon.js +1 -1
  102. package/dist/cjs/features/RequirementAI/components/citations/web-citation/ImagePreviewDialog.js +1 -1
  103. package/dist/cjs/features/RequirementAI/components/citations/web-citation/WebCitation.js +1 -1
  104. package/dist/cjs/features/RequirementAI/components/citations/web-citation/WebCitationIcon.js +1 -1
  105. package/dist/cjs/features/RequirementAI/components/citations/web-citation/WebCitationRenderer.js +1 -1
  106. package/dist/cjs/features/RequirementAI/components/citations/web-citation/WebCitationWithImageContent.js +1 -1
  107. package/dist/cjs/features/RequirementAI/components/citations/web-citation/WebCitationWithImageRenderer.js +1 -1
  108. package/dist/cjs/features/RequirementAI/components/cra/PartialRequirementContent.js +1 -1
  109. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
  110. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
  111. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterContentWrapper.js +1 -1
  112. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterItem.js +1 -1
  113. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/gapFilterSvgs.js +1 -1
  114. package/dist/cjs/features/RequirementAI/components/segment/DeleteSegmentsDialog.js +1 -1
  115. package/dist/cjs/features/RequirementAI/components/segment/EditSegmentDialog.js +1 -1
  116. package/dist/cjs/features/RequirementAI/components/segment/ExampleComponentWrapper.js +1 -1
  117. package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
  118. package/dist/cjs/features/RequirementAI/components/segment/SegmentLoader.js +1 -1
  119. package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  120. package/dist/cjs/features/RequirementAI/components/story-screen/BigEnoughPanel.js +1 -1
  121. package/dist/cjs/features/RequirementAI/components/story-screen/CompletionPanel.js +1 -1
  122. package/dist/cjs/features/RequirementAI/components/story-screen/ReplaceLearnedTags.js +1 -1
  123. package/dist/cjs/features/RequirementAI/components/story-screen/StreamingScreenSidebar.js +1 -1
  124. package/dist/cjs/features/RequirementAI/components/story-screen/SubfeatureBlock.js +1 -1
  125. package/dist/cjs/features/RequirementAI/components/story-screen/UserStoryScreen.js +1 -1
  126. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  127. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ApprovalBadge/ApprovalBadge.js +1 -1
  128. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ApprovalSidebar/ApprovalSidebar.js +1 -1
  129. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ApprovalSidebarItem/ApprovalSidebarItem.js +1 -1
  130. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ApprovalStatusBadge/ApprovalStatusBadge.js +1 -1
  131. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ContentBlock/ContentBlock.js +1 -1
  132. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.js +1 -1
  133. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  134. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
  135. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/HighlightButtonComponent.js +1 -1
  136. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.js +2 -0
  137. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.js.map +1 -0
  138. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.module.css.js +2 -0
  139. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.module.css.js.map +1 -0
  140. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  141. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
  142. package/dist/cjs/features/RequirementAI/hooks/useApprovalStatus.js +1 -1
  143. package/dist/cjs/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
  144. package/dist/cjs/features/RequirementAI/icons/AiGapIcon.js +1 -1
  145. package/dist/cjs/features/RequirementAI/icons/AiReasoningIcon.js +1 -1
  146. package/dist/cjs/features/RequirementAI/icons/BigEnoughIcon.js +1 -1
  147. package/dist/cjs/features/RequirementAI/icons/BookmarkIcon.js +1 -1
  148. package/dist/cjs/features/RequirementAI/icons/BrainRed.js +1 -1
  149. package/dist/cjs/features/RequirementAI/icons/CDIcon.js +1 -1
  150. package/dist/cjs/features/RequirementAI/icons/CheckIcon.js +1 -1
  151. package/dist/cjs/features/RequirementAI/icons/ChevronDownIcon.js +1 -1
  152. package/dist/cjs/features/RequirementAI/icons/ChevronUpIcon.js +1 -1
  153. package/dist/cjs/features/RequirementAI/icons/CognitiveDecision.js +1 -1
  154. package/dist/cjs/features/RequirementAI/icons/MeetingHighlightsIcon.js +1 -1
  155. package/dist/cjs/features/RequirementAI/icons/MenuUnfoldIcon.js +1 -1
  156. package/dist/cjs/features/RequirementAI/icons/PencilIcon.js +1 -1
  157. package/dist/cjs/features/RequirementAI/icons/ReasoningBulbIcon.js +1 -1
  158. package/dist/cjs/features/RequirementAI/icons/RelevanceScoreIcon.js +1 -1
  159. package/dist/cjs/features/RequirementAI/icons/SidebarCloseIcon.js +1 -1
  160. package/dist/cjs/features/RequirementAI/icons/SidebarOpenIcon.js +1 -1
  161. package/dist/cjs/features/RequirementAI/icons/TrashIcon.js +1 -1
  162. package/dist/cjs/features/RequirementAI/shared/Accordian.js +1 -1
  163. package/dist/cjs/features/RequirementAI/shared/AtomicButton.js +1 -1
  164. package/dist/cjs/features/RequirementAI/shared/CitationAIConfidenceDisplay.js +1 -1
  165. package/dist/cjs/features/RequirementAI/shared/CitationLoadingIndicator.js +1 -1
  166. package/dist/cjs/features/RequirementAI/shared/CodeViewer.js +1 -1
  167. package/dist/cjs/features/RequirementAI/shared/ExpandableOl.js +1 -1
  168. package/dist/cjs/features/RequirementAI/shared/GeneratedCodeCitation.js +1 -1
  169. package/dist/cjs/features/RequirementAI/shared/ReqAiCitationRenderer.js +1 -1
  170. package/dist/cjs/features/RequirementAI/shared/UpdatedAnimationContent.js +1 -1
  171. package/dist/cjs/features/RequirementAI/store/markdown-context.js +1 -1
  172. package/dist/cjs/features/RequirementAI/store/ref.context.js +1 -1
  173. package/dist/cjs/features/RequirementAI/utils/diff-edit.utils.js +1 -1
  174. package/dist/cjs/features/RequirementAI/utils/helpers.js +1 -1
  175. package/dist/cjs/features/RequirementAI/utils/learned-tag.utils.js +1 -1
  176. package/dist/cjs/features/RequirementAI/utils/userstory-approval.utils.js +1 -1
  177. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/AIConfidenceDisplay.js +1 -1
  178. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/icons/DocumentCitationIcon.js +1 -1
  179. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/icons/RelevanceScoreIcon.js +1 -1
  180. package/dist/cjs/features/UserStoryImport/UserStoryPicker.js +1 -1
  181. package/dist/cjs/features/UserStoryImport/UserStoryPicker.theme.js +1 -1
  182. package/dist/cjs/features/UserStoryImport/components/BackNav.js +1 -1
  183. package/dist/cjs/features/UserStoryImport/components/Badge.js +1 -1
  184. package/dist/cjs/features/UserStoryImport/components/BrowseProjectsButton.js +1 -1
  185. package/dist/cjs/features/UserStoryImport/components/CardGrid.js +1 -1
  186. package/dist/cjs/features/UserStoryImport/components/CardProceedButton.js +1 -1
  187. package/dist/cjs/features/UserStoryImport/components/ContentArea.js +1 -1
  188. package/dist/cjs/features/UserStoryImport/components/Footer.js +1 -1
  189. package/dist/cjs/features/UserStoryImport/components/Header.js +1 -1
  190. package/dist/cjs/features/UserStoryImport/components/NavRow.js +1 -1
  191. package/dist/cjs/features/UserStoryImport/components/ProceedButton.js +1 -1
  192. package/dist/cjs/features/UserStoryImport/components/ProjectCard.js +1 -1
  193. package/dist/cjs/features/UserStoryImport/components/ResizeHandle.js +1 -1
  194. package/dist/cjs/features/UserStoryImport/components/ScopeDropdown.js +1 -1
  195. package/dist/cjs/features/UserStoryImport/components/SearchInput.js +1 -1
  196. package/dist/cjs/features/UserStoryImport/components/SectionHeading.js +1 -1
  197. package/dist/cjs/features/UserStoryImport/components/ShowMore.js +1 -1
  198. package/dist/cjs/features/UserStoryImport/components/Sidebar.js +1 -1
  199. package/dist/cjs/features/UserStoryImport/components/SidebarFavoritesList.js +1 -1
  200. package/dist/cjs/features/UserStoryImport/components/SidebarProjectList.js +1 -1
  201. package/dist/cjs/features/UserStoryImport/components/SidebarSection.js +1 -1
  202. package/dist/cjs/features/UserStoryImport/components/SortDropdown.js +1 -1
  203. package/dist/cjs/features/UserStoryImport/components/SplitLayout.js +1 -1
  204. package/dist/cjs/features/UserStoryImport/components/Toolbar.js +1 -1
  205. package/dist/cjs/features/UserStoryImport/components/TypeDropdown.js +1 -1
  206. package/dist/cjs/features/UserStoryImport/components/UserStoryCard.js +1 -1
  207. package/dist/cjs/features/UserStoryImport/components/UserStoryImportDialog.js +1 -1
  208. package/dist/cjs/features/UserStoryImport/components/UserStoryScopeDropdown.js +1 -1
  209. package/dist/cjs/features/UserStoryImport/hooks/useUSPData.js +1 -1
  210. package/dist/cjs/features/UserStoryImport/hooks/useUserStoryPickerState.js +1 -1
  211. package/dist/cjs/features/UserStoryImport/lib/CustomTooltip.js +1 -1
  212. package/dist/cjs/features/UserStoryImport/lib/Tooltip.js +1 -1
  213. package/dist/cjs/features/UserStoryImport/lib/dialog.js +1 -1
  214. package/dist/cjs/index.js +1 -1
  215. package/dist/cjs/service/redlineService.js +2 -0
  216. package/dist/cjs/service/redlineService.js.map +1 -0
  217. package/dist/cjs/utils/tagHelper.js +2 -0
  218. package/dist/cjs/utils/tagHelper.js.map +1 -0
  219. package/dist/features/CitationRenderer/CitationRenderer.js +1 -1
  220. package/dist/features/RequirementAI/components/CustomPopover/CustomPopover.js +1 -1
  221. package/dist/features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.js +1 -1
  222. package/dist/features/RequirementAI/components/GapRiskSidebar/components/GapItem/GapItem.js +1 -1
  223. package/dist/features/RequirementAI/components/GapRiskSidebar/components/RiskCategorySection/RiskCategorySection.js +1 -1
  224. package/dist/features/RequirementAI/components/GapRiskSidebar/components/RiskSidebarCategorySection/RiskSidebarCategorySection.js +1 -1
  225. package/dist/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.js +1 -1
  226. package/dist/features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithGap.js +1 -1
  227. package/dist/features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithRisk.js +1 -1
  228. package/dist/features/RequirementAI/components/RecommendationBlock/RecommendationBlock.js +1 -1
  229. package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  230. package/dist/features/RequirementAI/components/RichTextEditor/Editor/Editor.js +1 -1
  231. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/Context/ContextMenu.js +1 -1
  232. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/EditorContainer/EditorContainer.js +1 -1
  233. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/EditorPlaceholder/EditorPlaceholder.js +1 -1
  234. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/EditorToolbar/EditorToolbar.js +1 -1
  235. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/EditorToolbar/components/ToolbarButton/ToolbarButton.js +1 -1
  236. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/Icons/Icon.js +1 -1
  237. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.js +1 -1
  238. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/HighlightNode.js +1 -1
  239. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/InitialHtml.js +1 -1
  240. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.js +1 -1
  241. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/InvisibleNode.js +2 -0
  242. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/InvisibleNode.js.map +1 -0
  243. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js +2 -0
  244. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js.map +1 -0
  245. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/PreservedNode.js +2 -0
  246. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/PreservedNode.js.map +1 -0
  247. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js +2 -0
  248. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js.map +1 -0
  249. package/dist/features/RequirementAI/components/RichTextEditor/Editor/theme/theme.css.js +1 -1
  250. package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  251. package/dist/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.js +1 -1
  252. package/dist/features/RequirementAI/components/UserStoryCard/AttachedContext.js +1 -1
  253. package/dist/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.js +1 -1
  254. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  255. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  256. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/ResizableSplitPane.js +1 -1
  257. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  258. package/dist/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js +2 -0
  259. package/dist/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js.map +1 -0
  260. package/dist/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  261. package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +2 -0
  262. package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js.map +1 -0
  263. package/dist/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js +1 -1
  264. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  265. package/dist/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.js +1 -1
  266. package/dist/features/RequirementAI/components/UserStoryCard/TitleEditor/TitleEditor.js +1 -1
  267. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  268. package/dist/features/RequirementAI/components/UserStoryCard/icons/PdfViewerIcons.js +1 -1
  269. package/dist/features/RequirementAI/components/ai-reasoning/AIReasonAccordion.js +1 -1
  270. package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  271. package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
  272. package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  273. package/dist/features/RequirementAI/components/ai-reasoning/BigEnoughComponent.js +1 -1
  274. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +1 -1
  275. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +1 -1
  276. package/dist/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
  277. package/dist/features/RequirementAI/components/citations/appmod-citation/AppmodCitationContent.js +1 -1
  278. package/dist/features/RequirementAI/components/citations/appmod-citation/AppmodCitationRenderer.js +1 -1
  279. package/dist/features/RequirementAI/components/citations/appmod-citation/components/CodeLinkHandler.js +1 -1
  280. package/dist/features/RequirementAI/components/citations/appmod-citation/icons/AppmodIcon.js +1 -1
  281. package/dist/features/RequirementAI/components/citations/appmod-citation/icons/ChatBubbleIcon.js +1 -1
  282. package/dist/features/RequirementAI/components/citations/appmod-citation/icons/SparkleIcon.js +1 -1
  283. package/dist/features/RequirementAI/components/citations/audio-citation/SearchWaveFromWrapper.js +1 -1
  284. package/dist/features/RequirementAI/components/citations/audio-citation/WaveformCitationRenderer.js +1 -1
  285. package/dist/features/RequirementAI/components/citations/audio-citation/components/AudioCitationIcon.js +1 -1
  286. package/dist/features/RequirementAI/components/citations/audio-citation/components/AudioTimeLineSlider.js +1 -1
  287. package/dist/features/RequirementAI/components/citations/audio-citation/components/SegmentByWordsViral.js +1 -1
  288. package/dist/features/RequirementAI/components/citations/audio-citation/components/videoPlayer.js +1 -1
  289. package/dist/features/RequirementAI/components/citations/audio-citation/icons/AudioLinesIcon.js +1 -1
  290. package/dist/features/RequirementAI/components/citations/audio-citation/icons/MaximizeIcon.js +1 -1
  291. package/dist/features/RequirementAI/components/citations/audio-citation/icons/MinimizeIcon.js +1 -1
  292. package/dist/features/RequirementAI/components/citations/audio-citation/icons/PauseIcon.js +1 -1
  293. package/dist/features/RequirementAI/components/citations/audio-citation/icons/PlayIcon.js +1 -1
  294. package/dist/features/RequirementAI/components/citations/audio-citation/icons/PlaybackSpeedIcon.js +1 -1
  295. package/dist/features/RequirementAI/components/citations/audio-citation/icons/VideoIcon.js +1 -1
  296. package/dist/features/RequirementAI/components/citations/audio-citation/searchwaveform.js +1 -1
  297. package/dist/features/RequirementAI/components/citations/audio-citation/store/autoplay.wavefrom.js +1 -1
  298. package/dist/features/RequirementAI/components/citations/big-enough/BigEnoughCitationRenderer.js +1 -1
  299. package/dist/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.js +1 -1
  300. package/dist/features/RequirementAI/components/citations/file-citation/DocumentCitationIcon.js +1 -1
  301. package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
  302. package/dist/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
  303. package/dist/features/RequirementAI/components/citations/gpt-web-citation/GptWebCitationRenderer.js +1 -1
  304. package/dist/features/RequirementAI/components/citations/gpt-web-citation/GptWebcitationPanel.js +1 -1
  305. package/dist/features/RequirementAI/components/citations/image-citation/ImageCitationContent.js +1 -1
  306. package/dist/features/RequirementAI/components/citations/image-citation/ImageCitationIcon.js +1 -1
  307. package/dist/features/RequirementAI/components/citations/image-citation/ImageCitationRenderer.js +1 -1
  308. package/dist/features/RequirementAI/components/citations/rca-citation/RCACitationContent.js +1 -1
  309. package/dist/features/RequirementAI/components/citations/rca-citation/RCACitationRenderer.js +1 -1
  310. package/dist/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.js +1 -1
  311. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
  312. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationRenderer.js +1 -1
  313. package/dist/features/RequirementAI/components/citations/readfile-citation/icons/ExternalLinkIcon.js +1 -1
  314. package/dist/features/RequirementAI/components/citations/readfile-citation/icons/FileCodeIcon.js +1 -1
  315. package/dist/features/RequirementAI/components/citations/stormee-citation/StormeeCitationRenderer.js +1 -1
  316. package/dist/features/RequirementAI/components/citations/stormee-citation/StormeeContent.js +1 -1
  317. package/dist/features/RequirementAI/components/citations/stormee-citation/components/GradientButton.js +1 -1
  318. package/dist/features/RequirementAI/components/citations/stormee-citation/components/ProblemStatementCard.js +1 -1
  319. package/dist/features/RequirementAI/components/citations/web-citation/FullScreenIcon.js +1 -1
  320. package/dist/features/RequirementAI/components/citations/web-citation/ImagePreviewDialog.js +1 -1
  321. package/dist/features/RequirementAI/components/citations/web-citation/WebCitation.js +1 -1
  322. package/dist/features/RequirementAI/components/citations/web-citation/WebCitationIcon.js +1 -1
  323. package/dist/features/RequirementAI/components/citations/web-citation/WebCitationRenderer.js +1 -1
  324. package/dist/features/RequirementAI/components/citations/web-citation/WebCitationWithImageContent.js +1 -1
  325. package/dist/features/RequirementAI/components/citations/web-citation/WebCitationWithImageRenderer.js +1 -1
  326. package/dist/features/RequirementAI/components/cra/PartialRequirementContent.js +1 -1
  327. package/dist/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
  328. package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
  329. package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterContentWrapper.js +1 -1
  330. package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterItem.js +1 -1
  331. package/dist/features/RequirementAI/components/lsc-reason-gap/gapFilterSvgs.js +1 -1
  332. package/dist/features/RequirementAI/components/segment/DeleteSegmentsDialog.js +1 -1
  333. package/dist/features/RequirementAI/components/segment/EditSegmentDialog.js +1 -1
  334. package/dist/features/RequirementAI/components/segment/ExampleComponentWrapper.js +1 -1
  335. package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
  336. package/dist/features/RequirementAI/components/segment/SegmentLoader.js +1 -1
  337. package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  338. package/dist/features/RequirementAI/components/story-screen/BigEnoughPanel.js +1 -1
  339. package/dist/features/RequirementAI/components/story-screen/CompletionPanel.js +1 -1
  340. package/dist/features/RequirementAI/components/story-screen/ReplaceLearnedTags.js +1 -1
  341. package/dist/features/RequirementAI/components/story-screen/StreamingScreenSidebar.js +1 -1
  342. package/dist/features/RequirementAI/components/story-screen/SubfeatureBlock.js +1 -1
  343. package/dist/features/RequirementAI/components/story-screen/UserStoryScreen.js +1 -1
  344. package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  345. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ApprovalBadge/ApprovalBadge.js +1 -1
  346. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ApprovalSidebar/ApprovalSidebar.js +1 -1
  347. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ApprovalSidebarItem/ApprovalSidebarItem.js +1 -1
  348. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ApprovalStatusBadge/ApprovalStatusBadge.js +1 -1
  349. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ContentBlock/ContentBlock.js +1 -1
  350. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.js +1 -1
  351. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  352. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
  353. package/dist/features/RequirementAI/components/userstory-with-citation/components/HighlightButtonComponent.js +1 -1
  354. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.js +2 -0
  355. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.js.map +1 -0
  356. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.module.css.js +2 -0
  357. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.module.css.js.map +1 -0
  358. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  359. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
  360. package/dist/features/RequirementAI/hooks/useApprovalStatus.js +1 -1
  361. package/dist/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
  362. package/dist/features/RequirementAI/icons/AiGapIcon.js +1 -1
  363. package/dist/features/RequirementAI/icons/AiReasoningIcon.js +1 -1
  364. package/dist/features/RequirementAI/icons/BigEnoughIcon.js +1 -1
  365. package/dist/features/RequirementAI/icons/BookmarkIcon.js +1 -1
  366. package/dist/features/RequirementAI/icons/BrainRed.js +1 -1
  367. package/dist/features/RequirementAI/icons/CDIcon.js +1 -1
  368. package/dist/features/RequirementAI/icons/CheckIcon.js +1 -1
  369. package/dist/features/RequirementAI/icons/ChevronDownIcon.js +1 -1
  370. package/dist/features/RequirementAI/icons/ChevronUpIcon.js +1 -1
  371. package/dist/features/RequirementAI/icons/CognitiveDecision.js +1 -1
  372. package/dist/features/RequirementAI/icons/MeetingHighlightsIcon.js +1 -1
  373. package/dist/features/RequirementAI/icons/MenuUnfoldIcon.js +1 -1
  374. package/dist/features/RequirementAI/icons/PencilIcon.js +1 -1
  375. package/dist/features/RequirementAI/icons/ReasoningBulbIcon.js +1 -1
  376. package/dist/features/RequirementAI/icons/RelevanceScoreIcon.js +1 -1
  377. package/dist/features/RequirementAI/icons/SidebarCloseIcon.js +1 -1
  378. package/dist/features/RequirementAI/icons/SidebarOpenIcon.js +1 -1
  379. package/dist/features/RequirementAI/icons/TrashIcon.js +1 -1
  380. package/dist/features/RequirementAI/shared/Accordian.js +1 -1
  381. package/dist/features/RequirementAI/shared/AtomicButton.js +1 -1
  382. package/dist/features/RequirementAI/shared/CitationAIConfidenceDisplay.js +1 -1
  383. package/dist/features/RequirementAI/shared/CitationLoadingIndicator.js +1 -1
  384. package/dist/features/RequirementAI/shared/CodeViewer.js +1 -1
  385. package/dist/features/RequirementAI/shared/ExpandableOl.js +1 -1
  386. package/dist/features/RequirementAI/shared/GeneratedCodeCitation.js +1 -1
  387. package/dist/features/RequirementAI/shared/ReqAiCitationRenderer.js +1 -1
  388. package/dist/features/RequirementAI/shared/UpdatedAnimationContent.js +1 -1
  389. package/dist/features/RequirementAI/store/markdown-context.js +1 -1
  390. package/dist/features/RequirementAI/store/ref.context.js +1 -1
  391. package/dist/features/RequirementAI/utils/diff-edit.utils.js +1 -1
  392. package/dist/features/RequirementAI/utils/helpers.js +1 -1
  393. package/dist/features/RequirementAI/utils/learned-tag.utils.js +1 -1
  394. package/dist/features/RequirementAI/utils/userstory-approval.utils.js +1 -1
  395. package/dist/features/RequirementAiCitations/AiReasoning/components/AIConfidenceDisplay.js +1 -1
  396. package/dist/features/RequirementAiCitations/AiReasoning/components/icons/DocumentCitationIcon.js +1 -1
  397. package/dist/features/RequirementAiCitations/AiReasoning/components/icons/RelevanceScoreIcon.js +1 -1
  398. package/dist/features/UserStoryImport/UserStoryPicker.js +1 -1
  399. package/dist/features/UserStoryImport/UserStoryPicker.theme.js +1 -1
  400. package/dist/features/UserStoryImport/components/BackNav.js +1 -1
  401. package/dist/features/UserStoryImport/components/Badge.js +1 -1
  402. package/dist/features/UserStoryImport/components/BrowseProjectsButton.js +1 -1
  403. package/dist/features/UserStoryImport/components/CardGrid.js +1 -1
  404. package/dist/features/UserStoryImport/components/CardProceedButton.js +1 -1
  405. package/dist/features/UserStoryImport/components/ContentArea.js +1 -1
  406. package/dist/features/UserStoryImport/components/Footer.js +1 -1
  407. package/dist/features/UserStoryImport/components/Header.js +1 -1
  408. package/dist/features/UserStoryImport/components/NavRow.js +1 -1
  409. package/dist/features/UserStoryImport/components/ProceedButton.js +1 -1
  410. package/dist/features/UserStoryImport/components/ProjectCard.js +1 -1
  411. package/dist/features/UserStoryImport/components/ResizeHandle.js +1 -1
  412. package/dist/features/UserStoryImport/components/ScopeDropdown.js +1 -1
  413. package/dist/features/UserStoryImport/components/SearchInput.js +1 -1
  414. package/dist/features/UserStoryImport/components/SectionHeading.js +1 -1
  415. package/dist/features/UserStoryImport/components/ShowMore.js +1 -1
  416. package/dist/features/UserStoryImport/components/Sidebar.js +1 -1
  417. package/dist/features/UserStoryImport/components/SidebarFavoritesList.js +1 -1
  418. package/dist/features/UserStoryImport/components/SidebarProjectList.js +1 -1
  419. package/dist/features/UserStoryImport/components/SidebarSection.js +1 -1
  420. package/dist/features/UserStoryImport/components/SortDropdown.js +1 -1
  421. package/dist/features/UserStoryImport/components/SplitLayout.js +1 -1
  422. package/dist/features/UserStoryImport/components/Toolbar.js +1 -1
  423. package/dist/features/UserStoryImport/components/TypeDropdown.js +1 -1
  424. package/dist/features/UserStoryImport/components/UserStoryCard.js +1 -1
  425. package/dist/features/UserStoryImport/components/UserStoryImportDialog.js +1 -1
  426. package/dist/features/UserStoryImport/components/UserStoryScopeDropdown.js +1 -1
  427. package/dist/features/UserStoryImport/hooks/useUSPData.js +1 -1
  428. package/dist/features/UserStoryImport/hooks/useUserStoryPickerState.js +1 -1
  429. package/dist/features/UserStoryImport/lib/CustomTooltip.js +1 -1
  430. package/dist/features/UserStoryImport/lib/Tooltip.js +1 -1
  431. package/dist/features/UserStoryImport/lib/dialog.js +1 -1
  432. package/dist/index.js +1 -1
  433. package/dist/service/redlineService.js +2 -0
  434. package/dist/service/redlineService.js.map +1 -0
  435. package/dist/types/src/App.d.ts.map +1 -1
  436. package/dist/types/src/RedlineEditorTest.d.ts +3 -0
  437. package/dist/types/src/RedlineEditorTest.d.ts.map +1 -0
  438. package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
  439. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +40 -1
  440. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
  441. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/Editor.d.ts +2 -1
  442. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/Editor.d.ts.map +1 -1
  443. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.d.ts +1 -4
  444. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.d.ts.map +1 -1
  445. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InitialHtml.d.ts.map +1 -1
  446. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.d.ts +4 -3
  447. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.d.ts.map +1 -1
  448. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InvisibleNode.d.ts +35 -0
  449. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InvisibleNode.d.ts.map +1 -0
  450. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.d.ts +26 -0
  451. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.d.ts.map +1 -0
  452. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/PreservedNode.d.ts +23 -0
  453. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/PreservedNode.d.ts.map +1 -0
  454. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.d.ts +26 -0
  455. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.d.ts.map +1 -0
  456. package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts +1 -0
  457. package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  458. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +9 -4
  459. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  460. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +45 -11
  461. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  462. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.d.ts +7 -0
  463. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.d.ts.map +1 -0
  464. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts +25 -0
  465. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts.map +1 -0
  466. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +15 -3
  467. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  468. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +9 -2
  469. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  470. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +2 -0
  471. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
  472. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
  473. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +4 -0
  474. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  475. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.d.ts +11 -0
  476. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.d.ts.map +1 -0
  477. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +3 -1
  478. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
  479. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +22 -13
  480. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
  481. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +2 -0
  482. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
  483. package/dist/types/src/index.d.ts +2 -0
  484. package/dist/types/src/index.d.ts.map +1 -1
  485. package/dist/types/src/service/redlineService.d.ts +33 -0
  486. package/dist/types/src/service/redlineService.d.ts.map +1 -0
  487. package/dist/types/src/utils/tagHelper.d.ts +5 -0
  488. package/dist/types/src/utils/tagHelper.d.ts.map +1 -0
  489. package/dist/utils/tagHelper.js +2 -0
  490. package/dist/utils/tagHelper.js.map +1 -0
  491. package/package.json +17 -1
@@ -1,2 +1,2 @@
1
- import{jsxs as o,jsx as e,Fragment as n}from"react/jsx-runtime";import{useState as i,useRef as l}from"react";import s from"../../icons/BigEnoughIcon.js";import r from"../ai-reasoning/AiReasoningCitationContent.js";import{useRequirementAI as t}from"../RequirementAIWrapper/RequirementAIWrapper.js";import a from"./BigEnoughPanel.module.css.js";const c=({customIcons:c,customStyles:d,currentUserStory:u,panelStyles:g,showPanel:p=!1})=>{var v,m,_,b;t();const[h,f]=i(!!p),y=l(null);return o("div",Object.assign({onClick:o=>o.stopPropagation()},{children:[!p&&e("button",Object.assign({ref:y,className:a.developerEffortButton,style:null==g?void 0:g.buttonStyle,onClick:o=>{o.stopPropagation(),f(o=>!o)}},{children:e(s,{color:null==g?void 0:g.iconColor,size:null==g?void 0:g.iconSize})})),h&&o(n,{children:[e("div",{className:null==a?void 0:a.backdrop,style:p?null==g?void 0:g.showPanelBackdropStyles:null==g?void 0:g.backdropStyle,onClick:o=>{o.stopPropagation(),f(!1)},onWheel:o=>o.stopPropagation()}),e("div",Object.assign({className:`${a.dropdown} ${p?a.showPanelDropdown:""}`,style:Object.assign(Object.assign({},null==g?void 0:g.dropdownStyle),p?null==g?void 0:g.showPanelDropdownStyle:{})},{children:e(r,{cognitiveDecisionHeaders:{mainHeader:`Feature Implementation Score - ${(null==u?void 0:u.big_enough)||0}`},big_enough_block:null===(v=u.big_enough_decision_factors)||void 0===v?void 0:v.big_enough_block,aiReason:{relevance_score:(null===(m=null==u?void 0:u.big_enough_decision_factors)||void 0===m?void 0:m.relevance_score)||0,reason:(null===(_=null==u?void 0:u.big_enough_decision_factors)||void 0===_?void 0:_.score_reason)||"",gap:(null===(b=null==u?void 0:u.big_enough_decision_factors)||void 0===b?void 0:b.gap)||"",id:"big-enough-cd"},customIcons:c,customStyles:d})}))]})]}))};export{c as BigEnoughPanel};
1
+ import{jsxs as o,jsx as e,Fragment as n}from"react/jsx-runtime";import{useState as i,useRef as l}from"react";import r from"../../icons/BigEnoughIcon.js";import t from"../ai-reasoning/AiReasoningCitationContent.js";import{useRequirementAI as s}from"../RequirementAIWrapper/RequirementAIWrapper.js";import a from"./BigEnoughPanel.module.css.js";const c=({customIcons:c,customStyles:d,currentUserStory:u,panelStyles:p,showPanel:g=!1})=>{var v,m,_,h;s();const[b,f]=i(!!g),y=l(null);return o("div",{onClick:o=>o.stopPropagation(),children:[!g&&e("button",{ref:y,className:a.developerEffortButton,style:null==p?void 0:p.buttonStyle,onClick:o=>{o.stopPropagation(),f(o=>!o)},children:e(r,{color:null==p?void 0:p.iconColor,size:null==p?void 0:p.iconSize})}),b&&o(n,{children:[e("div",{className:null==a?void 0:a.backdrop,style:g?null==p?void 0:p.showPanelBackdropStyles:null==p?void 0:p.backdropStyle,onClick:o=>{o.stopPropagation(),f(!1)},onWheel:o=>o.stopPropagation()}),e("div",{className:`${a.dropdown} ${g?a.showPanelDropdown:""}`,style:{...null==p?void 0:p.dropdownStyle,...g?null==p?void 0:p.showPanelDropdownStyle:{}},children:e(t,{cognitiveDecisionHeaders:{mainHeader:`Feature Implementation Score - ${(null==u?void 0:u.big_enough)||0}`},big_enough_block:null===(v=u.big_enough_decision_factors)||void 0===v?void 0:v.big_enough_block,aiReason:{relevance_score:(null===(m=null==u?void 0:u.big_enough_decision_factors)||void 0===m?void 0:m.relevance_score)||0,reason:(null===(_=null==u?void 0:u.big_enough_decision_factors)||void 0===_?void 0:_.score_reason)||"",gap:(null===(h=null==u?void 0:u.big_enough_decision_factors)||void 0===h?void 0:h.gap)||"",id:"big-enough-cd"},customIcons:c,customStyles:d})})]})]})};export{c as BigEnoughPanel};
2
2
  //# sourceMappingURL=BigEnoughPanel.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as o,Fragment as n}from"react/jsx-runtime";import{useState as t,useRef as i,useEffect as s}from"react";import l from"../ai-reasoning/AiReasoningCitationContent.js";import a from"./CompletionPanel.module.css.js";import r from"../../icons/CDIcon.js";import{Loader2 as c,Check as m}from"lucide-react";const d=({customIcons:d,customStyles:p,currentUserStory:u,panelStyles:g,showPanel:v=!1,children:C,onToggleStateChange:h,completionPanelConfig:k})=>{var f,y,j,w,b;const[_,P]=t(!!v),S=null!==(f=null==u?void 0:u.completion_percentage)&&void 0!==f?f:0,N=i(null),O=i(null),{isMarkingComplete:I=!1,markedComplete:D=!1,onMarkAsComplete:M}=null!=k?k:{},B=()=>{P(!1),null==h||h(!1)},E=e=>{e.stopPropagation(),P(e=>{const o=!e;return null==h||h(o),o})};return s(()=>{if(!_)return;const e=e=>{O.current&&!O.current.contains(e.target)&&B()},o=e=>{"Escape"===e.key&&(P(!1),null==h||h(!1))};return document.addEventListener("mousedown",e,!0),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",e,!0),document.removeEventListener("keydown",o)}},[_,h]),e("div",Object.assign({ref:O,className:a.triggerWrapper,style:null==g?void 0:g.triggerWrapperStyle},{children:[!v&&o(n,{children:C?o("div",Object.assign({className:a.completionButton,style:null==g?void 0:g.completionButtonStyle,onClick:E},{children:C})):o("button",Object.assign({ref:N,className:a.completionIconButton,style:null==g?void 0:g.completionIconButtonStyle,onClick:E},{children:o(r,{})}))}),_&&o("div",Object.assign({className:`${a.dropdown} ${v?a.showPanelDropdown:""}`,style:Object.assign(Object.assign({},null==g?void 0:g.dropdownStyle),v?null==g?void 0:g.showPanelDropdownStyle:{}),onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()},{children:o(l,{aiReason:{explanation:(null===(y=u.completion_decision_factors)||void 0===y?void 0:y.explanation)||"",relevance_score:(null===(j=u.completion_decision_factors)||void 0===j?void 0:j.relevance_score)||0,reason:(null===(w=u.completion_decision_factors)||void 0===w?void 0:w.score_reason)||"",gap:(null===(b=u.completion_decision_factors)||void 0===b?void 0:b.gap)||"",id:"completion-cd"},customIcons:d,customStyles:p,footer:e("div",Object.assign({className:a.markCompleteContainer},{children:[o("h4",Object.assign({className:a.markCompleteTitle},{children:"Mark this section as complete?"})),e("p",Object.assign({className:a.markCompleteDescription},{children:["AI estimates this section is"," ",S,"% complete. If you're satisfied with the content, you can mark it as complete."]})),e("button",Object.assign({className:a.markCompleteButton,disabled:I||D,onClick:e=>{e.stopPropagation(),null==M||M(),B()}},{children:[I?o(c,{size:18,className:a.markCompleteSpinner}):o(m,{size:18,strokeWidth:3,className:a.markCompleteIcon}),o("span",{children:D?"Marked Complete":"Mark as Complete"})]}))]}))})}))]}))};export{d as CompletionPanel,d as default};
1
+ import{jsxs as e,jsx as o,Fragment as n}from"react/jsx-runtime";import{useState as t,useRef as l,useEffect as i}from"react";import r from"../ai-reasoning/AiReasoningCitationContent.js";import s from"./CompletionPanel.module.css.js";import a from"../../icons/CDIcon.js";import{Loader2 as c,Check as m}from"lucide-react";const d=({customIcons:d,customStyles:p,currentUserStory:u,panelStyles:v,showPanel:C=!1,children:h,onToggleStateChange:k,completionPanelConfig:g})=>{var f,y,w,_,P;const[S,N]=t(!!C),I=null!==(f=null==u?void 0:u.completion_percentage)&&void 0!==f?f:0,D=l(null),M=l(null),{isMarkingComplete:B=!1,markedComplete:E=!1,onMarkAsComplete:j}=null!=g?g:{},x=()=>{N(!1),null==k||k(!1)},L=e=>{e.stopPropagation(),N(e=>{const o=!e;return null==k||k(o),o})};return i(()=>{if(!S)return;const e=e=>{M.current&&!M.current.contains(e.target)&&x()},o=e=>{"Escape"===e.key&&(N(!1),null==k||k(!1))};return document.addEventListener("mousedown",e,!0),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",e,!0),document.removeEventListener("keydown",o)}},[S,k]),e("div",{ref:M,className:s.triggerWrapper,style:null==v?void 0:v.triggerWrapperStyle,children:[!C&&o(n,{children:h?o("div",{className:s.completionButton,style:null==v?void 0:v.completionButtonStyle,onClick:L,children:h}):o("button",{ref:D,className:s.completionIconButton,style:null==v?void 0:v.completionIconButtonStyle,onClick:L,children:o(a,{})})}),S&&o("div",{className:`${s.dropdown} ${C?s.showPanelDropdown:""}`,style:{...null==v?void 0:v.dropdownStyle,...C?null==v?void 0:v.showPanelDropdownStyle:{}},onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:o(r,{aiReason:{explanation:(null===(y=u.completion_decision_factors)||void 0===y?void 0:y.explanation)||"",relevance_score:(null===(w=u.completion_decision_factors)||void 0===w?void 0:w.relevance_score)||0,reason:(null===(_=u.completion_decision_factors)||void 0===_?void 0:_.score_reason)||"",gap:(null===(P=u.completion_decision_factors)||void 0===P?void 0:P.gap)||"",id:"completion-cd"},customIcons:d,customStyles:p,footer:e("div",{className:s.markCompleteContainer,children:[o("h4",{className:s.markCompleteTitle,children:"Mark this section as complete?"}),e("p",{className:s.markCompleteDescription,children:["AI estimates this section is"," ",I,"% complete. If you're satisfied with the content, you can mark it as complete."]}),e("button",{className:s.markCompleteButton,disabled:B||E,onClick:e=>{e.stopPropagation(),null==j||j(),x()},children:[B?o(c,{size:18,className:s.markCompleteSpinner}):o(m,{size:18,strokeWidth:3,className:s.markCompleteIcon}),o("span",{children:E?"Marked Complete":"Mark as Complete"})]})]})})})]})};export{d as CompletionPanel,d as default};
2
2
  //# sourceMappingURL=CompletionPanel.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Info as t}from"lucide-react";import{v4 as r}from"uuid";import{Tooltip as i}from"@mui/material";import l from"./ReplaceLearnedTags.module.css.js";function n(n){const o=[],s=/<learned>(.*?)<\/learned>/g;let c,p=0,a=0;for(;null!==(c=s.exec(n));){const[m,u]=c,d=c.index;d>p&&o.push(e("span",{children:n.slice(p,d)},"text-pre-"+a++)),o.push(e(i,Object.assign({title:u,placement:"top"},{children:e(t,{size:16,className:l.linkText})}),`tooltip-${r()}`)),p=s.lastIndex}return p<(null==n?void 0:n.length)&&o.push(e("span",{children:n.slice(p)},"text-post-"+a++)),o}export{n as replaceLearnedTagsWithInfo};
1
+ import{jsx as e}from"react/jsx-runtime";import{Info as t}from"lucide-react";import{v4 as r}from"uuid";import{Tooltip as l}from"@mui/material";import i from"./ReplaceLearnedTags.module.css.js";function n(n){const o=[],s=/<learned>(.*?)<\/learned>/g;let p,c=0,m=0;for(;null!==(p=s.exec(n));){const[a,u]=p,d=p.index;d>c&&o.push(e("span",{children:n.slice(c,d)},"text-pre-"+m++)),o.push(e(l,{title:u,placement:"top",children:e(t,{size:16,className:i.linkText})},`tooltip-${r()}`)),c=s.lastIndex}return c<(null==n?void 0:n.length)&&o.push(e("span",{children:n.slice(c)},"text-post-"+m++)),o}export{n as replaceLearnedTagsWithInfo};
2
2
  //# sourceMappingURL=ReplaceLearnedTags.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import{useRequirementAI as i}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{Bookmark as n}from"lucide-react";import{useState as a}from"react";import{replaceLearnedTagsWithInfo as l}from"./ReplaceLearnedTags.js";import r from"./StreamingScreenSidebar.module.css.js";import{extractAllAiReasoningIds as o,stripAiReasoningAnchors as c}from"../../utils/helpers.js";import d from"../ai-reasoning/AiReasoningCitation.js";const m=({customStyles:s})=>t("div",Object.assign({className:r.skeleton,style:s},{children:[e("div",{className:r.skeletonLineSmall,style:null==s?void 0:s.skeletonLine}),e("div",{className:r.skeletonLineLarge,style:null==s?void 0:s.skeletonLine})]})),g=({isSidebarExpanded:g,selectedStreamingStoryIndex:u,setSelectedStreamingStoryIndex:p,streamingUserStories:v,isStreamingScreen:y,artifactTitleIds:b})=>{var h,j;const{customStyles:S,aiReasoning:f}=i(),O=null===(h=null==S?void 0:S.userStoryScreenStyles)||void 0===h?void 0:h.streamingSidebar,[N,I]=a({}),k=null===(j=v||[])||void 0===j?void 0:j.map((e,t)=>({artifactTitleId:b[t]||"",artifactId:e.artifactId,title:e.title,description:(null==e?void 0:e.description)||""})),C=(e,t)=>{const s=N[e],i=c(t);return s?i:i.length>116?i.slice(0,116)+"...":i};return e("div",Object.assign({className:`${r.container} ${g?r.expanded:r.collapsed}`,style:null==O?void 0:O.container},{children:t("div",Object.assign({className:r.sidebar,style:null==O?void 0:O.sidebarInner},{children:[e("div",Object.assign({className:r.header,style:null==O?void 0:O.header},{children:e("h2",Object.assign({className:r.title,style:null==O?void 0:O.title},{children:"User stories"}))})),e("div",Object.assign({className:r.storiesContainer,style:null==O?void 0:O.storiesContainer},{children:k.length>0?e(s,{children:k.map((s,i)=>{const a=o(s.description).map(e=>f.find(t=>t.id.toString()===e)).filter(Boolean);return e("div",Object.assign({onClick:()=>{p(i)},className:`${r.storyItem} ${i===k.length-1?r.borderBottom:""} ${u===i?r.activeStory:""}`,style:Object.assign(Object.assign({},null==O?void 0:O.storyItem),u===i?null==O?void 0:O.activeStory:{})},{children:t("div",Object.assign({className:r.storyContent,style:null==O?void 0:O.storyContent},{children:[t("div",Object.assign({className:r.storyHeader,style:null==O?void 0:O.storyHeader},{children:[e("span",Object.assign({className:r.iconGroup},{children:e(n,{className:r.bookmarkIcon,style:null==O?void 0:O.bookmarkIcon})})),y&&e("span",Object.assign({className:r.badge,style:null==O?void 0:O.badge},{children:"Generating..."}))]})),t("span",Object.assign({className:r.storyTitle,style:null==O?void 0:O.storyTitle},{children:[t("span",{children:[i+1,"."]}),l(s.title)]})),t("span",Object.assign({className:r.description,style:null==O?void 0:O.description},{children:[C(s.artifactId,s.description),s.description.length>116&&e("button",Object.assign({onClick:e=>{var t;e.stopPropagation(),t=s.artifactId,I(e=>Object.assign(Object.assign({},e),{[t]:!e[t]}))},className:r.moreButton,style:null==O?void 0:O.moreButton},{children:N[s.artifactId]?"less":"more"})),a.length>0&&e("span",Object.assign({className:r.aiReasoningContainer,onClick:e=>e.stopPropagation(),"data-sidebar-citation-streaming":"true"},{children:a.map(t=>e(d,{aiReason:t,isSourceHasHighlight:!1},null==t?void 0:t.id))}))]}))]}))}),s.artifactId)})}):e(m,{customStyles:null==O?void 0:O.skeleton})}))]}))}))};export{g as default};
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{useRequirementAI as l}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{Bookmark as s}from"lucide-react";import{useState as n}from"react";import{replaceLearnedTagsWithInfo as r}from"./ReplaceLearnedTags.js";import a from"./StreamingScreenSidebar.module.css.js";import{extractAllAiReasoningIds as o,stripAiReasoningAnchors as d}from"../../utils/helpers.js";import c from"../ai-reasoning/AiReasoningCitation.js";const m=({customStyles:i})=>t("div",{className:a.skeleton,style:i,children:[e("div",{className:a.skeletonLineSmall,style:null==i?void 0:i.skeletonLine}),e("div",{className:a.skeletonLineLarge,style:null==i?void 0:i.skeletonLine})]}),u=({isSidebarExpanded:u,selectedStreamingStoryIndex:p,setSelectedStreamingStoryIndex:v,streamingUserStories:y,isStreamingScreen:h,artifactTitleIds:g})=>{var S,f;const{customStyles:N,aiReasoning:I}=l(),k=null===(S=null==N?void 0:N.userStoryScreenStyles)||void 0===S?void 0:S.streamingSidebar,[b,C]=n({}),R=null===(f=y||[])||void 0===f?void 0:f.map((e,t)=>({artifactTitleId:g[t]||"",artifactId:e.artifactId,title:e.title,description:(null==e?void 0:e.description)||""})),j=(e,t)=>{const i=b[e],l=d(t);return i?l:l.length>116?l.slice(0,116)+"...":l};return e("div",{className:`${a.container} ${u?a.expanded:a.collapsed}`,style:null==k?void 0:k.container,children:t("div",{className:a.sidebar,style:null==k?void 0:k.sidebarInner,children:[e("div",{className:a.header,style:null==k?void 0:k.header,children:e("h2",{className:a.title,style:null==k?void 0:k.title,children:"User stories"})}),e("div",{className:a.storiesContainer,style:null==k?void 0:k.storiesContainer,children:R.length>0?e(i,{children:R.map((i,l)=>{const n=o(i.description).map(e=>I.find(t=>t.id.toString()===e)).filter(Boolean);return e("div",{onClick:()=>{v(l)},className:`${a.storyItem} ${l===R.length-1?a.borderBottom:""} ${p===l?a.activeStory:""}`,style:{...null==k?void 0:k.storyItem,...p===l?null==k?void 0:k.activeStory:{}},children:t("div",{className:a.storyContent,style:null==k?void 0:k.storyContent,children:[t("div",{className:a.storyHeader,style:null==k?void 0:k.storyHeader,children:[e("span",{className:a.iconGroup,children:e(s,{className:a.bookmarkIcon,style:null==k?void 0:k.bookmarkIcon})}),h&&e("span",{className:a.badge,style:null==k?void 0:k.badge,children:"Generating..."})]}),t("span",{className:a.storyTitle,style:null==k?void 0:k.storyTitle,children:[t("span",{children:[l+1,"."]}),r(i.title)]}),t("span",{className:a.description,style:null==k?void 0:k.description,children:[j(i.artifactId,i.description),i.description.length>116&&e("button",{onClick:e=>{var t;e.stopPropagation(),t=i.artifactId,C(e=>({...e,[t]:!e[t]}))},className:a.moreButton,style:null==k?void 0:k.moreButton,children:b[i.artifactId]?"less":"more"}),n.length>0&&e("span",{className:a.aiReasoningContainer,onClick:e=>e.stopPropagation(),"data-sidebar-citation-streaming":"true",children:n.map(t=>e(c,{aiReason:t,isSourceHasHighlight:!1},null==t?void 0:t.id))})]})]})},i.artifactId)})}):e(m,{customStyles:null==k?void 0:k.skeleton})})]})})};export{u as default};
2
2
  //# sourceMappingURL=StreamingScreenSidebar.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as t,jsx as e,Fragment as i}from"react/jsx-runtime";import{useState as s,useEffect as o}from"react";import{PencilIcon as n,ChevronDown as r}from"lucide-react";import{useRequirementAI as a}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{formatMarkdown as l,indentMarkdown as c}from"../../utils/helpers.js";import d from"../RichTextEditor/RichTextEditor.js";import u from"../userstory-with-citation/UserStoryWithCitation.js";import m from"../../shared/AtomicButton.js";import p from"./SubfeatureBlock.module.css.js";const g=({parentArtifactId:g,artifactId:v,title:h,content:y,isEditingModeOn:b,setIsEditingModeOn:f,isCitationLoadingDisplay:j=!1})=>{var O,S;const{userStory:I,setUserStory:N,customStyles:B,customIcons:C,segmentComponentConfig:W}=a(),k=null===(O=null==B?void 0:B.userStoryScreenStyles)||void 0===O?void 0:O.subFeatureBlock,x=null===(S=null==B?void 0:B.userStoryScreenStyles)||void 0===S?void 0:S.userStoryContentStyles,[A,w]=s(!0),[E,R]=s(!1),[T,F]=s(I);o(()=>{F(I)},[I]);return t("div",Object.assign({className:p.container,style:null==k?void 0:k.container},{children:[t("button",Object.assign({onClick:()=>{w(t=>!t)},className:p.toggleButton,style:null==k?void 0:k.toggleButton},{children:[e("h1",Object.assign({className:p.title,style:null==k?void 0:k.title},{children:h})),t("div",Object.assign({className:p.subFeatureToolbar,style:null==k?void 0:k.subFeatureToolbar},{children:[A&&e("div",Object.assign({className:p.actionBar,style:null==k?void 0:k.actionBar},{children:E?t("div",Object.assign({className:p.editingActions},{children:[e(m,{type:"outline",children:"Cancel",onClick:t=>{t.stopPropagation(),R(!1),f(!1)}}),e(m,{type:"fill",children:"Save",onClick:t=>{t.stopPropagation(),N(T),R(!1),f(!1)}})]})):!b&&e("div",Object.assign({className:p.viewActions},{children:e("button",Object.assign({className:p.editButton,style:null==k?void 0:k.editButton,onClick:t=>{t.stopPropagation(),R(!0),f(!0)}},{children:e(n,{size:16})}))}))})),e(r,{className:`${p.chevron} ${A?p.chevronOpen:""}`,style:null==k?void 0:k.chevron})]}))]})),A&&e(i,{children:e("div",E?Object.assign({className:p.editorWrapper,style:null==k?void 0:k.editorWrapper},{children:e(d,{minHeight:"100%",height:"100%",type:"string",value:l(y)||"",handleUpdateState:(t,e)=>{const i=c(e);F(t=>{const e=[...t],s=e.findIndex(t=>t.artifactId===g);if(-1===s)return e;const o=e[s].sub_features;if(o){const t=o.findIndex(t=>t.artifactId===v);-1!==t&&(e[s]=Object.assign(Object.assign({},e[s]),{sub_features:o.map((e,s)=>s===t?Object.assign(Object.assign({},e),{value:i}):e)}))}return e})},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:"edit"})}):Object.assign({className:p.contentWrapper,style:null==k?void 0:k.contentWrapper},{children:e(u,{message:y,isCitationLoadingDisplay:j,customStyles:Object.assign({},x),customIcons:Object.assign({},null==C?void 0:C.userStoryIcons)})}))})]}),v)};export{g as default};
1
+ import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import{useState as i,useEffect as r}from"react";import{PencilIcon as n,ChevronDown as s}from"lucide-react";import{useRequirementAI as l}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{formatMarkdown as a,indentMarkdown as c}from"../../utils/helpers.js";import d from"../RichTextEditor/RichTextEditor.js";import u from"../userstory-with-citation/UserStoryWithCitation.js";import m from"../../shared/AtomicButton.js";import p from"./SubfeatureBlock.module.css.js";const v=({parentArtifactId:v,artifactId:h,title:y,content:f,isEditingModeOn:g,setIsEditingModeOn:S,isCitationLoadingDisplay:I=!1})=>{var N,B;const{userStory:C,setUserStory:b,customStyles:j,customIcons:W,segmentComponentConfig:k}=l(),x=null===(N=null==j?void 0:j.userStoryScreenStyles)||void 0===N?void 0:N.subFeatureBlock,A=null===(B=null==j?void 0:j.userStoryScreenStyles)||void 0===B?void 0:B.userStoryContentStyles,[w,E]=i(!0),[R,T]=i(!1),[F,M]=i(C);r(()=>{M(C)},[C]);return t("div",{className:p.container,style:null==x?void 0:x.container,children:[t("button",{onClick:()=>{E(t=>!t)},className:p.toggleButton,style:null==x?void 0:x.toggleButton,children:[e("h1",{className:p.title,style:null==x?void 0:x.title,children:y}),t("div",{className:p.subFeatureToolbar,style:null==x?void 0:x.subFeatureToolbar,children:[w&&e("div",{className:p.actionBar,style:null==x?void 0:x.actionBar,children:R?t("div",{className:p.editingActions,children:[e(m,{type:"outline",children:"Cancel",onClick:t=>{t.stopPropagation(),T(!1),S(!1)}}),e(m,{type:"fill",children:"Save",onClick:t=>{t.stopPropagation(),b(F),T(!1),S(!1)}})]}):!g&&e("div",{className:p.viewActions,children:e("button",{className:p.editButton,style:null==x?void 0:x.editButton,onClick:t=>{t.stopPropagation(),T(!0),S(!0)},children:e(n,{size:16})})})}),e(s,{className:`${p.chevron} ${w?p.chevronOpen:""}`,style:null==x?void 0:x.chevron})]})]}),w&&e(o,{children:e("div",R?{className:p.editorWrapper,style:null==x?void 0:x.editorWrapper,children:e(d,{minHeight:"100%",height:"100%",type:"string",value:a(f)||"",handleUpdateState:(t,e)=>{const o=c(e);M(t=>{const e=[...t],i=e.findIndex(t=>t.artifactId===v);if(-1===i)return e;const r=e[i].sub_features;if(r){const t=r.findIndex(t=>t.artifactId===h);-1!==t&&(e[i]={...e[i],sub_features:r.map((e,i)=>i===t?{...e,value:o}:e)})}return e})},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:"edit"})}:{className:p.contentWrapper,style:null==x?void 0:x.contentWrapper,children:e(u,{message:f,isCitationLoadingDisplay:I,customStyles:{...A},customIcons:{...null==W?void 0:W.userStoryIcons}})})})]},h)};export{v as default};
2
2
  //# sourceMappingURL=SubfeatureBlock.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{createContext as s,useState as l,useRef as i,useEffect as r,useContext as o}from"react";import{PanelGroup as a,Panel as d,PanelResizeHandle as c}from"react-resizable-panels";import{PencilIcon as u,ChevronDown as S}from"lucide-react";import{formatMarkdown as v,indentMarkdown as m}from"../../utils/helpers.js";import g from"./SubfeatureBlock.js";import y from"./UserStoryScreen.module.css.js";import{useRequirementAI as p}from"../RequirementAIWrapper/RequirementAIWrapper.js";const b=s(null),h=()=>{const e=o(b);if(!e)throw new Error("UserStoryScreen must be used inside its provider");return e},N=({AtomicButton:n})=>{var s,l;const{selectedStreamingStoryIndex:i,isCitationLoadingNotStarted:r,classNames:o,scenario:a}=h(),{userStory:d,customStyles:c}=p(),u=null==c?void 0:c.userStoryScreenStyles;return(null==d?void 0:d.length)?t("div",Object.assign({className:`${y.header} ${null!==(s=null==o?void 0:o.header)&&void 0!==s?s:""}`,style:null==u?void 0:u.header},{children:[t("div",Object.assign({className:y.headerLeftContainer},{children:[e("span",Object.assign({className:y.headerTitle,style:null==u?void 0:u.headerTitle},{children:null===(l=d[i])||void 0===l?void 0:l.title})),"streaming"===a&&t("span",Object.assign({className:y.headerSubtitle,style:null==u?void 0:u.headerSubtitle},{children:[e("span",Object.assign({className:y.streamingText,style:null==u?void 0:u.streamingText},{children:r?"Generating Requirement Doc":"Hang tight! We're loading the citations."}))," • Review & edit blocks as we build"]}))]})),e(O,{AtomicButton:n})]})):e(f,{classNames:o})},O=({AtomicButton:n})=>{const{isEditing:s,isEditingModeOn:l,setIsEditing:i,setIsEditingModeOn:r,userStoryCopy:o}=h(),{userStory:a,setUserStory:d,customStyles:c}=p(),S=null==c?void 0:c.userStoryScreenStyles;return(null==a?void 0:a.length)?s?t("div",Object.assign({className:y.actions,style:null==S?void 0:S.actions},{children:[e(n,Object.assign({type:"outline",onClick:()=>{i(!1),r(!1)},style:null==S?void 0:S.cancelAtomicButton},{children:"Cancel"})),e(n,Object.assign({type:"fill",onClick:()=>{d(o),i(!1),r(!1)},style:null==S?void 0:S.saveAtomicButton},{children:"Save"}))]})):l?null:e("div",Object.assign({className:y.editToggleWrapper},{children:e("button",Object.assign({className:y.editToggleBtn,style:null==S?void 0:S.editToggleBtn,onClick:()=>{i(!0),r(!0)}},{children:e(u,{size:16})}))})):null},f=({classNames:n})=>{var s;return t("div",Object.assign({className:`${y.header} ${null!==(s=null==n?void 0:n.header)&&void 0!==s?s:""}`},{children:[e("div",{className:y.skeletonTitle}),e("div",{className:y.skeletonSubtitle})]}))},I=()=>{var n;const{customStyles:s}=p(),l=null===(n=null==s?void 0:s.userStoryScreenStyles)||void 0===n?void 0:n.accordionSkeleton;return t("div",Object.assign({className:y.accordionSkeleton,style:null==l?void 0:l.wrapper},{children:[e("div",{className:y.skeletonLine,style:null==l?void 0:l.line}),e("div",{className:y.skeletonBox,style:null==l?void 0:l.box})]}))},j=()=>{var n;const{customStyles:s}=p(),l=null===(n=null==s?void 0:s.userStoryScreenStyles)||void 0===n?void 0:n.subFeatureSkeleton;return t("div",Object.assign({className:y.subFeatureSkeleton,style:null==l?void 0:l.wrapper},{children:[e("div",{className:y.skeletonLine,style:null==l?void 0:l.line}),e("div",{className:y.skeletonLine,style:null==l?void 0:l.line}),e("div",{className:y.skeletonLine,style:null==l?void 0:l.line})]}))},C=Object.assign(({scenario:t,isCitationLoadingNotStarted:n,children:s,classNames:o,artifactTitleIds:d})=>{var c,u,S,v,m;const{userStory:g,customStyles:h}=p(),[N,O]=l(0),[f,I]=l(!0),[j,C]=l(!1),[B,x]=l(!1),[E,T]=l(!1),[k,L]=l(!1),[R,A]=l(g),$=i(null),w=i(null);return r(()=>{A(g)},[g]),r(()=>{C(!0);const e=setTimeout(()=>C(!1),2e3);return()=>clearTimeout(e)},[null===(u=null===(c=null==g?void 0:g[N])||void 0===c?void 0:c.sub_features)||void 0===u?void 0:u.length]),r(()=>{const e=w.current;if(!e)return;const t=()=>{x(e.scrollHeight-e.scrollTop-e.clientHeight<20)};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)},[null==g?void 0:g[N]]),e(b.Provider,Object.assign({value:{scenario:t,isCitationLoadingNotStarted:n,selectedStreamingStoryIndex:N,setSelectedStreamingStoryIndex:O,isSidebarExpanded:f,setIsSidebarExpanded:I,sidebarPanelRef:$,isEditing:E,setIsEditing:T,isEditingModeOn:k,setIsEditingModeOn:L,userStoryCopy:R,setUserStoryCopy:A,scrollContainerRef:w,isAtBottom:B,isScrollBtnBouncing:j,scrollToBottom:()=>{w.current&&w.current.scrollTo({top:w.current.scrollHeight,behavior:"smooth"})},classNames:o,artifactTitleIds:d}},{children:e("div",Object.assign({className:`${y.container} ${null!==(S=null==o?void 0:o.container)&&void 0!==S?S:""}`,style:Object.assign({},null===(v=null==h?void 0:h.userStoryScreenStyles)||void 0===v?void 0:v.wrapperContainer)},{children:e(a,Object.assign({direction:"horizontal",className:y.panelGroup,style:null===(m=null==h?void 0:h.userStoryScreenStyles)||void 0===m?void 0:m.panelGroup},{children:s}))}))}))},{Sidebar:({Component:t})=>{var n;const{selectedStreamingStoryIndex:s,setSelectedStreamingStoryIndex:l,isSidebarExpanded:i,setIsSidebarExpanded:r,sidebarPanelRef:o,scenario:a,artifactTitleIds:c}=h(),{userStory:u,customStyles:S}=p();return e(d,Object.assign({ref:o,defaultSize:25,minSize:15,collapsible:!0,collapsedSize:0,onCollapse:()=>r(!1),onExpand:()=>r(!0),id:"streaming-sidebar",order:1,className:y.sidebarPanel,style:null===(n=null==S?void 0:S.userStoryScreenStyles)||void 0===n?void 0:n.sidebarPanel},{children:e(t,{streamingUserStories:u,selectedStreamingStoryIndex:s,setSelectedStreamingStoryIndex:l,isSidebarExpanded:i,isStreamingScreen:"streaming"===a,artifactTitleIds:c})}))},SidebarToggle:({OpenIcon:t,CloseIcon:n})=>{const{isSidebarExpanded:s,setIsSidebarExpanded:l,sidebarPanelRef:i}=h(),{customStyles:r}=p(),o=null==r?void 0:r.userStoryScreenStyles;return e(c,Object.assign({className:y.resizeHandle,style:null==o?void 0:o.resizeHandle},{children:e("button",Object.assign({className:y.sidebarToggleBtn,onClick:e=>{var t,n;e.stopPropagation(),s?null===(t=i.current)||void 0===t||t.collapse():null===(n=i.current)||void 0===n||n.expand()},style:null==o?void 0:o.sidebarToggleBtn},{children:e(s?n:t,{})}))}))},Content:({children:n,AtomicButton:s})=>{var l;const{scrollContainerRef:i,classNames:r}=h(),{customStyles:o}=p(),a=null==o?void 0:o.userStoryScreenStyles;return e(d,Object.assign({minSize:0,id:"streaming-content",order:2,className:y.contentPanel,style:null==a?void 0:a.contentPanel},{children:t("div",Object.assign({ref:i,className:`${y.scrollContainer} ${null!==(l=null==r?void 0:r.scrollContainer)&&void 0!==l?l:""}`,style:null==a?void 0:a.scrollContainer},{children:[e(N,{AtomicButton:s}),n]}))}))},Body:({children:t})=>{const{userStory:s,setUserStory:l}=p();return(null==s?void 0:s.length)?e(n,{children:t}):null},Story:({Component:t})=>{var n,s,l;const{selectedStreamingStoryIndex:i,isEditing:r,scenario:o}=h(),{userStory:a,customStyles:d,customIcons:c,segmentComponentConfig:u}=p(),S=null==d?void 0:d.userStoryScreenStyles,v=null==S?void 0:S.userStoryContentStyles;return r?null:e("div",Object.assign({className:y.storyWrapper,style:null==S?void 0:S.storyWrapper},{children:e(t,{message:null===(n=a[i])||void 0===n?void 0:n.value,aiReasoningsForBlock:(null===(s=a[i])||void 0===s?void 0:s.aiReasoning)||[],isCitationLoadingDisplay:"streaming"===o,customStyles:Object.assign({},v),customIcons:Object.assign({},null==c?void 0:c.userStoryIcons),artifactId:null===(l=a[i])||void 0===l?void 0:l.artifactId,segmentComponentConfig:u})}))},Editor:({Component:t,onBlur:n})=>{var s;const{selectedStreamingStoryIndex:l,isEditing:i,setUserStoryCopy:r}=h(),{userStory:o,customStyles:a}=p(),d=null==a?void 0:a.textEditorStyles;if(!i)return null;return e("div",Object.assign({className:y.editorWrapper,style:null==d?void 0:d.wrapper},{children:e(t,{minHeight:"100%",height:"100%",type:"string",value:v(null===(s=o[l])||void 0===s?void 0:s.value)||"",handleUpdateState:(e,t)=>{var n;const s=m(t),i=null===(n=o[l])||void 0===n?void 0:n.storyNumber;r(e=>{const t=[...e],n=t.findIndex(e=>e.storyNumber===i);return-1===n||(t[n]=Object.assign(Object.assign({},t[n]),{value:s})),t})},doNotShowBorderInViewMode:!1,onBlur:n,mode:"edit",customStyles:d})}))},SubFeatures:()=>{var s;const{selectedStreamingStoryIndex:l,isEditingModeOn:i,setIsEditingModeOn:r,scenario:o,isCitationLoadingNotStarted:a}=h(),{userStory:d}=p(),c=(null===(s=null==d?void 0:d[l])||void 0===s?void 0:s.sub_features)||[];return 0===c.length&&"streaming"===o?e(I,{}):t(n,{children:[c.map(t=>e(g,{parentArtifactId:null==d?void 0:d[l].artifactId,artifactId:t.artifactId,title:t.title,content:t.value,aiReasoning:t.aiReasoning||[],isEditingModeOn:i,setIsEditingModeOn:r,isCitationLoadingDisplay:"streaming"===o},t.artifactId)),"streaming"===o&&a&&e("div",Object.assign({className:y.subFeatureSkeletonWrapper},{children:e(j,{})}))]})},ScrollButton:()=>{const{isAtBottom:t,isSidebarExpanded:n,scrollToBottom:s,isScrollBtnBouncing:l}=h(),{userStory:i,customStyles:r}=p(),o=null==r?void 0:r.userStoryScreenStyles;return!(null==i?void 0:i.length)||t?null:e("div",Object.assign({className:`${y.scrollBtnWrapper} ${n?y.scrollExpanded:y.scrollCollapsed}`,style:null==o?void 0:o.scrollBtnWrapper},{children:e("button",Object.assign({onClick:s,className:`${y.scrollBtn} ${l?y.bounce:""}`,style:null==o?void 0:o.scrollBtn,"aria-label":"Scroll to bottom"},{children:e(S,{size:20})}))}))}});export{C as default};
1
+ import{jsx as e,jsxs as t,Fragment as l}from"react/jsx-runtime";import{createContext as n,useState as i,useRef as r,useEffect as o,useContext as s}from"react";import{PanelGroup as a,Panel as d,PanelResizeHandle as c}from"react-resizable-panels";import{PencilIcon as u,ChevronDown as S}from"lucide-react";import{formatMarkdown as v,indentMarkdown as m}from"../../utils/helpers.js";import y from"./SubfeatureBlock.js";import g from"./UserStoryScreen.module.css.js";import{useRequirementAI as p}from"../RequirementAIWrapper/RequirementAIWrapper.js";const h=n(null),b=()=>{const e=s(h);if(!e)throw new Error("UserStoryScreen must be used inside its provider");return e},N=({AtomicButton:l})=>{var n,i;const{selectedStreamingStoryIndex:r,isCitationLoadingNotStarted:o,classNames:s,scenario:a}=b(),{userStory:d,customStyles:c}=p(),u=null==c?void 0:c.userStoryScreenStyles;return(null==d?void 0:d.length)?t("div",{className:`${g.header} ${null!==(n=null==s?void 0:s.header)&&void 0!==n?n:""}`,style:null==u?void 0:u.header,children:[t("div",{className:g.headerLeftContainer,children:[e("span",{className:g.headerTitle,style:null==u?void 0:u.headerTitle,children:null===(i=d[r])||void 0===i?void 0:i.title}),"streaming"===a&&t("span",{className:g.headerSubtitle,style:null==u?void 0:u.headerSubtitle,children:[e("span",{className:g.streamingText,style:null==u?void 0:u.streamingText,children:o?"Generating Requirement Doc":"Hang tight! We're loading the citations."})," • Review & edit blocks as we build"]})]}),e(f,{AtomicButton:l})]}):e(I,{classNames:s})},f=({AtomicButton:l})=>{const{isEditing:n,isEditingModeOn:i,setIsEditing:r,setIsEditingModeOn:o,userStoryCopy:s}=b(),{userStory:a,setUserStory:d,customStyles:c}=p(),S=null==c?void 0:c.userStoryScreenStyles;return(null==a?void 0:a.length)?n?t("div",{className:g.actions,style:null==S?void 0:S.actions,children:[e(l,{type:"outline",onClick:()=>{r(!1),o(!1)},style:null==S?void 0:S.cancelAtomicButton,children:"Cancel"}),e(l,{type:"fill",onClick:()=>{d(s),r(!1),o(!1)},style:null==S?void 0:S.saveAtomicButton,children:"Save"})]}):i?null:e("div",{className:g.editToggleWrapper,children:e("button",{className:g.editToggleBtn,style:null==S?void 0:S.editToggleBtn,onClick:()=>{r(!0),o(!0)},children:e(u,{size:16})})}):null},I=({classNames:l})=>{var n;return t("div",{className:`${g.header} ${null!==(n=null==l?void 0:l.header)&&void 0!==n?n:""}`,children:[e("div",{className:g.skeletonTitle}),e("div",{className:g.skeletonSubtitle})]})},C=()=>{var l;const{customStyles:n}=p(),i=null===(l=null==n?void 0:n.userStoryScreenStyles)||void 0===l?void 0:l.accordionSkeleton;return t("div",{className:g.accordionSkeleton,style:null==i?void 0:i.wrapper,children:[e("div",{className:g.skeletonLine,style:null==i?void 0:i.line}),e("div",{className:g.skeletonBox,style:null==i?void 0:i.box})]})},B=()=>{var l;const{customStyles:n}=p(),i=null===(l=null==n?void 0:n.userStoryScreenStyles)||void 0===l?void 0:l.subFeatureSkeleton;return t("div",{className:g.subFeatureSkeleton,style:null==i?void 0:i.wrapper,children:[e("div",{className:g.skeletonLine,style:null==i?void 0:i.line}),e("div",{className:g.skeletonLine,style:null==i?void 0:i.line}),e("div",{className:g.skeletonLine,style:null==i?void 0:i.line})]})},x=Object.assign(({scenario:t,isCitationLoadingNotStarted:l,children:n,classNames:s,artifactTitleIds:d})=>{var c,u,S,v,m;const{userStory:y,customStyles:b}=p(),[N,f]=i(0),[I,C]=i(!0),[B,x]=i(!1),[E,T]=i(!1),[k,L]=i(!1),[R,A]=i(!1),[$,w]=i(y),z=r(null),O=r(null);return o(()=>{w(y)},[y]),o(()=>{x(!0);const e=setTimeout(()=>x(!1),2e3);return()=>clearTimeout(e)},[null===(u=null===(c=null==y?void 0:y[N])||void 0===c?void 0:c.sub_features)||void 0===u?void 0:u.length]),o(()=>{const e=O.current;if(!e)return;const t=()=>{T(e.scrollHeight-e.scrollTop-e.clientHeight<20)};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)},[null==y?void 0:y[N]]),e(h.Provider,{value:{scenario:t,isCitationLoadingNotStarted:l,selectedStreamingStoryIndex:N,setSelectedStreamingStoryIndex:f,isSidebarExpanded:I,setIsSidebarExpanded:C,sidebarPanelRef:z,isEditing:k,setIsEditing:L,isEditingModeOn:R,setIsEditingModeOn:A,userStoryCopy:$,setUserStoryCopy:w,scrollContainerRef:O,isAtBottom:E,isScrollBtnBouncing:B,scrollToBottom:()=>{O.current&&O.current.scrollTo({top:O.current.scrollHeight,behavior:"smooth"})},classNames:s,artifactTitleIds:d},children:e("div",{className:`${g.container} ${null!==(S=null==s?void 0:s.container)&&void 0!==S?S:""}`,style:{...null===(v=null==b?void 0:b.userStoryScreenStyles)||void 0===v?void 0:v.wrapperContainer},children:e(a,{direction:"horizontal",className:g.panelGroup,style:null===(m=null==b?void 0:b.userStoryScreenStyles)||void 0===m?void 0:m.panelGroup,children:n})})})},{Sidebar:({Component:t})=>{var l;const{selectedStreamingStoryIndex:n,setSelectedStreamingStoryIndex:i,isSidebarExpanded:r,setIsSidebarExpanded:o,sidebarPanelRef:s,scenario:a,artifactTitleIds:c}=b(),{userStory:u,customStyles:S}=p();return e(d,{ref:s,defaultSize:25,minSize:15,collapsible:!0,collapsedSize:0,onCollapse:()=>o(!1),onExpand:()=>o(!0),id:"streaming-sidebar",order:1,className:g.sidebarPanel,style:null===(l=null==S?void 0:S.userStoryScreenStyles)||void 0===l?void 0:l.sidebarPanel,children:e(t,{streamingUserStories:u,selectedStreamingStoryIndex:n,setSelectedStreamingStoryIndex:i,isSidebarExpanded:r,isStreamingScreen:"streaming"===a,artifactTitleIds:c})})},SidebarToggle:({OpenIcon:t,CloseIcon:l})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:i,sidebarPanelRef:r}=b(),{customStyles:o}=p(),s=null==o?void 0:o.userStoryScreenStyles;return e(c,{className:g.resizeHandle,style:null==s?void 0:s.resizeHandle,children:e("button",{className:g.sidebarToggleBtn,onClick:e=>{var t,l;e.stopPropagation(),n?null===(t=r.current)||void 0===t||t.collapse():null===(l=r.current)||void 0===l||l.expand()},style:null==s?void 0:s.sidebarToggleBtn,children:e(n?l:t,{})})})},Content:({children:l,AtomicButton:n})=>{var i;const{scrollContainerRef:r,classNames:o}=b(),{customStyles:s}=p(),a=null==s?void 0:s.userStoryScreenStyles;return e(d,{minSize:0,id:"streaming-content",order:2,className:g.contentPanel,style:null==a?void 0:a.contentPanel,children:t("div",{ref:r,className:`${g.scrollContainer} ${null!==(i=null==o?void 0:o.scrollContainer)&&void 0!==i?i:""}`,style:null==a?void 0:a.scrollContainer,children:[e(N,{AtomicButton:n}),l]})})},Body:({children:t})=>{const{userStory:n,setUserStory:i}=p();return(null==n?void 0:n.length)?e(l,{children:t}):null},Story:({Component:t})=>{var l,n,i;const{selectedStreamingStoryIndex:r,isEditing:o,scenario:s}=b(),{userStory:a,customStyles:d,customIcons:c,segmentComponentConfig:u}=p(),S=null==d?void 0:d.userStoryScreenStyles,v=null==S?void 0:S.userStoryContentStyles;return o?null:e("div",{className:g.storyWrapper,style:null==S?void 0:S.storyWrapper,children:e(t,{message:null===(l=a[r])||void 0===l?void 0:l.value,aiReasoningsForBlock:(null===(n=a[r])||void 0===n?void 0:n.aiReasoning)||[],isCitationLoadingDisplay:"streaming"===s,customStyles:{...v},customIcons:{...null==c?void 0:c.userStoryIcons},artifactId:null===(i=a[r])||void 0===i?void 0:i.artifactId,segmentComponentConfig:u})})},Editor:({Component:t,onBlur:l})=>{var n;const{selectedStreamingStoryIndex:i,isEditing:r,setUserStoryCopy:o}=b(),{userStory:s,customStyles:a}=p(),d=null==a?void 0:a.textEditorStyles;if(!r)return null;return e("div",{className:g.editorWrapper,style:null==d?void 0:d.wrapper,children:e(t,{minHeight:"100%",height:"100%",type:"string",value:v(null===(n=s[i])||void 0===n?void 0:n.value)||"",handleUpdateState:(e,t)=>{var l;const n=m(t),r=null===(l=s[i])||void 0===l?void 0:l.storyNumber;o(e=>{const t=[...e],l=t.findIndex(e=>e.storyNumber===r);return-1===l||(t[l]={...t[l],value:n}),t})},doNotShowBorderInViewMode:!1,onBlur:l,mode:"edit",customStyles:d})})},SubFeatures:()=>{var n;const{selectedStreamingStoryIndex:i,isEditingModeOn:r,setIsEditingModeOn:o,scenario:s,isCitationLoadingNotStarted:a}=b(),{userStory:d}=p(),c=(null===(n=null==d?void 0:d[i])||void 0===n?void 0:n.sub_features)||[];return 0===c.length&&"streaming"===s?e(C,{}):t(l,{children:[c.map(t=>e(y,{parentArtifactId:null==d?void 0:d[i].artifactId,artifactId:t.artifactId,title:t.title,content:t.value,aiReasoning:t.aiReasoning||[],isEditingModeOn:r,setIsEditingModeOn:o,isCitationLoadingDisplay:"streaming"===s},t.artifactId)),"streaming"===s&&a&&e("div",{className:g.subFeatureSkeletonWrapper,children:e(B,{})})]})},ScrollButton:()=>{const{isAtBottom:t,isSidebarExpanded:l,scrollToBottom:n,isScrollBtnBouncing:i}=b(),{userStory:r,customStyles:o}=p(),s=null==o?void 0:o.userStoryScreenStyles;return!(null==r?void 0:r.length)||t?null:e("div",{className:`${g.scrollBtnWrapper} ${l?g.scrollExpanded:g.scrollCollapsed}`,style:null==s?void 0:s.scrollBtnWrapper,children:e("button",{onClick:n,className:`${g.scrollBtn} ${i?g.bounce:""}`,style:null==s?void 0:s.scrollBtn,"aria-label":"Scroll to bottom",children:e(S,{size:20})})})}});export{x as default};
2
2
  //# sourceMappingURL=UserStoryScreen.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e}from"tslib";import{jsx as t,jsxs as o,Fragment as n}from"react/jsx-runtime";import{useState as l,useRef as i,useCallback as r,useMemo as a,useEffect as s}from"react";import d from"showdown";import{useRequirementAI as c}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{createUserStoriesForApproval as u,cloneUserStories as v}from"../../utils/userstory-approval-transform.utils.js";import{getFirstNonApprovedSegmentId as p,getFirstUnapprovedStoryId as m,approveAllSegments as g}from"../../utils/userstory-approval.utils.js";import{useApprovalStatus as h}from"../../hooks/useApprovalStatus.js";import{ContentSegment as S}from"./components/ContentSegment/ContentSegment.js";import{ApprovalBadge as b}from"./components/ApprovalBadge/ApprovalBadge.js";import y from"./UserStoryApprovalScreen.module.css.js";import{CheckIcon as f}from"../../icons/CheckIcon.js";import{BookmarkIcon as I}from"../../icons/BookmarkIcon.js";import{ApprovalSidebar as j}from"./components/ApprovalSidebar/ApprovalSidebar.js";import{ExternalLink as C,Download as A,Share2 as O,Copy as w,SidebarOpenIcon as E,SidebarCloseIcon as N}from"lucide-react";import{UserStoryApprovalScreenContext as U,useUserStoryApprovalScreen as x}from"./UserStoryApprovalContext.js";import{BigEnoughPanel as T}from"../story-screen/BigEnoughPanel.js";import k from"../../icons/BigEnoughIcon.js";import{Menu as B,MenuItem as D}from"@mui/material";import{formatMarkdown as F}from"../../utils/helpers.js";import{replaceTitleSection as P}from"../../utils/user-story.utils.js";const M={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},_={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},R=Object.assign(({artifactTitleIds:e,config:o={},callbacks:n={},labels:d={},isDisabled:g=!1,children:S,classNames:b,selectedArtifactId:f})=>{var I;const{userStory:j,customStyles:C}=c(),A=Object.assign(Object.assign({},M),o),O=Object.assign(Object.assign({},_),d),[w,E]=l([]),[N,x]=l(""),[T,k]=l(""),[B,D]=l(!1),[F,P]=l(!0),R=i(void 0),z=r((e,t,o,l)=>{n.onShowNotification?n.onShowNotification(e,t,o,l):console.log(`[${e.toUpperCase()}] ${t}: ${o}`)},[n]),W=r(e=>{n.onScrollToElement?n.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[n]),$=a(()=>{const e=w.findIndex(e=>e.artifactId===N);return e>=0?e:0},[w,N]),L=w[$];s(()=>{R.current=L},[L]),s(()=>{var e;if(!(null==j?void 0:j.length))return;null===(e=n.onInitialize)||void 0===e||e.call(n),1===j.length&&P(!1),j.length>0&&!N&&x(f||j[0].artifactId);const t=u(v(j));E(t)},[j,f]),s(()=>{f&&f!==N&&x(f)},[f,N]),s(()=>{if(!L)return;const e=p(L,"");k(e)},[null==L?void 0:L.artifactId]);const V=r((e,t)=>{E(o=>{const n=[...o];if("APPROVED"===t.approval_status&&"APPROVED"!==o[e].approval_status){const e=m(o,t.artifactId);e&&x(e)}return n[e]=t,n})},[]),q=r(e=>{const t=R.current;if(!t)return;const o=p(t,e);"NA"!==o&&(k(""),setTimeout(()=>{k(o)},0))},[]);h({userStoryForApproval:w,selectedUserStoryForApproval:L,userStoryIndex:$,callbacks:n,labels:O,onSaveUserStory:V});const H=Object.assign({height:A.containerHeight},A.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),G={userStoryForApproval:w,setUserStoryForApproval:E,selectedStoryArtifactId:N,setSelectedStoryArtifactId:x,selectedUserStoryIndex:$,selectedUserStoryForApproval:L,currentContentId:T,setCurrentContentId:k,isEditingSegment:B,setIsEditingSegment:D,isSidebarExpanded:F,setIsSidebarExpanded:P,artifactTitleIds:e,config:A,labels:O,callbacks:n,isDisabled:g,handleSaveUserStory:V,handleUpdateContentId:q,showNotification:z,scrollToElement:W};return t(U.Provider,Object.assign({value:G},{children:t("div",Object.assign({className:`${y.container} ${(null==b?void 0:b.container)||""}`,style:Object.assign(Object.assign({},H),null===(I=null==C?void 0:C.approvalScreen)||void 0===I?void 0:I.wrapperContainer)},{children:S}))}))},{Sidebar:({Component:e,config:o,className:n})=>{const{isSidebarExpanded:l,selectedStoryArtifactId:i,setSelectedStoryArtifactId:r,userStoryForApproval:a,isEditingSegment:s,artifactTitleIds:d}=x();return e?t(e,{isSidebarExpanded:l,selectedStoryArtifactId:i,setSelectedStoryArtifactId:r,userStoryForApproval:a,isEditingAnUserStorySegment:s,artifactTitleIds:d}):t(j,{config:o,className:n})},SidebarToggle:({OpenIcon:e,CloseIcon:o,className:n=""})=>{const{isSidebarExpanded:l,setIsSidebarExpanded:i}=x(),r=e||E,a=o||N;return t("div",Object.assign({className:`${y.sidebarToggleWrapper} ${n}`},{children:t("button",Object.assign({onClick:()=>i(e=>!e),className:y.sidebarToggleBtn,"aria-label":l?"Collapse sidebar":"Expand sidebar",type:"button"},{children:t(l?a:r,{})}))}))},Content:({children:a,ButtonComponent:s,hideApproveAll:u=!1,pageTitle:v="Review Generated Requirements",showShareIcon:p=!1,handleDownloadUserStory:m,handleOpenSendDialog:h,pageDescription:S="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var j,E,N,U,M,_,R,z,W,$,L,V,q,H,G,Y,J,K,Q,X,Z,ee,te,oe,ne,le,ie,re,ae,se,de;const{selectedUserStoryForApproval:ce,selectedUserStoryIndex:ue,artifactTitleIds:ve,labels:pe,config:me,isDisabled:ge,isEditingSegment:he,handleSaveUserStory:Se,setCurrentContentId:be,showNotification:ye}=x(),{userStory:fe,setUserStory:Ie}=c(),je=fe[0],[Ce,Ae]=l(null),Oe=()=>{Ae(null)},we=i(null),[Ee,Ne]=l(!1),{customStyles:Ue,customIcons:xe}=c(),Te=null==Ue?void 0:Ue.userStoryCardStyles,[ke,Be]=l(!1),De=r(()=>{if(!ce)return;if(he)return void ye("warn","Warning!",pe.unsavedChangesWarning,3e3);const e=g(ce);Se(ue,e),be("")},[ce,ue,he,pe,Se,be,ye]);if(!ce)return null;const Fe=ve[ue]||"",Pe="APPROVED"===ce.approval_status,Me=null!=(null==ce?void 0:ce.big_enough)&&!Number.isNaN(ce.big_enough)&&!!(null==ce?void 0:ce.big_enough_decision_factors);return o("div",Object.assign({className:y.content,style:Object.assign({},null===(E=null===(j=null==Ue?void 0:Ue.approvalScreen)||void 0===j?void 0:j.content)||void 0===E?void 0:E.content),"data-lsc-ui-page-title":v,"data-lsc-ui-page-description":S},{children:[o("div",Object.assign({className:y.header,style:Object.assign({},null===(M=null===(U=null===(N=null==Ue?void 0:Ue.approvalScreen)||void 0===N?void 0:N.body)||void 0===U?void 0:U.contentSegment)||void 0===M?void 0:M.header)},{children:[o("div",Object.assign({className:y.headerLeft,style:Object.assign({},null===(R=null===(_=null==Ue?void 0:Ue.approvalScreen)||void 0===_?void 0:_.content)||void 0===R?void 0:R.headerLeft)},{children:[o("div",Object.assign({className:y.headerMeta,style:Object.assign({},null===($=null===(W=null===(z=null==Ue?void 0:Ue.approvalScreen)||void 0===z?void 0:z.body)||void 0===W?void 0:W.contentSegment)||void 0===$?void 0:$.headerMeta)},{children:[t(I,{size:16,color:(null===(q=null===(V=null===(L=null==Ue?void 0:Ue.approvalScreen)||void 0===L?void 0:L.body)||void 0===V?void 0:V.contentSegment)||void 0===q?void 0:q.bookMarkColor)||"#8C8C8C"}),t("h2",Object.assign({className:y.headerArtifactId,style:Object.assign({},null===(Y=null===(G=null===(H=null==Ue?void 0:Ue.approvalScreen)||void 0===H?void 0:H.body)||void 0===G?void 0:G.contentSegment)||void 0===Y?void 0:Y.headerArtifactId)},{children:Fe}))]})),t("p",Object.assign({className:y.headerTitle,style:Object.assign({},null===(Q=null===(K=null===(J=null==Ue?void 0:Ue.approvalScreen)||void 0===J?void 0:J.body)||void 0===K?void 0:K.contentSegment)||void 0===Q?void 0:Q.headerTitle)},{children:null==ce?void 0:ce.title}))]})),o("div",Object.assign({className:null==y?void 0:y.containerStyle,style:null===(Z=null===(X=null==Ue?void 0:Ue.approvalScreen)||void 0===X?void 0:X.BigEnoughStyles)||void 0===Z?void 0:Z.containerStyle},{children:[Me&&t("button",Object.assign({className:y.developerEffortButton,style:null===(te=null===(ee=null==Ue?void 0:Ue.approvalScreen)||void 0===ee?void 0:ee.BigEnoughStyles)||void 0===te?void 0:te.buttonStyle,onClick:()=>Be(!ke)},{children:t(k,{color:null===(ne=null===(oe=null==Ue?void 0:Ue.approvalScreen)||void 0===oe?void 0:oe.BigEnoughStyles)||void 0===ne?void 0:ne.iconColor,size:null===(ie=null===(le=null==Ue?void 0:Ue.approvalScreen)||void 0===le?void 0:le.BigEnoughStyles)||void 0===ie?void 0:ie.iconSize})})),p&&o(n,{children:[t("button",Object.assign({className:y.iconButton,style:null==Te?void 0:Te.iconButton,onClick:e=>{Ae(e.currentTarget)}},{children:t(C,{size:16})})),o(B,Object.assign({id:"user-story-share-menu",anchorEl:Ce,open:!!Ce,onClose:()=>Ae(null),style:null==Te?void 0:Te.userStoryShareMenu},{children:[t(D,Object.assign({style:null==Te?void 0:Te.userStoryMenuItem,onClick:()=>e(void 0,void 0,void 0,function*(){Ne(!0),m&&(yield Promise.all([m("pdf"),m("doc")]),Ne(!1))})},{children:o("div",Object.assign({ref:we,className:y.menuItemContent,style:null==Te?void 0:Te.menuItemContent},{children:[t(A,{size:16,color:null==Te?void 0:Te.menuIconColor}),t("p",Object.assign({style:null==Te?void 0:Te.menuLabel},{children:"Download"}))]}))})),t(D,Object.assign({style:null==Te?void 0:Te.userStoryMenuItem,onClick:()=>e(void 0,void 0,void 0,function*(){let e=je;e=Object.assign(Object.assign({},je),{value:`${P(null==je?void 0:je.value,je.title)}`}),null==h||h(!0,[e],je.artifactId),Oe()})},{children:o("div",Object.assign({style:null==Te?void 0:Te.menuItemContent,className:y.menuItemContentPadded},{children:[t(O,{size:16,color:null==Te?void 0:Te.menuIconColor}),t("p",Object.assign({style:null==Te?void 0:Te.menuLabel},{children:"Send"}))]}))})),t(D,Object.assign({style:null==Te?void 0:Te.userStoryMenuItem,onClick:()=>e(void 0,void 0,void 0,function*(){const e=(new d.Converter).makeHtml(F(je.value)||je.value),t=function(e){const t=(new d.Converter).makeHtml(e),o=document.createElement("div");return o.innerHTML=t,o.textContent||o.innerText||""}(F(je.value)||je.value),o=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{yield navigator.clipboard.write([o]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Oe()}})},{children:o("div",Object.assign({style:null==Te?void 0:Te.menuItemContent,className:y.menuItemContentPadded},{children:[t(w,{size:16,color:null==Te?void 0:Te.menuIconColor}),t("p",Object.assign({style:null==Te?void 0:Te.menuLabel},{children:"Copy"}))]}))}))]}))]}),!u&&me.showApproveAllButton&&t("div",Object.assign({className:y.headerRight},{children:Pe?t(b,{status:"APPROVED",label:pe.approved}):s?t(s,Object.assign({type:"fill",onClick:De,isDisable:ge,className:y.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:pe.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."}},{children:o("div",Object.assign({className:y.approveAllContent},{children:[t(f,{size:16,color:"white"}),t("span",{children:pe.approveAll})]}))})):o("button",Object.assign({onClick:De,disabled:ge,className:y.approveAllButtonDefault,style:Object.assign({},null===(ae=null===(re=null==Ue?void 0:Ue.approvalScreen)||void 0===re?void 0:re.content)||void 0===ae?void 0:ae.approveAllButtonDefault)},{children:[t(f,{size:16,color:"white"}),t("span",{children:pe.approveAll})]}))}))]}))]})),ke&&Me&&t("div",Object.assign({className:y.bigEnoughWrapper},{children:t(T,{customIcons:null==xe?void 0:xe.userStoryIcons,customStyles:null===(se=null==Ue?void 0:Ue.approvalScreen)||void 0===se?void 0:se.aiReasoningCitaionStyles,currentUserStory:ce,panelStyles:null===(de=null==Ue?void 0:Ue.approvalScreen)||void 0===de?void 0:de.BigEnoughStyles,showPanel:ke})})),a]}))},Body:({children:e,EditorComponent:n,ViewerComponent:l,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s=!1})=>{var d,u,v;const{selectedUserStoryForApproval:p,selectedUserStoryIndex:m,artifactTitleIds:g,handleSaveUserStory:h}=x(),{customStyles:b}=c(),f=r(e=>{h(m,e)},[m,h]),I=r((e,t)=>{var o;if(!p)return;const n=Object.assign(Object.assign({},p),{sub_features:null===(o=p.sub_features)||void 0===o?void 0:o.map((o,n)=>n===e?t:o)});h(m,n)},[p,m,h]),j=r(e=>{var t;if(!p)return;const o=Object.assign(Object.assign({},p),{sub_features:null===(t=p.sub_features)||void 0===t?void 0:t.filter((t,o)=>o!==e)});h(m,o)},[p,m,h]);if(!p)return null;const C=g[m]||"";return o("div",Object.assign({className:y.body,style:Object.assign({},null===(u=null===(d=null==b?void 0:b.approvalScreen)||void 0===d?void 0:d.body)||void 0===u?void 0:u.container)},{children:[t(S,{userStoryForApproval:p,artifactTitleId:C,onSaveMainStoryContent:f,EditorComponent:n,ViewerComponent:l}),null===(v=p.sub_features)||void 0===v?void 0:v.map((e,o)=>t(S,{userStoryForApproval:e,artifactTitleId:`${C} - ${String.fromCharCode(65+o)}`,isSubFeature:!0,subFeatureIndex:o,onSaveSubFeature:I,onDeleteSubFeature:j,EditorComponent:n,ViewerComponent:l,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s},e.artifactId)),e]}))}});export{R as default};
1
+ import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{useState as l,useRef as n,useCallback as r,useMemo as i,useEffect as a}from"react";import s from"showdown";import{useRequirementAI as d}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{createUserStoriesForApproval as c,cloneUserStories as u}from"../../utils/userstory-approval-transform.utils.js";import{getFirstNonApprovedSegmentId as v,getFirstUnapprovedStoryId as p,approveAllSegments as m}from"../../utils/userstory-approval.utils.js";import{useApprovalStatus as h}from"../../hooks/useApprovalStatus.js";import{ContentSegment as S}from"./components/ContentSegment/ContentSegment.js";import{ApprovalBadge as y}from"./components/ApprovalBadge/ApprovalBadge.js";import g from"./UserStoryApprovalScreen.module.css.js";import{CheckIcon as f}from"../../icons/CheckIcon.js";import{BookmarkIcon as b}from"../../icons/BookmarkIcon.js";import{ApprovalSidebar as I}from"./components/ApprovalSidebar/ApprovalSidebar.js";import{ExternalLink as C,Download as A,Share2 as w,Copy as E,SidebarOpenIcon as N,SidebarCloseIcon as U}from"lucide-react";import{UserStoryApprovalScreenContext as x,useUserStoryApprovalScreen as T}from"./UserStoryApprovalContext.js";import{BigEnoughPanel as k}from"../story-screen/BigEnoughPanel.js";import B from"../../icons/BigEnoughIcon.js";import{Menu as D,MenuItem as F}from"@mui/material";import{formatMarkdown as j}from"../../utils/helpers.js";import{replaceTitleSection as P}from"../../utils/user-story.utils.js";const M={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},_={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},R=Object.assign(({artifactTitleIds:o,config:t={},callbacks:s={},labels:m={},isDisabled:S=!1,children:y,classNames:f,selectedArtifactId:b})=>{var I;const{userStory:C,customStyles:A}=d(),w={...M,...t},E={..._,...m},[N,U]=l([]),[T,k]=l(""),[B,D]=l(""),[F,j]=l(!1),[P,R]=l(!0),z=n(void 0),W=r((e,o,t,l)=>{s.onShowNotification?s.onShowNotification(e,o,t,l):console.log(`[${e.toUpperCase()}] ${o}: ${t}`)},[s]),$=r(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),L=i(()=>{const e=N.findIndex(e=>e.artifactId===T);return e>=0?e:0},[N,T]),O=N[L];a(()=>{z.current=O},[O]),a(()=>{var e;if(!(null==C?void 0:C.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===C.length&&R(!1),C.length>0&&!T&&k(b||C[0].artifactId);const o=c(u(C));U(o)},[C,b]),a(()=>{b&&b!==T&&k(b)},[b,T]),a(()=>{if(!O)return;const e=v(O,"");D(e)},[null==O?void 0:O.artifactId]);const V=r((e,o)=>{U(t=>{const l=[...t];if("APPROVED"===o.approval_status&&"APPROVED"!==t[e].approval_status){const e=p(t,o.artifactId);e&&k(e)}return l[e]=o,l})},[]),q=r(e=>{const o=z.current;if(!o)return;const t=v(o,e);"NA"!==t&&(D(""),setTimeout(()=>{D(t)},0))},[]);h({userStoryForApproval:N,selectedUserStoryForApproval:O,userStoryIndex:L,callbacks:s,labels:E,onSaveUserStory:V});const H={height:w.containerHeight,...w.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},G={userStoryForApproval:N,setUserStoryForApproval:U,selectedStoryArtifactId:T,setSelectedStoryArtifactId:k,selectedUserStoryIndex:L,selectedUserStoryForApproval:O,currentContentId:B,setCurrentContentId:D,isEditingSegment:F,setIsEditingSegment:j,isSidebarExpanded:P,setIsSidebarExpanded:R,artifactTitleIds:o,config:w,labels:E,callbacks:s,isDisabled:S,handleSaveUserStory:V,handleUpdateContentId:q,showNotification:W,scrollToElement:$};return e(x.Provider,{value:G,children:e("div",{className:`${g.container} ${(null==f?void 0:f.container)||""}`,style:{...H,...null===(I=null==A?void 0:A.approvalScreen)||void 0===I?void 0:I.wrapperContainer},children:y})})},{Sidebar:({Component:o,config:t,className:l})=>{const{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:i,userStoryForApproval:a,isEditingSegment:s,artifactTitleIds:d}=T();return o?e(o,{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:i,userStoryForApproval:a,isEditingAnUserStorySegment:s,artifactTitleIds:d}):e(I,{config:t,className:l})},SidebarToggle:({OpenIcon:o,CloseIcon:t,className:l=""})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:r}=T(),i=o||N,a=t||U;return e("div",{className:`${g.sidebarToggleWrapper} ${l}`,children:e("button",{onClick:()=>r(e=>!e),className:g.sidebarToggleBtn,"aria-label":n?"Collapse sidebar":"Expand sidebar",type:"button",children:e(n?a:i,{})})})},Content:({children:i,ButtonComponent:a,hideApproveAll:c=!1,pageTitle:u="Review Generated Requirements",showShareIcon:v=!1,handleDownloadUserStory:p,handleOpenSendDialog:h,pageDescription:S="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var I,N,U,x,M,_,R,z,W,$,L,O,V,q,H,G,Y,J,K,Q,X,Z,ee,oe,te,le,ne,re,ie,ae,se;const{selectedUserStoryForApproval:de,selectedUserStoryIndex:ce,artifactTitleIds:ue,labels:ve,config:pe,isDisabled:me,isEditingSegment:he,handleSaveUserStory:Se,setCurrentContentId:ye,showNotification:ge}=T(),{userStory:fe,setUserStory:be}=d(),Ie=fe[0],[Ce,Ae]=l(null),we=()=>{Ae(null)},Ee=n(null),[Ne,Ue]=l(!1),{customStyles:xe,customIcons:Te}=d(),ke=null==xe?void 0:xe.userStoryCardStyles,[Be,De]=l(!1),Fe=r(()=>{if(!de)return;if(he)return void ge("warn","Warning!",ve.unsavedChangesWarning,3e3);const e=m(de);Se(ce,e),ye("")},[de,ce,he,ve,Se,ye,ge]);if(!de)return null;const je=ue[ce]||"",Pe="APPROVED"===de.approval_status,Me=null!=(null==de?void 0:de.big_enough)&&!Number.isNaN(de.big_enough)&&!!(null==de?void 0:de.big_enough_decision_factors);return o("div",{className:g.content,style:{...null===(N=null===(I=null==xe?void 0:xe.approvalScreen)||void 0===I?void 0:I.content)||void 0===N?void 0:N.content},"data-lsc-ui-page-title":u,"data-lsc-ui-page-description":S,children:[o("div",{className:g.header,style:{...null===(M=null===(x=null===(U=null==xe?void 0:xe.approvalScreen)||void 0===U?void 0:U.body)||void 0===x?void 0:x.contentSegment)||void 0===M?void 0:M.header},children:[o("div",{className:g.headerLeft,style:{...null===(R=null===(_=null==xe?void 0:xe.approvalScreen)||void 0===_?void 0:_.content)||void 0===R?void 0:R.headerLeft},children:[o("div",{className:g.headerMeta,style:{...null===($=null===(W=null===(z=null==xe?void 0:xe.approvalScreen)||void 0===z?void 0:z.body)||void 0===W?void 0:W.contentSegment)||void 0===$?void 0:$.headerMeta},children:[e(b,{size:16,color:(null===(V=null===(O=null===(L=null==xe?void 0:xe.approvalScreen)||void 0===L?void 0:L.body)||void 0===O?void 0:O.contentSegment)||void 0===V?void 0:V.bookMarkColor)||"#8C8C8C"}),e("h2",{className:g.headerArtifactId,style:{...null===(G=null===(H=null===(q=null==xe?void 0:xe.approvalScreen)||void 0===q?void 0:q.body)||void 0===H?void 0:H.contentSegment)||void 0===G?void 0:G.headerArtifactId},children:je})]}),e("p",{className:g.headerTitle,style:{...null===(K=null===(J=null===(Y=null==xe?void 0:xe.approvalScreen)||void 0===Y?void 0:Y.body)||void 0===J?void 0:J.contentSegment)||void 0===K?void 0:K.headerTitle},children:null==de?void 0:de.title})]}),o("div",{className:null==g?void 0:g.containerStyle,style:null===(X=null===(Q=null==xe?void 0:xe.approvalScreen)||void 0===Q?void 0:Q.BigEnoughStyles)||void 0===X?void 0:X.containerStyle,children:[Me&&e("button",{className:g.developerEffortButton,style:null===(ee=null===(Z=null==xe?void 0:xe.approvalScreen)||void 0===Z?void 0:Z.BigEnoughStyles)||void 0===ee?void 0:ee.buttonStyle,onClick:()=>De(!Be),children:e(B,{color:null===(te=null===(oe=null==xe?void 0:xe.approvalScreen)||void 0===oe?void 0:oe.BigEnoughStyles)||void 0===te?void 0:te.iconColor,size:null===(ne=null===(le=null==xe?void 0:xe.approvalScreen)||void 0===le?void 0:le.BigEnoughStyles)||void 0===ne?void 0:ne.iconSize})}),v&&o(t,{children:[e("button",{className:g.iconButton,style:null==ke?void 0:ke.iconButton,onClick:e=>{Ae(e.currentTarget)},children:e(C,{size:16})}),o(D,{id:"user-story-share-menu",anchorEl:Ce,open:!!Ce,onClose:()=>Ae(null),style:null==ke?void 0:ke.userStoryShareMenu,children:[e(F,{style:null==ke?void 0:ke.userStoryMenuItem,onClick:async()=>{Ue(!0),p&&(await Promise.all([p("pdf"),p("doc")]),Ue(!1))},children:o("div",{ref:Ee,className:g.menuItemContent,style:null==ke?void 0:ke.menuItemContent,children:[e(A,{size:16,color:null==ke?void 0:ke.menuIconColor}),e("p",{style:null==ke?void 0:ke.menuLabel,children:"Download"})]})}),e(F,{style:null==ke?void 0:ke.userStoryMenuItem,onClick:async()=>{let e=Ie;e={...Ie,value:`${P(null==Ie?void 0:Ie.value,Ie.title)}`},null==h||h(!0,[e],Ie.artifactId),we()},children:o("div",{style:null==ke?void 0:ke.menuItemContent,className:g.menuItemContentPadded,children:[e(w,{size:16,color:null==ke?void 0:ke.menuIconColor}),e("p",{style:null==ke?void 0:ke.menuLabel,children:"Send"})]})}),e(F,{style:null==ke?void 0:ke.userStoryMenuItem,onClick:async()=>{const e=(new s.Converter).makeHtml(j(Ie.value)||Ie.value),o=function(e){const o=(new s.Converter).makeHtml(e),t=document.createElement("div");return t.innerHTML=o,t.textContent||t.innerText||""}(j(Ie.value)||Ie.value),t=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([t]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{we()}},children:o("div",{style:null==ke?void 0:ke.menuItemContent,className:g.menuItemContentPadded,children:[e(E,{size:16,color:null==ke?void 0:ke.menuIconColor}),e("p",{style:null==ke?void 0:ke.menuLabel,children:"Copy"})]})})]})]}),!c&&pe.showApproveAllButton&&e("div",{className:g.headerRight,children:Pe?e(y,{status:"APPROVED",label:ve.approved}):a?e(a,{type:"fill",onClick:Fe,isDisable:me,className:g.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:ve.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:o("div",{className:g.approveAllContent,children:[e(f,{size:16,color:"white"}),e("span",{children:ve.approveAll})]})}):o("button",{onClick:Fe,disabled:me,className:g.approveAllButtonDefault,style:{...null===(ie=null===(re=null==xe?void 0:xe.approvalScreen)||void 0===re?void 0:re.content)||void 0===ie?void 0:ie.approveAllButtonDefault},children:[e(f,{size:16,color:"white"}),e("span",{children:ve.approveAll})]})})]})]}),Be&&Me&&e("div",{className:g.bigEnoughWrapper,children:e(k,{customIcons:null==Te?void 0:Te.userStoryIcons,customStyles:null===(ae=null==xe?void 0:xe.approvalScreen)||void 0===ae?void 0:ae.aiReasoningCitaionStyles,currentUserStory:de,panelStyles:null===(se=null==xe?void 0:xe.approvalScreen)||void 0===se?void 0:se.BigEnoughStyles,showPanel:Be})}),i]})},Body:({children:t,EditorComponent:l,ViewerComponent:n,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s=!1})=>{var c,u,v;const{selectedUserStoryForApproval:p,selectedUserStoryIndex:m,artifactTitleIds:h,handleSaveUserStory:y}=T(),{customStyles:f}=d(),b=r(e=>{y(m,e)},[m,y]),I=r((e,o)=>{var t;if(!p)return;const l={...p,sub_features:null===(t=p.sub_features)||void 0===t?void 0:t.map((t,l)=>l===e?o:t)};y(m,l)},[p,m,y]),C=r(e=>{var o;if(!p)return;const t={...p,sub_features:null===(o=p.sub_features)||void 0===o?void 0:o.filter((o,t)=>t!==e)};y(m,t)},[p,m,y]);if(!p)return null;const A=h[m]||"";return o("div",{className:g.body,style:{...null===(u=null===(c=null==f?void 0:f.approvalScreen)||void 0===c?void 0:c.body)||void 0===u?void 0:u.container},children:[e(S,{userStoryForApproval:p,artifactTitleId:A,onSaveMainStoryContent:b,EditorComponent:l,ViewerComponent:n}),null===(v=p.sub_features)||void 0===v?void 0:v.map((o,t)=>e(S,{userStoryForApproval:o,artifactTitleId:`${A} - ${String.fromCharCode(65+t)}`,isSubFeature:!0,subFeatureIndex:t,onSaveSubFeature:I,onDeleteSubFeature:C,EditorComponent:l,ViewerComponent:n,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s},o.artifactId)),t]})}});export{R as default};
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import r from"./ApprovalBadge.module.css.js";import{CheckIcon as l}from"../../../../icons/CheckIcon.js";import{useRequirementAI as a}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";const o=({status:o,label:t="Approved",size:i="medium",className:m})=>{var n,p;const{customStyles:c}=a();if("APPROVED"!==o)return null;const d="small"===i?r.small:r.medium;return e("div",Object.assign({className:`${r.badge} ${d} ${m||""}`,style:Object.assign({},null===(p=null===(n=null==c?void 0:c.approvalScreen)||void 0===n?void 0:n.content)||void 0===p?void 0:p.approvalBadge)},{children:[s(l,{size:"small"===i?14:16}),s("span",{children:t})]}))};export{o as ApprovalBadge,o as default};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import l from"./ApprovalBadge.module.css.js";import{CheckIcon as o}from"../../../../icons/CheckIcon.js";import{useRequirementAI as s}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";const a=({status:a,label:m="Approved",size:t="medium",className:i})=>{var n,p;const{customStyles:d}=s();if("APPROVED"!==a)return null;const c="small"===t?l.small:l.medium;return e("div",{className:`${l.badge} ${c} ${i||""}`,style:{...null===(p=null===(n=null==d?void 0:d.approvalScreen)||void 0===n?void 0:n.content)||void 0===p?void 0:p.approvalBadge},children:[r(o,{size:"small"===t?14:16}),r("span",{children:m})]})};export{a as ApprovalBadge,a as default};
2
2
  //# sourceMappingURL=ApprovalBadge.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import{useMemo as t,useCallback as a}from"react";import o from"../../../../icons/MenuUnfoldIcon.js";import{ApprovalSidebarItem as r}from"../ApprovalSidebarItem/ApprovalSidebarItem.js";import n from"./ApprovalSidebar.module.css.js";import{useUserStoryApprovalScreen as s}from"../../UserStoryApprovalContext.js";import{useRequirementAI as l}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";const d={descriptionCharLimit:116,sidebarTitle:"Generated User Stories",TooltipComponent:void 0,InfoIconComponent:void 0,HeaderIconComponent:void 0},c=({config:c={},className:p=""})=>{var v,m,u,b,f,g,I,S,h,j,O,y;const{customIcons:A,customStyles:N}=l(),{isSidebarExpanded:T,selectedStoryArtifactId:x,setSelectedStoryArtifactId:C,userStoryForApproval:E,isEditingSegment:L,artifactTitleIds:w,showNotification:P,labels:R}=s(),U=t(()=>Object.assign(Object.assign({},d),c),[c]),{sidebarTitle:W,HeaderIconComponent:q}=U,B=t(()=>E.map((e,i)=>({artifactTitleId:w&&w[i]||"",artifactId:e.artifactId,title:e.title,description:e.description||"",approvalStatus:e.approval_status||"NOT_APPROVED",index:i})),[E,w]),H=a(e=>{C(e)},[C]),_=a(()=>{P("warn","Warning!","Please save the latest changes to proceed with the other segment.",3e3)},[P]),k=[n.container,T?n.containerExpanded:n.containerCollapsed,p].filter(Boolean).join(" "),z=q||o;return e("div",Object.assign({className:k,style:Object.assign({},null===(m=null===(v=null==N?void 0:N.approvalScreen)||void 0===v?void 0:v.sidebar)||void 0===m?void 0:m.container)},{children:i("div",Object.assign({className:n.inner,style:Object.assign({},null===(b=null===(u=null==N?void 0:N.approvalScreen)||void 0===u?void 0:u.sidebar)||void 0===b?void 0:b.innerContainer)},{children:[i("div",Object.assign({className:n.header,style:Object.assign({},null===(g=null===(f=null==N?void 0:N.approvalScreen)||void 0===f?void 0:f.sidebar)||void 0===g?void 0:g.header)},{children:[e("div",Object.assign({className:n.headerIcon,style:Object.assign({},null===(S=null===(I=null==N?void 0:N.approvalScreen)||void 0===I?void 0:I.sidebar)||void 0===S?void 0:S.headerIcon)},{children:e(z,{size:20})})),e("h2",Object.assign({className:n.headerTitle,style:Object.assign({},null===(j=null===(h=null==N?void 0:N.approvalScreen)||void 0===h?void 0:h.sidebar)||void 0===j?void 0:j.headerTitle)},{children:W}))]})),e("div",Object.assign({className:n.storyList,style:Object.assign({},null===(y=null===(O=null==N?void 0:N.approvalScreen)||void 0===O?void 0:O.sidebar)||void 0===y?void 0:y.storyList),role:"listbox"},{children:B.map((i,t)=>e(r,{artifactTitleId:i.artifactTitleId,artifactId:i.artifactId,title:i.title,description:i.description,approvalStatus:i.approvalStatus,index:i.index,isLast:t===B.length-1,isSelected:x===i.artifactId,isEditingSegment:L,onSelect:H,onNavigationBlocked:_,sidebarConfig:U},i.artifactId))}))]}))}))};export{c as ApprovalSidebar,c as default};
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{useMemo as t,useCallback as o}from"react";import r from"../../../../icons/MenuUnfoldIcon.js";import{ApprovalSidebarItem as a}from"../ApprovalSidebarItem/ApprovalSidebarItem.js";import l from"./ApprovalSidebar.module.css.js";import{useUserStoryApprovalScreen as d}from"../../UserStoryApprovalContext.js";import{useRequirementAI as n}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";const s={descriptionCharLimit:116,sidebarTitle:"Generated User Stories",TooltipComponent:void 0,InfoIconComponent:void 0,HeaderIconComponent:void 0},c=({config:c={},className:p=""})=>{var v,m,u,f,I,S,h,b,y,g,A,N;const{customIcons:T,customStyles:x}=n(),{isSidebarExpanded:C,selectedStoryArtifactId:j,setSelectedStoryArtifactId:E,userStoryForApproval:L,isEditingSegment:w,artifactTitleIds:P,showNotification:R,labels:U}=d(),W=t(()=>({...s,...c}),[c]),{sidebarTitle:q,HeaderIconComponent:B}=W,H=t(()=>L.map((e,i)=>({artifactTitleId:P&&P[i]||"",artifactId:e.artifactId,title:e.title,description:e.description||"",approvalStatus:e.approval_status||"NOT_APPROVED",index:i})),[L,P]),O=o(e=>{E(e)},[E]),_=o(()=>{R("warn","Warning!","Please save the latest changes to proceed with the other segment.",3e3)},[R]),k=[l.container,C?l.containerExpanded:l.containerCollapsed,p].filter(Boolean).join(" "),z=B||r;return e("div",{className:k,style:{...null===(m=null===(v=null==x?void 0:x.approvalScreen)||void 0===v?void 0:v.sidebar)||void 0===m?void 0:m.container},children:i("div",{className:l.inner,style:{...null===(f=null===(u=null==x?void 0:x.approvalScreen)||void 0===u?void 0:u.sidebar)||void 0===f?void 0:f.innerContainer},children:[i("div",{className:l.header,style:{...null===(S=null===(I=null==x?void 0:x.approvalScreen)||void 0===I?void 0:I.sidebar)||void 0===S?void 0:S.header},children:[e("div",{className:l.headerIcon,style:{...null===(b=null===(h=null==x?void 0:x.approvalScreen)||void 0===h?void 0:h.sidebar)||void 0===b?void 0:b.headerIcon},children:e(z,{size:20})}),e("h2",{className:l.headerTitle,style:{...null===(g=null===(y=null==x?void 0:x.approvalScreen)||void 0===y?void 0:y.sidebar)||void 0===g?void 0:g.headerTitle},children:q})]}),e("div",{className:l.storyList,style:{...null===(N=null===(A=null==x?void 0:x.approvalScreen)||void 0===A?void 0:A.sidebar)||void 0===N?void 0:N.storyList},role:"listbox",children:H.map((i,t)=>e(a,{artifactTitleId:i.artifactTitleId,artifactId:i.artifactId,title:i.title,description:i.description,approvalStatus:i.approvalStatus,index:i.index,isLast:t===H.length-1,isSelected:j===i.artifactId,isEditingSegment:w,onSelect:O,onNavigationBlocked:_,sidebarConfig:W},i.artifactId))})]})})};export{c as ApprovalSidebar,c as default};
2
2
  //# sourceMappingURL=ApprovalSidebar.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as i,jsxs as e}from"react/jsx-runtime";import{useState as o,useCallback as l}from"react";import{BookmarkIcon as n}from"../../../../icons/BookmarkIcon.js";import{ApprovalStatusBadge as a}from"../ApprovalStatusBadge/ApprovalStatusBadge.js";import{replaceLearnedTagsWithInfo as s}from"../../../../utils/learned-tag.utils.js";import d from"./ApprovalSidebarItem.module.css.js";import{useRequirementAI as t}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";import r from"../../../../icons/RelevanceScoreIcon.js";import{stripAiReasoningAnchors as v,extractAllAiReasoningIds as c}from"../../../../utils/helpers.js";import p from"../../../ai-reasoning/AiReasoningCitation.js";const u=({artifactTitleId:u,artifactId:m,title:b,description:g,approvalStatus:S,index:j,isLast:I,isSelected:f,isEditingSegment:h,onSelect:O,onNavigationBlocked:C,sidebarConfig:N,className:y=""})=>{var R,B,k,A,w,x,L,q,z,G,H,P,T,W,E,F,M,$,D,J,K,Q,U,V,X,Y,Z,_,ii,ei,oi,li,ni,ai;const[si,di]=o(!1),{customStyles:ti,getAvgScoreForStory:ri,aiReasoning:vi}=t(),ci=ri(m),{descriptionCharLimit:pi,TooltipComponent:ui,InfoIconComponent:mi}=N,bi=l(()=>{h?null==C||C():O(m)},[m,h,O,C]),gi=l(i=>{i.stopPropagation(),di(i=>!i)},[]),Si=v(g),ji=si?Si:Si.length>pi?Si.slice(0,pi):Si,Ii=Si.length>pi,fi=[d.item,I?d.itemLast:"",f?d.itemSelected:"",y].filter(Boolean).join(" "),hi=c(g).map(i=>vi.find(e=>e.id.toString()===i)).filter(Boolean);return i("div",Object.assign({className:fi,style:Object.assign({},null===(k=null===(B=null===(R=null==ti?void 0:ti.approvalScreen)||void 0===R?void 0:R.sidebar)||void 0===B?void 0:B.sidebarItem)||void 0===k?void 0:k.container),onClick:bi,role:"option","aria-selected":f},{children:e("div",Object.assign({className:d.itemContent,style:Object.assign({},null===(x=null===(w=null===(A=null==ti?void 0:ti.approvalScreen)||void 0===A?void 0:A.sidebar)||void 0===w?void 0:w.sidebarItem)||void 0===x?void 0:x.itemContent)},{children:[e("div",Object.assign({className:d.topRow,style:Object.assign({},null===(z=null===(q=null===(L=null==ti?void 0:ti.approvalScreen)||void 0===L?void 0:L.sidebar)||void 0===q?void 0:q.sidebarItem)||void 0===z?void 0:z.topRow)},{children:[e("span",Object.assign({className:d.artifactIdGroup,style:Object.assign({},null===(P=null===(H=null===(G=null==ti?void 0:ti.approvalScreen)||void 0===G?void 0:G.sidebar)||void 0===H?void 0:H.sidebarItem)||void 0===P?void 0:P.artifactIdGroup)},{children:[i(n,{size:20,color:(null===(E=null===(W=null===(T=null==ti?void 0:ti.approvalScreen)||void 0===T?void 0:T.sidebar)||void 0===W?void 0:W.sidebarItem)||void 0===E?void 0:E.bookMarkColor)||"#8C8C8C"}),i("span",{children:u})]})),e("div",Object.assign({className:d.scoreBadgeContainer},{children:[ci>0&&e("span",Object.assign({className:d.confidenceScore,style:null===($=null===(M=null===(F=null==ti?void 0:ti.approvalScreen)||void 0===F?void 0:F.sidebar)||void 0===M?void 0:M.sidebarItem)||void 0===$?void 0:$.confidenceScore},{children:[i(r,{size:14,color:(null===(Q=null===(K=null===(J=null===(D=null==ti?void 0:ti.approvalScreen)||void 0===D?void 0:D.sidebar)||void 0===J?void 0:J.sidebarItem)||void 0===K?void 0:K.confidenceScoreIcon)||void 0===Q?void 0:Q.color)||"#166534"}),ci,"%"]})),i(a,{status:S})]}))]})),e("span",Object.assign({className:d.titleRow,style:Object.assign({},null===(X=null===(V=null===(U=null==ti?void 0:ti.approvalScreen)||void 0===U?void 0:U.sidebar)||void 0===V?void 0:V.sidebarItem)||void 0===X?void 0:X.titleRow)},{children:[i("span",Object.assign({className:d.titleIndex,style:Object.assign({},null===(_=null===(Z=null===(Y=null==ti?void 0:ti.approvalScreen)||void 0===Y?void 0:Y.sidebar)||void 0===Z?void 0:Z.sidebarItem)||void 0===_?void 0:_.titleIndex)},{children:`${j+1}.`})),i("span",{children:s(b,ui,mi)})]})),g&&e("span",Object.assign({className:d.description,style:Object.assign({},null===(oi=null===(ei=null===(ii=null==ti?void 0:ti.approvalScreen)||void 0===ii?void 0:ii.sidebar)||void 0===ei?void 0:ei.sidebarItem)||void 0===oi?void 0:oi.description)},{children:[ji,Ii&&i("button",Object.assign({onClick:gi,className:d.moreButton,style:Object.assign({},null===(ai=null===(ni=null===(li=null==ti?void 0:ti.approvalScreen)||void 0===li?void 0:li.sidebar)||void 0===ni?void 0:ni.sidebarItem)||void 0===ai?void 0:ai.moreButton),"aria-label":si?"Show less":"Show more"},{children:si?"less":"more"})),hi.length>0&&i("span",Object.assign({className:d.aiReasoningContainer,onClick:i=>i.stopPropagation()},{children:null==hi?void 0:hi.map(e=>i(p,{aiReason:e,isSourceHasHighlight:!1},null==e?void 0:e.id))}))]}))]}))}))};export{u as ApprovalSidebarItem,u as default};
1
+ import{jsx as i,jsxs as o}from"react/jsx-runtime";import{useState as e,useCallback as l}from"react";import{BookmarkIcon as n}from"../../../../icons/BookmarkIcon.js";import{ApprovalStatusBadge as d}from"../ApprovalStatusBadge/ApprovalStatusBadge.js";import{replaceLearnedTagsWithInfo as a}from"../../../../utils/learned-tag.utils.js";import r from"./ApprovalSidebarItem.module.css.js";import{useRequirementAI as t}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";import s from"../../../../icons/RelevanceScoreIcon.js";import{stripAiReasoningAnchors as v,extractAllAiReasoningIds as c}from"../../../../utils/helpers.js";import p from"../../../ai-reasoning/AiReasoningCitation.js";const u=({artifactTitleId:u,artifactId:m,title:S,description:b,approvalStatus:I,index:f,isLast:g,isSelected:h,isEditingSegment:C,onSelect:N,onNavigationBlocked:y,sidebarConfig:R,className:j=""})=>{var B,k,A,w,x,L,q,z,G,H,P,T,W,E,F,M,$,D,J,K,O,Q,U,V,X,Y,Z,_,ii,oi,ei,li,ni,di;const[ai,ri]=e(!1),{customStyles:ti,getAvgScoreForStory:si,aiReasoning:vi}=t(),ci=si(m),{descriptionCharLimit:pi,TooltipComponent:ui,InfoIconComponent:mi}=R,Si=l(()=>{C?null==y||y():N(m)},[m,C,N,y]),bi=l(i=>{i.stopPropagation(),ri(i=>!i)},[]),Ii=v(b),fi=ai?Ii:Ii.length>pi?Ii.slice(0,pi):Ii,gi=Ii.length>pi,hi=[r.item,g?r.itemLast:"",h?r.itemSelected:"",j].filter(Boolean).join(" "),Ci=c(b).map(i=>vi.find(o=>o.id.toString()===i)).filter(Boolean);return i("div",{className:hi,style:{...null===(A=null===(k=null===(B=null==ti?void 0:ti.approvalScreen)||void 0===B?void 0:B.sidebar)||void 0===k?void 0:k.sidebarItem)||void 0===A?void 0:A.container},onClick:Si,role:"option","aria-selected":h,children:o("div",{className:r.itemContent,style:{...null===(L=null===(x=null===(w=null==ti?void 0:ti.approvalScreen)||void 0===w?void 0:w.sidebar)||void 0===x?void 0:x.sidebarItem)||void 0===L?void 0:L.itemContent},children:[o("div",{className:r.topRow,style:{...null===(G=null===(z=null===(q=null==ti?void 0:ti.approvalScreen)||void 0===q?void 0:q.sidebar)||void 0===z?void 0:z.sidebarItem)||void 0===G?void 0:G.topRow},children:[o("span",{className:r.artifactIdGroup,style:{...null===(T=null===(P=null===(H=null==ti?void 0:ti.approvalScreen)||void 0===H?void 0:H.sidebar)||void 0===P?void 0:P.sidebarItem)||void 0===T?void 0:T.artifactIdGroup},children:[i(n,{size:20,color:(null===(F=null===(E=null===(W=null==ti?void 0:ti.approvalScreen)||void 0===W?void 0:W.sidebar)||void 0===E?void 0:E.sidebarItem)||void 0===F?void 0:F.bookMarkColor)||"#8C8C8C"}),i("span",{children:u})]}),o("div",{className:r.scoreBadgeContainer,children:[ci>0&&o("span",{className:r.confidenceScore,style:null===(D=null===($=null===(M=null==ti?void 0:ti.approvalScreen)||void 0===M?void 0:M.sidebar)||void 0===$?void 0:$.sidebarItem)||void 0===D?void 0:D.confidenceScore,children:[i(s,{size:14,color:(null===(Q=null===(O=null===(K=null===(J=null==ti?void 0:ti.approvalScreen)||void 0===J?void 0:J.sidebar)||void 0===K?void 0:K.sidebarItem)||void 0===O?void 0:O.confidenceScoreIcon)||void 0===Q?void 0:Q.color)||"#166534"}),ci,"%"]}),i(d,{status:I})]})]}),o("span",{className:r.titleRow,style:{...null===(X=null===(V=null===(U=null==ti?void 0:ti.approvalScreen)||void 0===U?void 0:U.sidebar)||void 0===V?void 0:V.sidebarItem)||void 0===X?void 0:X.titleRow},children:[i("span",{className:r.titleIndex,style:{...null===(_=null===(Z=null===(Y=null==ti?void 0:ti.approvalScreen)||void 0===Y?void 0:Y.sidebar)||void 0===Z?void 0:Z.sidebarItem)||void 0===_?void 0:_.titleIndex},children:`${f+1}.`}),i("span",{children:a(S,ui,mi)})]}),b&&o("span",{className:r.description,style:{...null===(ei=null===(oi=null===(ii=null==ti?void 0:ti.approvalScreen)||void 0===ii?void 0:ii.sidebar)||void 0===oi?void 0:oi.sidebarItem)||void 0===ei?void 0:ei.description},children:[fi,gi&&i("button",{onClick:bi,className:r.moreButton,style:{...null===(di=null===(ni=null===(li=null==ti?void 0:ti.approvalScreen)||void 0===li?void 0:li.sidebar)||void 0===ni?void 0:ni.sidebarItem)||void 0===di?void 0:di.moreButton},"aria-label":ai?"Show less":"Show more",children:ai?"less":"more"}),Ci.length>0&&i("span",{className:r.aiReasoningContainer,onClick:i=>i.stopPropagation(),children:null==Ci?void 0:Ci.map(o=>i(p,{aiReason:o,isSourceHasHighlight:!1},null==o?void 0:o.id))})]})]})})};export{u as ApprovalSidebarItem,u as default};
2
2
  //# sourceMappingURL=ApprovalSidebarItem.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import s from"./ApprovalStatusBadge.module.css.js";import{useRequirementAI as a}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";const o={approved:"Approved",inProgress:"In Progress",notApproved:"Not Approved"},r=({status:r,labels:d={},className:l=""})=>{var i,n,t,p,v,u,c,g,b,m,A,O;const j=Object.assign(Object.assign({},o),d),{customStyles:P}=a();switch(r){case"APPROVED":return e("span",Object.assign({className:`${s.badgeApproved} ${l}`,style:Object.assign({},null===(p=null===(t=null===(n=null===(i=null==P?void 0:P.approvalScreen)||void 0===i?void 0:i.sidebar)||void 0===n?void 0:n.sidebarItem)||void 0===t?void 0:t.approvalStatusBadge)||void 0===p?void 0:p.badgeApproved)},{children:j.approved}));case"IN_PROGRESS":return e("span",Object.assign({className:`${s.badgeInProgress} ${l}`,style:Object.assign({},null===(g=null===(c=null===(u=null===(v=null==P?void 0:P.approvalScreen)||void 0===v?void 0:v.sidebar)||void 0===u?void 0:u.sidebarItem)||void 0===c?void 0:c.approvalStatusBadge)||void 0===g?void 0:g.badgeInProgress)},{children:j.inProgress}));case"NOT_APPROVED":return e("span",Object.assign({className:`${s.badgeNotApproved} ${l}`,style:Object.assign({},null===(O=null===(A=null===(m=null===(b=null==P?void 0:P.approvalScreen)||void 0===b?void 0:b.sidebar)||void 0===m?void 0:m.sidebarItem)||void 0===A?void 0:A.approvalStatusBadge)||void 0===O?void 0:O.badgeNotApproved)},{children:j.notApproved}));default:return null}};export{r as ApprovalStatusBadge,r as default};
1
+ import{jsx as e}from"react/jsx-runtime";import o from"./ApprovalStatusBadge.module.css.js";import{useRequirementAI as r}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";const d={approved:"Approved",inProgress:"In Progress",notApproved:"Not Approved"},a=({status:a,labels:l={},className:s=""})=>{var i,p,v,n,t,u,c,m,g,b,A,P;const S={...d,...l},{customStyles:I}=r();switch(a){case"APPROVED":return e("span",{className:`${o.badgeApproved} ${s}`,style:{...null===(n=null===(v=null===(p=null===(i=null==I?void 0:I.approvalScreen)||void 0===i?void 0:i.sidebar)||void 0===p?void 0:p.sidebarItem)||void 0===v?void 0:v.approvalStatusBadge)||void 0===n?void 0:n.badgeApproved},children:S.approved});case"IN_PROGRESS":return e("span",{className:`${o.badgeInProgress} ${s}`,style:{...null===(m=null===(c=null===(u=null===(t=null==I?void 0:I.approvalScreen)||void 0===t?void 0:t.sidebar)||void 0===u?void 0:u.sidebarItem)||void 0===c?void 0:c.approvalStatusBadge)||void 0===m?void 0:m.badgeInProgress},children:S.inProgress});case"NOT_APPROVED":return e("span",{className:`${o.badgeNotApproved} ${s}`,style:{...null===(P=null===(A=null===(b=null===(g=null==I?void 0:I.approvalScreen)||void 0===g?void 0:g.sidebar)||void 0===b?void 0:b.sidebarItem)||void 0===A?void 0:A.approvalStatusBadge)||void 0===P?void 0:P.badgeNotApproved},children:S.notApproved});default:return null}};export{a as ApprovalStatusBadge,a as default};
2
2
  //# sourceMappingURL=ApprovalStatusBadge.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useState as e,useRef as t,useCallback as l,useEffect as i}from"react";import d from"./ContentBlock.module.css.js";import{CheckIcon as c}from"../../../../icons/CheckIcon.js";import{PencilIcon as v}from"../../../../icons/PencilIcon.js";import{TrashIcon as r}from"../../../../icons/TrashIcon.js";import{useUserStoryApprovalScreen as a}from"../../UserStoryApprovalContext.js";import{useRequirementAI as s}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";const u=({segment:u,segmentIndex:p,isSubFeature:m=!1,onSaveContent:g,onApproveContent:b,onDeleteContent:S,EditorComponent:y,ViewerComponent:j})=>{var B,h,k,O,C,I,x,f,N,A,T,w,D,E,M,W,z,R,V,F,U,q,H,$,_,L,P,G,J,K,Q,X,Y,Z,oo,no,eo,to,lo,io,co,vo,ro,ao,so,uo,po,mo,go,bo,So,yo,jo,Bo,ho,ko,Oo,Co,Io,xo,fo,No,Ao,To,wo,Do,Eo,Mo,Wo,zo,Ro,Vo,Fo,Uo,qo,Ho,$o,_o,Lo,Po;const{currentContentId:Go,handleUpdateContentId:Jo,isDisabled:Ko,isEditingSegment:Qo,setIsEditingSegment:Xo,config:Yo,labels:Zo,showNotification:on}=a(),{customStyles:nn,customIcons:en}=s(),[tn,ln]=e(!1),dn=t(u.content),cn=t(null),[vn,rn]=e(0),an=u.contentId===Go,sn=l(()=>{if(!cn.current)return;const o=cn.current;o.style.scrollMarginTop="90px",o.scrollIntoView({behavior:"smooth",block:"start"})},[]),un=l(()=>{if(!cn.current)return;const o=cn.current;o.style.scrollMarginBottom="90px",o.scrollIntoView({behavior:"smooth",block:"end"})},[]);i(()=>{if(!an||!cn.current||tn)return;const o=setTimeout(()=>{un()},200);return()=>clearTimeout(o)},[Go,an,tn,un]),i(()=>{if(0===vn)return;const o=setTimeout(()=>{sn()},150);return()=>clearTimeout(o)},[vn,sn]),i(()=>{dn.current=u.content},[u.content]);const pn=l(()=>{dn.current=u.content,ln(!0),Xo(!0),rn(o=>o+1)},[u.content,Xo]),mn=l(()=>{dn.current=u.content,ln(!1),Xo(!1)},[u.content,Xo]),gn=l((o,n)=>{dn.current=n},[]),bn=l(()=>{const o=dn.current;(null==o?void 0:o.trim())?(ln(!1),Xo(!1),g(p,o)):on("warn","Warning!",Zo.emptyContentWarning,3e3)},[p,g,Xo,on,Zo.emptyContentWarning]),Sn=l(()=>{b(p),Jo(u.contentId)},[p,u.contentId,b,Jo]),yn=l(()=>{null==S||S(p)},[p,S]),jn=[d.container,an?d.containerActive:d.containerDefault].join(" "),Bn=null===(k=null===(h=null===(B=null==nn?void 0:nn.approvalScreen)||void 0===B?void 0:B.body)||void 0===h?void 0:h.contentSegment)||void 0===k?void 0:k.contentBlock,hn=an?(null==Bn?void 0:Bn.currentSegementContainer)||{boxShadow:"0px 4px 14.3px 0px rgba(151, 71, 255, 0.3), 0px -4px 34.7px 0px rgba(51, 210, 255, 0.05)"}:(null==Bn?void 0:Bn.containerDefault)||{};return o("div",Object.assign({className:jn,style:hn,ref:cn},{children:[u.isApproved&&o("div",Object.assign({className:d.approvedBadge,style:Object.assign({},null===(x=null===(I=null===(C=null===(O=null==nn?void 0:nn.approvalScreen)||void 0===O?void 0:O.body)||void 0===C?void 0:C.contentSegment)||void 0===I?void 0:I.contentBlock)||void 0===x?void 0:x.approvedBadge)},{children:[n("span",{children:Zo.approved}),n(c,{size:16,color:null===(T=null===(A=null===(N=null===(f=null==nn?void 0:nn.approvalScreen)||void 0===f?void 0:f.body)||void 0===N?void 0:N.contentSegment)||void 0===A?void 0:A.contentBlock)||void 0===T?void 0:T.checkIconColor})]})),n("div",Object.assign({className:d.contentArea,style:Object.assign({},null===(M=null===(E=null===(D=null===(w=null==nn?void 0:nn.approvalScreen)||void 0===w?void 0:w.body)||void 0===D?void 0:D.contentSegment)||void 0===E?void 0:E.contentBlock)||void 0===M?void 0:M.contentArea)},{children:tn&&y?n(y,{minHeight:"100%",height:"100%",type:"string",value:u.content||"",handleUpdateState:gn,doNotShowBorderInViewMode:!1,mode:"edit"}):j?n(j,{message:u.content||"",scenario:"approving",customStyles:Object.assign({},null===(W=null==nn?void 0:nn.userStoryScreenStyles)||void 0===W?void 0:W.userStoryContentStyles),customIcons:Object.assign({},null==en?void 0:en.userStoryIcons)}):n("div",{className:d.contentFallback,dangerouslySetInnerHTML:{__html:u.content||""}})})),tn?o("div",Object.assign({className:d.editActionsContainer,style:Object.assign({},null===(To=null===(Ao=null===(No=null===(fo=null==nn?void 0:nn.approvalScreen)||void 0===fo?void 0:fo.body)||void 0===No?void 0:No.contentSegment)||void 0===Ao?void 0:Ao.contentBlock)||void 0===To?void 0:To.editActionsContainer)},{children:[n("button",Object.assign({onClick:mn,className:d.outlineButton,style:Object.assign(Object.assign({},null===(Mo=null===(Eo=null===(Do=null===(wo=null==nn?void 0:nn.approvalScreen)||void 0===wo?void 0:wo.body)||void 0===Do?void 0:Do.contentSegment)||void 0===Eo?void 0:Eo.contentBlock)||void 0===Mo?void 0:Mo.outlineButton),null===(Vo=null===(Ro=null===(zo=null===(Wo=null==nn?void 0:nn.approvalScreen)||void 0===Wo?void 0:Wo.body)||void 0===zo?void 0:zo.contentSegment)||void 0===Ro?void 0:Ro.contentBlock)||void 0===Vo?void 0:Vo.cancelButton)},{children:Zo.cancel})),n("button",Object.assign({onClick:bn,className:d.outlineButton,style:Object.assign(Object.assign({},null===(Ho=null===(qo=null===(Uo=null===(Fo=null==nn?void 0:nn.approvalScreen)||void 0===Fo?void 0:Fo.body)||void 0===Uo?void 0:Uo.contentSegment)||void 0===qo?void 0:qo.contentBlock)||void 0===Ho?void 0:Ho.outlineButton),null===(Po=null===(Lo=null===(_o=null===($o=null==nn?void 0:nn.approvalScreen)||void 0===$o?void 0:$o.body)||void 0===_o?void 0:_o.contentSegment)||void 0===Lo?void 0:Lo.contentBlock)||void 0===Po?void 0:Po.saveButton)},{children:Zo.save}))]})):n("div",Object.assign({className:d.actionsContainer,style:Object.assign({},null===(F=null===(V=null===(R=null===(z=null==nn?void 0:nn.approvalScreen)||void 0===z?void 0:z.body)||void 0===R?void 0:R.contentSegment)||void 0===V?void 0:V.contentBlock)||void 0===F?void 0:F.actionsContainer)},{children:o("div",Object.assign({className:d.actionsRow,style:Object.assign({},null===($=null===(H=null===(q=null===(U=null==nn?void 0:nn.approvalScreen)||void 0===U?void 0:U.body)||void 0===q?void 0:q.contentSegment)||void 0===H?void 0:H.contentBlock)||void 0===$?void 0:$.actionsRow)},{children:[!Qo&&Yo.allowEditing&&o("button",Object.assign({onClick:pn,className:d.actionButton,style:Object.assign({},null===(G=null===(P=null===(L=null===(_=null==nn?void 0:nn.approvalScreen)||void 0===_?void 0:_.body)||void 0===L?void 0:L.contentSegment)||void 0===P?void 0:P.contentBlock)||void 0===G?void 0:G.actionButton)},{children:[n("span",Object.assign({className:d.actionText,style:Object.assign({},null===(X=null===(Q=null===(K=null===(J=null==nn?void 0:nn.approvalScreen)||void 0===J?void 0:J.body)||void 0===K?void 0:K.contentSegment)||void 0===Q?void 0:Q.contentBlock)||void 0===X?void 0:X.actionText)},{children:Zo.correctMe})),n(v,{size:16,color:(null===(no=null===(oo=null===(Z=null===(Y=null==nn?void 0:nn.approvalScreen)||void 0===Y?void 0:Y.body)||void 0===Z?void 0:Z.contentSegment)||void 0===oo?void 0:oo.contentBlock)||void 0===no?void 0:no.pencilIcon)||"#5928ED"})]})),!u.isApproved&&o("button",Object.assign({disabled:Ko,onClick:Sn,style:Object.assign({},null===(io=null===(lo=null===(to=null===(eo=null==nn?void 0:nn.approvalScreen)||void 0===eo?void 0:eo.body)||void 0===to?void 0:to.contentSegment)||void 0===lo?void 0:lo.contentBlock)||void 0===io?void 0:io.approveButton),className:`${d.actionButton} ${Ko?d.actionDisabled:""}`},{children:[n("span",Object.assign({className:(null==Bn?void 0:Bn.approveText)?"":Ko?d.actionTextDisabled:d.actionText,style:Object.assign({},null==Bn?void 0:Bn.approveText)},{children:Zo.approve})),n("span",Object.assign({style:Object.assign({},null===(ao=null===(ro=null===(vo=null===(co=null==nn?void 0:nn.approvalScreen)||void 0===co?void 0:co.body)||void 0===vo?void 0:vo.contentSegment)||void 0===ro?void 0:ro.contentBlock)||void 0===ao?void 0:ao.approveIconStyle)},{children:n(c,{size:16,color:Ko?(null===(mo=null===(po=null===(uo=null===(so=null==nn?void 0:nn.approvalScreen)||void 0===so?void 0:so.body)||void 0===uo?void 0:uo.contentSegment)||void 0===po?void 0:po.contentBlock)||void 0===mo?void 0:mo.disableApproveIconColor)||"#9CA3AF":(null===(yo=null===(So=null===(bo=null===(go=null==nn?void 0:nn.approvalScreen)||void 0===go?void 0:go.body)||void 0===bo?void 0:bo.contentSegment)||void 0===So?void 0:So.contentBlock)||void 0===yo?void 0:yo.approveIconColor)||"#5928ED"})}))]})),m&&Yo.allowDeletion&&o("button",Object.assign({onClick:yn,className:d.deleteButton,style:Object.assign({},null===(ko=null===(ho=null===(Bo=null===(jo=null==nn?void 0:nn.approvalScreen)||void 0===jo?void 0:jo.body)||void 0===Bo?void 0:Bo.contentSegment)||void 0===ho?void 0:ho.contentBlock)||void 0===ko?void 0:ko.deleteButton)},{children:[n("span",{children:Zo.delete}),n(r,{size:16,color:(null===(xo=null===(Io=null===(Co=null===(Oo=null==nn?void 0:nn.approvalScreen)||void 0===Oo?void 0:Oo.body)||void 0===Co?void 0:Co.contentSegment)||void 0===Io?void 0:Io.contentBlock)||void 0===xo?void 0:xo.deleteIconColor)||"#ed3f28"})]}))]}))}))]}))};export{u as ContentBlock,u as default};
1
+ import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useState as e,useRef as l,useCallback as t,useEffect as i}from"react";import d from"./ContentBlock.module.css.js";import{CheckIcon as v}from"../../../../icons/CheckIcon.js";import{PencilIcon as c}from"../../../../icons/PencilIcon.js";import{TrashIcon as r}from"../../../../icons/TrashIcon.js";import{useUserStoryApprovalScreen as u}from"../../UserStoryApprovalContext.js";import{useRequirementAI as a}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";const s=({segment:s,segmentIndex:p,isSubFeature:m=!1,onSaveContent:S,onApproveContent:y,onDeleteContent:g,EditorComponent:b,ViewerComponent:B})=>{var h,k,C,I,x,f,N,A,T,w,D,j,E,M,W,z,R,V,F,U,q,H,$,_,L,P,G,J,K,O,Q,X,Y,Z,oo,no,eo,lo,to,io,vo,co,ro,uo,ao,so,po,mo,So,yo,go,bo,Bo,ho,ko,Co,Io,xo,fo,No,Ao,To,wo,Do,jo,Eo,Mo,Wo,zo,Ro,Vo,Fo,Uo,qo,Ho,$o,_o,Lo,Po,Go;const{currentContentId:Jo,handleUpdateContentId:Ko,isDisabled:Oo,isEditingSegment:Qo,setIsEditingSegment:Xo,config:Yo,labels:Zo,showNotification:on}=u(),{customStyles:nn,customIcons:en}=a(),[ln,tn]=e(!1),dn=l(s.content),vn=l(null),[cn,rn]=e(0),un=s.contentId===Jo,an=t(()=>{if(!vn.current)return;const o=vn.current;o.style.scrollMarginTop="90px",o.scrollIntoView({behavior:"smooth",block:"start"})},[]),sn=t(()=>{if(!vn.current)return;const o=vn.current;o.style.scrollMarginBottom="90px",o.scrollIntoView({behavior:"smooth",block:"end"})},[]);i(()=>{if(!un||!vn.current||ln)return;const o=setTimeout(()=>{sn()},200);return()=>clearTimeout(o)},[Jo,un,ln,sn]),i(()=>{if(0===cn)return;const o=setTimeout(()=>{an()},150);return()=>clearTimeout(o)},[cn,an]),i(()=>{dn.current=s.content},[s.content]);const pn=t(()=>{dn.current=s.content,tn(!0),Xo(!0),rn(o=>o+1)},[s.content,Xo]),mn=t(()=>{dn.current=s.content,tn(!1),Xo(!1)},[s.content,Xo]),Sn=t((o,n)=>{dn.current=n},[]),yn=t(()=>{const o=dn.current;(null==o?void 0:o.trim())?(tn(!1),Xo(!1),S(p,o)):on("warn","Warning!",Zo.emptyContentWarning,3e3)},[p,S,Xo,on,Zo.emptyContentWarning]),gn=t(()=>{y(p),Ko(s.contentId)},[p,s.contentId,y,Ko]),bn=t(()=>{null==g||g(p)},[p,g]),Bn=[d.container,un?d.containerActive:d.containerDefault].join(" "),hn=null===(C=null===(k=null===(h=null==nn?void 0:nn.approvalScreen)||void 0===h?void 0:h.body)||void 0===k?void 0:k.contentSegment)||void 0===C?void 0:C.contentBlock,kn=un?(null==hn?void 0:hn.currentSegementContainer)||{boxShadow:"0px 4px 14.3px 0px rgba(151, 71, 255, 0.3), 0px -4px 34.7px 0px rgba(51, 210, 255, 0.05)"}:(null==hn?void 0:hn.containerDefault)||{};return o("div",{className:Bn,style:kn,ref:vn,children:[s.isApproved&&o("div",{className:d.approvedBadge,style:{...null===(N=null===(f=null===(x=null===(I=null==nn?void 0:nn.approvalScreen)||void 0===I?void 0:I.body)||void 0===x?void 0:x.contentSegment)||void 0===f?void 0:f.contentBlock)||void 0===N?void 0:N.approvedBadge},children:[n("span",{children:Zo.approved}),n(v,{size:16,color:null===(D=null===(w=null===(T=null===(A=null==nn?void 0:nn.approvalScreen)||void 0===A?void 0:A.body)||void 0===T?void 0:T.contentSegment)||void 0===w?void 0:w.contentBlock)||void 0===D?void 0:D.checkIconColor})]}),n("div",{className:d.contentArea,style:{...null===(W=null===(M=null===(E=null===(j=null==nn?void 0:nn.approvalScreen)||void 0===j?void 0:j.body)||void 0===E?void 0:E.contentSegment)||void 0===M?void 0:M.contentBlock)||void 0===W?void 0:W.contentArea},children:ln&&b?n(b,{minHeight:"100%",height:"100%",type:"string",value:s.content||"",handleUpdateState:Sn,doNotShowBorderInViewMode:!1,mode:"edit"}):B?n(B,{message:s.content||"",scenario:"approving",customStyles:{...null===(z=null==nn?void 0:nn.userStoryScreenStyles)||void 0===z?void 0:z.userStoryContentStyles},customIcons:{...null==en?void 0:en.userStoryIcons}}):n("div",{className:d.contentFallback,dangerouslySetInnerHTML:{__html:s.content||""}})}),ln?o("div",{className:d.editActionsContainer,style:{...null===(Do=null===(wo=null===(To=null===(Ao=null==nn?void 0:nn.approvalScreen)||void 0===Ao?void 0:Ao.body)||void 0===To?void 0:To.contentSegment)||void 0===wo?void 0:wo.contentBlock)||void 0===Do?void 0:Do.editActionsContainer},children:[n("button",{onClick:mn,className:d.outlineButton,style:{...null===(Wo=null===(Mo=null===(Eo=null===(jo=null==nn?void 0:nn.approvalScreen)||void 0===jo?void 0:jo.body)||void 0===Eo?void 0:Eo.contentSegment)||void 0===Mo?void 0:Mo.contentBlock)||void 0===Wo?void 0:Wo.outlineButton,...null===(Fo=null===(Vo=null===(Ro=null===(zo=null==nn?void 0:nn.approvalScreen)||void 0===zo?void 0:zo.body)||void 0===Ro?void 0:Ro.contentSegment)||void 0===Vo?void 0:Vo.contentBlock)||void 0===Fo?void 0:Fo.cancelButton},children:Zo.cancel}),n("button",{onClick:yn,className:d.outlineButton,style:{...null===($o=null===(Ho=null===(qo=null===(Uo=null==nn?void 0:nn.approvalScreen)||void 0===Uo?void 0:Uo.body)||void 0===qo?void 0:qo.contentSegment)||void 0===Ho?void 0:Ho.contentBlock)||void 0===$o?void 0:$o.outlineButton,...null===(Go=null===(Po=null===(Lo=null===(_o=null==nn?void 0:nn.approvalScreen)||void 0===_o?void 0:_o.body)||void 0===Lo?void 0:Lo.contentSegment)||void 0===Po?void 0:Po.contentBlock)||void 0===Go?void 0:Go.saveButton},children:Zo.save})]}):n("div",{className:d.actionsContainer,style:{...null===(U=null===(F=null===(V=null===(R=null==nn?void 0:nn.approvalScreen)||void 0===R?void 0:R.body)||void 0===V?void 0:V.contentSegment)||void 0===F?void 0:F.contentBlock)||void 0===U?void 0:U.actionsContainer},children:o("div",{className:d.actionsRow,style:{...null===(_=null===($=null===(H=null===(q=null==nn?void 0:nn.approvalScreen)||void 0===q?void 0:q.body)||void 0===H?void 0:H.contentSegment)||void 0===$?void 0:$.contentBlock)||void 0===_?void 0:_.actionsRow},children:[!Qo&&Yo.allowEditing&&o("button",{onClick:pn,className:d.actionButton,style:{...null===(J=null===(G=null===(P=null===(L=null==nn?void 0:nn.approvalScreen)||void 0===L?void 0:L.body)||void 0===P?void 0:P.contentSegment)||void 0===G?void 0:G.contentBlock)||void 0===J?void 0:J.actionButton},children:[n("span",{className:d.actionText,style:{...null===(X=null===(Q=null===(O=null===(K=null==nn?void 0:nn.approvalScreen)||void 0===K?void 0:K.body)||void 0===O?void 0:O.contentSegment)||void 0===Q?void 0:Q.contentBlock)||void 0===X?void 0:X.actionText},children:Zo.correctMe}),n(c,{size:16,color:(null===(no=null===(oo=null===(Z=null===(Y=null==nn?void 0:nn.approvalScreen)||void 0===Y?void 0:Y.body)||void 0===Z?void 0:Z.contentSegment)||void 0===oo?void 0:oo.contentBlock)||void 0===no?void 0:no.pencilIcon)||"#5928ED"})]}),!s.isApproved&&o("button",{disabled:Oo,onClick:gn,style:{...null===(io=null===(to=null===(lo=null===(eo=null==nn?void 0:nn.approvalScreen)||void 0===eo?void 0:eo.body)||void 0===lo?void 0:lo.contentSegment)||void 0===to?void 0:to.contentBlock)||void 0===io?void 0:io.approveButton},className:`${d.actionButton} ${Oo?d.actionDisabled:""}`,children:[n("span",{className:(null==hn?void 0:hn.approveText)?"":Oo?d.actionTextDisabled:d.actionText,style:{...null==hn?void 0:hn.approveText},children:Zo.approve}),n("span",{style:{...null===(uo=null===(ro=null===(co=null===(vo=null==nn?void 0:nn.approvalScreen)||void 0===vo?void 0:vo.body)||void 0===co?void 0:co.contentSegment)||void 0===ro?void 0:ro.contentBlock)||void 0===uo?void 0:uo.approveIconStyle},children:n(v,{size:16,color:Oo?(null===(mo=null===(po=null===(so=null===(ao=null==nn?void 0:nn.approvalScreen)||void 0===ao?void 0:ao.body)||void 0===so?void 0:so.contentSegment)||void 0===po?void 0:po.contentBlock)||void 0===mo?void 0:mo.disableApproveIconColor)||"#9CA3AF":(null===(bo=null===(go=null===(yo=null===(So=null==nn?void 0:nn.approvalScreen)||void 0===So?void 0:So.body)||void 0===yo?void 0:yo.contentSegment)||void 0===go?void 0:go.contentBlock)||void 0===bo?void 0:bo.approveIconColor)||"#5928ED"})})]}),m&&Yo.allowDeletion&&o("button",{onClick:bn,className:d.deleteButton,style:{...null===(Co=null===(ko=null===(ho=null===(Bo=null==nn?void 0:nn.approvalScreen)||void 0===Bo?void 0:Bo.body)||void 0===ho?void 0:ho.contentSegment)||void 0===ko?void 0:ko.contentBlock)||void 0===Co?void 0:Co.deleteButton},children:[n("span",{children:Zo.delete}),n(r,{size:16,color:(null===(No=null===(fo=null===(xo=null===(Io=null==nn?void 0:nn.approvalScreen)||void 0===Io?void 0:Io.body)||void 0===xo?void 0:xo.contentSegment)||void 0===fo?void 0:fo.contentBlock)||void 0===No?void 0:No.deleteIconColor)||"#ed3f28"})]})]})})]})};export{s as ContentBlock,s as default};
2
2
  //# sourceMappingURL=ContentBlock.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e}from"tslib";import{jsxs as n,jsx as o,Fragment as t}from"react/jsx-runtime";import{useState as l,useRef as i,useCallback as s}from"react";import{ContentBlock as r}from"../ContentBlock/ContentBlock.js";import a from"./ContentSegment.module.css.js";import{ChevronUpIcon as d}from"../../../../icons/ChevronUpIcon.js";import{BookmarkIcon as c}from"../../../../icons/BookmarkIcon.js";import{ChevronDownIcon as u}from"../../../../icons/ChevronDownIcon.js";import{useRequirementAI as v}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as m}from"../../../story-screen/BigEnoughPanel.js";import{Menu as p,MenuItem as g}from"@mui/material";import{ExternalLink as b,Download as j,Share2 as y,Copy as h}from"lucide-react";import S from"showdown";import{formatMarkdown as O}from"../../../../utils/helpers.js";const C=({userStoryForApproval:C,artifactTitleId:f,isSubFeature:I=!1,subFeatureIndex:N,onSaveSubFeature:w,onDeleteSubFeature:k,onSaveMainStoryContent:x,EditorComponent:A,ViewerComponent:B,handleDownloadUserStory:M,handleOpenSendDialog:T,showShareIcon:F=!1})=>{var _,z,D,E,L,P,U,W,H,R,q,V,G,J,K,Q,X,Y,Z,$,ee,ne,oe,te,le,ie,se,re,ae;const[de,ce]=l(!0),{customStyles:ue,customIcons:ve}=v(),me=null==ue?void 0:ue.userStoryCardStyles,[pe,ge]=l(null),[be,je]=l(!1),ye=i(null),he=s(()=>{ce(e=>!e)},[]),Se=s(e=>{if(void 0===N)return;const n=Object.assign(Object.assign({},C),{value:C.value.map((n,o)=>o===e?Object.assign(Object.assign({},n),{isApproved:!0}):n)});null==w||w(N,n)},[C,N,w]),Oe=s((e,n)=>{if(void 0===N)return;const o=Object.assign(Object.assign({},C),{value:C.value.map((o,t)=>t===e?Object.assign(Object.assign({},o),{content:n}):o)});null==w||w(N,o)},[C,N,w]),Ce=s(e=>{if(void 0===N)return;const n=Object.assign(Object.assign({},C),{value:C.value.filter((n,o)=>o!==e)});0!==n.value.length?null==w||w(N,n):null==k||k(N)},[C,N,w,k]),fe=s((e,n)=>{var o;if(I)return;const t=null===(o=C.value[e])||void 0===o?void 0:o.contentId;if(!t)return;const l=Object.assign(Object.assign({},C),{value:C.value.map(e=>e.contentId===t?Object.assign(Object.assign({},e),{content:n}):e)});null==x||x(l)},[C,I,x]),Ie=s(e=>{var n;if(I)return;const o=null===(n=C.value[e])||void 0===n?void 0:n.contentId;if(!o)return;const t=Object.assign(Object.assign({},C),{value:C.value.map(e=>e.contentId===o?Object.assign(Object.assign({},e),{isApproved:!0}):e)});null==x||x(t)},[C,I,x]),Ne=()=>{ge(null)},we=e=>{var n;const o=e.value.map(e=>e.content).join("");return Object.assign(Object.assign({},e),{value:o,sub_features:null===(n=e.sub_features)||void 0===n?void 0:n.map(we)})},ke=null!=(null==C?void 0:C.big_enough)&&!Number.isNaN(C.big_enough)&&!!(null==C?void 0:C.big_enough_decision_factors);return n("div",Object.assign({className:a.container,style:Object.assign({},null===(D=null===(z=null===(_=null==ue?void 0:ue.approvalScreen)||void 0===_?void 0:_.body)||void 0===z?void 0:z.contentSegment)||void 0===D?void 0:D.container)},{children:[I&&n("button",Object.assign({onClick:he,className:a.header,style:Object.assign({},null===(P=null===(L=null===(E=null==ue?void 0:ue.approvalScreen)||void 0===E?void 0:E.body)||void 0===L?void 0:L.contentSegment)||void 0===P?void 0:P.header)},{children:[n("div",Object.assign({className:a.headerContent,style:Object.assign({},null===(H=null===(W=null===(U=null==ue?void 0:ue.approvalScreen)||void 0===U?void 0:U.body)||void 0===W?void 0:W.contentSegment)||void 0===H?void 0:H.headerContent)},{children:[n("div",Object.assign({className:a.headerMeta,style:Object.assign({},null===(V=null===(q=null===(R=null==ue?void 0:ue.approvalScreen)||void 0===R?void 0:R.body)||void 0===q?void 0:q.contentSegment)||void 0===V?void 0:V.headerMeta)},{children:[o(c,{size:16,color:(null===(K=null===(J=null===(G=null==ue?void 0:ue.approvalScreen)||void 0===G?void 0:G.body)||void 0===J?void 0:J.contentSegment)||void 0===K?void 0:K.bookMarkColor)||"#8C8C8C"}),o("h2",Object.assign({className:a.headerArtifactId,style:Object.assign({},null===(Y=null===(X=null===(Q=null==ue?void 0:ue.approvalScreen)||void 0===Q?void 0:Q.body)||void 0===X?void 0:X.contentSegment)||void 0===Y?void 0:Y.headerArtifactId)},{children:f}))]})),o("p",Object.assign({className:a.headerTitle,style:Object.assign({},null===(ee=null===($=null===(Z=null==ue?void 0:ue.approvalScreen)||void 0===Z?void 0:Z.body)||void 0===$?void 0:$.contentSegment)||void 0===ee?void 0:ee.headerTitle)},{children:null==C?void 0:C.title}))]})),n("div",Object.assign({className:a.headerToggle,style:Object.assign({},null===(te=null===(oe=null===(ne=null==ue?void 0:ue.approvalScreen)||void 0===ne?void 0:ne.body)||void 0===oe?void 0:oe.contentSegment)||void 0===te?void 0:te.headerToggle)},{children:[ke&&o(m,{customIcons:null==ve?void 0:ve.userStoryIcons,customStyles:null===(le=null==ue?void 0:ue.approvalScreen)||void 0===le?void 0:le.aiReasoningCitaionStyles,currentUserStory:C,panelStyles:null===(ie=null==ue?void 0:ue.approvalScreen)||void 0===ie?void 0:ie.BigEnoughStyles}),F&&n(t,{children:[o("button",Object.assign({className:a.iconButton,style:null==me?void 0:me.iconButton,onClick:e=>{ge(e.currentTarget)}},{children:o(b,{size:16})})),n(p,Object.assign({id:"user-story-share-menu",anchorEl:pe,open:!!pe,onClose:()=>ge(null),style:null==me?void 0:me.userStoryShareMenu},{children:[o(g,Object.assign({style:null==me?void 0:me.userStoryMenuItem,onClick:()=>e(void 0,void 0,void 0,function*(){je(!0),M&&(yield Promise.all([M("pdf"),M("doc")]),je(!1))})},{children:n("div",Object.assign({ref:ye,className:a.menuItemContent,style:null==me?void 0:me.menuItemContent},{children:[o(j,{size:16,color:null==me?void 0:me.menuIconColor}),o("p",Object.assign({style:null==me?void 0:me.menuLabel},{children:"Download"}))]}))})),o(g,Object.assign({style:null==me?void 0:me.userStoryMenuItem,onClick:()=>e(void 0,void 0,void 0,function*(){const e=we(C);null==T||T(!0,[e],C.artifactId),Ne()})},{children:n("div",Object.assign({style:null==me?void 0:me.menuItemContent,className:a.menuItemContentPadded},{children:[o(y,{size:16,color:null==me?void 0:me.menuIconColor}),o("p",Object.assign({style:null==me?void 0:me.menuLabel},{children:"Send"}))]}))})),o(g,Object.assign({style:null==me?void 0:me.userStoryMenuItem,onClick:()=>e(void 0,void 0,void 0,function*(){const e=new S.Converter,n=C.value.map(e=>e.content).join(""),o=e.makeHtml(O(n)||n),t=(e=>{const n=(new S.Converter).makeHtml(e),o=document.createElement("div");return o.innerHTML=n,o.textContent||o.innerText||""})(O(n)||n),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([o],{type:"text/html"})});try{yield navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Ne()}})},{children:n("div",Object.assign({style:null==me?void 0:me.menuItemContent,className:a.menuItemContentPadded},{children:[o(h,{size:16,color:null==me?void 0:me.menuIconColor}),o("p",Object.assign({style:null==me?void 0:me.menuLabel},{children:"Copy"}))]}))}))]}))]}),o(de?d:u,{size:16})]}))]})),de&&o("div",Object.assign({className:a.contentWrapper,style:Object.assign({},null===(ae=null===(re=null===(se=null==ue?void 0:ue.approvalScreen)||void 0===se?void 0:se.body)||void 0===re?void 0:re.contentSegment)||void 0===ae?void 0:ae.contentWrapper)},{children:Array.isArray(null==C?void 0:C.value)&&C.value.map((e,n)=>o(r,{segment:e,segmentIndex:n,isSubFeature:I,onSaveContent:I?Oe:fe,onApproveContent:I?Se:Ie,onDeleteContent:I?Ce:void 0,EditorComponent:A,ViewerComponent:B},e.contentId))}))]}))};export{C as ContentSegment,C as default};
1
+ import{jsxs as e,jsx as n,Fragment as o}from"react/jsx-runtime";import{useState as l,useRef as t,useCallback as i}from"react";import{ContentBlock as r}from"../ContentBlock/ContentBlock.js";import d from"./ContentSegment.module.css.js";import{ChevronUpIcon as a}from"../../../../icons/ChevronUpIcon.js";import{BookmarkIcon as u}from"../../../../icons/BookmarkIcon.js";import{ChevronDownIcon as v}from"../../../../icons/ChevronDownIcon.js";import{useRequirementAI as c}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as s}from"../../../story-screen/BigEnoughPanel.js";import{Menu as m,MenuItem as p}from"@mui/material";import{ExternalLink as y,Download as h,Share2 as S,Copy as C}from"lucide-react";import I from"showdown";import{formatMarkdown as f}from"../../../../utils/helpers.js";const g=({userStoryForApproval:g,artifactTitleId:b,isSubFeature:w=!1,subFeatureIndex:N,onSaveSubFeature:k,onDeleteSubFeature:j,onSaveMainStoryContent:x,EditorComponent:A,ViewerComponent:B,handleDownloadUserStory:M,handleOpenSendDialog:T,showShareIcon:F=!1})=>{var _,z,D,E,L,P,U,W,H,R,q,V,O,G,J,K,Q,X,Y,Z,$,ee,ne,oe,le,te,ie,re,de;const[ae,ue]=l(!0),{customStyles:ve,customIcons:ce}=c(),se=null==ve?void 0:ve.userStoryCardStyles,[me,pe]=l(null),[ye,he]=l(!1),Se=t(null),Ce=i(()=>{ue(e=>!e)},[]),Ie=i(e=>{if(void 0===N)return;const n={...g,value:g.value.map((n,o)=>o===e?{...n,isApproved:!0}:n)};null==k||k(N,n)},[g,N,k]),fe=i((e,n)=>{if(void 0===N)return;const o={...g,value:g.value.map((o,l)=>l===e?{...o,content:n}:o)};null==k||k(N,o)},[g,N,k]),ge=i(e=>{if(void 0===N)return;const n={...g,value:g.value.filter((n,o)=>o!==e)};0!==n.value.length?null==k||k(N,n):null==j||j(N)},[g,N,k,j]),be=i((e,n)=>{var o;if(w)return;const l=null===(o=g.value[e])||void 0===o?void 0:o.contentId;if(!l)return;const t={...g,value:g.value.map(e=>e.contentId===l?{...e,content:n}:e)};null==x||x(t)},[g,w,x]),we=i(e=>{var n;if(w)return;const o=null===(n=g.value[e])||void 0===n?void 0:n.contentId;if(!o)return;const l={...g,value:g.value.map(e=>e.contentId===o?{...e,isApproved:!0}:e)};null==x||x(l)},[g,w,x]),Ne=()=>{pe(null)},ke=e=>{var n;const o=e.value.map(e=>e.content).join("");return{...e,value:o,sub_features:null===(n=e.sub_features)||void 0===n?void 0:n.map(ke)}},je=null!=(null==g?void 0:g.big_enough)&&!Number.isNaN(g.big_enough)&&!!(null==g?void 0:g.big_enough_decision_factors);return e("div",{className:d.container,style:{...null===(D=null===(z=null===(_=null==ve?void 0:ve.approvalScreen)||void 0===_?void 0:_.body)||void 0===z?void 0:z.contentSegment)||void 0===D?void 0:D.container},children:[w&&e("button",{onClick:Ce,className:d.header,style:{...null===(P=null===(L=null===(E=null==ve?void 0:ve.approvalScreen)||void 0===E?void 0:E.body)||void 0===L?void 0:L.contentSegment)||void 0===P?void 0:P.header},children:[e("div",{className:d.headerContent,style:{...null===(H=null===(W=null===(U=null==ve?void 0:ve.approvalScreen)||void 0===U?void 0:U.body)||void 0===W?void 0:W.contentSegment)||void 0===H?void 0:H.headerContent},children:[e("div",{className:d.headerMeta,style:{...null===(V=null===(q=null===(R=null==ve?void 0:ve.approvalScreen)||void 0===R?void 0:R.body)||void 0===q?void 0:q.contentSegment)||void 0===V?void 0:V.headerMeta},children:[n(u,{size:16,color:(null===(J=null===(G=null===(O=null==ve?void 0:ve.approvalScreen)||void 0===O?void 0:O.body)||void 0===G?void 0:G.contentSegment)||void 0===J?void 0:J.bookMarkColor)||"#8C8C8C"}),n("h2",{className:d.headerArtifactId,style:{...null===(X=null===(Q=null===(K=null==ve?void 0:ve.approvalScreen)||void 0===K?void 0:K.body)||void 0===Q?void 0:Q.contentSegment)||void 0===X?void 0:X.headerArtifactId},children:b})]}),n("p",{className:d.headerTitle,style:{...null===($=null===(Z=null===(Y=null==ve?void 0:ve.approvalScreen)||void 0===Y?void 0:Y.body)||void 0===Z?void 0:Z.contentSegment)||void 0===$?void 0:$.headerTitle},children:null==g?void 0:g.title})]}),e("div",{className:d.headerToggle,style:{...null===(oe=null===(ne=null===(ee=null==ve?void 0:ve.approvalScreen)||void 0===ee?void 0:ee.body)||void 0===ne?void 0:ne.contentSegment)||void 0===oe?void 0:oe.headerToggle},children:[je&&n(s,{customIcons:null==ce?void 0:ce.userStoryIcons,customStyles:null===(le=null==ve?void 0:ve.approvalScreen)||void 0===le?void 0:le.aiReasoningCitaionStyles,currentUserStory:g,panelStyles:null===(te=null==ve?void 0:ve.approvalScreen)||void 0===te?void 0:te.BigEnoughStyles}),F&&e(o,{children:[n("button",{className:d.iconButton,style:null==se?void 0:se.iconButton,onClick:e=>{pe(e.currentTarget)},children:n(y,{size:16})}),e(m,{id:"user-story-share-menu",anchorEl:me,open:!!me,onClose:()=>pe(null),style:null==se?void 0:se.userStoryShareMenu,children:[n(p,{style:null==se?void 0:se.userStoryMenuItem,onClick:async()=>{he(!0),M&&(await Promise.all([M("pdf"),M("doc")]),he(!1))},children:e("div",{ref:Se,className:d.menuItemContent,style:null==se?void 0:se.menuItemContent,children:[n(h,{size:16,color:null==se?void 0:se.menuIconColor}),n("p",{style:null==se?void 0:se.menuLabel,children:"Download"})]})}),n(p,{style:null==se?void 0:se.userStoryMenuItem,onClick:async()=>{const e=ke(g);null==T||T(!0,[e],g.artifactId),Ne()},children:e("div",{style:null==se?void 0:se.menuItemContent,className:d.menuItemContentPadded,children:[n(S,{size:16,color:null==se?void 0:se.menuIconColor}),n("p",{style:null==se?void 0:se.menuLabel,children:"Send"})]})}),n(p,{style:null==se?void 0:se.userStoryMenuItem,onClick:async()=>{const e=new I.Converter,n=g.value.map(e=>e.content).join(""),o=e.makeHtml(f(n)||n),l=(e=>{const n=(new I.Converter).makeHtml(e),o=document.createElement("div");return o.innerHTML=n,o.textContent||o.innerText||""})(f(n)||n),t=new ClipboardItem({"text/plain":new Blob([l],{type:"text/plain"}),"text/html":new Blob([o],{type:"text/html"})});try{await navigator.clipboard.write([t]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Ne()}},children:e("div",{style:null==se?void 0:se.menuItemContent,className:d.menuItemContentPadded,children:[n(C,{size:16,color:null==se?void 0:se.menuIconColor}),n("p",{style:null==se?void 0:se.menuLabel,children:"Copy"})]})})]})]}),n(ae?a:v,{size:16})]})]}),ae&&n("div",{className:d.contentWrapper,style:{...null===(de=null===(re=null===(ie=null==ve?void 0:ve.approvalScreen)||void 0===ie?void 0:ie.body)||void 0===re?void 0:re.contentSegment)||void 0===de?void 0:de.contentWrapper},children:Array.isArray(null==g?void 0:g.value)&&g.value.map((e,o)=>n(r,{segment:e,segmentIndex:o,isSubFeature:w,onSaveContent:w?fe:be,onApproveContent:w?Ie:we,onDeleteContent:w?ge:void 0,EditorComponent:A,ViewerComponent:B},e.contentId))})]})};export{g as ContentSegment,g as default};
2
2
  //# sourceMappingURL=ContentSegment.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as e}from"tslib";import{jsx as n,Fragment as i,jsxs as o}from"react/jsx-runtime";import t,{createContext as l,useRef as r,useState as d,useCallback as a,useMemo as s,useEffect as c,useContext as u}from"react";import g from"react-markdown";import v from"rehype-raw";import p from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as h}from"../../shared/useMarkdownSearch.js";import{Info as m}from"lucide-react";import{Tooltip as C}from"@mui/material";import f from"dompurify";import b from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import w from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as S}from"../RequirementAIWrapper/RequirementAIWrapper.js";import j from"../../icons/CognitiveDecision.js";import I from"../../icons/BrainRed.js";import R,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as $}from"../ai-reasoning/AiReasoningCitation.js";import O from"../../icons/RelevanceScoreIcon.js";import x from"../RecommendationBlock/RecommendationBlock.js";import N from"../UserStoryCard/AttachedContext.js";import k from"../ai-reasoning/AiReasoningCitationContent.js";import A from"./components/InlineUpdatedComponent.js";import U from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as E}from"../../store/markdown-context.js";import L from"./components/HighlightButtonComponent.js";const T=l(!1),_=l({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),D=l({rowId:""}),M=({aiReason:e,isHighConfidence:i,customStyle:t,customIcons:l})=>{var r;const{expandedInfo:d,setExpanded:a,reasonToRow:s}=u(_),{rowId:c}=u(D),g=String(e.id);c&&s.current.set(g,c);const v=(null===(r=null==d?void 0:d.aiReason)||void 0===r?void 0:r.id)===e.id,h=i?(null==l?void 0:l.highConfidence)||n(j,{}):(null==l?void 0:l.lowConfidence)||n(I,{});return o("button",Object.assign({className:p.aiReasoningButton,style:t,onClick:n=>{n.stopPropagation(),n.preventDefault(),a(v?null:c,v?null:e)}},{children:[h,n("i",v?{className:`pi pi-angle-up ${i?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence}`}:{className:`pi pi-angle-down ${i?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence}`})]}))},P=({children:e,node:i,customStyles:t,customIcons:l})=>{var d,a;const s=r(Math.random().toString(36).slice(2)).current,{expandedInfo:c}=u(_),g=(null==c?void 0:c.rowId)===s,v=Array.isArray(null==i?void 0:i.children)?i.children.filter(e=>"element"===e.type).length:1,h=null!==(a=null===(d=null==i?void 0:i.properties)||void 0===d?void 0:d.style)&&void 0!==a?a:void 0;return o(D.Provider,Object.assign({value:{rowId:s}},{children:[n("tr",Object.assign({style:h?{cssText:h}:void 0},{children:e})),g&&(null==c?void 0:c.aiReason)&&n("tr",Object.assign({style:{width:"100%"}},{children:n("td",Object.assign({colSpan:v||1,className:p.tableExpandedCell},{children:n("div",Object.assign({className:p.tableExpandedCellInner},{children:n("div",Object.assign({className:p.tableExpandedCellContent},{children:n(k,{aiReason:c.aiReason,customIcons:l,customStyles:{aiReasoningContent:null==t?void 0:t.aiReasoningContent,aiReasoningAccordion:null==t?void 0:t.aiReasoningAccordion,aiReasoningMarkdown:null==t?void 0:t.aiReasoningMarkdown,aiReasoningPill:null==t?void 0:t.aiReasoningPill,webCitation:null==t?void 0:t.webCitation,stormeeCitation:null==t?void 0:t.stormeeCitation,waveformCitation:null==t?void 0:t.waveformCitation,imageCitation:null==t?void 0:t.imageCitation,fileCitation:null==t?void 0:t.fileCitation,appModCitation:null==t?void 0:t.appModCitation,rcaCitation:null==t?void 0:t.rcaCitation,readFileCitation:null==t?void 0:t.readFileCitation,loadingCitations:null==t?void 0:t.loadingCitations,chatCitation:null==t?void 0:t.chatCitation}})}))}))}))}))]}))};const H=["del","ins"];function F(e){return function(e,n,i){const o=n.join("|");return e.replace(new RegExp(`<(${o})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,o)=>`<${n}>${i(o)}</${n}>`)}(e,H,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var o;return`<code>${t=null!==(o=n[Number(i)])&&void 0!==o?o:"",t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code>`;var t})}(e)).join(""))}const B=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function V(e,n){const i=[],o=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,r;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!t.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(o.has(d))return i.push(e),null;if(B.has(d))return e;const a=null===(r=t.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===r?void 0:r.flat().filter(e=>null!=e);return a&&0!==a.length?t.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}const q=({message:l,noMarkdownContent:j,useMarkdown:I=!0,isParent:k,scenario:D,showUserStoryDiff:H=!1,aiReasoningsForBlock:B,isCitationLoadingDisplay:q=!1,className:z,highConfidenceIcon:W,lowConfidenceIcon:G,customStyles:Q,customIcons:J,contextVariant:K,aiReasoningDiffView:X,userStoryCitations:Y,artifactId:Z,isCraflow:ee,onCraAccept:ne,onCraReject:ie,craFlowConfig:oe,isDisplayHighlightControl:te=!1,showConfidenceScore:le=!0,CDNeededInChip:re,blockId:de})=>{var ae;console.log("userstorywithcitation blockid ",de);const se=r(null),{userStory:ce,inlineUpdateComponentConfig:ue,getAvgScoreForStory:ge,setUserStory:ve,aiReasoning:pe,setAiReasoning:he,customIcons:me,searchQueryList:Ce,searchQueryReasoningIdList:fe,currentHighlightIndex:be,segmentComponentConfig:ye,diffEditConfig:we}=S(),Se=null!=J?J:null==me?void 0:me.userStoryIcons;null==Q||Q.searchHighlight;const{search:je,clear:Ie}=h(se),[Re,$e]=d("1"),[Oe,xe]=d(null),Ne=r(new Map),[ke,Ae]=d(new Set),Ue=a((e,n)=>{xe(e&&n?{rowId:e,aiReason:n}:null)},[]),Ee=Z?ge(Z):0,[Le,Te]=d([]),_e=a(e=>{Ae(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),De=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(De).join(""):t.isValidElement(e)?De(e.props.children):"",Me=e=>{let n=e;return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,o,t)=>{const l=o.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,o,t)=>{const l=n.substring(0,t),r=l.lastIndexOf("\n"),d=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),a=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(d||a){let e=o;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let o;const t=new RegExp(n.source,n.flags);for(;null!==(o=t.exec(e));){const e=o[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),t=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:o.index,endIndex:o.index+o[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==t?void 0:t[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],o=n.changedItemCount-n.deletedItemCount;if(0===o)continue;const t=l.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of t){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const d=n.endIndex,a=e+1<i.length?i[e+1].index:l.length;let s=l.substring(d,a);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+o}. `),l=l.substring(0,d)+s+l.substring(a)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=F(n),n},Pe=s(()=>l?Me(l):l,[l]);c(()=>{Te(B||pe)},[B,pe]);const He=s(()=>({span:i=>{var o,t,l,r,d,{node:a,children:s}=i,c=e(i,["node","children"]);const u=null!==(t=null===(o=null==a?void 0:a.properties)||void 0===o?void 0:o["highlight-id"])&&void 0!==t?t:null==c?void 0:c["highlight-id"],g="string"==typeof u&&ke.has(u),v=null!==(r=null===(l=null==a?void 0:a.properties)||void 0===l?void 0:l["highlight-color"])&&void 0!==r?r:null==c?void 0:c["highlight-color"];return n("span",Object.assign({style:Object.assign(Object.assign({},null!==(d=null==Q?void 0:Q.span)&&void 0!==d?d:{}),g?{backgroundColor:v||"#fef08a"}:{})},{children:s}))},button:o=>{var t,l,r,d,a,s,{node:c,children:u}=o,g=e(o,["node","children"]);const v=null!==(l=null===(t=null==c?void 0:c.properties)||void 0===t?void 0:t.action)&&void 0!==l?l:null==g?void 0:g.action,p=null!==(d=null===(r=null==c?void 0:c.properties)||void 0===r?void 0:r["highlight-id"])&&void 0!==d?d:null==g?void 0:g["highlight-id"],h=null!==(s=null===(a=null==c?void 0:c.properties)||void 0===a?void 0:a["highlight-type"])&&void 0!==s?s:null==g?void 0:g["highlight-type"];return"highlight"===v?n(L,{highlightId:p,handleHighlightSpan:_e,icon:"web"===h?null==Se?void 0:Se.webCitationIcon:"doc"===h?null==Se?void 0:Se.fileCitationIcon:n(i,{}),customStyles:"web"===h?null==Q?void 0:Q.webButton:"doc"===h?null==Q?void 0:Q.docButton:{}}):null},upt:o=>{var t,{node:l,children:r}=o,d=e(o,["node","children"]);const a=null==d?void 0:d.id,s=a?null===(t=a.split("$"))||void 0===t?void 0:t[1]:null,c=pe.find(e=>e.id.toString()===s);return c?n(i,{children:n(A,Object.assign({aiReason:c,customStyles:null==Q?void 0:Q.inlineUpdatedComponent,handleClickCognitiveDecision:null==ue?void 0:ue.handleClickCognitiveDecision,handleClickUpdatedPill:null==ue?void 0:ue.handleClickUpdatedPill,handleClickOutputValue:null==ue?void 0:ue.handleClickOutputValue,customIcons:null==ue?void 0:ue.customIcons,CDNeededInChip:re},{children:r}))}):r},del:t=>{var l,r,d,a,{node:s,children:c}=t,u=e(t,["node","children"]);const g=u.aireason,v=g&&(null===(l=g.deviation_details)||void 0===l?void 0:l.resolved)&&("rejected"===(null===(r=g.deviation_details)||void 0===r?void 0:r.resolved)||"reverted"===(null===(d=g.deviation_details)||void 0===d?void 0:d.resolved)),{cleanedChildren:h,extractedNodes:m}=V(c,["ins"]);return o(i,{children:[n("span",Object.assign({className:p.deleted,style:Object.assign(Object.assign({},null!==(a=null==Q?void 0:Q.deleted)&&void 0!==a?a:{}),{textDecoration:v?"none":"line-through"})},u,{onClick:u.onclick},{children:h})),m]})},ins:t=>{var{children:l}=t,r=e(t,["children"]);const{cleanedChildren:d,extractedNodes:a}=V(l,["del"]);return o(i,{children:[n("span",Object.assign({className:p.inserted,style:null==Q?void 0:Q.inserted},r,{onClick:r.onclick},{children:d})),a]})},preserved:i=>{var{children:o}=i,t=e(i,["children"]);return n("span",Object.assign({className:p.preserved,style:null==Q?void 0:Q.preserved},t,{onClick:t.onclick},{children:o}))},h1:i=>{var o=e(i,["node"]);return n("h1",Object.assign({className:p.heading1,style:null==Q?void 0:Q.heading1},{children:o.children}))},h2:i=>{var o=e(i,["node"]);return n("h2",Object.assign({className:p.heading2,style:null==Q?void 0:Q.heading2},{children:o.children}))},h3:i=>{var o=e(i,["node"]);return n("h3",Object.assign({className:p.heading3,style:null==Q?void 0:Q.heading3},{children:o.children}))},b:i=>{var o=e(i,["node"]);return n("b",Object.assign({className:p.bold,style:null==Q?void 0:Q.bold},{children:null==o?void 0:o.children}))},p:i=>{var o=e(i,["node"]);return n("p",Object.assign({},o,{className:p.paragraph,style:null==Q?void 0:Q.paragraph},{children:o.children}))},updated:i=>{var{node:o}=i,t=e(i,["node"]);return n(b,Object.assign({},t,{showUserStoryDiff:H,currentUpdatedTagId:Re,setCurrentUpdatedTagId:$e,userStory:ce,setUserStory:ve,setAiReasoning:he,node:o,isCraflow:ee,onCraAccept:ne,onCraReject:ie,diffEditConfig:we,customStyles:null==Q?void 0:Q.updatedContent,craFlowConfig:oe}))},ol:i=>{var o,t,l,{node:r}=i,d=e(i,["node"]);const a=null!==(l=null!==(t=null===(o=null==r?void 0:r.properties)||void 0===o?void 0:o.start)&&void 0!==t?t:null==d?void 0:d.start)&&void 0!==l?l:void 0;return n("ol",Object.assign({className:p.orderedList,style:null==Q?void 0:Q.olist},a?{start:Number(a)}:{},{children:null==d?void 0:d.children}))},ul:i=>{var o=e(i,["node"]);return n("ul",Object.assign({className:p.unorderedList,style:null==Q?void 0:Q.ulist},{children:null==o?void 0:o.children}))},table:({children:e})=>n("div",Object.assign({className:p.tableWrapper},{children:n("table",Object.assign({className:p.table,style:null==Q?void 0:Q.table},{children:e}))})),tr:({node:e,children:i})=>n(P,{node:e,children:i,customStyles:Q}),td:({node:i,children:o})=>{var t;const l=null!==(t=null==i?void 0:i.properties)&&void 0!==t?t:{},{style:r}=l,d=e(l,["style"]);return n(T.Provider,Object.assign({value:!0},{children:n("td",Object.assign({},d,{style:r?{cssText:r}:void 0},{children:o}))}))},th:({node:i,children:o})=>{var t;const l=null!==(t=null==i?void 0:i.properties)&&void 0!==t?t:{},{style:r}=l,d=e(l,["style"]);return n(T.Provider,Object.assign({value:!0},{children:n("th",Object.assign({},d,{style:r?{cssText:r}:void 0},{children:o}))}))},recommendation:i=>{var o,t=e(i,["node"]);const l=`The AI has selected this content based on: ${(null===(o=null==t?void 0:t.children)||void 0===o?void 0:o[0])||""}`;return n(x,Object.assign({},t,{customStyles:null==Q?void 0:Q.recommendationBlock,label:l}))},a:i=>{var o,t,l,{inline:r,children:d,node:a}=i,s=e(i,["inline","children","node"]);const c=u(T)||"true"==(null==s?void 0:s.table),g=`${null==s?void 0:s.href}`,v=null===(o=g.split("$"))||void 0===o?void 0:o[0],p=null===(t=g.split("$"))||void 0===t?void 0:t[1];if("ai_reasoning"===v){const e=(null!==(l=H?X:pe)&&void 0!==l?l:[]).find(e=>e.id.toString()===decodeURIComponent(p)),i=fe.includes(p);if(e){if(c)return n(M,{aiReason:e,customStyle:null==Q?void 0:Q.tableAiReasoning,customIcons:Se,isHighConfidence:e.relevance_score>=$});const o=De(d),t="source"!==o.trim().toLowerCase();return n(R,{aiReason:e,isSourceHasHighlight:i,inlineLabel:o,isInlineCitation:t,customIcons:Se,customStyles:{aiReasoningContent:null==Q?void 0:Q.aiReasoningContent,aiReasoningAccordion:null==Q?void 0:Q.aiReasoningAccordion,aiReasoningMarkdown:null==Q?void 0:Q.aiReasoningMarkdown,aiReasoningPill:null==Q?void 0:Q.aiReasoningPill,webCitation:null==Q?void 0:Q.webCitation,stormeeCitation:null==Q?void 0:Q.stormeeCitation,waveformCitation:null==Q?void 0:Q.waveformCitation,imageCitation:null==Q?void 0:Q.imageCitation,fileCitation:null==Q?void 0:Q.fileCitation,appModCitation:null==Q?void 0:Q.appModCitation,rcaCitation:null==Q?void 0:Q.rcaCitation,readFileCitation:null==Q?void 0:Q.readFileCitation,loadingCitations:null==Q?void 0:Q.loadingCitations,chatCitation:null==Q?void 0:Q.chatCitation,bigEnoughCitation:null==Q?void 0:Q.bigEnoughCitation}})}}return null},code:i=>{var{inline:o,children:t,className:l,node:r}=i;e(i,["inline","children","className","node"]);return/language-(\w+)/.exec(l||"")||(null==l?void 0:l.includes("language-"))?n("div",{children:n("code",Object.assign({className:p.blockCode,style:null==Q?void 0:Q.code},{children:t}))}):n("code",Object.assign({className:p.inlineCode,style:null==Q?void 0:Q.code},{children:t}))},learned:({children:e})=>n(C,Object.assign({title:e,placement:"top"},{children:n(m,{size:16,className:p.learned})})),generatedcode:i=>{var o=e(i,["node"]);const t=(null==o?void 0:o.language)||"python",l=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=e=>{var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n})(o);return n(y,{title:"Generated Code",code:l,language:t,customStyles:{pill:null==Q?void 0:Q.generatedCodePill,content:null==Q?void 0:Q.generatedCodeContent}})},updatedsegment:i=>{var o,t,l,r,{node:d,children:a}=i,s=e(i,["node","children"]);const c=`${null===(o=d.position)||void 0===o?void 0:o.start.line}-${null===(t=d.position)||void 0===t?void 0:t.start.column}-${null===(l=d.position)||void 0===l?void 0:l.end.line}-${null===(r=d.position)||void 0===r?void 0:r.end.column}`,u=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(s),g=n("div",u?{dangerouslySetInnerHTML:{__html:f.sanitize(u)}}:{children:a});return n(U,{id:c,node:d,children:g,props:s,segmentComponentConfig:ye,customStyles:Q,customIcons:J,extractText:De,isUpdatedSegment:!0})},segment:i=>{var o,t,l,r,{node:d,children:a}=i,s=e(i,["node","children"]);const c=`${null===(o=d.position)||void 0===o?void 0:o.start.line}-${null===(t=d.position)||void 0===t?void 0:t.start.column}-${null===(l=d.position)||void 0===l?void 0:l.end.line}-${null===(r=d.position)||void 0===r?void 0:r.end.column}`;return n(U,{id:c,node:d,children:a,props:s,segmentComponentConfig:ye,customStyles:Q,customIcons:J,extractText:De,blockId:de})}}),[Le,oe,pe,Y,Re,H,l,J,Ce,fe,Q,ye,ke,_e,de]);return c(()=>{if(!se.current)return;if(!Ce.length)return void Ie();let e;if(0===fe.length||te)requestAnimationFrame(()=>{je([Ce[be].replace(/\*/g,"")])});else{const n=se.current,i=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{i.disconnect(),requestAnimationFrame(()=>{je([Ce[be].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return()=>{clearTimeout(e)}},[Ce,fe,be,te]),n(_.Provider,Object.assign({value:{expandedInfo:Oe,setExpanded:Ue,reasonToRow:Ne}},{children:o("div",Object.assign({ref:se,className:`${p.container} ${"approving"!==D?p.wrapper:""} ${z||""}`,style:null==Q?void 0:Q.container},{children:[I?n(E,{children:n(g,Object.assign({components:He,rehypePlugins:[v]},{children:Pe}))}):j,Ee>0&&le&&n("div",Object.assign({className:p.confidenceScoreContainer,style:null==Q?void 0:Q.confidenceScoreContainer},{children:o("span",Object.assign({className:p.confidenceScore,style:null==Q?void 0:Q.confidenceScore},{children:[n(O,{size:14,color:(null==Q?void 0:Q.confidenceScoreIconColor)||"#166534"}),Ee,"%"]}))})),q&&n("div",Object.assign({className:p.citationLoader,style:null==Q?void 0:Q.citationLoaderContainer},{children:n(w,{customStyles:{container:null==Q?void 0:Q.citationLoadingContainer,icon:null==Q?void 0:Q.citationLoadingIcon,text:null==Q?void 0:Q.citationLoadingText}})})),k&&n("div",Object.assign({style:Object.assign({},null===(ae=null==Q?void 0:Q.attachedContext)||void 0===ae?void 0:ae.wrapper),className:"flex mt-5"},{children:n(N,{customStyles:null==Q?void 0:Q.attachedContext,variant:K})}))]}))}))};export{q as default,V as splitNestedDiffNodes};
1
+ import{jsx as e,Fragment as n,jsxs as i}from"react/jsx-runtime";import o,{createContext as t,useRef as l,useState as r,useCallback as d,useMemo as a,useEffect as s,useContext as c}from"react";import u from"react-markdown";import p from"rehype-raw";import g from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as h}from"../../shared/useMarkdownSearch.js";import{Info as v}from"lucide-react";import{Tooltip as m}from"@mui/material";import C from"dompurify";import f from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import w from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as S}from"../RequirementAIWrapper/RequirementAIWrapper.js";import b from"../../icons/CognitiveDecision.js";import I from"../../icons/BrainRed.js";import R,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as $}from"../ai-reasoning/AiReasoningCitation.js";import x from"../../icons/RelevanceScoreIcon.js";import N from"../RecommendationBlock/RecommendationBlock.js";import k from"../UserStoryCard/AttachedContext.js";import A from"../ai-reasoning/AiReasoningCitationContent.js";import j from"./components/InlineUpdatedComponent.js";import U from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as E}from"../../store/markdown-context.js";import L from"./components/InlineManualComponent.js";import M from"./components/HighlightButtonComponent.js";import{escapeTagIds as T,splitTagAcrossParagraphs as P}from"../../../../utils/tagHelper.js";const D=t(!1),_=t({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),H=t({rowId:""}),F=({aiReason:n,isHighConfidence:o,customStyle:t,customIcons:l})=>{var r;const{expandedInfo:d,setExpanded:a,reasonToRow:s}=c(_),{rowId:u}=c(H),p=String(n.id);u&&s.current.set(p,u);const h=(null===(r=null==d?void 0:d.aiReason)||void 0===r?void 0:r.id)===n.id,v=o?(null==l?void 0:l.highConfidence)||e(b,{}):(null==l?void 0:l.lowConfidence)||e(I,{});return i("button",{className:g.aiReasoningButton,style:t,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(h?null:u,h?null:n)},children:[v,e("i",h?{className:`pi pi-angle-up ${o?g.aiReasoningIconHighConfidence:g.aiReasoningIconLowConfidence}`}:{className:`pi pi-angle-down ${o?g.aiReasoningIconHighConfidence:g.aiReasoningIconLowConfidence}`})]})},B=({children:n,node:o,customStyles:t,customIcons:r})=>{var d,a;const s=l(Math.random().toString(36).slice(2)).current,{expandedInfo:u}=c(_),p=(null==u?void 0:u.rowId)===s,h=Array.isArray(null==o?void 0:o.children)?o.children.filter(e=>"element"===e.type).length:1,v=null!==(a=null===(d=null==o?void 0:o.properties)||void 0===d?void 0:d.style)&&void 0!==a?a:void 0;return i(H.Provider,{value:{rowId:s},children:[e("tr",{style:v?{cssText:v}:void 0,children:n}),p&&(null==u?void 0:u.aiReason)&&e("tr",{style:{width:"100%"},children:e("td",{colSpan:h||1,className:g.tableExpandedCell,children:e("div",{className:g.tableExpandedCellInner,children:e("div",{className:g.tableExpandedCellContent,children:e(A,{aiReason:u.aiReason,customIcons:r,customStyles:{aiReasoningContent:null==t?void 0:t.aiReasoningContent,aiReasoningAccordion:null==t?void 0:t.aiReasoningAccordion,aiReasoningMarkdown:null==t?void 0:t.aiReasoningMarkdown,aiReasoningPill:null==t?void 0:t.aiReasoningPill,webCitation:null==t?void 0:t.webCitation,stormeeCitation:null==t?void 0:t.stormeeCitation,waveformCitation:null==t?void 0:t.waveformCitation,imageCitation:null==t?void 0:t.imageCitation,fileCitation:null==t?void 0:t.fileCitation,appModCitation:null==t?void 0:t.appModCitation,rcaCitation:null==t?void 0:t.rcaCitation,readFileCitation:null==t?void 0:t.readFileCitation,loadingCitations:null==t?void 0:t.loadingCitations,chatCitation:null==t?void 0:t.chatCitation}})})})})})]})};const O=["del","ins"];function V(e){return function(e,n,i){const o=n.join("|");return e.replace(new RegExp(`<(${o})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,o)=>`<${n}>${i(o)}</${n}>`)}(e,O,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var o;return`<code>${t=null!==(o=n[Number(i)])&&void 0!==o?o:"",t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code>`;var t})}(e)).join(""))}const q=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function z(e,n){const i=[],t=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,r;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!o.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(t.has(d))return i.push(e),null;if(q.has(d))return e;const a=null===(r=o.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===r?void 0:r.flat().filter(e=>null!=e);return a&&0!==a.length?o.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}const W=({message:t,noMarkdownContent:b,useMarkdown:I=!0,isParent:A,scenario:H,showUserStoryDiff:O=!1,aiReasoningsForBlock:q,isCitationLoadingDisplay:W=!1,className:G,highConfidenceIcon:Q,lowConfidenceIcon:J,customStyles:K,customIcons:X,contextVariant:Y,aiReasoningDiffView:Z,userStoryCitations:ee,artifactId:ne,isCraflow:ie,onCraAccept:oe,onCraReject:te,craFlowConfig:le,isDisplayHighlightControl:re=!1,showConfidenceScore:de=!0,CDNeededInChip:ae,blockId:se})=>{var ce;console.log("userstorywithcitation blockid ",se);const ue=l(null),{userStory:pe,inlineUpdateComponentConfig:ge,getAvgScoreForStory:he,setUserStory:ve,aiReasoning:me,setAiReasoning:Ce,customIcons:fe,searchQueryList:ye,searchQueryReasoningIdList:we,currentHighlightIndex:Se,segmentComponentConfig:be,inlineManualComponentConfig:Ie,diffEditConfig:Re}=S(),$e=null!=X?X:null==fe?void 0:fe.userStoryIcons;null==K||K.searchHighlight;const{search:xe,clear:Ne}=h(ue),[ke,Ae]=r("1"),[je,Ue]=r(null),Ee=l(new Map),[Le,Me]=r(new Set),Te=d((e,n)=>{Ue(e&&n?{rowId:e,aiReason:n}:null)},[]),Pe=ne?he(ne):0,[De,_e]=r([]),He=d(e=>{Me(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Fe=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Fe).join(""):o.isValidElement(e)?Fe(e.props.children):"",Be=e=>{let n=e;return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,o,t)=>{const l=o.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,o,t)=>{const l=n.substring(0,t),r=l.lastIndexOf("\n"),d=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),a=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(d||a){let e=o;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let o;const t=new RegExp(n.source,n.flags);for(;null!==(o=t.exec(e));){const e=o[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),t=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:o.index,endIndex:o.index+o[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==t?void 0:t[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],o=n.changedItemCount-n.deletedItemCount;if(0===o)continue;const t=l.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of t){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const d=n.endIndex,a=e+1<i.length?i[e+1].index:l.length;let s=l.substring(d,a);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+o}. `),l=l.substring(0,d)+s+l.substring(a)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=V(n),n},Oe=a(()=>t?Be(t):t,[t]);s(()=>{_e(q||me)},[q,me]);const Ve=a(()=>({span:({node:n,children:i,...o})=>{var t,l,r,d,a;const s=null!==(l=null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==l?l:null==o?void 0:o["highlight-id"],c="string"==typeof s&&Le.has(s),u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==d?d:null==o?void 0:o["highlight-color"];return e("span",{style:{...null!==(a=null==K?void 0:K.span)&&void 0!==a?a:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:i})},button:({node:i,children:o,...t})=>{var l,r,d,a,s,c;const u=null!==(r=null===(l=null==i?void 0:i.properties)||void 0===l?void 0:l.action)&&void 0!==r?r:null==t?void 0:t.action,p=null!==(a=null===(d=null==i?void 0:i.properties)||void 0===d?void 0:d["highlight-id"])&&void 0!==a?a:null==t?void 0:t["highlight-id"],g=null!==(c=null===(s=null==i?void 0:i.properties)||void 0===s?void 0:s["highlight-type"])&&void 0!==c?c:null==t?void 0:t["highlight-type"];return"highlight"===u?e(M,{highlightId:p,handleHighlightSpan:He,icon:"web"===g?null==$e?void 0:$e.webCitationIcon:"doc"===g?null==$e?void 0:$e.fileCitationIcon:e(n,{}),customStyles:"web"===g?null==K?void 0:K.webButton:"doc"===g?null==K?void 0:K.docButton:{}}):null},upt:({node:i,children:o,...t})=>{var l,r;const d=null==t?void 0:t.id,a=d?null===(r=null===(l=d.split("$"))||void 0===l?void 0:l[1])||void 0===r?void 0:r.replaceAll("@","<").replaceAll("#",">"):null,s=me.find(e=>e.id.toString()===a);if(!s)return o||e(n,{});const c="data-main"in t,u=t["data-status"];return e(n,{children:e(j,{aiReason:s,customStyles:null==K?void 0:K.inlineUpdatedComponent,handleClickCognitiveDecision:null==ge?void 0:ge.handleClickCognitiveDecision,handleClickUpdatedPill:null==ge?void 0:ge.handleClickUpdatedPill,handleClickOutputValue:null==ge?void 0:ge.handleClickOutputValue,customIcons:null==ge?void 0:ge.customIcons,CDNeededInChip:ae,showChip:c,status:u,children:o||e(n,{})})})},del:({node:o,children:t,...l})=>{var r;const{cleanedChildren:d,extractedNodes:a}=z(t,["ins"]);return i(n,{children:[e("span",{className:g.deleted,style:null!==(r=null==K?void 0:K.deleted)&&void 0!==r?r:{},...l,onClick:()=>{l.onclick&&l.onclick()},children:d}),a]})},ins:({children:o,...t})=>{var l;const{cleanedChildren:r,extractedNodes:d}=z(o,["del"]);return i(n,{children:[e("span",{className:g.inserted,style:null!==(l=null==K?void 0:K.inserted)&&void 0!==l?l:{},...t,onClick:()=>{t.onclick&&t.onclick()},children:r}),d]})},preserved:({children:n,...i})=>e("span",{className:g.preserved,style:null==K?void 0:K.preserved,...i,children:n}),manual:({children:i,...o})=>{var t;const l=null===(t=null==o?void 0:o.id)||void 0===t?void 0:t.replaceAll("@","<").replaceAll("#",">"),r=me.find(e=>e.id.toString()===l),d=o["data-status"];return r?e(L,{aiReason:r,handleClick:null==Ie?void 0:Ie.handleClick,status:d,children:i}):i||e(n,{})},invisible:({children:i,...o})=>e(n,{}),h1:({node:n,...i})=>e("h1",{className:g.heading1,style:null==K?void 0:K.heading1,children:i.children}),h2:({node:n,...i})=>e("h2",{className:g.heading2,style:null==K?void 0:K.heading2,children:i.children}),h3:({node:n,...i})=>e("h3",{className:g.heading3,style:null==K?void 0:K.heading3,children:i.children}),b:({node:n,...i})=>e("b",{className:g.bold,style:null==K?void 0:K.bold,children:null==i?void 0:i.children}),p:({node:n,...i})=>e("p",{...i,className:g.paragraph,style:null==K?void 0:K.paragraph,children:i.children}),updated:({node:n,...i})=>e(f,{...i,showUserStoryDiff:O,currentUpdatedTagId:ke,setCurrentUpdatedTagId:Ae,userStory:pe,setUserStory:ve,setAiReasoning:Ce,node:n,isCraflow:ie,onCraAccept:oe,onCraReject:te,diffEditConfig:Re,customStyles:null==K?void 0:K.updatedContent,craFlowConfig:le}),ol:({node:n,...i})=>{var o,t,l;const r=null!==(l=null!==(t=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o.start)&&void 0!==t?t:null==i?void 0:i.start)&&void 0!==l?l:void 0;return e("ol",{className:g.orderedList,style:null==K?void 0:K.olist,...r?{start:Number(r)}:{},children:null==i?void 0:i.children})},ul:({node:n,...i})=>e("ul",{className:g.unorderedList,style:null==K?void 0:K.ulist,children:null==i?void 0:i.children}),table:({children:n})=>e("div",{className:g.tableWrapper,children:e("table",{className:g.table,style:null==K?void 0:K.table,children:n})}),tr:({node:n,children:i})=>e(B,{node:n,children:i,customStyles:K}),td:({node:n,children:i})=>{var o;const{style:t,...l}=null!==(o=null==n?void 0:n.properties)&&void 0!==o?o:{};return e(D.Provider,{value:!0,children:e("td",{...l,style:t?{cssText:t}:void 0,children:i})})},th:({node:n,children:i})=>{var o;const{style:t,...l}=null!==(o=null==n?void 0:n.properties)&&void 0!==o?o:{};return e(D.Provider,{value:!0,children:e("th",{...l,style:t?{cssText:t}:void 0,children:i})})},recommendation:({node:n,...i})=>{var o;const t=`The AI has selected this content based on: ${(null===(o=null==i?void 0:i.children)||void 0===o?void 0:o[0])||""}`;return e(N,{...i,customStyles:null==K?void 0:K.recommendationBlock,label:t})},a:({inline:n,children:i,node:o,...t})=>{var l,r,d;const a=c(D)||"true"==(null==t?void 0:t.table),s=`${null==t?void 0:t.href}`,u=null===(l=s.split("$"))||void 0===l?void 0:l[0],p=null===(r=s.split("$"))||void 0===r?void 0:r[1];if("ai_reasoning"===u){const n=(null!==(d=O?Z:me)&&void 0!==d?d:[]).find(e=>e.id.toString()===decodeURIComponent(p)),o=we.includes(p);if(n){if(a)return e(F,{aiReason:n,customStyle:null==K?void 0:K.tableAiReasoning,customIcons:$e,isHighConfidence:n.relevance_score>=$});const t=Fe(i),l="source"!==t.trim().toLowerCase();return e(R,{aiReason:n,isSourceHasHighlight:o,inlineLabel:t,isInlineCitation:l,customIcons:$e,customStyles:{aiReasoningContent:null==K?void 0:K.aiReasoningContent,aiReasoningAccordion:null==K?void 0:K.aiReasoningAccordion,aiReasoningMarkdown:null==K?void 0:K.aiReasoningMarkdown,aiReasoningPill:null==K?void 0:K.aiReasoningPill,webCitation:null==K?void 0:K.webCitation,stormeeCitation:null==K?void 0:K.stormeeCitation,waveformCitation:null==K?void 0:K.waveformCitation,imageCitation:null==K?void 0:K.imageCitation,fileCitation:null==K?void 0:K.fileCitation,appModCitation:null==K?void 0:K.appModCitation,rcaCitation:null==K?void 0:K.rcaCitation,readFileCitation:null==K?void 0:K.readFileCitation,loadingCitations:null==K?void 0:K.loadingCitations,chatCitation:null==K?void 0:K.chatCitation,bigEnoughCitation:null==K?void 0:K.bigEnoughCitation}})}}return null},code:({inline:n,children:i,className:o,node:t,...l})=>/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?e("div",{children:e("code",{className:g.blockCode,style:null==K?void 0:K.code,children:i})}):e("code",{className:g.inlineCode,style:null==K?void 0:K.code,children:i}),learned:({children:n})=>e(m,{title:n,placement:"top",children:e(v,{size:16,className:g.learned})}),generatedcode:({node:n,...i})=>{const o=(null==i?void 0:i.language)||"python",t=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=e=>{var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n})(i);return e(y,{title:"Generated Code",code:t,language:o,customStyles:{pill:null==K?void 0:K.generatedCodePill,content:null==K?void 0:K.generatedCodeContent}})},updatedsegment:({node:n,children:i,...o})=>{var t,l,r,d;const a=`${null===(t=n.position)||void 0===t?void 0:t.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(o),c=e("div",s?{dangerouslySetInnerHTML:{__html:C.sanitize(s)}}:{children:i});return e(U,{id:a,node:n,children:c,props:o,segmentComponentConfig:be,customStyles:K,customIcons:X,extractText:Fe,isUpdatedSegment:!0})},segment:({node:n,children:i,...o})=>{var t,l,r,d;const a=`${null===(t=n.position)||void 0===t?void 0:t.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`;return e(U,{id:a,node:n,children:i,props:o,segmentComponentConfig:be,customStyles:K,customIcons:X,extractText:Fe,blockId:se})}}),[De,le,me,ee,ke,O,t,X,ye,we,K,be,Le,He,se]),qe=a(()=>{let e=T(Oe,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=P(e,n,"upt"===n)}),e},[Oe]);return s(()=>{if(!ue.current)return;if(!ye.length)return void Ne();let e;if(0===we.length||re)requestAnimationFrame(()=>{xe([ye[Se].replace(/\*/g,"")])});else{const n=ue.current,i=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{i.disconnect(),requestAnimationFrame(()=>{xe([ye[Se].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return()=>{clearTimeout(e)}},[ye,we,Se,re]),e(_.Provider,{value:{expandedInfo:je,setExpanded:Te,reasonToRow:Ee},children:i("div",{ref:ue,className:`${g.container} ${"approving"!==H?g.wrapper:""} ${G||""}`,style:null==K?void 0:K.container,children:[I?e(E,{children:e(u,{components:Ve,rehypePlugins:[p],children:qe})}):b,Pe>0&&de&&e("div",{className:g.confidenceScoreContainer,style:null==K?void 0:K.confidenceScoreContainer,children:i("span",{className:g.confidenceScore,style:null==K?void 0:K.confidenceScore,children:[e(x,{size:14,color:(null==K?void 0:K.confidenceScoreIconColor)||"#166534"}),Pe,"%"]})}),W&&e("div",{className:g.citationLoader,style:null==K?void 0:K.citationLoaderContainer,children:e(w,{customStyles:{container:null==K?void 0:K.citationLoadingContainer,icon:null==K?void 0:K.citationLoadingIcon,text:null==K?void 0:K.citationLoadingText}})}),A&&e("div",{style:{...null===(ce=null==K?void 0:K.attachedContext)||void 0===ce?void 0:ce.wrapper},className:"flex mt-5",children:e(k,{customStyles:null==K?void 0:K.attachedContext,variant:Y})})]})})};export{W as default,z as splitNestedDiffNodes};
2
2
  //# sourceMappingURL=UserStoryWithCitation.js.map