@e-llm-studio/requirement-ai 0.0.251 → 0.0.253

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 (451) 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/theme/theme.css.js +1 -1
  24. package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  25. package/dist/cjs/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.js +1 -1
  26. package/dist/cjs/features/RequirementAI/components/UserStoryCard/AttachedContext.js +1 -1
  27. package/dist/cjs/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.js +1 -1
  28. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  29. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  30. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/ResizableSplitPane.js +1 -1
  31. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  32. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  33. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js +1 -1
  34. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  35. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.js +1 -1
  36. package/dist/cjs/features/RequirementAI/components/UserStoryCard/TitleEditor/TitleEditor.js +1 -1
  37. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  38. package/dist/cjs/features/RequirementAI/components/UserStoryCard/icons/PdfViewerIcons.js +1 -1
  39. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AIReasonAccordion.js +1 -1
  40. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  41. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
  42. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  43. package/dist/cjs/features/RequirementAI/components/ai-reasoning/BigEnoughComponent.js +1 -1
  44. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +1 -1
  45. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +1 -1
  46. package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
  47. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/AppmodCitationContent.js +1 -1
  48. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/AppmodCitationRenderer.js +1 -1
  49. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/components/CodeLinkHandler.js +1 -1
  50. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/icons/AppmodIcon.js +1 -1
  51. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/icons/ChatBubbleIcon.js +1 -1
  52. package/dist/cjs/features/RequirementAI/components/citations/appmod-citation/icons/SparkleIcon.js +1 -1
  53. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/SearchWaveFromWrapper.js +1 -1
  54. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/WaveformCitationRenderer.js +1 -1
  55. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/components/AudioCitationIcon.js +1 -1
  56. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/components/AudioTimeLineSlider.js +1 -1
  57. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/components/SegmentByWordsViral.js +1 -1
  58. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/components/videoPlayer.js +1 -1
  59. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/AudioLinesIcon.js +1 -1
  60. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/MaximizeIcon.js +1 -1
  61. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/MinimizeIcon.js +1 -1
  62. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/PauseIcon.js +1 -1
  63. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/PlayIcon.js +1 -1
  64. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/PlaybackSpeedIcon.js +1 -1
  65. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/icons/VideoIcon.js +1 -1
  66. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/searchwaveform.js +1 -1
  67. package/dist/cjs/features/RequirementAI/components/citations/audio-citation/store/autoplay.wavefrom.js +1 -1
  68. package/dist/cjs/features/RequirementAI/components/citations/big-enough/BigEnoughCitationRenderer.js +1 -1
  69. package/dist/cjs/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.js +1 -1
  70. package/dist/cjs/features/RequirementAI/components/citations/file-citation/DocumentCitationIcon.js +1 -1
  71. package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
  72. package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
  73. package/dist/cjs/features/RequirementAI/components/citations/gpt-web-citation/GptWebCitationRenderer.js +1 -1
  74. package/dist/cjs/features/RequirementAI/components/citations/gpt-web-citation/GptWebcitationPanel.js +1 -1
  75. package/dist/cjs/features/RequirementAI/components/citations/image-citation/ImageCitationContent.js +1 -1
  76. package/dist/cjs/features/RequirementAI/components/citations/image-citation/ImageCitationIcon.js +1 -1
  77. package/dist/cjs/features/RequirementAI/components/citations/image-citation/ImageCitationRenderer.js +1 -1
  78. package/dist/cjs/features/RequirementAI/components/citations/rca-citation/RCACitationContent.js +1 -1
  79. package/dist/cjs/features/RequirementAI/components/citations/rca-citation/RCACitationRenderer.js +1 -1
  80. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.js +1 -1
  81. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
  82. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationRenderer.js +1 -1
  83. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/icons/ExternalLinkIcon.js +1 -1
  84. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/icons/FileCodeIcon.js +1 -1
  85. package/dist/cjs/features/RequirementAI/components/citations/stormee-citation/StormeeCitationRenderer.js +1 -1
  86. package/dist/cjs/features/RequirementAI/components/citations/stormee-citation/StormeeContent.js +1 -1
  87. package/dist/cjs/features/RequirementAI/components/citations/stormee-citation/components/GradientButton.js +1 -1
  88. package/dist/cjs/features/RequirementAI/components/citations/stormee-citation/components/ProblemStatementCard.js +1 -1
  89. package/dist/cjs/features/RequirementAI/components/citations/web-citation/FullScreenIcon.js +1 -1
  90. package/dist/cjs/features/RequirementAI/components/citations/web-citation/ImagePreviewDialog.js +1 -1
  91. package/dist/cjs/features/RequirementAI/components/citations/web-citation/WebCitation.js +1 -1
  92. package/dist/cjs/features/RequirementAI/components/citations/web-citation/WebCitationIcon.js +1 -1
  93. package/dist/cjs/features/RequirementAI/components/citations/web-citation/WebCitationRenderer.js +1 -1
  94. package/dist/cjs/features/RequirementAI/components/citations/web-citation/WebCitationWithImageContent.js +1 -1
  95. package/dist/cjs/features/RequirementAI/components/citations/web-citation/WebCitationWithImageRenderer.js +1 -1
  96. package/dist/cjs/features/RequirementAI/components/cra/PartialRequirementContent.js +1 -1
  97. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
  98. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
  99. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterContentWrapper.js +1 -1
  100. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterItem.js +1 -1
  101. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/gapFilterSvgs.js +1 -1
  102. package/dist/cjs/features/RequirementAI/components/segment/DeleteSegmentsDialog.js +1 -1
  103. package/dist/cjs/features/RequirementAI/components/segment/EditSegmentDialog.js +1 -1
  104. package/dist/cjs/features/RequirementAI/components/segment/ExampleComponentWrapper.js +1 -1
  105. package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
  106. package/dist/cjs/features/RequirementAI/components/segment/SegmentLoader.js +1 -1
  107. package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  108. package/dist/cjs/features/RequirementAI/components/story-screen/BigEnoughPanel.js +1 -1
  109. package/dist/cjs/features/RequirementAI/components/story-screen/CompletionPanel.js +1 -1
  110. package/dist/cjs/features/RequirementAI/components/story-screen/ReplaceLearnedTags.js +1 -1
  111. package/dist/cjs/features/RequirementAI/components/story-screen/StreamingScreenSidebar.js +1 -1
  112. package/dist/cjs/features/RequirementAI/components/story-screen/SubfeatureBlock.js +1 -1
  113. package/dist/cjs/features/RequirementAI/components/story-screen/UserStoryScreen.js +1 -1
  114. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  115. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ApprovalBadge/ApprovalBadge.js +1 -1
  116. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ApprovalSidebar/ApprovalSidebar.js +1 -1
  117. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ApprovalSidebarItem/ApprovalSidebarItem.js +1 -1
  118. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ApprovalStatusBadge/ApprovalStatusBadge.js +1 -1
  119. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ContentBlock/ContentBlock.js +1 -1
  120. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.js +1 -1
  121. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  122. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
  123. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/HighlightButtonComponent.js +1 -1
  124. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  125. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
  126. package/dist/cjs/features/RequirementAI/hooks/useApprovalStatus.js +1 -1
  127. package/dist/cjs/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
  128. package/dist/cjs/features/RequirementAI/icons/AiGapIcon.js +1 -1
  129. package/dist/cjs/features/RequirementAI/icons/AiReasoningIcon.js +1 -1
  130. package/dist/cjs/features/RequirementAI/icons/BigEnoughIcon.js +1 -1
  131. package/dist/cjs/features/RequirementAI/icons/BookmarkIcon.js +1 -1
  132. package/dist/cjs/features/RequirementAI/icons/BrainRed.js +1 -1
  133. package/dist/cjs/features/RequirementAI/icons/CDIcon.js +1 -1
  134. package/dist/cjs/features/RequirementAI/icons/CheckIcon.js +1 -1
  135. package/dist/cjs/features/RequirementAI/icons/ChevronDownIcon.js +1 -1
  136. package/dist/cjs/features/RequirementAI/icons/ChevronUpIcon.js +1 -1
  137. package/dist/cjs/features/RequirementAI/icons/CognitiveDecision.js +1 -1
  138. package/dist/cjs/features/RequirementAI/icons/MeetingHighlightsIcon.js +1 -1
  139. package/dist/cjs/features/RequirementAI/icons/MenuUnfoldIcon.js +1 -1
  140. package/dist/cjs/features/RequirementAI/icons/PencilIcon.js +1 -1
  141. package/dist/cjs/features/RequirementAI/icons/ReasoningBulbIcon.js +1 -1
  142. package/dist/cjs/features/RequirementAI/icons/RelevanceScoreIcon.js +1 -1
  143. package/dist/cjs/features/RequirementAI/icons/SidebarCloseIcon.js +1 -1
  144. package/dist/cjs/features/RequirementAI/icons/SidebarOpenIcon.js +1 -1
  145. package/dist/cjs/features/RequirementAI/icons/TrashIcon.js +1 -1
  146. package/dist/cjs/features/RequirementAI/shared/Accordian.js +1 -1
  147. package/dist/cjs/features/RequirementAI/shared/AtomicButton.js +1 -1
  148. package/dist/cjs/features/RequirementAI/shared/CitationAIConfidenceDisplay.js +1 -1
  149. package/dist/cjs/features/RequirementAI/shared/CitationLoadingIndicator.js +1 -1
  150. package/dist/cjs/features/RequirementAI/shared/CodeViewer.js +1 -1
  151. package/dist/cjs/features/RequirementAI/shared/ExpandableOl.js +1 -1
  152. package/dist/cjs/features/RequirementAI/shared/GeneratedCodeCitation.js +1 -1
  153. package/dist/cjs/features/RequirementAI/shared/ReqAiCitationRenderer.js +1 -1
  154. package/dist/cjs/features/RequirementAI/shared/UpdatedAnimationContent.js +1 -1
  155. package/dist/cjs/features/RequirementAI/store/markdown-context.js +1 -1
  156. package/dist/cjs/features/RequirementAI/store/ref.context.js +1 -1
  157. package/dist/cjs/features/RequirementAI/utils/diff-edit.utils.js +1 -1
  158. package/dist/cjs/features/RequirementAI/utils/helpers.js +1 -1
  159. package/dist/cjs/features/RequirementAI/utils/learned-tag.utils.js +1 -1
  160. package/dist/cjs/features/RequirementAI/utils/userstory-approval.utils.js +1 -1
  161. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/AIConfidenceDisplay.js +1 -1
  162. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/icons/DocumentCitationIcon.js +1 -1
  163. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/icons/RelevanceScoreIcon.js +1 -1
  164. package/dist/cjs/features/UserStoryImport/UserStoryPicker.js +1 -1
  165. package/dist/cjs/features/UserStoryImport/UserStoryPicker.theme.js +1 -1
  166. package/dist/cjs/features/UserStoryImport/components/BackNav.js +1 -1
  167. package/dist/cjs/features/UserStoryImport/components/Badge.js +1 -1
  168. package/dist/cjs/features/UserStoryImport/components/BrowseProjectsButton.js +1 -1
  169. package/dist/cjs/features/UserStoryImport/components/CardGrid.js +1 -1
  170. package/dist/cjs/features/UserStoryImport/components/CardProceedButton.js +1 -1
  171. package/dist/cjs/features/UserStoryImport/components/ContentArea.js +1 -1
  172. package/dist/cjs/features/UserStoryImport/components/Footer.js +1 -1
  173. package/dist/cjs/features/UserStoryImport/components/Header.js +1 -1
  174. package/dist/cjs/features/UserStoryImport/components/NavRow.js +1 -1
  175. package/dist/cjs/features/UserStoryImport/components/ProceedButton.js +1 -1
  176. package/dist/cjs/features/UserStoryImport/components/ProjectCard.js +1 -1
  177. package/dist/cjs/features/UserStoryImport/components/ResizeHandle.js +1 -1
  178. package/dist/cjs/features/UserStoryImport/components/ScopeDropdown.js +1 -1
  179. package/dist/cjs/features/UserStoryImport/components/SearchInput.js +1 -1
  180. package/dist/cjs/features/UserStoryImport/components/SectionHeading.js +1 -1
  181. package/dist/cjs/features/UserStoryImport/components/ShowMore.js +1 -1
  182. package/dist/cjs/features/UserStoryImport/components/Sidebar.js +1 -1
  183. package/dist/cjs/features/UserStoryImport/components/SidebarFavoritesList.js +1 -1
  184. package/dist/cjs/features/UserStoryImport/components/SidebarProjectList.js +1 -1
  185. package/dist/cjs/features/UserStoryImport/components/SidebarSection.js +1 -1
  186. package/dist/cjs/features/UserStoryImport/components/SortDropdown.js +1 -1
  187. package/dist/cjs/features/UserStoryImport/components/SplitLayout.js +1 -1
  188. package/dist/cjs/features/UserStoryImport/components/Toolbar.js +1 -1
  189. package/dist/cjs/features/UserStoryImport/components/TypeDropdown.js +1 -1
  190. package/dist/cjs/features/UserStoryImport/components/UserStoryCard.js +1 -1
  191. package/dist/cjs/features/UserStoryImport/components/UserStoryImportDialog.js +1 -1
  192. package/dist/cjs/features/UserStoryImport/components/UserStoryScopeDropdown.js +1 -1
  193. package/dist/cjs/features/UserStoryImport/hooks/useUSPData.js +1 -1
  194. package/dist/cjs/features/UserStoryImport/hooks/useUserStoryPickerState.js +1 -1
  195. package/dist/cjs/features/UserStoryImport/lib/CustomTooltip.js +1 -1
  196. package/dist/cjs/features/UserStoryImport/lib/Tooltip.js +1 -1
  197. package/dist/cjs/features/UserStoryImport/lib/dialog.js +1 -1
  198. package/dist/cjs/index.js +1 -1
  199. package/dist/features/CitationRenderer/CitationRenderer.js +1 -1
  200. package/dist/features/RequirementAI/components/CustomPopover/CustomPopover.js +1 -1
  201. package/dist/features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.js +1 -1
  202. package/dist/features/RequirementAI/components/GapRiskSidebar/components/GapItem/GapItem.js +1 -1
  203. package/dist/features/RequirementAI/components/GapRiskSidebar/components/RiskCategorySection/RiskCategorySection.js +1 -1
  204. package/dist/features/RequirementAI/components/GapRiskSidebar/components/RiskSidebarCategorySection/RiskSidebarCategorySection.js +1 -1
  205. package/dist/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.js +1 -1
  206. package/dist/features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithGap.js +1 -1
  207. package/dist/features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithRisk.js +1 -1
  208. package/dist/features/RequirementAI/components/RecommendationBlock/RecommendationBlock.js +1 -1
  209. package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  210. package/dist/features/RequirementAI/components/RichTextEditor/Editor/Editor.js +1 -1
  211. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/Context/ContextMenu.js +1 -1
  212. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/EditorContainer/EditorContainer.js +1 -1
  213. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/EditorPlaceholder/EditorPlaceholder.js +1 -1
  214. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/EditorToolbar/EditorToolbar.js +1 -1
  215. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/EditorToolbar/components/ToolbarButton/ToolbarButton.js +1 -1
  216. package/dist/features/RequirementAI/components/RichTextEditor/Editor/components/Icons/Icon.js +1 -1
  217. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.js +1 -1
  218. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/HighlightNode.js +1 -1
  219. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/InitialHtml.js +1 -1
  220. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.js +1 -1
  221. package/dist/features/RequirementAI/components/RichTextEditor/Editor/theme/theme.css.js +1 -1
  222. package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  223. package/dist/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.js +1 -1
  224. package/dist/features/RequirementAI/components/UserStoryCard/AttachedContext.js +1 -1
  225. package/dist/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.js +1 -1
  226. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  227. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  228. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/ResizableSplitPane.js +1 -1
  229. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  230. package/dist/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  231. package/dist/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js +1 -1
  232. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  233. package/dist/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.js +1 -1
  234. package/dist/features/RequirementAI/components/UserStoryCard/TitleEditor/TitleEditor.js +1 -1
  235. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  236. package/dist/features/RequirementAI/components/UserStoryCard/icons/PdfViewerIcons.js +1 -1
  237. package/dist/features/RequirementAI/components/ai-reasoning/AIReasonAccordion.js +1 -1
  238. package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  239. package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
  240. package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  241. package/dist/features/RequirementAI/components/ai-reasoning/BigEnoughComponent.js +1 -1
  242. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +1 -1
  243. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +1 -1
  244. package/dist/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
  245. package/dist/features/RequirementAI/components/citations/appmod-citation/AppmodCitationContent.js +1 -1
  246. package/dist/features/RequirementAI/components/citations/appmod-citation/AppmodCitationRenderer.js +1 -1
  247. package/dist/features/RequirementAI/components/citations/appmod-citation/components/CodeLinkHandler.js +1 -1
  248. package/dist/features/RequirementAI/components/citations/appmod-citation/icons/AppmodIcon.js +1 -1
  249. package/dist/features/RequirementAI/components/citations/appmod-citation/icons/ChatBubbleIcon.js +1 -1
  250. package/dist/features/RequirementAI/components/citations/appmod-citation/icons/SparkleIcon.js +1 -1
  251. package/dist/features/RequirementAI/components/citations/audio-citation/SearchWaveFromWrapper.js +1 -1
  252. package/dist/features/RequirementAI/components/citations/audio-citation/WaveformCitationRenderer.js +1 -1
  253. package/dist/features/RequirementAI/components/citations/audio-citation/components/AudioCitationIcon.js +1 -1
  254. package/dist/features/RequirementAI/components/citations/audio-citation/components/AudioTimeLineSlider.js +1 -1
  255. package/dist/features/RequirementAI/components/citations/audio-citation/components/SegmentByWordsViral.js +1 -1
  256. package/dist/features/RequirementAI/components/citations/audio-citation/components/videoPlayer.js +1 -1
  257. package/dist/features/RequirementAI/components/citations/audio-citation/icons/AudioLinesIcon.js +1 -1
  258. package/dist/features/RequirementAI/components/citations/audio-citation/icons/MaximizeIcon.js +1 -1
  259. package/dist/features/RequirementAI/components/citations/audio-citation/icons/MinimizeIcon.js +1 -1
  260. package/dist/features/RequirementAI/components/citations/audio-citation/icons/PauseIcon.js +1 -1
  261. package/dist/features/RequirementAI/components/citations/audio-citation/icons/PlayIcon.js +1 -1
  262. package/dist/features/RequirementAI/components/citations/audio-citation/icons/PlaybackSpeedIcon.js +1 -1
  263. package/dist/features/RequirementAI/components/citations/audio-citation/icons/VideoIcon.js +1 -1
  264. package/dist/features/RequirementAI/components/citations/audio-citation/searchwaveform.js +1 -1
  265. package/dist/features/RequirementAI/components/citations/audio-citation/store/autoplay.wavefrom.js +1 -1
  266. package/dist/features/RequirementAI/components/citations/big-enough/BigEnoughCitationRenderer.js +1 -1
  267. package/dist/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.js +1 -1
  268. package/dist/features/RequirementAI/components/citations/file-citation/DocumentCitationIcon.js +1 -1
  269. package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
  270. package/dist/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
  271. package/dist/features/RequirementAI/components/citations/gpt-web-citation/GptWebCitationRenderer.js +1 -1
  272. package/dist/features/RequirementAI/components/citations/gpt-web-citation/GptWebcitationPanel.js +1 -1
  273. package/dist/features/RequirementAI/components/citations/image-citation/ImageCitationContent.js +1 -1
  274. package/dist/features/RequirementAI/components/citations/image-citation/ImageCitationIcon.js +1 -1
  275. package/dist/features/RequirementAI/components/citations/image-citation/ImageCitationRenderer.js +1 -1
  276. package/dist/features/RequirementAI/components/citations/rca-citation/RCACitationContent.js +1 -1
  277. package/dist/features/RequirementAI/components/citations/rca-citation/RCACitationRenderer.js +1 -1
  278. package/dist/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.js +1 -1
  279. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
  280. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationRenderer.js +1 -1
  281. package/dist/features/RequirementAI/components/citations/readfile-citation/icons/ExternalLinkIcon.js +1 -1
  282. package/dist/features/RequirementAI/components/citations/readfile-citation/icons/FileCodeIcon.js +1 -1
  283. package/dist/features/RequirementAI/components/citations/stormee-citation/StormeeCitationRenderer.js +1 -1
  284. package/dist/features/RequirementAI/components/citations/stormee-citation/StormeeContent.js +1 -1
  285. package/dist/features/RequirementAI/components/citations/stormee-citation/components/GradientButton.js +1 -1
  286. package/dist/features/RequirementAI/components/citations/stormee-citation/components/ProblemStatementCard.js +1 -1
  287. package/dist/features/RequirementAI/components/citations/web-citation/FullScreenIcon.js +1 -1
  288. package/dist/features/RequirementAI/components/citations/web-citation/ImagePreviewDialog.js +1 -1
  289. package/dist/features/RequirementAI/components/citations/web-citation/WebCitation.js +1 -1
  290. package/dist/features/RequirementAI/components/citations/web-citation/WebCitationIcon.js +1 -1
  291. package/dist/features/RequirementAI/components/citations/web-citation/WebCitationRenderer.js +1 -1
  292. package/dist/features/RequirementAI/components/citations/web-citation/WebCitationWithImageContent.js +1 -1
  293. package/dist/features/RequirementAI/components/citations/web-citation/WebCitationWithImageRenderer.js +1 -1
  294. package/dist/features/RequirementAI/components/cra/PartialRequirementContent.js +1 -1
  295. package/dist/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
  296. package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
  297. package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterContentWrapper.js +1 -1
  298. package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterItem.js +1 -1
  299. package/dist/features/RequirementAI/components/lsc-reason-gap/gapFilterSvgs.js +1 -1
  300. package/dist/features/RequirementAI/components/segment/DeleteSegmentsDialog.js +1 -1
  301. package/dist/features/RequirementAI/components/segment/EditSegmentDialog.js +1 -1
  302. package/dist/features/RequirementAI/components/segment/ExampleComponentWrapper.js +1 -1
  303. package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
  304. package/dist/features/RequirementAI/components/segment/SegmentLoader.js +1 -1
  305. package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  306. package/dist/features/RequirementAI/components/story-screen/BigEnoughPanel.js +1 -1
  307. package/dist/features/RequirementAI/components/story-screen/CompletionPanel.js +1 -1
  308. package/dist/features/RequirementAI/components/story-screen/ReplaceLearnedTags.js +1 -1
  309. package/dist/features/RequirementAI/components/story-screen/StreamingScreenSidebar.js +1 -1
  310. package/dist/features/RequirementAI/components/story-screen/SubfeatureBlock.js +1 -1
  311. package/dist/features/RequirementAI/components/story-screen/UserStoryScreen.js +1 -1
  312. package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  313. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ApprovalBadge/ApprovalBadge.js +1 -1
  314. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ApprovalSidebar/ApprovalSidebar.js +1 -1
  315. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ApprovalSidebarItem/ApprovalSidebarItem.js +1 -1
  316. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ApprovalStatusBadge/ApprovalStatusBadge.js +1 -1
  317. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ContentBlock/ContentBlock.js +1 -1
  318. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.js +1 -1
  319. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  320. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
  321. package/dist/features/RequirementAI/components/userstory-with-citation/components/HighlightButtonComponent.js +1 -1
  322. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  323. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
  324. package/dist/features/RequirementAI/hooks/useApprovalStatus.js +1 -1
  325. package/dist/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
  326. package/dist/features/RequirementAI/icons/AiGapIcon.js +1 -1
  327. package/dist/features/RequirementAI/icons/AiReasoningIcon.js +1 -1
  328. package/dist/features/RequirementAI/icons/BigEnoughIcon.js +1 -1
  329. package/dist/features/RequirementAI/icons/BookmarkIcon.js +1 -1
  330. package/dist/features/RequirementAI/icons/BrainRed.js +1 -1
  331. package/dist/features/RequirementAI/icons/CDIcon.js +1 -1
  332. package/dist/features/RequirementAI/icons/CheckIcon.js +1 -1
  333. package/dist/features/RequirementAI/icons/ChevronDownIcon.js +1 -1
  334. package/dist/features/RequirementAI/icons/ChevronUpIcon.js +1 -1
  335. package/dist/features/RequirementAI/icons/CognitiveDecision.js +1 -1
  336. package/dist/features/RequirementAI/icons/MeetingHighlightsIcon.js +1 -1
  337. package/dist/features/RequirementAI/icons/MenuUnfoldIcon.js +1 -1
  338. package/dist/features/RequirementAI/icons/PencilIcon.js +1 -1
  339. package/dist/features/RequirementAI/icons/ReasoningBulbIcon.js +1 -1
  340. package/dist/features/RequirementAI/icons/RelevanceScoreIcon.js +1 -1
  341. package/dist/features/RequirementAI/icons/SidebarCloseIcon.js +1 -1
  342. package/dist/features/RequirementAI/icons/SidebarOpenIcon.js +1 -1
  343. package/dist/features/RequirementAI/icons/TrashIcon.js +1 -1
  344. package/dist/features/RequirementAI/shared/Accordian.js +1 -1
  345. package/dist/features/RequirementAI/shared/AtomicButton.js +1 -1
  346. package/dist/features/RequirementAI/shared/CitationAIConfidenceDisplay.js +1 -1
  347. package/dist/features/RequirementAI/shared/CitationLoadingIndicator.js +1 -1
  348. package/dist/features/RequirementAI/shared/CodeViewer.js +1 -1
  349. package/dist/features/RequirementAI/shared/ExpandableOl.js +1 -1
  350. package/dist/features/RequirementAI/shared/GeneratedCodeCitation.js +1 -1
  351. package/dist/features/RequirementAI/shared/ReqAiCitationRenderer.js +1 -1
  352. package/dist/features/RequirementAI/shared/UpdatedAnimationContent.js +1 -1
  353. package/dist/features/RequirementAI/store/markdown-context.js +1 -1
  354. package/dist/features/RequirementAI/store/ref.context.js +1 -1
  355. package/dist/features/RequirementAI/utils/diff-edit.utils.js +1 -1
  356. package/dist/features/RequirementAI/utils/helpers.js +1 -1
  357. package/dist/features/RequirementAI/utils/learned-tag.utils.js +1 -1
  358. package/dist/features/RequirementAI/utils/userstory-approval.utils.js +1 -1
  359. package/dist/features/RequirementAiCitations/AiReasoning/components/AIConfidenceDisplay.js +1 -1
  360. package/dist/features/RequirementAiCitations/AiReasoning/components/icons/DocumentCitationIcon.js +1 -1
  361. package/dist/features/RequirementAiCitations/AiReasoning/components/icons/RelevanceScoreIcon.js +1 -1
  362. package/dist/features/UserStoryImport/UserStoryPicker.js +1 -1
  363. package/dist/features/UserStoryImport/UserStoryPicker.theme.js +1 -1
  364. package/dist/features/UserStoryImport/components/BackNav.js +1 -1
  365. package/dist/features/UserStoryImport/components/Badge.js +1 -1
  366. package/dist/features/UserStoryImport/components/BrowseProjectsButton.js +1 -1
  367. package/dist/features/UserStoryImport/components/CardGrid.js +1 -1
  368. package/dist/features/UserStoryImport/components/CardProceedButton.js +1 -1
  369. package/dist/features/UserStoryImport/components/ContentArea.js +1 -1
  370. package/dist/features/UserStoryImport/components/Footer.js +1 -1
  371. package/dist/features/UserStoryImport/components/Header.js +1 -1
  372. package/dist/features/UserStoryImport/components/NavRow.js +1 -1
  373. package/dist/features/UserStoryImport/components/ProceedButton.js +1 -1
  374. package/dist/features/UserStoryImport/components/ProjectCard.js +1 -1
  375. package/dist/features/UserStoryImport/components/ResizeHandle.js +1 -1
  376. package/dist/features/UserStoryImport/components/ScopeDropdown.js +1 -1
  377. package/dist/features/UserStoryImport/components/SearchInput.js +1 -1
  378. package/dist/features/UserStoryImport/components/SectionHeading.js +1 -1
  379. package/dist/features/UserStoryImport/components/ShowMore.js +1 -1
  380. package/dist/features/UserStoryImport/components/Sidebar.js +1 -1
  381. package/dist/features/UserStoryImport/components/SidebarFavoritesList.js +1 -1
  382. package/dist/features/UserStoryImport/components/SidebarProjectList.js +1 -1
  383. package/dist/features/UserStoryImport/components/SidebarSection.js +1 -1
  384. package/dist/features/UserStoryImport/components/SortDropdown.js +1 -1
  385. package/dist/features/UserStoryImport/components/SplitLayout.js +1 -1
  386. package/dist/features/UserStoryImport/components/Toolbar.js +1 -1
  387. package/dist/features/UserStoryImport/components/TypeDropdown.js +1 -1
  388. package/dist/features/UserStoryImport/components/UserStoryCard.js +1 -1
  389. package/dist/features/UserStoryImport/components/UserStoryImportDialog.js +1 -1
  390. package/dist/features/UserStoryImport/components/UserStoryScopeDropdown.js +1 -1
  391. package/dist/features/UserStoryImport/hooks/useUSPData.js +1 -1
  392. package/dist/features/UserStoryImport/hooks/useUserStoryPickerState.js +1 -1
  393. package/dist/features/UserStoryImport/lib/CustomTooltip.js +1 -1
  394. package/dist/features/UserStoryImport/lib/Tooltip.js +1 -1
  395. package/dist/features/UserStoryImport/lib/dialog.js +1 -1
  396. package/dist/index.js +1 -1
  397. package/dist/types/src/App.d.ts.map +1 -1
  398. package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
  399. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +50 -1
  400. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
  401. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/Editor.d.ts +2 -1
  402. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/Editor.d.ts.map +1 -1
  403. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.d.ts +1 -4
  404. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.d.ts.map +1 -1
  405. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InitialHtml.d.ts.map +1 -1
  406. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.d.ts +4 -3
  407. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.d.ts.map +1 -1
  408. package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts +1 -0
  409. package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  410. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts +8 -0
  411. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts.map +1 -1
  412. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +9 -4
  413. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  414. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +45 -11
  415. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  416. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts +17 -13
  417. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
  418. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +29 -5
  419. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  420. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +17 -2
  421. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  422. package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.d.ts.map +1 -1
  423. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts +3 -2
  424. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts.map +1 -1
  425. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts +1 -1
  426. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts.map +1 -1
  427. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +4 -0
  428. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
  429. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts +2 -1
  430. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
  431. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts +1 -0
  432. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts.map +1 -1
  433. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts +2 -0
  434. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts.map +1 -1
  435. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +7 -1
  436. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  437. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +4 -1
  438. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
  439. package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts +1 -1
  440. package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts.map +1 -1
  441. package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts +2 -0
  442. package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts.map +1 -1
  443. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +24 -13
  444. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
  445. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +7 -1
  446. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
  447. package/dist/types/src/features/RequirementAI/utils/helpers.d.ts +2 -0
  448. package/dist/types/src/features/RequirementAI/utils/helpers.d.ts.map +1 -1
  449. package/dist/types/src/index.d.ts +3 -0
  450. package/dist/types/src/index.d.ts.map +1 -1
  451. package/package.json +24 -1
