@viswa-test/test-citation 0.0.240 → 0.0.242

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 (235) hide show
  1. package/README.md +218 -0
  2. package/dist/cjs/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
  3. package/dist/cjs/features/ChatCitation/components/ChatCitation.js +1 -1
  4. package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
  5. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
  6. package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +2 -0
  7. package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js.map +1 -0
  8. package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  9. package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
  10. package/dist/cjs/features/IngestionStatus/useIngestionStatus.js +1 -1
  11. package/dist/cjs/features/InstantLearningCitation/SlashLoader.js +2 -0
  12. package/dist/cjs/features/InstantLearningCitation/SlashLoader.js.map +1 -0
  13. package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +2 -0
  14. package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js.map +1 -0
  15. package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  16. package/dist/cjs/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.js +1 -1
  17. package/dist/cjs/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.module.css.js +1 -1
  18. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  19. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  20. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  21. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +2 -0
  22. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js.map +1 -0
  23. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  24. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  25. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  26. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
  27. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  28. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  29. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +2 -0
  30. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js.map +1 -0
  31. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +2 -0
  32. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js.map +1 -0
  33. package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
  34. package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js +2 -0
  35. package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js.map +1 -0
  36. package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js +2 -0
  37. package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js.map +1 -0
  38. package/dist/cjs/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.js +1 -1
  39. package/dist/cjs/features/RequirementAI/components/segment/DeleteSegmentsDialog.js +2 -0
  40. package/dist/cjs/features/RequirementAI/components/segment/DeleteSegmentsDialog.js.map +1 -0
  41. package/dist/cjs/features/RequirementAI/components/segment/EditSegmentDialog.js +2 -0
  42. package/dist/cjs/features/RequirementAI/components/segment/EditSegmentDialog.js.map +1 -0
  43. package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
  44. package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  45. package/dist/cjs/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js +2 -0
  46. package/dist/cjs/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js.map +1 -0
  47. package/dist/cjs/features/RequirementAI/components/segment/segment.module.css.js +1 -1
  48. package/dist/cjs/features/RequirementAI/components/story-screen/CompletionPanel.js +1 -1
  49. package/dist/cjs/features/RequirementAI/components/story-screen/CompletionPanel.module.css.js +1 -1
  50. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  51. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  52. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  53. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
  54. package/dist/cjs/hooks/useOnDemandCitationFetch.js +2 -0
  55. package/dist/cjs/hooks/useOnDemandCitationFetch.js.map +1 -0
  56. package/dist/cjs/index.js +1 -1
  57. package/dist/cjs/service/apicache.service.js +2 -0
  58. package/dist/cjs/service/apicache.service.js.map +1 -0
  59. package/dist/cjs/service/onDemandApi.js +2 -0
  60. package/dist/cjs/service/onDemandApi.js.map +1 -0
  61. package/dist/cjs/types/onDemandApi.types.js +2 -0
  62. package/dist/cjs/types/onDemandApi.types.js.map +1 -0
  63. package/dist/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
  64. package/dist/features/ChatCitation/components/ChatCitation.js +1 -1
  65. package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
  66. package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
  67. package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +2 -0
  68. package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js.map +1 -0
  69. package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  70. package/dist/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
  71. package/dist/features/IngestionStatus/useIngestionStatus.js +1 -1
  72. package/dist/features/InstantLearningCitation/SlashLoader.js +2 -0
  73. package/dist/features/InstantLearningCitation/SlashLoader.js.map +1 -0
  74. package/dist/features/ParentCitationComponent/ParentCitationComponent.js +2 -0
  75. package/dist/features/ParentCitationComponent/ParentCitationComponent.js.map +1 -0
  76. package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  77. package/dist/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.js +1 -1
  78. package/dist/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.module.css.js +1 -1
  79. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  80. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  81. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  82. package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +2 -0
  83. package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js.map +1 -0
  84. package/dist/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.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/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  89. package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  90. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +2 -0
  91. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js.map +1 -0
  92. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +2 -0
  93. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js.map +1 -0
  94. package/dist/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
  95. package/dist/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js +2 -0
  96. package/dist/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js.map +1 -0
  97. package/dist/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js +2 -0
  98. package/dist/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js.map +1 -0
  99. package/dist/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.js +1 -1
  100. package/dist/features/RequirementAI/components/segment/DeleteSegmentsDialog.js +2 -0
  101. package/dist/features/RequirementAI/components/segment/DeleteSegmentsDialog.js.map +1 -0
  102. package/dist/features/RequirementAI/components/segment/EditSegmentDialog.js +2 -0
  103. package/dist/features/RequirementAI/components/segment/EditSegmentDialog.js.map +1 -0
  104. package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
  105. package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  106. package/dist/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js +2 -0
  107. package/dist/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js.map +1 -0
  108. package/dist/features/RequirementAI/components/segment/segment.module.css.js +1 -1
  109. package/dist/features/RequirementAI/components/story-screen/CompletionPanel.js +1 -1
  110. package/dist/features/RequirementAI/components/story-screen/CompletionPanel.module.css.js +1 -1
  111. package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  112. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  113. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  114. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
  115. package/dist/hooks/useOnDemandCitationFetch.js +2 -0
  116. package/dist/hooks/useOnDemandCitationFetch.js.map +1 -0
  117. package/dist/index.js +1 -1
  118. package/dist/service/apicache.service.js +2 -0
  119. package/dist/service/apicache.service.js.map +1 -0
  120. package/dist/service/onDemandApi.js +2 -0
  121. package/dist/service/onDemandApi.js.map +1 -0
  122. package/dist/types/onDemandApi.types.js +2 -0
  123. package/dist/types/onDemandApi.types.js.map +1 -0
  124. package/dist/types/src/DeviationSummaryTest.d.ts.map +1 -1
  125. package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
  126. package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
  127. package/dist/types/src/constants/deviationData.d.ts +887 -0
  128. package/dist/types/src/constants/deviationData.d.ts.map +1 -0
  129. package/dist/types/src/constants/treeData.d.ts +732 -0
  130. package/dist/types/src/constants/treeData.d.ts.map +1 -0
  131. package/dist/types/src/features/ChatCitation/InternalChatCitationRenderer.d.ts.map +1 -1
  132. package/dist/types/src/features/ChatCitation/components/ChatCitation.d.ts +1 -0
  133. package/dist/types/src/features/ChatCitation/components/ChatCitation.d.ts.map +1 -1
  134. package/dist/types/src/features/ChatCitation/types/citations.types.d.ts +3 -0
  135. package/dist/types/src/features/ChatCitation/types/citations.types.d.ts.map +1 -1
  136. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
  137. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
  138. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
  139. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +8 -0
  140. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
  141. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +2 -1
  142. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
  143. package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts +3 -0
  144. package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts.map +1 -0
  145. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +815 -7803
  146. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
  147. package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -1
  148. package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +0 -1
  149. package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -1
  150. package/dist/types/src/features/IngestionStatus/useIngestionStatus.d.ts.map +1 -1
  151. package/dist/types/src/features/InstantLearningCitation/InstantLearningCitationTest.d.ts +2 -0
  152. package/dist/types/src/features/InstantLearningCitation/InstantLearningCitationTest.d.ts.map +1 -1
  153. package/dist/types/src/features/InstantLearningCitation/types/Types.d.ts +2 -0
  154. package/dist/types/src/features/InstantLearningCitation/types/Types.d.ts.map +1 -1
  155. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +128 -0
  156. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +1 -0
  157. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +13 -0
  158. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +1 -0
  159. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +13 -6
  160. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
  161. package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  162. package/dist/types/src/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.d.ts.map +1 -1
  163. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts.map +1 -1
  164. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +7 -1
  165. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  166. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts +8 -0
  167. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts.map +1 -0
  168. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  169. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.d.ts +13 -0
  170. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.d.ts.map +1 -0
  171. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts +17 -13
  172. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
  173. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +15 -3
  174. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  175. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +21 -2
  176. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  177. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts.map +1 -1
  178. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts +3 -1
  179. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts.map +1 -1
  180. package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.d.ts +11 -0
  181. package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.d.ts.map +1 -0
  182. package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.d.ts +25 -0
  183. package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.d.ts.map +1 -0
  184. package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts +3 -2
  185. package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts.map +1 -1
  186. package/dist/types/src/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.d.ts +31 -0
  187. package/dist/types/src/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.d.ts.map +1 -0
  188. package/dist/types/src/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.d.ts +1 -0
  189. package/dist/types/src/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.d.ts.map +1 -1
  190. package/dist/types/src/features/RequirementAI/components/segment/DeleteSegmentsDialog.d.ts +13 -0
  191. package/dist/types/src/features/RequirementAI/components/segment/DeleteSegmentsDialog.d.ts.map +1 -0
  192. package/dist/types/src/features/RequirementAI/components/segment/EditSegmentDialog.d.ts +12 -0
  193. package/dist/types/src/features/RequirementAI/components/segment/EditSegmentDialog.d.ts.map +1 -0
  194. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +8 -1
  195. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
  196. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts +5 -1
  197. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
  198. package/dist/types/src/features/RequirementAI/components/story-screen/CompletionPanel.d.ts +3 -1
  199. package/dist/types/src/features/RequirementAI/components/story-screen/CompletionPanel.d.ts.map +1 -1
  200. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +3 -1
  201. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  202. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +2 -1
  203. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
  204. package/dist/types/src/features/RequirementAI/interfaces/citation.interface.d.ts +18 -1
  205. package/dist/types/src/features/RequirementAI/interfaces/citation.interface.d.ts.map +1 -1
  206. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +32 -1
  207. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
  208. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +8 -0
  209. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
  210. package/dist/types/src/hooks/useOnDemandCitationFetch.d.ts +11 -0
  211. package/dist/types/src/hooks/useOnDemandCitationFetch.d.ts.map +1 -0
  212. package/dist/types/src/hooks/useOnDemandCitationFetchTest.d.ts +4 -0
  213. package/dist/types/src/hooks/useOnDemandCitationFetchTest.d.ts.map +1 -0
  214. package/dist/types/src/index.d.ts +2 -0
  215. package/dist/types/src/index.d.ts.map +1 -1
  216. package/dist/types/src/methodsToExpose.d.ts +1 -1
  217. package/dist/types/src/service/ProjectService.d.ts +2 -2
  218. package/dist/types/src/service/SavedDataSetService.d.ts +3 -3
  219. package/dist/types/src/service/apicache.service.d.ts +43 -0
  220. package/dist/types/src/service/apicache.service.d.ts.map +1 -0
  221. package/dist/types/src/service/onDemandApi.d.ts +27 -0
  222. package/dist/types/src/service/onDemandApi.d.ts.map +1 -0
  223. package/dist/types/src/types/onDemandApi.types.d.ts +58 -0
  224. package/dist/types/src/types/onDemandApi.types.d.ts.map +1 -0
  225. package/dist/types/src/types/useOnDemandCitationFetch.types.d.ts +70 -0
  226. package/dist/types/src/types/useOnDemandCitationFetch.types.d.ts.map +1 -0
  227. package/package.json +15 -4
  228. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
  229. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
  230. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
  231. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
  232. package/dist/types/src/CitationAccordionTest.d.ts +0 -1
  233. package/dist/types/src/CitationAccordionTest.d.ts.map +0 -1
  234. package/dist/types/src/MockDeviationSummary.d.ts +0 -1
  235. package/dist/types/src/MockDeviationSummary.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- import{__assign as i}from"tslib";import{jsxs as o,jsx as e,Fragment as n}from"react/jsx-runtime";import{ChevronUp as t,ChevronDown as l}from"lucide-react";import{useState as r,useMemo as d}from"react";import a from"./ResizableSplitPane.js";import u from"../PdfViewer/PdfViewer.js";import{DefaultFullScreenCloseIcon as s,DefaultFullScreenIcon as c}from"../../assests/svg/PdfViewerIcons.js";import p from"react-markdown";import g from"rehype-raw";import{Box as m}from"@mui/material";import{SHARED_MARKDOWN_STYLES as h}from"./CognitiveCompareConfig.js";import"react-dom";import{useCompareContext as v}from"./CompareContext.js";import{processGuidelinesMarkdown as f}from"./Guidelines/utils/processGuidelinesMarkdown.js";import"./MoreFunctionsPopup.js";import"./components/SubSectionAccordion.js";import"./components/LHSSectionRow.js";import"./components/RHSSectionRow.js";var _=function(o){var t,l,r,s,c,_,x,b=o.href,y=o.metaData,F=o.citationTitle,w=o.citationType,C=o.citationReason,P=o.isFullscreen,S=v().guidelinesData,R=function(i){try{var o=new URL(i,window.location.origin);return{citationNumber:o.searchParams.get("citationNumber"),phraseToHighlight:o.searchParams.get("phrase_to_highlight")}}catch(i){return{citationNumber:null,phraseToHighlight:null}}}(b),j=R.citationNumber,k=R.phraseToHighlight,D=j&&(null===(t=null==y?void 0:y.citations)||void 0===t?void 0:t[j])||{},T=(null===(l=null==y?void 0:y.docData)||void 0===l?void 0:l.documents)||{},H=(null===(r=null==y?void 0:y.docData)||void 0===r?void 0:r.input_index_map)||{},z=null==H?void 0:H[0],A=null==H?void 0:H[1],E=z?T[z]:null,N=A?T[A]:null,I=z?D[z]:null,V=A?D[A]:null,W=d(function(){var i,o,n,t;return I&&E?e(u,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:null==E?void 0:E.title,pdfUrl:null==E?void 0:E.signed_url,highlightText:[null!==(i=null==I?void 0:I.highlighted_text)&&void 0!==i?i:""],highlightPages:{1:null===(o=null==I?void 0:I.custom_metadata)||void 0===o?void 0:o.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(n=null==I?void 0:I.custom_metadata)||void 0===n?void 0:n.pdf_start_page_number,null===(t=null==I?void 0:I.custom_metadata)||void 0===t?void 0:t.pdf_end_page_number]}):null},[null==E?void 0:E.title,null==E?void 0:E.signed_url,null==I?void 0:I.highlighted_text,null===(s=null==I?void 0:I.custom_metadata)||void 0===s?void 0:s.pdf_start_page_number,null===(c=null==I?void 0:I.custom_metadata)||void 0===c?void 0:c.pdf_end_page_number]),B=d(function(){var i,o,n,t;return V&&N?e(u,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:null==N?void 0:N.title,pdfUrl:null==N?void 0:N.signed_url,jumpToPageValue:1,highlightText:[null!==(i=null==V?void 0:V.highlighted_text)&&void 0!==i?i:""],highlightPages:{1:null===(o=null==V?void 0:V.custom_metadata)||void 0===o?void 0:o.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(n=null==V?void 0:V.custom_metadata)||void 0===n?void 0:n.pdf_start_page_number,null===(t=null==V?void 0:V.custom_metadata)||void 0===t?void 0:t.pdf_end_page_number]}):null},[null==N?void 0:N.title,null==N?void 0:N.signed_url,null==V?void 0:V.highlighted_text,null===(_=null==V?void 0:V.custom_metadata)||void 0===_?void 0:_.pdf_start_page_number,null===(x=null==V?void 0:V.custom_metadata)||void 0===x?void 0:x.pdf_end_page_number]),U=d(function(){if(!W)return null;var o="rulebook_citation"===w?e(n,{children:e(m,i({sx:i(i({padding:"0px 20px",backgroundColor:"#FFFFFF",borderRadius:"8px"},h),{overflow:"auto"})},{children:e(p,i({rehypePlugins:[g]},{children:f({guidelinesData:S,targetHighlights:[k],labelColor:"#FEF08A"})}))}))}):B;return o?e(a,{leftComponent:W,rightComponent:o,isFullscreen:P}):W},[W,B,w,P]);return j?"rulebook_citation"===w?e("div",I?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:U}):i({style:{padding:"12px",fontSize:"13px",color:"#344054",lineHeight:1.5}},{children:C||"Rulebook citation selected."})):["contract","clause"].includes(F)?e("div",I||V?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:U}):{children:"Missing PDF Citation. Please try again later"}):e("div",{children:"No Citation Found. Please try again later"}):null},x=function(n){var d,a,u,p=n.href,g=n.children,m=n.citationType,h=n.citationReason,v=n.metaData,f=n.chevronUpComponent,x=void 0===f?null:f,b=n.chevronDownComponent,y=void 0===b?null:b,F=n.customStyle,w=void 0===F?{}:F,C=n.defaultState,P=r(void 0!==C&&C),S=P[0],R=P[1],j=r(!1),k=j[0],D=j[1],T="string"==typeof g&&(null===(d=null==g?void 0:g.split("\n"))||void 0===d?void 0:d.length)>1?g.split("\n").join(" "):g,H="string"==typeof g?g:g[0],z=null!=x?x:function(i){var o,n;return e(t,{size:null!==(o=null==i?void 0:i.fontSize)&&void 0!==o?o:16,color:null!==(n=null==i?void 0:i.color)&&void 0!==n?n:"rgb(214, 51, 132)"})}(null!==(a=null==w?void 0:w.arrow)&&void 0!==a?a:{}),A=null!=y?y:function(i){var o,n;return e(l,{size:null!==(o=null==i?void 0:i.fontSize)&&void 0!==o?o:16,color:null!==(n=null==i?void 0:i.color)&&void 0!==n?n:"rgb(214, 51, 132)"})}(null!==(u=null==w?void 0:w.arrow)&&void 0!==u?u:{});return o("span",i({style:i({display:"inline"},w.relativeWrapper||{})},{children:[e("div",i({style:i({display:"inline",marginTop:0},w.citationButtonWrapper||{})},{children:o("button",i({type:"button",onClick:function(){return R(function(i){return!i})},style:i({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"},w.citationButton||{})},{children:[e("span",{children:T}),e("span",i({style:{display:"flex",alignItems:"center"}},{children:S?z:A}))]}))})),S&&o("div",i({style:k?{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:[e("div",i({style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:e("button",i({onClick:function(){D(function(i){return!i})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:e(k?s:c,{})}))})),e("div",i({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:e(_,{href:p,children:g,metaData:v,citationTitle:H,citationType:m,citationReason:h,isFullscreen:k})}))]}))]}))};export{x as default};
1
+ import{__assign as i,__awaiter as n,__generator as o}from"tslib";import{jsxs as t,jsx as e,Fragment as l}from"react/jsx-runtime";import{Globe as r,ChevronUp as a,ChevronDown as d,Maximize2 as u,X as c,ExternalLink as s}from"lucide-react";import{useState as v,useMemo as p,useRef as m,useEffect as h}from"react";import g from"./ResizableSplitPane.js";import f from"../PdfViewer/PdfViewer.js";import{DefaultFullScreenCloseIcon as x,DefaultFullScreenIcon as b}from"../../assests/svg/PdfViewerIcons.js";import _ from"react-markdown";import y from"rehype-raw";import{Box as C}from"@mui/material";import{SHARED_MARKDOWN_STYLES as w}from"./CognitiveCompareConfig.js";import"react-dom";import{useCompareContext as D}from"./CompareContext.js";import{processGuidelinesMarkdown as S}from"./Guidelines/utils/processGuidelinesMarkdown.js";import F from"../GptWebCitation/GptWebCitation.js";import{CitationType as T}from"../GptWebCitation/types.js";import"./MoreFunctionsPopup.js";import"./components/SubSectionAccordion.js";import"./components/LHSSectionRow.js";import"./components/RHSSectionRow.js";var I=function(i){var n,o,t;return(null===(t=null===(o=null===(n=(null==i?void 0:i.extraMetaData)||i)||void 0===n?void 0:n.aiReasoningCitation)||void 0===o?void 0:o.gpt_citation)||void 0===t?void 0:t[0])||null},P="https://dev-proposals-ai.techo.camp/utility/ca-workflow-composer-agent/get_citation",j="sai.siddhartha@techolution.com",k="672e32f7a0e8fe2e8e50bcba",N="TNV Sai Siddhartha",R=function(){var i;return"function"==typeof(null===(i=globalThis.crypto)||void 0===i?void 0:i.randomUUID)?globalThis.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var n=Math.floor(16*Math.random());return("x"===i?n:n%4+8).toString(16)})},E=function(i,n){var o=function(i){var n;return(null==i?void 0:i.payloadCitationId)||(null===(n=null==i?void 0:i.extraMetaData)||void 0===n?void 0:n.payloadCitationId)||""}(i)||n||R();return function(i,n){i&&"object"==typeof i&&(i.payloadCitationId=n,i.extraMetaData&&"object"==typeof i.extraMetaData&&(i.extraMetaData.payloadCitationId=n))}(i,o),o},M=function(t){var l,r=t.metaData,g=D().gptWebCitationConfig,f=p(function(){return function(i){return{endpoint:(null==i?void 0:i.endpoint)||P,userEmail:(null==i?void 0:i.userEmail)||j,userId:(null==i?void 0:i.userId)||k,userName:(null==i?void 0:i.userName)||N,headers:null==i?void 0:i.headers}}(g)},[g]),x=null==r?void 0:r.webGpt,b=m(null);b.current||(b.current=R());var _=p(function(){return function(i,n,o){var t,e,l=I(i),r=(null==l?void 0:l.customMetaData)||{},a=(null==r?void 0:r.value)||{},d=(null==i?void 0:i.webSearchAnswer)||{},u=(null==i?void 0:i.extraMetaData)||i||{};return{userEmail:(null==i?void 0:i.userEmail)||(null==d?void 0:d.userEmail)||(null==n?void 0:n.userEmail)||"",userId:(null==i?void 0:i.userId)||(null==d?void 0:d.userId)||(null==n?void 0:n.userId)||"",userName:(null==i?void 0:i.userName)||(null==d?void 0:d.userName)||(null==n?void 0:n.userName)||"",citationId:E(i,o),citationUrl:(null==a?void 0:a.citationUrl)||(null==d?void 0:d.citationUrl)||"",content:(null==u?void 0:u.Reasoning)||(null==d?void 0:d.enhanced_content)||"",citationType:(null==a?void 0:a.citationType)||"web",citatioNumber:null!==(e=null!==(t=null==r?void 0:r.citation_number)&&void 0!==t?t:null==l?void 0:l.citation_number)&&void 0!==e?e:Number((null==i?void 0:i.reasoningId)||0)}}(x,f,b.current||void 0)},[x,f]),y=p(function(){return I(x)},[x]),C=(null===(l=null==y?void 0:y.customMetaData)||void 0===l?void 0:l.value)||{},w=(null==x?void 0:x.extraMetaData)||x||{},S=v(),M=S[0],U=S[1],G=v("pending"),z=G[0],W=G[1],A=v(!0),H=A[0],V=A[1];h(function(){var t=!0;return n(void 0,void 0,void 0,function(){var n,e,l,r;return o(this,function(o){switch(o.label){case 0:if(!f.endpoint||!(null==_?void 0:_.citationUrl)||!(null==_?void 0:_.content))return W("error"),[2];W("pending"),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(f.endpoint,{method:"POST",headers:i({"actor-id":_.userEmail,Accept:"application/json, text/plain, */*","Content-Type":"application/json"},f.headers||{}),body:JSON.stringify(_)})];case 2:if(!(n=o.sent()).ok)throw new Error("Failed to fetch GPT web citation (".concat(n.status,")"));return[4,n.json()];case 3:return e=o.sent(),l=(null==e?void 0:e.responseData)||(null==e?void 0:e.result)||(null==e?void 0:e.data)||e,t?(U(l),W("success"),[3,5]):[2];case 4:return r=o.sent(),t?(console.error("Failed to load GPT web citation",r),W("error"),[3,5]):[2];case 5:return[2]}})}),function(){t=!1}},[_,f]);var O=p(function(){return{item:{confidence_score:Number((null==w?void 0:w.Confidence_score)||0),text:(null==C?void 0:C.paraphrase)||"Web citation reasoning",dataSource:(null==C?void 0:C.text)||(null==w?void 0:w.Reasoning)||"",paraphrase:(null==C?void 0:C.paraphrase)||""},headerTitle:"GPT Web Citation",index:Number((null==_?void 0:_.citatioNumber)||1)-1,iconsConfig:{ChevronDownIcon:d,ChevronUpIcon:a,MaximizeIcon:u,CloseIcon:c}}},[C,null==_?void 0:_.citatioNumber,w]);return e(F,{gptCitation:O,defaultCitationUrl:(null==_?void 0:_.citationUrl)||"",citationType:T.GPT_WEB,webCitationData:M,webCitationStatus:z,showWebCitation:H,onToggleCitationView:function(){return V(function(i){return!i})},iconsConfig:{MaximizeIcon:u,ExternalLinkIcon:s},isFixedHeight:!0})},U=function(n){var o,t,r,a,d,u,c,s=n.href,v=n.metaData,m=n.citationTitle,h=n.citationType,x=n.citationReason,b=n.isFullscreen,F=D().guidelinesData,T=function(i){try{var n=new URL(i,window.location.origin);return{citationNumber:n.searchParams.get("citationNumber"),phraseToHighlight:n.searchParams.get("phrase_to_highlight")}}catch(i){return{citationNumber:null,phraseToHighlight:null}}}(s),I=T.citationNumber,P=T.phraseToHighlight,j=I&&(null===(o=null==v?void 0:v.citations)||void 0===o?void 0:o[I])||{},k=(null===(t=null==v?void 0:v.docData)||void 0===t?void 0:t.documents)||{},N=(null===(r=null==v?void 0:v.docData)||void 0===r?void 0:r.input_index_map)||{},R=Object.keys((null==v?void 0:v.citations)||{}).length>0||Object.keys((null==v?void 0:v.docData)||{}).length>0,E=null==N?void 0:N[0],U=null==N?void 0:N[1],G=E?k[E]:null,z=U?k[U]:null,W=E?j[E]:null,A=U?j[U]:null,H=p(function(){var i,n,o,t;return W&&G?e(f,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:null==G?void 0:G.title,pdfUrl:null==G?void 0:G.signed_url,highlightText:[null!==(i=null==W?void 0:W.highlighted_text)&&void 0!==i?i:""],highlightPages:{1:null===(n=null==W?void 0:W.custom_metadata)||void 0===n?void 0:n.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(o=null==W?void 0:W.custom_metadata)||void 0===o?void 0:o.pdf_start_page_number,null===(t=null==W?void 0:W.custom_metadata)||void 0===t?void 0:t.pdf_end_page_number]}):null},[null==G?void 0:G.title,null==G?void 0:G.signed_url,null==W?void 0:W.highlighted_text,null===(a=null==W?void 0:W.custom_metadata)||void 0===a?void 0:a.pdf_start_page_number,null===(d=null==W?void 0:W.custom_metadata)||void 0===d?void 0:d.pdf_end_page_number]),V=p(function(){var i,n,o,t;return A&&z?e(f,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:null==z?void 0:z.title,pdfUrl:null==z?void 0:z.signed_url,jumpToPageValue:1,highlightText:[null!==(i=null==A?void 0:A.highlighted_text)&&void 0!==i?i:""],highlightPages:{1:null===(n=null==A?void 0:A.custom_metadata)||void 0===n?void 0:n.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(o=null==A?void 0:A.custom_metadata)||void 0===o?void 0:o.pdf_start_page_number,null===(t=null==A?void 0:A.custom_metadata)||void 0===t?void 0:t.pdf_end_page_number]}):null},[null==z?void 0:z.title,null==z?void 0:z.signed_url,null==A?void 0:A.highlighted_text,null===(u=null==A?void 0:A.custom_metadata)||void 0===u?void 0:u.pdf_start_page_number,null===(c=null==A?void 0:A.custom_metadata)||void 0===c?void 0:c.pdf_end_page_number]),O=p(function(){if(!H)return null;var n="rulebook_citation"===h?e(l,{children:e(C,i({sx:i(i({padding:"0px 20px",backgroundColor:"#FFFFFF",borderRadius:"8px"},w),{overflow:"auto"})},{children:e(_,i({rehypePlugins:[y]},{children:S({guidelinesData:F,targetHighlights:[P],labelColor:"#FEF08A"})}))}))}):V;return n?e(g,{leftComponent:H,rightComponent:n,isFullscreen:b}):H},[H,V,h,b]);return(null==v?void 0:v.webGpt)&&!R?e(M,{metaData:v}):I?"rulebook_citation"===h?e("div",W?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:O}):i({style:{padding:"12px",fontSize:"13px",color:"#344054",lineHeight:1.5}},{children:x||"Rulebook citation selected."})):["contract","clause"].includes(m)?e("div",W||A?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:O}):{children:"Missing PDF Citation. Please try again later"}):e("div",{children:"No Citation Found. Please try again later"}):null},G=function(n){var o,l,u,c,s,p,m,h=n.href,g=n.children,f=n.citationType,_=n.citationReason,y=n.metaData,C=n.chevronUpComponent,w=void 0===C?null:C,D=n.chevronDownComponent,S=void 0===D?null:D,F=n.customStyle,T=void 0===F?{}:F,I=n.defaultState,P=v(void 0!==I&&I),j=P[0],k=P[1],N=v(!1),R=N[0],E=N[1],M="string"==typeof g&&(null===(o=null==g?void 0:g.split("\n"))||void 0===o?void 0:o.length)>1?g.split("\n").join(" "):g,G="string"==typeof g?g:g[0],z=null!=w?w:function(i){var n,o;return e(a,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(o=null==i?void 0:i.color)&&void 0!==o?o:"rgb(214, 51, 132)"})}(null!==(l=null==T?void 0:T.arrow)&&void 0!==l?l:{}),W=null!=S?S:function(i){var n,o;return e(d,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(o=null==i?void 0:i.color)&&void 0!==o?o:"rgb(214, 51, 132)"})}(null!==(u=null==T?void 0:T.arrow)&&void 0!==u?u:{});return t("span",i({style:i({display:"inline"},T.relativeWrapper||{})},{children:[e("div",i({style:i({display:"inline",marginTop:0},T.citationButtonWrapper||{})},{children:t("button",i({type:"button",onClick:function(){return k(function(i){return!i})},style:i({display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:(null==y?void 0:y.webGpt)?600:700,color:(null==y?void 0:y.webGpt)?"#6D28D9":"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},T.citationButton||{})},{children:[(null==y?void 0:y.webGpt)&&e("span",i({style:{display:"inline-flex",alignItems:"center",lineHeight:0,verticalAlign:"middle"}},{children:e(r,{size:null!==(s=null===(c=T.arrow)||void 0===c?void 0:c.fontSize)&&void 0!==s?s:14,color:null!==(m=null===(p=T.arrow)||void 0===p?void 0:p.color)&&void 0!==m?m:"#6D28D9",style:{display:"block",flexShrink:0}})})),e("span",{children:M}),e("span",i({style:{display:"flex",alignItems:"center"}},{children:j?z:W}))]}))})),j&&t("div",i({style:R?{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:[e("div",i({style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:e("button",i({onClick:function(){E(function(i){return!i})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:e(R?x:b,{})}))})),e("div",i({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:e(U,{href:h,children:g,metaData:y,citationTitle:G,citationType:f,citationReason:_,isFullscreen:R})}))]}))]}))};export{G as default};
2
2
  //# sourceMappingURL=CitationAnchor.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as n,__awaiter as i,__generator as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as l,useRef as u,useMemo as c,useEffect as a,useCallback as s}from"react";import{Box as d,Snackbar as v,Alert as f,Tooltip as p,Typography as g}from"@mui/material";import{ChevronDown as h}from"lucide-react";import{ButtonCognitiveIcon as m}from"../../assests/svg/ButtonCognitiveIcon.js";import S from"./OverlayComponent.js";import{safeStringify as x,extractDeviationScore as R,generateColorPalette as y,findKeyPathByNodeId as b,DEVIATION_BADGE_SEPARATOR as C,hasMeaningfulRedlineTags as w,scrollAndHighlightClause as B,scrollAndWait as _,waitForScrollIdle as I}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as F,DEFAULT_FIELD_CONFIG as E,DEFAULT_COMPARISON_CONFIG as T}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as A,EMPTY_SUMMARY_POPUP_STATE as D,DEFAULT_COMPONENT_HEADER_TEXT as k}from"./CognitiveCompareConstants.js";import O from"./CognitivePopup.js";import P from"./MoreFunctionsPopup.js";import j from"./LoaderComponent.js";import L from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as N}from"./hooks/useCompareData.js";import{useComparePopups as M}from"./hooks/useComparePopups.js";import{useSectionRefs as H}from"./hooks/useSectionRefs.js";import{useAccordionState as z}from"./hooks/useAccordionState.js";import{useDeviationNavigation as q}from"./hooks/useDeviationNavigation.js";import V from"./components/CompareHeader.js";import W from"./components/SubSectionAccordion.js";import G from"./components/LHSSectionRow.js";import K from"./components/RHSSectionRow.js";import Y from"./components/CognitiveSummaryPopup.js";import{CompareContextProvider as J}from"./CompareContext.js";import{useStyleHelpers as X}from"./hooks/useStyles.js";import{useResizeHandler as $}from"./hooks/useResizeHandler.js";import{useLinesCalculator as U}from"./hooks/useLinesCalculator.js";import{useSideBySide as Q}from"./hooks/useSideBySide.js";import Z from"./components/SvgConnectors.js";import ee from"./Guidelines/components/GuidelinePanel.js";var ne=function(ne){var ie,te,oe,re,le,ue,ce,ae,se,de,ve,fe,pe,ge,he,me,Se,xe,Re,ye,be,Ce,we,Be,_e,Ie,Fe,Ee,Te,Ae,De,ke,Oe,Pe,je,Le=ne.componentHeaderText,Ne=void 0===Le?k:Le,Me=ne.treeData,He=ne.comparisonConfig,ze=ne.leftColumnTitleText,qe=ne.rightColumnTitleText,Ve=ne.markdownStyles,We=ne.resetTrigger,Ge=ne.displayConfig,Ke=void 0===Ge?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0,isStreamingEnabled:!1}:Ge,Ye=ne.onMaintainRelativeOrderChange,Je=ne.popupConfig,Xe=ne.deviationData,$e=void 0===Xe?{}:Xe,Ue=ne.deviationNodeIdToView,Qe=ne.resetDeviationNodeId,Ze=ne.isProposingFix,en=void 0!==Ze&&Ze,nn=ne.proposingFixNodeId,tn=ne.isRedlineFlow,on=ne.badgeStyleOverride,rn=ne.guidelinesData,ln=l(Ke.maintainRelativeOrder),un=ln[0],cn=ln[1],an=null!==(ie=null==Ke?void 0:Ke.expandLevels)&&void 0!==ie?ie:0,sn=!!(null==Ke?void 0:Ke.expandAllSections),dn=!!un||!!(null==Ke?void 0:Ke.showDeviationBadges),vn=l(!1),fn=vn[0],pn=vn[1],gn=l(null),hn=gn[0],mn=gn[1],Sn=l(null===(oe=null!==(te=null==Me?void 0:Me.newEvaluationResult)&&void 0!==te?te:null==Ke?void 0:Ke.enableDeviationSchemaBackwardCompatibility)||void 0===oe||oe)[0],xn=l(new Set),Rn=xn[0],yn=xn[1],bn=l([]),Cn=bn[0],wn=bn[1],Bn=l(!1),_n=Bn[0],In=Bn[1],Fn=u(null),En=u(null),Tn=u(null),An=u(null),Dn=u(null),kn=u(!1),On=u(null),Pn=u({}),jn=u([]),Ln=u(function(){}),Nn=u(null),Mn=u(function(){}),Hn=c(function(){return JSON.stringify($e||{})},[JSON.stringify($e)]),zn=c(function(){return $e||{}},[Hn]),qn=c(function(){return(null==Me?void 0:Me.cognitive_decisioning)||{}},[Me]),Vn=c(function(){return e(e({},F),Ve)},[Ve]),Wn=u(null),Gn=u(null),Kn=u(null),Yn=u(null),Jn=u(null),Xn=u(null),$n=u(null),Un=u(null),Qn=u(null),Zn=u(null),ei=M(Wn),ni=ei.cognitivePopup,ii=ei.setCognitivePopup,ti=ei.moreFunctions,oi=ei.setMoreFunctions,ri=ei.position,li=ei.setPosition,ui=ei.activeBadgeId,ci=ei.summaryPopup,ai=ei.setSummaryPopup,si=ei.closeSummaryPopup,di=ei.setActiveBadgeId,vi=ei.popupRef,fi=ei.handleOpenCognitiveCompare,pi=ei.openCognitivePopupFromState,gi=ei.closeCognitivePopup,hi=ei.closeMoreFunctionsPopup,mi=c(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==He?void 0:He.fields)&&void 0!==e?e:E,thresholds:{high:null!==(i=null===(n=null==He?void 0:He.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:T.thresholds.high,medium:null!==(o=null===(t=null==He?void 0:He.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:T.thresholds.medium,exact:null!==(l=null===(r=null==He?void 0:He.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:T.thresholds.exact}}},[He]),Si=l(null),xi=Si[0];Si[1];var Ri=null===(ue=null===(re=null==Me?void 0:Me.documents)||void 0===re?void 0:re[null===(le=null==Me?void 0:Me.input_index_map)||void 0===le?void 0:le[0]])||void 0===ue?void 0:ue.title,yi=null===(se=null===(ce=null==Me?void 0:Me.documents)||void 0===ce?void 0:ce[null===(ae=null==Me?void 0:Me.input_index_map)||void 0===ae?void 0:ae[1]])||void 0===se?void 0:se.title,bi=x(ze||Ri||"Uploaded Contract"),Ci=null===(pe=null===(fe=null===(de=null==Me?void 0:Me.documents)||void 0===de?void 0:de[null===(ve=null==Me?void 0:Me.input_index_map)||void 0===ve?void 0:ve[0]])||void 0===fe?void 0:fe.metadata)||void 0===pe?void 0:pe.file_name,wi=x(Ci),Bi=null===(Se=null===(me=null===(ge=null==Me?void 0:Me.documents)||void 0===ge?void 0:ge[null===(he=null==Me?void 0:Me.input_index_map)||void 0===he?void 0:he[1]])||void 0===me?void 0:me.metadata)||void 0===Se?void 0:Se.file_name,_i=x(Bi),Ii=x(qe||yi||"Reference Template"),Fi=N(Me,un,zn,mi,Sn,rn),Ei=Fi.isGuidelineMode,Ti=Fi.activeProposed,Ai=Fi.existingRule,Di=Fi.proposedSections,ki=Fi.existingSections,Oi=Fi.visibleFields,Pi=Fi.parentDeviationRecord,ji=Fi.deviationNumberRegistry,Li=Fi.deviationParentRegistry,Ni=Fi.parseError;a(function(){Ni&&mn("Failed to load comparison: ".concat(Ni))},[Ni]);var Mi=Di.length>0||ki.length>0,Hi=c(function(){if(!tn)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";w(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(Di),i(ki),"".concat(e,":").concat(n)},[tn,Di,ki]);a(function(){if(Di.length||ki.length)if(sn){var e={},n={},i=function(i,t){i.forEach(function(i,o){var r,l=un?"".concat(t,"-").concat(o):String(o);e[l]=!0;var u=function(e,i){null==e||e.forEach(function(e,t){var o,r="".concat(i,"-").concat(t);n[r]=!0,(null===(o=e.subsections)||void 0===o?void 0:o.length)&&u(e.subsections,r)})};(null===(r=i.subsections)||void 0===r?void 0:r.length)&&u(i.subsections,String(o))})};i(Di,"left"),i(ki,"right"),bt(e),wt(n)}else if(an>0){var t={},o={},r=function(e,n,i){e.forEach(function(e,r){var l;if(i>=1){var u=un?"".concat(n,"-").concat(r):String(r);t[u]=!0}var c=function(e,n,t){t>i||null==e||e.forEach(function(e,i){var r,l="".concat(n,"-").concat(i);o[l]=!0,(null===(r=e.subsections)||void 0===r?void 0:r.length)&&c(e.subsections,l,t+1)})};(null===(l=e.subsections)||void 0===l?void 0:l.length)&&i>=2&&c(e.subsections,String(r),2)})};r(Di,"left",an),r(ki,"right",an),bt(t),wt(o)}},[sn,an,Di,ki,un]);var zi=H(Oi.map(function(e){return e.key}),Math.max(Di.length,ki.length)),qi=zi.leftRefs,Vi=zi.rightRefs,Wi=zi.sectionLeftRefs,Gi=zi.sectionRightRefs,Ki=zi.lhsBadgeRefs,Yi=zi.rhsBadgeRefs,Ji=zi.sectionRightRowRefs,Xi=zi.subSectionLeftRefs,$i=zi.subSectionRightRefs,Ui=zi.sectionRowRefs,Qi=zi.getSectionRowRef,Zi=zi.getSubSectionRef,et=zi.getBadgeRef,nt=Q({isGuidelineMode:Ei,maintainRelativeOrder:un,proposedSections:Di,existingSections:ki,leftContainerRef:Un,rightContainerRef:Kn,scrollContainerRef:Wn,sectionLeftRefs:Wi,sectionRightRefs:Gi,subSectionLeftRefs:Xi,subSectionRightRefs:$i,lhsBadgeRefs:Ki,rhsBadgeRefs:Yi,sectionRowRefs:Ui,sectionRightRowRefs:Ji,rhsTopSpacerRef:Yn,rhsBottomSpacerRef:Jn,lhsTopSpacerRef:Xn,lhsBottomSpacerRef:$n,calculateLinesRef:Ln,setConnectedSections:yn,setConnectedLines:wn,cachedConnectedPositions:jn,closeMoreFunctionsPopup:hi,setErrorToast:mn,moreFunctions:ti,closeSummaryPopup:si}),it=nt.isSideBySide,tt=nt.isArrowVisible,ot=nt.setIsArrowVisible,rt=nt.isResizing,lt=nt.setIsResizing,ut=nt.isSideBySideLoading,ct=nt.activeSideBySideSection,at=nt.scrollLock,st=nt.sideBySideCacheRef,dt=nt.isSideBySideRef,vt=nt.activeSideBySideRightSectionRef,ft=nt.activeSideBySideSectionRef,pt=nt.sideBySideLineRef,gt=nt.highlightedClauseRefs,ht=nt.clearClauseHighlight,mt=nt.resetSideBySide,St=nt.activateSideBySide,xt=u(St);a(function(){xt.current=St},[St]);var Rt=z({maintainRelativeOrder:!!un,proposedSections:Di,existingSections:ki,activeSideBySideSection:ct,connectedSections:Rn,resetSideBySide:mt,setConnectedSections:yn,setConnectedLines:wn,cachedConnectedPositions:jn,svgContainerRef:Fn,isAnimatingRef:kn,animationTimerRef:On,calculateLinesRef:Ln,sectionLeftRefs:Wi,sectionRightRefs:Gi,subSectionLeftRefs:Xi,subSectionRightRefs:$i}),yt=Rt.expandedSections,bt=Rt.setExpandedSections,Ct=Rt.expandedSubSections,wt=Rt.setExpandedSubSections,Bt=Rt.handleSubSectionToggle,_t=Rt.toggleSection,It=Rt.forceExpandCrossWiredSections,Ft=function(){var e,n;if(null!=ct){var i=null===(e=Wi.current[ct])||void 0===e?void 0:e.current,t=null===(n=Gi.current[ct])||void 0===n?void 0:n.current,o=Kn.current;if(i&&t&&o){var r=i.getBoundingClientRect(),l=t.getBoundingClientRect(),u=o.getBoundingClientRect(),c=r.top-u.top,a=l.top-u.top-c;o.scrollBy({top:a,behavior:"smooth"})}}},Et=s(function(e){null==e||e.stopPropagation(),In(function(e){var n=!e;return n&&requestAnimationFrame(function(){Ft()}),n})},[Ft]);a(function(){tn&&"off"!==Hi&&"0:0"!==Hi&&(st.current=null,jn.current=[],requestAnimationFrame(function(){var e;null===(e=Ln.current)||void 0===e||e.call(Ln)}))},[tn,Hi]);var Tt=c(function(){var e=new Map,n=new Map,i=1;if(un)Di.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),ki.forEach(function(t){if(t.id&&!(!t.title&&!t.content)){var o=Di.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(Di.length,ki.length),o=0;o<t;o++){var r=Di[o],l=ki[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[Di,ki,un]),At=Ai.analysis,Dt=x(null===(Re=null===(xe=null==At?void 0:At.rule_difference_comparison)||void 0===xe?void 0:xe.summary)||void 0===Re?void 0:Re.overall_summary),kt=!!Dt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Ot=null!==(ye=null==Me?void 0:Me.base_root_id)&&void 0!==ye?ye:"-1";null==Me||Me[Ot];var Pt=Sn?null!==(ke=null!==(Te=$e&&(null===(Ee=null==$e?void 0:$e[Ot])||void 0===Ee?void 0:Ee.evaluation_result))&&void 0!==Te?Te:null===(De=null===(Ae=null==Me?void 0:Me.nodes)||void 0===Ae?void 0:Ae[Ot])||void 0===De?void 0:De.evaluation_result)&&void 0!==ke?ke:null:null!==(Fe=null!==(we=$e&&(null===(Ce=null===(be=null==$e?void 0:$e[Ot])||void 0===be?void 0:be.evaluation_result)||void 0===Ce?void 0:Ce[0]))&&void 0!==we?we:null===(Ie=null===(_e=null===(Be=null==Me?void 0:Me.nodes)||void 0===Be?void 0:Be[Ot])||void 0===_e?void 0:_e.evaluation_result)||void 0===Ie?void 0:Ie[0])&&void 0!==Fe?Fe:null,jt=R(Pt),Lt=y(null!==(je=null===(Pe=null===(Oe=null==Pt?void 0:Pt.evaluation_outputs)||void 0===Oe?void 0:Oe.metadata)||void 0===Pe?void 0:Pe.label_color)&&void 0!==je?je:A);if(on){var Nt=on(jt);Nt&&(Lt=e(e({},Lt),{badgeBg:Nt.bg,badgeText:Nt.text,badgeBorder:Nt.border}))}var Mt=u(mt);a(function(){Mt.current=mt},[mt]);var Ht=u(gi);a(function(){Ht.current=gi},[gi]);var zt=s(function(e,n,i,t,o,r){return Yo.current(e,n,i,t,o,r)},[]),qt=s(function(e,n,i,t,o){return Xo.current(e,n,i,t,o)},[]),Vt=s(function(){return $o.current()},[]),Wt=s(function(e,n){return Uo.current(e,n)},[]),Gt=s(function(e){return Qo.current(e)},[]),Kt=s(function(e){return Zo.current(e)},[]),Yt=s(function(){return er.current()},[]),Jt=s(function(){var e,n;ht(),null===(e=Mt.current)||void 0===e||e.call(Mt),In(!1),yn(new Set),wn([]),jn.current=[],po([]),ho(null),ai(D),null===(n=Ht.current)||void 0===n||n.call(Ht),requestAnimationFrame(function(){var e;null===(e=Ln.current)||void 0===e||e.call(Ln)})},[]),Xt=u(Jt);a(function(){Xt.current=Jt},[Jt]),a(function(){We&&Xt.current()},[We]);var $t=c(function(){return{documents:null==Me?void 0:Me.documents,input_index_map:null==Me?void 0:Me.input_index_map}},[JSON.stringify(null==Me?void 0:Me.documents),JSON.stringify(null==Me?void 0:Me.input_index_map)]),Ut=u(Me);a(function(){Ut.current=Me},[Me]);var Qt=u(qn);a(function(){Qt.current=qn},[qn]);var Zt=s(function(n,i,t,o,r,l,u){var c,a,s,d,v,f,p,g,h,m,S,R,y=x(null==i?void 0:i.id)||x(null==t?void 0:t.id)||"",b=(y?null===(c=Qt.current)||void 0===c?void 0:c[y]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:y,decisioning:[],gap:[],relevance_score:0},w=null!==(s=null===(a=Ui.current[o])||void 0===a?void 0:a.current)&&void 0!==s?s:null,B=function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e(e({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(C)))return u(l);var c=o.split(C)[1];if(!c)return l;var a=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},s=(null===(n=null==a?void 0:a.deviation_entries)||void 0===n?void 0:n[c])||(null===(r=null==a?void 0:a.deviations)||void 0===r?void 0:r[c])||null;return s?e(e(e({},a),s),{deviation_summary:(null==s?void 0:s.deviation_summary)||(null==a?void 0:a.deviation_summary),deviation_title:(null==s?void 0:s.deviation_title)||(null==a?void 0:a.deviation_title),deviation_impact:(null==s?void 0:s.deviation_impact)||(null==a?void 0:a.deviation_impact),deviation_explanation:(null==s?void 0:s.deviation_explanation)||(null==a?void 0:a.deviation_explanation),evaluation_outputs:(null==s?void 0:s.evaluation_outputs)||(null==a?void 0:a.evaluation_outputs),cognitive_decisioning:(null==s?void 0:s.cognitive_decisioning)||(null==a?void 0:a.cognitive_decisioning)}):u(l)}(),_=(null!==(f=null===(v=null===(d=null==B?void 0:B.cognitive_decisioning)||void 0===d?void 0:d.decisioning_factors)||void 0===v?void 0:v.length)&&void 0!==f?f:0)>0||(null!==(h=null===(g=null===(p=null==B?void 0:B.cognitive_decisioning)||void 0===p?void 0:p.gaps_in_decision)||void 0===g?void 0:g.length)&&void 0!==h?h:0)>0,I=null!==(m=null==Ke?void 0:Ke.isLoading)&&void 0!==m&&m,F=!0;if(Ei)if(B&&Object.keys(B).length>0){var E=Array.isArray(B)?B[0]:B,T=null===(R=null===(S=null==E?void 0:E.evaluation_outputs)||void 0===S?void 0:S.metadata)||void 0===R?void 0:R.is_orphan;!0!==T&&"true"!==T&&"Yes"!==T&&"yes"!==T||(F=!1)}else F=!1;return{isLoading:I&&!_,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:b,anchorEl:n,sectionAnchorEl:w,badgeStyle:l||null,sectionIdx:o,docData:$t,deviationData:B,isOrphan:!!r,hasGuidelineMatches:F}},[$t,null==Ke?void 0:Ke.isLoading,Ei]),eo=s(function(e,n,i,t,o,r){var l;if(e.stopPropagation(),ti.open&&ti.sectionIdx===o)hi();else{var u=e.currentTarget,c="left";(null===(l=Kn.current)||void 0===l?void 0:l.contains(u))&&(c="right");ht(),dt.current&&mt(),yn(new Set),wn([]),jn.current=[],gi(),ci.open?Io():si(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(C)){var r=o.split(C),l="".concat(r[0]).concat(C).concat(r[1]);return"right"===c?null===(e=Yi.current[l])||void 0===e?void 0:e.current:null===(n=Ki.current[l])||void 0===n?void 0:n.current}return"right"===c?null===(i=Yi.current[o])||void 0===i?void 0:i.current:null===(t=Ki.current[o])||void 0===t?void 0:t.current}()||u;oi(Zt(e,n,t,o,i,r))})}},[ti.open,ti.sectionIdx,hi,si,Zt]),no=s(function(){var e=ti.sectionIdx;ti.isOrphan,hi(),si(),null!==e&&(It(e),ht(),dt.current&&mt(),wn([]),jn.current=[],yn(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Ln.current&&Ln.current()},50))},[ti.sectionIdx,ti.isOrphan,hi,si,mt]),io=s(function(){var e=Dn.current;if(e){Dn.current=null;var n=Di.findIndex(function(n){return n.id===e}),i=ki.findIndex(function(n){return n.id===e}),t=-1===n?b(Di,e):null,o=-1===i?b(ki,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,u;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(u=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==u?u:null},c=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(gt.current.add(r),B(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(un)-1!==r&&Un.current&&c(function(){return u(n,t,Wi,Xi)},Un.current),-1!==l&&Kn.current&&c(function(){return u(i,o,Gi,$i)},Kn.current);else{var a=Wn.current;if(!a)return;c(function(){return-1!==r?u(n,t,Wi,Xi):u(i,o,Gi,$i)},a)}}},[Di,ki,un,Wi,Gi,Xi,$i,Un,Kn,Wn]),to=s(function(n){if(n){ht(),mt(),yn(new Set),wn([]),jn.current=[],si(),gi();var i=Di.findIndex(function(e){return e.id===n}),t=ki.findIndex(function(e){return e.id===n}),o=-1===i?b(Di,n):null,r=-1===t?b(ki,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;Dn.current=n,bt(function(n){var i,t=e({},n),o=!1;-1!==l&&(t[i=un?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=un?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),wt(function(n){var i=e({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){Dn.current===n&&oo.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[Di,ki,un,bt,wt,mt,si,gi]),oo=u(io);a(function(){oo.current=io},[io]);var ro=u(null);a(function(){if(xi){var e=mi.fields.find(function(e){return e.analysisKey===xi||e.key===xi});if(e){var n=qi.current[e.key]||Vi.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[xi,mi.fields]);var lo=s(function(e){var n,i,t,o,r,l,u,c,a,s=null===(n=null==At?void 0:At.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!s||!s[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=s[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[At]),uo=X({proposedSections:Di,existingSections:ki,maintainRelativeOrder:un,cognitiveMap:qn,deviationData:zn,treeData:Me,resolvedComparisonConfig:mi,badgeStyleOverride:on}),co=uo.getSectionCompareStyle,ao=uo.getSubSectionCompareStyle,so=uo.getDeviationStyleByKey,vo=U({containerRef:En,leftContainerRef:Un,rightContainerRef:Kn,svgContainerRef:Fn,pathRefs:Pn,leftHeaderRef:Tn,rightHeaderRef:An,proposedSections:Di,existingSections:ki,visibleFields:Oi,leftRefs:qi,rightRefs:Vi,sectionLeftRefs:Wi,sectionRightRefs:Gi,subSectionLeftRefs:Xi,subSectionRightRefs:$i,lhsBadgeRefs:Ki,rhsBadgeRefs:Yi,sectionRowRefs:Ui,expandedSections:yt,expandedSubSections:Ct,connectedSections:Rn,isSideBySide:it,activeSideBySideSection:ct,maintainRelativeOrder:un,isGuidelineMode:Ei,cognitiveMap:qn,getSectionCompareStyle:co,getSubSectionCompareStyle:ao,getDeviationStyleByKey:so,isArrowVisible:tt,isAnimatingRef:kn,isSideBySideRef:dt,sideBySideCacheRef:st,sideBySideLineRef:pt,activeSideBySideSectionRef:ft,activeSideBySideRightSectionRef:vt,connectedLines:Cn,setConnectedLines:wn,cachedConnectedPositions:jn,calculateLinesRef:Ln,resizeTimerRef:Nn,scrollLock:at,scrollSyncLocked:_n,handleResizeRef:Mn,activeProposed:Ti,existingRule:Ai,analysisData:At,pendingScrollTargetRef:Qn,pendingScrollCallbackRef:Zn,resolvedComparisonConfig:mi,getFieldData:lo}),fo=vo.lines,po=vo.setLines,go=vo.overallConnector,ho=vo.setOverallConnector,mo=vo.svgDimensions,So=vo.handleColumnScroll;a(function(){ci.anchorEl&&requestAnimationFrame(function(){requestAnimationFrame(function(){var e;null===(e=Ln.current)||void 0===e||e.call(Ln)})})},[ci.anchorEl,_n]);var xo=s(function(){ht(),In(!1),bt({}),wt({}),mt(),yn(new Set),wn([]),jn.current=[],si(),gi(),hi(),requestAnimationFrame(function(){Ln.current&&Ln.current()})},[bt,wt,mt,si,gi,hi]);a(function(){it||0!==Rn.size||In(!1)},[it,Rn]);var Ro=c(function(){return Object.values(yt).some(Boolean)||Object.values(Ct).some(Boolean)},[yt,Ct]),yo=u(null),bo=u(0),Co=u(0),wo=u(0),Bo=$({timerRef:yo,ruleComponentRef:Gn,scrollContainerRef:Wn,containerRef:En,maintainRelativeOrder:un,proposedSections:Di,existingSections:ki,isSideBySideRef:dt,activeSideBySideSectionRef:ft,activeSideBySideRightSectionRef:vt,sectionRowRefs:Ui,sectionRightRowRefs:Ji,sectionLeftRefs:Wi,sectionRightRefs:Gi,subSectionLeftRefs:Xi,subSectionRightRefs:$i,lhsBadgeRefs:Ki,rhsBadgeRefs:Yi,leftContainerRef:Un,rightContainerRef:Kn,calculateLinesRef:Ln,handleResizeRef:Mn,setIsResizing:lt,setIsArrowVisible:ot,sideBySideCacheRef:st,cachedConnectedPositions:jn}).handleResize;a(function(){Mn.current=Bo},[Bo,Mn]),a(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,u;i.current=null;var c=e[e.length-1];if(c){var a=null!==(u=null===(l=null===(r=c.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:c.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return Gn.current&&o.push(e(Gn.current,bo,n,function(){return Mn.current()},function(){})),Wn.current&&o.push(e(Wn.current,Co,i,function(){return Mn.current()},function(){return Ln.current()})),En.current&&o.push(e(En.current,wo,t,function(){return Mn.current()},function(){return Ln.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),a(function(){dt.current=it},[it]),a(function(){ft.current=ct},[ct]);var _o=s(function(){var e,n=ti.sectionIdx,i=ti.isOrphan;if(si(),null!=n){var t="left";ti.anchorEl&&(null===(e=Kn.current)||void 0===e?void 0:e.contains(ti.anchorEl))&&(t="right"),It(n),Ei&&yn(new Set([n])),St(n,i,{sourceSide:t,onReady:function(){Ei&&setTimeout(function(){return ko(String(n))},150)}})}},[St,ti.isOrphan,ti.sectionIdx,ti.anchorEl,si,It,Ei]),Io=s(function(){si(),mt(),yn(new Set),wn([]),jn.current=[]},[si,mt]),Fo=null!==ti.sectionIdx&&Rn.has(ti.sectionIdx),Eo=q({proposedSections:Di,existingSections:ki,parentDeviationRecord:Pi,expandedSections:yt,maintainRelativeOrder:!!un,scrollContainerRef:Wn,leftContainerRef:Un,rightContainerRef:Kn,lhsBadgeRefs:Ki,rhsBadgeRefs:Yi}),To=Eo.showDeviationNavigation,Ao=Eo.showOpenNodeRef,Do=Eo.adjustScrollForPopup,ko=s(function(e){var n,i,t=document.querySelectorAll('[id^="guideline-target-"]'),o=Un.current,r=Kn.current,l="string"==typeof e&&e.includes(C)?"".concat(e.split(C)[0]).concat(C).concat(e.split(C)[1]):e,u=(null===(n=Ki.current[l])||void 0===n?void 0:n.current)||(null===(i=Ki.current[e])||void 0===i?void 0:i.current);if(t.length>0&&u&&o&&r){var c=t[0];Xn.current&&(Xn.current.style.height="0px"),Yn.current&&(Yn.current.style.height="0px"),$n.current&&($n.current.style.height="0px"),Jn.current&&(Jn.current.style.height="0px"),requestAnimationFrame(function(){var e=u.getBoundingClientRect(),n=c.getBoundingClientRect(),i=o.getBoundingClientRect(),t=r.getBoundingClientRect(),l=o.scrollTop+(e.top-i.top)+e.height/2,a=r.scrollTop+(n.top-t.top)+n.height/2,s=i.height/2,d=l-s,v=a-s,f=d<0?Math.abs(d):0,p=v<0?Math.abs(v):0,g=Math.max(0,d),h=Math.max(0,v);Xn.current&&(Xn.current.style.height="".concat(f,"px")),Yn.current&&(Yn.current.style.height="".concat(p,"px")),requestAnimationFrame(function(){var e=o.scrollHeight-o.clientHeight,n=r.scrollHeight-r.clientHeight,i=g>e?g-e:0,t=h>n?h-n:0;$n.current&&($n.current.style.height="".concat(i,"px")),Jn.current&&(Jn.current.style.height="".concat(t,"px")),requestAnimationFrame(function(){o.scrollTo({top:g,behavior:"smooth"}),r.scrollTo({top:h,behavior:"smooth"}),Ln.current&&setTimeout(function(){return Ln.current()},50)})})})}},[C]),Oo=s(function(e,n,i,t,o){var r,l="string"==typeof t?x(t).trim():x(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;gi();var c="left";(null===(r=Kn.current)||void 0===r?void 0:r.contains(u))&&(c="right");var a=function(){var e,i,t,o;if("string"==typeof n&&n.includes(C)){var r=n.split(C),l="".concat(r[0]).concat(C).concat(r[1]);return"right"===c?null===(e=Yi.current[l])||void 0===e?void 0:e.current:null===(i=Ki.current[l])||void 0===i?void 0:i.current}return"right"===c?null===(t=Yi.current[n])||void 0===t?void 0:t.current:null===(o=Ki.current[n])||void 0===o?void 0:o.current};if(i&&!Ei)return mt(),yn(new Set),wn([]),jn.current=[],void(l&&(It(n),requestAnimationFrame(function(){var e=a()||u;e&&(e.getBoundingClientRect().top>.8*window.innerHeight&&e.scrollIntoView({behavior:"smooth",block:"center"}));ai({open:!0,anchorEl:e,summary:t,displayImpact:o})})));It(n),Ei&&yn(new Set([n])),l?setTimeout(function(){St(n,i,{toggleIfSame:!1,sourceSide:c,onReady:function(){var e,i,r,l=a()||u;if(Ei)setTimeout(function(){return ko(n)},150);else if(l){var c=l.getBoundingClientRect();if(c.top>.8*window.innerHeight||c.top<100){var s=c.top-window.innerHeight/2;un?(null===(e=Un.current)||void 0===e||e.scrollBy({top:s,behavior:"smooth"}),null===(i=Kn.current)||void 0===i||i.scrollBy({top:s,behavior:"smooth"})):null===(r=Wn.current)||void 0===r||r.scrollBy({top:s,behavior:"smooth"})}}ai({open:!0,anchorEl:l,summary:t,displayImpact:o})}})},350):setTimeout(function(){St(n,i,{toggleIfSame:!1,sourceSide:c}),Ei&&setTimeout(function(){return ko(n)},150)},350)},[St,gi,ai,mt,It,Ei,un,ko]),Po=c(function(){var e;if(!Ue)return null;var n=null===(e=null==Ue?void 0:Ue.id)||void 0===e?void 0:e.split(":")[0];for(var i in Pi){if((Pi[i]||[]).some(function(e){return e.id===n}))return i}return null},[Ue,Pi]),jo=u({id:null,triggerMs:null}),Lo=u(null);a(function(){if(null==Ue?void 0:Ue.id){var o=Number(Ue.trigger),r=jo.current;if((null==r?void 0:r.id)!==Ue.id||(null==r?void 0:r.triggerMs)!==o){if(!(Ue.id.includes(":")&&/:\d+$/.test(Ue.id)))return jo.current={id:Ue.id,triggerMs:o},void to(Ue.id);var l=Ue.id.split(":"),u=l[0],c=l[1],a=null!=c?c:"0",s="".concat(Ue.id,":").concat(o);Lo.current!==s&&(si(),gi(),mt(),yn(new Set),wn([]),jn.current=[],Lo.current=s);var d=!1,v=0,f=null,p=null,g=!1,h=function(e,n){for(var i=function(e,t){if(!e)return null;if(n.includes(e.id)||n.includes(e.nodeId)||n.includes(e.contentId))return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},m=function(){var r,l,c;if(!d){var s=function(){jo.current={id:Ue.id,triggerMs:o}},S=null,x=null;for(var R in Pi){var y=Pi[R].find(function(e){var n;return e.id===u||e.nodeId===u||e.contentId===u||(null===(n=e.evaluationResult)||void 0===n?void 0:n.nodeId)===u});if(y){S=R,x=y;break}}if(x&&S){var b=Array.from(new Set([u,x.id,x.nodeId,x.contentId,null===(r=x.evaluationResult)||void 0===r?void 0:r.nodeId].filter(Boolean))),w=Di.findIndex(function(e){return e.id===S}),B=ki.findIndex(function(e){return e.id===S}),F=-1===w&&-1!==B,E=h(Di,b),T=h(ki,b);if(E&&!T&&!F){var A=E.split("-"),D=Number(A[0]);if(un){var k=null===(c=null===(l=Di[D])||void 0===l?void 0:l.refIndexes)||void 0===c?void 0:c[0],O=ki.findIndex(function(e){return e.selfIndex===k});-1!==O&&(D=O)}T=n([D],A.slice(1),!0).join("-")}if(E||T){var P=E?Number(E.split("-")[0]):w,j=T?Number(T.split("-")[0]):B,L=j>=0?j:T?Number(T.split("-")[0]):-1,N=Di[P],M=ki[L],H=N&&!N.title&&!N.content,z=M&&!M.title&&!M.content,q=F||(!E&&!!T||H&&!z);if(q){if(!(un?!!Jo.current["right-".concat(j)]:!!Jo.current[String(j)])&&j>=0)return _t(j,"right"),void(f=setTimeout(m,200))}else if(!(un?!!Jo.current["left-".concat(P)]:!!Jo.current[String(P)])&&P>=0)return _t(P,"left"),void(f=setTimeout(m,200));var V=E||"",W=T||"",G=b.map(function(e){return"".concat(e).concat(C).concat(a)}),K=G[0],Y=function(){for(var e,n,i=0,t=G;i<t.length;i++){var o=t[i],r=(null===(e=Ki.current[o])||void 0===e?void 0:e.current)||null,l=(null===(n=Yi.current[o])||void 0===n?void 0:n.current)||null;if(r||l)return{refId:o,left:r,right:l}}return{refId:K,left:null,right:null}},J=function(e){return"".concat(e).concat(C).concat(V).concat(C).concat(W)};if(!g){It(J(K)),g=!0,v=0;var X=function(){var e=Y(),n=e.left,i=e.right;return q||!n&&!!i?i:n};return null==p||p(),void(f=setTimeout(function(){var e,n,i,t,o,r,l,u;d||(e=X,n=function(){d||(p=null,m())},t=0,o=null,r=null,l=performance.now(),u=function(){if(!d)if(performance.now()-l>3e3)n();else{var c=e();if(c&&0!==c.getBoundingClientRect().height){var a=c.getBoundingClientRect(),s=a.top,v=a.height,f=null!==o&&Math.abs(s-o)<.5,p=null!==r&&Math.abs(v-r)<.5;if(f&&p){if(++t>=5)return void n()}else t=0;o=s,r=v,i=requestAnimationFrame(u)}else i=requestAnimationFrame(u)}},i=requestAnimationFrame(u),p=function(){return cancelAnimationFrame(i)})},300))}var $=Y(),U=$.refId,Q=$.left,Z=$.right,ee=J(U);if(Q||Z){var ne=q||!Q&&!!Z,ie=ne?Z:Q,te=un?ne?Kn.current:Un.current:Wn.current;if(ie&&te){var oe=ie.getBoundingClientRect();if(0!==oe.height){var re=te.getBoundingClientRect(),le=oe.top-re.top+te.scrollTop-re.height/2+oe.height/2,ue=(null==E?void 0:E.includes("-"))||(null==T?void 0:T.includes("-")),ce=function(){return i(void 0,void 0,void 0,function(){var n,i,o,r,l,u,c,v,f,p;return t(this,function(t){switch(t.label){case 0:return d?[2]:(s(),n=ie instanceof Element?window.getComputedStyle(ie).color:"",[Q,Z].forEach(function(e){e&&(e.style.transition="box-shadow 300ms ease-in-out",e.style.boxShadow="0 0 10px ".concat(n))}),setTimeout(function(){[Q,Z].forEach(function(e){e&&(e.style.boxShadow="")})},2e3),i=(null===(c=null===(u=x.evaluationResult)||void 0===u?void 0:u.deviations)||void 0===c?void 0:c[a])||x,o=(null===(v=x.evaluationResult)||void 0===v?void 0:v.evaluation_outputs)||x.evaluation_outputs,!!Q&&!!Z?(l=function(e,n){return Promise.race([e,new Promise(function(e){return setTimeout(e,n)})])},un?[4,Promise.all([Un.current?l(I(Un.current),600):Promise.resolve(),Kn.current?l(I(Kn.current),600):Promise.resolve()])]:[3,2]):(r=ne?(null===(f=Yi.current[ue?U:j])||void 0===f?void 0:f.current)||Z:(null===(p=Ki.current[ue?U:P])||void 0===p?void 0:p.current)||Q,Do(r,function(){ai({open:!0,anchorEl:r,displayImpact:Ue.displayImpact,summary:e(e({},i),{evaluation_outputs:o})})},{skipScroll:!0}),null==Qe||Qe(),[2]));case 1:t.sent(),t.label=2;case 2:return xt.current(ee,!1,{toggleIfSame:!1,sourceSide:F?"right":"left",onReady:function(){var n,t,o,r;s();var l=ne?(null===(n=Yi.current[U])||void 0===n?void 0:n.current)||Z:(null===(t=Ki.current[U])||void 0===t?void 0:t.current)||Q,u=(null===(o=Ki.current[U])||void 0===o?void 0:o.current)||Q,c=(null===(r=Yi.current[U])||void 0===r?void 0:r.current)||Z;u&&(u.style.scrollMarginTop="150px",u.scrollIntoView({behavior:"smooth",block:"start"})),c&&(c.style.scrollMarginTop="150px",c.scrollIntoView({behavior:"smooth",block:"start"})),ai({open:!0,anchorEl:l,displayImpact:Ue.displayImpact,summary:e({},i)}),null==Qe||Qe()}}),[2]}})})};Math.abs(te.scrollTop-le)<=2?ce():_(te,le,ce)}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}};return f=setTimeout(m,100),function(){d=!0,f&&clearTimeout(f),null==p||p()}}}},[null==Ue?void 0:Ue.id,null==Ue?void 0:Ue.trigger,null==Ue?void 0:Ue.displayImpact,Pi,Di,ki,un,ai,to]),a(function(){var n,i,t;if(ci.open){var o=ci.anchorEl;if(o&&!o.isConnected){var r=function(e){for(var n,i=0,t=Object.entries(e);i<t.length;i++){var r=t[i],l=r[0];if((null===(n=r[1].current)||void 0===n?void 0:n.textContent)===o.textContent)return l}return null},l=(null===(n=o.dataset)||void 0===n?void 0:n.deviationRefId)||r(Ki.current)||r(Yi.current);if(l){var u=(null===(i=Yi.current[l])||void 0===i?void 0:i.current)||(null===(t=Ki.current[l])||void 0===t?void 0:t.current);u&&u.isConnected&&ai(function(n){return e(e({},n),{anchorEl:u})})}}}},[ci.open,ci.anchorEl,_n,Rn,yt]);var No=ni.open,Mo=ni.sectionIdx,Ho=ni.isOrphan,zo=ni.badgeStyle,qo=ni.anchorEl,Vo=ni.sectionAnchorEl;a(function(){var n;if(Ke.isStreamingEnabled&&No&&null!=Mo&&Mo!==Ot){var i="string"==typeof Mo?Mo.split(C)[0]:null,t=function(e,n){var i;if(!e||!Array.isArray(e))return null;for(var o=0,r=e;o<r.length;o++){var l=r[o];if(l.id===n)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var u=t(l.subsections,n);if(u)return u}}return null},o=i&&"string"==typeof i?t(Di,i):null,r=i&&"string"==typeof i?t(ki,i):null,l="number"==typeof Mo?Di[Mo]||null:o||i&&((null===(n=null==Me?void 0:Me.nodes)||void 0===n?void 0:n[i])||(null==Me?void 0:Me[i]))||null,u="number"==typeof Mo?ki[Mo]||null:r,c=Zt(qo,l,u,Mo,Ho,zo);ii(function(n){return n.open?x(n.cognitiveData)===x(c.cognitiveData)&&x(n.deviationData)===x(c.deviationData)&&n.sectionTitle===c.sectionTitle&&n.refSectionTitle===c.refSectionTitle?n:e(e(e({},n),c),{open:!0,anchorEl:n.anchorEl,sectionAnchorEl:n.sectionAnchorEl}):n})}},[No,Mo,Ho,zo,qo,Vo,Di,ki,Zt]);var Wo=s(function(e){var n=e.section,i=e.keyPath,t=e.depth,r=void 0===t?0:t,l=e.columnKey,u=void 0===l?"left":l,c=e.parentNodeId,a=void 0===c?"":c,s=e.sectionOffset,d=e.rhsOrphanVisualIndexes;return o(W,{section:n,keyPath:i,depth:r,columnKey:u,parentNodeId:a,sectionOffset:s,rhsOrphanVisualIndexes:d})},[]),Go=c(function(){return Di.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&un?null:o(G,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"left-row-".concat(n))})},[Di]),Ko=c(function(){return ki.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&un?null:o(K,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"right-row-".concat(n))})},[ki]),Yo=u(eo);a(function(){Yo.current=eo},[eo]);var Jo=u(yt);a(function(){Jo.current=yt},[yt]);var Xo=u(Oo);a(function(){Xo.current=Oo},[Oo]);var $o=u(Io);a(function(){$o.current=Io},[Io]);var Uo=u(_t);a(function(){Uo.current=_t},[_t]);var Qo=u(Bt);a(function(){Qo.current=Bt},[Bt]);var Zo=u(Wo);a(function(){Zo.current=Wo},[Wo]);var er=u(mt);a(function(){er.current=mt},[mt]);var nr=c(function(){return{isGuidelineMode:Ei,maintainRelativeOrder:!!un,showDeviationBadges:dn,isProposingFix:en,proposingFixNodeId:nn,isRedlineFlow:tn,isSideBySide:it,activeSideBySideSection:ct,scrollSyncLocked:_n,toggleScrollSyncLocked:Et,summaryPopupAnchorEl:ci.anchorEl,connectedSections:Rn,proposedSections:Di,existingSections:ki,deviationNumberRegistry:ji,deviationParentRegistry:Li,treeData:Me,displayConfig:Ke,resolvedMarkdownStyles:Vn,unifiedNumbering:Tt,expandedSections:yt,expandedSubSections:Ct,setExpandedSubSections:wt,getSectionCompareStyle:co,getSubSectionCompareStyle:ao,getBadgeRef:et,getSectionRowRef:Qi,getSubSectionRef:Zi,sectionLeftRefs:Wi,sectionRightRefs:Gi,sectionRowRefs:Ui,sectionRightRowRefs:Ji,subSectionLeftRefs:Xi,subSectionRightRefs:$i,lhsBadgeRefs:Ki,rhsBadgeRefs:Yi,openMoreFunctionsPopup:zt,handleOpenSummaryPopup:qt,openSummaryPopup:qt,handleCloseSummaryPopup:Vt,toggleSection:Wt,handleSubSectionToggle:Gt,renderSubSectionAccordion:Kt,resetSideBySide:Yt,setConnectedSections:yn,setConnectedLines:wn,cachedConnectedPositions:jn,showDeviationNavigation:To,showOpenNodeRef:Ao,deviationNodeIdToView:null==Ue?void 0:Ue.id,deviationTargetParentId:Po,guidelinesData:rn}},[Ei,un,dn,en,nn,tn,it,ct,_n,Et,ci.anchorEl,Rn,Di,ki,ji,Ke,Vn,Tt,yt,Ct,wt,co,ao,et,Qi,Zi,To,Ao,Ue,Po,rn]);return o(J,e({value:nr},{children:r(d,e({ref:Gn,sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"visible",position:"relative"}},{children:[fn&&o(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:o(j,{})})),ci.open&&o(Y,{open:ci.open,anchorEl:ci.anchorEl,containerEl:ro.current,clipTopEl:Tn.current,scrollContainerEl:Wn.current,onClose:Io,summary:ci.summary,displayImpact:ci.displayImpact,isScrollLocked:_n}),o(P,{open:ti.open,anchorEl:ti.anchorEl,maintainRelativeOrder:!!un,sectionTitle:ti.sectionTitle,referenceSectionTitle:ti.refSectionTitle,onClose:hi,onOpenCognitiveCompare:fi,onOpenSideBySide:_o,onConnect:no,isConnected:Fo,isOrphan:!Ei&&!!ti.isOrphan,isGuidelineMode:Ei,hasGuidelineMatches:ti.hasGuidelineMatches}),ni.open&&o(O,{open:ni.open,popupRef:vi,position:ri,popupConfig:Je,onClose:function(){li(null),ii(function(n){return e(e({},n),{open:!1})}),di(null)},markdownStyles:Ve,sectionTitle:wi,referenceSectionTitle:_i,cognitiveData:ni.cognitiveData,anchorEl:ni.anchorEl,sectionAnchorEl:ni.sectionAnchorEl,scrollContainerEl:Wn.current,badgeStyle:ni.badgeStyle,docData:ni.docData,deviationData:ni.deviationData,isLoading:ni.isLoading}),o(v,e({open:!!hn,autoHideDuration:8e3,onClose:function(){return mn(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:o(f,e({onClose:function(){return mn(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:hn}))})),o(V,{componentHeaderText:Ne,displayConfig:Ke,maintainRelativeOrder:un,onCollapseAll:xo,showCollapseAll:Ro,onToggleView:function(e){pn(!0),setTimeout(function(){cn(!e),null==Ye||Ye(!e),In(!1),mt(),si(),yn(new Set),wn([]),jn.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){pn(!1)},600)})})},50)}}),o(d,e({ref:Wn,onScroll:So,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:un?"visible":"auto",borderTop:Dt&&kt?"none":"1.5px solid #EEF0F4"}},{children:o(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},un?{flex:1}:{})},{children:r(d,e({ref:En,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"100px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},un?{flex:1,overflow:"visible"}:{})},{children:[o(Z,{svgContainerRef:Fn,svgDimensions:mo,isResizing:rt,overallConnector:go,rootDeviationStyle:Lt,lines:fo,isSideBySide:it,activeSideBySideSection:ct,isArrowVisible:tt,maintainRelativeOrder:un,proposedSections:Di,existingSections:ki,cognitivePopup:ni,activeBadgeId:ui,closeCognitivePopup:gi,setActiveBadgeId:di,openCognitivePopupFromState:pi,buildSectionPopupState:Zt,connectedLines:Cn,isGuidelineMode:Ei,pathRefs:Pn}),r(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},un?{flex:1,overflow:"visible"}:{})},{children:[o(d,e({ref:Tn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:o(p,e({title:bi,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:bi}))}))})),r(d,e({ref:Un,onScroll:So,sx:e({p:"12px",display:"flex",flexDirection:"column"},un?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-180px",pr:"192px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[o("div",{ref:Xn,style:{width:"100%",height:"0px",flexShrink:0}}),Mi&&Go,o("div",{ref:$n,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),o(d,e({ref:ro,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:o(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:r(d,e({onClick:function(n){n.stopPropagation(),ni.open&&ui===Ot?gi():(di(Ot),pi(Zt(n.currentTarget,{title:"",content:"",evaluationResult:Pt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Ot,!0,e(e({},Lt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Lt.badgeBg,color:Lt.badgeText,border:"1px solid ".concat(Lt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=jt?jt:o(L,{}),o(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:o(m,{})})),o(h,{size:11,style:{transform:ni.open&&ui===Ot?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),r(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},un?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[ut&&o(S,{sections:11}),o(d,e({ref:An,sx:e({p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center"},un?e({maxHeight:"calc(100vh - 250px)",overflowY:"auto",overflowX:"hidden",minHeight:0},Ei?{"&::-webkit-scrollbar":{width:"6px",display:"block"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"#94A3B8"},scrollbarWidth:"thin",scrollbarColor:"#CBD5E1 transparent"}:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}):{})},{children:o(p,e({title:Ii,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Ii}))}))})),r(d,e({ref:Kn,onScroll:So,sx:e({p:Ei?"0px":"12px",display:"flex",flexDirection:"column"},un?e(e({maxHeight:"calc(100vh - 250px)"},!Ei&&{flex:1}),{overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}):{})},{children:[o("div",{ref:Yn,style:{width:"100%",height:"0px",flexShrink:0}}),Ei?o(ee,{guidelinesData:rn,deviationData:$e,connectedSections:Rn,proposedSections:Di}):Mi&&Ko,o("div",{ref:Jn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};export{ne as default};
1
+ import{__assign as e,__spreadArray as n,__awaiter as i,__generator as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as l,useRef as u,useMemo as c,useEffect as a,useCallback as s}from"react";import{Box as d,Snackbar as v,Alert as f,Tooltip as p,Typography as g,Tabs as h,Tab as m}from"@mui/material";import{ChevronDown as S}from"lucide-react";import{ButtonCognitiveIcon as x}from"../../assests/svg/ButtonCognitiveIcon.js";import R from"./OverlayComponent.js";import{safeStringify as b,extractDeviationScore as y,generateColorPalette as C,findKeyPathByNodeId as w,DEVIATION_BADGE_SEPARATOR as B,hasMeaningfulRedlineTags as _,scrollAndHighlightClause as I,scrollAndWait as F,waitForScrollIdle as T}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as E,DEFAULT_FIELD_CONFIG as A,DEFAULT_COMPARISON_CONFIG as k}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as D,EMPTY_SUMMARY_POPUP_STATE as O,DEFAULT_COMPONENT_HEADER_TEXT as P}from"./CognitiveCompareConstants.js";import j from"./CognitivePopup.js";import L from"./MoreFunctionsPopup.js";import N from"./LoaderComponent.js";import M from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as H}from"./hooks/useCompareData.js";import{useComparePopups as z}from"./hooks/useComparePopups.js";import{useSectionRefs as W}from"./hooks/useSectionRefs.js";import{useAccordionState as q}from"./hooks/useAccordionState.js";import{useDeviationNavigation as G}from"./hooks/useDeviationNavigation.js";import V from"./components/CompareHeader.js";import K from"./components/SubSectionAccordion.js";import Y from"./components/LHSSectionRow.js";import J from"./components/RHSSectionRow.js";import X from"./components/CognitiveSummaryPopup.js";import{CompareContextProvider as $}from"./CompareContext.js";import{useStyleHelpers as U}from"./hooks/useStyles.js";import{useResizeHandler as Q}from"./hooks/useResizeHandler.js";import{useLinesCalculator as Z}from"./hooks/useLinesCalculator.js";import{useSideBySide as ee}from"./hooks/useSideBySide.js";import ne from"./components/SvgConnectors.js";import ie from"./Guidelines/components/GuidelinePanel.js";import te from"./Guidelines/components/WebGptPanel.js";var oe=function(oe){var re,le,ue,ce,ae,se,de,ve,fe,pe,ge,he,me,Se,xe,Re,be,ye,Ce,we,Be,_e,Ie,Fe,Te,Ee,Ae,ke,De,Oe,Pe,je,Le,Ne,Me,He=oe.componentHeaderText,ze=void 0===He?P:He,We=oe.treeData,qe=oe.comparisonConfig,Ge=oe.leftColumnTitleText,Ve=oe.rightColumnTitleText,Ke=oe.markdownStyles,Ye=oe.resetTrigger,Je=oe.displayConfig,Xe=void 0===Je?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0,isStreamingEnabled:!1}:Je,$e=oe.onMaintainRelativeOrderChange,Ue=oe.popupConfig,Qe=oe.deviationData,Ze=void 0===Qe?{}:Qe,en=oe.deviationNodeIdToView,nn=oe.resetDeviationNodeId,tn=oe.isProposingFix,on=void 0!==tn&&tn,rn=oe.proposingFixNodeId,ln=oe.isRedlineFlow,un=oe.badgeStyleOverride,cn=oe.guidelinesData,an=oe.gptWebCitationConfig,sn=l(Xe.maintainRelativeOrder),dn=sn[0],vn=sn[1],fn=null!==(re=null==Xe?void 0:Xe.expandLevels)&&void 0!==re?re:0,pn=!!(null==Xe?void 0:Xe.expandAllSections),gn=!!dn||!!(null==Xe?void 0:Xe.showDeviationBadges),hn=l(!1),mn=hn[0],Sn=hn[1],xn=l(null),Rn=xn[0],bn=xn[1],yn=l(null===(ue=null!==(le=null==We?void 0:We.newEvaluationResult)&&void 0!==le?le:null==Xe?void 0:Xe.enableDeviationSchemaBackwardCompatibility)||void 0===ue||ue)[0],Cn=l(new Set),wn=Cn[0],Bn=Cn[1],_n=l([]),In=_n[0],Fn=_n[1],Tn=l(!1),En=Tn[0],An=Tn[1],kn=l(0),Dn=kn[0],On=kn[1],Pn=u(null),jn=u(null),Ln=u(null),Nn=u(null),Mn=u(null),Hn=u(!1),zn=u(null),Wn=u({}),qn=u([]),Gn=u(function(){}),Vn=u(null),Kn=u(function(){}),Yn=c(function(){return JSON.stringify(Ze||{})},[JSON.stringify(Ze)]),Jn=c(function(){return Ze||{}},[Yn]),Xn=c(function(){return(null==We?void 0:We.cognitive_decisioning)||{}},[We]),$n=c(function(){return e(e({},E),Ke)},[Ke]),Un=u(null),Qn=u(null),Zn=u(null),ei=u(null),ni=u(null),ii=u(null),ti=u(null),oi=u(null),ri=u(null),li=u(null),ui=z(Un),ci=ui.cognitivePopup,ai=ui.setCognitivePopup,si=ui.moreFunctions,di=ui.setMoreFunctions,vi=ui.position,fi=ui.setPosition,pi=ui.activeBadgeId,gi=ui.summaryPopup,hi=ui.setSummaryPopup,mi=ui.closeSummaryPopup,Si=ui.setActiveBadgeId,xi=ui.popupRef,Ri=ui.handleOpenCognitiveCompare,bi=ui.openCognitivePopupFromState,yi=ui.closeCognitivePopup,Ci=ui.closeMoreFunctionsPopup,wi=c(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==qe?void 0:qe.fields)&&void 0!==e?e:A,thresholds:{high:null!==(i=null===(n=null==qe?void 0:qe.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:k.thresholds.high,medium:null!==(o=null===(t=null==qe?void 0:qe.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:k.thresholds.medium,exact:null!==(l=null===(r=null==qe?void 0:qe.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:k.thresholds.exact}}},[qe]),Bi=l(null),_i=Bi[0];Bi[1];var Ii=null===(se=null===(ce=null==We?void 0:We.documents)||void 0===ce?void 0:ce[null===(ae=null==We?void 0:We.input_index_map)||void 0===ae?void 0:ae[0]])||void 0===se?void 0:se.title,Fi=null===(fe=null===(de=null==We?void 0:We.documents)||void 0===de?void 0:de[null===(ve=null==We?void 0:We.input_index_map)||void 0===ve?void 0:ve[1]])||void 0===fe?void 0:fe.title,Ti=b(Ge||Ii||"Uploaded Contract"),Ei=null===(me=null===(he=null===(pe=null==We?void 0:We.documents)||void 0===pe?void 0:pe[null===(ge=null==We?void 0:We.input_index_map)||void 0===ge?void 0:ge[0]])||void 0===he?void 0:he.metadata)||void 0===me?void 0:me.file_name,Ai=b(Ei),ki=null===(be=null===(Re=null===(Se=null==We?void 0:We.documents)||void 0===Se?void 0:Se[null===(xe=null==We?void 0:We.input_index_map)||void 0===xe?void 0:xe[1]])||void 0===Re?void 0:Re.metadata)||void 0===be?void 0:be.file_name,Di=b(ki),Oi=b(Ve||Fi||"Reference Template"),Pi=H(We,dn,Jn,wi,yn,cn),ji=Pi.isGuidelineMode,Li=Pi.activeProposed,Ni=Pi.existingRule,Mi=Pi.proposedSections,Hi=Pi.existingSections,zi=Pi.visibleFields,Wi=Pi.parentDeviationRecord,qi=Pi.deviationNumberRegistry,Gi=Pi.deviationParentRegistry,Vi=Pi.parseError;a(function(){Vi&&bn("Failed to load comparison: ".concat(Vi))},[Vi]);var Ki=Mi.length>0||Hi.length>0,Yi=c(function(){if(!ln)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";_(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(Mi),i(Hi),"".concat(e,":").concat(n)},[ln,Mi,Hi]);a(function(){if(Mi.length||Hi.length)if(pn){var e={},n={},i=function(i,t){i.forEach(function(i,o){var r,l=dn?"".concat(t,"-").concat(o):String(o);e[l]=!0;var u=function(e,i){null==e||e.forEach(function(e,t){var o,r="".concat(i,"-").concat(t);n[r]=!0,(null===(o=e.subsections)||void 0===o?void 0:o.length)&&u(e.subsections,r)})};(null===(r=i.subsections)||void 0===r?void 0:r.length)&&u(i.subsections,String(o))})};i(Mi,"left"),i(Hi,"right"),Tt(e),At(n)}else if(fn>0){var t={},o={},r=function(e,n,i){e.forEach(function(e,r){var l;if(i>=1){var u=dn?"".concat(n,"-").concat(r):String(r);t[u]=!0}var c=function(e,n,t){t>i||null==e||e.forEach(function(e,i){var r,l="".concat(n,"-").concat(i);o[l]=!0,(null===(r=e.subsections)||void 0===r?void 0:r.length)&&c(e.subsections,l,t+1)})};(null===(l=e.subsections)||void 0===l?void 0:l.length)&&i>=2&&c(e.subsections,String(r),2)})};r(Mi,"left",fn),r(Hi,"right",fn),Tt(t),At(o)}},[pn,fn,Mi,Hi,dn]);var Ji=W(zi.map(function(e){return e.key}),Math.max(Mi.length,Hi.length)),Xi=Ji.leftRefs,$i=Ji.rightRefs,Ui=Ji.sectionLeftRefs,Qi=Ji.sectionRightRefs,Zi=Ji.lhsBadgeRefs,et=Ji.rhsBadgeRefs,nt=Ji.sectionRightRowRefs,it=Ji.subSectionLeftRefs,tt=Ji.subSectionRightRefs,ot=Ji.sectionRowRefs,rt=Ji.getSectionRowRef,lt=Ji.getSubSectionRef,ut=Ji.getBadgeRef,ct=ee({isGuidelineMode:ji,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,leftContainerRef:oi,rightContainerRef:Zn,scrollContainerRef:Un,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,sectionRowRefs:ot,sectionRightRowRefs:nt,rhsTopSpacerRef:ei,rhsBottomSpacerRef:ni,lhsTopSpacerRef:ii,lhsBottomSpacerRef:ti,calculateLinesRef:Gn,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,closeMoreFunctionsPopup:Ci,setErrorToast:bn,moreFunctions:si,closeSummaryPopup:mi}),at=ct.isSideBySide,st=ct.isArrowVisible,dt=ct.setIsArrowVisible,vt=ct.isResizing,ft=ct.setIsResizing,pt=ct.isSideBySideLoading,gt=ct.activeSideBySideSection,ht=ct.scrollLock,mt=ct.sideBySideCacheRef,St=ct.isSideBySideRef,xt=ct.activeSideBySideRightSectionRef,Rt=ct.activeSideBySideSectionRef,bt=ct.sideBySideLineRef,yt=ct.highlightedClauseRefs,Ct=ct.clearClauseHighlight,wt=ct.resetSideBySide,Bt=ct.activateSideBySide,_t=u(Bt);a(function(){_t.current=Bt},[Bt]);var It=q({maintainRelativeOrder:!!dn,proposedSections:Mi,existingSections:Hi,activeSideBySideSection:gt,connectedSections:wn,resetSideBySide:wt,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,svgContainerRef:Pn,isAnimatingRef:Hn,animationTimerRef:zn,calculateLinesRef:Gn,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt}),Ft=It.expandedSections,Tt=It.setExpandedSections,Et=It.expandedSubSections,At=It.setExpandedSubSections,kt=It.handleSubSectionToggle,Dt=It.toggleSection,Ot=It.forceExpandCrossWiredSections,Pt=function(){var e,n;if(null!=gt){var i=null===(e=Ui.current[gt])||void 0===e?void 0:e.current,t=null===(n=Qi.current[gt])||void 0===n?void 0:n.current,o=Zn.current;if(i&&t&&o){var r=i.getBoundingClientRect(),l=t.getBoundingClientRect(),u=o.getBoundingClientRect(),c=r.top-u.top,a=l.top-u.top-c;o.scrollBy({top:a,behavior:"smooth"})}}},jt=s(function(e){null==e||e.stopPropagation(),An(function(e){var n=!e;return n&&requestAnimationFrame(function(){Pt()}),n})},[Pt]);a(function(){ln&&"off"!==Yi&&"0:0"!==Yi&&(mt.current=null,qn.current=[],requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)}))},[ln,Yi]);var Lt=c(function(){var e=new Map,n=new Map,i=1;if(dn)Mi.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),Hi.forEach(function(t){if(t.id&&!(!t.title&&!t.content)){var o=Mi.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(Mi.length,Hi.length),o=0;o<t;o++){var r=Mi[o],l=Hi[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[Mi,Hi,dn]),Nt=Ni.analysis,Mt=b(null===(Ce=null===(ye=null==Nt?void 0:Nt.rule_difference_comparison)||void 0===ye?void 0:ye.summary)||void 0===Ce?void 0:Ce.overall_summary),Ht=!!Mt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),zt=null!==(we=null==We?void 0:We.base_root_id)&&void 0!==we?we:"-1";null==We||We[zt];var Wt=yn?null!==(je=null!==(De=Ze&&(null===(ke=null==Ze?void 0:Ze[zt])||void 0===ke?void 0:ke.evaluation_result))&&void 0!==De?De:null===(Pe=null===(Oe=null==We?void 0:We.nodes)||void 0===Oe?void 0:Oe[zt])||void 0===Pe?void 0:Pe.evaluation_result)&&void 0!==je?je:null:null!==(Ae=null!==(Ie=Ze&&(null===(_e=null===(Be=null==Ze?void 0:Ze[zt])||void 0===Be?void 0:Be.evaluation_result)||void 0===_e?void 0:_e[0]))&&void 0!==Ie?Ie:null===(Ee=null===(Te=null===(Fe=null==We?void 0:We.nodes)||void 0===Fe?void 0:Fe[zt])||void 0===Te?void 0:Te.evaluation_result)||void 0===Ee?void 0:Ee[0])&&void 0!==Ae?Ae:null,qt=y(Wt),Gt=C(null!==(Me=null===(Ne=null===(Le=null==Wt?void 0:Wt.evaluation_outputs)||void 0===Le?void 0:Le.metadata)||void 0===Ne?void 0:Ne.label_color)&&void 0!==Me?Me:D);if(un){var Vt=un(qt);Vt&&(Gt=e(e({},Gt),{badgeBg:Vt.bg,badgeText:Vt.text,badgeBorder:Vt.border}))}var Kt=u(wt);a(function(){Kt.current=wt},[wt]);var Yt=u(yi);a(function(){Yt.current=yi},[yi]);var Jt=s(function(e,n,i,t,o,r){return nr.current(e,n,i,t,o,r)},[]),Xt=s(function(e,n,i,t,o){return tr.current(e,n,i,t,o)},[]),$t=s(function(){return or.current()},[]),Ut=s(function(e,n){return rr.current(e,n)},[]),Qt=s(function(e){return lr.current(e)},[]),Zt=s(function(e){return ur.current(e)},[]),eo=s(function(){return cr.current()},[]),no=s(function(){var e,n;Ct(),null===(e=Kt.current)||void 0===e||e.call(Kt),An(!1),Bn(new Set),Fn([]),qn.current=[],bo([]),Co(null),hi(O),null===(n=Yt.current)||void 0===n||n.call(Yt),requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)})},[]),io=u(no);a(function(){io.current=no},[no]),a(function(){Ye&&io.current()},[Ye]);var to=c(function(){return{documents:null==We?void 0:We.documents,input_index_map:null==We?void 0:We.input_index_map}},[JSON.stringify(null==We?void 0:We.documents),JSON.stringify(null==We?void 0:We.input_index_map)]),oo=u(We);a(function(){oo.current=We},[We]);var ro=u(Xn);a(function(){ro.current=Xn},[Xn]);var lo=s(function(n,i,t,o,r,l,u){var c,a,s,d,v,f,p,g,h,m,S,x,R=b(null==i?void 0:i.id)||b(null==t?void 0:t.id)||"",y=(R?null===(c=ro.current)||void 0===c?void 0:c[R]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:R,decisioning:[],gap:[],relevance_score:0},C=null!==(s=null===(a=ot.current[o])||void 0===a?void 0:a.current)&&void 0!==s?s:null,w=function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e(e({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(B)))return u(l);var c=o.split(B)[1];if(!c)return l;var a=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},s=(null===(n=null==a?void 0:a.deviation_entries)||void 0===n?void 0:n[c])||(null===(r=null==a?void 0:a.deviations)||void 0===r?void 0:r[c])||null;return s?e(e(e({},a),s),{deviation_summary:(null==s?void 0:s.deviation_summary)||(null==a?void 0:a.deviation_summary),deviation_title:(null==s?void 0:s.deviation_title)||(null==a?void 0:a.deviation_title),deviation_impact:(null==s?void 0:s.deviation_impact)||(null==a?void 0:a.deviation_impact),deviation_explanation:(null==s?void 0:s.deviation_explanation)||(null==a?void 0:a.deviation_explanation),evaluation_outputs:(null==s?void 0:s.evaluation_outputs)||(null==a?void 0:a.evaluation_outputs),cognitive_decisioning:(null==s?void 0:s.cognitive_decisioning)||(null==a?void 0:a.cognitive_decisioning)}):u(l)}(),_=(null!==(f=null===(v=null===(d=null==w?void 0:w.cognitive_decisioning)||void 0===d?void 0:d.decisioning_factors)||void 0===v?void 0:v.length)&&void 0!==f?f:0)>0||(null!==(h=null===(g=null===(p=null==w?void 0:w.cognitive_decisioning)||void 0===p?void 0:p.gaps_in_decision)||void 0===g?void 0:g.length)&&void 0!==h?h:0)>0,I=null!==(m=null==Xe?void 0:Xe.isLoading)&&void 0!==m&&m,F=!0;if(ji)if(w&&Object.keys(w).length>0){var T=Array.isArray(w)?w[0]:w,E=null===(x=null===(S=null==T?void 0:T.evaluation_outputs)||void 0===S?void 0:S.metadata)||void 0===x?void 0:x.is_orphan;!0!==E&&"true"!==E&&"Yes"!==E&&"yes"!==E||(F=!1)}else F=!1;return{isLoading:I&&!_,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:y,anchorEl:n,sectionAnchorEl:C,badgeStyle:l||null,sectionIdx:o,docData:to,deviationData:w,isOrphan:!!r,hasGuidelineMatches:F}},[to,null==Xe?void 0:Xe.isLoading,ji]),uo=s(function(e,n,i,t,o,r){var l;if(e.stopPropagation(),si.open&&si.sectionIdx===o)Ci();else{var u=e.currentTarget,c="left";(null===(l=Zn.current)||void 0===l?void 0:l.contains(u))&&(c="right");Ct(),St.current&&wt(),Bn(new Set),Fn([]),qn.current=[],yi(),gi.open?jo():mi(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(B)){var r=o.split(B),l="".concat(r[0]).concat(B).concat(r[1]);return"right"===c?null===(e=et.current[l])||void 0===e?void 0:e.current:null===(n=Zi.current[l])||void 0===n?void 0:n.current}return"right"===c?null===(i=et.current[o])||void 0===i?void 0:i.current:null===(t=Zi.current[o])||void 0===t?void 0:t.current}()||u;di(lo(e,n,t,o,i,r))})}},[si.open,si.sectionIdx,Ci,mi,lo]),co=s(function(){var e=si.sectionIdx;si.isOrphan,Ci(),mi(),null!==e&&(Ot(e),Ct(),St.current&&wt(),Fn([]),qn.current=[],ji&&null!==e&&On(Do(e)),Bn(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Gn.current&&Gn.current()},50))},[si.sectionIdx,si.isOrphan,Ci,mi,wt]),ao=s(function(){var e=Mn.current;if(e){Mn.current=null;var n=Mi.findIndex(function(n){return n.id===e}),i=Hi.findIndex(function(n){return n.id===e}),t=-1===n?w(Mi,e):null,o=-1===i?w(Hi,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,u;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(u=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==u?u:null},c=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(yt.current.add(r),I(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(dn)-1!==r&&oi.current&&c(function(){return u(n,t,Ui,it)},oi.current),-1!==l&&Zn.current&&c(function(){return u(i,o,Qi,tt)},Zn.current);else{var a=Un.current;if(!a)return;c(function(){return-1!==r?u(n,t,Ui,it):u(i,o,Qi,tt)},a)}}},[Mi,Hi,dn,Ui,Qi,it,tt,oi,Zn,Un]),so=s(function(n){if(n){Ct(),wt(),Bn(new Set),Fn([]),qn.current=[],mi(),yi();var i=Mi.findIndex(function(e){return e.id===n}),t=Hi.findIndex(function(e){return e.id===n}),o=-1===i?w(Mi,n):null,r=-1===t?w(Hi,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;Mn.current=n,Tt(function(n){var i,t=e({},n),o=!1;-1!==l&&(t[i=dn?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=dn?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),At(function(n){var i=e({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){Mn.current===n&&vo.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[Mi,Hi,dn,Tt,At,wt,mi,yi]),vo=u(ao);a(function(){vo.current=ao},[ao]);var fo=u(null);a(function(){if(_i){var e=wi.fields.find(function(e){return e.analysisKey===_i||e.key===_i});if(e){var n=Xi.current[e.key]||$i.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[_i,wi.fields]);var po=s(function(e){var n,i,t,o,r,l,u,c,a,s=null===(n=null==Nt?void 0:Nt.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!s||!s[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=s[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Nt]),go=U({proposedSections:Mi,existingSections:Hi,maintainRelativeOrder:dn,cognitiveMap:Xn,deviationData:Jn,treeData:We,resolvedComparisonConfig:wi,badgeStyleOverride:un}),ho=go.getSectionCompareStyle,mo=go.getSubSectionCompareStyle,So=go.getDeviationStyleByKey,xo=Z({containerRef:jn,leftContainerRef:oi,rightContainerRef:Zn,svgContainerRef:Pn,pathRefs:Wn,leftHeaderRef:Ln,rightHeaderRef:Nn,proposedSections:Mi,existingSections:Hi,visibleFields:zi,leftRefs:Xi,rightRefs:$i,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,sectionRowRefs:ot,expandedSections:Ft,expandedSubSections:Et,connectedSections:wn,isSideBySide:at,activeSideBySideSection:gt,maintainRelativeOrder:dn,isGuidelineMode:ji,cognitiveMap:Xn,getSectionCompareStyle:ho,getSubSectionCompareStyle:mo,getDeviationStyleByKey:So,isArrowVisible:st,isAnimatingRef:Hn,isSideBySideRef:St,sideBySideCacheRef:mt,sideBySideLineRef:bt,activeSideBySideSectionRef:Rt,activeSideBySideRightSectionRef:xt,connectedLines:In,setConnectedLines:Fn,cachedConnectedPositions:qn,calculateLinesRef:Gn,resizeTimerRef:Vn,scrollLock:ht,scrollSyncLocked:En,handleResizeRef:Kn,activeProposed:Li,existingRule:Ni,analysisData:Nt,pendingScrollTargetRef:ri,pendingScrollCallbackRef:li,resolvedComparisonConfig:wi,getFieldData:po}),Ro=xo.lines,bo=xo.setLines,yo=xo.overallConnector,Co=xo.setOverallConnector,wo=xo.svgDimensions,Bo=xo.handleColumnScroll;a(function(){gi.anchorEl&&requestAnimationFrame(function(){requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)})})},[gi.anchorEl,En]);var _o=s(function(){Ct(),An(!1),Tt({}),At({}),wt(),Bn(new Set),Fn([]),qn.current=[],mi(),yi(),Ci(),requestAnimationFrame(function(){Gn.current&&Gn.current()})},[Tt,At,wt,mi,yi,Ci]);a(function(){at||0!==wn.size||An(!1)},[at,wn]);var Io=c(function(){return Object.values(Ft).some(Boolean)||Object.values(Et).some(Boolean)},[Ft,Et]),Fo=u(null),To=u(0),Eo=u(0),Ao=u(0),ko=Q({timerRef:Fo,ruleComponentRef:Qn,scrollContainerRef:Un,containerRef:jn,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,isSideBySideRef:St,activeSideBySideSectionRef:Rt,activeSideBySideRightSectionRef:xt,sectionRowRefs:ot,sectionRightRowRefs:nt,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,leftContainerRef:oi,rightContainerRef:Zn,calculateLinesRef:Gn,handleResizeRef:Kn,setIsResizing:ft,setIsArrowVisible:dt,sideBySideCacheRef:mt,cachedConnectedPositions:qn}).handleResize;a(function(){Kn.current=ko},[ko,Kn]),a(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,u;i.current=null;var c=e[e.length-1];if(c){var a=null!==(u=null===(l=null===(r=c.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:c.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return Qn.current&&o.push(e(Qn.current,To,n,function(){return Kn.current()},function(){})),Un.current&&o.push(e(Un.current,Eo,i,function(){return Kn.current()},function(){return Gn.current()})),jn.current&&o.push(e(jn.current,Ao,t,function(){return Kn.current()},function(){return Gn.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),a(function(){St.current=at},[at]),a(function(){Rt.current=gt},[gt]);var Do=s(function(e){var n,i,t,o,r,l="",u="0";if("number"==typeof e)l=(null===(n=Mi[e])||void 0===n?void 0:n.nodeId)||(null===(i=Mi[e])||void 0===i?void 0:i.id)||"";else{var c=String(e).split(B);l=c[0],u=c[1]||"0"}var a=null===(t=null==Jn?void 0:Jn[l])||void 0===t?void 0:t.evaluation_result,s=Array.isArray(a)?a[parseInt(u,10)]:null==a?void 0:a[u];return!1===(null===(r=null===(o=null==s?void 0:s.evaluation_outputs)||void 0===o?void 0:o.guideline_flag)||void 0===r?void 0:r.rulebook_used)?1:0},[Mi,Jn]),Oo=s(function(e){var n,i,t=document.querySelectorAll('[id^="guideline-target-"], [data-web-gpt-active="true"]'),o=oi.current,r=Zn.current,l="string"==typeof e&&e.includes(B)?"".concat(e.split(B)[0]).concat(B).concat(e.split(B)[1]):e,u=(null===(n=Zi.current[l])||void 0===n?void 0:n.current)||(null===(i=Zi.current[e])||void 0===i?void 0:i.current);if(t.length>0&&u&&o&&r){var c=t[0];ii.current&&(ii.current.style.height="0px"),ei.current&&(ei.current.style.height="0px"),ti.current&&(ti.current.style.height="0px"),ni.current&&(ni.current.style.height="0px"),requestAnimationFrame(function(){var e=u.getBoundingClientRect(),n=c.getBoundingClientRect(),i=o.getBoundingClientRect(),t=r.getBoundingClientRect(),l=o.scrollTop+(e.top-i.top)+e.height/2,a=r.scrollTop+(n.top-t.top)+n.height/2,s=l-i.height/2,d=Math.max(0,s),v=o.scrollHeight-o.clientHeight,f=d>v?d-v:0,p=i.top+l-d,g=t.top+a-p,h=0;g<0&&(h=Math.abs(g),g=0);var m=r.scrollHeight-r.clientHeight+h,S=g>m?g-m:0;ti.current&&(ti.current.style.height="".concat(f,"px")),ei.current&&(ei.current.style.height="".concat(h,"px")),ni.current&&(ni.current.style.height="".concat(S,"px")),requestAnimationFrame(function(){o.scrollTo({top:d,behavior:"smooth"}),r.scrollTo({top:g,behavior:"smooth"}),Gn.current&&setTimeout(function(){return Gn.current()},50)})})}},[B]),Po=s(function(){var e,n=si.sectionIdx,i=si.isOrphan;if(mi(),null!=n){var t="left";si.anchorEl&&(null===(e=Zn.current)||void 0===e?void 0:e.contains(si.anchorEl))&&(t="right"),Ot(n),ji&&(On(Do(n)),Bn(new Set([n]))),Bt(n,i,{sourceSide:t,onReady:function(){ji&&setTimeout(function(){return Oo(String(n))},150)}})}},[Bt,si.isOrphan,si.sectionIdx,si.anchorEl,mi,Ot,ji,Oo,Jn]),jo=s(function(){mi(),wt(),Bn(new Set),Fn([]),qn.current=[]},[mi,wt]),Lo=null!==si.sectionIdx&&wn.has(si.sectionIdx),No=G({proposedSections:Mi,existingSections:Hi,parentDeviationRecord:Wi,expandedSections:Ft,maintainRelativeOrder:!!dn,scrollContainerRef:Un,leftContainerRef:oi,rightContainerRef:Zn,lhsBadgeRefs:Zi,rhsBadgeRefs:et}),Mo=No.showDeviationNavigation,Ho=No.showOpenNodeRef,zo=No.adjustScrollForPopup,Wo=s(function(e,n,i,t,o){var r,l="string"==typeof t?b(t).trim():b(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;yi();var c="left";(null===(r=Zn.current)||void 0===r?void 0:r.contains(u))&&(c="right");var a=function(){var e,i,t,o;if("string"==typeof n&&n.includes(B)){var r=n.split(B),l="".concat(r[0]).concat(B).concat(r[1]);return"right"===c?null===(e=et.current[l])||void 0===e?void 0:e.current:null===(i=Zi.current[l])||void 0===i?void 0:i.current}return"right"===c?null===(t=et.current[n])||void 0===t?void 0:t.current:null===(o=Zi.current[n])||void 0===o?void 0:o.current};if(i&&!ji)return wt(),Bn(new Set),Fn([]),qn.current=[],void(l&&(Ot(n),requestAnimationFrame(function(){var e=a()||u;e&&(e.getBoundingClientRect().top>.8*window.innerHeight&&e.scrollIntoView({behavior:"smooth",block:"center"}));hi({open:!0,anchorEl:e,summary:t,displayImpact:o})})));Ot(n),ji&&(On(Do(n)),Bn(new Set([n]))),l?setTimeout(function(){Bt(n,i,{toggleIfSame:!1,sourceSide:c,onReady:function(){var e,i,r,l=a()||u;if(ji)setTimeout(function(){return Oo(n)},150);else if(l){var c=l.getBoundingClientRect();if(c.top>.8*window.innerHeight||c.top<100){var s=c.top-window.innerHeight/2;dn?(null===(e=oi.current)||void 0===e||e.scrollBy({top:s,behavior:"smooth"}),null===(i=Zn.current)||void 0===i||i.scrollBy({top:s,behavior:"smooth"})):null===(r=Un.current)||void 0===r||r.scrollBy({top:s,behavior:"smooth"})}}hi({open:!0,anchorEl:l,summary:t,displayImpact:o})}})},350):setTimeout(function(){Bt(n,i,{toggleIfSame:!1,sourceSide:c}),ji&&setTimeout(function(){return Oo(n)},150)},350)},[Bt,yi,hi,wt,Ot,ji,dn,Oo,Jn]),qo=c(function(){var e;if(!en)return null;var n=null===(e=null==en?void 0:en.id)||void 0===e?void 0:e.split(":")[0];for(var i in Wi){if((Wi[i]||[]).some(function(e){return e.id===n}))return i}return null},[en,Wi]),Go=u({id:null,triggerMs:null}),Vo=u(null);a(function(){if(null==en?void 0:en.id){var o=Number(en.trigger),r=Go.current;if((null==r?void 0:r.id)!==en.id||(null==r?void 0:r.triggerMs)!==o){if(!(en.id.includes(":")&&/:\d+$/.test(en.id)))return Go.current={id:en.id,triggerMs:o},void so(en.id);var l=en.id.split(":"),u=l[0],c=l[1],a=null!=c?c:"0",s="".concat(en.id,":").concat(o);Vo.current!==s&&(mi(),yi(),wt(),Bn(new Set),Fn([]),qn.current=[],Vo.current=s);var d=!1,v=0,f=null,p=null,g=!1,h=function(e,n){for(var i=function(e,t){if(!e)return null;if(n.includes(e.id)||n.includes(e.nodeId)||n.includes(e.contentId))return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},m=function(){var r,l,c;if(!d){var s=function(){Go.current={id:en.id,triggerMs:o}},S=null,x=null;for(var R in Wi){var b=Wi[R].find(function(e){var n;return e.id===u||e.nodeId===u||e.contentId===u||(null===(n=e.evaluationResult)||void 0===n?void 0:n.nodeId)===u});if(b){S=R,x=b;break}}if(x&&S){var y=Array.from(new Set([u,x.id,x.nodeId,x.contentId,null===(r=x.evaluationResult)||void 0===r?void 0:r.nodeId].filter(Boolean))),C=Mi.findIndex(function(e){return e.id===S}),w=Hi.findIndex(function(e){return e.id===S}),_=-1===C&&-1!==w,I=h(Mi,y),E=h(Hi,y);if(I&&!E&&!_){var A=I.split("-"),k=Number(A[0]);if(dn){var D=null===(c=null===(l=Mi[k])||void 0===l?void 0:l.refIndexes)||void 0===c?void 0:c[0],O=Hi.findIndex(function(e){return e.selfIndex===D});-1!==O&&(k=O)}E=n([k],A.slice(1),!0).join("-")}if(I||E){var P=I?Number(I.split("-")[0]):C,j=E?Number(E.split("-")[0]):w,L=j>=0?j:E?Number(E.split("-")[0]):-1,N=Mi[P],M=Hi[L],H=N&&!N.title&&!N.content,z=M&&!M.title&&!M.content,W=_||(!I&&!!E||H&&!z);if(W){if(!(dn?!!ir.current["right-".concat(j)]:!!ir.current[String(j)])&&j>=0)return Dt(j,"right"),void(f=setTimeout(m,200))}else if(!(dn?!!ir.current["left-".concat(P)]:!!ir.current[String(P)])&&P>=0)return Dt(P,"left"),void(f=setTimeout(m,200));var q=I||"",G=E||"",V=y.map(function(e){return"".concat(e).concat(B).concat(a)}),K=V[0],Y=function(){for(var e,n,i=0,t=V;i<t.length;i++){var o=t[i],r=(null===(e=Zi.current[o])||void 0===e?void 0:e.current)||null,l=(null===(n=et.current[o])||void 0===n?void 0:n.current)||null;if(r||l)return{refId:o,left:r,right:l}}return{refId:K,left:null,right:null}},J=function(e){return"".concat(e).concat(B).concat(q).concat(B).concat(G)};if(!g){Ot(J(K)),g=!0,v=0;var X=function(){var e=Y(),n=e.left,i=e.right;return W||!n&&!!i?i:n};return null==p||p(),void(f=setTimeout(function(){var e,n,i,t,o,r,l,u;d||(e=X,n=function(){d||(p=null,m())},t=0,o=null,r=null,l=performance.now(),u=function(){if(!d)if(performance.now()-l>3e3)n();else{var c=e();if(c&&0!==c.getBoundingClientRect().height){var a=c.getBoundingClientRect(),s=a.top,v=a.height,f=null!==o&&Math.abs(s-o)<.5,p=null!==r&&Math.abs(v-r)<.5;if(f&&p){if(++t>=5)return void n()}else t=0;o=s,r=v,i=requestAnimationFrame(u)}else i=requestAnimationFrame(u)}},i=requestAnimationFrame(u),p=function(){return cancelAnimationFrame(i)})},300))}var $=Y(),U=$.refId,Q=$.left,Z=$.right,ee=J(U);if(Q||Z){var ne=W||!Q&&!!Z,ie=ne?Z:Q,te=dn?ne?Zn.current:oi.current:Un.current;if(ie&&te){var oe=ie.getBoundingClientRect();if(0!==oe.height){var re=te.getBoundingClientRect(),le=oe.top-re.top+te.scrollTop-re.height/2+oe.height/2,ue=(null==I?void 0:I.includes("-"))||(null==E?void 0:E.includes("-")),ce=function(){return i(void 0,void 0,void 0,function(){var n,i,o,r,l,u,c,v,f,p;return t(this,function(t){switch(t.label){case 0:return d?[2]:(s(),n=ie instanceof Element?window.getComputedStyle(ie).color:"",[Q,Z].forEach(function(e){e&&(e.style.transition="box-shadow 300ms ease-in-out",e.style.boxShadow="0 0 10px ".concat(n))}),setTimeout(function(){[Q,Z].forEach(function(e){e&&(e.style.boxShadow="")})},2e3),i=(null===(c=null===(u=x.evaluationResult)||void 0===u?void 0:u.deviations)||void 0===c?void 0:c[a])||x,o=(null===(v=x.evaluationResult)||void 0===v?void 0:v.evaluation_outputs)||x.evaluation_outputs,!!Q&&!!Z?(l=function(e,n){return Promise.race([e,new Promise(function(e){return setTimeout(e,n)})])},dn?[4,Promise.all([oi.current?l(T(oi.current),600):Promise.resolve(),Zn.current?l(T(Zn.current),600):Promise.resolve()])]:[3,2]):(r=ne?(null===(f=et.current[ue?U:j])||void 0===f?void 0:f.current)||Z:(null===(p=Zi.current[ue?U:P])||void 0===p?void 0:p.current)||Q,zo(r,function(){hi({open:!0,anchorEl:r,displayImpact:en.displayImpact,summary:e(e({},i),{evaluation_outputs:o})})},{skipScroll:!0}),null==nn||nn(),[2]));case 1:t.sent(),t.label=2;case 2:return _t.current(ee,!1,{toggleIfSame:!1,sourceSide:_?"right":"left",onReady:function(){var n,t,o,r;s();var l=ne?(null===(n=et.current[U])||void 0===n?void 0:n.current)||Z:(null===(t=Zi.current[U])||void 0===t?void 0:t.current)||Q,u=(null===(o=Zi.current[U])||void 0===o?void 0:o.current)||Q,c=(null===(r=et.current[U])||void 0===r?void 0:r.current)||Z;u&&(u.style.scrollMarginTop="150px",u.scrollIntoView({behavior:"smooth",block:"start"})),c&&(c.style.scrollMarginTop="150px",c.scrollIntoView({behavior:"smooth",block:"start"})),hi({open:!0,anchorEl:l,displayImpact:en.displayImpact,summary:e({},i)}),null==nn||nn()}}),[2]}})})};Math.abs(te.scrollTop-le)<=2?ce():F(te,le,ce)}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}};return f=setTimeout(m,100),function(){d=!0,f&&clearTimeout(f),null==p||p()}}}},[null==en?void 0:en.id,null==en?void 0:en.trigger,null==en?void 0:en.displayImpact,Wi,Mi,Hi,dn,hi,so]),a(function(){var n,i,t;if(gi.open){var o=gi.anchorEl;if(o&&!o.isConnected){var r=function(e){for(var n,i=0,t=Object.entries(e);i<t.length;i++){var r=t[i],l=r[0];if((null===(n=r[1].current)||void 0===n?void 0:n.textContent)===o.textContent)return l}return null},l=(null===(n=o.dataset)||void 0===n?void 0:n.deviationRefId)||r(Zi.current)||r(et.current);if(l){var u=(null===(i=et.current[l])||void 0===i?void 0:i.current)||(null===(t=Zi.current[l])||void 0===t?void 0:t.current);u&&u.isConnected&&hi(function(n){return e(e({},n),{anchorEl:u})})}}}},[gi.open,gi.anchorEl,En,wn,Ft]);var Ko=ci.open,Yo=ci.sectionIdx,Jo=ci.isOrphan,Xo=ci.badgeStyle,$o=ci.anchorEl,Uo=ci.sectionAnchorEl;a(function(){var n;if(Xe.isStreamingEnabled&&Ko&&null!=Yo&&Yo!==zt){var i="string"==typeof Yo?Yo.split(B)[0]:null,t=function(e,n){var i;if(!e||!Array.isArray(e))return null;for(var o=0,r=e;o<r.length;o++){var l=r[o];if(l.id===n)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var u=t(l.subsections,n);if(u)return u}}return null},o=i&&"string"==typeof i?t(Mi,i):null,r=i&&"string"==typeof i?t(Hi,i):null,l="number"==typeof Yo?Mi[Yo]||null:o||i&&((null===(n=null==We?void 0:We.nodes)||void 0===n?void 0:n[i])||(null==We?void 0:We[i]))||null,u="number"==typeof Yo?Hi[Yo]||null:r,c=lo($o,l,u,Yo,Jo,Xo);ai(function(n){return n.open?b(n.cognitiveData)===b(c.cognitiveData)&&b(n.deviationData)===b(c.deviationData)&&n.sectionTitle===c.sectionTitle&&n.refSectionTitle===c.refSectionTitle?n:e(e(e({},n),c),{open:!0,anchorEl:n.anchorEl,sectionAnchorEl:n.sectionAnchorEl}):n})}},[Ko,Yo,Jo,Xo,$o,Uo,Mi,Hi,lo]);var Qo=s(function(e){var n=e.section,i=e.keyPath,t=e.depth,r=void 0===t?0:t,l=e.columnKey,u=void 0===l?"left":l,c=e.parentNodeId,a=void 0===c?"":c,s=e.sectionOffset,d=e.rhsOrphanVisualIndexes;return o(K,{section:n,keyPath:i,depth:r,columnKey:u,parentNodeId:a,sectionOffset:s,rhsOrphanVisualIndexes:d})},[]),Zo=c(function(){return Mi.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&dn?null:o(Y,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"left-row-".concat(n))})},[Mi]),er=c(function(){return Hi.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&dn?null:o(J,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"right-row-".concat(n))})},[Hi]),nr=u(uo);a(function(){nr.current=uo},[uo]);var ir=u(Ft);a(function(){ir.current=Ft},[Ft]);var tr=u(Wo);a(function(){tr.current=Wo},[Wo]);var or=u(jo);a(function(){or.current=jo},[jo]);var rr=u(Dt);a(function(){rr.current=Dt},[Dt]);var lr=u(kt);a(function(){lr.current=kt},[kt]);var ur=u(Qo);a(function(){ur.current=Qo},[Qo]);var cr=u(wt);a(function(){cr.current=wt},[wt]);var ar=c(function(){return{isGuidelineMode:ji,maintainRelativeOrder:!!dn,showDeviationBadges:gn,isProposingFix:on,proposingFixNodeId:rn,isRedlineFlow:ln,isSideBySide:at,activeSideBySideSection:gt,scrollSyncLocked:En,toggleScrollSyncLocked:jt,summaryPopupAnchorEl:gi.anchorEl,connectedSections:wn,proposedSections:Mi,existingSections:Hi,deviationNumberRegistry:qi,deviationParentRegistry:Gi,treeData:We,displayConfig:Xe,resolvedMarkdownStyles:$n,unifiedNumbering:Lt,expandedSections:Ft,expandedSubSections:Et,setExpandedSubSections:At,getSectionCompareStyle:ho,getSubSectionCompareStyle:mo,getBadgeRef:ut,getSectionRowRef:rt,getSubSectionRef:lt,sectionLeftRefs:Ui,sectionRightRefs:Qi,sectionRowRefs:ot,sectionRightRowRefs:nt,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,openMoreFunctionsPopup:Jt,handleOpenSummaryPopup:Xt,openSummaryPopup:Xt,handleCloseSummaryPopup:$t,toggleSection:Ut,handleSubSectionToggle:Qt,renderSubSectionAccordion:Zt,resetSideBySide:eo,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,showDeviationNavigation:Mo,showOpenNodeRef:Ho,deviationNodeIdToView:null==en?void 0:en.id,deviationTargetParentId:qo,guidelinesData:cn,gptWebCitationConfig:an}},[ji,dn,gn,on,rn,ln,at,gt,En,jt,gi.anchorEl,wn,Mi,Hi,qi,Xe,$n,Lt,Ft,Et,At,ho,mo,ut,rt,lt,Mo,Ho,en,qo,cn,an]);return o($,e({value:ar},{children:r(d,e({ref:Qn,sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"visible",position:"relative"}},{children:[mn&&o(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:o(N,{})})),gi.open&&o(X,{open:gi.open,anchorEl:gi.anchorEl,containerEl:fo.current,clipTopEl:Ln.current,scrollContainerEl:Un.current,onClose:jo,summary:gi.summary,displayImpact:gi.displayImpact,isScrollLocked:En}),o(L,{open:si.open,anchorEl:si.anchorEl,maintainRelativeOrder:!!dn,sectionTitle:si.sectionTitle,referenceSectionTitle:si.refSectionTitle,onClose:Ci,onOpenCognitiveCompare:Ri,onOpenSideBySide:Po,onConnect:co,isConnected:Lo,isOrphan:!ji&&!!si.isOrphan,isGuidelineMode:ji,hasGuidelineMatches:si.hasGuidelineMatches}),ci.open&&o(j,{open:ci.open,popupRef:xi,position:vi,popupConfig:Ue,onClose:function(){fi(null),ai(function(n){return e(e({},n),{open:!1})}),Si(null)},markdownStyles:Ke,sectionTitle:Ai,referenceSectionTitle:Di,cognitiveData:ci.cognitiveData,anchorEl:ci.anchorEl,sectionAnchorEl:ci.sectionAnchorEl,scrollContainerEl:Un.current,badgeStyle:ci.badgeStyle,docData:ci.docData,deviationData:ci.deviationData,isLoading:ci.isLoading}),o(v,e({open:!!Rn,autoHideDuration:8e3,onClose:function(){return bn(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:o(f,e({onClose:function(){return bn(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Rn}))})),o(V,{componentHeaderText:ze,displayConfig:Xe,maintainRelativeOrder:dn,onCollapseAll:_o,showCollapseAll:Io,onToggleView:function(e){Sn(!0),setTimeout(function(){vn(!e),null==$e||$e(!e),An(!1),wt(),mi(),Bn(new Set),Fn([]),qn.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){Sn(!1)},600)})})},50)}}),o(d,e({ref:Un,onScroll:Bo,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:dn?"visible":"auto",borderTop:Mt&&Ht?"none":"1.5px solid #EEF0F4"}},{children:o(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},dn?{flex:1}:{})},{children:r(d,e({ref:jn,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"100px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},dn?{flex:1,overflow:"visible"}:{})},{children:[o(ne,{svgContainerRef:Pn,svgDimensions:wo,isResizing:vt,overallConnector:yo,rootDeviationStyle:Gt,lines:Ro,isSideBySide:at,activeSideBySideSection:gt,isArrowVisible:st,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,cognitivePopup:ci,activeBadgeId:pi,closeCognitivePopup:yi,setActiveBadgeId:Si,openCognitivePopupFromState:bi,buildSectionPopupState:lo,connectedLines:In,isGuidelineMode:ji,pathRefs:Wn}),r(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},dn?{flex:1,overflow:"visible"}:{})},{children:[o(d,e({ref:Ln,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:o(p,e({title:Ti,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Ti}))}))})),r(d,e({ref:oi,onScroll:Bo,sx:e({p:"12px",display:"flex",flexDirection:"column"},dn?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-180px",pr:"192px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[o("div",{ref:ii,style:{width:"100%",height:"0px",flexShrink:0}}),Ki&&Zo,o("div",{ref:ti,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),o(d,e({ref:fo,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:o(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:r(d,e({onClick:function(n){n.stopPropagation(),ci.open&&pi===zt?yi():(Si(zt),bi(lo(n.currentTarget,{title:"",content:"",evaluationResult:Wt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,zt,!0,e(e({},Gt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Gt.badgeBg,color:Gt.badgeText,border:"1px solid ".concat(Gt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=qt?qt:o(M,{}),o(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:o(x,{})})),o(S,{size:11,style:{transform:ci.open&&pi===zt?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),r(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},dn?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[pt&&o(R,{sections:11}),o(d,e({ref:Nn,sx:e({p:"8px",bgcolor:ji?"#F1F3F5":"#F7F8FA",borderBottom:"1px solid #D7DCE2",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center"},dn?e({maxHeight:"calc(100vh - 250px)",overflowY:"auto",overflowX:"hidden",minHeight:0},ji?{"&::-webkit-scrollbar":{width:"6px",display:"block"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"#94A3B8"},scrollbarWidth:"thin",scrollbarColor:"#CBD5E1 transparent"}:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}):{})},{children:ji?r(h,e({value:Dn,onChange:function(e,n){return On(n)},variant:"fullWidth",TabIndicatorProps:{sx:{display:"none"}},sx:{width:"100%",minHeight:"36px","& .MuiTab-root":{minHeight:"36px",px:1,py:0,borderRadius:"8px",fontSize:"14px",lineHeight:1,fontWeight:500,textTransform:"none",color:"#374151",minWidth:0,transition:"background-color 160ms ease, box-shadow 160ms ease"},"& .Mui-selected":{color:"#374151",bgcolor:"#FFFFFF"}}},{children:[o(m,{label:o(p,e({title:Oi,placement:"top"},{children:o(d,e({component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",width:"100%"}},{children:"Redline Guidelines"}))}))}),o(m,{label:o(p,e({title:"Web & GPT Sources",placement:"top"},{children:o(d,e({component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",width:"100%"}},{children:"Web & GPT Sources"}))}))})]})):o(p,e({title:Oi,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Oi}))}))})),r(d,e({ref:Zn,onScroll:Bo,sx:e({p:ji?"0px":"12px",display:"flex",flexDirection:"column"},dn?e(e({maxHeight:"calc(100vh - 250px)"},!ji&&{flex:1}),{overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}):{})},{children:[o("div",{ref:ei,style:{width:"100%",height:"0px",flexShrink:0}}),ji?o(0===Dn?ie:te,{guidelinesData:cn,deviationData:Ze,connectedSections:wn,proposedSections:Mi}):Ki&&er,o("div",{ref:ni,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};export{oe as default};
2
2
  //# sourceMappingURL=CognitiveCompare.js.map
@@ -0,0 +1,2 @@
1
+ import{__assign as e,__rest as r}from"tslib";import{jsx as n}from"react/jsx-runtime";import{useMemo as o}from"react";import{Box as t,Typography as a}from"@mui/material";import i from"react-markdown";import d from"rehype-raw";import{SHARED_MARKDOWN_STYLES as l}from"../../CognitiveCompareConfig.js";import{DEVIATION_BADGE_SEPARATOR as u,generateColorPalette as c}from"../../CognitiveComparehelpers.js";import v from"../../CitationAnchor.js";var s=function(e){var r,n,o=e.evalNode;return!1===(null===(n=null===(r=null==o?void 0:o.evaluation_outputs)||void 0===r?void 0:r.guideline_flag)||void 0===n?void 0:n.rulebook_used)},p=function(e,r,n){return"".concat(e,"::").concat(r,"::").concat(n)},f=function(e,r){return"".concat(e,"::").concat(r)},w={relativeWrapper:{verticalAlign:"baseline"},arrow:{color:"#6D28D9"}},m=function(m){var b=m.deviationData,y=m.connectedSections,h=m.proposedSections,g=Array.from(y||[])[0],x=o(function(){return function(e,r){var n;return"number"==typeof e?(null===(n=r[e])||void 0===n?void 0:n.nodeId)||"":"string"==typeof e?e.includes(u)?e.split(u)[0]:e.split("::")[0].split(":")[0]:""}(g,h||[])},[g,h]),K=o(function(){if(!b||"object"!=typeof b)return[];return Object.entries(b).flatMap(function(e){var r=e[0];return function(e){var r=null==e?void 0:e.evaluation_result;return r?Array.isArray(r)?r.map(function(e,r){return{evalNode:e,evaluationKey:String(r)}}):"object"==typeof r?Object.entries(r).map(function(e){var r=e[0];return{evalNode:e[1],evaluationKey:r}}):[]:[]}(e[1]).filter(s).map(function(e){var n,o,t,a=e.evalNode,i=e.evaluationKey;return{nodeId:r,evaluationKey:i,answerKey:f(r,i),evaluation:a,webSearchAnswer:a.web_search_answer,colorPalette:null!==(t=c((null===(o=null===(n=null==a?void 0:a.evaluation_outputs)||void 0===n?void 0:n.metadata)||void 0===o?void 0:o.label_color)||""))&&void 0!==t?t:{border:w.arrow.color}}}).filter(function(e){var r=e.webSearchAnswer;return!!(null==r?void 0:r.enhanced_content)})}).map(function(r,n){return e(e({},r),{answerOrder:n})})},[b]),F=o(function(){return K.reduce(function(e,r){var n,o=(null===(n=r.webSearchAnswer)||void 0===n?void 0:n.extraMetaData)||{};return Object.entries(o).forEach(function(n){var o=n[0],t=n[1],a=p(r.nodeId,r.evaluationKey,o);e[a]={nodeId:r.nodeId,evaluationKey:r.evaluationKey,answerKey:r.answerKey,answerOrder:r.answerOrder,reasoningId:o,evaluation:r.evaluation,webSearchAnswer:r.webSearchAnswer,extraMetaData:t}}),e},{})},[K]),S=o(function(){return K.reduce(function(e,o){return e[o.answerKey]={a:function(e){var t=e.href,a=void 0===t?"":t,i=e.children,d=e.type,l=e.reason,u=r(e,["href","children","type","reason"]),c=null==u?void 0:u["data-cognitive-reasoning"],s=c?p(o.nodeId,o.evaluationKey,String(c)):"",f=s?F[s]:null;return n(v,{href:a,children:i,citationType:d,citationReason:l,metaData:{webGpt:f,webGptMetaKey:s},customStyle:w})}},e},{})},[K,F]);return n(t,e({sx:e(e({padding:"12px 12px 12px 0px",backgroundColor:"#FFFFFF",borderRadius:"8px"},l),{overflow:"visible"})},{children:K.length>0?K.map(function(r,o){return n(t,e({id:r.nodeId===x?"guideline-target-0":void 0,"data-web-gpt-node-id":r.nodeId,"data-web-gpt-evaluation-key":r.evaluationKey,"data-web-gpt-answer-order":r.answerOrder,"data-web-gpt-active":r.nodeId===x?"true":"false",sx:{mb:1.5,border:r.nodeId===x?"2px solid ".concat(r.colorPalette.border):"1px solid #d3d3d3",borderRadius:"6px",padding:"8px",backgroundColor:"#FFFFFF"}},{children:n(i,e({rehypePlugins:[d],components:S[r.answerKey]},{children:r.webSearchAnswer.enhanced_content}))}),r.answerKey)}):n(a,e({sx:{color:"#64748B",fontSize:"14px",py:1}},{children:"No web GPT data available."}))}))};export{m as default};
2
+ //# sourceMappingURL=WebGptPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGptPanel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{__spreadArray as e,__assign as n}from"tslib";import{jsx as o,jsxs as i,Fragment as t}from"react/jsx-runtime";import r from"react";import{Box as l,Tooltip as d,Typography as a}from"@mui/material";import{EllipsisVertical as c}from"lucide-react";import s from"./SectionAccordion.js";import u from"./ThreeDotsLoader.js";import p from"./ScrollLockToggle.js";import{getRhsMappedSectionNumber as f,getAlphabeticSuffix as x}from"../CognitiveComparehelpers.js";import{useCompareContext as g}from"../CompareContext.js";var v=r.memo(function(v){var m,h,b,S=v.section,I=v.idx,y=g(),R=y.maintainRelativeOrder;y.existingSections;var w=y.proposedSections,B=y.connectedSections,C=y.expandedSections,N=y.displayConfig,k=y.treeData;y.deviationNumberRegistry;var T=y.getSectionCompareStyle;y.getBadgeRef;var j=y.getSectionRowRef,P=y.sectionRightRefs,z=y.rhsBadgeRefs,D=y.openMoreFunctionsPopup,M=y.handleOpenSummaryPopup,A=y.handleCloseSummaryPopup,L=y.toggleSection;y.showDeviationBadges,y.renderSubSectionAccordion,y.isProposingFix,y.proposingFixNodeId,y.isRedlineFlow;var F=y.isSideBySide,O=y.activeSideBySideSection,E=y.scrollSyncLocked,U=y.toggleScrollSyncLocked,W=y.summaryPopupAnchorEl;y.deviationNodeIdToView,y.deviationTargetParentId;var _=y.showDeviationNavigation;y.showOpenNodeRef,y.resolvedMarkdownStyles;var H=y.unifiedNumbering,K=S,V=!1,X=null,Y=-1,q=-1;R?(q=w.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(K.selfIndex))&&e.selfIndex>=0}),Y=w.findIndex(function(e,n){var o;return B.has(n)&&(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(K.selfIndex))}),(V=-1!==Y)&&(X=T(Y,"left"))):(V=B.has(I))&&(X=T(I,"right"));var G=R&&-1!==q?T(q,"left"):T(I,"right"),J=X||G,Q=R?-1!==q||!(null===(m=K.refIndexes)||void 0===m?void 0:m.length)&&w.some(function(e){return e.id&&e.id===K.id}):Boolean(w[I]),Z=R?K.selfIndex<0||!Q:!w[I],$=r.useMemo(function(){var e=H.rightNums.get(K.id);return R&&K.id?f({section:K,proposedSections:w,leftNums:H.leftNums,fallbackNumber:e}):e},[R,w,K.id,K.selfIndex,H]),ee=r.useMemo(function(){if(!R||null==K.selfIndex)return null!=$?[{label:String($),title:K.title||"Untitled Section",lhsIdx:-1}]:[];var n=w.map(function(e,n){var o=Array.isArray(null==e?void 0:e.refIndexes)?e.refIndexes:[],i=o.findIndex(function(e){return e===K.selfIndex});if(-1===i)return null;var t=(null==e?void 0:e.id)?H.leftNums.get(e.id):void 0;return null==t?null:{label:o.length>1?"".concat(t).concat(x(i)):String(t),title:(null==e?void 0:e.title)||"Untitled Section",lhsIdx:n}}).filter(Boolean);return-1===Y?n:e([],n,!0).sort(function(e,n){return e.lhsIdx===Y?-1:n.lhsIdx===Y?1:0})},[R,w,K.selfIndex,K.title,$,H.leftNums,Y]),ne=r.useMemo(function(){var e,n=null===(e=ee[0])||void 0===e?void 0:e.label;if(!n)return null!=$?String($):"";var o=ee.length-1;return o>0?"".concat(n," +").concat(o):n},[ee,$]),oe=r.useMemo(function(){return 0===ee.length?"":ee.map(function(e){return"".concat(e.label,": ").concat(e.title)}).join("\n")},[ee]),ie=null===(h=z.current[I])||void 0===h?void 0:h.current,te=V||F&&(O===I||O===q)||!!W&&W===ie;return o(l,n({ref:j(I),sx:{mb:1,width:"100%"}},{children:o(l,n({ref:P.current[I],sx:n({width:"100%",display:"flex"},V&&X&&{borderRadius:"6px",outline:"2px solid ".concat(X.badgeBorder),outlineOffset:"1px"})},{children:i(l,n({sx:{position:"relative",width:"100%"}},{children:[o(s,{section:S,idx:I,columnKey:"right",colRef:j("right-accordion-".concat(I)),mb:0,parentNodeId:(null===(b=null==k?void 0:k.input_index_map)||void 0===b?void 0:b[1])||"",isExpanded:R?!!C["right-".concat(I)]:!!C[String(I)],onToggle:function(){A(),L(I,"right")},navigation:S.id?_[S.id]:null}),R&&J&&o(d,n({title:oe?o(l,n({sx:{whiteSpace:"pre-line"}},{children:o(a,n({component:"span",sx:{fontSize:"11px",lineHeight:1.5}},{children:oe}))})):"",placement:"top",arrow:!0},{children:o(l,n({ref:z.current[I],"data-section-id":K.id,onClick:function(e){var n,o,i;if(Z){var t=N.enableDeviationSchemaBackwardCompatibility?null!==(n=K.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=K.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;M(e,String(I),Z,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Z?"4px":"0px",fontSize:"11px",bgcolor:J.badgeBg,color:J.badgeText,border:"1px solid ".concat(J.badgeBorder),borderRadius:Z?"12px":"10px",px:Z?1.2:1,py:.3,fontWeight:Z?600:700,cursor:Z?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:Z?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:Z?i(t,{children:[i(l,n({component:"span",onClick:function(e){var n,o,i;e.stopPropagation();var t=N.enableDeviationSchemaBackwardCompatibility?null!==(n=K.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=K.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;M(e,String(I),Z,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(J.badgeBorder),"&:hover":{bgcolor:"".concat(J.badgeBorder,"22")}}},{children:[null!=$&&o(l,n({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(J.badgeBorder)}},{children:$})),o(l,n({component:"span",sx:{fontSize:"11px",px:.25}},{children:!N.isLoading||null!=K.evaluationResult&&void 0!==K.evaluationResult?J.label?"".concat(J.label):"100% Deviation":o(u,{color:J.badgeText})}))]})),i(l,n({component:"span",onClick:function(e){e.stopPropagation();var n=R?w.find(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(K.selfIndex)})||{title:"",content:""}:w[I]||{title:"",content:""};D(e,n,Z,K,I,J)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(J.badgeBorder,"22")}}},{children:[o(c,{size:11,color:J.badgeText}),te&&o(p,{locked:E,onToggle:U,color:J.badgeText,borderColor:J.badgeBorder,size:11})]}))]}):o(t,{children:o(l,n({component:"span",sx:{px:.2}},{children:ne}))})}))}))]}))}))}),"right-row-".concat(I))});export{v as default};
1
+ import{__assign as e}from"tslib";import{jsx as o,jsxs as n,Fragment as i}from"react/jsx-runtime";import t from"react";import{Box as r}from"@mui/material";import{EllipsisVertical as l}from"lucide-react";import a from"./SectionAccordion.js";import d from"./ThreeDotsLoader.js";import c from"./ScrollLockToggle.js";import{getRhsMappedSectionNumber as s}from"../CognitiveComparehelpers.js";import{useCompareContext as p}from"../CompareContext.js";var u=t.memo(function(u){var g,f,x,v=u.section,m=u.idx,h=p(),b=h.maintainRelativeOrder;h.existingSections;var S=h.proposedSections,R=h.connectedSections,y=h.expandedSections,I=h.displayConfig,w=h.treeData;h.deviationNumberRegistry;var B=h.getSectionCompareStyle;h.getBadgeRef;var C=h.getSectionRowRef,k=h.sectionRightRefs,N=h.rhsBadgeRefs,T=h.openMoreFunctionsPopup,P=h.handleOpenSummaryPopup,j=h.handleCloseSummaryPopup,D=h.toggleSection;h.showDeviationBadges,h.renderSubSectionAccordion,h.isProposingFix,h.proposingFixNodeId,h.isRedlineFlow;var z=h.isSideBySide,L=h.activeSideBySideSection,F=h.scrollSyncLocked,O=h.toggleScrollSyncLocked,A=h.summaryPopupAnchorEl;h.deviationNodeIdToView,h.deviationTargetParentId;var M=h.showDeviationNavigation;h.showOpenNodeRef,h.resolvedMarkdownStyles;var E=h.unifiedNumbering,W=v,_=!1,K=null,V=-1;if(b){V=S.findIndex(function(e){var o;return(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(W.selfIndex))&&e.selfIndex>=0});var X=S.findIndex(function(e,o){var n;return R.has(o)&&(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(W.selfIndex))});(_=-1!==X)&&(K=B(X,"left"))}else(_=R.has(m))&&(K=B(m,"right"));var Y=b&&-1!==V?B(V,"left"):B(m,"right"),q=b?-1!==V||!(null===(g=W.refIndexes)||void 0===g?void 0:g.length)&&S.some(function(e){return e.id&&e.id===W.id}):Boolean(S[m]),G=b?W.selfIndex<0||!q:!S[m],H=t.useMemo(function(){var e=E.rightNums.get(W.id);return b&&W.id?s({section:W,proposedSections:S,leftNums:E.leftNums,fallbackNumber:e}):e},[b,S,W.id,W.selfIndex,E]),J=null===(f=N.current[m])||void 0===f?void 0:f.current,Q=_||z&&(L===m||L===V)||!!A&&A===J;return o(r,e({ref:C(m),sx:{mb:1,width:"100%"}},{children:o(r,e({ref:k.current[m],sx:e({width:"100%",display:"flex"},_&&K&&{borderRadius:"6px",outline:"2px solid ".concat(K.badgeBorder),outlineOffset:"1px"})},{children:n(r,e({sx:{position:"relative",width:"100%"}},{children:[o(a,{section:v,idx:m,columnKey:"right",colRef:C("right-accordion-".concat(m)),mb:0,parentNodeId:(null===(x=null==w?void 0:w.input_index_map)||void 0===x?void 0:x[1])||"",isExpanded:b?!!y["right-".concat(m)]:!!y[String(m)],onToggle:function(){j(),D(m,"right")},navigation:v.id?M[v.id]:null}),b&&Y&&o(r,e({ref:N.current[m],"data-section-id":W.id,onClick:function(e){var o,n,i;if(G){var t=I.enableDeviationSchemaBackwardCompatibility?null!==(o=W.evaluationResult)&&void 0!==o?o:null:null!==(i=null===(n=W.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==i?i:null;P(e,String(m),G,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:G?"4px":"0px",fontSize:"11px",bgcolor:Y.badgeBg,color:Y.badgeText,border:"1px solid ".concat(Y.badgeBorder),borderRadius:G?"12px":"10px",px:G?1.2:1,py:.3,fontWeight:G?600:700,cursor:G?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:G?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:G?n(i,{children:[n(r,e({component:"span",onClick:function(e){var o,n,i;e.stopPropagation();var t=I.enableDeviationSchemaBackwardCompatibility?null!==(o=W.evaluationResult)&&void 0!==o?o:null:null!==(i=null===(n=W.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==i?i:null;P(e,String(m),G,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(Y.badgeBorder),"&:hover":{bgcolor:"".concat(Y.badgeBorder,"22")}}},{children:[null!=H&&o(r,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(Y.badgeBorder)}},{children:H})),o(r,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:!I.isLoading||null!=W.evaluationResult&&void 0!==W.evaluationResult?Y.label?"".concat(Y.label):"100% Deviation":o(d,{color:Y.badgeText})}))]})),n(r,e({component:"span",onClick:function(e){e.stopPropagation();var o=b?S.find(function(e){var o;return null===(o=e.refIndexes)||void 0===o?void 0:o.includes(W.selfIndex)})||{title:"",content:""}:S[m]||{title:"",content:""};T(e,o,G,W,m,Y)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(Y.badgeBorder,"22")}}},{children:[o(l,{size:11,color:Y.badgeText}),Q&&o(c,{locked:F,onToggle:O,color:Y.badgeText,borderColor:Y.badgeBorder,size:11})]}))]}):o(i,{children:o(r,e({component:"span",sx:{px:.2}},{children:null!=H?H:""}))})}))]}))}))}),"right-row-".concat(m))});export{u as default};
2
2
  //# sourceMappingURL=RHSSectionRow.js.map
@@ -1,2 +1,2 @@
1
- var e={container:"CognitiveNonWebSearchReasoning-module_container__koQEN",itemRow:"CognitiveNonWebSearchReasoning-module_itemRow__lRmgs",indexNumber:"CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg",textContent:"CognitiveNonWebSearchReasoning-module_textContent__327fx",paraphraseButton:"CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe",paraphraseText:"CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty",paraphraseStar:"CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR",chevronIcon:"CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw",chevronIconRotated:"CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP",expandedContainer:"CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9",expandedHeader:"CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb",headerTitle:"CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI",headerActions:"CognitiveNonWebSearchReasoning-module_headerActions__j1P4u",navigationContainer:"CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG",navButton:"CognitiveNonWebSearchReasoning-module_navButton__aOaMv",navIcon:"CognitiveNonWebSearchReasoning-module_navIcon__uLme4",navCounter:"CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc",confidenceBadge:"CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3",confidenceStar:"CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S",confidenceScore:"CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK",maximizeButton:"CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-",maximizeIcon:"CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez",contentArea:"CognitiveNonWebSearchReasoning-module_contentArea__hVoLL",contentInner:"CognitiveNonWebSearchReasoning-module_contentInner__df-34",footer:"CognitiveNonWebSearchReasoning-module_footer__CNE8q",trainingTitle:"CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh",trainingTitleLink:"CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U",modalDialog:"CognitiveNonWebSearchReasoning-module_modalDialog__eGApe",modalContainer:"CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01",modalHeader:"CognitiveNonWebSearchReasoning-module_modalHeader__qglof",modalHeaderTitle:"CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X",modalHeaderActions:"CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip",modalNavContainer:"CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP",modalNavButton:"CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24",closeButton:"CognitiveNonWebSearchReasoning-module_closeButton__S23zi",closeIcon:"CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG",modalContent:"CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv",modalContentInner:"CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo",modalFooter:"CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn",modalFooterSource:"CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt",blockLine:"CognitiveNonWebSearchReasoning-module_blockLine__FwGYE",headerLine:"CognitiveNonWebSearchReasoning-module_headerLine__0j5p4",listItemLine:"CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O",listCounter:"CognitiveNonWebSearchReasoning-module_listCounter__esNpx",boldText:"CognitiveNonWebSearchReasoning-module_boldText__suAp2",highlight:"CognitiveNonWebSearchReasoning-module_highlight__EMAz5",highlightActive:"CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU",highlightActiveVariant:"CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp",highlightVariant:"CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ",highlightButton:"CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".CognitiveNonWebSearchReasoning-module_container__koQEN{display:flex;flex-direction:column;gap:.5rem}.CognitiveNonWebSearchReasoning-module_itemRow__lRmgs{align-items:flex-start;display:flex;font-size:.875rem;gap:.5rem}.CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg{color:#475467;font-weight:500}.CognitiveNonWebSearchReasoning-module_textContent__327fx{color:#475467;flex:1;max-width:none}.CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe{align-items:center;background:#0000;border:none;border-radius:.375rem;cursor:pointer;display:inline-flex;gap:.25rem;justify-content:flex-start;padding:.125rem .375rem}.CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty{color:#2563eb;font-weight:500;text-align:start}.CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR{color:#2563eb;padding-right:.25rem}.CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw{color:#2563eb;height:1rem;transition:transform .2s;width:1rem}.CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP{transform:rotate(180deg)}.CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9{border:solid #e5e7eb;border-radius:.5rem;border-width:1px 1px 2px;margin-left:1.5rem;margin-top:.5rem;overflow:hidden}.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.25rem .75rem}.CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI{font-size:.875rem;font-weight:400}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv:hover{background-color:#f3f4f6}.CognitiveNonWebSearchReasoning-module_navIcon__uLme4{color:#6b7280;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc{color:#4b5563;font-size:.875rem;min-width:2.25rem;text-align:center}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{align-items:center;background-color:#f0fdf4;border:2px solid #3ac894;border-radius:9999px;display:inline-flex;gap:.25rem;padding:.25rem .5rem}.CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S{color:#059669;font-size:.75rem}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{color:#059669;font-size:.875rem;font-weight:600}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{color:#6b7280;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{font-size:.875rem;max-height:11rem;overflow-y:auto;padding:.5rem .75rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_contentInner__df-34{line-height:1.5rem}.CognitiveNonWebSearchReasoning-module_footer__CNE8q{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;justify-content:flex-end}.CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh{font-size:.875rem;font-style:italic;font-weight:300}.CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;font-size:.8rem;font-weight:600;gap:.25rem}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe{background:#0000;border:none;left:50%;margin:0;max-height:none;max-width:none;overflow:visible;padding:0;position:fixed;top:50%;transform:translate(-50%,-50%)}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe::backdrop{background-color:#0006}.CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01{background-color:#fff;border-radius:.75rem;box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;max-height:80vh;max-width:900px;overflow:hidden;width:80vw}.CognitiveNonWebSearchReasoning-module_modalHeader__qglof{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.75rem .5rem .75rem 1rem;width:100%}.CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X{font-size:1rem;font-weight:500}.CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP{align-items:center;background-color:#f3f4f6;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG{color:#4b5563;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv{flex:1;font-size:.875rem;overflow-y:auto;padding:.75rem 1rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo{line-height:1.75rem}.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;justify-content:flex-end;padding:.5rem 1rem}.CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;justify-content:flex-start;padding:1rem}.CognitiveNonWebSearchReasoning-module_blockLine__FwGYE{display:block}.CognitiveNonWebSearchReasoning-module_headerLine__0j5p4{display:block;font-weight:400}.CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O{display:block}.CognitiveNonWebSearchReasoning-module_listCounter__esNpx{display:inline-block;font-weight:500;text-align:left;width:1.5rem}.CognitiveNonWebSearchReasoning-module_boldText__suAp2{font-weight:600}.CognitiveNonWebSearchReasoning-module_highlight__EMAz5{background-color:#fef08a;border-radius:.25rem;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU{background-color:#fde047;border:1px solid #eab308;box-shadow:0 1px 2px 0 #0000000d}.CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp{background-color:#e0e7ff;border:1px solid #5c75f4;box-shadow:0 1px 2px 0 #0000000d;color:#6366f1;font-weight:500}.CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ{background-color:#eef2ff;border-radius:.25rem;color:#6366f1;font-weight:500;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb{border:none;cursor:pointer;display:inline;font:inherit}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
1
+ var e={container:"CognitiveNonWebSearchReasoning-module_container__koQEN",itemRow:"CognitiveNonWebSearchReasoning-module_itemRow__lRmgs",indexNumber:"CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg",textContent:"CognitiveNonWebSearchReasoning-module_textContent__327fx",paraphraseButton:"CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe",paraphraseText:"CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty",paraphraseStar:"CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR",chevronIcon:"CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw",chevronIconRotated:"CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP",expandedContainer:"CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9",expandedHeader:"CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb",headerTitle:"CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI",headerActions:"CognitiveNonWebSearchReasoning-module_headerActions__j1P4u",navigationContainer:"CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG",navButton:"CognitiveNonWebSearchReasoning-module_navButton__aOaMv",navIcon:"CognitiveNonWebSearchReasoning-module_navIcon__uLme4",navCounter:"CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc",confidenceBadge:"CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3",confidenceStar:"CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S",confidenceScore:"CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK",maximizeButton:"CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-",maximizeIcon:"CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez",contentArea:"CognitiveNonWebSearchReasoning-module_contentArea__hVoLL",contentInner:"CognitiveNonWebSearchReasoning-module_contentInner__df-34",footer:"CognitiveNonWebSearchReasoning-module_footer__CNE8q",trainingTitle:"CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh",trainingTitleLink:"CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U",modalDialog:"CognitiveNonWebSearchReasoning-module_modalDialog__eGApe",modalContainer:"CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01",modalHeader:"CognitiveNonWebSearchReasoning-module_modalHeader__qglof",modalHeaderTitle:"CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X",modalHeaderActions:"CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip",modalNavContainer:"CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP",modalNavButton:"CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24",closeButton:"CognitiveNonWebSearchReasoning-module_closeButton__S23zi",closeIcon:"CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG",modalContent:"CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv",modalContentInner:"CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo",modalFooter:"CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn",modalFooterSource:"CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt",blockLine:"CognitiveNonWebSearchReasoning-module_blockLine__FwGYE",headerLine:"CognitiveNonWebSearchReasoning-module_headerLine__0j5p4",listItemLine:"CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O",listCounter:"CognitiveNonWebSearchReasoning-module_listCounter__esNpx",boldText:"CognitiveNonWebSearchReasoning-module_boldText__suAp2",highlight:"CognitiveNonWebSearchReasoning-module_highlight__EMAz5",highlightActive:"CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU",highlightActiveVariant:"CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp",highlightVariant:"CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ",highlightButton:"CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const n=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;n&&e.setAttribute("nonce",n),e.appendChild(document.createTextNode(".CognitiveNonWebSearchReasoning-module_container__koQEN{display:flex;flex-direction:column;gap:.5rem}.CognitiveNonWebSearchReasoning-module_itemRow__lRmgs{align-items:flex-start;display:flex;font-size:.875rem;gap:.5rem}.CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg{color:#475467;font-weight:500}.CognitiveNonWebSearchReasoning-module_textContent__327fx{color:#475467;flex:1;max-width:none}.CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe{align-items:center;background:#0000;border:none;border-radius:.375rem;cursor:pointer;display:inline-flex;gap:.25rem;justify-content:flex-start;padding:.125rem .375rem}.CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty{color:#2563eb;font-weight:500;text-align:start}.CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR{color:#2563eb;padding-right:.25rem}.CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw{color:#2563eb;height:1rem;transition:transform .2s;width:1rem}.CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP{transform:rotate(180deg)}.CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9{border:solid #e5e7eb;border-radius:.5rem;border-width:1px 1px 2px;container-type:inline-size;margin-left:1.5rem;margin-top:.5rem;overflow:hidden}.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.25rem .75rem}.CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI{font-size:.875rem;font-weight:400}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv:hover{background-color:#f3f4f6}.CognitiveNonWebSearchReasoning-module_navIcon__uLme4{color:#6b7280;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc{color:#4b5563;font-size:.875rem;min-width:2.25rem;text-align:center}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{align-items:center;background-color:#f0fdf4;border:2px solid #3ac894;border-radius:9999px;display:inline-flex;gap:.25rem;padding:.25rem .5rem}.CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S{color:#059669;font-size:.75rem}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{color:#059669;font-size:.875rem;font-weight:600}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{color:#6b7280;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{font-size:.875rem;max-height:11rem;overflow-y:auto;padding:.5rem .75rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_contentInner__df-34{line-height:1.5rem}.CognitiveNonWebSearchReasoning-module_footer__CNE8q{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;justify-content:flex-end}.CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh{font-size:.875rem;font-style:italic;font-weight:300}.CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;font-size:.8rem;font-weight:600;gap:.25rem}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe{background:#0000;border:none;left:50%;margin:0;max-height:none;max-width:none;overflow:visible;padding:0;position:fixed;top:50%;transform:translate(-50%,-50%)}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe::backdrop{background-color:#0006}.CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01{background-color:#fff;border-radius:.75rem;box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;max-height:80vh;max-width:900px;overflow:hidden;width:80vw}.CognitiveNonWebSearchReasoning-module_modalHeader__qglof{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.75rem .5rem .75rem 1rem;width:100%}.CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X{font-size:1rem;font-weight:500}.CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP{align-items:center;background-color:#f3f4f6;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG{color:#4b5563;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv{flex:1;font-size:.875rem;overflow-y:auto;padding:.75rem 1rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo{line-height:1.75rem}.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;justify-content:flex-end;padding:.5rem 1rem}.CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;justify-content:flex-start;padding:1rem}.CognitiveNonWebSearchReasoning-module_blockLine__FwGYE{display:block}.CognitiveNonWebSearchReasoning-module_headerLine__0j5p4{display:block;font-weight:400}.CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O{display:block}.CognitiveNonWebSearchReasoning-module_listCounter__esNpx{display:inline-block;font-weight:500;text-align:left;width:1.5rem}.CognitiveNonWebSearchReasoning-module_boldText__suAp2{font-weight:600}.CognitiveNonWebSearchReasoning-module_highlight__EMAz5{background-color:#fef08a;border-radius:.25rem;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU{background-color:#fde047;border:1px solid #eab308;box-shadow:0 1px 2px 0 #0000000d}.CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp{background-color:#e0e7ff;border:1px solid #5c75f4;box-shadow:0 1px 2px 0 #0000000d;color:#6366f1;font-weight:500}.CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ{background-color:#eef2ff;border-radius:.25rem;color:#6366f1;font-weight:500;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb{border:none;cursor:pointer;display:inline;font:inherit}@container (max-width: 520px){.CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9{margin-left:0;margin-top:0}.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{align-items:flex-start;display:flex;flex-wrap:wrap;gap:8px;padding:8px 12px}.CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI{flex:1 1 100%;font-size:14px;line-height:1.3;min-width:0;white-space:normal}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{align-items:center;gap:8px;justify-content:space-between;min-width:0;width:100%}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP,.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{flex-shrink:1;gap:2px;padding:2px}.CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc{font-size:12px;min-width:auto}.CognitiveNonWebSearchReasoning-module_navIcon__uLme4{height:16px;width:16px}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24,.CognitiveNonWebSearchReasoning-module_navButton__aOaMv{padding:2px}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{flex-shrink:0;gap:2px;padding:2px 6px}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{font-size:12px}.CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S{font-size:10px}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-{flex-shrink:0;padding:2px}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{height:18px;width:18px}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{padding:12px}}@container (max-width: 420px){.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{padding:8px}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{gap:4px}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP,.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{transform:scale(.92);transform-origin:left center}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{padding:2px 5px}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{font-size:11px}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{height:16px;width:16px}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{font-size:13px;padding:10px}}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
2
2
  //# sourceMappingURL=CognitiveNonWebSearchReasoning.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{useState as e,useRef as n,useCallback as t,useEffect as r}from"react";var o=new Set(["DONE","COMPLETED","FAILED"]),c=new Map;function a(a,l){var u=e(null),i=u[0],s=u[1],v=e(!1),d=v[0],f=v[1],S=e(null),p=S[0],g=S[1],E=n(null),O=t(function(){var e;null===(e=E.current)||void 0===e||e.close(),E.current=null,f(!1)},[]);return r(function(){if(a){g(null),s(null);var e=c.get(a);e&&e.readyState!==WebSocket.CLOSED&&e.close();var n=new WebSocket("".concat(l,"/").concat(a));c.set(a,n),E.current=n,n.onopen=function(){return f(!0)};var t=setInterval(function(){n.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:"ping"}))},5e3);return n.onmessage=function(e){var r;try{var l=JSON.parse(e.data);s(l),o.has(null===(r=l.ingestionStatus)||void 0===r?void 0:r.toUpperCase())&&(clearInterval(t),n.close(),c.delete(a))}catch(e){g("Failed to parse WebSocket message")}},n.onerror=function(){return g("WebSocket connection error")},n.onclose=function(){return f(!1)},function(){clearInterval(t),n.close(),c.delete(a)}}},[a,l]),{data:i,connected:d,error:p,disconnect:O}}export{a as useIngestionWebSocket};
1
+ import{useState as e,useRef as n,useEffect as t,useCallback as r}from"react";var o=new Set(["DONE","COMPLETED","FAILED"]);var a=new Map;function i(e,n,t){n.listeners.delete(t),0===n.listeners.size&&a.get(e)===n&&(clearInterval(n.keepAliveInterval),n.ws.readyState!==WebSocket.OPEN&&n.ws.readyState!==WebSocket.CONNECTING||n.ws.close(),a.delete(e))}function l(l,s){var c=e(null),u=c[0],f=c[1],v=e(!1),d=v[0],S=v[1],p=e(null),g=p[0],E=p[1],k=n(null),w=n(null),b=n(l);t(function(){b.current=l},[l]);var y=r(function(){var e=b.current;e&&k.current&&w.current&&i(e,k.current,w.current),k.current=null,w.current=null,S(!1)},[]);return t(function(){if(l){E(null);var e=function(e,n){if(!n||"string"!=typeof n||!n.trim())return console.error("useIngestionWebSocket: wsBaseUrl is missing or invalid; skipping connection."),null;var t=a.get(e);if(t&&t.ws.readyState!==WebSocket.CLOSED)return t;var r=new WebSocket("".concat(n.trim(),"/").concat(e)),i={ws:r,listeners:new Set,lastData:null,keepAliveInterval:setInterval(function(){r.readyState===WebSocket.OPEN&&r.send(JSON.stringify({type:"ping"}))},5e3)};return r.onmessage=function(n){var t;try{t=JSON.parse(n.data)}catch(e){return void i.listeners.forEach(function(e){return e(null,"Failed to parse WebSocket message")})}if(function(e){if(!e||"object"!=typeof e)return!1;var n=e;return"string"==typeof n.ingestionStatus&&"string"==typeof n.ingestionId}(t)){var l=t;i.lastData=l,i.listeners.forEach(function(e){return e(l,null)}),o.has(l.ingestionStatus.toUpperCase())&&(clearInterval(i.keepAliveInterval),r.close(),a.delete(e))}else i.listeners.forEach(function(e){return e(null,"Received malformed WebSocket payload")})},r.onerror=function(){i.listeners.forEach(function(e){return e(null,"WebSocket connection error")})},r.onclose=function(){clearInterval(i.keepAliveInterval),a.get(e)===i&&a.delete(e)},a.set(e,i),i}(l,s);if(!e)return E("Missing or invalid WebSocket base URL"),void S(!1);e.lastData&&f(e.lastData),S(e.ws.readyState===WebSocket.OPEN);var n=function(e,n){n?E(n):f(e)};e.listeners.add(n),k.current=e,w.current=n;var t=function(){return S(!0)},r=function(){return S(!1)};return e.ws.addEventListener("open",t),e.ws.addEventListener("close",r),function(){e.ws.removeEventListener("open",t),e.ws.removeEventListener("close",r),i(l,e,n),k.current=null,w.current=null}}},[l,s]),{data:u,connected:d,error:g,disconnect:y}}export{l as useIngestionWebSocket};
2
2
  //# sourceMappingURL=useIngestionStatus.js.map
@@ -0,0 +1,2 @@
1
+ import{__assign as r}from"tslib";import{jsxs as t,jsx as e}from"react/jsx-runtime";var n=function(n){var o=n.speed,a=void 0===o?200:o,i=n.color,s=void 0===i?"#5928ED":i,m=n.size;return t("span",r({style:{display:"inline-block",fontFamily:"monospace",color:s,fontSize:void 0===m?"1.2rem":m,animation:"slashRotate ".concat(a,"ms linear infinite"),transformOrigin:"center center"}},{children:["/",e("style",{children:"\n @keyframes slashRotate {\n 0% { transform: rotate(0deg); }\n 25% { transform: rotate(90deg); }\n 50% { transform: rotate(180deg); }\n 75% { transform: rotate(270deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]}))};export{n as default};
2
+ //# sourceMappingURL=SlashLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SlashLoader.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{__assign as t}from"tslib";import{jsxs as o,jsx as i}from"react/jsx-runtime";import{ChevronDown as a,ChevronUp as n,Maximize2 as e,X as l,ExternalLink as r}from"lucide-react";import u from"dayjs";import c from"../ScannedDocCitation/ScannedDocCitation.js";import s from"../InstantLearningCitation/InstantLearningCitationComponent.js";import d from"../InstantLearningCitation/SlashLoader.js";import v from"../CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";import m from"../RequirementAiCitations/ImageCitation/ImageCitationContent.js";import g from"../RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";import h from"../ChatCitation/ChatCitationRenderer.js";var _=function(t,o,i){if(!t)throw new Error("[CitationOrchestratorComponent] ".concat(o,': missing required field "').concat(i,'" in customMetaData'))},C=function(t,o){if(!Object.values(t).some(Boolean))throw new Error("[CitationOrchestratorComponent] ".concat(o,': missing one of "').concat(Object.keys(t).join('", "'),'" in customMetaData'))},p=function(p){var D,f,M,b,I,w,S,R,j,k,x,T,y,P,L,U,O,A,F,W,q,z,B,E,G,H,N,$,J,K,Q,V,X,Y,Z,tt,ot,it,at,nt,et,lt,rt=p.href,ut=p.citations,ct=p.children,st=p.isStreaming,dt=p.onCitationToggle,vt=p.chatCitationConfig;if(st)return o("span",t({style:{display:"inline-flex",alignItems:"center",gap:"0.25rem",fontWeight:500,color:"#6D28D9"}},{children:[i("span",{children:ct}),i(d,{})]}));try{var mt=new URL(rt,"http://example.com"),gt=mt.searchParams.get("citationNumber"),ht=mt.searchParams.get("decisionStrength");if(!gt)return null;var _t=(null==ut?void 0:ut.find(function(t){var o;return String(null===(o=null==t?void 0:t.customMetaData)||void 0===o?void 0:o.citation_number)===gt}))||null;if(!_t)return null;var Ct=(null===(D=null==_t?void 0:_t.customMetaData)||void 0===D?void 0:D.citation_type)||((null===(f=_t.customMetaData)||void 0===f?void 0:f.type)||"").replace(/s$/,"");if("scanned_doc_citation"===Ct){var pt=null==_t?void 0:_t.customMetaData.value;if(null==pt?void 0:pt.length)return i(c,{pages:pt,subHeadingText:_t.customMetaData.artifact_title});_(null===(M=null==_t?void 0:_t.customMetaData)||void 0===M?void 0:M.gs_url,"scanned_doc_citation","gs_url");var Dt=[null===(b=null==_t?void 0:_t.customMetaData)||void 0===b?void 0:b.gs_url],ft=(null!==(I=_t.customMetaData.highlighted_coordinates)&&void 0!==I?I:[]).map(function(t,o){return{pageIndex:o,bboxes:[t]}});return i(c,{images:Dt,highlights:ft})}if("IL"===Ct){_(_t.customMetaData.il_learning,"IL","il_learning");var Mt=ct||(null===(w=_t.customMetaData)||void 0===w?void 0:w.link_text)||(null===(S=_t.customMetaData)||void 0===S?void 0:S.citation_source)||String(null!==(R=_t.customMetaData.citation_number)&&void 0!==R?R:1);return i(s,{citation:_t,linkTitle:Mt,onCitationToggle:null!=dt?dt:function(){},decisionStrengthFromUrl:ht||(null===(j=_t.customMetaData)||void 0===j?void 0:j.decision_strength)||""})}if("chat_citation"===Ct){var bt=null!=vt?vt:{},It=null===(T=null!==(x=null===(k=null==_t?void 0:_t.customMetaData)||void 0===k?void 0:k.chat_data)&&void 0!==x?x:[])||void 0===T?void 0:T.map(function(o){return t(t({},o),{timeStamp:u(o.timeStamp)})}),wt=!!(null===(y=null==_t?void 0:_t.customMetaData)||void 0===y?void 0:y.rule_book_content);return i(h,{showRootContainer:null===(P=bt.showRootContainer)||void 0===P||P,reversePanels:bt.reversePanels,isRenderedCustomComponent:bt.isRenderedCustomComponent,modalContainerStyle:bt.modalContainerStyle,additionalData:bt.additionalData,closePreview:bt.closePreview,selectedIdFromReason:null!==(L=bt.selectedIdFromReason)&&void 0!==L?L:void 0,rootContainer:t(t({},bt.rootContainer),{relevanceScore:_t.customMetaData.relevance_score}),chatContainer:t(t({},bt.chatContainer),{chatData:It,summarizedTab:null!==(O=null===(U=bt.chatContainer)||void 0===U?void 0:U.summarizedTab)&&void 0!==O?O:{chip:{isActive:!0,show:!0}},detailedTab:null!==(F=null===(A=bt.chatContainer)||void 0===A?void 0:A.detailedTab)&&void 0!==F?F:{chip:{isActive:!1}}}),ruleBookContainer:wt?t(t({},bt.ruleBookContainer),{data:{content:_t.customMetaData.rule_book_content,highlighted_texts:null!==(W=_t.customMetaData.rule_book_highlights)&&void 0!==W?W:[]}}):void 0})}if("gpt_citation"===Ct){var St=null===(q=_t.customMetaData)||void 0===q?void 0:q.value,Rt=null!==(z=null==St?void 0:St.text)&&void 0!==z?z:null===(E=null===(B=_t.customMetaData)||void 0===B?void 0:B.data_sources)||void 0===E?void 0:E[0],jt=null!==(G=null==St?void 0:St.label)&&void 0!==G?G:null===(N=null===(H=_t.customMetaData)||void 0===H?void 0:H.training_data_title)||void 0===N?void 0:N[0],kt=null!==($=null==St?void 0:St.paraphrase)&&void 0!==$?$:null===(K=null===(J=_t.customMetaData)||void 0===J?void 0:J.paraphrase)||void 0===K?void 0:K[0];return C({data_sources:Rt,training_data_title:jt},"gpt_citation"),i(v,{item:{text:"",dataSource:Rt,trainingDataTitle:jt,paraphrase:kt},headerTitle:"GPT - Gemini 2.5 Flash",iconsConfig:{ChevronDownIcon:a,ChevronUpIcon:n,MaximizeIcon:e,CloseIcon:l}})}if("web_citation"===Ct){!function(t,o,i){_(t,o,i);try{new URL(t)}catch(a){throw new Error("[CitationOrchestratorComponent] ".concat(o,': "').concat(i,'" is not a valid URL: "').concat(t,'"'))}}(null===(Q=_t.customMetaData)||void 0===Q?void 0:Q.link,"web_citation","link");var xt=_t.customMetaData.link,Tt=ct||(null===(V=_t.customMetaData)||void 0===V?void 0:V.citation_source)||xt;return(null===(X=_t.customMetaData)||void 0===X?void 0:X.screenshot_url)?i(g,{url:xt,label:Tt,gsUtilPath:null===(Y=_t.customMetaData)||void 0===Y?void 0:Y.gs_util_path,signedUrl:null===(Z=_t.customMetaData)||void 0===Z?void 0:Z.screenshot_url,relevanceScore:null===(tt=_t.customMetaData)||void 0===tt?void 0:tt.relevance_score,visitIcon:r,PreviewDialogCloseIcon:l}):i("a",t({href:xt,target:"_blank",rel:"noreferrer"},{children:Tt}))}if("image_citation"===Ct)return C({gs_util_path:null===(ot=_t.customMetaData)||void 0===ot?void 0:ot.gs_util_path,signed_url:null===(it=_t.customMetaData)||void 0===it?void 0:it.signed_url},"image_citation"),i(m,{citationTitle:ct||(null===(at=_t.customMetaData)||void 0===at?void 0:at.citation_source),gsUtilPath:null===(nt=_t.customMetaData)||void 0===nt?void 0:nt.gs_util_path,signedUrl:null===(et=_t.customMetaData)||void 0===et?void 0:et.signed_url,relevanceScore:null===(lt=_t.customMetaData)||void 0===lt?void 0:lt.relevance_score})}catch(t){return console.error(t),null}return null};export{p as default};
2
+ //# sourceMappingURL=ParentCitationComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParentCitationComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as r,useRef as n,useState as o,useEffect as a,useImperativeHandle as l}from"react";import{DEFAULT_TOOLBAR_CONFIG as i}from"./Editor/constants/editorConfig.js";import c from"./Editor/Editor.js";import{useRefStore as s}from"../../store/ref.context.js";import{$generateHtmlFromNodes as u}from"@lexical/html";import d from"turndown";import{tables as h}from"turndown-plugin-gfm";import{UnsavedChangesPopup as p}from"../UnsavedChangesPopup/UnsavedChangesPopup.js";import{mergeTagAcrossParagraphs as m,unescapeTagIds as g}from"../../../../utils/tagHelper.js";const f=new d({headingStyle:"atx",codeBlockStyle:"fenced"});f.keep(["ins","del","mark"]),f.keep(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}),f.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),f.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),f.use(h);const E=e=>(e||"").replace(/\r\n/g,"\n").trim(),v=r(({type:r,value:d,handleUpdateState:h,onBlur:v,placeholder:A,minHeight:S,height:$,mode:y,doNotShowBorderInViewMode:w,onEditBlocked:b,onSaveUnsavedChanges:x,onDiscardUnsavedChanges:C,isSavingUnsavedChanges:N=!1},B)=>{const T=n(null),[L,q]=o({type:r,value:d}),[H,I]=o(0),[R,_]=o(!1),j=n(d),k=n(d),M=n(Boolean(d)),{contentRef:U,setContentRef:V}=s();a(()=>{q(e=>({...e,value:d})),j.current=d,k.current=d,M.current=Boolean(d),_(!1)},[d]),l(B,()=>({requestClose:()=>!("edit"===y&&E(j.current)!==E(k.current))||(_(!0),!1)}),[y]);return a(()=>{const e=()=>{U&&U.current&&I(U.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[U]),e("div",{style:{position:"relative",width:"100%",height:$,minHeight:S},children:[R&&t(p,{isSaving:N,onSave:async()=>{await(null==x?void 0:x()),j.current=k.current,_(!1)},onDiscard:()=>{k.current=j.current,null==C||C(),_(!1)}}),t(c,{minHeight:S,height:$,placeholder:A||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=u(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=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});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 i=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),c=e.tagName.toLowerCase();return i?`<${c} ${i}>${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 a=[];r.querySelectorAll("invisible").forEach((e,t)=>{a.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const l=[];["manual","upt"].forEach(e=>{r.querySelectorAll(e).forEach((e,t)=>{l.push(o(e,f)),e.replaceWith(r.createTextNode(`%%REVIEW_${l.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 c=f.turndown(r.body.innerHTML);for(let e=l.length-1;e>=0;e--)c=c.replace(`%%REVIEW\\_${e}%%`,` ${l[e]} `);a.forEach((e,t)=>{c=c.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),i.forEach((e,t)=>{c=c.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),c=c.replace(/\*{4}([^*]+)\*{4}/g,"**$1**");["upt","manual","del","ins","preserved"].forEach(e=>{c=m(c,e)}),c=g(c,["manual","upt"]),M.current&&(j.current=c,M.current=!1),k.current=c,((e,t)=>{h(e,t)})("prompt",c)})},toolbarConfig:i,editorRef:T,mode:y,initialString:{type:L.type,value:L.value},dynamicHeight:H,onBlur:v,doNotShowBorderInViewMode:w||!1,onEditBlocked:b})]})});v.displayName="RichTextEditor";export{v as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as r,useRef as n,useState as o,useEffect as a,useImperativeHandle as l}from"react";import{DEFAULT_TOOLBAR_CONFIG as i}from"./Editor/constants/editorConfig.js";import c from"./Editor/Editor.js";import{useRefStore as s}from"../../store/ref.context.js";import{$generateHtmlFromNodes as u}from"@lexical/html";import d from"turndown";import{tables as p}from"turndown-plugin-gfm";import{UnsavedChangesPopup as h}from"../UnsavedChangesPopup/UnsavedChangesPopup.js";import{mergeTagAcrossParagraphs as g,unescapeTagIds as m}from"../../../../utils/tagHelper.js";const f=new d({headingStyle:"atx",codeBlockStyle:"fenced"}),E=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");f.keep(["ins","del","mark"]),f.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,E(a).replace(/"/g,"&quot;")}">${E(o)}</a>`;var a}}),f.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),f.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),f.use(p);const v=e=>(e||"").replace(/\r\n/g,"\n").trim(),$=r(({type:r,value:d,handleUpdateState:p,onBlur:E,placeholder:$,minHeight:A,height:S,mode:w,doNotShowBorderInViewMode:y,onEditBlocked:b,onSaveUnsavedChanges:x,onDiscardUnsavedChanges:C,isSavingUnsavedChanges:N=!1},B)=>{const T=n(null),[q,L]=o({type:r,value:d}),[_,H]=o(0),[I,R]=o(!1),j=n(d),k=n(d),M=n(Boolean(d)),{contentRef:P,setContentRef:U}=s();a(()=>{L(e=>({...e,value:d})),j.current=d,k.current=d,M.current=Boolean(d),R(!1)},[d]),l(B,()=>({requestClose:()=>!("edit"===w&&v(j.current)!==v(k.current))||(R(!0),!1)}),[w]);return a(()=>{const e=()=>{P&&P.current&&H(P.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[P]),e("div",{style:{position:"relative",width:"100%",height:S,minHeight:A},children:[I&&t(h,{isSaving:N,onSave:async()=>{await(null==x?void 0:x()),j.current=k.current,R(!1)},onDiscard:()=>{k.current=j.current,null==C||C(),R(!1)}}),t(c,{minHeight:A,height:S,placeholder:$||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=u(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 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 i=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),c=e.tagName.toLowerCase();return i?`<${c} ${i}>${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 a=[];r.querySelectorAll("invisible").forEach((e,t)=>{a.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const l=[];["manual","upt"].forEach(e=>{r.querySelectorAll(e).forEach((e,t)=>{l.push(o(e,f)),e.replaceWith(r.createTextNode(`%%REVIEW_${l.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 c=f.turndown(r.body.innerHTML);for(let e=l.length-1;e>=0;e--)c=c.replace(`%%REVIEW\\_${e}%%`,` ${l[e]} `);a.forEach((e,t)=>{c=c.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),i.forEach((e,t)=>{c=c.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),c=c.replace(/\*{4}([^*]+)\*{4}/g,"**$1**"),c=c.replace(/\s+class="PlaygroundEditorTheme__[^"]*"/g,""),c=c.replace(/<span\s+style="white-space:\s*pre-wrap;?">([\s\S]*?)<\/span>/g,"$1"),c=c.replace(/\s+style="white-space:\s*pre-wrap;?"/g,""),c=c.replace(/<b>\s*<strong>([\s\S]*?)<\/strong>\s*<\/b>/g,"<strong>$1</strong>");["upt","manual","del","ins","preserved"].forEach(e=>{c=g(c,e)}),c=m(c,["manual","upt"]),M.current&&(j.current=c,M.current=!1),k.current=c,((e,t)=>{p(e,t)})("prompt",c)})},toolbarConfig:i,editorRef:T,mode:w,initialString:{type:q.type,value:q.value},dynamicHeight:_,onBlur:E,doNotShowBorderInViewMode:y||!1,onEditBlocked:b})]})});$.displayName="RichTextEditor";export{$ as default};
2
2
  //# sourceMappingURL=RichTextEditor.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as l,Fragment as a}from"react/jsx-runtime";import{Info as n,X as i,LoaderCircle as s,Save as t}from"lucide-react";import d from"./ClinicalTrialSection.module.css.js";const o=({title:o,note:r="This content is provided by the scientific team and not generated from uploaded documents.",fields:c,value:u,readonly:m=!0,isSaving:v=!1,styles:y,onChange:h,onSave:p,onCancel:N})=>{const b=(e,l)=>{m||null==h||h({...u,[e]:l})},f=c.find(e=>"summary"===e.key),C=c.filter(e=>"summary"!==e.key);return e("div",{className:d.container,style:null==y?void 0:y.container,children:[e("div",{className:d.noteContainer,style:null==y?void 0:y.noteContainer,children:[l(n,{size:18,className:d.noteIcon,style:null==y?void 0:y.noteIcon}),e("span",{className:d.noteText,style:null==y?void 0:y.noteText,children:[l("strong",{children:"Note:"})," ",r]})]}),e(a,m?{children:[l("div",{className:d.fieldsRow,style:null==y?void 0:y.fieldsRow,children:C.map(a=>e("div",{className:d.field,style:null==y?void 0:y.field,children:[l("label",{className:d.label,style:null==y?void 0:y.label,children:a.label}),l("div",{className:d.readonlyValue,style:null==y?void 0:y.readonlyValue,children:u[a.key]||"-"})]},a.key))}),f&&e("div",{className:d.field,style:null==y?void 0:y.field,children:[l("label",{className:d.label,style:null==y?void 0:y.label,children:f.label}),l("div",{className:d.readonlySummary,style:null==y?void 0:y.readonlySummary,children:u.summary||"-"})]})]}:{children:[l("div",{className:d.fieldsRow,style:null==y?void 0:y.fieldsRow,children:C.map(a=>{var n;return e("div",{className:d.field,style:null==y?void 0:y.field,children:[l("label",{className:d.label,style:null==y?void 0:y.label,children:a.label}),"select"===a.type?e("select",{className:d.input,style:null==y?void 0:y.input,value:u[a.key]||"",onChange:e=>b(a.key,e.target.value),children:[e("option",{value:"",children:["Select ",a.label]}),null===(n=a.options)||void 0===n?void 0:n.map(e=>l("option",{value:e.value,children:e.label},e.value))]}):l("input",{className:d.input,style:null==y?void 0:y.input,placeholder:a.placeholder,value:u[a.key]||"",onChange:e=>b(a.key,e.target.value)})]},a.key)})}),f&&l("div",{className:d.summaryContainer,style:null==y?void 0:y.summaryContainer,children:l("textarea",{className:d.summaryTextarea,style:null==y?void 0:y.summaryTextarea,placeholder:(null==f?void 0:f.placeholder)||"Add section summary here",value:u.summary||"",onChange:e=>b("summary",e.target.value)})}),e("div",{className:d.actionBar,style:null==y?void 0:y.actionBar,children:[e("button",{type:"button",className:d.cancelButton,style:null==y?void 0:y.cancelButton,onClick:N,children:[l(i,{size:18}),l("span",{children:"Cancel"})]}),l("button",{type:"button",className:d.saveButton,style:null==y?void 0:y.saveButton,onClick:p,disabled:v,children:e(a,v?{children:[l(s,{size:18,className:d.spinner,style:null==y?void 0:y.spinner}),l("span",{children:"Saving..."})]}:{children:[l(t,{size:18}),l("span",{children:"Save"})]})})]})]})]})};export{o as default};
1
+ import{jsxs as e,jsx as l,Fragment as a}from"react/jsx-runtime";import{Info as n,X as i,LoaderCircle as s,Save as t}from"lucide-react";import d from"./ClinicalTrialSection.module.css.js";const o=({title:o,note:r="This content is provided by the scientific team and not generated from uploaded documents.",fields:c,value:u,readonly:m=!0,isSaving:v=!1,styles:y,onChange:h,onSave:p,onCancel:N})=>{const b=(e,l)=>{m||null==h||h({...u,[e]:l})},f=c.find(e=>"summary"===e.key),C=c.filter(e=>"summary"!==e.key),g=c.some(e=>{var l;return(null!==(l=u[e.key])&&void 0!==l?l:"").trim().length>0});return e("div",{className:d.container,style:null==y?void 0:y.container,children:[e("div",{className:d.noteContainer,style:null==y?void 0:y.noteContainer,children:[l(n,{size:18,className:d.noteIcon,style:null==y?void 0:y.noteIcon}),e("span",{className:d.noteText,style:null==y?void 0:y.noteText,children:[l("strong",{children:"Note:"})," ",r]})]}),e(a,m?{children:[l("div",{className:d.fieldsRow,style:null==y?void 0:y.fieldsRow,children:C.map(a=>e("div",{className:d.field,style:null==y?void 0:y.field,children:[l("label",{className:d.label,style:null==y?void 0:y.label,children:a.label}),l("div",{className:d.readonlyValue,style:null==y?void 0:y.readonlyValue,children:u[a.key]||"-"})]},a.key))}),f&&e("div",{className:d.field,style:null==y?void 0:y.field,children:[l("label",{className:d.label,style:null==y?void 0:y.label,children:f.label}),l("div",{className:d.readonlySummary,style:null==y?void 0:y.readonlySummary,children:u.summary||"-"})]})]}:{children:[l("div",{className:d.fieldsRow,style:null==y?void 0:y.fieldsRow,children:C.map(a=>{var n;return e("div",{className:d.field,style:null==y?void 0:y.field,children:[l("label",{className:d.label,style:null==y?void 0:y.label,children:a.label}),"select"===a.type?e("select",{className:d.input,style:null==y?void 0:y.input,value:u[a.key]||"",onChange:e=>b(a.key,e.target.value),children:[e("option",{value:"",children:["Select ",a.label]}),null===(n=a.options)||void 0===n?void 0:n.map(e=>l("option",{value:e.value,children:e.label},e.value))]}):l("input",{className:d.input,style:null==y?void 0:y.input,placeholder:a.placeholder,value:u[a.key]||"",onChange:e=>b(a.key,e.target.value)})]},a.key)})}),f&&l("div",{className:d.summaryContainer,style:null==y?void 0:y.summaryContainer,children:l("textarea",{className:d.summaryTextarea,style:null==y?void 0:y.summaryTextarea,placeholder:(null==f?void 0:f.placeholder)||"Add section summary here",value:u.summary||"",onChange:e=>b("summary",e.target.value)})}),e("div",{className:d.actionBar,style:null==y?void 0:y.actionBar,children:[e("button",{type:"button",className:d.cancelButton,style:null==y?void 0:y.cancelButton,onClick:N,children:[l(i,{size:18}),l("span",{children:"Cancel"})]}),l("button",{type:"button",className:d.saveButton,style:null==y?void 0:y.saveButton,onClick:p,disabled:v||!g,children:e(a,v?{children:[l(s,{size:18,className:d.spinner,style:null==y?void 0:y.spinner}),l("span",{children:"Saving..."})]}:{children:[l(t,{size:18}),l("span",{children:"Save"})]})})]})]})]})};export{o as default};
2
2
  //# sourceMappingURL=ClinicalTrialSection.js.map
@@ -1,2 +1,2 @@
1
- var e={container:"ClinicalTrialSection-module_container__oXyDo",noteContainer:"ClinicalTrialSection-module_noteContainer__fjKfZ",noteIcon:"ClinicalTrialSection-module_noteIcon__uO955",noteText:"ClinicalTrialSection-module_noteText__ZNtmw",fieldsRow:"ClinicalTrialSection-module_fieldsRow__S5DzE",field:"ClinicalTrialSection-module_field__KuTr6",label:"ClinicalTrialSection-module_label__xPB0g",input:"ClinicalTrialSection-module_input__nGvpX",summaryContainer:"ClinicalTrialSection-module_summaryContainer__kdXAi",summaryTextarea:"ClinicalTrialSection-module_summaryTextarea__QbEXd",actionBar:"ClinicalTrialSection-module_actionBar__V8LoA",cancelButton:"ClinicalTrialSection-module_cancelButton__GsyN4",saveButton:"ClinicalTrialSection-module_saveButton__P5AIo",readonlyValue:"ClinicalTrialSection-module_readonlyValue__31toE",readonlySummary:"ClinicalTrialSection-module_readonlySummary__WF5q6",spinner:"ClinicalTrialSection-module_spinner__AL39r",spin:"ClinicalTrialSection-module_spin__kH9hF"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const i=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;i&&e.setAttribute("nonce",i),e.appendChild(document.createTextNode(".ClinicalTrialSection-module_container__oXyDo{display:flex;flex-direction:column;gap:20px;padding:20px;width:100%}.ClinicalTrialSection-module_noteContainer__fjKfZ{align-items:center;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;display:flex;gap:8px;padding:12px 16px}.ClinicalTrialSection-module_noteIcon__uO955{color:#6b7280;flex-shrink:0}.ClinicalTrialSection-module_noteText__ZNtmw{color:#4b5563;font-size:14px;line-height:20px}.ClinicalTrialSection-module_fieldsRow__S5DzE{display:flex;gap:24px;width:100%}.ClinicalTrialSection-module_field__KuTr6{display:flex;flex:1;flex-direction:column}.ClinicalTrialSection-module_label__xPB0g{color:#111827;font-size:14px;font-weight:600;line-height:20px;margin-bottom:8px}.ClinicalTrialSection-module_input__nGvpX{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;height:48px;outline:none;padding:0 16px;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_input__nGvpX::placeholder{color:#9ca3af}.ClinicalTrialSection-module_input__nGvpX:focus{border-color:#3b82f6}.ClinicalTrialSection-module_summaryContainer__kdXAi{width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;line-height:20px;min-height:150px;outline:none;padding:16px;resize:vertical;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd::placeholder{color:#9ca3af}.ClinicalTrialSection-module_summaryTextarea__QbEXd:focus{border-color:#3b82f6}.ClinicalTrialSection-module_actionBar__V8LoA{align-items:center;display:flex;gap:24px;justify-content:flex-end;margin-top:20px}.ClinicalTrialSection-module_cancelButton__GsyN4{align-items:center;background:#0000;border:none;color:#ef4444;cursor:pointer;display:flex;font-size:16px;font-weight:500;gap:6px}.ClinicalTrialSection-module_cancelButton__GsyN4:hover{opacity:.8}.ClinicalTrialSection-module_saveButton__P5AIo{align-items:center;background:#0000;border:none;color:#4f46e5;cursor:pointer;display:flex;font-size:16px;font-weight:600;gap:6px}.ClinicalTrialSection-module_saveButton__P5AIo:hover{opacity:.8}.ClinicalTrialSection-module_readonlyValue__31toE{align-items:center;background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;display:flex;font-size:14px;line-height:20px;min-height:48px;padding:0 16px}.ClinicalTrialSection-module_readonlySummary__WF5q6{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;font-size:14px;line-height:22px;min-height:150px;padding:16px;white-space:pre-wrap;word-break:break-word}.ClinicalTrialSection-module_spinner__AL39r{animation:ClinicalTrialSection-module_spin__kH9hF 1s linear infinite}@keyframes ClinicalTrialSection-module_spin__kH9hF{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
1
+ var e={container:"ClinicalTrialSection-module_container__oXyDo",noteContainer:"ClinicalTrialSection-module_noteContainer__fjKfZ",noteIcon:"ClinicalTrialSection-module_noteIcon__uO955",noteText:"ClinicalTrialSection-module_noteText__ZNtmw",fieldsRow:"ClinicalTrialSection-module_fieldsRow__S5DzE",field:"ClinicalTrialSection-module_field__KuTr6",label:"ClinicalTrialSection-module_label__xPB0g",input:"ClinicalTrialSection-module_input__nGvpX",summaryContainer:"ClinicalTrialSection-module_summaryContainer__kdXAi",summaryTextarea:"ClinicalTrialSection-module_summaryTextarea__QbEXd",actionBar:"ClinicalTrialSection-module_actionBar__V8LoA",cancelButton:"ClinicalTrialSection-module_cancelButton__GsyN4",saveButton:"ClinicalTrialSection-module_saveButton__P5AIo",readonlyValue:"ClinicalTrialSection-module_readonlyValue__31toE",readonlySummary:"ClinicalTrialSection-module_readonlySummary__WF5q6",spinner:"ClinicalTrialSection-module_spinner__AL39r",spin:"ClinicalTrialSection-module_spin__kH9hF"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const i=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;i&&e.setAttribute("nonce",i),e.appendChild(document.createTextNode(".ClinicalTrialSection-module_container__oXyDo{display:flex;flex-direction:column;gap:20px;padding:20px;width:100%}.ClinicalTrialSection-module_noteContainer__fjKfZ{align-items:center;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;display:flex;gap:8px;padding:12px 16px}.ClinicalTrialSection-module_noteIcon__uO955{color:#6b7280;flex-shrink:0}.ClinicalTrialSection-module_noteText__ZNtmw{color:#4b5563;font-size:14px;line-height:20px}.ClinicalTrialSection-module_fieldsRow__S5DzE{display:flex;gap:24px;width:100%}.ClinicalTrialSection-module_field__KuTr6{display:flex;flex:1;flex-direction:column}.ClinicalTrialSection-module_label__xPB0g{color:#111827;font-size:14px;font-weight:600;line-height:20px;margin-bottom:8px}.ClinicalTrialSection-module_input__nGvpX{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;height:48px;outline:none;padding:0 16px;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_input__nGvpX::placeholder{color:#9ca3af}.ClinicalTrialSection-module_input__nGvpX:focus{border-color:#3b82f6}.ClinicalTrialSection-module_summaryContainer__kdXAi{width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;line-height:20px;min-height:150px;outline:none;padding:16px;resize:vertical;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd::placeholder{color:#9ca3af}.ClinicalTrialSection-module_summaryTextarea__QbEXd:focus{border-color:#3b82f6}.ClinicalTrialSection-module_actionBar__V8LoA{align-items:center;display:flex;gap:24px;justify-content:flex-end;margin-top:20px}.ClinicalTrialSection-module_cancelButton__GsyN4{align-items:center;background:#0000;border:none;color:#ef4444;cursor:pointer;display:flex;font-size:16px;font-weight:500;gap:6px}.ClinicalTrialSection-module_cancelButton__GsyN4:hover{opacity:.8}.ClinicalTrialSection-module_saveButton__P5AIo{align-items:center;background:#0000;border:none;color:#4f46e5;cursor:pointer;display:flex;font-size:16px;font-weight:600;gap:6px}.ClinicalTrialSection-module_saveButton__P5AIo:hover{opacity:.8}.ClinicalTrialSection-module_saveButton__P5AIo:disabled{color:#9ca3af;cursor:not-allowed;opacity:.6;pointer-events:none}.ClinicalTrialSection-module_saveButton__P5AIo:disabled:hover{opacity:.6}.ClinicalTrialSection-module_readonlyValue__31toE{align-items:center;background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;display:flex;font-size:14px;line-height:20px;min-height:48px;padding:0 16px}.ClinicalTrialSection-module_readonlySummary__WF5q6{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;font-size:14px;line-height:22px;min-height:150px;padding:16px;white-space:pre-wrap;word-break:break-word}.ClinicalTrialSection-module_spinner__AL39r{animation:ClinicalTrialSection-module_spin__kH9hF 1s linear infinite}@keyframes ClinicalTrialSection-module_spin__kH9hF{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
2
2
  //# sourceMappingURL=ClinicalTrialSection.module.css.js.map