@viswa-test/test-citation 0.0.334 → 0.0.335

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 (339) hide show
  1. package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
  2. package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  3. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +2 -0
  4. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +1 -0
  5. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +2 -0
  6. package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  7. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +2 -0
  8. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +1 -0
  9. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +2 -0
  10. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +1 -0
  11. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +2 -0
  12. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +1 -0
  13. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +2 -0
  14. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +1 -0
  15. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +2 -0
  16. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +1 -0
  17. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +2 -0
  18. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +1 -0
  19. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +2 -0
  20. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +1 -0
  21. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  22. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  23. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  24. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
  25. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  26. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  27. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  28. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
  29. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +1 -1
  30. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +1 -1
  31. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +1 -1
  32. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +1 -1
  33. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  34. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  35. package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
  36. package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
  37. package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
  38. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
  39. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
  40. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
  41. package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
  42. package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  43. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  44. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  45. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
  46. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  47. package/dist/cjs/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
  48. package/dist/cjs/features/RequirementAI/utils/helpers.js +1 -1
  49. package/dist/cjs/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
  50. package/dist/cjs/features/SegmentReviewComponents/BoundaryCard.js +1 -1
  51. package/dist/cjs/features/SegmentReviewComponents/CognitiveIntegrity.js +1 -1
  52. package/dist/cjs/features/SegmentReviewComponents/LabelCheck.js +1 -1
  53. package/dist/cjs/features/SegmentReviewComponents/PageCheck.js +2 -0
  54. package/dist/cjs/features/SegmentReviewComponents/PageCheck.js.map +1 -0
  55. package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
  56. package/dist/cjs/features/SegmentReviewComponents/helper.js +1 -1
  57. package/dist/cjs/features/SegmentReviewComponents/reviewStepAdapters.js +1 -1
  58. package/dist/cjs/index.js +1 -1
  59. package/dist/cjs/service/redlineService.js +1 -1
  60. package/dist/features/PdfViewer/PdfViewer.js +1 -1
  61. package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  62. package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +2 -0
  63. package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +1 -0
  64. package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +2 -0
  65. package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  66. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +2 -0
  67. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +1 -0
  68. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +2 -0
  69. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +1 -0
  70. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +2 -0
  71. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +1 -0
  72. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +2 -0
  73. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +1 -0
  74. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +2 -0
  75. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +1 -0
  76. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +2 -0
  77. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +1 -0
  78. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +2 -0
  79. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +1 -0
  80. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  81. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  82. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  83. package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
  84. package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  85. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  86. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  87. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
  88. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +1 -1
  89. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +1 -1
  90. package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +1 -1
  91. package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +1 -1
  92. package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  93. package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  94. package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
  95. package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
  96. package/dist/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
  97. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
  98. package/dist/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
  99. package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
  100. package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
  101. package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  102. package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  103. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  104. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
  105. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  106. package/dist/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
  107. package/dist/features/RequirementAI/utils/helpers.js +1 -1
  108. package/dist/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
  109. package/dist/features/SegmentReviewComponents/BoundaryCard.js +1 -1
  110. package/dist/features/SegmentReviewComponents/CognitiveIntegrity.js +1 -1
  111. package/dist/features/SegmentReviewComponents/LabelCheck.js +1 -1
  112. package/dist/features/SegmentReviewComponents/PageCheck.js +2 -0
  113. package/dist/features/SegmentReviewComponents/PageCheck.js.map +1 -0
  114. package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
  115. package/dist/features/SegmentReviewComponents/helper.js +1 -1
  116. package/dist/features/SegmentReviewComponents/reviewStepAdapters.js +1 -1
  117. package/dist/index.js +1 -1
  118. package/dist/service/redlineService.js +1 -1
  119. package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
  120. package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
  121. package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
  122. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +39 -29
  123. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
  124. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts +2 -0
  125. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts.map +1 -0
  126. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts +2 -0
  127. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts.map +1 -0
  128. package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  129. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts +10 -0
  130. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts.map +1 -0
  131. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts +17 -0
  132. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts.map +1 -0
  133. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts +23 -0
  134. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts.map +1 -0
  135. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts +3 -0
  136. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts.map +1 -0
  137. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts.map +1 -1
  138. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +1 -1
  139. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  140. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts +84 -5439
  141. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts.map +1 -1
  142. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +1 -1
  143. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  144. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts +1 -1
  145. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts.map +1 -1
  146. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +2 -2
  147. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  148. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +19 -2
  149. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  150. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts +7 -2
  151. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts.map +1 -1
  152. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts.map +1 -1
  153. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts +15 -1
  154. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts.map +1 -1
  155. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts +2 -1
  156. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts.map +1 -1
  157. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts +3 -2
  158. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts.map +1 -1
  159. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts.map +1 -1
  160. package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts +1 -0
  161. package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts.map +1 -1
  162. package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts +1 -0
  163. package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts.map +1 -1
  164. package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.d.ts.map +1 -1
  165. package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts +12 -0
  166. package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts.map +1 -0
  167. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts +3 -2
  168. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts.map +1 -1
  169. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts +1 -1
  170. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts.map +1 -1
  171. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +3 -1
  172. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
  173. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts +2 -1
  174. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
  175. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts +1 -0
  176. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts.map +1 -1
  177. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts +2 -0
  178. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts.map +1 -1
  179. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +2 -1
  180. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  181. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +2 -1
  182. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
  183. package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts +1 -1
  184. package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts.map +1 -1
  185. package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts +2 -0
  186. package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts.map +1 -1
  187. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +3 -0
  188. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
  189. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +2 -1
  190. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
  191. package/dist/types/src/features/RequirementAI/utils/helpers.d.ts +2 -0
  192. package/dist/types/src/features/RequirementAI/utils/helpers.d.ts.map +1 -1
  193. package/dist/types/src/features/RequirementAI/utils/proccess-stream.utils.d.ts.map +1 -1
  194. package/dist/types/src/features/SegmentReviewComponents/BoundaryCard.d.ts +1 -3
  195. package/dist/types/src/features/SegmentReviewComponents/BoundaryCard.d.ts.map +1 -1
  196. package/dist/types/src/features/SegmentReviewComponents/LabelCheck.d.ts +1 -3
  197. package/dist/types/src/features/SegmentReviewComponents/LabelCheck.d.ts.map +1 -1
  198. package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts +51 -0
  199. package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts.map +1 -0
  200. package/dist/types/src/features/SegmentReviewComponents/ReviewedCard.d.ts +1 -2
  201. package/dist/types/src/features/SegmentReviewComponents/ReviewedCard.d.ts.map +1 -1
  202. package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts +5 -17
  203. package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts.map +1 -1
  204. package/dist/types/src/features/SegmentReviewComponents/SegmentReviewRedirectionTest.d.ts.map +1 -1
  205. package/dist/types/src/features/SegmentReviewComponents/helper.d.ts.map +1 -1
  206. package/dist/types/src/features/SegmentReviewComponents/index.d.ts +5 -6
  207. package/dist/types/src/features/SegmentReviewComponents/index.d.ts.map +1 -1
  208. package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts +37 -38
  209. package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts.map +1 -1
  210. package/dist/types/src/index.d.ts +2 -2
  211. package/dist/types/src/index.d.ts.map +1 -1
  212. package/dist/types/src/service/redlineService.d.ts.map +1 -1
  213. package/package.json +9 -4
  214. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js +0 -2
  215. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js.map +0 -1
  216. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js +0 -2
  217. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js.map +0 -1
  218. package/dist/cjs/features/CognitiveCompare/components/GuidelineSkeletonLoader.js +0 -2
  219. package/dist/cjs/features/CognitiveCompare/components/GuidelineSkeletonLoader.js.map +0 -1
  220. package/dist/cjs/features/CognitiveCompare/utils/normalizeRedlineMarkdown.js +0 -2
  221. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
  222. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
  223. package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
  224. package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
  225. package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js +0 -2
  226. package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js.map +0 -1
  227. package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js +0 -2
  228. package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js.map +0 -1
  229. package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js +0 -2
  230. package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js.map +0 -1
  231. package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js +0 -2
  232. package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js.map +0 -1
  233. package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +0 -2
  234. package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +0 -1
  235. package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js +0 -2
  236. package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js.map +0 -1
  237. package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js +0 -2
  238. package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +0 -1
  239. package/dist/cjs/features/SegmentReviewComponents/ChartBreakoutCircle.js +0 -2
  240. package/dist/cjs/features/SegmentReviewComponents/ChartBreakoutCircle.js.map +0 -1
  241. package/dist/cjs/features/SegmentReviewComponents/RevertCard.js +0 -2
  242. package/dist/cjs/features/SegmentReviewComponents/RevertCard.js.map +0 -1
  243. package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js +0 -2
  244. package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js.map +0 -1
  245. package/dist/cjs/features/SegmentReviewComponents/RevertSummaryNotice.js +0 -2
  246. package/dist/cjs/features/SegmentReviewComponents/RevertSummaryNotice.js.map +0 -1
  247. package/dist/cjs/features/SegmentReviewComponents/ReviewedCard.js +0 -2
  248. package/dist/cjs/features/SegmentReviewComponents/ReviewedCard.js.map +0 -1
  249. package/dist/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js +0 -2
  250. package/dist/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js.map +0 -1
  251. package/dist/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js +0 -2
  252. package/dist/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js.map +0 -1
  253. package/dist/features/CognitiveCompare/components/GuidelineSkeletonLoader.js +0 -2
  254. package/dist/features/CognitiveCompare/components/GuidelineSkeletonLoader.js.map +0 -1
  255. package/dist/features/CognitiveCompare/utils/normalizeRedlineMarkdown.js +0 -2
  256. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
  257. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
  258. package/dist/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
  259. package/dist/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
  260. package/dist/features/PdfViewer/nyc-components/BoundaryCard.js +0 -2
  261. package/dist/features/PdfViewer/nyc-components/BoundaryCard.js.map +0 -1
  262. package/dist/features/PdfViewer/nyc-components/CardWrapper.js +0 -2
  263. package/dist/features/PdfViewer/nyc-components/CardWrapper.js.map +0 -1
  264. package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js +0 -2
  265. package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js.map +0 -1
  266. package/dist/features/PdfViewer/nyc-components/LabelCheck.js +0 -2
  267. package/dist/features/PdfViewer/nyc-components/LabelCheck.js.map +0 -1
  268. package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +0 -2
  269. package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +0 -1
  270. package/dist/features/PdfViewer/nyc-components/infoAlert.js +0 -2
  271. package/dist/features/PdfViewer/nyc-components/infoAlert.js.map +0 -1
  272. package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js +0 -2
  273. package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +0 -1
  274. package/dist/features/SegmentReviewComponents/ChartBreakoutCircle.js +0 -2
  275. package/dist/features/SegmentReviewComponents/ChartBreakoutCircle.js.map +0 -1
  276. package/dist/features/SegmentReviewComponents/RevertCard.js +0 -2
  277. package/dist/features/SegmentReviewComponents/RevertCard.js.map +0 -1
  278. package/dist/features/SegmentReviewComponents/RevertSuccessCard.js +0 -2
  279. package/dist/features/SegmentReviewComponents/RevertSuccessCard.js.map +0 -1
  280. package/dist/features/SegmentReviewComponents/RevertSummaryNotice.js +0 -2
  281. package/dist/features/SegmentReviewComponents/RevertSummaryNotice.js.map +0 -1
  282. package/dist/features/SegmentReviewComponents/ReviewedCard.js +0 -2
  283. package/dist/features/SegmentReviewComponents/ReviewedCard.js.map +0 -1
  284. package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts +0 -23
  285. package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts.map +0 -1
  286. package/dist/types/src/Background.d.ts +0 -7
  287. package/dist/types/src/Background.d.ts.map +0 -1
  288. package/dist/types/src/RedlineApprovalCardTest.d.ts +0 -1
  289. package/dist/types/src/RedlineApprovalCardTest.d.ts.map +0 -1
  290. package/dist/types/src/RedlineEditorTest2.d.ts +0 -3
  291. package/dist/types/src/RedlineEditorTest2.d.ts.map +0 -1
  292. package/dist/types/src/assests/icons/ChartSplitIcon.d.ts +0 -3
  293. package/dist/types/src/assests/icons/ChartSplitIcon.d.ts.map +0 -1
  294. package/dist/types/src/commonConstants.d.ts +0 -31103
  295. package/dist/types/src/commonConstants.d.ts.map +0 -1
  296. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/guidelineTargets.d.ts +0 -3
  297. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/guidelineTargets.d.ts.map +0 -1
  298. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.d.ts +0 -19
  299. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.d.ts.map +0 -1
  300. package/dist/types/src/features/CognitiveCompare/components/GuidelineSkeletonLoader.d.ts +0 -8
  301. package/dist/types/src/features/CognitiveCompare/components/GuidelineSkeletonLoader.d.ts.map +0 -1
  302. package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts +0 -2
  303. package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts.map +0 -1
  304. package/dist/types/src/features/CognitiveCompare/utils/normalizeRedlineMarkdown.d.ts +0 -6
  305. package/dist/types/src/features/CognitiveCompare/utils/normalizeRedlineMarkdown.d.ts.map +0 -1
  306. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +0 -128
  307. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +0 -1
  308. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +0 -13
  309. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +0 -1
  310. package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts +0 -59
  311. package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts.map +0 -1
  312. package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts +0 -19
  313. package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts.map +0 -1
  314. package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts +0 -3
  315. package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts.map +0 -1
  316. package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts +0 -77
  317. package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts.map +0 -1
  318. package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts +0 -47
  319. package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts.map +0 -1
  320. package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts +0 -15
  321. package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts.map +0 -1
  322. package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts +0 -3
  323. package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts.map +0 -1
  324. package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts +0 -36
  325. package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts.map +0 -1
  326. package/dist/types/src/features/SegmentReviewComponents/ChartBreakoutCircle.d.ts +0 -3
  327. package/dist/types/src/features/SegmentReviewComponents/ChartBreakoutCircle.d.ts.map +0 -1
  328. package/dist/types/src/features/SegmentReviewComponents/RevertCard.d.ts +0 -37
  329. package/dist/types/src/features/SegmentReviewComponents/RevertCard.d.ts.map +0 -1
  330. package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts +0 -9
  331. package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts.map +0 -1
  332. package/dist/types/src/features/SegmentReviewComponents/RevertSummaryNotice.d.ts +0 -7
  333. package/dist/types/src/features/SegmentReviewComponents/RevertSummaryNotice.d.ts.map +0 -1
  334. package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts +0 -2
  335. package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts.map +0 -1
  336. package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts +0 -2
  337. package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts.map +0 -1
  338. /package/dist/cjs/features/{CognitiveCompare → RequirementAI/components/RichTextEditor/Editor}/utils/normalizeRedlineMarkdown.js.map +0 -0
  339. /package/dist/features/{CognitiveCompare → RequirementAI/components/RichTextEditor/Editor}/utils/normalizeRedlineMarkdown.js.map +0 -0
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@react-pdf-viewer/core"),i=require("./PdfContainer.js"),r=require("./PdfToolbar.js"),o=require("./PdfStyle.js"),a=require("./usePdfHighlight.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");var u=require("react"),l=require("../ScannedDocCitation/ScannedDocCitation.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(u);exports.default=function(s){var d,g=s.pdfUrl,f=s.highlightText,v=s.highlightPages,h=s.highlightCordinatePages,p=s.highlightColor,m=void 0===p?"yellow":p,_=s.activeHighlightColor,x=void 0===_?"#f7dc51":_,y=s.jumpToPageValue,P=void 0===y?0:y,w=s.pdfName,T=s.onClose,S=s.customStyles,C=s.customClasses,b=s.customIcons,q=s.useCoordinates,A=s.fallbackPages,j=s.activeCitationIndex,L=s.onActiveCitationChange,I=s.headerAction,R=s.isZoomEnabled,H=void 0===R||R,N=s.showHighlightsAction,F=void 0===N||N,M=s.defaultScale,Z=void 0===M?n.SpecialZoomLevel.ActualSize:M,E=s.useRange,B=void 0!==E&&E,D=s.rangeOfPages,V=void 0===D?null:D,W=s.showFullScreenAction,z=void 0===W||W,O=s.segments,k=void 0===O?[{title:"Document 2",start_page:52,end_page:52,page_count:1}]:O,U=s.segmentTooltipText,J=s.onCurrentPageChange,K=s.navigationRequest,G=s.onNavigationSettled,Q=s.disablePdfAnnotations,X=void 0!==Q&&Q,Y=s.disablePdfTextLayer,$=void 0!==Y&&Y,ee=s.renderPage,te=s.setRenderRange,ne=u.useRef(null),ie=function(e){switch(e){case"ActualSize":return n.SpecialZoomLevel.ActualSize;case"PageFit":return n.SpecialZoomLevel.PageFit;case"PageWidth":return n.SpecialZoomLevel.PageWidth;default:return null!=e?e:n.SpecialZoomLevel.PageWidth}}(Z),re=u.useState(0),oe=re[0],ae=re[1],ue=u.useState(0),le=ue[0],se=ue[1],ce=u.useRef(null),de=u.useRef(null),ge=u.useRef(0),fe=u.useMemo(function(){return X||$?function(n){var i=$?t.jsx("div",e.__assign({"aria-hidden":"true",style:{display:"none"}},{children:n.textLayer.children})):n.textLayer.children,r=e.__assign(e.__assign({},n),{annotationLayer:e.__assign(e.__assign({},n.annotationLayer),{children:X?null:n.annotationLayer.children}),textLayer:e.__assign(e.__assign({},n.textLayer),{children:i})});return ee?ee(r):t.jsxs(t.Fragment,{children:[n.canvasLayer.children,i,!X&&n.annotationLayer.children]})}:ee},[X,$,ee]),ve=u.useMemo(function(){if(q)return new Set(h.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(v).forEach(function(t){t>0&&e.add(t-1)}),e},[h,v,q]),he=(d=f)&&0!==d.length?d.filter(function(e){return!d.some(function(t){return t!==e&&t.includes(e)})}):d,pe=a.PdfHighlightControls(he,q?{}:v,ne,ve,q,q?h:[],m,x),me=pe.highlightIndex,_e=pe.cursorIndex,xe=pe.setCursorIndex,ye=pe.orderedKeys,Pe=pe.totalHighlights,we=pe.getValidPosition,Te=pe.tryJump,Se=pe.jumpToPage,Ce=pe.plugins,be=pe.controls,qe=pe.hideNonTargetHighlights,Ae=pe.deduplicateHighlights,je=we(_e),Le=u.useMemo(function(){var e=oe+1;return k.find(function(t){return e>=t.start_page&&e<=t.end_page})},[oe,k]);u.useEffect(function(){void 0!==j&&j!==_e&&xe(j)},[j]);var Ie=e.__assign(e.__assign({},be),{goToNext:function(){_e>=Pe-1||(be.goToNext(),L&&L(_e+1))},goToPrevious:function(){_e<=0||(be.goToPrevious(),L&&L(_e-1))}}),Re=c.default.useCallback(function(e,t){ge.current+=1;var n=ge.current;null!=de.current&&window.clearTimeout(de.current);var i=null,r=0,o=0,a=function(){var u,l;if(ge.current===n){o+=1;var s=null===(u=ne.current)||void 0===u?void 0:u.querySelector(".rpv-core__inner-pages"),c=null===(l=ne.current)||void 0===l?void 0:l.querySelector('[data-testid="core__page-layer-'.concat(t-1,'"]'));if(!s||!c)return o>=40?(de.current=null,void(null==G||G({pageNumber:t,requestId:e.requestId}))):void(de.current=window.setTimeout(a,50));i===s.scrollTop?r+=1:(i=s.scrollTop,r=0);var d=s.getBoundingClientRect(),g=c.getBoundingClientRect(),f=Boolean(d&&g&&g.bottom>d.top&&g.top<d.bottom);if(r>=2&&f||o>=40)return de.current=null,void(null==G||G({pageNumber:t,requestId:e.requestId}));de.current=window.setTimeout(a,50)}};de.current=window.setTimeout(a,50)},[G]);if(u.useEffect(function(){return function(){ge.current+=1,null!=de.current&&window.clearTimeout(de.current)}},[]),u.useEffect(function(){var e;if(K&&!(le<=0)){var t=Math.min(Math.max(Math.trunc(K.pageNumber),1),le),n="".concat(null!==(e=K.requestId)&&void 0!==e?e:t,":").concat(t);ce.current!==n&&(ce.current=n,ae(t-1),Se(t-1),Re(K,t))}},[Se,K,le,Re]),!g)return t.jsx(l.default,{pages:A,activeCitationIndex:j,onActiveCitationChange:L,headerAction:I});return t.jsxs("div",e.__assign({ref:ne,className:(null==C?void 0:C.pdfViewerWrapper)||"","data-disable-pdf-annotations":X?"true":void 0,"data-pdf-page-fit":ie===n.SpecialZoomLevel.PageFit?"true":void 0,style:e.__assign(e.__assign(e.__assign({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},o.pdfStyles.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==S?void 0:S.pdfViewer)},{children:[t.jsx(r.default,{highlightIndex:me,totalHighlights:Pe,controls:Ie,currentPosition:je,pdfName:w,onClose:T,pdfUrl:g,viewerRef:ne,customStyles:S,customClasses:C,customIcons:b,headerAction:I,isZoomEnabled:H,showHighlightsAction:F,showFullScreenAction:z,currentSegment:Le,segmentTooltipText:U,currentPage:oe+1,totalPages:le,onPageNavigate:function(e){var t=Math.min(Math.max(e,1),le||e);ae(t-1),Se(t-1)}}),t.jsx(i.default,{defaultScale:ie,pdfUrl:g,plugins:Ce,customStyles:S,onLoad:function(t){se(t.doc.numPages);var n=!q&&!B&&P<=0;if(P>0&&!B){var i=P-1,r=ye[i],o=v[r],a=h[i];xe(i),console.log(a,"cordinateTargetHighlight"),q&&a.pageIndex>0&&Se(a.pageIndex),o>0&&(setTimeout(function(){qe(ve),Ae(o-1)},1e3),q||Se(o-1))}else if(B&&V&&2===V.length){e.__awaiter(void 0,void 0,void 0,function(){var t,n,i,r,o;return e.__generator(this,function(e){switch(e.label){case 0:t=V[0],n=V[1],i=t,e.label=1;case 1:return i<=n?(Se(r=i-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(e.sent(),qe(ve),(o=Ae(r))&&o>0)return[3,4];e.label=3;case 3:return i++,[3,1];case 4:return[2]}})})}else if(!q&&v){var u=ye.find(function(e){return v[e]>0});if(void 0!==u){var l=v[u]-1;Se(l),setTimeout(function(){qe(ve),Ae(l)},1e3)}}requestAnimationFrame(function(){n&&Te(),!q&&P>0&&!B&&function(){if(ne.current){var e=P-1,t=ye[e],n=v[t],i=n>0?n-1:0,r={};ye.forEach(function(e,t){var n=v[e];n>0&&(r[n]||(r[n]=[]),r[n].push(t))});var o=(r[n]||[]).indexOf(e),a=0,u=function(){var e,t;if(!(++a>40)){var n=null===(e=ne.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(n){var r=null===(t=ne.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(i,'"]'));if(r){var l=n.getBoundingClientRect(),s=r.getBoundingClientRect();if(s.top<l.bottom&&s.bottom>l.top){var c=r.querySelectorAll(".rpv-search__highlight")[o];if(c){var d=c.getBoundingClientRect(),g=n.scrollTop+(d.top-l.top)-n.clientHeight/2+d.height/2;n.scrollTo({top:g,behavior:"smooth"})}else setTimeout(u,100)}else setTimeout(u,100)}else setTimeout(u,100)}else setTimeout(u,100)}};setTimeout(u,500)}}()})},onPageChange:function(e){var t=e.currentPage;ae(t),null==J||J(t+1),ve.has(t)?(Ae(t),qe(ve)):qe(ve)},renderPage:fe,setRenderRange:te})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@react-pdf-viewer/core"),i=require("./PdfContainer.js"),r=require("./PdfToolbar.js"),o=require("./PdfStyle.js"),a=require("./usePdfHighlight.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");var l=require("react"),u=require("../ScannedDocCitation/ScannedDocCitation.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(l),d=function(e){switch(e){case"ActualSize":return n.SpecialZoomLevel.ActualSize;case"PageFit":return n.SpecialZoomLevel.PageFit;case"PageWidth":return n.SpecialZoomLevel.PageWidth;default:return null!=e?e:n.SpecialZoomLevel.PageWidth}};exports.default=function(s){var g,f=s.pdfUrl,h=s.highlightText,v=s.highlightPages,p=s.highlightCordinatePages,m=s.highlightColor,_=void 0===m?"yellow":m,x=s.activeHighlightColor,y=void 0===x?"#f7dc51":x,P=s.jumpToPageValue,T=void 0===P?0:P,w=s.pdfName,S=s.onClose,C=s.customStyles,b=s.customClasses,q=s.customIcons,A=s.useCoordinates,j=s.fallbackPages,L=s.activeCitationIndex,R=s.onActiveCitationChange,I=s.headerAction,H=s.isZoomEnabled,N=void 0===H||H,F=s.showHighlightsAction,M=void 0===F||F,E=s.defaultScale,Z=void 0===E?n.SpecialZoomLevel.ActualSize:E,B=s.useRange,D=void 0!==B&&B,V=s.rangeOfPages,W=void 0===V?null:V,z=s.showFullScreenAction,O=void 0===z||z,k=s.segments,U=void 0===k?[{title:"Document 2",start_page:52,end_page:52,page_count:1}]:k,J=s.segmentTooltipText,K=s.onCurrentPageChange,G=s.navigationRequest,Q=s.onNavigationSettled,X=s.disablePdfAnnotations,Y=void 0!==X&&X,$=s.disablePdfTextLayer,ee=void 0!==$&&$,te=s.renderPage,ne=s.setRenderRange,ie=l.useRef(null),re=l.useState(0),oe=re[0],ae=re[1],le=l.useState(0),ue=le[0],se=le[1],ce=l.useRef(null),de=l.useRef(null),ge=l.useRef(0),fe=l.useMemo(function(){return Y||ee?function(n){var i=ee?t.jsx("div",e.__assign({"aria-hidden":"true",style:{display:"none"}},{children:n.textLayer.children})):n.textLayer.children,r=e.__assign(e.__assign({},n),{annotationLayer:e.__assign(e.__assign({},n.annotationLayer),{children:Y?null:n.annotationLayer.children}),textLayer:e.__assign(e.__assign({},n.textLayer),{children:i})});return te?te(r):t.jsxs(t.Fragment,{children:[n.canvasLayer.children,i,!Y&&n.annotationLayer.children]})}:te},[Y,ee,te]),he=l.useMemo(function(){if(A)return new Set(p.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(v).forEach(function(t){t>0&&e.add(t-1)}),e},[p,v,A]),ve=(g=h)&&0!==g.length?g.filter(function(e){return!g.some(function(t){return t!==e&&t.includes(e)})}):g,pe=a.PdfHighlightControls(ve,A?{}:v,ie,he,A,A?p:[],_,y),me=pe.highlightIndex,_e=pe.cursorIndex,xe=pe.setCursorIndex,ye=pe.orderedKeys,Pe=pe.totalHighlights,Te=pe.getValidPosition,we=pe.tryJump,Se=pe.jumpToPage,Ce=pe.plugins,be=pe.controls,qe=pe.hideNonTargetHighlights,Ae=pe.deduplicateHighlights,je=Te(_e),Le=l.useMemo(function(){var e=oe+1;return U.find(function(t){return e>=t.start_page&&e<=t.end_page})},[oe,U]);l.useEffect(function(){void 0!==L&&L!==_e&&xe(L)},[L]);var Re=e.__assign(e.__assign({},be),{goToNext:function(){_e>=Pe-1||(be.goToNext(),R&&R(_e+1))},goToPrevious:function(){_e<=0||(be.goToPrevious(),R&&R(_e-1))}}),Ie=c.default.useCallback(function(e,t){ge.current+=1;var n=ge.current;null!=de.current&&window.clearTimeout(de.current);var i=null,r=0,o=0,a=function(){var l,u;if(ge.current===n){var s=null===(l=ie.current)||void 0===l?void 0:l.querySelector(".rpv-core__inner-pages");if(s){var c=null===(u=ie.current)||void 0===u?void 0:u.querySelector('[data-testid="core__page-layer-'.concat(t-1,'"]'));if(c){o+=1,s&&(i===s.scrollTop?r+=1:(i=s.scrollTop,r=0));var d=null==s?void 0:s.getBoundingClientRect(),g=null==c?void 0:c.getBoundingClientRect(),f=Boolean(d&&g&&g.bottom>d.top&&g.top<d.bottom);if(r>=2&&f||o>=40)return de.current=null,void(null==Q||Q({pageNumber:t,requestId:e.requestId}));de.current=window.setTimeout(a,50)}}}};de.current=window.setTimeout(a,50)},[Q]);if(l.useEffect(function(){return function(){ge.current+=1,null!=de.current&&window.clearTimeout(de.current)}},[]),l.useEffect(function(){var e;if(G&&!(ue<=0)){var t=Math.min(Math.max(Math.trunc(G.pageNumber),1),ue),n="".concat(null!==(e=G.requestId)&&void 0!==e?e:t,":").concat(t);ce.current!==n&&(ce.current=n,ae(t-1),Se(t-1),Ie(G,t))}},[Se,G,ue,Ie]),!f)return t.jsx(u.default,{pages:j,activeCitationIndex:L,onActiveCitationChange:R,headerAction:I});return t.jsxs("div",e.__assign({ref:ie,className:(null==b?void 0:b.pdfViewerWrapper)||"","data-disable-pdf-annotations":Y?"true":void 0,style:e.__assign(e.__assign(e.__assign({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},o.pdfStyles.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==C?void 0:C.pdfViewer)},{children:[t.jsx(r.default,{highlightIndex:me,totalHighlights:Pe,controls:Re,currentPosition:je,pdfName:w,onClose:S,pdfUrl:f,viewerRef:ie,customStyles:C,customClasses:b,customIcons:q,headerAction:I,isZoomEnabled:N,showHighlightsAction:M,showFullScreenAction:O,currentSegment:Le,segmentTooltipText:J,currentPage:oe+1,totalPages:ue,onPageNavigate:function(e){var t=Math.min(Math.max(e,1),ue||e);ae(t-1),Se(t-1)}}),t.jsx(i.default,{defaultScale:d(Z),pdfUrl:f,plugins:Ce,customStyles:C,onLoad:function(t){se(t.doc.numPages);var n=!A&&!D&&T<=0;if(T>0&&!D){var i=T-1,r=ye[i],o=v[r],a=p[i];xe(i),console.log(a,"cordinateTargetHighlight"),A&&a.pageIndex>0&&Se(a.pageIndex),o>0&&(setTimeout(function(){qe(he),Ae(o-1)},1e3),A||Se(o-1))}else if(D&&W&&2===W.length){e.__awaiter(void 0,void 0,void 0,function(){var t,n,i,r,o;return e.__generator(this,function(e){switch(e.label){case 0:t=W[0],n=W[1],i=t,e.label=1;case 1:return i<=n?(Se(r=i-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(e.sent(),qe(he),(o=Ae(r))&&o>0)return[3,4];e.label=3;case 3:return i++,[3,1];case 4:return[2]}})})}else if(!A&&v){var l=ye.find(function(e){return v[e]>0});if(void 0!==l){var u=v[l]-1;Se(u),setTimeout(function(){qe(he),Ae(u)},1e3)}}requestAnimationFrame(function(){n&&we(),!A&&T>0&&!D&&function(){if(ie.current){var e=T-1,t=ye[e],n=v[t],i=n>0?n-1:0,r={};ye.forEach(function(e,t){var n=v[e];n>0&&(r[n]||(r[n]=[]),r[n].push(t))});var o=(r[n]||[]).indexOf(e),a=0,l=function(){var e,t;if(!(++a>40)){var n=null===(e=ie.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(n){var r=null===(t=ie.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(i,'"]'));if(r){var u=n.getBoundingClientRect(),s=r.getBoundingClientRect();if(s.top<u.bottom&&s.bottom>u.top){var c=r.querySelectorAll(".rpv-search__highlight")[o];if(c){var d=c.getBoundingClientRect(),g=n.scrollTop+(d.top-u.top)-n.clientHeight/2+d.height/2;n.scrollTo({top:g,behavior:"smooth"})}else setTimeout(l,100)}else setTimeout(l,100)}else setTimeout(l,100)}else setTimeout(l,100)}};setTimeout(l,500)}}()})},onPageChange:function(e){var t=e.currentPage;ae(t),null==K||K(t+1),he.has(t)?(Ae(t),qe(he)):qe(he)},renderPage:fe,setRenderRange:ne})]}))};
2
2
  //# sourceMappingURL=PdfViewer.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../store/ref.context.js");require("../UserStoryCard/cws/CwsEvent.js");var i,o=require("../UserStoryCard/cws/CwsEventProvider.js"),r=require("react-hot-toast");exports.SectionStatus=void 0,(i=exports.SectionStatus||(exports.SectionStatus={})).WAITING="waiting",i.IN_PROGRESS="in_progress",i.GENERATED="generated",i.FAILED="failed",i.GENERATE="generate",i.APPROVED="approved";const s=t.createContext(null),a="user-story-lib";exports.ToasterId=a,exports.default=({children:i,userStory:u,setUserStory:l,aiReasoning:d,setAiReasoning:c,citations:g,setCitations:C,apiCachingConfig:f,customStyles:p,customIcons:h,searchQueryList:v,searchQueryReasoningIdList:m,citationConfig:S,chatHistory:I,chatCitationConfigs:R,gptCitationConfigs:x,diffEditConfig:y,aiReasoningAccordionOpenStates:E,persistedDataFiles:A,inlineUpdateComponentConfig:b,segmentComponentConfig:j,onEditBlocked:w,inlineManualComponentConfig:P,redlineConfig:q,sectionStatusConfig:D,customSectionConfig:U,updateRedlineDataParent:N,redlineCollaborativeConfig:T})=>{const[_,k]=t.useState(0),[F,L]=t.useState(""),M=t.useMemo(()=>{if(0===u.length||0===d.length)return Array(u.length).fill(0);const e=Array.from({length:u.length},()=>[]);return d.forEach(t=>{const n=Number(t.relevance_score);if(isNaN(n)||n<=0)return;const i=`ai_reasoning$${t.id}`,o=u.findIndex(e=>{var t;return e.value.includes(i)||(null===(t=e.sub_features)||void 0===t?void 0:t.some(e=>e.value.includes(i)))});-1!==o&&e[o].push(n)}),e.map(e=>0===e.length?0:Math.round(e.reduce((e,t)=>e+t,0)/e.length))},[u,d]),O=t.useCallback(e=>{var t;const n=u.findIndex(t=>t.artifactId===e);return-1===n?0:null!==(t=M[n])&&void 0!==t?t:0},[u,M]);return e.jsxs(s.Provider,{value:{chatHistory:I,userStory:u,setUserStory:l,aiReasoning:d,setAiReasoning:c,citations:g,setCitations:C,apiCachingConfig:f,customStyles:p,customIcons:h,searchQueryList:v,searchQueryReasoningIdList:m,citationConfig:S,getAvgScoreForStory:O,chatCitationConfigs:R,gptCitationConfigs:x,diffEditConfig:y,aiReasoningAccordionOpenStates:E,persistedDataFiles:A,currentHighlightIndex:_,setCurrentHighlightIndex:k,inlineUpdateComponentConfig:b,segmentComponentConfig:j,onEditBlocked:w,inlineManualComponentConfig:P,redlineConfig:q,redlineDcoumentId:F,setRedlineDocumentId:L,sectionStatusConfig:D,customSectionConfig:U,updateRedlineDataParent:N,redlineCollaborativeConfig:T},children:[e.jsx(r.Toaster,{position:"top-right",toasterId:a}),(null==T?void 0:T.initiateCollaborativeFlow)?e.jsx(o.default,{applicationId:null==T?void 0:T.modeId,baseUrl:null==T?void 0:T.cwsBaseUrl,authToken:null==T?void 0:T.authToken,children:e.jsx(n.RefProvider,{children:i})}):e.jsx(n.RefProvider,{children:i})]})},exports.useRequirementAI=()=>{const e=t.useContext(s);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../store/ref.context.js");require("../UserStoryCard/cws/CwsEvent.js");var i,o=require("../UserStoryCard/cws/CwsEventProvider.js"),r=require("react-hot-toast");exports.SectionStatus=void 0,(i=exports.SectionStatus||(exports.SectionStatus={})).WAITING="waiting",i.IN_PROGRESS="in_progress",i.GENERATED="generated",i.FAILED="failed",i.GENERATE="generate",i.APPROVED="approved";const s=t.createContext(null),a="user-story-lib";exports.ToasterId=a,exports.default=({children:i,userStory:u,setUserStory:d,aiReasoning:l,setAiReasoning:c,citations:g,setCitations:C,apiCachingConfig:f,customStyles:h,customIcons:p,searchQueryList:S,searchQueryReasoningIdList:m,citationConfig:v,chatHistory:I,chatCitationConfigs:R,gptCitationConfigs:x,diffEditConfig:y,aiReasoningAccordionOpenStates:E,persistedDataFiles:A,inlineUpdateComponentConfig:D,segmentComponentConfig:b,onEditBlocked:j,inlineManualComponentConfig:w,redlineConfig:P,sectionStatusConfig:q,customSectionConfig:T,updateRedlineDataParent:U,redlineCollaborativeConfig:F,onFetchOnDemandCitation:N})=>{const[O,_]=t.useState(0),[k,L]=t.useState(""),M=t.useMemo(()=>{if(0===u.length||0===l.length)return Array(u.length).fill(0);const e=Array.from({length:u.length},()=>[]);return l.forEach(t=>{const n=Number(t.relevance_score);if(isNaN(n)||n<=0)return;const i=`ai_reasoning$${t.id}`,o=u.findIndex(e=>{var t;return e.value.includes(i)||(null===(t=e.sub_features)||void 0===t?void 0:t.some(e=>e.value.includes(i)))});-1!==o&&e[o].push(n)}),e.map(e=>0===e.length?0:Math.round(e.reduce((e,t)=>e+t,0)/e.length))},[u,l]),G=t.useCallback(e=>{var t;const n=u.findIndex(t=>t.artifactId===e);return-1===n?0:null!==(t=M[n])&&void 0!==t?t:0},[u,M]),[H,Q]=t.useState(null);return e.jsxs(s.Provider,{value:{chatHistory:I,userStory:u,setUserStory:d,aiReasoning:l,setAiReasoning:c,citations:g,setCitations:C,apiCachingConfig:f,customStyles:h,customIcons:p,searchQueryList:S,searchQueryReasoningIdList:m,citationConfig:v,getAvgScoreForStory:G,chatCitationConfigs:R,gptCitationConfigs:x,diffEditConfig:y,aiReasoningAccordionOpenStates:E,persistedDataFiles:A,currentHighlightIndex:O,setCurrentHighlightIndex:_,inlineUpdateComponentConfig:D,segmentComponentConfig:b,onEditBlocked:j,inlineManualComponentConfig:w,redlineConfig:P,redlineDcoumentId:k,setRedlineDocumentId:L,sectionStatusConfig:q,customSectionConfig:T,updateRedlineDataParent:U,redlineCollaborativeConfig:F,selectedSectionToEdit:H,setSelectedSectionToEdit:Q,onFetchOnDemandCitation:N},children:[e.jsx(r.Toaster,{position:"top-right",toasterId:a}),(null==F?void 0:F.initiateCollaborativeFlow)?e.jsx(o.default,{applicationId:null==F?void 0:F.modeId,baseUrl:null==F?void 0:F.cwsBaseUrl,authToken:null==F?void 0:F.authToken,children:e.jsx(n.RefProvider,{children:i})}):e.jsx(n.RefProvider,{children:i})]})},exports.useRequirementAI=()=>{const e=t.useContext(s);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};
2
2
  //# sourceMappingURL=RequirementAIWrapper.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.INITIAL_HTML_LOAD_TAG="rich-text-editor:initial-html-load";
2
+ //# sourceMappingURL=changeTags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changeTags.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`,t=new RegExp(String.raw`<updated\b(${e})>([\s\S]*?)<\/updated\s*>`,"gi"),n=new RegExp(String.raw`<upt\b(${e})>([\s\S]*?)<\/upt\s*>`,"gi"),r=new RegExp(String.raw`<(deleted|changed)\b(${e})>([\s\S]*?)<\/\1\s*>`,"gi"),i=e=>{const t=e.trim();if(!t.includes("|"))return null;const n=[];let r="";for(let e=0;e<t.length;e+=1){const i=t[e],s=e>0&&"\\"===t[e-1];"|"!==i||s?r+=i:(n.push(r.trim()),r="")}return n.push(r.trim()),t.startsWith("|")&&n.shift(),t.endsWith("|")&&n.pop(),n},s=e=>!!(null==e?void 0:e.length)&&e.every(e=>/^:?-{3,}:?$/.test(e)),d=e=>`| ${e.join(" | ")} |`,l=e=>e.replace(n,(e,t,n)=>{if(!(e=>{const t=e.split("\n");return t.some((e,n)=>{var r;return n>0&&s(i(e))&&!!(null===(r=i(t[n-1]))||void 0===r?void 0:r.length)})})(n))return e;return`<updated${t}>${n.replace(/<del\b([^>]*)>/gi,"<deleted$1>").replace(/<\/del\s*>/gi,"</deleted>").replace(/<ins\b([^>]*)>/gi,"<changed$1>").replace(/<\/ins\s*>/gi,"</changed>")}</updated>`});exports.normalizeRedlineMarkdown=n=>{if(!n)return"";let a=l(n).replace(t,(e,t,n)=>{if(!n.includes("|"))return e;if(!/\bid\s*=\s*["']ai_reasoning\$/i.test(t))return n;const r=/\bdata-main\b/i.test(t)?"":" data-main",i=((e,t)=>{const n=t.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!n)return e;const r=encodeURIComponent(n[1]);return e.replace(/<(deleted|changed)\b([^>]*)>/gi,(e,t,n)=>/\bdata-upt-id\s*=/i.test(n)?e:`<${t}${n} data-upt-id="${r}">`)})(n,t);return`<upt${t}${r}></upt>\n\n${i}`});return a=(t=>{const n=new RegExp(String.raw`(<deleted\b${e}>(?:(?!<\/deleted\s*>)[\s\S])*?\|(?:(?!<\/deleted\s*>)[\s\S])*?<\/deleted\s*>)\s*(<changed\b${e}>[^|]*?<\/changed\s*>)\s*\|`,"gi"),d=t.replace(n,(e,t,n)=>{var r;return`${(null!==(r=t.replace(/<\/deleted\s*>$/i,"").trimEnd().split("\n").at(-1))&&void 0!==r?r:"").trimEnd().endsWith("|")?t:t.replace(/<\/deleted\s*>$/i," |</deleted>")}\n${n}`}),l=new RegExp(String.raw`(<deleted\b${e}>(?:(?!<\/deleted\s*>)[\s\S])*?\|(?:(?!<\/deleted\s*>)[\s\S])*?<\/deleted\s*>)\s*(?=<changed\b${e}>)`,"gi"),a=d.replace(l,"$1\n\n");return a.replace(r,(e,t,n,r,d)=>{if(!r.includes("|"))return e;const l=a.slice(0,d),c=/(?:^|\n)[ \t]*$/.test(l);return r.split("\n").map((e,r)=>{if(!e)return e;let d=e;d.includes("|")&&!/^\s*\|/.test(d)&&(r>0||c)&&(d=`| ${d}`);const l=i(d);return s(l)?d:d.split(/(\|)/).map(e=>"|"!==e&&e.trim()?`<${t}${n}>${e}</${t}>`:e).join("")}).join("\n")})})(a),a=a.replace(/([([])\s+(?=<(?:deleted|changed)>)/gi,"$1"),(e=>{const t=e.split("\n");for(let e=1;e<t.length;e+=1){const n=i(t[e]);if(!s(n))continue;const r=i(t[e-1]);if(!(null==r?void 0:r.length))continue;for(;r.length>n.length;){const e=r.findIndex(e=>""===e);if(-1===e)break;r.splice(e,1)}const l=Math.max(r.length,n.length);let a=e+1,c=0;for(;a<t.length&&""!==t[a].trim();){const e=i(t[a]);if(!e)break;for(;e.length>l;){const t=e.findIndex(e=>""===e);if(-1===t)break;e.splice(t,1)}t[a]=d(e),c=Math.max(c,e.length),a+=1}const o=Math.max(r.length,n.length,c);for(;r.length<o;)r.push("");for(;n.length<o;)n.push("---");t[e-1]=d(r),t[e]=d(n)}return t.join("\n")})(a)};
2
+ //# sourceMappingURL=normalizeRedlineMarkdown.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./Editor/constants/editorConfig.js"),n=require("./Editor/Editor.js"),a=require("../../store/ref.context.js"),o=require("@lexical/html"),l=require("turndown"),s=require("turndown-plugin-gfm"),i=require("../UnsavedChangesPopup/UnsavedChangesPopup.js"),c=require("../../../../utils/tagHelper.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const d=new(u(l).default)({headingStyle:"atx",codeBlockStyle:"fenced"}),p=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");d.keep(["ins","del","mark"]),d.addRule("ai-reasoning-link-passthrough",{filter:e=>{var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r},replacement:(e,t)=>{const r=t,n=r.getAttribute("href")||"",a=r.textContent||"";return`<a href="${o=n,p(o).replace(/"/g,"&quot;")}">${p(a)}</a>`;var o}}),d.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),d.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),d.use(s.tables);const h=e=>(e||"").replace(/\r\n/g,"\n").trim(),g=t.forwardRef(({type:l,value:s,handleUpdateState:u,onBlur:p,placeholder:g,minHeight:f,height:m,mode:E,doNotShowBorderInViewMode:v,onEditBlocked:S,onSaveUnsavedChanges:A,onDiscardUnsavedChanges:$,isSavingUnsavedChanges:y=!1},b)=>{const w=t.useRef(null),[x,C]=t.useState({type:l,value:s}),[q,N]=t.useState(0),[R,T]=t.useState(!1),_=t.useRef(s),B=t.useRef(s),j=t.useRef(Boolean(s)),{contentRef:I,setContentRef:L}=a.useRefStore();t.useEffect(()=>{C(e=>({...e,value:s})),_.current=s,B.current=s,j.current=Boolean(s),T(!1)},[s]),t.useImperativeHandle(b,()=>({requestClose:()=>!("edit"===E&&h(_.current)!==h(B.current))||(T(!0),!1)}),[E]);return t.useEffect(()=>{const e=()=>{I&&I.current&&N(I.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[I]),e.jsxs("div",{style:{position:"relative",width:"100%",height:m,minHeight:f},children:[R&&e.jsx(i.UnsavedChangesPopup,{isSaving:y,onSave:async()=>{await(null==A?void 0:A()),_.current=B.current,T(!1)},onDiscard:()=>{B.current=_.current,null==$||$(),T(!1)}}),e.jsx(n.default,{minHeight:f,height:m,placeholder:g||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=o.$generateHtmlFromNodes(t,null),r=(new DOMParser).parseFromString(e,"text/html");r.querySelectorAll("span").forEach(e=>{const t=e.getAttribute("style")||"";t.includes("background-color")&&t.includes("rgb(219, 234, 254)")&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("strong code").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,"")),e.removeAttribute("class"),e.textContent=e.textContent||""})(e)});const n=["upt","manual","ins","del","preserved"];function a(e,t){const r=e.cloneNode(!0),o=new Map;r.querySelectorAll(n.join(",")).forEach(e=>{if(e===r)return;const n=`%%NESTED${o.size}%%`;o.set(n,a(e,t)),e.replaceWith(n)});let l=t.turndown(r.innerHTML);o.forEach((e,t)=>{l=l.replace(t,e)});const s=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),i=e.tagName.toLowerCase();return s?`<${i} ${s}>${l}</${i}>`:`<${i}>${l}</${i}>`}r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const l=[];r.querySelectorAll("invisible").forEach((e,t)=>{l.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const s=[];["manual","upt"].forEach(e=>{r.querySelectorAll(e).forEach((e,t)=>{s.push(a(e,d)),e.replaceWith(r.createTextNode(`%%REVIEW_${s.length-1}%%`))})});const i=[];r.querySelectorAll("table").forEach((e,t)=>{i.push(e.outerHTML);const n=r.createElement("p");n.textContent=`%%TABLE_${t}%%`,e.replaceWith(n)});let p=d.turndown(r.body.innerHTML);for(let e=s.length-1;e>=0;e--)p=p.replace(`%%REVIEW\\_${e}%%`,` ${s[e]} `);l.forEach((e,t)=>{p=p.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),i.forEach((e,t)=>{p=p.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),p=p.replace(/\*{4}([^*]+)\*{4}/g,"**$1**"),p=p.replace(/\s+class="PlaygroundEditorTheme__[^"]*"/g,""),p=p.replace(/<span\s+style="white-space:\s*pre-wrap;?">([\s\S]*?)<\/span>/g,"$1"),p=p.replace(/\s+style="white-space:\s*pre-wrap;?"/g,""),p=p.replace(/<b>\s*<strong>([\s\S]*?)<\/strong>\s*<\/b>/g,"<strong>$1</strong>");["upt","manual","del","ins","preserved"].forEach(e=>{p=c.mergeTagAcrossParagraphs(p,e)}),p=c.unescapeTagIds(p,["manual","upt"]),j.current&&(_.current=p,j.current=!1),B.current=p,((e,t)=>{u(e,t)})("prompt",p)})},toolbarConfig:r.DEFAULT_TOOLBAR_CONFIG,editorRef:w,mode:E,initialString:{type:x.type,value:x.value},dynamicHeight:q,onBlur:p,doNotShowBorderInViewMode:v||!1,onEditBlocked:S})]})});g.displayName="RichTextEditor",exports.default=g;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./Editor/constants/editorConfig.js"),n=require("./Editor/Editor.js"),o=require("../../store/ref.context.js"),a=require("@lexical/html"),l=require("turndown"),s=require("turndown-plugin-gfm"),c=require("../UnsavedChangesPopup/UnsavedChangesPopup.js"),i=require("../../../../utils/tagHelper.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const d=new(u(l).default)({headingStyle:"atx",codeBlockStyle:"fenced"}),p=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");d.keep(["ins","del","mark"]),d.keep(e=>["DELETED","CHANGED"].includes(e.nodeName)),d.addRule("ai-reasoning-link-passthrough",{filter:e=>{var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r},replacement:(e,t)=>{const r=t,n=r.getAttribute("href")||"",o=r.textContent||"";return`<a href="${a=n,p(a).replace(/"/g,"&quot;")}">${p(o)}</a>`;var a}}),d.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),d.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),d.use(s.tables);const h=e=>(e||"").replace(/\r\n/g,"\n").trim(),g=t.forwardRef(({type:l,value:s,handleUpdateState:u,onBlur:p,placeholder:g,minHeight:f,height:E,mode:m,doNotShowBorderInViewMode:v,onEditBlocked:A,onSaveUnsavedChanges:y,onDiscardUnsavedChanges:S,isSavingUnsavedChanges:$=!1},x)=>{const w=t.useRef(null),[C,b]=t.useState({type:l,value:s}),[N,q]=t.useState(0),[T,R]=t.useState(!1),L=t.useRef(s),B=t.useRef(s),_=t.useRef(Boolean(s)),{contentRef:I,setContentRef:j}=o.useRefStore();t.useEffect(()=>{b(e=>({...e,value:s})),L.current=s,B.current=s,_.current=Boolean(s),R(!1)},[s]),t.useImperativeHandle(x,()=>({requestClose:()=>!("edit"===m&&h(L.current)!==h(B.current))||(R(!0),!1)}),[m]);return t.useEffect(()=>{const e=()=>{I&&I.current&&q(I.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[I]),e.jsxs("div",{style:{position:"relative",width:"100%",height:E,minHeight:f},children:[T&&e.jsx(c.UnsavedChangesPopup,{isSaving:$,onSave:async()=>{await(null==y?void 0:y()),L.current=B.current,R(!1)},onDiscard:()=>{B.current=L.current,null==S||S(),R(!1)}}),e.jsx(n.default,{minHeight:f,height:E,placeholder:g||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=a.$generateHtmlFromNodes(t,null),r=(new DOMParser).parseFromString(e,"text/html");r.querySelectorAll("span").forEach(e=>{const t=e.getAttribute("style")||"";t.includes("background-color")&&(t.includes("rgb(219, 234, 254)")||t.includes("rgb(213, 232, 255)")||t.toLowerCase().includes("#d5e8ff"))&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("span[data-review]").forEach(e=>{const t="delete"===e.getAttribute("data-review")?"deleted":"changed",n=r.createElement(t);n.append(...Array.from(e.childNodes)),e.replaceWith(n)}),r.querySelectorAll("strong code").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code").forEach(e=>{e.textContent=e.textContent||""}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,"")),e.removeAttribute("class"),e.textContent=e.textContent||""})(e)});const n=["upt","manual","ins","del","preserved"];function o(e,t){const r=e.cloneNode(!0),a=new Map;r.querySelectorAll(n.join(",")).forEach(e=>{if(e===r)return;const n=`%%NESTED${a.size}%%`;a.set(n,o(e,t)),e.replaceWith(n)});let l=t.turndown(r.innerHTML);a.forEach((e,t)=>{l=l.replace(t,e)});const s=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),c=e.tagName.toLowerCase();return s?`<${c} ${s}>${l}</${c}>`:`<${c}>${l}</${c}>`}r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const l=[];r.querySelectorAll("invisible").forEach((e,t)=>{l.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const s=[];["manual","upt"].forEach(e=>{r.querySelectorAll(e).forEach((e,t)=>{s.push(o(e,d)),e.replaceWith(r.createTextNode(`%%REVIEW_${s.length-1}%%`))})});const c=[];r.querySelectorAll("p").forEach(e=>{if(!(""===e.textContent&&Array.from(e.childNodes).every(e=>"BR"===e.nodeName||e.nodeType===Node.TEXT_NODE&&""===e.textContent)))return;const t=`%%BLANKLINE${c.length}%%`;c.push(t),e.textContent=t});const p=[];r.querySelectorAll("table").forEach((e,t)=>{p.push(e.outerHTML);const n=r.createElement("p");n.textContent=`%%TABLE_${t}%%`,e.replaceWith(n)});let h=d.turndown(r.body.innerHTML);c.forEach(e=>{h=h.replace(new RegExp(`\\n*${e}\\n*`,"g"),"\n\n")});for(let e=s.length-1;e>=0;e--)h=h.replace(`%%REVIEW\\_${e}%%`,` ${s[e]} `);l.forEach((e,t)=>{h=h.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),p.forEach((e,t)=>{h=h.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),h=h.replace(/\*{4}([^*]+)\*{4}/g,"**$1**"),h=h.replace(/\s+class="PlaygroundEditorTheme__[^"]*"/g,""),h=h.replace(/<span\s+style="white-space:\s*pre-wrap;?">([\s\S]*?)<\/span>/g,"$1"),h=h.replace(/\s+style="white-space:\s*pre-wrap;?"/g,""),h=h.replace(/<b>\s*<strong>([\s\S]*?)<\/strong>\s*<\/b>/g,"<strong>$1</strong>"),h=h.replace(/<code([^>]*)>\s*<span[^>]*>([\s\S]*?)<\/span>\s*<\/code>/g,"<code$1>$2</code>");["upt","manual","del","ins","preserved"].forEach(e=>{h=i.mergeTagAcrossParagraphs(h,e)}),h=i.unescapeTagIds(h,["manual","upt"]),_.current&&(L.current=h,_.current=!1),B.current=h,((e,t)=>{u(e,t)})("prompt",h)})},toolbarConfig:r.DEFAULT_TOOLBAR_CONFIG,editorRef:w,mode:m,initialString:{type:C.type,value:C.value},dynamicHeight:N,onBlur:p,doNotShowBorderInViewMode:v||!1,onEditBlocked:A})]})});g.displayName="RichTextEditor",exports.default=g;
2
2
  //# sourceMappingURL=RichTextEditor.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=".avatar{align-items:center;border-radius:50%;box-sizing:border-box;color:#475467;display:flex;flex-shrink:0;font-family:Inter;font-weight:600;justify-content:center;line-height:1;position:relative;user-select:none}.avatar--bordered{border:2px solid #fff}.online-dot{background:#22c55e;border:2px solid #fff;border-radius:50%;bottom:-1px;position:absolute;right:-1px}";!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&t.setAttribute("nonce",o),t.appendChild(document.createTextNode(e));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(t)}(),exports.default=e;
2
+ //# sourceMappingURL=Avatar.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("./Avatar.css.js");var a=require("./avatarUtils.js");exports.default=function({name:t,online:r=!1,size:s=56,bordered:i=!1}){return e.jsxs("div",{className:"avatar "+(i?"avatar--bordered":""),style:{width:s,height:s,background:a.getAvatarColor(t),fontSize:Math.max(12,.38*s)},children:[a.getInitials(t),r&&e.jsx("span",{className:"online-dot",style:{width:Math.max(8,.28*s),height:Math.max(8,.28*s)}})]})};
2
+ //# sourceMappingURL=Avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=".avatar-group{align-items:center;cursor:pointer;display:inline-flex;gap:6px;position:relative;user-select:none}.avatar-stack{align-items:center;display:flex}.avatar-wrapper{margin-left:-10px;position:relative}.avatar-wrapper:first-child{margin-left:0}.avatar-more{align-items:center;background:#f2f4f7;border:2px solid #fff;border-radius:50%;box-sizing:border-box;color:#667085;display:flex;font-size:11px;font-weight:600;height:32px;justify-content:center;line-height:1;user-select:none;width:32px}.avatar-chevron{color:#667085;cursor:pointer;height:16px;transition:transform .2s ease;width:16px}.avatar-chevron.open{transform:rotate(180deg)}.avatar-group-container{display:inline-block;position:relative}.collaborators-popup-wrapper{left:-100px;position:absolute;z-index:1000}";!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const n=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;n&&t.setAttribute("nonce",n),t.appendChild(document.createTextNode(e));const r=document.head||document.getElementsByTagName("head")[0]||document.documentElement;r&&r.appendChild(t)}(),exports.default=e;
2
+ //# sourceMappingURL=CollaboratorsGroup.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollaboratorsGroup.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react");require("./CollaboratorsGroup.css.js");var s=require("./Avatar.js"),a=require("./CollaboratorsPopup.js"),t=require("lucide-react");exports.default=function({users:n,owner:o,activeUsers:i,previousUsers:c=[],maxVisible:l=3}){const u=n.slice(0,l),d=n.length-u.length,[v,p]=r.useState(!1),m=r.useRef(null);return r.useEffect(()=>{function e(e){m.current&&!m.current.contains(e.target)&&p(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),e.jsxs("div",{className:"avatar-group-container",ref:m,children:[e.jsxs("div",{className:"avatar-group",onClick:()=>p(e=>!e),children:[e.jsxs("div",{className:"avatar-stack",children:[u.map((r,a)=>e.jsx("div",{className:"avatar-wrapper",style:{zIndex:a+1},children:e.jsx(s.default,{name:r.name,online:r.online,size:32,bordered:!0})},r.id)),d>0&&e.jsx("div",{className:"avatar-wrapper",style:{zIndex:u.length+1},children:e.jsxs("div",{className:"avatar-more",children:["+",d]})})]}),e.jsx(t.ChevronDown,{className:"avatar-chevron "+(v?"open":"")})]}),v&&e.jsx("div",{className:"collaborators-popup-wrapper",children:e.jsx(a.default,{owner:o,activeUsers:i,previousUsers:c})})]})};
2
+ //# sourceMappingURL=CollaboratorsGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollaboratorsGroup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=".collaborators-popover{background:#fff;border-radius:12px;box-shadow:0 10px 30px #0000001f,0 2px 8px #0000000f;font-family:Inter,sans-serif;max-height:400px;overflow-y:auto;padding:12px;width:280px}.owner-section,.user-row{align-items:center;display:flex}.user-row+.user-row{margin-top:10px}.user-info{margin-left:12px;min-width:0}.user-name{align-items:center;color:#344054;display:flex;font-size:14px;font-weight:600;gap:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.you{color:#667085;font-weight:400}.user-subtitle{color:#667085;font-size:13px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.divider{background:#eaecf0;height:1px;margin:12px 0}.section-title{color:#98a2b3;font-size:12px;font-weight:600;letter-spacing:.04em;margin-bottom:10px;text-transform:uppercase}.section-title.previous{margin-top:18px}.faded{opacity:.45}.user-text{display:inline-block;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&t.setAttribute("nonce",o),t.appendChild(document.createTextNode(e));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(t)}(),exports.default=e;
2
+ //# sourceMappingURL=CollaboratorsPopup.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollaboratorsPopup.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("./CollaboratorsPopup.css.js");var s=require("./Avatar.js"),i=require("@mui/material");function r({user:r}){return e.jsxs("div",{className:"user-row "+(r.faded?"faded":""),children:[e.jsx(s.default,{name:r.name,online:r.online,size:40}),e.jsxs("div",{className:"user-info",children:[e.jsxs("div",{className:"user-name",children:[e.jsx(i.Tooltip,{title:r.name,children:e.jsx("span",{className:"user-text",children:r.name})}),!!r.isUser&&e.jsx("span",{className:"you",children:"(You)"})]}),e.jsx("div",{className:"user-subtitle",children:e.jsx(i.Tooltip,{title:r.subtitle,children:e.jsx("span",{className:"user-text",children:r.subtitle})})})]})]})}exports.default=function({owner:a,activeUsers:l,previousUsers:n=[]}){return e.jsxs("div",{className:"collaborators-popover",children:[a&&e.jsxs("div",{className:"owner-section",children:[e.jsx(s.default,{name:a.name,online:a.online,size:40}),e.jsxs("div",{className:"user-info",children:[e.jsxs("div",{className:"user-name",children:[e.jsx(i.Tooltip,{title:a.name,children:e.jsx("span",{className:"user-text",children:a.name})}),!!a.isUser&&e.jsx("span",{className:"you",children:"(You)"})]}),e.jsx("div",{className:"user-subtitle",children:"Owner"})]})]}),(l.length>0||n.length>0)&&e.jsx("div",{className:"divider"}),l.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"section-title",children:"On this document"}),l.map(s=>e.jsx(r,{user:s},s.id))]}),n.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"section-title previous",children:"Previously active"}),n.map(s=>e.jsx(r,{user:{...s,faded:!0}},s.id))]})]})};
2
+ //# sourceMappingURL=CollaboratorsPopup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollaboratorsPopup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t=["#FFF3B0","#D9F7E5","#EEE3FF","#DDEBFF","#FFE2E2","#FFE9CC","#DFF5FF","#FDE2F3"];exports.getAvatarColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=e.charCodeAt(t)+((r<<5)-r);return t[Math.abs(r)%t.length]},exports.getInitials=function(t){return t.trim().split(/\s+/).slice(0,2).map(t=>{var e;return null===(e=t[0])||void 0===e?void 0:e.toUpperCase()}).join("")};
2
+ //# sourceMappingURL=avatarUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatarUtils.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("react/jsx-runtime"),e=require("lucide-react"),n=require("react"),o=require("./ResizableSplitPane.js"),l=require("../icons/PdfViewerIcons.js"),t=require("@e-llm-studio/citation"),a=require("react-markdown"),r=require("rehype-raw"),d=require("@mui/material"),u=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function s(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var c=s(a),v=s(r);const p=i=>{if(i)try{const e=new URL(i).hostname.replace(/^www\./i,""),n=e.split(".")[0];return n?n.charAt(0).toUpperCase()+n.slice(1):e}catch(i){return}},x=(i,e)=>{const n=((i,e)=>(null==i?void 0:i.payloadCitationId)||(null==e?void 0:e.payloadCitationId)||(null==e?void 0:e.citation_uuid)||"")(i,e)||("function"==typeof(null===(o=globalThis.crypto)||void 0===o?void 0:o.randomUUID)?globalThis.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const e=Math.floor(16*Math.random());return("x"===i?e:e%4+8).toString(16)}));var o;return i&&"object"==typeof i&&(i.payloadCitationId=n),e&&"object"==typeof e&&(e.payloadCitationId=n,e.citation_uuid||(e.citation_uuid=n)),n},g=({href:l,metaData:a,citationTitle:r,isFullscreen:s,secondaryCitation:g})=>{var h,f,m,b,y,C,j,_,w,F,T,I,D,S,P,k,M,U,W,z,R;const A=n.useMemo(()=>{var i;return null===(i=(Array.isArray(null==a?void 0:a.citations)?a.citations:[]).find(i=>`pdf_citation$${i.id}`===l))||void 0===i?void 0:i.data},[l,null==a?void 0:a.citations]),q=null!==(y=null===(b=null===(m=null===(f=null===(h=null==a?void 0:a.guidelinesData)||void 0===h?void 0:h.artifactData)||void 0===f?void 0:f.userStorySnapshot)||void 0===m?void 0:m[0])||void 0===b?void 0:b.value)&&void 0!==y?y:"",E=n.useMemo(()=>{const i=null==g?void 0:g.phraseToHighlight;if(!i)return q;const e=q.toLowerCase().indexOf(i.toLowerCase());return-1===e?q:[q.slice(0,e),'<mark style="background-color: #FEF08A; padding: 0 2px;">',q.slice(e,e+i.length),"</mark>",q.slice(e+i.length)].join("")},[q,null==g?void 0:g.phraseToHighlight]),B=n.useMemo(()=>{var i;const e=Array.isArray(null==a?void 0:a.gptCitations)?a.gptCitations:[],n=((i="")=>{const e=i.match(/gpt_citation\$(\d+)/i);return(null==e?void 0:e[1])||""})(null==g?void 0:g.href);if(!n)return null;const o=e.find(i=>String(null==i?void 0:i.id)===n),l=(null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.extraMetaData)||{},t=(i=>Object.keys(i||{}).sort((i,e)=>Number(i)-Number(e)))(l),r=t[Number((null==g?void 0:g.occurrenceIndex)||0)]||t[0];return r?l[r]:null},[null==a?void 0:a.gptCitations,null==g?void 0:g.href,null==g?void 0:g.occurrenceIndex]),G=(null===(w=null===(_=null===(j=null===(C=null==B?void 0:B.aiReasoningCitation)||void 0===C?void 0:C.gpt_citation)||void 0===j?void 0:j[0])||void 0===_?void 0:_.customMetaData)||void 0===w?void 0:w.value)||{},N=(null===(I=null===(T=null===(F=null==B?void 0:B.aiReasoningCitation)||void 0===F?void 0:F.gpt_citation)||void 0===T?void 0:T[0])||void 0===I?void 0:I.customMetaData)||{},L=n.useMemo(()=>x(B,G),[G,B]),[O,H]=n.useState(),[V,$]=n.useState("pending"),[X,J]=n.useState(!0),{apiCachingConfig:K,citationConfig:Q}=u.useRequirementAI(),{getGptWebCitation:Y,gptWebCitationPartialPayload:Z}=K||{},ii=(null===(D=null==Q?void 0:Q.gptWeb)||void 0===D?void 0:D.displayMode)||t.CitationType.GPT_WEB,ei=null===(S=null==g?void 0:g.href)||void 0===S?void 0:S.includes("gpt_citation"),ni=n.useMemo(()=>({...Z,citationId:L,citationUrl:null==G?void 0:G.citationUrl,content:(null==B?void 0:B.Reasoning)||(null==G?void 0:G.text),citationType:null==G?void 0:G.citationType,citatioNumber:Number((null==N?void 0:N.citation_number)||0)}),[Z,L,null==N?void 0:N.citation_number,null==G?void 0:G.citationType,null==G?void 0:G.citationUrl,null==G?void 0:G.text,null==B?void 0:B.Reasoning]),oi=n.useMemo(()=>({item:{confidence_score:Number((null==B?void 0:B.Confidence_score)||0),text:(null==G?void 0:G.paraphrase)||(null==g?void 0:g.title)||"Web citation reasoning",dataSource:(null==G?void 0:G.text)||(null==B?void 0:B.Reasoning)||"",paraphrase:(null==G?void 0:G.paraphrase)||""},headerTitle:(null==G?void 0:G.label)||"GPT Web Citation",index:Number((null==N?void 0:N.citation_number)||1)-1,iconsConfig:{ChevronDownIcon:e.ChevronDown,ChevronUpIcon:e.ChevronUp,MaximizeIcon:e.Maximize2,CloseIcon:e.X}}),[null==g?void 0:g.title,null==N?void 0:N.citation_number,null==G?void 0:G.label,null==G?void 0:G.paraphrase,null==G?void 0:G.text,null==B?void 0:B.Confidence_score,null==B?void 0:B.Reasoning]);if(n.useEffect(()=>{let i=!0;return(async()=>{var e,n;if(ei&&(null==G?void 0:G.citationUrl)&&ii!==t.CitationType.GPT&&(ii!==t.CitationType.GPT_WEB||X))if(Y){$("pending");try{const o=await Y(ni);if(!i)return;H(null!==(n=null!==(e=null==o?void 0:o.data)&&void 0!==e?e:null==o?void 0:o.responseData)&&void 0!==n?n:o),$("success")}catch(e){if(!i)return;$("error"),console.error("Failed to load GPT web citation",e)}}else $("error")})(),()=>{i=!1}},[Y,ni,ii,ei,null==G?void 0:G.citationUrl,X]),!A)return null;const li=(null===(P=null==a?void 0:a.docData)||void 0===P?void 0:P.documents)||{},ti=(null===(k=null==a?void 0:a.docData)||void 0===k?void 0:k.input_index_map)||{},ai=Object.values(ti).find(i=>{const e=null==li?void 0:li[i];return(null==A?void 0:A[i])&&("application/pdf"===(null==e?void 0:e.mime_type)||"base"===(null==e?void 0:e.role))}),ri=Object.keys(A).find(i=>{const e=null==li?void 0:li[i];return"application/pdf"===(null==e?void 0:e.mime_type)||"base"===(null==e?void 0:e.role)})||Object.keys(A)[0],di=ai||ri||(null==ti?void 0:ti[0]),ui=Object.values(ti).find(i=>i!==di),si=di?li[di]:null,ci=ui?li[ui]:null,vi=di?A[di]:null,pi=ui?A[ui]:null,xi="rulebook_citation"===((null===(M=null==g?void 0:g.type)||void 0===M?void 0:M.toLowerCase())||"")||Boolean(null==g?void 0:g.phraseToHighlight),gi=g?i.jsxs("div",{style:{height:"100%",overflow:"auto",padding:"16px",boxSizing:"border-box",backgroundColor:"#FFFFFF",color:"#101828",fontFamily:'"Inter", sans-serif',fontSize:"13px",lineHeight:1.6},children:[i.jsx("div",{style:{fontWeight:700,marginBottom:"8px"},children:xi?"Guideline Citation":"Web/GPT Citation"}),xi?i.jsx(i.Fragment,{children:i.jsx(d.Box,{sx:{padding:"0px 12px",backgroundColor:"#FFFFFF",overflow:"visible"},children:i.jsx(c.default,{rehypePlugins:[v.default],children:E})})}):ei?i.jsx(t.GptWebCitation,{gptCitation:oi,defaultCitationUrl:(null==G?void 0:G.citationUrl)||"",citationType:ii,webCitationData:O,sourceLabel:`Source: Web Citation > ${(null==G?void 0:G.paraphrase)||(null==G?void 0:G.label)||"Web Citation"}`,learnedFrom:p(null==G?void 0:G.citationUrl),showWebCitation:X,webCitationStatus:V,onGenerateWebCitation:()=>J(!0),onToggleCitationView:()=>J(i=>!i),showExpandImageButton:!0,showGptMaximizeButton:!0,iconsConfig:{MaximizeIcon:e.Maximize2,ExternalLinkIcon:e.ExternalLink},isFixedHeight:!1}):i.jsx("div",{children:"No secondary citation preview available."})]}):null;if(["Contract","clause"].includes(r)){const e=vi?i.jsx(t.PdfViewer,{pdfName:null==si?void 0:si.title,pdfUrl:null==si?void 0:si.signed_url,highlightText:[null!==(U=null==vi?void 0:vi.highlighted_text)&&void 0!==U?U:""],highlightPages:{1:null===(W=null==vi?void 0:vi.custom_metadata)||void 0===W?void 0:W.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1}):null,n=gi||(pi?i.jsx(t.PdfViewer,{pdfName:null==ci?void 0:ci.title,pdfUrl:null==ci?void 0:ci.signed_url,jumpToPageValue:1,highlightText:[null!==(z=null==pi?void 0:pi.highlighted_text)&&void 0!==z?z:""],highlightPages:{1:null===(R=null==pi?void 0:pi.custom_metadata)||void 0===R?void 0:R.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1}):null);return vi||pi||gi?i.jsx("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:i.jsx(o.default,{leftComponent:e,rightComponent:n,isFullscreen:s})}):i.jsx("div",{children:"Missing PDF Citation. Please try again later"})}return i.jsx("div",{children:"No Citation Found. Please try again later"})};exports.default=({href:o,children:t,metaData:a,secondaryCitation:r,chevronUpComponent:d=null,chevronDownComponent:u=null,customStyle:s={},defaultState:c=!1})=>{var v,p,x;const[h,f]=n.useState(c),[m,b]=n.useState(!1),y="string"==typeof t&&(null===(v=null==t?void 0:t.split("\n"))||void 0===v?void 0:v.length)>1?t.split("\n").join(" "):t,C="string"==typeof t?t:t[0],j=null!=d?d:(n=>{var o,l;return i.jsx(e.ChevronUp,{size:null!==(o=null==n?void 0:n.fontSize)&&void 0!==o?o:16,color:null!==(l=null==n?void 0:n.color)&&void 0!==l?l:"rgb(214, 51, 132)"})})(null!==(p=null==s?void 0:s.arrow)&&void 0!==p?p:{}),_=null!=u?u:(n=>{var o,l;return i.jsx(e.ChevronDown,{size:null!==(o=null==n?void 0:n.fontSize)&&void 0!==o?o:16,color:null!==(l=null==n?void 0:n.color)&&void 0!==l?l:"rgb(214, 51, 132)"})})(null!==(x=null==s?void 0:s.arrow)&&void 0!==x?x:{}),w=n.useMemo(()=>(Array.isArray(null==a?void 0:a.citations)?a.citations:[]).some(i=>`pdf_citation$${i.id}`===o),[o,null==a?void 0:a.citations]);return["contract","clause"].includes(C.toLowerCase())&&w?i.jsxs("span",{style:{display:"inline",...s.relativeWrapper||{}},children:[i.jsx("div",{style:{display:"inline",marginTop:0,...s.citationButtonWrapper||{}},children:i.jsxs("button",{type:"button",onClick:()=>f(i=>!i),style:{display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal",...s.citationButton||{}},children:[i.jsx("span",{children:y}),i.jsx("span",{style:{display:"flex",alignItems:"center"},children:h?j:_})]})}),h&&i.jsxs("div",{style:m?{position:"fixed",inset:0,zIndex:999999,backgroundColor:"#FAFAFA",display:"flex",flexDirection:"column"}:{boxSizing:"border-box",border:"1px solid #E4E7EC",borderRadius:"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%"},children:[i.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0},children:i.jsx("button",{onClick:()=>{b(i=>!i)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"},children:m?i.jsx(l.DefaultFullScreenCloseIcon,{}):i.jsx(l.DefaultFullScreenIcon,{})})}),i.jsx("div",{style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"},children:i.jsx(g,{href:o,children:t,metaData:a,citationTitle:C,isFullscreen:m,secondaryCitation:r})})]})]}):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("react/jsx-runtime"),e=require("lucide-react"),n=require("react"),o=require("./ResizableSplitPane.js"),t=require("../icons/PdfViewerIcons.js"),l=require("@e-llm-studio/citation"),a=require("react-markdown"),r=require("rehype-raw"),d=require("@mui/material"),u=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),s=require("../../../utils/helpers.js");function c(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var v=c(a),p=c(r);const x=i=>{if(i)try{const e=new URL(i).hostname.replace(/^www\./i,""),n=e.split(".")[0];return n?n.charAt(0).toUpperCase()+n.slice(1):e}catch(i){return}},g=(i,e)=>{const n=((i,e)=>(null==i?void 0:i.payloadCitationId)||(null==e?void 0:e.payloadCitationId)||(null==e?void 0:e.citation_uuid)||"")(i,e)||("function"==typeof(null===(o=globalThis.crypto)||void 0===o?void 0:o.randomUUID)?globalThis.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const e=Math.floor(16*Math.random());return("x"===i?e:e%4+8).toString(16)}));var o;return i&&"object"==typeof i&&(i.payloadCitationId=n),e&&"object"==typeof e&&(e.payloadCitationId=n,e.citation_uuid||(e.citation_uuid=n)),n},h=({href:t,metaData:a,citationTitle:r,isFullscreen:c,secondaryCitation:h})=>{var f,m,y,C,b,j,w,_,F,T,I,P,D,S,U,k;const M=n.useMemo(()=>{var i;return null===(i=(Array.isArray(null==a?void 0:a.citations)?a.citations:[]).find(i=>`pdf_citation$${i.id}`===t))||void 0===i?void 0:i.data},[t,null==a?void 0:a.citations]),W=(null==a?void 0:a.guidelinesData)||"",R=n.useMemo(()=>{const i=null==h?void 0:h.phraseToHighlight;if(!i)return W;const e=W.toLowerCase().indexOf(i.toLowerCase());return-1===e?W:[W.slice(0,e),'<mark style="background-color: #FEF08A; padding: 0 2px;">',W.slice(e,e+i.length),"</mark>",W.slice(e+i.length)].join("")},[W,null==h?void 0:h.phraseToHighlight]),z=n.useMemo(()=>{var i;const e=Array.isArray(null==a?void 0:a.gptCitations)?a.gptCitations:[],n=((i="")=>{if(!i||"string"!=typeof i||!i.trim())return"";const e=i.match(/gpt_citation\$(\d+)/i);return e&&e.length>=2?e[1]:""})(null==h?void 0:h.href);if(!n)return null;const o=e.find(i=>String(null==i?void 0:i.id)===n),t=(null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.extraMetaData)||{},l=(i=>Object.keys(i||{}).sort((i,e)=>Number(i)-Number(e)))(t),r=l[Number((null==h?void 0:h.occurrenceIndex)||0)]||l[0];return r?t[r]:null},[null==a?void 0:a.gptCitations,null==h?void 0:h.href,null==h?void 0:h.occurrenceIndex]),q=(null===(C=null===(y=null===(m=null===(f=null==z?void 0:z.aiReasoningCitation)||void 0===f?void 0:f.gpt_citation)||void 0===m?void 0:m[0])||void 0===y?void 0:y.customMetaData)||void 0===C?void 0:C.value)||{},A=(null===(w=null===(j=null===(b=null==z?void 0:z.aiReasoningCitation)||void 0===b?void 0:b.gpt_citation)||void 0===j?void 0:j[0])||void 0===w?void 0:w.customMetaData)||{},B=n.useMemo(()=>g(z,q),[q,z]),[E,G]=n.useState(),[N,L]=n.useState("pending"),[H,O]=n.useState(!0),{apiCachingConfig:V,citationConfig:$}=u.useRequirementAI(),{getGptWebCitation:Q,gptWebCitationPartialPayload:X}=V||{},J=(null===(_=null==$?void 0:$.gptWeb)||void 0===_?void 0:_.displayMode)||l.CitationType.GPT_WEB,K=null===(F=null==h?void 0:h.href)||void 0===F?void 0:F.includes("gpt_citation"),Y=(null==q?void 0:q.citationUrl)&&Q?J:l.CitationType.GPT,Z=n.useMemo(()=>({...X,citationId:B,citationUrl:null==q?void 0:q.citationUrl,content:(null==z?void 0:z.Reasoning)||(null==q?void 0:q.text),citationType:null==q?void 0:q.citationType,citationNumber:Number((null==A?void 0:A.citation_number)||0)}),[X,B,null==A?void 0:A.citation_number,null==q?void 0:q.citationType,null==q?void 0:q.citationUrl,null==q?void 0:q.text,null==z?void 0:z.Reasoning]),ii=n.useMemo(()=>({item:{confidence_score:Number((null==z?void 0:z.Confidence_score)||0),text:(null==q?void 0:q.paraphrase)||(null==h?void 0:h.title)||"Web citation reasoning",dataSource:(null==q?void 0:q.text)||(null==z?void 0:z.Reasoning)||"",paraphrase:(null==q?void 0:q.paraphrase)||""},headerTitle:(null==q?void 0:q.label)||"GPT Web Citation",index:Number((null==A?void 0:A.citation_number)||1)-1,iconsConfig:{ChevronDownIcon:e.ChevronDown,ChevronUpIcon:e.ChevronUp,MaximizeIcon:e.Maximize2,CloseIcon:e.X}}),[null==h?void 0:h.title,null==A?void 0:A.citation_number,null==q?void 0:q.label,null==q?void 0:q.paraphrase,null==q?void 0:q.text,null==z?void 0:z.Confidence_score,null==z?void 0:z.Reasoning]);if(n.useEffect(()=>{let i=!0;return(async()=>{var e,n;if(K&&(null==q?void 0:q.citationUrl)&&Y!==l.CitationType.GPT&&(Y!==l.CitationType.GPT_WEB||H))if(Q){L("pending");try{const o=await Q(Z);if(!i)return;G(null!==(n=null!==(e=null==o?void 0:o.data)&&void 0!==e?e:null==o?void 0:o.responseData)&&void 0!==n?n:o),L("success")}catch(e){if(!i)return;L("error"),console.error("Failed to load GPT web citation",e)}}else L("error")})(),()=>{i=!1}},[Q,Y,Z,K,null==q?void 0:q.citationUrl,H]),!M)return null;const ei=(null===(T=null==a?void 0:a.docData)||void 0===T?void 0:T.documents)||{},ni=(null===(I=null==a?void 0:a.docData)||void 0===I?void 0:I.input_index_map)||{},oi=Object.values(ni).find(i=>{const e=null==ei?void 0:ei[i];return(null==M?void 0:M[i])&&("application/pdf"===(null==e?void 0:e.mime_type)||"base"===(null==e?void 0:e.role))}),ti=Object.keys(M).find(i=>{const e=null==ei?void 0:ei[i];return"application/pdf"===(null==e?void 0:e.mime_type)||"base"===(null==e?void 0:e.role)})||Object.keys(M)[0],li=oi||ti||(null==ni?void 0:ni[0]),ai=Object.values(ni).find(i=>i!==li),ri=li?ei[li]:null,di=ai?ei[ai]:null,ui=li?M[li]:null,si=ai?M[ai]:null,ci=(null===(P=null==h?void 0:h.type)||void 0===P?void 0:P.toLowerCase())||"",vi=s.getHrefQueryParam(null==h?void 0:h.href,"citation_type").toLowerCase(),pi=s.guidelineCitationTypes.includes(ci)||s.guidelineCitationTypes.includes(vi)||Boolean(null==h?void 0:h.phraseToHighlight),xi=Boolean(z&&((null==q?void 0:q.citationUrl)||(null==q?void 0:q.text)||(null==z?void 0:z.Reasoning))),gi=Boolean(K&&xi),hi=Boolean(pi&&W),fi=h&&(pi?hi:gi)?i.jsxs("div",{style:{height:"100%",overflow:"auto",padding:"16px",boxSizing:"border-box",backgroundColor:"#FFFFFF",color:"#101828",fontFamily:'"Inter", sans-serif',fontSize:"13px",lineHeight:1.6},children:[i.jsx("div",{style:{fontWeight:700,marginBottom:"8px"},children:pi?"Guideline Citation":"Web/GPT Citation"}),pi?i.jsx(i.Fragment,{children:i.jsx(d.Box,{sx:{padding:"0px 12px",backgroundColor:"#FFFFFF",overflow:"visible"},children:i.jsx(v.default,{rehypePlugins:[p.default],children:R})})}):K?i.jsx(l.GptWebCitation,{gptCitation:ii,defaultCitationUrl:(null==q?void 0:q.citationUrl)||"",citationType:Y,webCitationData:E,sourceLabel:`Source: Web Citation > ${(null==q?void 0:q.paraphrase)||(null==q?void 0:q.label)||"Web Citation"}`,learnedFrom:x(null==q?void 0:q.citationUrl),showWebCitation:H,webCitationStatus:N,onGenerateWebCitation:()=>O(!0),onToggleCitationView:()=>O(i=>!i),showExpandImageButton:!0,showGptMaximizeButton:!0,iconsConfig:{MaximizeIcon:e.Maximize2,ExternalLinkIcon:e.ExternalLink},isFixedHeight:!1}):i.jsx("div",{children:"No secondary citation preview available."})]}):null;if(["Contract","clause"].includes(r)){const e=ui?i.jsx(l.PdfViewer,{pdfName:null==ri?void 0:ri.title,pdfUrl:null==ri?void 0:ri.signed_url,highlightText:[null!==(D=null==ui?void 0:ui.highlighted_text)&&void 0!==D?D:""],highlightPages:{1:null===(S=null==ui?void 0:ui.custom_metadata)||void 0===S?void 0:S.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1}):null,n=fi||(si?i.jsx(l.PdfViewer,{pdfName:null==di?void 0:di.title,pdfUrl:null==di?void 0:di.signed_url,jumpToPageValue:1,highlightText:[null!==(U=null==si?void 0:si.highlighted_text)&&void 0!==U?U:""],highlightPages:{1:null===(k=null==si?void 0:si.custom_metadata)||void 0===k?void 0:k.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1}):null);return ui||si||fi?i.jsx("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:i.jsx(o.default,{leftComponent:e,rightComponent:n,isFullscreen:c})}):i.jsx("div",{children:"Missing PDF Citation. Please try again later"})}return i.jsx("div",{children:"No Citation Found. Please try again later"})};exports.default=({href:o,children:l,metaData:a,secondaryCitation:r,chevronUpComponent:d=null,chevronDownComponent:u=null,customStyle:s={},defaultState:c=!1})=>{var v,p,x;const[g,f]=n.useState(c),[m,y]=n.useState(!1),C="string"==typeof l&&(null===(v=null==l?void 0:l.split("\n"))||void 0===v?void 0:v.length)>1?l.split("\n").join(" "):l,b="string"==typeof l?l:l[0],j=null!=d?d:(n=>{var o,t;return i.jsx(e.ChevronUp,{size:null!==(o=null==n?void 0:n.fontSize)&&void 0!==o?o:16,color:null!==(t=null==n?void 0:n.color)&&void 0!==t?t:"rgb(214, 51, 132)"})})(null!==(p=null==s?void 0:s.arrow)&&void 0!==p?p:{}),w=null!=u?u:(n=>{var o,t;return i.jsx(e.ChevronDown,{size:null!==(o=null==n?void 0:n.fontSize)&&void 0!==o?o:16,color:null!==(t=null==n?void 0:n.color)&&void 0!==t?t:"rgb(214, 51, 132)"})})(null!==(x=null==s?void 0:s.arrow)&&void 0!==x?x:{}),_=n.useMemo(()=>(Array.isArray(null==a?void 0:a.citations)?a.citations:[]).some(i=>`pdf_citation$${i.id}`===o),[o,null==a?void 0:a.citations]);return["contract","clause"].includes(b.toLowerCase())&&_?i.jsxs("span",{style:{display:"inline",...s.relativeWrapper||{}},children:[i.jsx("div",{style:{display:"inline",marginTop:0,...s.citationButtonWrapper||{}},children:i.jsxs("button",{type:"button",onClick:()=>f(i=>!i),style:{display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal",...s.citationButton||{}},children:[i.jsx("span",{children:C}),i.jsx("span",{style:{display:"flex",alignItems:"center"},children:g?j:w})]})}),g&&i.jsxs("div",{style:m?{position:"fixed",inset:0,zIndex:999999,backgroundColor:"#FAFAFA",display:"flex",flexDirection:"column"}:{boxSizing:"border-box",border:"1px solid #E4E7EC",borderRadius:"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%"},children:[i.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0},children:i.jsx("button",{onClick:()=>{y(i=>!i)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"},children:m?i.jsx(t.DefaultFullScreenCloseIcon,{}):i.jsx(t.DefaultFullScreenIcon,{})})}),i.jsx("div",{style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"},children:i.jsx(h,{href:o,children:l,metaData:a,citationTitle:b,isFullscreen:m,secondaryCitation:r})})]})]}):null};
2
2
  //# sourceMappingURL=CitationAnchor.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),t=require("../Popups/PopupDefaults.js"),i=require("react-markdown"),n=require("rehype-raw"),c=require("./CitationComponent.module.css.js"),l=require("lucide-react"),s=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),d=require("./CitationAnchor.js"),o=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),u=require("../../../../../service/redlineService.js"),m=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),p=require("../cws/CwsEvent.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=x(a),f=x(i),v=x(n);const _=(e="")=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),g=(e,a)=>{const t=e.match(new RegExp(`${a}=(["'])(.*?)\\1`,"i"));return(null==t?void 0:t[2])||""},j=(e,a)=>{const t=[...e.matchAll(/<a\b((?:[^>"']|"[^"]*"|'[^']*')*)>([\s\S]*?)<\/a>/gi)].map(e=>{var a;return{fullMatch:e[0],attributes:e[1],label:e[2],index:null!==(a=e.index)&&void 0!==a?a:0}}),i=t.find(e=>{return a=e.attributes,g(a,"href").startsWith("pdf_citation$");var a}),n=t.find(e=>{return a=e.attributes,g(a,"href").includes("gpt_citation")||a.includes("phrase_to_highlight=");var a});if(!i||!n)return e;const c=((e,a,t,i,n)=>{const c=g(t,"href"),l=g(t,"type")||(c.includes("gpt_citation")?"gpt_citation":""),s=g(t,"reason"),r=c.split("?")[1]||"",d=r&&new URLSearchParams(r).get("phrase_to_highlight")||"",o=c.includes("gpt_citation")&&void 0!==n?` data-secondary-occurrence-index="${n}"`:"";return`<a${e} data-dual-citation="true" data-secondary-href="${_(c)}" data-secondary-type="${_(l)}" data-secondary-title="${_(i)}" data-secondary-reason="${_(s)}" data-secondary-phrase-to-highlight="${_(d)}"${o}>${a}</a>`})(i.attributes,i.label,n.attributes,n.label,g(n.attributes,"href").includes("gpt_citation")?a():void 0),l=(n.index>i.index?e.slice(i.index+i.fullMatch.length,n.index):e.slice(n.index+n.fullMatch.length,i.index)).trim()?n.label:"";return e.replace(i.fullMatch,c).replace(n.fullMatch,l)},y=(e,a)=>{var t,i;const n=a.replace(/-([a-z])/g,(e,a)=>a.toUpperCase());return null!==(i=null!==(t=null==e?void 0:e[a])&&void 0!==t?t:null==e?void 0:e[n])&&void 0!==i?i:""},N=({text:t,item:i})=>{const n=a.useMemo(()=>(e=>{let a=0;const t=()=>a++;return e.split("\n").map(e=>j(e,t)).join("\n")})(t),[t]);return e.jsx(f.default,{rehypePlugins:[v.default],components:{ol:({children:a})=>e.jsx("ol",{className:c.default["md-ol"],children:a}),ul:({children:a})=>e.jsx("ul",{className:c.default["md-ul"],children:a}),li:({children:a})=>e.jsx("li",{className:c.default["md-li"],children:a}),a:({node:a,href:t,children:n})=>{const c=(null==a?void 0:a.properties)||{},l=y(c,"data-secondary-href");return e.jsx(d.default,{href:t,children:n,secondaryCitation:l?{href:l,title:y(c,"data-secondary-title"),type:y(c,"data-secondary-type"),reason:y(c,"data-secondary-reason"),phraseToHighlight:y(c,"data-secondary-phrase-to-highlight"),occurrenceIndex:Number(y(c,"data-secondary-occurrence-index")||0)}:void 0,metaData:{citations:i.citations,docData:i.docData,guidelinesData:i.guidelinesData,gptCitations:i.gptCitations}})}},children:n.replace(/<br\s*\/?>/gi,"\n")})},b=({text:a,markdownStyles:t,citationStyles:i,customIcons:n})=>e.jsx(o.AiReasonMarkdownWrapper,{message:a.replace(/<br\s*\/?>/gi,"\n"),customStyles:t,citationStyles:i,customIcons:n}),I=(e,a)=>e.disableAllActions===a.disableAllActions&&(e.redlineId===a.redlineId&&(e.aiReasonId===a.aiReasonId&&(e.relevanceScore===a.relevanceScore&&(e.reason===a.reason&&(e.impact===a.impact&&(e.explaination===a.explaination&&e.gap===a.gap)))))),C=a.memo(function({item:i,title:n="Cognitive Decisioning AI",relevanceScore:d=0,showRelevanceScore:o=!0,reason:u="No reasoning provided.",impact:m="No Impact provided.",explaination:p="No explaination provided.",gap:x="None",onClose:f=()=>{},showResolveBtns:v=!1,sections:_,leftIcon:g,scoreIcon:j,className:y,customStyles:I={},markdownStyles:C,citationStyles:R,customIcons:A,actions:k,disableAllActions:$=!1,actionBtnDisabledStyle:D={},onBackClick:S,isImpactNeeded:q=!0,cognitiveTitle:w="Cognitive Integrity",labels:M={},chatHistory:T,resolveRedlineAction:H}){const B=a.useMemo(()=>{const e=Number(d);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[d]),P=a.useMemo(()=>{const e=M&&M.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a})(x)?e:x},[x]),L=M&&M.impact||"Impact",E=M&&M.explanation||"Explaination",U=M&&M.decisionFactors||"Decision Making Factors",W=M&&M.gaps||"Gaps in Decision",F=M&&M.accept||"Accept",G=M&&M.reject||"Reject",z=M&&M.backAriaLabel||"Go back",O=k||[{id:"reject",label:G,onClick:()=>H("reject"),className:c.default["btn-reject"]},{id:"accept",label:F,onClick:()=>H("accept"),className:c.default["btn-accept"]}],J=T&&T.length>0;return e.jsxs("div",{className:`${c.default["cite-acc"]} ${y||""}`,style:{...t.default.CitationAccordionDefaults.container,...null==I?void 0:I.container},children:[S&&e.jsxs("div",{className:c.default["cite-acc__backHeader"],children:[e.jsx("button",{type:"button",className:c.default["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),S&&S()},"aria-label":z,children:"‹"}),e.jsx("span",{className:c.default["cite-acc__backTitle"],children:w})]}),e.jsx("div",{className:c.default["cite-body"],children:_&&_.length>0?_.map(a=>!1===a.show?null:e.jsxs("div",{className:`${c.default["cite-acc__explain-body"]} ${a.bodyClassName||""}`,children:[e.jsxs("div",{className:c.default["cite-acc__innerHeader"],style:{...t.default.CitationAccordionDefaults.innerHeader,...null==I?void 0:I.innerHeader},children:[e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:a.title})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),f&&f()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...t.default.CitationAccordionDefaults.innerBody,...null==I?void 0:I.innerBody},children:"string"==typeof a.content?e.jsx(N,{text:a.content,item:a.item||i||{}}):a.content})]},a.id||a.title)):e.jsxs(e.Fragment,{children:[q&&e.jsxs("div",{className:c.default["cite-acc__explain-body"],children:[e.jsxs("div",{className:c.default["cite-acc__innerHeader"],children:[e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:L})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),f&&f()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(N,{text:m||"",item:i||{}})})]}),p&&"No explaination provided."!==p&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:c.default["cite-acc__explain-body"],children:[e.jsx("div",{className:c.default["cite-acc__innerHeader"],children:e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:E})})})}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(N,{text:p||"",item:{}})})]}),e.jsx("div",{style:{borderTop:"1px solid #e5e7eb",margin:"12px 0"}}),v&&e.jsx("div",{className:c.default["cite-acc__btn-container"],children:O.map(a=>{const t=$||a.disabled;return e.jsx("button",{className:a.className,onClick:t?void 0:a.onClick,disabled:t,style:{...a.style,...t?{opacity:.5,cursor:"not-allowed",...D,...a.disabledStyle}:{}},children:a.label},a.id)})})]}),e.jsxs("div",{className:c.default["cite-acc__header"],children:[e.jsxs("div",{className:c.default["cite-acc__headerLeft"],children:[e.jsx("span",{className:c.default["cite-acc__titleIcon"],children:g?"function"==typeof g?h.default.createElement(g):g:e.jsx(s.ReactComponent,{})}),e.jsx("div",{className:c.default["cite-acc__title"],children:n})]}),e.jsx("div",{className:c.default["cite-acc__headerRight"],children:o&&e.jsxs("span",{className:c.default["cite-acc__scoreBadge"],children:[j?"function"==typeof j?h.default.createElement(j):j:e.jsx(r.ReactComponent,{}),e.jsxs("span",{className:c.default["cite-acc__scoreText"],children:[B,"%"]})]})})]}),e.jsxs("div",{className:c.default["cite-acc__explain-body"],children:[e.jsx("div",{className:c.default["cite-acc__innerHeader"],children:e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:U})})})}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:J?e.jsx(b,{text:u||"",markdownStyles:C,citationStyles:R,customIcons:A}):e.jsx(N,{text:u||"",item:i||{}})})]}),e.jsxs("div",{className:`${c.default["cite-acc__explain-body"]} ${c.default["cite-acc__explain-body_border"]}`,children:[e.jsx("div",{className:c.default["cite-acc__innerHeader"],children:e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:W})})})}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:J?e.jsx(b,{text:P||"",markdownStyles:C,citationStyles:R,customIcons:A}):e.jsx(N,{text:P||"",item:i||{}})})]})]})})]})},I);var R=a.memo(function(t){const{redlineDcoumentId:i,redlineConfig:n,updateRedlineDataParent:c}=m.useRequirementAI(),l=a.useRef({redlineDcoumentId:i,redlineConfig:n,updateRedlineDataParent:c}),s=a.useRef({onActionTrigger:t.onActionTrigger,redlineId:t.redlineId,aiReasonId:t.aiReasonId});l.current={redlineDcoumentId:i,redlineConfig:n,updateRedlineDataParent:c},s.current={onActionTrigger:t.onActionTrigger,redlineId:t.redlineId,aiReasonId:t.aiReasonId};const r=a.useCallback(async e=>{var a,t,i,n,c,r;const{redlineDcoumentId:d,redlineConfig:o,updateRedlineDataParent:m}=l.current,{onActionTrigger:x,redlineId:h,aiReasonId:f}=s.current;null==x||x({status:"loading",action:e,metadata:{redlineId:h,aiReasonId:f}});try{const{updated_reqai:l}=await u.resolveRedline({documentId:d,userEmail:null==o?void 0:o.userEmail,userName:null==o?void 0:o.userName,redlineId:null!=h?h:"",action:e,baseApiUrl:null==o?void 0:o.baseApiUrl,redlineConfigId:null!==(a=null==o?void 0:o.redlineConfigId)&&void 0!==a?a:""},null!==(t=null==o?void 0:o.token)&&void 0!==t?t:"");await(null==m?void 0:m(l)),null===(i=p.default.emit)||void 0===i||i.call(p.default,`redline-edit:${d}:${null===(r=null===(c=null===(n=null==l?void 0:l.artifactData)||void 0===n?void 0:n.userStorySnapshot)||void 0===c?void 0:c[0])||void 0===r?void 0:r.artifactId}`,{updatedBy:null==o?void 0:o.userName}),null==x||x({status:"success",action:e,metadata:{redlineId:h,aiReasonId:f}})}catch(a){null==x||x({status:"failed",action:e,metadata:{redlineId:h,aiReasonId:f}})}},[]);return e.jsx(C,{...t,resolveRedlineAction:r})},I);exports.default=R;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("../Popups/PopupDefaults.js"),i=require("react-markdown"),n=require("rehype-raw"),c=require("./CitationComponent.module.css.js"),l=require("lucide-react"),s=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),d=require("./CitationAnchor.js"),o=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),u=require("../../../../../service/redlineService.js"),m=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),p=require("../cws/CwsEvent.js"),x=require("../../../utils/helpers.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=h(t),v=h(i),g=h(n);const _=(e="")=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),j=(e,t)=>{try{const a=e.match(new RegExp(`${t}=(["'])([\\s\\S]*?)\\1(?=\\s+[\\w:-]+=|\\s*$)`,"i"));return a&&a.length>=3&&a[2]||""}catch(e){return console.error("Regex matching failed in getAnchorAttribute",e),""}},y=(e,t)=>j(t,"type")||x.getHrefQueryParam(e,"citation_type")||(e.includes("gpt_citation")?"gpt_citation":""),N=(e,t)=>{let a=[];try{a=(e=>{const t=[],a=/<a\b/gi;let i;for(;null!==(i=a.exec(e));){const n=i.index,c=e.indexOf("</a>",a.lastIndex);if(-1===c)break;const l=e.slice(n+2,c),s=l.lastIndexOf(">");-1!==s?(t.push({fullMatch:e.slice(n,c+4),attributes:l.slice(0,s),label:l.slice(s+1),index:n}),a.lastIndex=c+4):a.lastIndex=c+4}return t})(e)}catch(t){return console.error("Failed to parse anchors in line",t),e}const i=a.find(e=>{return t=e.attributes,j(t,"href").startsWith("pdf_citation$");var t}),n=a.find(e=>(e=>{const t=j(e,"href"),a=y(t,e).toLowerCase();return t.includes("gpt_citation")||x.guidelineCitationTypes.includes(a)||e.includes("phrase_to_highlight=")})(e.attributes));if(!i||!n)return e;const c=((e,t,a,i,n)=>{const c=j(a,"href"),l=y(c,a),s=j(a,"reason"),r=x.getHrefQueryParam(c,"phrase_to_highlight"),d=c.includes("gpt_citation")&&void 0!==n?` data-secondary-occurrence-index="${n}"`:"";return`<a${e} data-dual-citation="true" data-secondary-href="${_(c)}" data-secondary-type="${_(l)}" data-secondary-title="${_(i)}" data-secondary-reason="${_(s)}" data-secondary-phrase-to-highlight="${_(r)}"${d}>${t}</a>`})(i.attributes,i.label,n.attributes,n.label,j(n.attributes,"href").includes("gpt_citation")?t():void 0),l=(n.index>i.index?e.slice(i.index+i.fullMatch.length,n.index):e.slice(n.index+n.fullMatch.length,i.index)).trim()?n.label:"";return e.replace(i.fullMatch,c).replace(n.fullMatch,l)},b=(e,t)=>{var a,i;let n=t;try{n=t.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}catch(e){console.error("String replacement failed in getDataAttribute",e)}return null!==(i=null!==(a=null==e?void 0:e[t])&&void 0!==a?a:null==e?void 0:e[n])&&void 0!==i?i:""},I=({text:a,item:i})=>{const n=t.useMemo(()=>(e=>{let t=0;const a=()=>t++;return e.split("\n").map(e=>N(e,a)).join("\n")})(a),[a]);return e.jsx(v.default,{rehypePlugins:[g.default],components:{ol:({children:t})=>e.jsx("ol",{className:c.default["md-ol"],children:t}),ul:({children:t})=>e.jsx("ul",{className:c.default["md-ul"],children:t}),li:({children:t})=>e.jsx("li",{className:c.default["md-li"],children:t}),a:({node:t,href:a,children:n})=>{const c=(null==t?void 0:t.properties)||{},l=b(c,"data-secondary-href");return e.jsx(d.default,{href:a,children:n,secondaryCitation:l?{href:l,title:b(c,"data-secondary-title"),type:b(c,"data-secondary-type"),reason:b(c,"data-secondary-reason"),phraseToHighlight:b(c,"data-secondary-phrase-to-highlight"),occurrenceIndex:Number(b(c,"data-secondary-occurrence-index")||0)}:void 0,metaData:{citations:i.citations,docData:i.docData,guidelinesData:i.guidelinesData,gptCitations:i.gptCitations}})}},children:n.replace(/<br\s*\/?>/gi,"\n")})},C=({text:t,markdownStyles:a,citationStyles:i,customIcons:n})=>e.jsx(o.AiReasonMarkdownWrapper,{message:t.replace(/<br\s*\/?>/gi,"\n"),customStyles:a,citationStyles:i,customIcons:n}),R=(e,t)=>{return e.disableAllActions===t.disableAllActions&&(e.redlineId===t.redlineId&&(e.aiReasonId===t.aiReasonId&&(e.relevanceScore===t.relevanceScore&&(e.reason===t.reason&&(e.impact===t.impact&&(e.explaination===t.explaination&&(e.gap===t.gap&&(a=e.item,i=t.item,a===i||(a&&i?a.citations===i.citations&&a.guidelinesData===i.guidelinesData&&a.docData===i.docData&&(null===(n=a.docData)||void 0===n?void 0:n.input_index_map)===(null===(c=i.docData)||void 0===c?void 0:c.input_index_map)&&(null===(l=a.docData)||void 0===l?void 0:l.documents)===(null===(s=i.docData)||void 0===s?void 0:s.documents):a===i)))))))));var a,i,n,c,l,s},D=t.memo(function({item:i,title:n="Cognitive Decisioning AI",relevanceScore:d=0,showRelevanceScore:o=!0,reason:u="No reasoning provided.",impact:m="No Impact provided.",explaination:p="No explaination provided.",gap:x="None",onClose:h=()=>{},showResolveBtns:v=!1,sections:g,leftIcon:_,scoreIcon:j,className:y,customStyles:N={},markdownStyles:b,citationStyles:R,customIcons:D,actions:A,disableAllActions:k=!1,actionBtnDisabledStyle:$={},onBackClick:w,isImpactNeeded:S=!0,cognitiveTitle:q="Cognitive Integrity",labels:H={},chatHistory:T,resolveRedlineAction:M}){const B=t.useMemo(()=>{const e=Number(d);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[d]),P=t.useMemo(()=>{const e=H&&H.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const t=e.trim().toLowerCase();return"none"===t||"no gap"===t||"no gaps"===t||"n/a"===t})(x)?e:x},[x]),L=H&&H.impact||"Impact",E=H&&H.explanation||"Explaination",F=H&&H.decisionFactors||"Decision Making Factors",U=H&&H.gaps||"Gaps in Decision",W=H&&H.accept||"Accept",G=H&&H.reject||"Reject",O=H&&H.backAriaLabel||"Go back",Q=A||[{id:"reject",label:G,onClick:()=>M("reject"),className:c.default["btn-reject"]},{id:"accept",label:W,onClick:()=>M("accept"),className:c.default["btn-accept"]}],z=T&&T.length>0;return e.jsxs("div",{className:`${c.default["cite-acc"]} ${y||""}`,style:{...a.default.CitationAccordionDefaults.container,...null==N?void 0:N.container},children:[w&&e.jsxs("div",{className:c.default["cite-acc__backHeader"],children:[e.jsx("button",{type:"button",className:c.default["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),w&&w()},"aria-label":O,children:"‹"}),e.jsx("span",{className:c.default["cite-acc__backTitle"],children:q})]}),e.jsx("div",{className:c.default["cite-body"],children:g&&g.length>0?g.map(t=>!1===t.show?null:e.jsxs("div",{className:`${c.default["cite-acc__explain-body"]} ${t.bodyClassName||""}`,children:[e.jsxs("div",{className:c.default["cite-acc__innerHeader"],style:{...a.default.CitationAccordionDefaults.innerHeader,...null==N?void 0:N.innerHeader},children:[e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:t.title})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),h&&h()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...a.default.CitationAccordionDefaults.innerBody,...null==N?void 0:N.innerBody},children:"string"==typeof t.content?e.jsx(I,{text:t.content,item:t.item||i||{}}):t.content})]},t.id||t.title)):e.jsxs(e.Fragment,{children:[S&&e.jsxs("div",{className:c.default["cite-acc__explain-body"],children:[e.jsxs("div",{className:c.default["cite-acc__innerHeader"],children:[e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:L})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),h&&h()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(I,{text:m||"",item:i||{}})})]}),p&&"No explaination provided."!==p&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:c.default["cite-acc__explain-body"],children:[e.jsx("div",{className:c.default["cite-acc__innerHeader"],children:e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:E})})})}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(I,{text:p||"",item:{}})})]}),e.jsx("div",{style:{borderTop:"1px solid #e5e7eb",margin:"12px 0"}}),v&&e.jsx("div",{className:c.default["cite-acc__btn-container"],children:Q.map(t=>{const a=k||t.disabled;return e.jsx("button",{className:t.className,onClick:a?void 0:t.onClick,disabled:a,style:{...t.style,...a?{opacity:.5,cursor:"not-allowed",...$,...t.disabledStyle}:{}},children:t.label},t.id)})})]}),e.jsxs("div",{className:c.default["cite-acc__header"],children:[e.jsxs("div",{className:c.default["cite-acc__headerLeft"],children:[e.jsx("span",{className:c.default["cite-acc__titleIcon"],children:_?"function"==typeof _?f.default.createElement(_):_:e.jsx(s.ReactComponent,{})}),e.jsx("div",{className:c.default["cite-acc__title"],children:n})]}),e.jsx("div",{className:c.default["cite-acc__headerRight"],children:o&&e.jsxs("span",{className:c.default["cite-acc__scoreBadge"],children:[j?"function"==typeof j?f.default.createElement(j):j:e.jsx(r.ReactComponent,{}),e.jsxs("span",{className:c.default["cite-acc__scoreText"],children:[B,"%"]})]})})]}),e.jsxs("div",{className:c.default["cite-acc__explain-body"],children:[e.jsx("div",{className:c.default["cite-acc__innerHeader"],children:e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:F})})})}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:z?e.jsx(C,{text:u||"",markdownStyles:b,citationStyles:R,customIcons:D}):e.jsx(I,{text:u||"",item:i||{}})})]}),e.jsxs("div",{className:`${c.default["cite-acc__explain-body"]} ${c.default["cite-acc__explain-body_border"]}`,children:[e.jsx("div",{className:c.default["cite-acc__innerHeader"],children:e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:U})})})}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:z?e.jsx(C,{text:P||"",markdownStyles:b,citationStyles:R,customIcons:D}):e.jsx(I,{text:P||"",item:i||{}})})]})]})})]})},R);var A=t.memo(function(a){const{redlineDcoumentId:i,redlineConfig:n,updateRedlineDataParent:c}=m.useRequirementAI(),l=t.useRef({redlineDcoumentId:i,redlineConfig:n,updateRedlineDataParent:c}),s=t.useRef({onActionTrigger:a.onActionTrigger,redlineId:a.redlineId,aiReasonId:a.aiReasonId});l.current={redlineDcoumentId:i,redlineConfig:n,updateRedlineDataParent:c},s.current={onActionTrigger:a.onActionTrigger,redlineId:a.redlineId,aiReasonId:a.aiReasonId};const r=t.useCallback(async e=>{var t,a,c,r,d;const{redlineDcoumentId:o,redlineConfig:m,updateRedlineDataParent:x}=l.current,{onActionTrigger:h,redlineId:f,aiReasonId:v}=s.current;try{await(null==h?void 0:h({status:"loading",action:e,metadata:{redlineId:f,aiReasonId:v}}))}catch(e){}if(null==n?void 0:n.callResolveRedline)try{const{updated_reqai:l}=await u.resolveRedline({documentId:o,userEmail:null==m?void 0:m.userEmail,userName:null==m?void 0:m.userName,redlineId:null!=f?f:"",action:e,baseApiUrl:null==m?void 0:m.baseApiUrl,redlineConfigId:null!==(t=null==m?void 0:m.redlineConfigId)&&void 0!==t?t:""},null!==(a=null==m?void 0:m.token)&&void 0!==a?a:"");await(null==x?void 0:x(l));const s=null===(d=null===(r=null===(c=null==l?void 0:l.artifactData)||void 0===c?void 0:c.userStorySnapshot)||void 0===r?void 0:r[0])||void 0===d?void 0:d.artifactId;"string"==typeof s&&s.trim()&&"string"==typeof i&&i.trim()&&"string"==typeof(null==n?void 0:n.userName)&&(null==n?void 0:n.userName.trim())?p.default.emit(`redline-edit:${i}:${s}`,{updatedBy:null==n?void 0:n.userName}):console.error("invalid cwsEvent name or payload"),null==h||h({status:"success",action:e,metadata:{redlineId:f,aiReasonId:v}})}catch(t){null==h||h({status:"failed",action:e,metadata:{redlineId:f,aiReasonId:v}})}},[]);return e.jsx(D,{...a,resolveRedlineAction:r})},R);exports.default=A;
2
2
  //# sourceMappingURL=CognitiveComponent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),t=require("react"),n=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var o=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),r=require("@mui/material"),s=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../../../../../service/redlineService.js"),a=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),c=require("../cws/CwsEvent.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=p(t);const g=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],u=({toneIndex:i,configs:t=g})=>{const n=Math.min(i,t.length-1),{color:o,angle:l,arcD:r}=t[n]||t[1]||t[0],s=(l-90)*Math.PI/180,d=11+9*Math.cos(s),a=13+9*Math.sin(s);return e.jsxs("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:r,stroke:o,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:"11",y1:"13",x2:d,y2:a,stroke:o,strokeWidth:"2",strokeLinecap:"round"})]})},v=({type:i,customStyles:t={}})=>{const n={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...t},o=n[i]||n.Medium;return e.jsx("div",{style:o,children:i})},h=["Lenient","Balanced","Aggressive"],m={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},y={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},f={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},j={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},w={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},S={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},b={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},C={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},k={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},I={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},T={display:"flex",gap:8,marginBottom:18},B={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},A={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},E={borderTop:"0.5px solid #eee",padding:"14px 0px"},R={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},W={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},D={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},F={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},z={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},L={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},M={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},H={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},_={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0},q=t.memo(function({onAssignClick:i,onOpenCognitive:t,cognitiveIconSmall:n,cognitiveTootipTitle:o,historyIconSmall:l,onHistoryClick:r,historyTootipTitle:s}){const d="20px";return e.jsxs("div",{style:{..._,minWidth:"200px"},children:[e.jsxs("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:i,children:[e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"})]})}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),t&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>t(e),children:[n&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:n}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),r&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>r(e),children:[l&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:l}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s})]})]})}),O=t.memo(function({onAssignClick:i,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d}){const[a,c]=t.useState(!1);return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsx("button",{onClick:()=>c(!a),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),a&&e.jsx(q,{onAssignClick:i?()=>{c(!1),i&&i()}:void 0,onOpenCognitive:n?e=>{c(!1),n&&n(e)}:void 0,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d})]})}),N=t.memo(function({users:i,onClick:t}){const n=i.length;return e.jsxs("div",{onClick:t,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e.jsx("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==i?void 0:i[0].length)>9?(null==i?void 0:i[0].slice(0,9))+"...":null==i?void 0:i[0]}),n>1&&e.jsxs("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",n-1]})]})}),P=t.memo(function({steps:i}){if(!(null==i?void 0:i.length))return null;const t=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:t?"6px 8px":"8px 10px",background:"#F8FAFC",gap:t?4:8,overflow:"hidden"},children:i.map((n,o)=>{const l=(e=>{const i=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return i[e%i.length]})(o),r=o===i.length-1;return e.jsxs(x.default.Fragment,{children:[e.jsxs("div",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:t?4:6,overflow:"hidden"},children:[(s=n.status,"approved"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#F59E0B",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:t?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:t?20:22,height:t?20:22,minWidth:t?20:22,borderRadius:"50%",background:l.bg,color:l.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:t?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!r&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"18",height:t?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:t?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var s})})})});var $=t.memo(function({onClose:p,aiReason:x,onActionTrigger:_,onIterate:q,initialTone:$,onRegenerate:V,labels:U={},toneLevelsConfig:G=h,toneColorsConfig:K=m,dialConfigs:X=g,actions:J,disableAllActions:Q=!1,customStyles:Y={},severityChipStyles:Z={},customIcons:ee={},onOpenCognitive:ie,onHistoryClick:te,historyIconSmall:ne,historyTootipTitle:oe,showTone:le=!0,cognitiveSectionStyle:re={},cognitiveScoreBadgeStyle:se={},cognitiveScoreTextStyle:de={},cognitiveStyles:ae={},cognitiveClassNames:ce={},cognitiveTitle:pe="Cognitive Integrity",cognitiveTootipTitle:xe="Cognitive Decisioning",cognitiveLeftIcon:ge,cognitiveIconSmall:ue,showCognitiveRightArrow:ve=!0,isStreaming:he,onAssignClick:me,assignedUsers:ye,onReviewUsersClick:fe,redlineId:je,aiReasonId:we,displayVariant:Se="default",reviewTitle:be,reviewSubtitle:Ce,reviewStatusIcon:ke=e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-hourglass-icon lucide-hourglass",children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]}),reviewSteps:Ie=[],showReviewProgress:Te=!1,showOriginalText:Be=!1,originalText:Ae,originalTextHeader:Ee="Original text",hideSummaryText:Re=!1,hideSeverityChip:We=!1}){var De,Fe,ze,Le,Me,He,_e,qe,Oe,Ne,Pe,$e,Ve,Ue,Ge,Ke,Xe,Je,Qe,Ye;let Ze=G.findIndex(e=>e===$);-1===Ze&&(Ze=1);const[ei,ii]=t.useState(!0),[ti,ni]=t.useState(!1),[oi,li]=t.useState(!1),[ri,si]=t.useState(Ze),[di]=t.useState(Ze),[ai,ci]=t.useState(!0),pi="review"===Se,xi=G[ri],gi=K[xi]||"#BA7517",ui=ri!==di,vi=[{id:"iterate",icon:ee.iterateIcon||e.jsx(i.PenLine,{size:16,color:"#64748B"}),label:U.btnIterate||"Iterate",color:"#64748B",onClick:q},{id:"accept",icon:ee.acceptIcon||e.jsx(i.CheckCircle,{size:16,color:"#10B981"}),label:U.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:ee.rejectIcon||e.jsx(i.XCircle,{size:16,color:"#DC2626"}),label:U.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:hi,redlineConfig:mi,updateRedlineDataParent:yi}=s.useRequirementAI(),fi=J||vi;return e.jsxs("div",{onClick:e=>{e.stopPropagation()},style:{...y,...null===(De=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===De?void 0:De.root},children:[e.jsxs("div",{style:{...f,...null===(Fe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Fe?void 0:Fe.header,marginBottom:pi?14:oi?"16px":"12px",...pi&&{backgroundColor:"#F1F5F9",padding:"12px 16px",marginTop:"-16px",marginLeft:"-16px",marginRight:"-16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0"}},children:[pi?e.jsxs("div",{style:{minWidth:0,flex:"1 1 auto"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#1E293B",fontSize:16,fontWeight:600,lineHeight:1.2},children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",color:"#64748B"},children:ke||ee.summaryIcon||"⏳"}),e.jsx("span",{children:be||"Redline In Review"})]}),e.jsx("div",{style:{marginTop:6,paddingLeft:28,color:"#475569",fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Ce||(null===(ze=null==x?void 0:x.redlining_details)||void 0===ze?void 0:ze.redline_title)})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{children:ee.summaryIcon||e.jsx(i.Info,{size:16,color:"#E24B4A"})}),e.jsx("span",{style:{...j,...null===(Le=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Le?void 0:Le.title},children:U.summaryHeader||"Summary"})]}),ye&&ye.length>0&&e.jsx(N,{users:ye,onClick:e=>{e.stopPropagation(),null==fe||fe()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(me||ie||te)&&e.jsx(O,{onAssignClick:me,onOpenCognitive:ie,cognitiveIconSmall:ue,cognitiveTootipTitle:xe,historyIconSmall:ne,onHistoryClick:te,historyTootipTitle:oe}),e.jsx("button",{onClick:p,style:{...A,...null===(Me=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Me?void 0:Me.closeBtn,color:"#64748B",fontSize:16},children:"✕"})]})]}),pi&&Te&&Ie.length>0&&e.jsx(P,{steps:Ie}),!Re&&!pi&&e.jsx(e.Fragment,{children:e.jsx(r.Tooltip,{title:null===(He=null==x?void 0:x.redlining_details)||void 0===He?void 0:He.redline_title,children:e.jsx("p",{style:{...w,...null===(_e=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===_e?void 0:_e.bodyText},children:null===(qe=null==x?void 0:x.redlining_details)||void 0===qe?void 0:qe.redline_title})})}),e.jsx("p",{style:{...S,...null===(Oe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Oe?void 0:Oe.summary},children:null===(Ne=null==x?void 0:x.redlining_details)||void 0===Ne?void 0:Ne.redline_summary}),e.jsxs("div",{style:{...b,...null===(Pe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.impactContainer},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("button",{onClick:()=>ii(!ei),style:{...k,...null===($e=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===$e?void 0:$e.impactToggle},children:[e.jsx("span",{style:{...I,...null===(Ve=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ve?void 0:Ve.impactToggleLabel},children:U.impactHeader||"Impact"}),e.jsx("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ei?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})})]}),e.jsx(v,{type:(null==x?void 0:x.severity)||"Medium",customStyles:Z})]}),ei&&e.jsx(e.Fragment,{children:e.jsx("div",{style:{...C,...null===(Ue=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ue?void 0:Ue.impactText},children:e.jsx(a.AiReasonMarkdownWrapper,{message:`${null!==(Ke=null===(Ge=null==x?void 0:x.redlining_details)||void 0===Ge?void 0:Ge.redline_impact)&&void 0!==Ke?Ke:U.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(Xe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Xe?void 0:Xe.impactMarkdown})})})]}),pi&&Be&&e.jsxs("div",{style:{borderTop:"1px solid #E2E8F0",paddingTop:14,marginBottom:20},children:[e.jsxs("button",{onClick:()=>ci(e=>!e),style:{background:"none",border:"none",padding:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",color:"#1E293B",fontSize:21,fontWeight:600},children:[e.jsx("span",{children:Ee}),e.jsx(i.ChevronDown,{size:18,color:"#1E293B",style:{transform:ai?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]}),ai&&e.jsxs("div",{style:{marginTop:10,border:"1px solid #CBD5E1",borderRadius:12,padding:"16px 20px",background:"#F8FAFC",color:"#475569",fontSize:20,lineHeight:1.7,fontStyle:"italic",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.08)"},children:["“",Ae||"","”"]})]}),e.jsx("div",{style:{...T,...null===(Je=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Je?void 0:Je.actionContainer},children:fi.map(i=>{var t,n;const o=Q||i.disabled,l=o?{cursor:"not-allowed",opacity:.5,...null===(t=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtnDisabled,...i.disabledStyle}:{};return e.jsxs("button",{style:{...B,...null===(n=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtn,color:i.color,...i.style,...l},onClick:o?void 0:async()=>{var e,t;if(i.useLabel)try{await(null===(e=i.onClick)||void 0===e?void 0:e.call(i))}finally{await(async e=>{var i,t,n,o,l,r;null==_||_({status:"loading",action:e,metadata:{redlineId:je,aiReasonId:we}});try{const{updated_reqai:s}=await d.resolveRedline({documentId:hi,userEmail:null==mi?void 0:mi.userEmail,userName:null==mi?void 0:mi.userName,redlineId:null!==(i=null==x?void 0:x.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==mi?void 0:mi.baseApiUrl,redlineConfigId:null!==(t=null==mi?void 0:mi.redlineConfigId)&&void 0!==t?t:""},null!==(n=null==mi?void 0:mi.token)&&void 0!==n?n:"");await(null==yi?void 0:yi(s)),c.default.emit(`redline-edit:${hi}:${null===(r=null===(l=null===(o=null==s?void 0:s.artifactData)||void 0===o?void 0:o.userStorySnapshot)||void 0===l?void 0:l[0])||void 0===r?void 0:r.artifactId}`,{updatedBy:null==mi?void 0:mi.userName}),null==_||_({status:"success",action:e,metadata:{redlineId:je,aiReasonId:we}})}catch(i){null==_||_({status:"failed",action:e,metadata:{redlineId:je,aiReasonId:we}})}})(i.id.toLowerCase())}else await(null===(t=i.onClick)||void 0===t?void 0:t.call(i))},disabled:o,children:[i.icon,i.label]},i.id)})}),le&&e.jsxs("div",{style:{...E,...null===(Qe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Qe?void 0:Qe.toneContainer},children:[e.jsxs("button",{onClick:()=>ni(!ti),style:{...R,...null===(Ye=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ye?void 0:Ye.toneToggleBtn},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(u,{toneIndex:ri,configs:X}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:U.toneHeader||"Redline Tone"})]}),e.jsx("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ti?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#111"})})]}),ti&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:U.toneDescription||"Controls how assertively AI is redlining"}),e.jsx(n.ToneToggle,{isDirty:ui,onToneChange:e=>{si(e)},toneColor:gi,toneIndex:ri,onClickRegenerate:()=>null==V?void 0:V(xi),toneLabels:G,isStreaming:he,aiReason:x})]})]}),ie&&e.jsxs("div",{className:null==ce?void 0:ce.section,onClick:e=>{e.stopPropagation(),ie&&ie(e)},style:{...W,...null==ae?void 0:ae.section,...re},children:[e.jsxs("div",{className:null==ce?void 0:ce.headerLeft,style:{...D,...null==ae?void 0:ae.headerLeft},children:[e.jsx("span",{className:null==ce?void 0:ce.titleIcon,style:{...F,...null==ae?void 0:ae.titleIcon},children:null!=ge?ge:e.jsx(o.ReactComponent,{})}),e.jsx("div",{className:null==ce?void 0:ce.cognitiveTitle,style:{...z,...null==ae?void 0:ae.cognitiveTitle},children:pe})]}),e.jsxs("div",{className:null==ce?void 0:ce.headerRight,style:{...L,...null==ae?void 0:ae.headerRight},children:[void 0!==(null==x?void 0:x.relevance_score)&&null!==(null==x?void 0:x.relevance_score)?e.jsxs("span",{className:null==ce?void 0:ce.scoreBadge,style:{...M,...null==ae?void 0:ae.scoreBadge,...se},children:[e.jsx(l.ReactComponent,{}),e.jsxs("span",{className:null==ce?void 0:ce.scoreText,style:{...H,...null==ae?void 0:ae.scoreText,...de},children:[Math.round(Number(x.relevance_score)),"%"]})]}):null,ve&&e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(i.ChevronRight,{size:16,color:"#64748B"})})]})]})]})},(e,i)=>{var t,n,o,l;if(e.displayVariant!==i.displayVariant)return!1;if(e.reviewTitle!==i.reviewTitle)return!1;if(e.reviewSubtitle!==i.reviewSubtitle)return!1;if(e.showReviewProgress!==i.showReviewProgress)return!1;if(e.showOriginalText!==i.showOriginalText)return!1;if(e.originalText!==i.originalText)return!1;if(e.hideSummaryText!==i.hideSummaryText)return!1;if(e.hideSeverityChip!==i.hideSeverityChip)return!1;if((null!==(n=null===(t=e.reviewSteps)||void 0===t?void 0:t.length)&&void 0!==n?n:0)!==(null!==(l=null===(o=i.reviewSteps)||void 0===o?void 0:o.length)&&void 0!==l?l:0))return!1;if(e.reviewSteps&&i.reviewSteps){if(e.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|")!==i.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|"))return!1}return!0});exports.AssignMenu=q,exports.DisplayUsers=N,exports.KebabMenu=O,exports.default=$;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),t=require("react"),n=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var o=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),r=require("@mui/material"),s=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../../../../../service/redlineService.js"),a=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),c=require("../cws/CwsEvent.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=p(t);const u=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],g=({toneIndex:i,configs:t=u})=>{const n=Math.min(i,t.length-1),{color:o,angle:l,arcD:r}=t[n]||t[1]||t[0],s=(l-90)*Math.PI/180,d=11+9*Math.cos(s),a=13+9*Math.sin(s);return e.jsxs("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:r,stroke:o,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:"11",y1:"13",x2:d,y2:a,stroke:o,strokeWidth:"2",strokeLinecap:"round"})]})},v=({type:i,customStyles:t={}})=>{const n={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...t},o=n[i]||n.Medium;return e.jsx("div",{style:o,children:i})},h=["Lenient","Balanced","Aggressive"],m={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},y={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},f={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},j={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},w={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},S={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},b={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},C={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},k={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},I={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},T={display:"flex",gap:8,marginBottom:18},B={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},A={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},E={borderTop:"0.5px solid #eee",padding:"14px 0px"},R={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},W={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},D={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},F={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},z={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},L={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},M={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},H={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},_={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0},q=t.memo(function({onAssignClick:i,onOpenCognitive:t,cognitiveIconSmall:n,cognitiveTootipTitle:o,historyIconSmall:l,onHistoryClick:r,historyTootipTitle:s}){const d="20px";return e.jsxs("div",{style:{..._,minWidth:"200px"},children:[e.jsxs("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:i,children:[e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"})]})}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),t&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>t(e),children:[n&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:n}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),r&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>r(e),children:[l&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:l}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s})]})]})}),O=t.memo(function({onAssignClick:i,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d}){const[a,c]=t.useState(!1);return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsx("button",{onClick:()=>c(!a),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),a&&e.jsx(q,{onAssignClick:i?()=>{c(!1),i&&i()}:void 0,onOpenCognitive:n?e=>{c(!1),n&&n(e)}:void 0,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d})]})}),N=t.memo(function({users:i,onClick:t}){const n=i.length;return e.jsxs("div",{onClick:t,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e.jsx("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==i?void 0:i[0].length)>9?(null==i?void 0:i[0].slice(0,9))+"...":null==i?void 0:i[0]}),n>1&&e.jsxs("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",n-1]})]})}),P=t.memo(function({steps:i}){if(!(null==i?void 0:i.length))return null;const t=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:t?"6px 8px":"8px 10px",background:"#F8FAFC",gap:t?4:8,overflow:"hidden"},children:i.map((n,o)=>{const l=(e=>{const i=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return i[e%i.length]})(o),r=o===i.length-1;return e.jsxs(x.default.Fragment,{children:[e.jsxs("div",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:t?4:6,overflow:"hidden"},children:[(s=n.status,"approved"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#F59E0B",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:t?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:t?20:22,height:t?20:22,minWidth:t?20:22,borderRadius:"50%",background:l.bg,color:l.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:t?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!r&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"18",height:t?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:t?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var s})})})});var $=t.memo(function({onClose:p,aiReason:x,onActionTrigger:_,onIterate:q,initialTone:$,onRegenerate:V,labels:U={},toneLevelsConfig:G=h,toneColorsConfig:K=m,dialConfigs:X=u,actions:J,disableAllActions:Q=!1,customStyles:Y={},severityChipStyles:Z={},customIcons:ee={},onOpenCognitive:ie,onHistoryClick:te,historyIconSmall:ne,historyTootipTitle:oe,showTone:le=!0,cognitiveSectionStyle:re={},cognitiveScoreBadgeStyle:se={},cognitiveScoreTextStyle:de={},cognitiveStyles:ae={},cognitiveClassNames:ce={},cognitiveTitle:pe="Cognitive Integrity",cognitiveTootipTitle:xe="Cognitive Decisioning",cognitiveLeftIcon:ue,cognitiveIconSmall:ge,showCognitiveRightArrow:ve=!0,isStreaming:he,onAssignClick:me,assignedUsers:ye,onReviewUsersClick:fe,redlineId:je,aiReasonId:we,displayVariant:Se="default",reviewTitle:be,reviewSubtitle:Ce,reviewStatusIcon:ke=e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-hourglass-icon lucide-hourglass",children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]}),reviewSteps:Ie=[],showReviewProgress:Te=!1,showOriginalText:Be=!1,originalText:Ae,originalTextHeader:Ee="Original text",hideSummaryText:Re=!1,hideSeverityChip:We=!1}){var De,Fe,ze,Le,Me,He,_e,qe,Oe,Ne,Pe,$e,Ve,Ue,Ge,Ke,Xe,Je,Qe,Ye;let Ze=G.findIndex(e=>e===$);-1===Ze&&(Ze=1);const[ei,ii]=t.useState(!0),[ti,ni]=t.useState(!1),[oi,li]=t.useState(!1),[ri,si]=t.useState(Ze),[di]=t.useState(Ze),[ai,ci]=t.useState(!0),pi="review"===Se,xi=G[ri],ui=K[xi]||"#BA7517",gi=ri!==di,vi=[{id:"iterate",icon:ee.iterateIcon||e.jsx(i.PenLine,{size:16,color:"#64748B"}),label:U.btnIterate||"Iterate",color:"#64748B",onClick:q},{id:"accept",icon:ee.acceptIcon||e.jsx(i.CheckCircle,{size:16,color:"#10B981"}),label:U.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:ee.rejectIcon||e.jsx(i.XCircle,{size:16,color:"#DC2626"}),label:U.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:hi,redlineConfig:mi,updateRedlineDataParent:yi}=s.useRequirementAI(),fi=J||vi;return e.jsxs("div",{onClick:e=>{e.stopPropagation()},style:{...y,...null===(De=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===De?void 0:De.root},children:[e.jsxs("div",{style:{...f,...null===(Fe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Fe?void 0:Fe.header,marginBottom:pi?14:oi?"16px":"12px",...pi&&{backgroundColor:"#F1F5F9",padding:"12px 16px",marginTop:"-16px",marginLeft:"-16px",marginRight:"-16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0"}},children:[pi?e.jsxs("div",{style:{minWidth:0,flex:"1 1 auto"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#1E293B",fontSize:16,fontWeight:600,lineHeight:1.2},children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",color:"#64748B"},children:ke||ee.summaryIcon||"⏳"}),e.jsx("span",{children:be||"Redline In Review"})]}),e.jsx("div",{style:{marginTop:6,paddingLeft:28,color:"#475569",fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Ce||(null===(ze=null==x?void 0:x.redlining_details)||void 0===ze?void 0:ze.redline_title)})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{children:ee.summaryIcon||e.jsx(i.Info,{size:16,color:"#E24B4A"})}),e.jsx("span",{style:{...j,...null===(Le=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Le?void 0:Le.title},children:U.summaryHeader||"Summary"})]}),ye&&ye.length>0&&e.jsx(N,{users:ye,onClick:e=>{e.stopPropagation(),null==fe||fe()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(me||ie||te)&&e.jsx(O,{onAssignClick:me,onOpenCognitive:ie,cognitiveIconSmall:ge,cognitiveTootipTitle:xe,historyIconSmall:ne,onHistoryClick:te,historyTootipTitle:oe}),e.jsx("button",{onClick:p,style:{...A,...null===(Me=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Me?void 0:Me.closeBtn,color:"#64748B",fontSize:16},children:"✕"})]})]}),pi&&Te&&Ie.length>0&&e.jsx(P,{steps:Ie}),!Re&&!pi&&e.jsx(e.Fragment,{children:e.jsx(r.Tooltip,{title:null===(He=null==x?void 0:x.redlining_details)||void 0===He?void 0:He.redline_title,children:e.jsx("p",{style:{...w,...null===(_e=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===_e?void 0:_e.bodyText},children:null===(qe=null==x?void 0:x.redlining_details)||void 0===qe?void 0:qe.redline_title})})}),e.jsx("p",{style:{...S,...null===(Oe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Oe?void 0:Oe.summary},children:null===(Ne=null==x?void 0:x.redlining_details)||void 0===Ne?void 0:Ne.redline_summary}),e.jsxs("div",{style:{...b,...null===(Pe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.impactContainer},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("button",{onClick:()=>ii(!ei),style:{...k,...null===($e=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===$e?void 0:$e.impactToggle},children:[e.jsx("span",{style:{...I,...null===(Ve=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ve?void 0:Ve.impactToggleLabel},children:U.impactHeader||"Impact"}),e.jsx("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ei?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})})]}),e.jsx(v,{type:(null==x?void 0:x.severity)||"Medium",customStyles:Z})]}),ei&&e.jsx(e.Fragment,{children:e.jsx("div",{style:{...C,...null===(Ue=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ue?void 0:Ue.impactText},children:e.jsx(a.AiReasonMarkdownWrapper,{message:`${null!==(Ke=null===(Ge=null==x?void 0:x.redlining_details)||void 0===Ge?void 0:Ge.redline_impact)&&void 0!==Ke?Ke:U.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(Xe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Xe?void 0:Xe.impactMarkdown})})})]}),pi&&Be&&e.jsxs("div",{style:{borderTop:"1px solid #E2E8F0",paddingTop:14,marginBottom:20},children:[e.jsxs("button",{onClick:()=>ci(e=>!e),style:{background:"none",border:"none",padding:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",color:"#1E293B",fontSize:21,fontWeight:600},children:[e.jsx("span",{children:Ee}),e.jsx(i.ChevronDown,{size:18,color:"#1E293B",style:{transform:ai?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]}),ai&&e.jsxs("div",{style:{marginTop:10,border:"1px solid #CBD5E1",borderRadius:12,padding:"16px 20px",background:"#F8FAFC",color:"#475569",fontSize:20,lineHeight:1.7,fontStyle:"italic",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.08)"},children:["“",Ae||"","”"]})]}),e.jsx("div",{style:{...T,...null===(Je=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Je?void 0:Je.actionContainer},children:fi.map(i=>{var t,n;const o=Q||i.disabled,l=o?{cursor:"not-allowed",opacity:.5,...null===(t=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtnDisabled,...i.disabledStyle}:{};return e.jsxs("button",{style:{...B,...null===(n=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtn,color:i.color,...i.style,...l},onClick:o?void 0:async()=>{var e,t;if(i.useLabel)try{await(null===(e=i.onClick)||void 0===e?void 0:e.call(i))}finally{await(async e=>{var i,t,n,o,l,r;try{await(null==_?void 0:_({status:"loading",action:e,metadata:{redlineId:je,aiReasonId:we}}))}catch(e){}if(null==mi?void 0:mi.callResolveRedline)try{const{updated_reqai:s}=await d.resolveRedline({documentId:hi,userEmail:null==mi?void 0:mi.userEmail,userName:null==mi?void 0:mi.userName,redlineId:null!==(i=null==x?void 0:x.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==mi?void 0:mi.baseApiUrl,redlineConfigId:null!==(t=null==mi?void 0:mi.redlineConfigId)&&void 0!==t?t:""},null!==(n=null==mi?void 0:mi.token)&&void 0!==n?n:"");await(null==yi?void 0:yi(s));const a=null===(r=null===(l=null===(o=null==s?void 0:s.artifactData)||void 0===o?void 0:o.userStorySnapshot)||void 0===l?void 0:l[0])||void 0===r?void 0:r.artifactId;"string"==typeof a&&a.trim()&&"string"==typeof hi&&hi.trim()&&"string"==typeof(null==mi?void 0:mi.userName)&&(null==mi?void 0:mi.userName.trim())?c.default.emit(`redline-edit:${hi}:${a}`,{updatedBy:null==mi?void 0:mi.userName}):console.error("invalid cwsEvent name or payload"),null==_||_({status:"success",action:e,metadata:{redlineId:je,aiReasonId:we}})}catch(i){null==_||_({status:"failed",action:e,metadata:{redlineId:je,aiReasonId:we}})}})(i.id.toLowerCase())}else await(null===(t=i.onClick)||void 0===t?void 0:t.call(i))},disabled:o,children:[i.icon,i.label]},i.id)})}),le&&e.jsxs("div",{style:{...E,...null===(Qe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Qe?void 0:Qe.toneContainer},children:[e.jsxs("button",{onClick:()=>ni(!ti),style:{...R,...null===(Ye=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ye?void 0:Ye.toneToggleBtn},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(g,{toneIndex:ri,configs:X}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:U.toneHeader||"Redline Tone"})]}),e.jsx("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ti?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#111"})})]}),ti&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:U.toneDescription||"Controls how assertively AI is redlining"}),e.jsx(n.ToneToggle,{isDirty:gi,onToneChange:e=>{si(e)},toneColor:ui,toneIndex:ri,onClickRegenerate:()=>null==V?void 0:V(xi),toneLabels:G,isStreaming:he,aiReason:x})]})]}),ie&&e.jsxs("div",{className:null==ce?void 0:ce.section,onClick:e=>{e.stopPropagation(),ie&&ie(e)},style:{...W,...null==ae?void 0:ae.section,...re},children:[e.jsxs("div",{className:null==ce?void 0:ce.headerLeft,style:{...D,...null==ae?void 0:ae.headerLeft},children:[e.jsx("span",{className:null==ce?void 0:ce.titleIcon,style:{...F,...null==ae?void 0:ae.titleIcon},children:null!=ue?ue:e.jsx(o.ReactComponent,{})}),e.jsx("div",{className:null==ce?void 0:ce.cognitiveTitle,style:{...z,...null==ae?void 0:ae.cognitiveTitle},children:pe})]}),e.jsxs("div",{className:null==ce?void 0:ce.headerRight,style:{...L,...null==ae?void 0:ae.headerRight},children:[void 0!==(null==x?void 0:x.relevance_score)&&null!==(null==x?void 0:x.relevance_score)?e.jsxs("span",{className:null==ce?void 0:ce.scoreBadge,style:{...M,...null==ae?void 0:ae.scoreBadge,...se},children:[e.jsx(l.ReactComponent,{}),e.jsxs("span",{className:null==ce?void 0:ce.scoreText,style:{...H,...null==ae?void 0:ae.scoreText,...de},children:[Math.round(Number(x.relevance_score)),"%"]})]}):null,ve&&e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(i.ChevronRight,{size:16,color:"#64748B"})})]})]})]})},(e,i)=>{var t,n,o,l;if(e.displayVariant!==i.displayVariant)return!1;if(e.reviewTitle!==i.reviewTitle)return!1;if(e.reviewSubtitle!==i.reviewSubtitle)return!1;if(e.showReviewProgress!==i.showReviewProgress)return!1;if(e.showOriginalText!==i.showOriginalText)return!1;if(e.originalText!==i.originalText)return!1;if(e.hideSummaryText!==i.hideSummaryText)return!1;if(e.hideSeverityChip!==i.hideSeverityChip)return!1;if((null!==(n=null===(t=e.reviewSteps)||void 0===t?void 0:t.length)&&void 0!==n?n:0)!==(null!==(l=null===(o=i.reviewSteps)||void 0===o?void 0:o.length)&&void 0!==l?l:0))return!1;if(e.reviewSteps&&i.reviewSteps){if(e.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|")!==i.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|"))return!1}return!0});exports.AssignMenu=q,exports.DisplayUsers=N,exports.KebabMenu=O,exports.default=$;
2
2
  //# sourceMappingURL=DeviationSummary.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./IterateComponent.js");exports.default=function({onBack:o,onApply:n,historicalClausesData:i=[],isLoadingHistory:s,headerTitle:l="Historical Recommendations",customStyles:a={}}){const d={...r.styles,...a},c=({clause:r,index:o})=>{const[i,s]=t.useState(!1),[l,a]=t.useState(!1),[c,p]=t.useState(!1),x=t.useRef(null),[u,f]=t.useState(!1),h=r.title||r.filename,g=r.content||r.excerpt||"",b=((e=0)=>e>=80?{bg:"#dcfce7",text:"#166534",border:"#bbf7d0"}:e>=50?{bg:"#fef9c3",text:"#854d0e",border:"#fef08a"}:{bg:"#fee2e2",text:"#991b1b",border:"#fecaca"})(r.relevance_score),y=c&&h,v=0===o;return t.useEffect(()=>{const e=x.current;if(!e)return;const t=()=>{i||f(e.scrollHeight>e.clientHeight)};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[g,i]),e.jsxs("div",{onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{...d.clauseCard,display:"flex",flexDirection:"column",gap:6,textAlign:"left",backgroundColor:l?"#f8fafc":"#fff",borderColor:l?"#cbd5e1":"#dde5f0",transition:"all 0.2s ease"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"8px"},children:[e.jsxs("div",{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{position:"relative",flex:1,minWidth:0},children:[e.jsx("p",{style:{...d.clauseFilename,margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%",cursor:"default"},children:h}),y&&e.jsx("div",{style:{position:"absolute",top:v?"100%":"auto",bottom:v?"auto":"100%",marginTop:v?"6px":"0px",marginBottom:v?"0px":"6px",left:0,backgroundColor:"#1E293B",color:"#fff",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:400,zIndex:50,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"normal",wordBreak:"break-word",width:"max-content",maxWidth:"220px",pointerEvents:"none",lineHeight:1.4},children:h})]}),void 0!==r.relevance_score&&e.jsxs("div",{style:{fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:12,border:`1px solid ${b.border}`,backgroundColor:b.bg,color:b.text,whiteSpace:"nowrap",flexShrink:0},children:[r.relevance_score,"% Match"]})]}),e.jsxs("div",{ref:x,onClick:e=>e.stopPropagation(),style:{...d.clauseExcerpt,margin:0,display:i?"block":"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:i?"unset":3,overflowY:i?"auto":"hidden",overflowX:"hidden",maxHeight:i?"100px":"none",paddingRight:i?"4px":"0px",cursor:"auto"},children:['"',g,'"']}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginTop:"4px"},children:[e.jsx("div",{children:(u||i)&&e.jsx("span",{onClick:e=>{e.stopPropagation(),i&&x.current&&(x.current.scrollTop=0),s(!i)},style:{fontSize:12,color:"#2563EB",fontWeight:500,cursor:"pointer"},children:i?"View Less":"...View More"})}),e.jsx("button",{onClick:()=>null==n?void 0:n({type:"history",value:r}),style:{backgroundColor:"#F8FAFC",color:"#0F172A",border:"1px solid #CBD5E1",borderRadius:"6px",padding:"4px 12px",fontSize:"12px",fontWeight:500,cursor:"pointer",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#F1F5F9",e.currentTarget.style.borderColor="#94A3B8"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#F8FAFC",e.currentTarget.style.borderColor="#CBD5E1"},children:"Proceed"})]})]})};return e.jsxs("div",{style:d.card,children:[e.jsxs("div",{style:d.header,children:[e.jsx("button",{onClick:o,style:d.backBtn,"aria-label":"Go back",children:"‹"}),e.jsx("span",{style:d.headerTitle,children:l})]}),e.jsx("div",{style:{...d.body,paddingTop:12,paddingBottom:16},children:s?e.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",color:"#64748B",fontSize:13},children:[e.jsx("style",{children:"\n @keyframes iterateSpinner {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "}),e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"iterateSpinner 1s linear infinite"},children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),"Fetching recommendations..."]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,maxHeight:"40vh",overflowY:"auto",paddingRight:"4px"},children:[null==i?void 0:i.map((t,r)=>e.jsx(c,{clause:t,index:r},t.id)),(!i||0===i.length)&&e.jsx("p",{style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"},children:"No clauses found"})]})})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./IterateComponent.js");exports.default=function({onBack:o,onApply:n,historicalClausesData:i=[],isLoadingHistory:s,headerTitle:l="Historical Recommendations",customStyles:a={}}){const d={...r.styles,...a},c=({clause:r,index:o})=>{const[i,s]=t.useState(!1),[l,a]=t.useState(!1),[c,p]=t.useState(!1),x=t.useRef(null),[u,f]=t.useState(!1),g="string"==typeof r.title&&r.title.trim()?r.title:"string"==typeof r.filename&&r.filename.trim()?r.filename:"",h="string"==typeof r.content&&r.content.trim()?r.content:"string"==typeof r.excerpt&&r.excerpt.trim()?r.excerpt:"",b=((e=0)=>e>=80?{bg:"#dcfce7",text:"#166534",border:"#bbf7d0"}:e>=50?{bg:"#fef9c3",text:"#854d0e",border:"#fef08a"}:{bg:"#fee2e2",text:"#991b1b",border:"#fecaca"})(r.relevance_score),y=c&&g,m=0===o;return t.useEffect(()=>{const e=x.current;if(!e)return;const t=()=>{i||f(e.scrollHeight>e.clientHeight)};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[h,i]),e.jsxs("div",{onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{...d.clauseCard,display:"flex",flexDirection:"column",gap:6,textAlign:"left",backgroundColor:l?"#f8fafc":"#fff",borderColor:l?"#cbd5e1":"#dde5f0",transition:"all 0.2s ease"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"8px"},children:[e.jsxs("div",{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{position:"relative",flex:1,minWidth:0},children:[e.jsx("p",{style:{...d.clauseFilename,margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%",cursor:"default"},children:g}),y&&e.jsx("div",{style:{position:"absolute",top:m?"100%":"auto",bottom:m?"auto":"100%",marginTop:m?"6px":"0px",marginBottom:m?"0px":"6px",left:0,backgroundColor:"#1E293B",color:"#fff",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:400,zIndex:50,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"normal",wordBreak:"break-word",width:"max-content",maxWidth:"220px",pointerEvents:"none",lineHeight:1.4},children:g})]}),void 0!==r.relevance_score&&e.jsxs("div",{style:{fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:12,border:`1px solid ${b.border}`,backgroundColor:b.bg,color:b.text,whiteSpace:"nowrap",flexShrink:0},children:[r.relevance_score,"% Match"]})]}),e.jsxs("div",{ref:x,onClick:e=>e.stopPropagation(),style:{...d.clauseExcerpt,margin:0,display:i?"block":"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:i?"unset":3,overflowY:i?"auto":"hidden",overflowX:"hidden",maxHeight:i?"100px":"none",paddingRight:i?"4px":"0px",cursor:"auto"},children:['"',h,'"']}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginTop:"4px"},children:[e.jsx("div",{children:(u||i)&&e.jsx("span",{onClick:e=>{e.stopPropagation(),i&&x.current&&(x.current.scrollTop=0),s(!i)},style:{fontSize:12,color:"#2563EB",fontWeight:500,cursor:"pointer"},children:i?"View Less":"...View More"})}),e.jsx("button",{onClick:()=>null==n?void 0:n({type:"history",value:r}),style:{backgroundColor:"#F8FAFC",color:"#0F172A",border:"1px solid #CBD5E1",borderRadius:"6px",padding:"4px 12px",fontSize:"12px",fontWeight:500,cursor:"pointer",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#F1F5F9",e.currentTarget.style.borderColor="#94A3B8"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#F8FAFC",e.currentTarget.style.borderColor="#CBD5E1"},children:"Proceed"})]})]})};return e.jsxs("div",{style:d.card,children:[e.jsxs("div",{style:d.header,children:[e.jsx("button",{onClick:o,style:d.backBtn,"aria-label":"Go back",children:"‹"}),e.jsx("span",{style:d.headerTitle,children:l})]}),e.jsx("div",{style:{...d.body,paddingTop:12,paddingBottom:16},children:s?e.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",color:"#64748B",fontSize:13},children:[e.jsx("style",{children:"\n @keyframes iterateSpinner {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "}),e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"iterateSpinner 1s linear infinite"},children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),"Fetching recommendations..."]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,maxHeight:"40vh",overflowY:"auto",paddingRight:"4px"},children:[null==i?void 0:i.map((t,r)=>e.jsx(c,{clause:t,index:r},t.id)),(!i||0===i.length)&&e.jsx("p",{style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"},children:"No clauses found"})]})})]})};
2
2
  //# sourceMappingURL=HistoryMenu.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),l=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../../../../service/redlineService.js"),d=require("../cws/CwsEvent.js");require("react");const t={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};exports.default=function({onClose:o,editorInfo:r,headerText:a,btnsConfig:s,labelText:c,onActionTrigger:u,aiReason:v=null}){var p,f;const{redlineDcoumentId:x,redlineConfig:b,updateRedlineDataParent:g}=l.useRequirementAI(),y=async e=>{var i,l,t,o,r,a,s;null==u||u({status:"loading",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}});try{const{updated_reqai:c}=await n.resolveRedline({documentId:x,userEmail:null==b?void 0:b.userEmail,userName:null==b?void 0:b.userName,redlineId:null!==(i=null==v?void 0:v.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==b?void 0:b.baseApiUrl,redlineConfigId:null!==(l=null==b?void 0:b.redlineConfigId)&&void 0!==l?l:""},null!==(t=null==b?void 0:b.token)&&void 0!==t?t:"");await(null==g?void 0:g(c)),null===(o=d.default.emit)||void 0===o||o.call(d.default,`redline-edit:${x}:${null===(s=null===(a=null===(r=null==c?void 0:c.artifactData)||void 0===r?void 0:r.userStorySnapshot)||void 0===a?void 0:a[0])||void 0===s?void 0:s.artifactId}`,{updatedBy:null==b?void 0:b.userName}),null==u||u({status:"success",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}})}catch(i){null==u||u({status:"failed",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}})}};return e.jsxs("div",{style:t.popup,children:[e.jsxs("div",{style:t.header,children:[e.jsx("span",{style:t.title,children:a||"Manually Edited"}),e.jsx("button",{onClick:o,style:t.closeButton,"aria-label":"Close",children:"✕"})]}),e.jsxs("div",{style:t.content,children:[e.jsxs("div",{style:t.labelRow,children:[e.jsx(i.UserPen,{}),e.jsx("span",{style:t.label,children:c||"Edited By"})]}),e.jsx("div",{style:t.editorInfo,children:r}),e.jsx("div",{style:t.divider}),e.jsxs("div",{style:t.actions,children:[null==s?void 0:s.map(i=>e.jsxs("button",{style:{...t.actionBtn,...i.style||{}},onClick:e=>i.onClick(e,{redlineId:null==v?void 0:v.redline_id,id:null==v?void 0:v.id}),children:[i.icon," ",i.text]})),!("accepted"===(null===(p=null==v?void 0:v.redlining_details)||void 0===p?void 0:p.status)||"rejected"===(null===(f=null==v?void 0:v.redlining_details)||void 0===f?void 0:f.status))&&e.jsxs("div",{style:t.resolveActions,children:[e.jsxs("button",{style:{...t.actionBtn,...(null==v?void 0:v.resolving)?t.actionBtnDisabled:{}},disabled:null==v?void 0:v.resolving,onClick:()=>y("accept"),children:[e.jsx(i.CheckCircle,{size:16,color:"#10B981"})," ","Adopt"]}),e.jsxs("button",{style:{...t.actionBtn,...(null==v?void 0:v.resolving)?t.actionBtnDisabled:{}},onClick:()=>y("reject"),disabled:null==v?void 0:v.resolving,children:[e.jsx(i.XCircle,{size:16,color:"#DC2626"})," ","Reject"]})]})]})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),l=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../../../../service/redlineService.js"),t=require("../cws/CwsEvent.js");require("react");const d={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};exports.default=function({onClose:o,editorInfo:r,headerText:a,btnsConfig:s,labelText:c,onActionTrigger:u,aiReason:v=null}){var p,f;const{redlineDcoumentId:g,redlineConfig:x,updateRedlineDataParent:b}=l.useRequirementAI(),y=async e=>{var i,l,d,o,r,a;try{await(null==u?void 0:u({status:"loading",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}}))}catch(e){}if(null==x?void 0:x.callResolveRedline)try{const{updated_reqai:s}=await n.resolveRedline({documentId:g,userEmail:null==x?void 0:x.userEmail,userName:null==x?void 0:x.userName,redlineId:null!==(i=null==v?void 0:v.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==x?void 0:x.baseApiUrl,redlineConfigId:null!==(l=null==x?void 0:x.redlineConfigId)&&void 0!==l?l:""},null!==(d=null==x?void 0:x.token)&&void 0!==d?d:"");await(null==b?void 0:b(s));const c=null===(a=null===(r=null===(o=null==s?void 0:s.artifactData)||void 0===o?void 0:o.userStorySnapshot)||void 0===r?void 0:r[0])||void 0===a?void 0:a.artifactId;"string"==typeof c&&c.trim()&&"string"==typeof g&&g.trim()&&"string"==typeof(null==x?void 0:x.userName)&&(null==x?void 0:x.userName.trim())?t.default.emit(`redline-edit:${g}:${c}`,{updatedBy:null==x?void 0:x.userName}):console.error("invalid cwsEvent name or payload"),null==u||u({status:"success",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}})}catch(i){null==u||u({status:"failed",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}})}};return e.jsxs("div",{style:d.popup,children:[e.jsxs("div",{style:d.header,children:[e.jsx("span",{style:d.title,children:a||"Manually Edited"}),e.jsx("button",{onClick:o,style:d.closeButton,"aria-label":"Close",children:"✕"})]}),e.jsxs("div",{style:d.content,children:[e.jsxs("div",{style:d.labelRow,children:[e.jsx(i.UserPen,{}),e.jsx("span",{style:d.label,children:c||"Edited By"})]}),e.jsx("div",{style:d.editorInfo,children:r}),e.jsx("div",{style:d.divider}),e.jsxs("div",{style:d.actions,children:[null==s?void 0:s.map(i=>e.jsxs("button",{style:{...d.actionBtn,...i.style||{}},onClick:e=>i.onClick(e,{redlineId:null==v?void 0:v.redline_id,id:null==v?void 0:v.id}),children:[i.icon," ",i.text]})),!("accepted"===(null===(p=null==v?void 0:v.redlining_details)||void 0===p?void 0:p.status)||"rejected"===(null===(f=null==v?void 0:v.redlining_details)||void 0===f?void 0:f.status))&&e.jsxs("div",{style:d.resolveActions,children:[e.jsxs("button",{style:{...d.actionBtn,...(null==v?void 0:v.resolving)?d.actionBtnDisabled:{}},disabled:null==v?void 0:v.resolving,onClick:()=>y("accept"),children:[e.jsx(i.CheckCircle,{size:16,color:"#10B981"})," ","Adopt"]}),e.jsxs("button",{style:{...d.actionBtn,...(null==v?void 0:v.resolving)?d.actionBtnDisabled:{}},onClick:()=>y("reject"),disabled:null==v?void 0:v.resolving,children:[e.jsx(i.XCircle,{size:16,color:"#DC2626"})," ","Reject"]})]})]})]})]})};
2
2
  //# sourceMappingURL=ManualEditPopup.js.map