@@ -1,2 +1,2 @@
1
- import{__awaiter as e}from"tslib";import{jsx as t,jsxs as n,Fragment as i}from"react/jsx-runtime";import s,{useContext as o,useMemo as a}from"react";import{Pencil as l,Check as c,X as r,ArrowUpRight as d,Trash2 as m}from"lucide-react";import{cn as g}from"../../../UserStoryImport/lib/cn.js";import p from"./segment.module.css.js";import u from"./deleteSegmentDialog.module.css.js";import b from"./ExampleComponentWrapper.js";import j from"../ai-reasoning/AiReasoningCitationContent.js";import v from"./SegmentLoader.js";import"./segment-common.css.js";import{MarkdownStateContext as y}from"../../store/markdown-context.js";import h from"@mui/material/Dialog";import O from"@mui/material/IconButton";import f from"./DeleteSegmentsDialog.js";import C from"@mui/material/Tooltip";import S from"./EditSegmentDialog.js";const x=({id:x="Segment",label:I,children:E,segmentUUID:D,decisionStrength:N=80,aiReason:k,customStyles:w,customIcons:B,aiReasoningCitationCustomStyles:$,segmentExampleComponent:z,handleViewGlossary:L,isUpdatedSegment:W,onOpen:R,onDelete:A,onEdit:U,customDeleteStyles:M,customDeleteIcons:T})=>{var G,V;const{citationsMetadata:F,updateCitationsMetadata:H}=o(y),[K,q]=s.useState(!1),[J,P]=s.useState(!1),[Q,X]=s.useState(!1),[Y,Z]=s.useState(""),[_,ee]=s.useState(!1),{prefix:te,inner:ne}=a(()=>(e=>{const t=e.match(/^(.*?)\s*\{([^}]+)\}\s*$/);return!t||t.length<3?{prefix:"",inner:e}:{prefix:t[1].trim(),inner:t[2].trim()}})(null!=I?I:""),[I]);s.useEffect(()=>{Q||Z(ne)},[Q,ne]);const ie=()=>e(void 0,void 0,void 0,function*(){if(U){const e=Y.toLowerCase();yield U(e)}X(!1),ee(!1)}),se=()=>X(!1),oe=(null==T?void 0:T.editIcon)||t(l,{size:14}),ae=(null==T?void 0:T.checkIcon)||t(c,{size:16,color:"#16A34A"}),le=(null==T?void 0:T.crossIcon)||t(r,{size:16,color:"#DC2626"}),ce=a(()=>F.get(D),[F,D]),re=a(()=>(null==ce?void 0:ce.open)||!1,[ce]),de=a(()=>ce&&"loading"===ce.state,[ce]),me=()=>e(void 0,void 0,void 0,function*(){const e=!re;if(q(!1),console.log("citation metadata::",e,k),e&&!(null==k?void 0:k.reason)){H(D,t=>{if(t){const e=Object.assign({},t);return e.state="loading",e}return{open:e,state:"loading"}});try{console.log("citation metadata:: onopen"),yield null==R?void 0:R()}finally{H(D,t=>{if(t){const n=Object.assign({},t);return n.state="ready",n.open=e,n}return{open:e,state:"ready"}})}}else console.log("citation metadata:: else block"),H(D,t=>{if(t){const n=Object.assign({},t);return n.open=e,n}return{open:e,state:de?"loading":"ready"}})});return n("div",Object.assign({className:`segment-wrapper-${x} ${p.segmentWrapper}`,style:Object.assign(Object.assign({},null==w?void 0:w.segmentWrapper),{display:"inline-flex",verticalAlign:"middle"})},{children:[n("div",Object.assign({className:`segment-${x}-container segmentContainer ${W?"updatedSegmentContainer":""}`,style:Object.assign({},null==w?void 0:w.container)},{children:[t("span",Object.assign({className:`segment-${x} segmentLabel ${W?"updatedSegmentLabel":""}`,style:Object.assign({},null==w?void 0:w.label)},{children:W?E:I})),t("button",Object.assign({className:`${p.segmentExplanationButtonContainer}`,style:Object.assign({},null==w?void 0:w.buttonContainer),onClick:me},{children:t(d,{className:g(W&&p.updatedChevronIcon,p.cheveronIcon),style:Object.assign({},null==w?void 0:w.cheveronIcon)})}))]})),re&&t(h,Object.assign({open:!0,onClose:me,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",maxWidth:"xl",container:document.getElementById("#root")},{children:n("div",Object.assign({style:{minWidth:"50vw",paddingLeft:16,paddingRight:16,paddingTop:24,paddingBottom:24}},{children:[n("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16}},{children:[n("div",Q?Object.assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[te&&t("span",Object.assign({className:"segmentLabel",style:Object.assign({fontSize:18,fontWeight:600},null==w?void 0:w.label)},{children:te})),n("div",Object.assign({className:p.editInputWrapper,style:null==w?void 0:w.editInputWrapper},{children:[t("input",{value:Y,onChange:e=>Z(e.target.value),className:p.editInput,style:Object.assign(Object.assign({},null==w?void 0:w.editInput),{color:(null===(G=null==w?void 0:w.label)||void 0===G?void 0:G.color)?String(w.label.color):"#3B82F6",textTransform:"uppercase"}),autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&ie(),"Escape"===e.key&&se()}}),t(O,Object.assign({onClick:()=>{Y!==ne?(H(D,e=>e?Object.assign(Object.assign({},e),{open:!1}):{open:!1,state:de?"loading":"ready"}),ee(!0)):X(!1)},size:"small",style:null==w?void 0:w.editCheckIcon},{children:ae})),t(O,Object.assign({onClick:se,size:"small",style:null==w?void 0:w.editCrossIcon},{children:le}))]}))]}):Object.assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[t("span",Object.assign({className:"segmentLabel",style:Object.assign({fontSize:18,fontWeight:600},null==w?void 0:w.label)},{children:null!=I?I:"SEGMENT NAME"})),t(C,Object.assign({title:"Edit segment",placement:"top",arrow:!0},{children:t("button",Object.assign({onClick:()=>X(!0),className:p.headerEditButton,style:null==w?void 0:w.editIconButton},{children:oe}))}))]})),n("div",Object.assign({style:Object.assign({display:"flex",alignItems:"center",gap:"6px",flexShrink:0},null==w?void 0:w.headerActionsContainer)},{children:[t(C,Object.assign({title:"Delete segment",placement:"top",arrow:!0},{children:n("button",Object.assign({onClick:()=>{q(!1),P(!0),H(D,e=>{if(e){const t=Object.assign({},e);return t.open=!1,t}return{open:!1,state:de?"loading":"ready"}})},className:u.headerDeleteButton},{children:[t(m,{size:14}),"Delete"]}))})),t(O,Object.assign({"aria-label":"close",onClick:me,sx:e=>({padding:"4px",color:e.palette.grey[500]})},{children:t(r,{size:20})}))]}))]})),de?t(v,{customStyles:null==w?void 0:w.loadingSkeleton}):n(i,{children:[K&&!W&&t("div",Object.assign({style:{marginBottom:16}},{children:t(b,{label:null!=I?I:"",segmentExampleComponent:z,customStyles:Object.assign(Object.assign({},null==w?void 0:w.segmentExample),{exampleContainer:Object.assign(Object.assign({},null===(V=null==w?void 0:w.segmentExample)||void 0===V?void 0:V.exampleContainer),{width:"100%"})}),handleCancelExample:()=>{q(!1)}})})),W&&t("div",Object.assign({style:{marginBottom:16}},{children:t("div",Object.assign({className:`segment-${x}-container segmentContainer updatedSegmentContainer`,style:Object.assign({},null==w?void 0:w.container)},{children:t("span",Object.assign({className:`segment-${x} segmentLabel updatedSegmentLabel`,style:Object.assign({},null==w?void 0:w.label)},{children:E}))}))})),t("div",{children:t(j,{aiReason:k,customStyles:Object.assign(Object.assign({},$),{aiReasoningContent:Object.assign(Object.assign({},null==$?void 0:$.aiReasoningContent),{headerBar:{width:"auto"}}),aiReasoningAccordion:{header:{width:"auto"}}}),customIcons:B,isSegmentExplanation:!0,handleViewGlossary:L?()=>{H(D,e=>{if(e){const t=Object.assign({},e);return t.open=!1,t}return{open:!1,state:de?"loading":"ready"}}),null==L||L(x)}:void 0,handleViewExample:z?()=>{q(!0)}:void 0,isUpdatedSegment:W})})]})]}))})),t(f,{open:J,onHide:()=>{P(!1)},customDeleteStyles:M,customDeleteIcons:T,onDelete:t=>e(void 0,void 0,void 0,function*(){yield null==A?void 0:A(t)})}),t(S,{open:_,onHide:()=>{ee(!1),X(!1)},customStyles:M,customIcons:T,onConfirm:ie})]}))};export{x as default};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import o,{useContext as l,useMemo as i}from"react";import{Pencil as a,Check as s,X as r,ArrowUpRight as d,Trash2 as m}from"lucide-react";import{cn as c}from"../../../UserStoryImport/lib/cn.js";import p from"./segment.module.css.js";import u from"./deleteSegmentDialog.module.css.js";import g from"./ExampleComponentWrapper.js";import y from"../ai-reasoning/AiReasoningCitationContent.js";import v from"./SegmentLoader.js";import"./segment-common.css.js";import{MarkdownStateContext as h}from"../../store/markdown-context.js";import f from"@mui/material/Dialog";import C from"@mui/material/IconButton";import S from"./DeleteSegmentsDialog.js";import x from"@mui/material/Tooltip";import b from"./EditSegmentDialog.js";const I=({id:I="Segment",label:E,children:w,segmentUUID:D,decisionStrength:N=80,aiReason:k,customStyles:j,customIcons:B,aiReasoningCitationCustomStyles:L,segmentExampleComponent:$,handleViewGlossary:z,isUpdatedSegment:W,onOpen:A,onDelete:R,onEdit:U,customDeleteStyles:M,customDeleteIcons:T,enabledSegmentActions:G,segmentDataList:V,onShowNotification:F})=>{var H,K;const{citationsMetadata:O,updateCitationsMetadata:_}=l(h),[q,J]=o.useState(!1),[P,Q]=o.useState(!1),[X,Y]=o.useState(!1),[Z,ee]=o.useState(""),[te,ne]=o.useState(!1),{prefix:oe,inner:le}=i(()=>(e=>{const t=e.match(/^(.*?)\s*\{([^}]+)\}\s*$/);return!t||t.length<3?{prefix:"",inner:e}:{prefix:t[1].trim(),inner:t[2].trim()}})(null!=E?E:""),[E]);o.useEffect(()=>{X||ee(le)},[X,le]);const ie=async()=>{if(U){const e=Z.toLowerCase();_(D,e=>e?{...e,open:!1}:{open:!1,state:pe?"loading":"ready"}),await U(e)}Y(!1),ne(!1)},ae=()=>Y(!1),se=(null==T?void 0:T.editIcon)||e(a,{size:14}),re=(null==T?void 0:T.checkIcon)||e(s,{size:16,color:"#16A34A"}),de=(null==T?void 0:T.crossIcon)||e(r,{size:16,color:"#DC2626"}),me=i(()=>O.get(D),[O,D]),ce=i(()=>(null==me?void 0:me.open)||!1,[me]),pe=i(()=>me&&"loading"===me.state,[me]),ue=async()=>{const e=!ce;if(J(!1),console.log("citation metadata::",e,k),e&&!(null==k?void 0:k.reason)){_(D,t=>{if(t){const e={...t};return e.state="loading",e}return{open:e,state:"loading"}});try{console.log("citation metadata:: onopen"),await(null==A?void 0:A())}finally{_(D,t=>{if(t){const n={...t};return n.state="ready",n.open=e,n}return{open:e,state:"ready"}})}}else console.log("citation metadata:: else block"),_(D,t=>{if(t){const n={...t};return n.open=e,n}return{open:e,state:pe?"loading":"ready"}})};return t("div",{className:`segment-wrapper-${I} ${p.segmentWrapper}`,style:{...null==j?void 0:j.segmentWrapper,display:"inline-flex",verticalAlign:"middle"},children:[t("div",{className:`segment-${I}-container segmentContainer ${W?"updatedSegmentContainer":""}`,style:{...null==j?void 0:j.container},children:[e("span",{className:`segment-${I} segmentLabel ${W?"updatedSegmentLabel":""}`,style:{...null==j?void 0:j.label},children:W?w:E}),e("button",{className:`${p.segmentExplanationButtonContainer}`,style:{...null==j?void 0:j.buttonContainer},onClick:ue,children:e(d,{className:c(W&&p.updatedChevronIcon,p.cheveronIcon),style:{...null==j?void 0:j.cheveronIcon}})})]}),ce&&e(f,{open:!0,onClose:ue,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",maxWidth:"xl",container:document.getElementById("#root"),children:t("div",{style:{minWidth:"50vw",paddingLeft:16,paddingRight:16,paddingTop:24,paddingBottom:24},children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[t("div",X?{style:{display:"flex",alignItems:"center",gap:"8px"},children:[oe&&e("span",{className:"segmentLabel",style:{fontSize:18,fontWeight:600,...null==j?void 0:j.label},children:oe}),t("div",{className:p.editInputWrapper,style:null==j?void 0:j.editInputWrapper,children:[e("input",{value:Z,onChange:e=>ee(e.target.value),className:p.editInput,style:{...null==j?void 0:j.editInput,color:(null===(H=null==j?void 0:j.label)||void 0===H?void 0:H.color)?String(j.label.color):"#3B82F6",textTransform:"uppercase"},autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&ie(),"Escape"===e.key&&ae()}}),e(C,{onClick:()=>{if(Z===le||""===Z.trim())return void Y(!1);const e=Z.toLowerCase().trim();if(null==V?void 0:V.some(t=>t.segment_name.toLowerCase().trim()===e))return null==F||F("error","Error","Segment name already exists!"),_(D,e=>e?{...e,open:!1}:{open:!1,state:pe?"loading":"ready"}),void Y(!1);ne(!0)},size:"small",style:null==j?void 0:j.editCheckIcon,children:re}),e(C,{onClick:ae,size:"small",style:null==j?void 0:j.editCrossIcon,children:de})]})]}:{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e("span",{className:"segmentLabel",style:{fontSize:18,fontWeight:600,...null==j?void 0:j.label},children:null!=E?E:"SEGMENT NAME"}),(null==G?void 0:G.includes("edit"))&&e(x,{title:"Edit segment",placement:"top",arrow:!0,children:e("button",{onClick:()=>Y(!0),className:p.headerEditButton,style:null==j?void 0:j.editIconButton,children:se})})]}),t("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexShrink:0,...null==j?void 0:j.headerActionsContainer},children:[(null==G?void 0:G.includes("delete"))&&e(x,{title:"Delete segment",placement:"top",arrow:!0,children:t("button",{onClick:()=>{J(!1),Q(!0),_(D,e=>{if(e){const t={...e};return t.open=!1,t}return{open:!1,state:pe?"loading":"ready"}})},className:u.headerDeleteButton,children:[e(m,{size:14}),"Delete"]})}),e(C,{"aria-label":"close",onClick:ue,sx:e=>({padding:"4px",color:e.palette.grey[500]}),children:e(r,{size:20})})]})]}),pe?e(v,{customStyles:null==j?void 0:j.loadingSkeleton}):t(n,{children:[q&&!W&&e("div",{style:{marginBottom:16},children:e(g,{label:null!=E?E:"",segmentExampleComponent:$,customStyles:{...null==j?void 0:j.segmentExample,exampleContainer:{...null===(K=null==j?void 0:j.segmentExample)||void 0===K?void 0:K.exampleContainer,width:"100%"}},handleCancelExample:()=>{J(!1)}})}),W&&e("div",{style:{marginBottom:16},children:e("div",{className:`segment-${I}-container segmentContainer updatedSegmentContainer`,style:{...null==j?void 0:j.container},children:e("span",{className:`segment-${I} segmentLabel updatedSegmentLabel`,style:{...null==j?void 0:j.label},children:w})})}),e("div",{children:e(y,{aiReason:k,customStyles:{...L,aiReasoningContent:{...null==L?void 0:L.aiReasoningContent,headerBar:{width:"auto"}},aiReasoningAccordion:{header:{width:"auto"}}},customIcons:B,isSegmentExplanation:!0,handleViewGlossary:z?()=>{_(D,e=>{if(e){const t={...e};return t.open=!1,t}return{open:!1,state:pe?"loading":"ready"}}),null==z||z(I)}:void 0,handleViewExample:$?()=>{J(!0)}:void 0,isUpdatedSegment:W})})]})]})}),e(S,{open:P,onHide:()=>{Q(!1)},customDeleteStyles:M,customDeleteIcons:T,onDelete:async e=>{await(null==R?void 0:R(e))}}),e(b,{open:te,onHide:()=>{ne(!1),Y(!1)},customStyles:M,customIcons:T,onConfirm:ie})]})};export{I as default};
2
2
  //# sourceMappingURL=Segment.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as l}from"react/jsx-runtime";import s from"./segment.module.css.js";const i=({customStyles:i})=>e("div",Object.assign({className:s.loaderWrapper,style:null==i?void 0:i.wrapper},{children:l("div",Object.assign({className:s.loaderContainer,style:null==i?void 0:i.container},{children:[l("div",Object.assign({className:s.loaderHeader,style:null==i?void 0:i.header},{children:[e("div",{className:`${s.skeleton} ${s.title}`,style:null==i?void 0:i.titleSkeleton}),e("div",{className:`${s.skeleton} ${s.icon}`,style:null==i?void 0:i.iconSkeleton})]})),e("div",{className:`${s.skeleton} ${s.lineFull}`,style:null==i?void 0:i.lineFull}),e("div",{className:`${s.skeleton} ${s.line90}`,style:null==i?void 0:i.line90}),e("div",{className:`${s.skeleton} ${s.line75}`,style:null==i?void 0:i.line75}),e("div",{className:`${s.skeleton} ${s.line60}`,style:null==i?void 0:i.line60})]}))}));export{i as default};
1
+ import{jsx as l,jsxs as e}from"react/jsx-runtime";import s from"./segment.module.css.js";const i=({customStyles:i})=>l("div",{className:s.loaderWrapper,style:null==i?void 0:i.wrapper,children:e("div",{className:s.loaderContainer,style:null==i?void 0:i.container,children:[e("div",{className:s.loaderHeader,style:null==i?void 0:i.header,children:[l("div",{className:`${s.skeleton} ${s.title}`,style:null==i?void 0:i.titleSkeleton}),l("div",{className:`${s.skeleton} ${s.icon}`,style:null==i?void 0:i.iconSkeleton})]}),l("div",{className:`${s.skeleton} ${s.lineFull}`,style:null==i?void 0:i.lineFull}),l("div",{className:`${s.skeleton} ${s.line90}`,style:null==i?void 0:i.line90}),l("div",{className:`${s.skeleton} ${s.line75}`,style:null==i?void 0:i.line75}),l("div",{className:`${s.skeleton} ${s.line60}`,style:null==i?void 0:i.line60})]})});export{i as default};
2
2
  //# sourceMappingURL=SegmentLoader.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e}from"tslib";import{jsx as n}from"react/jsx-runtime";import t from"./Segment.js";import o from"dompurify";const l=({id:l,children:i,props:d,segmentComponentConfig:s,customStyles:a,customIcons:u,extractText:v,isUpdatedSegment:r=!1,blockId:m,customDeleteStyles:g,customDeleteIcons:c})=>{var p,S,h,I,C,f,y,D,b,x,_,E,U,W,k,F,L,j,O;const R=(null==d?void 0:d.id)||"Segment",w=(null==d?void 0:d.decisionstrength)||"80",{segmentDataList:A,getSegmentExampleComponent:B,handleViewGlossary:G,upadatedSegmentDataList:T,handleFetchUpdatedSegmentDetails:V,handleFetchSegmentDetails:z,handleDeleteSegment:H,handleEditSegment:M}=s||{},q=r?null==T?void 0:T.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==R?void 0:R.split("-"))||void 0===n?void 0:n[0])}):null==A?void 0:A.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==R?void 0:R.split("-"))||void 0===n?void 0:n[0])}),J={id:R,reason:null!==(p=null==q?void 0:q.reason)&&void 0!==p?p:"",gap:null!==(S=null==q?void 0:q.gap)&&void 0!==S?S:"",explanation:null!==(h=null==q?void 0:q.explanation)&&void 0!==h?h:"",relevance_score:null!==(I=null==q?void 0:q.relevance_score)&&void 0!==I?I:0,isOpen:!1};let K;const N=v(i),P=d["data-table"];let Q="";if(P&&!r)try{Q=decodeURIComponent(atob(P))}catch(e){console.error("Failed to decode data-table for segment",R,e)}const X=o.sanitize(Q),Y=()=>n("div",{dangerouslySetInnerHTML:{__html:X}});return q||!z||r||null==z||z(R),R&&q&&B&&!r&&(K=P?n(Y,{}):B(R,N,q.segment_type)),n(t,Object.assign({id:R,segmentUUID:l,label:null!==(C=null==q?void 0:q.label)&&void 0!==C?C:null==q?void 0:q.segment_name,decisionStrength:w,aiReason:J,customIcons:u,aiReasoningCitationCustomStyles:a,segmentExampleComponent:K,handleViewGlossary:G,customStyles:{segmentWrapper:null===(f=null==a?void 0:a.segment)||void 0===f?void 0:f.segmentWrapper,container:null===(y=null==a?void 0:a.segment)||void 0===y?void 0:y.container,label:null===(D=null==a?void 0:a.segment)||void 0===D?void 0:D.label,decisionStrength:null===(b=null==a?void 0:a.segment)||void 0===b?void 0:b.decisionStrength,buttonContainer:null===(x=null==a?void 0:a.segment)||void 0===x?void 0:x.buttonContainer,cheveronIcon:null===(_=null==a?void 0:a.segment)||void 0===_?void 0:_.cheveronIcon,segmentExample:null===(E=null==a?void 0:a.segment)||void 0===E?void 0:E.segmentExample,loadingSkeleton:null===(U=null==a?void 0:a.segment)||void 0===U?void 0:U.SegmentLoadingSkeletonStyles,editInputWrapper:null===(W=null==a?void 0:a.segment)||void 0===W?void 0:W.editInputWrapper,editInput:null===(k=null==a?void 0:a.segment)||void 0===k?void 0:k.editInput,editCheckIcon:null===(F=null==a?void 0:a.segment)||void 0===F?void 0:F.editCheckIcon,editCrossIcon:null===(L=null==a?void 0:a.segment)||void 0===L?void 0:L.editCrossIcon,headerActionsContainer:null===(j=null==a?void 0:a.segment)||void 0===j?void 0:j.headerActionsContainer,editIconButton:null===(O=null==a?void 0:a.segment)||void 0===O?void 0:O.editIconButton},isUpdatedSegment:r,onOpen:()=>e(void 0,void 0,void 0,function*(){!q&&r&&(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),yield null==V?void 0:V(R))}),onDelete:e=>{if(console.log("SegmentWrapper: onDelete",e,q,m),q)return null==H?void 0:H(e,q,m)},onEdit:e=>{if(console.log("SegmentWrapper: onEdit",q,e),q&&M)return null==M?void 0:M(q,e)},customDeleteStyles:g,customDeleteIcons:c},{children:i}),R)};export{l as default};
1
+ import{jsx as e}from"react/jsx-runtime";import n from"./Segment.js";import t from"dompurify";const o=({id:o,children:l,props:i,segmentComponentConfig:d,customStyles:s,customIcons:a,extractText:u,isUpdatedSegment:r=!1,blockId:m,storyId:v,customDeleteStyles:g,customDeleteIcons:c})=>{var p,S,h,I,C,f,y,D,b,x,_,E,U,W,k,w,L,A,F;const R=(null==i?void 0:i.id)||"Segment",j=(null==i?void 0:i.decisionstrength)||"80",{segmentDataList:B,getSegmentExampleComponent:G,handleViewGlossary:N,upadatedSegmentDataList:O,handleFetchUpdatedSegmentDetails:T,handleFetchSegmentDetails:V,handleDeleteSegment:z,handleEditSegment:H,enabledSegmentActions:M,onShowNotification:q}=d||{},J=r?null==O?void 0:O.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==R?void 0:R.split("-"))||void 0===n?void 0:n[0])}):null==B?void 0:B.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==R?void 0:R.split("-"))||void 0===n?void 0:n[0])}),K={id:R,reason:null!==(p=null==J?void 0:J.reason)&&void 0!==p?p:"",gap:null!==(S=null==J?void 0:J.gap)&&void 0!==S?S:"",explanation:null!==(h=null==J?void 0:J.explanation)&&void 0!==h?h:"",relevance_score:null!==(I=null==J?void 0:J.relevance_score)&&void 0!==I?I:0,isOpen:!1};let P;const Q=u(l),X=i["data-table"];let Y="";if(X&&!r)try{Y=decodeURIComponent(atob(X))}catch(e){console.error("Failed to decode data-table for segment",R,e)}const Z=t.sanitize(Y),$=()=>e("div",{dangerouslySetInnerHTML:{__html:Z}});return J||!V||r||null==V||V(R),R&&J&&G&&!r&&(P=X?e($,{}):G(R,Q,J.segment_type)),e(n,{id:R,segmentUUID:o,label:null!==(C=null==J?void 0:J.label)&&void 0!==C?C:null==J?void 0:J.segment_name,decisionStrength:j,aiReason:K,customIcons:a,aiReasoningCitationCustomStyles:s,segmentExampleComponent:P,handleViewGlossary:N,customStyles:{segmentWrapper:null===(f=null==s?void 0:s.segment)||void 0===f?void 0:f.segmentWrapper,container:null===(y=null==s?void 0:s.segment)||void 0===y?void 0:y.container,label:null===(D=null==s?void 0:s.segment)||void 0===D?void 0:D.label,decisionStrength:null===(b=null==s?void 0:s.segment)||void 0===b?void 0:b.decisionStrength,buttonContainer:null===(x=null==s?void 0:s.segment)||void 0===x?void 0:x.buttonContainer,cheveronIcon:null===(_=null==s?void 0:s.segment)||void 0===_?void 0:_.cheveronIcon,segmentExample:null===(E=null==s?void 0:s.segment)||void 0===E?void 0:E.segmentExample,loadingSkeleton:null===(U=null==s?void 0:s.segment)||void 0===U?void 0:U.SegmentLoadingSkeletonStyles,editInputWrapper:null===(W=null==s?void 0:s.segment)||void 0===W?void 0:W.editInputWrapper,editInput:null===(k=null==s?void 0:s.segment)||void 0===k?void 0:k.editInput,editCheckIcon:null===(w=null==s?void 0:s.segment)||void 0===w?void 0:w.editCheckIcon,editCrossIcon:null===(L=null==s?void 0:s.segment)||void 0===L?void 0:L.editCrossIcon,headerActionsContainer:null===(A=null==s?void 0:s.segment)||void 0===A?void 0:A.headerActionsContainer,editIconButton:null===(F=null==s?void 0:s.segment)||void 0===F?void 0:F.editIconButton},isUpdatedSegment:r,onOpen:async()=>{!J&&r&&(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),await(null==T?void 0:T(R)))},onDelete:e=>{if(console.log("SegmentWrapper: onDelete",e,{...J,segment_uuid:R},v,m),J)return null==z?void 0:z(e,{...J,segment_uuid:R},v,m)},onEdit:e=>{if(console.log("SegmentWrapper: onEdit",J,e),J&&H)return null==H?void 0:H(J,e)},customDeleteStyles:g,customDeleteIcons:c,enabledSegmentActions:M,segmentDataList:B,onShowNotification:(e,n,t)=>{q&&q(e,n,t)},children:l},R)};export{o as default};
2
2
  //# sourceMappingURL=SegmentWrapper.js.map
@@ -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,Tooltip as j}from"@mui/material";import{formatMarkdown as P}from"../../utils/helpers.js";import{replaceTitleSection as R}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"},z=Object.assign(({artifactTitleIds:o,config:t={},callbacks:s={},labels:m={},isDisabled:S=!1,disabledReason:y="",children:f,classNames:b,selectedArtifactId:I})=>{var C;const{userStory:A,customStyles:w}=d(),E={...M,...t},N={..._,...m},[U,T]=l([]),[k,B]=l(""),[D,F]=l(""),[j,P]=l(!1),[R,z]=l(!0),W=n(void 0),$=r((e,o,t,l)=>{s.onShowNotification?s.onShowNotification(e,o,t,l):console.log(`[${e.toUpperCase()}] ${o}: ${t}`)},[s]),L=r(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),O=i(()=>{const e=U.findIndex(e=>e.artifactId===k);return e>=0?e:0},[U,k]),V=U[O];a(()=>{W.current=V},[V]),a(()=>{var e;if(!(null==A?void 0:A.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===A.length&&z(!1),A.length>0&&!k&&B(I||A[0].artifactId);const o=c(u(A));T(o)},[A,I]),a(()=>{I&&I!==k&&B(I)},[I,k]),a(()=>{if(!V)return;const e=v(V,"");F(e)},[null==V?void 0:V.artifactId]);const q=r((e,o)=>{T(t=>{const l=[...t];if("APPROVED"===o.approval_status&&"APPROVED"!==t[e].approval_status){const e=p(t,o.artifactId);e&&B(e)}return l[e]=o,l})},[]),H=r(e=>{const o=W.current;if(!o)return;const t=v(o,e);"NA"!==t&&(F(""),setTimeout(()=>{F(t)},0))},[]);h({userStoryForApproval:U,selectedUserStoryForApproval:V,userStoryIndex:O,callbacks:s,labels:N,onSaveUserStory:q});const G={height:E.containerHeight,...E.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},Y={userStoryForApproval:U,setUserStoryForApproval:T,selectedStoryArtifactId:k,setSelectedStoryArtifactId:B,selectedUserStoryIndex:O,selectedUserStoryForApproval:V,currentContentId:D,setCurrentContentId:F,isEditingSegment:j,setIsEditingSegment:P,isSidebarExpanded:R,setIsSidebarExpanded:z,artifactTitleIds:o,config:E,labels:N,callbacks:s,isDisabled:S,disabledReason:y,handleSaveUserStory:q,handleUpdateContentId:H,showNotification:$,scrollToElement:L};return e(x.Provider,{value:Y,children:e("div",{className:`${g.container} ${(null==b?void 0:b.container)||""}`,style:{...G,...null===(C=null==w?void 0:w.approvalScreen)||void 0===C?void 0:C.wrapperContainer},children:f})})},{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,_,z,W,$,L,O,V,q,H,G,Y,J,K,Q,X,Z,ee,oe,te,le,ne,re,ie,ae,se,de;const{selectedUserStoryForApproval:ce,selectedUserStoryIndex:ue,artifactTitleIds:ve,labels:pe,config:me,isDisabled:he,disabledReason:Se,isEditingSegment:ye,handleSaveUserStory:ge,setCurrentContentId:fe,showNotification:be}=T(),{userStory:Ie,setUserStory:Ce}=d(),Ae=Ie[0],[we,Ee]=l(null),Ne=()=>{Ee(null)},Ue=n(null),[xe,Te]=l(!1),{customStyles:ke,customIcons:Be}=d(),De=null==ke?void 0:ke.userStoryCardStyles,[Fe,je]=l(!1),Pe=r(()=>{if(!ce)return;if(ye)return void be("warn","Warning!",pe.unsavedChangesWarning,3e3);const e=m(ce);ge(ue,e),fe("")},[ce,ue,ye,pe,ge,fe,be]);if(!ce)return null;const Re=ve[ue]||"",Me="APPROVED"===ce.approval_status,_e=he?Se:"",ze=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",{className:g.content,style:{...null===(N=null===(I=null==ke?void 0:ke.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==ke?void 0:ke.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===(z=null===(_=null==ke?void 0:ke.approvalScreen)||void 0===_?void 0:_.content)||void 0===z?void 0:z.headerLeft},children:[o("div",{className:g.headerMeta,style:{...null===(L=null===($=null===(W=null==ke?void 0:ke.approvalScreen)||void 0===W?void 0:W.body)||void 0===$?void 0:$.contentSegment)||void 0===L?void 0:L.headerMeta},children:[e(b,{size:16,color:(null===(q=null===(V=null===(O=null==ke?void 0:ke.approvalScreen)||void 0===O?void 0:O.body)||void 0===V?void 0:V.contentSegment)||void 0===q?void 0:q.bookMarkColor)||"#8C8C8C"}),e("h2",{className:g.headerArtifactId,style:{...null===(Y=null===(G=null===(H=null==ke?void 0:ke.approvalScreen)||void 0===H?void 0:H.body)||void 0===G?void 0:G.contentSegment)||void 0===Y?void 0:Y.headerArtifactId},children:Re})]}),e("p",{className:g.headerTitle,style:{...null===(Q=null===(K=null===(J=null==ke?void 0:ke.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",{className:null==g?void 0:g.containerStyle,style:null===(Z=null===(X=null==ke?void 0:ke.approvalScreen)||void 0===X?void 0:X.BigEnoughStyles)||void 0===Z?void 0:Z.containerStyle,children:[ze&&e("button",{className:g.developerEffortButton,style:null===(oe=null===(ee=null==ke?void 0:ke.approvalScreen)||void 0===ee?void 0:ee.BigEnoughStyles)||void 0===oe?void 0:oe.buttonStyle,onClick:()=>je(!Fe),children:e(B,{color:null===(le=null===(te=null==ke?void 0:ke.approvalScreen)||void 0===te?void 0:te.BigEnoughStyles)||void 0===le?void 0:le.iconColor,size:null===(re=null===(ne=null==ke?void 0:ke.approvalScreen)||void 0===ne?void 0:ne.BigEnoughStyles)||void 0===re?void 0:re.iconSize})}),v&&o(t,{children:[e("button",{className:g.iconButton,style:null==De?void 0:De.iconButton,onClick:e=>{Ee(e.currentTarget)},children:e(C,{size:16})}),o(D,{id:"user-story-share-menu",anchorEl:we,open:!!we,onClose:()=>Ee(null),style:null==De?void 0:De.userStoryShareMenu,children:[e(F,{style:null==De?void 0:De.userStoryMenuItem,onClick:async()=>{Te(!0),p&&(await Promise.all([p("pdf"),p("doc")]),Te(!1))},children:o("div",{ref:Ue,className:g.menuItemContent,style:null==De?void 0:De.menuItemContent,children:[e(A,{size:16,color:null==De?void 0:De.menuIconColor}),e("p",{style:null==De?void 0:De.menuLabel,children:"Download"})]})}),e(F,{style:null==De?void 0:De.userStoryMenuItem,onClick:async()=>{let e=Ae;e={...Ae,value:`${R(null==Ae?void 0:Ae.value,Ae.title)}`},null==h||h(!0,[e],Ae.artifactId),Ne()},children:o("div",{style:null==De?void 0:De.menuItemContent,className:g.menuItemContentPadded,children:[e(w,{size:16,color:null==De?void 0:De.menuIconColor}),e("p",{style:null==De?void 0:De.menuLabel,children:"Send"})]})}),e(F,{style:null==De?void 0:De.userStoryMenuItem,onClick:async()=>{const e=(new s.Converter).makeHtml(P(Ae.value)||Ae.value),o=function(e){const o=(new s.Converter).makeHtml(e),t=document.createElement("div");return t.innerHTML=o,t.textContent||t.innerText||""}(P(Ae.value)||Ae.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{Ne()}},children:o("div",{style:null==De?void 0:De.menuItemContent,className:g.menuItemContentPadded,children:[e(E,{size:16,color:null==De?void 0:De.menuIconColor}),e("p",{style:null==De?void 0:De.menuLabel,children:"Copy"})]})})]})]}),!c&&me.showApproveAllButton&&e("div",{className:g.headerRight,children:Me?e(y,{status:"APPROVED",label:pe.approved}):e(j,a?{title:_e,children:e("span",{children:e(a,{type:"fill",onClick:Pe,isDisable:he,className:g.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",{className:g.approveAllContent,children:[e(f,{size:16,color:"white"}),e("span",{children:pe.approveAll})]})})})}:{title:_e,children:e("span",{children:o("button",{onClick:Pe,disabled:he,className:g.approveAllButtonDefault,style:{...null===(ae=null===(ie=null==ke?void 0:ke.approvalScreen)||void 0===ie?void 0:ie.content)||void 0===ae?void 0:ae.approveAllButtonDefault},children:[e(f,{size:16,color:"white"}),e("span",{children:pe.approveAll})]})})})})]})]}),Fe&&ze&&e("div",{className:g.bigEnoughWrapper,children:e(k,{customIcons:null==Be?void 0:Be.userStoryIcons,customStyles:null===(se=null==ke?void 0:ke.approvalScreen)||void 0===se?void 0:se.aiReasoningCitaionStyles,currentUserStory:ce,panelStyles:null===(de=null==ke?void 0:ke.approvalScreen)||void 0===de?void 0:de.BigEnoughStyles,showPanel:Fe})}),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{z 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