@e-llm-studio/citation 0.0.200 → 0.0.201

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 (215) hide show
  1. package/README.md +157 -28
  2. package/dist/assests/svg/PdfViewerIcons.js +1 -1
  3. package/dist/assests/svg/SparkleIcon.js +2 -0
  4. package/dist/assests/svg/SparkleIcon.js.map +1 -0
  5. package/dist/cjs/assests/svg/PdfViewerIcons.js +1 -1
  6. package/dist/cjs/assests/svg/SparkleIcon.js +2 -0
  7. package/dist/cjs/assests/svg/SparkleIcon.js.map +1 -0
  8. package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +2 -0
  9. package/dist/cjs/features/CognitiveCompare/CitationAnchor.js.map +1 -0
  10. package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +2 -0
  11. package/dist/cjs/features/CognitiveCompare/CitationRenderer.js.map +1 -0
  12. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +2 -0
  13. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js.map +1 -0
  14. package/dist/cjs/features/CognitiveCompare/CognitiveCompareConfig.js +2 -0
  15. package/dist/cjs/features/CognitiveCompare/CognitiveCompareConfig.js.map +1 -0
  16. package/dist/cjs/features/CognitiveCompare/CognitiveCompareConstants.js +2 -0
  17. package/dist/cjs/features/CognitiveCompare/CognitiveCompareConstants.js.map +1 -0
  18. package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +2 -0
  19. package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js.map +1 -0
  20. package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +2 -0
  21. package/dist/cjs/features/CognitiveCompare/CognitivePopup.js.map +1 -0
  22. package/dist/cjs/features/CognitiveCompare/CompareContext.js +2 -0
  23. package/dist/cjs/features/CognitiveCompare/CompareContext.js.map +1 -0
  24. package/dist/cjs/features/CognitiveCompare/LoaderComponent.js +2 -0
  25. package/dist/cjs/features/CognitiveCompare/LoaderComponent.js.map +1 -0
  26. package/dist/cjs/features/CognitiveCompare/MoreFunctionsPopup.js +2 -0
  27. package/dist/cjs/features/CognitiveCompare/MoreFunctionsPopup.js.map +1 -0
  28. package/dist/cjs/features/CognitiveCompare/OverlayComponent.js +2 -0
  29. package/dist/cjs/features/CognitiveCompare/OverlayComponent.js.map +1 -0
  30. package/dist/cjs/features/CognitiveCompare/ResizableSplitPane.js +2 -0
  31. package/dist/cjs/features/CognitiveCompare/ResizableSplitPane.js.map +1 -0
  32. package/dist/cjs/features/CognitiveCompare/components/CognitiveSummaryPopup.js +2 -0
  33. package/dist/cjs/features/CognitiveCompare/components/CognitiveSummaryPopup.js.map +1 -0
  34. package/dist/cjs/features/CognitiveCompare/components/CompareHeader.js +2 -0
  35. package/dist/cjs/features/CognitiveCompare/components/CompareHeader.js.map +1 -0
  36. package/dist/cjs/features/CognitiveCompare/components/LHSSectionRow.js +2 -0
  37. package/dist/cjs/features/CognitiveCompare/components/LHSSectionRow.js.map +1 -0
  38. package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +2 -0
  39. package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js.map +1 -0
  40. package/dist/cjs/features/CognitiveCompare/components/ScrollLockToggle.js +2 -0
  41. package/dist/cjs/features/CognitiveCompare/components/ScrollLockToggle.js.map +1 -0
  42. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +2 -0
  43. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js.map +1 -0
  44. package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +2 -0
  45. package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js.map +1 -0
  46. package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js +2 -0
  47. package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js.map +1 -0
  48. package/dist/cjs/features/CognitiveCompare/components/ThreeDotsLoader.js +2 -0
  49. package/dist/cjs/features/CognitiveCompare/components/ThreeDotsLoader.js.map +1 -0
  50. package/dist/cjs/features/CognitiveCompare/components/connectedLines.js +2 -0
  51. package/dist/cjs/features/CognitiveCompare/components/connectedLines.js.map +1 -0
  52. package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +2 -0
  53. package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js.map +1 -0
  54. package/dist/cjs/features/CognitiveCompare/hooks/useAccordionState.js +2 -0
  55. package/dist/cjs/features/CognitiveCompare/hooks/useAccordionState.js.map +1 -0
  56. package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +2 -0
  57. package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js.map +1 -0
  58. package/dist/cjs/features/CognitiveCompare/hooks/useComparePopups.js +2 -0
  59. package/dist/cjs/features/CognitiveCompare/hooks/useComparePopups.js.map +1 -0
  60. package/dist/cjs/features/CognitiveCompare/hooks/useDeviationNavigation.js +2 -0
  61. package/dist/cjs/features/CognitiveCompare/hooks/useDeviationNavigation.js.map +1 -0
  62. package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +2 -0
  63. package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js.map +1 -0
  64. package/dist/cjs/features/CognitiveCompare/hooks/useResizeHandler.js +2 -0
  65. package/dist/cjs/features/CognitiveCompare/hooks/useResizeHandler.js.map +1 -0
  66. package/dist/cjs/features/CognitiveCompare/hooks/useSectionRefs.js +2 -0
  67. package/dist/cjs/features/CognitiveCompare/hooks/useSectionRefs.js.map +1 -0
  68. package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +2 -0
  69. package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js.map +1 -0
  70. package/dist/cjs/features/CognitiveCompare/hooks/useStyles.js +2 -0
  71. package/dist/cjs/features/CognitiveCompare/hooks/useStyles.js.map +1 -0
  72. package/dist/cjs/index.js +1 -1
  73. package/dist/features/CognitiveCompare/CitationAnchor.js +2 -0
  74. package/dist/features/CognitiveCompare/CitationAnchor.js.map +1 -0
  75. package/dist/features/CognitiveCompare/CitationRenderer.js +2 -0
  76. package/dist/features/CognitiveCompare/CitationRenderer.js.map +1 -0
  77. package/dist/features/CognitiveCompare/CognitiveCompare.js +2 -0
  78. package/dist/features/CognitiveCompare/CognitiveCompare.js.map +1 -0
  79. package/dist/features/CognitiveCompare/CognitiveCompareConfig.js +2 -0
  80. package/dist/features/CognitiveCompare/CognitiveCompareConfig.js.map +1 -0
  81. package/dist/features/CognitiveCompare/CognitiveCompareConstants.js +2 -0
  82. package/dist/features/CognitiveCompare/CognitiveCompareConstants.js.map +1 -0
  83. package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +2 -0
  84. package/dist/features/CognitiveCompare/CognitiveComparehelpers.js.map +1 -0
  85. package/dist/features/CognitiveCompare/CognitivePopup.js +2 -0
  86. package/dist/features/CognitiveCompare/CognitivePopup.js.map +1 -0
  87. package/dist/features/CognitiveCompare/CompareContext.js +2 -0
  88. package/dist/features/CognitiveCompare/CompareContext.js.map +1 -0
  89. package/dist/features/CognitiveCompare/LoaderComponent.js +2 -0
  90. package/dist/features/CognitiveCompare/LoaderComponent.js.map +1 -0
  91. package/dist/features/CognitiveCompare/MoreFunctionsPopup.js +2 -0
  92. package/dist/features/CognitiveCompare/MoreFunctionsPopup.js.map +1 -0
  93. package/dist/features/CognitiveCompare/OverlayComponent.js +2 -0
  94. package/dist/features/CognitiveCompare/OverlayComponent.js.map +1 -0
  95. package/dist/features/CognitiveCompare/ResizableSplitPane.js +2 -0
  96. package/dist/features/CognitiveCompare/ResizableSplitPane.js.map +1 -0
  97. package/dist/features/CognitiveCompare/components/CognitiveSummaryPopup.js +2 -0
  98. package/dist/features/CognitiveCompare/components/CognitiveSummaryPopup.js.map +1 -0
  99. package/dist/features/CognitiveCompare/components/CompareHeader.js +2 -0
  100. package/dist/features/CognitiveCompare/components/CompareHeader.js.map +1 -0
  101. package/dist/features/CognitiveCompare/components/LHSSectionRow.js +2 -0
  102. package/dist/features/CognitiveCompare/components/LHSSectionRow.js.map +1 -0
  103. package/dist/features/CognitiveCompare/components/RHSSectionRow.js +2 -0
  104. package/dist/features/CognitiveCompare/components/RHSSectionRow.js.map +1 -0
  105. package/dist/features/CognitiveCompare/components/ScrollLockToggle.js +2 -0
  106. package/dist/features/CognitiveCompare/components/ScrollLockToggle.js.map +1 -0
  107. package/dist/features/CognitiveCompare/components/SectionAccordion.js +2 -0
  108. package/dist/features/CognitiveCompare/components/SectionAccordion.js.map +1 -0
  109. package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +2 -0
  110. package/dist/features/CognitiveCompare/components/SubSectionAccordion.js.map +1 -0
  111. package/dist/features/CognitiveCompare/components/SvgConnectors.js +2 -0
  112. package/dist/features/CognitiveCompare/components/SvgConnectors.js.map +1 -0
  113. package/dist/features/CognitiveCompare/components/ThreeDotsLoader.js +2 -0
  114. package/dist/features/CognitiveCompare/components/ThreeDotsLoader.js.map +1 -0
  115. package/dist/features/CognitiveCompare/components/connectedLines.js +2 -0
  116. package/dist/features/CognitiveCompare/components/connectedLines.js.map +1 -0
  117. package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +2 -0
  118. package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js.map +1 -0
  119. package/dist/features/CognitiveCompare/hooks/useAccordionState.js +2 -0
  120. package/dist/features/CognitiveCompare/hooks/useAccordionState.js.map +1 -0
  121. package/dist/features/CognitiveCompare/hooks/useCompareData.js +2 -0
  122. package/dist/features/CognitiveCompare/hooks/useCompareData.js.map +1 -0
  123. package/dist/features/CognitiveCompare/hooks/useComparePopups.js +2 -0
  124. package/dist/features/CognitiveCompare/hooks/useComparePopups.js.map +1 -0
  125. package/dist/features/CognitiveCompare/hooks/useDeviationNavigation.js +2 -0
  126. package/dist/features/CognitiveCompare/hooks/useDeviationNavigation.js.map +1 -0
  127. package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +2 -0
  128. package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js.map +1 -0
  129. package/dist/features/CognitiveCompare/hooks/useResizeHandler.js +2 -0
  130. package/dist/features/CognitiveCompare/hooks/useResizeHandler.js.map +1 -0
  131. package/dist/features/CognitiveCompare/hooks/useSectionRefs.js +2 -0
  132. package/dist/features/CognitiveCompare/hooks/useSectionRefs.js.map +1 -0
  133. package/dist/features/CognitiveCompare/hooks/useSideBySide.js +2 -0
  134. package/dist/features/CognitiveCompare/hooks/useSideBySide.js.map +1 -0
  135. package/dist/features/CognitiveCompare/hooks/useStyles.js +2 -0
  136. package/dist/features/CognitiveCompare/hooks/useStyles.js.map +1 -0
  137. package/dist/index.js +1 -1
  138. package/dist/types/src/CognitiveCompareTest.d.ts +3 -0
  139. package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -0
  140. package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
  141. package/dist/types/src/assests/svg/PdfViewerIcons.d.ts +1 -0
  142. package/dist/types/src/assests/svg/PdfViewerIcons.d.ts.map +1 -1
  143. package/dist/types/src/assests/svg/SparkleIcon.d.ts +3 -0
  144. package/dist/types/src/assests/svg/SparkleIcon.d.ts.map +1 -0
  145. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts +27 -0
  146. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -0
  147. package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts +11 -0
  148. package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -0
  149. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +6 -0
  150. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -0
  151. package/dist/types/src/features/CognitiveCompare/CognitiveCompareConfig.d.ts +64 -0
  152. package/dist/types/src/features/CognitiveCompare/CognitiveCompareConfig.d.ts.map +1 -0
  153. package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts +11 -0
  154. package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts.map +1 -0
  155. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +282 -0
  156. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -0
  157. package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +63 -0
  158. package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -0
  159. package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts +7 -0
  160. package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -0
  161. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +67 -0
  162. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -0
  163. package/dist/types/src/features/CognitiveCompare/LoaderComponent.d.ts +3 -0
  164. package/dist/types/src/features/CognitiveCompare/LoaderComponent.d.ts.map +1 -0
  165. package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts +17 -0
  166. package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts.map +1 -0
  167. package/dist/types/src/features/CognitiveCompare/OverlayComponent.d.ts +5 -0
  168. package/dist/types/src/features/CognitiveCompare/OverlayComponent.d.ts.map +1 -0
  169. package/dist/types/src/features/CognitiveCompare/ResizableSplitPane.d.ts +9 -0
  170. package/dist/types/src/features/CognitiveCompare/ResizableSplitPane.d.ts.map +1 -0
  171. package/dist/types/src/features/CognitiveCompare/components/CognitiveSummaryPopup.d.ts +3 -0
  172. package/dist/types/src/features/CognitiveCompare/components/CognitiveSummaryPopup.d.ts.map +1 -0
  173. package/dist/types/src/features/CognitiveCompare/components/CompareHeader.d.ts +12 -0
  174. package/dist/types/src/features/CognitiveCompare/components/CompareHeader.d.ts.map +1 -0
  175. package/dist/types/src/features/CognitiveCompare/components/LHSSectionRow.d.ts +9 -0
  176. package/dist/types/src/features/CognitiveCompare/components/LHSSectionRow.d.ts.map +1 -0
  177. package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts +9 -0
  178. package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -0
  179. package/dist/types/src/features/CognitiveCompare/components/ScrollLockToggle.d.ts +11 -0
  180. package/dist/types/src/features/CognitiveCompare/components/ScrollLockToggle.d.ts.map +1 -0
  181. package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts +17 -0
  182. package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -0
  183. package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts +13 -0
  184. package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -0
  185. package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts +36 -0
  186. package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts.map +1 -0
  187. package/dist/types/src/features/CognitiveCompare/components/ThreeDotsLoader.d.ts +8 -0
  188. package/dist/types/src/features/CognitiveCompare/components/ThreeDotsLoader.d.ts.map +1 -0
  189. package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts +8 -0
  190. package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts.map +1 -0
  191. package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts +13 -0
  192. package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -0
  193. package/dist/types/src/features/CognitiveCompare/hooks/useAccordionState.d.ts +32 -0
  194. package/dist/types/src/features/CognitiveCompare/hooks/useAccordionState.d.ts.map +1 -0
  195. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +13 -0
  196. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -0
  197. package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +24 -0
  198. package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -0
  199. package/dist/types/src/features/CognitiveCompare/hooks/useComparePopups.d.ts +22 -0
  200. package/dist/types/src/features/CognitiveCompare/hooks/useComparePopups.d.ts.map +1 -0
  201. package/dist/types/src/features/CognitiveCompare/hooks/useDeviationNavigation.d.ts +32 -0
  202. package/dist/types/src/features/CognitiveCompare/hooks/useDeviationNavigation.d.ts.map +1 -0
  203. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts +27 -0
  204. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -0
  205. package/dist/types/src/features/CognitiveCompare/hooks/useResizeHandler.d.ts +5 -0
  206. package/dist/types/src/features/CognitiveCompare/hooks/useResizeHandler.d.ts.map +1 -0
  207. package/dist/types/src/features/CognitiveCompare/hooks/useSectionRefs.d.ts +19 -0
  208. package/dist/types/src/features/CognitiveCompare/hooks/useSectionRefs.d.ts.map +1 -0
  209. package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts +35 -0
  210. package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -0
  211. package/dist/types/src/features/CognitiveCompare/hooks/useStyles.d.ts +15 -0
  212. package/dist/types/src/features/CognitiveCompare/hooks/useStyles.d.ts.map +1 -0
  213. package/dist/types/src/index.d.ts +1 -0
  214. package/dist/types/src/index.d.ts.map +1 -1
  215. package/package.json +9 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDeviationNavigation.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{useState as t,useRef as e,useCallback as n,useEffect as i}from"react";import{DEVIATION_BADGE_SEPARATOR as r,hasValue as c,getBentArrowPath as o}from"../CognitiveComparehelpers.js";var l=function(l){var u=l.containerRef,a=l.leftContainerRef,d=l.rightContainerRef;l.svgContainerRef;var v=l.pathRefs,s=l.leftHeaderRef,h=l.rightHeaderRef,g=l.proposedSections,f=l.existingSections,p=l.visibleFields,y=l.leftRefs,x=l.rightRefs,m=l.sectionLeftRefs,R=l.sectionRightRefs,C=l.subSectionLeftRefs,b=l.subSectionRightRefs,B=l.lhsBadgeRefs,S=l.rhsBadgeRefs,M=l.sectionRowRefs,L=l.expandedSections,T=l.expandedSubSections,I=l.connectedSections,H=l.isSideBySide,A=l.activeSideBySideSection,E=l.maintainRelativeOrder,D=l.cognitiveMap,k=l.getSectionCompareStyle,Y=l.getSubSectionCompareStyle,w=l.getDeviationStyleByKey,N=l.isArrowVisible,O=l.isAnimatingRef,j=l.isSideBySideRef,F=l.sideBySideCacheRef,P=l.sideBySideLineRef,z=l.activeSideBySideSectionRef,K=l.activeSideBySideRightSectionRef,q=l.connectedLines,V=l.setConnectedLines,G=l.cachedConnectedPositions,J=l.calculateLinesRef,Q=l.resizeTimerRef,U=l.scrollLock,W=l.scrollSyncLocked,X=l.handleResizeRef,Z=l.activeProposed,$=l.existingRule,_=l.analysisData,tt=l.pendingScrollTargetRef,et=l.pendingScrollCallbackRef,nt=l.resolvedComparisonConfig,it=l.getFieldData,rt=t([]),ct=rt[0],ot=rt[1],lt=t(null),ut=lt[0],at=lt[1],dt=t([]),vt=dt[0],st=dt[1],ht=null!=q?q:vt,gt=null!=V?V:st,ft=t({width:0,height:0}),pt=ft[0],yt=ft[1],xt=e(!1),mt=e(!1),Rt=e(!1),Ct=e(null),bt=e([]),Bt=null!=G?G:bt,St=n(function(){var t,e,n,i,l,v,M,N,j,F,P,z,K,q,V,G,J,Q,U,W,X,Z,$;if(!xt.current&&!O.current){xt.current=!0;try{if(!u.current)return;var _=function(t){var e=t.split("-"),n=e[0];if(!L[n]&&!1===E)return!1;if(E&&!L["left-".concat(n)]&&!L["right-".concat(n)]&&!L[n])return!1;for(var i=n,r=1;r<e.length-1;r++)if(i+="-".concat(e[r]),!T[i])return!1;return!0},tt=u.current.getBoundingClientRect();yt({width:tt.width,height:tt.height});var et=[];if(p.forEach(function(t){var e,n,i=t.key,r=null===(e=y.current[i])||void 0===e?void 0:e.current,c=null===(n=x.current[i])||void 0===n?void 0:n.current;r&&c&&(r.style.height="auto",c.style.height="auto",r.style.minHeight="0px",c.style.minHeight="0px")}),!O.current){for(var nt=0;nt<Math.max(g.length,f.length);nt++){var it=null===(t=m.current[nt])||void 0===t?void 0:t.current,rt=null===(e=R.current[nt])||void 0===e?void 0:e.current;it&&(it.style.height="auto",it.style.minHeight="0px"),rt&&(rt.style.height="auto",rt.style.minHeight="0px")}E||Object.keys(C.current).forEach(function(t){var e,n;if(_(t)){var i=null===(e=C.current[t])||void 0===e?void 0:e.current,r=null===(n=b.current[t])||void 0===n?void 0:n.current;i&&r&&(i.style.height="auto",r.style.height="auto",i.style.minHeight="0px",r.style.minHeight="0px")}})}var ct={};p.forEach(function(t){var e,n,i=t.key,r=null===(e=y.current[i])||void 0===e?void 0:e.current,c=null===(n=x.current[i])||void 0===n?void 0:n.current;if(r&&c){var o=r.getBoundingClientRect(),l=c.getBoundingClientRect();ct[i]=Math.max(o.height,l.height)}});var lt={left:{},right:{}},ut={};if(!O.current)if(E){if(H&&null!==A)if("number"==typeof A){var dt=A,vt=g[dt],st=null===(l=m.current[dt])||void 0===l?void 0:l.current;st&&vt&&(vt.refIndexes||[]).forEach(function(t){var e,n=f.findIndex(function(e){return e.selfIndex===t}),i=null===(e=R.current[n])||void 0===e?void 0:e.current;if(i&&(L["left-".concat(dt)]||L["right-".concat(n)])){var r=Math.max(st.getBoundingClientRect().height,i.getBoundingClientRect().height);lt.left[dt]=Math.max(lt.left[dt]||0,r),lt.right[n]=Math.max(lt.right[n]||0,r)}})}else{var ht=A.split(r)[2];if(ht){it=null===(v=C.current[ht])||void 0===v?void 0:v.current,rt=null===(M=b.current[ht])||void 0===M?void 0:M.current;if(it&&rt){ft=Math.max(it.getBoundingClientRect().height,rt.getBoundingClientRect().height);ut[ht]=Math.max(ut[ht]||0,ft)}}}}else{Object.keys(C.current).forEach(function(t){var e,n;if(_(t)){var i=null===(e=C.current[t])||void 0===e?void 0:e.current,r=null===(n=b.current[t])||void 0===n?void 0:n.current;if(i&&r&&null!==i.offsetParent&&null!==r.offsetParent){var c=i.getBoundingClientRect(),o=r.getBoundingClientRect(),l=Math.max(c.height,o.height);ut[t]=l,i.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}});for(nt=0;nt<Math.min(g.length,f.length);nt++){var it=null===(n=m.current[nt])||void 0===n?void 0:n.current,rt=null===(i=R.current[nt])||void 0===i?void 0:i.current;if(it&&rt){var ft=Math.max(it.getBoundingClientRect().height,rt.getBoundingClientRect().height);lt.left[nt]=ft,lt.right[nt]=ft}}}if(p.forEach(function(t){var e,n,i=t.key,r=null===(e=y.current[i])||void 0===e?void 0:e.current,c=null===(n=x.current[i])||void 0===n?void 0:n.current;if(r&&c){var o=ct[i];r.style.minHeight="".concat(o,"px"),c.style.minHeight="".concat(o,"px")}}),O.current||(Object.entries(lt.left).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=m.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),Object.entries(lt.right).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=R.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),E||Object.keys(ut).forEach(function(t){var e,n,i=null===(e=C.current[t])||void 0===e?void 0:e.current,r=null===(n=b.current[t])||void 0===n?void 0:n.current;if(i&&r&&ut[t]){var c=ut[t];i.style.minHeight="".concat(c,"px"),r.style.minHeight="".concat(c,"px")}})),E)g.forEach(function(t,e){var n;(null===(n=m.current[e])||void 0===n?void 0:n.current)&&(t.refIndexes||[]).forEach(function(t){var n,i,r,c,o,l,u,v,s,h,g=f.findIndex(function(e){return e.selfIndex===t});if(-1!==g){var p=null===(n=B.current[e])||void 0===n?void 0:n.current,y=null===(i=S.current[g])||void 0===i?void 0:i.current;if(p&&y){var x=p.getBoundingClientRect(),m=y.getBoundingClientRect(),R=x.right-tt.left,C=m.left-tt.left,b=x.top+x.height/2-tt.top,M=m.top+m.height/2-tt.top;if(H&&A===e){var L=null!==(c=null===(r=a.current)||void 0===r?void 0:r.getBoundingClientRect().top)&&void 0!==c?c:0,T=null!==(l=null===(o=d.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==l?l:0,I=L+(null!==(v=null===(u=a.current)||void 0===u?void 0:u.clientHeight)&&void 0!==v?v:1/0),E=T+(null!==(h=null===(s=d.current)||void 0===s?void 0:s.clientHeight)&&void 0!==h?h:1/0),D=x.top+x.height/2,Y=m.top+m.height/2,w=function(t,e,n){return Math.max(e,Math.min(n,t))};b=w(D,L,I)-tt.top,M=w(Y,T,E)-tt.top}var N=k(e);N&&et.push({id:"line-".concat(e,"-").concat(g),x1:R,y1:b,x2:C,y2:M,style:N,sectionIdx:e,targetRightIdx:g})}}})});else{for(nt=0;nt<Math.min(g.length,f.length);nt++){var pt=null===(N=m.current[nt])||void 0===N?void 0:N.current,mt=null===(j=R.current[nt])||void 0===j?void 0:j.current;if(pt&&mt){var Rt=pt.getBoundingClientRect(),Ct=mt.getBoundingClientRect(),bt=Math.max(Rt.top,Ct.top)+18-tt.top,St=(null===(F=f[nt])||void 0===F?void 0:F.id)||"sec-".concat(nt);(Dt=k(nt))&&et.push({id:St,x1:Rt.right-tt.left,y1:bt,x2:Ct.left-tt.left,y2:bt,style:Dt,sectionIdx:nt,hasCognitive:!!((null===(P=g[nt])||void 0===P?void 0:P.cognitiveData)||(null===(z=f[nt])||void 0===z?void 0:z.cognitiveData)||St&&D[St]),isSubSection:!1})}}Object.keys(C.current).forEach(function(t){var e,n,i,r,o,l;if(_(t)){var u=null===(e=C.current[t])||void 0===e?void 0:e.current,a=null===(n=b.current[t])||void 0===n?void 0:n.current;if(u&&a){for(var d=t.split("-").map(Number),v=g[d[0]],s=f[d[0]],h=1;h<d.length;h++)(null==v?void 0:v.subsections)&&(v=v.subsections[d[h]]),(null==s?void 0:s.subsections)&&(s=s.subsections[d[h]]);var p=!!v&&((null===(i=v.displayTitle)||void 0===i||i)&&c(v.title)),y=!!v&&((null===(r=v.displayContent)||void 0===r||r)&&c(v.content)),x=!!s&&((null===(o=s.displayTitle)||void 0===o||o)&&c(s.title)),m=!!s&&((null===(l=s.displayContent)||void 0===l||l)&&c(s.content));if(p&&y||x&&m){var R=u.getBoundingClientRect(),B=a.getBoundingClientRect(),S=Math.max(R.top,B.top)+16-tt.top,M=Y(t);M&&"Not Defined"!==M.label&&et.push({id:"subsec-".concat(t),x1:R.right-tt.left,y1:S,x2:B.left-tt.left,y2:S,style:M,sectionIdx:d[0],isSubSection:!0,subSectionKeyPath:t,hasCognitive:!(!(null==v?void 0:v.cognitiveData)&&!(null==s?void 0:s.cognitiveData))})}}}})}if(H&&"string"==typeof A&&A.includes(r)){var Mt=A.split(r),Lt=Mt[0],Tt=Mt[1],It=Mt[2],Ht=(Mt[3],"".concat(Lt).concat(r).concat(Tt)),At=null===(K=B.current[Ht])||void 0===K?void 0:K.current,Et=null===(q=S.current[Ht])||void 0===q?void 0:q.current;if(At&&Et){var Dt,kt=At.getBoundingClientRect(),Yt=Et.getBoundingClientRect(),wt=kt.right-tt.left,Nt=Yt.left-tt.left,Ot=kt.top+kt.height/2-tt.top,jt=Yt.top+Yt.height/2-tt.top;if(E){var Ft=null!==(G=null===(V=a.current)||void 0===V?void 0:V.getBoundingClientRect().top)&&void 0!==G?G:0,Pt=null!==(Q=null===(J=d.current)||void 0===J?void 0:J.getBoundingClientRect().top)&&void 0!==Q?Q:0,zt=Ft+(null!==(W=null===(U=a.current)||void 0===U?void 0:U.clientHeight)&&void 0!==W?W:1/0),Kt=Pt+(null!==(Z=null===(X=d.current)||void 0===X?void 0:X.clientHeight)&&void 0!==Z?Z:1/0),qt=function(t,e,n){return Math.max(e,Math.min(n,t))};Ot=qt(kt.top+kt.height/2,Ft,zt)-tt.top,jt=qt(Yt.top+Yt.height/2,Pt,Kt)-tt.top}(Dt=null!==($=w(Lt,Tt))&&void 0!==$?$:Y(It))&&et.push({id:"line-subsec-".concat(Ht),x1:wt,y1:Ot,x2:Nt,y2:jt,style:Dt,sectionIdx:Number(It.split("-")[0]),isSubSection:!0,subSectionKeyPath:A})}}if(ot(et),s.current&&h.current){var Vt=s.current.getBoundingClientRect(),Gt=h.current.getBoundingClientRect(),Jt=(Vt.top+Vt.height/2-tt.top+Gt.top+Gt.height/2-tt.top)/2;at({x1:Vt.right-tt.left,x2:Gt.left-tt.left,y:Jt})}else at(null);if(I.size>0){var Qt=[],Ut=a.current,Wt=d.current;if(Ut&&Wt){var Xt=[],Zt=Ut.getBoundingClientRect().top,$t=Wt.getBoundingClientRect().top,_t=Zt+Ut.clientHeight,te=$t+Wt.clientHeight,ee=Ut.scrollTop,ne=Wt.scrollTop,ie=tt.top,re=function(t,e,n){return Math.max(e,Math.min(n,t))};I.forEach(function(t){var e,n,i,c,l,u;if("string"==typeof t&&t.includes(r)){var a=t.split(r),d=a[0],v=a[1],s=a[2],h=(a[3],"".concat(d).concat(r).concat(v)),p=null===(e=B.current[h])||void 0===e?void 0:e.current,y=null===(n=S.current[h])||void 0===n?void 0:n.current;if(!p||!y)return;var x=p.getBoundingClientRect(),m=y.getBoundingClientRect(),R=null!==(i=w(d,v))&&void 0!==i?i:Y(s),C=(q=x.right-tt.left)+.5*((V=m.left-tt.left-0)-q),b=x.top+x.height/2,M=m.top+m.height/2,L=b-Zt+ee,T=M-$t+ne,I="conn-subsec-".concat(h);Xt.push({lhsScrollY:L,rhsScrollY:T,x1:q,x2:V,containerTop:ie,leftIdx:t,rhsArrayIdx:t,styleColor:(null==R?void 0:R.badgeBorder)||"#6366F1",styleId:I});var H=re(b,Zt,_t),A=re(M,$t,te),D=H-ie,N=A-ie,O=M>=$t-4&&M<=te+4,j="";j=(G=b>=Zt-4&&b<=_t+4)&&O?o(q,D,V,N):G&&!O?"M ".concat(q,",").concat(D," L ").concat(C,",").concat(D," L ").concat(C,",").concat(N):!G&&O?"M ".concat(C,",").concat(D," L ").concat(C,",").concat(N," L ").concat(V,",").concat(N):"M ".concat(C,",").concat(D," L ").concat(C,",").concat(N),Qt.push({id:I,pathD:j,style:R,leftIdx:t,rhsArrayIdx:t,x1:q,x2:V,y1:D,y2:N})}else if(E){var F=t,P=g[F];if(!(null===(u=null==P?void 0:P.refIndexes)||void 0===u?void 0:u.length))return;P.refIndexes.forEach(function(t){var e,n,i=f.findIndex(function(e){return e.selfIndex===t});if(-1!==i){var r=null===(e=B.current[F])||void 0===e?void 0:e.current,c=null===(n=S.current[i])||void 0===n?void 0:n.current;if(r&&c){var l=r.getBoundingClientRect(),u=c.getBoundingClientRect(),a=k(F),d=l.right-tt.left,v=u.left-tt.left-0,s=d+.5*(v-d),h=l.top+l.height/2,g=u.top+u.height/2,p=h-Zt+ee,y=g-$t+ne,x="conn-".concat(F,"-").concat(i);Xt.push({lhsScrollY:p,rhsScrollY:y,x1:d,x2:v,containerTop:ie,leftIdx:F,rhsArrayIdx:i,styleColor:(null==a?void 0:a.badgeBorder)||"#6366F1",styleId:x});var m=re(h,Zt,_t),R=re(g,$t,te),C=m-ie,b=R-ie,M=h>=Zt-4&&h<=_t+4,L=g>=$t-4&&g<=te+4,T="";T=M&&L?o(d,C,v,b):M&&!L?"M ".concat(d,",").concat(C," L ").concat(s,",").concat(C," L ").concat(s,",").concat(b):!M&&L?"M ".concat(s,",").concat(C," L ").concat(s,",").concat(b," L ").concat(v,",").concat(b):"M ".concat(s,",").concat(C," L ").concat(s,",").concat(b),Qt.push({id:x,pathD:T,style:a,leftIdx:F,rhsArrayIdx:i,x1:d,x2:v,y1:C,y2:b})}}})}else{var z=t,K=z;p=null===(c=B.current[z])||void 0===c?void 0:c.current,y=null===(l=S.current[K])||void 0===l?void 0:l.current;if(!p||!y)return;var q,V;x=p.getBoundingClientRect(),m=y.getBoundingClientRect(),R=k(z),C=(q=x.right-tt.left)+.5*((V=m.left-tt.left-0)-q),b=x.top+x.height/2,M=m.top+m.height/2,L=b-Zt+ee,T=M-$t+ne,I="conn-".concat(z,"-").concat(K);Xt.push({lhsScrollY:L,rhsScrollY:T,x1:q,x2:V,containerTop:ie,leftIdx:z,rhsArrayIdx:K,styleColor:(null==R?void 0:R.badgeBorder)||"#6366F1",styleId:I});var G;H=re(b,Zt,_t),A=re(M,$t,te),D=H-ie,N=A-ie,O=M>=$t-4&&M<=te+4,j="";j=(G=b>=Zt-4&&b<=_t+4)&&O?o(q,D,V,N):G&&!O?"M ".concat(q,",").concat(D," L ").concat(C,",").concat(D," L ").concat(C,",").concat(N):!G&&O?"M ".concat(C,",").concat(D," L ").concat(C,",").concat(N," L ").concat(V,",").concat(N):"M ".concat(C,",").concat(D," L ").concat(C,",").concat(N),Qt.push({id:I,pathD:j,style:R,leftIdx:z,rhsArrayIdx:K,x1:q,x2:V,y1:D,y2:N})}}),Bt.current=Xt}gt(Qt)}else gt([]),Bt.current=[]}catch(t){console.error("Line render safe fail: ",t)}finally{xt.current=!1}}},[p,g,f,D,nt,it,k,w,E,H,A,I,L,T]),Mt=n(function(){var t,e,n,i,r,c,l,s,h,g,f,p,y,x,m=Bt.current;if(m.length&&!O.current){var R=null!==(e=null===(t=a.current)||void 0===t?void 0:t.scrollTop)&&void 0!==e?e:0,C=null!==(i=null===(n=d.current)||void 0===n?void 0:n.scrollTop)&&void 0!==i?i:0,b=null!==(c=null===(r=a.current)||void 0===r?void 0:r.clientHeight)&&void 0!==c?c:1/0,B=null!==(s=null===(l=d.current)||void 0===l?void 0:l.clientHeight)&&void 0!==s?s:1/0,S=null!==(g=null===(h=a.current)||void 0===h?void 0:h.getBoundingClientRect().top)&&void 0!==g?g:0,M=null!==(p=null===(f=d.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==p?p:0,L=S+b,T=M+B,I=null!==(x=null===(y=u.current)||void 0===y?void 0:y.getBoundingClientRect().top)&&void 0!==x?x:0,H=function(t,e,n){return Math.max(e,Math.min(n,t))};m.forEach(function(t){var e=t.lhsScrollY-R+S,n=t.rhsScrollY-C+M,i=v.current[t.styleId+"-stroke"],r=v.current[t.styleId+"-bg"],c=v.current[t.styleId+"-btn"];if(i||r){var l,u=H(e,S,L),a=H(n,M,T),d=u-I,s=a-I,h=e>=S-4&&e<=L+4,g=n>=M-4&&n<=T+4,f=t.x1+.5*(t.x2-t.x1);l=h&&g?o(t.x1,d,t.x2,s):h&&!g?"M ".concat(t.x1,",").concat(d," L ").concat(f,",").concat(d," L ").concat(f,",").concat(s):!h&&g?"M ".concat(f,",").concat(d," L ").concat(f,",").concat(s," L ").concat(t.x2,",").concat(s):"M ".concat(f,",").concat(d," L ").concat(f,",").concat(s),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",l)),r&&(r.setAttribute("visibility","visible"),r.setAttribute("d",l)),c&&(h?(c.setAttribute("visibility","visible"),c.setAttribute("y",String(d-12))):c.setAttribute("visibility","hidden"))}})}},[]),Lt=n(function(){Bt.current.length>0&&!O.current||(null!==Ct.current&&clearTimeout(Ct.current),Ct.current=setTimeout(function(){J.current(),Ct.current=null},50))},[]),Tt=n(function(t){if(null!==tt.current&&et.current&&Math.abs(t.currentTarget.scrollTop-tt.current)<=2){var e=et.current;tt.current=null,et.current=null,e()}if(!Rt.current&&!U.current){if(E&&W&&(j.current||I.size>0)){var n=t.currentTarget,i=a.current,c=d.current,o=n===i?c:n===c?i:null;if(n&&o){var l=function(){var t,e,n,i,c,o,l,u,a,d,v,s=z.current,h=K.current;if(null===s)return{leftAnchor:null,rightAnchor:null};if("string"==typeof s&&s.includes(r)){var g=s.split(r),f="".concat(g[0]).concat(r).concat(g[1]);return{leftAnchor:(null===(t=B.current[f])||void 0===t?void 0:t.current)||(null===(e=C.current[g[2]])||void 0===e?void 0:e.current)||(null===(n=m.current[Number(g[2])])||void 0===n?void 0:n.current)||null,rightAnchor:(null===(i=S.current[f])||void 0===i?void 0:i.current)||(null===(c=b.current[g[3]])||void 0===c?void 0:c.current)||(null===(o=R.current[Number(g[3])])||void 0===o?void 0:o.current)||null}}var p=Number(s),y=null!==h?Number(h):p;return{leftAnchor:(null===(l=B.current[p])||void 0===l?void 0:l.current)||(null===(u=M.current[p])||void 0===u?void 0:u.current)||(null===(a=m.current[p])||void 0===a?void 0:a.current)||null,rightAnchor:(null===(d=S.current[y])||void 0===d?void 0:d.current)||(null===(v=R.current[y])||void 0===v?void 0:v.current)||null}}(),v=l.leftAnchor,s=l.rightAnchor,h=n===i?v:s,g=n===i?s:v,f=null;if(h&&g){var p=h.getBoundingClientRect(),y=g.getBoundingClientRect(),x=o.getBoundingClientRect(),L=p.top+p.height/2;f=y.top-x.top+o.scrollTop+y.height/2-(L-x.top)}else{var T=Math.max(0,n.scrollHeight-n.clientHeight),H=Math.max(0,o.scrollHeight-o.clientHeight);f=T>0?n.scrollTop/T*H:n.scrollTop}var A=Math.max(0,o.scrollHeight-o.clientHeight);f=Math.max(0,Math.min(f,A)),Math.abs(o.scrollTop-f)>1&&(Rt.current=!0,o.scrollTop=f,requestAnimationFrame(function(){Rt.current=!1}))}}E||Lt(),mt.current||(mt.current=!0,requestAnimationFrame(function(){var t,e,n,i,c,o,l;if(j.current){var v=a.current,s=d.current;if(v&&s&&P.current){if(!F.current){var h=z.current,g=void 0;if("string"==typeof h&&h.includes(r)){var f=h.split(r),p="".concat(f[0]).concat(r).concat(f[1]);g=null===(t=B.current[p])||void 0===t?void 0:t.current}else g=null===(e=B.current[h])||void 0===e?void 0:e.current;if(g){var y=g.getBoundingClientRect();F.current={badgeScreenY:y.top+y.height/2,initialScrollTop:v.scrollTop,leftTop:v.getBoundingClientRect().top,leftBottom:v.getBoundingClientRect().top+v.clientHeight,cTop:null!==(i=null===(n=u.current)||void 0===n?void 0:n.getBoundingClientRect().top)&&void 0!==i?i:0}}}if(F.current){var x=F.current,m=v.scrollTop-x.initialScrollTop,R=x.badgeScreenY-m,C=((c=R,o=x.leftTop,l=x.leftBottom,Math.max(o,Math.min(l,c)))-x.cTop).toString(),b=R>=x.leftTop-4&&R<=x.leftBottom+4;P.current.setAttribute("y1",C),P.current.setAttribute("y2",C),P.current.setAttribute("visibility",b?"visible":"hidden")}}}Bt.current.length>0&&Mt(),mt.current=!1}))}},[Mt,E,W,I,Lt]);return i(function(){J.current=St},[St]),i(function(){var t=setTimeout(Lt,250),e=function(){return X.current()};return window.addEventListener("resize",e),function(){clearTimeout(t),null!==Ct.current&&clearTimeout(Ct.current),null!==Q.current&&clearTimeout(Q.current),window.removeEventListener("resize",e)}},[Z,$,_,p,L,T,g,f,nt,Lt,H,A,N,I]),{lines:ct,setLines:ot,overallConnector:ut,setOverallConnector:at,connectedLines:ht,setConnectedLines:gt,svgDimensions:pt,cachedConnectedPositions:Bt,calculateLines:St,calculateLinesRef:J,calculateLinesDebounced:Lt,handleColumnScroll:Tt}};export{l as useLinesCalculator};
2
+ //# sourceMappingURL=useLinesCalculator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLinesCalculator.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{useRef as n,useEffect as e,useCallback as r}from"react";import{DEVIATION_BADGE_SEPARATOR as t}from"../CognitiveComparehelpers.js";var u=function(u){var i=u.timerRef,c=u.ruleComponentRef,l=u.scrollContainerRef,o=u.containerRef,a=u.maintainRelativeOrder,d=u.proposedSections,s=u.existingSections,f=u.isSideBySideRef,v=u.activeSideBySideSectionRef,R=u.activeSideBySideRightSectionRef,p=u.sectionRowRefs,g=u.sectionRightRowRefs,h=u.sectionLeftRefs,m=u.sectionRightRefs,C=u.subSectionLeftRefs,S=u.subSectionRightRefs,B=u.lhsBadgeRefs,T=u.rhsBadgeRefs,b=u.leftContainerRef,y=u.rightContainerRef,z=u.calculateLinesRef,x=u.handleResizeRef,w=u.setIsResizing,A=u.setIsArrowVisible,E=u.sideBySideCacheRef,F=u.cachedConnectedPositions,L=n(0),M=n(0),I=n(0),N=n(function(){}),O=null!=x?x:N,j=n(null);n(i),e(function(){var n=function(n,e,r,t,u){e.current=n.getBoundingClientRect().width;var i=new ResizeObserver(function(n){null!==r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(function(){var i,c,l;r.current=null;var o=n[n.length-1];if(o){var a=null!==(l=null===(c=null===(i=o.borderBoxSize)||void 0===i?void 0:i[0])||void 0===c?void 0:c.inlineSize)&&void 0!==l?l:o.contentRect.width;Math.abs(a-e.current)<1?u():(e.current=a,t())}})});return i.observe(n),i},e={current:null},r={current:null},t={current:null},u=[],i=[e,r,t];return c.current&&u.push(n(c.current,L,e,function(){return O.current()},function(){})),l.current&&u.push(n(l.current,M,r,function(){return O.current()},function(){var n;return null===(n=z.current)||void 0===n?void 0:n.call(z)})),o.current&&u.push(n(o.current,I,t,function(){return O.current()},function(){var n;return null===(n=z.current)||void 0===n?void 0:n.call(z)})),function(){u.forEach(function(n){return n.disconnect()}),i.forEach(function(n){null!==n.current&&(cancelAnimationFrame(n.current),n.current=null)})}},[]);var q=r(function(){w(!0),A(!1),E.current=null,null!==j.current&&clearTimeout(j.current),null!==i.current&&(clearTimeout(i.current),i.current=null),j.current=setTimeout(function(){var n,e,r,u,i,c,l,o,d,s,x;try{if(F.current=[],f.current&&null!==v.current&&null!==R.current){var E=v.current,L=R.current,M="string"==typeof E&&E.includes(t),I=null,N=null,O=null,q=null;if(M){var P=E.split(t),V="".concat(P[0]).concat(t).concat(P[1]);I=(null===(n=B.current[V])||void 0===n?void 0:n.current)||null,N=(null===(e=T.current[V])||void 0===e?void 0:e.current)||null,O=(null===(r=C.current[P[2]])||void 0===r?void 0:r.current)||(null===(u=h.current[Number(P[2])])||void 0===u?void 0:u.current)||null,q=(null===(i=S.current[P[3]])||void 0===i?void 0:i.current)||(null===(c=m.current[Number(P[3])])||void 0===c?void 0:c.current)||null}else I=(null===(l=p.current[E])||void 0===l?void 0:l.current)||null,O=(null===(o=h.current[E])||void 0===o?void 0:o.current)||null,N=(null===(d=g.current[L])||void 0===d?void 0:d.current)||null,q=(null===(s=m.current[L])||void 0===s?void 0:s.current)||null;if(I&&N&&O&&q){if(O.style.paddingTop="0px",q.style.paddingTop="0px",!a){var k=I.getBoundingClientRect(),D=N.getBoundingClientRect(),G=k.top-D.top;G>0?q.style.paddingTop="".concat(G,"px"):G<0&&(O.style.paddingTop="".concat(Math.abs(G),"px"))}var H=b.current,J=y.current;if(H&&J){var K=I.getBoundingClientRect().top-H.getBoundingClientRect().top+H.scrollTop,Q=N.getBoundingClientRect().top-J.getBoundingClientRect().top+J.scrollTop-(K-H.scrollTop);Math.abs(J.scrollTop-Q)>1&&(J.scrollTop=Q)}}}null===(x=z.current)||void 0===x||x.call(z),f.current&&A(!0)}catch(n){console.error("Error in resize handler: ",n)}finally{w(!1),j.current=null}},150)},[a,d,s]);return{handleResize:q,handleResizeRef:O}};export{u as useResizeHandler};
2
+ //# sourceMappingURL=useResizeHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizeHandler.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import e,{useRef as t,useCallback as r}from"react";var n=function(){return e.createRef()},f=function(e,f){var c=t({}),u=t({}),o=t({}),i=t({}),R=t({}),s=t({}),a=t({}),g=t({}),h=t({}),l=t({}),v=r(function(e,t){var r="left"===e?c.current:u.current;return r[t]||(r[t]=n()),r[t]},[]),S=r(function(e,t){return e.current[t]||(e.current[t]=n()),e.current[t]},[]);e.forEach(function(e){v("left",e),v("right",e)});for(var d=0;d<f;d+=1)S(o,d),S(i,d),S(R,d),S(s,d),S(a,d);var b=r(function(e){return S(l,e)},[S]),w=r(function(e,t){var r="left"===e?g.current:h.current;return r[t]||(r[t]=n()),r[t]},[]),B=r(function(e,t){return S("left"===e?R:s,t)},[S]);return{leftRefs:c,rightRefs:u,sectionLeftRefs:o,sectionRightRefs:i,lhsBadgeRefs:R,rhsBadgeRefs:s,sectionRightRowRefs:a,subSectionLeftRefs:g,subSectionRightRefs:h,sectionRowRefs:l,getFieldRef:v,getSectionRowRef:b,getSubSectionRef:w,getBadgeRef:B}};export{f as useSectionRefs};
2
+ //# sourceMappingURL=useSectionRefs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSectionRefs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{useState as e,useRef as n,useCallback as t,useEffect as r}from"react";import{DEVIATION_BADGE_SEPARATOR as i,smoothScrollTo as l,resetClauseHighlight as u}from"../CognitiveComparehelpers.js";var o=function(o){var c=o.maintainRelativeOrder,d=o.proposedSections,s=o.existingSections,v=o.leftContainerRef,a=o.rightContainerRef,p=o.scrollContainerRef,g=o.sectionLeftRefs,f=o.sectionRightRefs,h=o.subSectionLeftRefs,R=o.subSectionRightRefs,S=o.lhsBadgeRefs,y=o.rhsBadgeRefs,m=o.sectionRowRefs,B=o.sectionRightRowRefs,x=o.rhsTopSpacerRef,C=o.rhsBottomSpacerRef,T=o.lhsTopSpacerRef,b=o.lhsBottomSpacerRef,A=o.calculateLinesRef,w=o.setConnectedSections,I=o.setConnectedLines,L=o.cachedConnectedPositions,F=o.closeMoreFunctionsPopup,N=o.setErrorToast;o.moreFunctions,o.closeSummaryPopup;var E=e(!1),q=E[0],H=E[1],P=e(!1),M=P[0],z=P[1],V=e(!1),j=V[0],k=V[1],O=e(!1),D=O[0],G=O[1],J=e(null),K=J[0],Q=J[1],U=n(!1),W=n(null),X=n(!1),Y=n(null),Z=n(null),$=n(null),_=n(new Set),ee=function(){_.current.forEach(function(e){u(e)}),_.current.clear()},ne=function(e,n,t){var r,l,u,o,c,d,s,p,x,C,T,b,A=null,w=null,I=null,L=null,F=null,N=null,E=function(e,n){if(!e||!n)return!0;var t=e.getBoundingClientRect(),r=n.getBoundingClientRect();return t.bottom>=r.top&&t.top<=r.bottom};if(e){var q=n.split(i),H="".concat(q[0]).concat(i).concat(q[1]);A=(null===(r=h.current[q[2]])||void 0===r?void 0:r.current)||(null===(l=g.current[Number(q[2])])||void 0===l?void 0:l.current)||null,w=(null===(u=R.current[q[3]])||void 0===u?void 0:u.current)||(null===(o=f.current[Number(q[3])])||void 0===o?void 0:o.current)||null,I=(null===(c=S.current[H])||void 0===c?void 0:c.current)||A,L=(null===(d=y.current[H])||void 0===d?void 0:d.current)||w}else{var P=Number(n),M=null!==t?Number(t):P;A=(null===(s=g.current[P])||void 0===s?void 0:s.current)||null,w=(null===(p=f.current[M])||void 0===p?void 0:p.current)||null,F=(null===(x=S.current[P])||void 0===x?void 0:x.current)||null,N=(null===(C=y.current[M])||void 0===C?void 0:C.current)||null,I=F||(null===(T=m.current[P])||void 0===T?void 0:T.current)||A,L=N||(null===(b=B.current[M])||void 0===b?void 0:b.current)||w}if(A&&(A.style.paddingTop="0px"),w&&(w.style.paddingTop="0px"),e||(F&&(F.style.marginTop="0px"),N&&(N.style.marginTop="0px")),!e&&F&&N){var z=v.current,V=a.current;if(!E(F,z)||!E(N,V))return;var j=F.getBoundingClientRect(),k=N.getBoundingClientRect(),O=j.top-k.top;if(Math.abs(O)>32)return;O>0&&(N.style.marginTop="".concat(O,"px"))}else if(I&&L&&A&&w){j=I.getBoundingClientRect(),k=L.getBoundingClientRect();(O=j.top-k.top)>0&&(w.style.paddingTop="".concat(O,"px"))}},te=t(function(){var e,n,t,r,l,u,o,c,d=Y.current,s=Z.current;if(null!==d)if("string"==typeof d&&d.includes(i)){var v=d.split(i),a=(null===(e=h.current[v[2]])||void 0===e?void 0:e.current)||(null===(n=g.current[Number(v[2])])||void 0===n?void 0:n.current)||null,p=(null===(t=R.current[v[3]])||void 0===t?void 0:t.current)||(null===(r=f.current[Number(v[3])])||void 0===r?void 0:r.current)||null;a&&(a.style.paddingTop="0px"),p&&(p.style.paddingTop="0px")}else{a=(null===(l=g.current[d])||void 0===l?void 0:l.current)||null,p=(null===(u=f.current[null!=s?s:d])||void 0===u?void 0:u.current)||null;a&&(a.style.paddingTop="0px"),p&&(p.style.paddingTop="0px");var m=(null===(o=S.current[d])||void 0===o?void 0:o.current)||null,B=(null===(c=y.current[null!=s?s:d])||void 0===c?void 0:c.current)||null;m&&(m.style.marginTop="0px"),B&&(B.style.marginTop="0px")}x.current&&(x.current.style.height="0px"),C.current&&(C.current.style.height="0px"),T.current&&(T.current.style.height="0px"),b.current&&(b.current.style.height="0px")},[]);r(function(){X.current=q},[q]),r(function(){Y.current=K},[K]);var re=t(function(){ee(),H(!1),X.current=!1,W.current=null,te(),Q(null),Y.current=null,Z.current=null,z(!1),G(!1)},[te]),ie=t(function(e,n,t){var r,u,o=null===(r=null==t?void 0:t.toggleIfSame)||void 0===r||r,h=null==t?void 0:t.onReady,R=null!==(u=null==t?void 0:t.sourceSide)&&void 0!==u?u:"left";if(F(),null!=e)if(n)N("No counterpart exists for this section.");else{ee();var E=q&&K===e;q&&null!==K&&te(),E&&o?re():(w(new Set([e])),I([]),L.current=[],G(!0),U.current=!0,Q(e),Y.current=e,H(!0),X.current=!0,z(!1),x.current&&(x.current.style.height="0px"),C.current&&(C.current.style.height="0px"),T.current&&(T.current.style.height="0px"),b.current&&(b.current.style.height="0px"),requestAnimationFrame(function(){var n,t,r,u,o,T,b,w,I="string"==typeof e&&e.includes(i),L=null,F=null,N=null;if(I){var E=e.split(i),q="".concat(E[0]).concat(i).concat(E[1]);L=(null===(n=S.current[q])||void 0===n?void 0:n.current)||null,F=(null===(t=y.current[q])||void 0===t?void 0:t.current)||null,N=F?e:null}else if(L=(null===(r=g.current[e])||void 0===r?void 0:r.current)||(null===(u=m.current[e])||void 0===u?void 0:u.current)||null,c){var H=d[e],P=(null==H?void 0:H.refIndexes)||[];if(P.length>0){var M=P[0],V=s.findIndex(function(e){return e.selfIndex===M});-1!==V&&(F=(null===(b=f.current[V])||void 0===b?void 0:b.current)||(null===(w=B.current[V])||void 0===w?void 0:w.current)||null,N=V)}}else F=(null===(o=f.current[e])||void 0===o?void 0:o.current)||(null===(T=B.current[e])||void 0===T?void 0:T.current)||null,N=F?e:null;Z.current=N;var j=v.current,k=a.current,O=function(){ne(I,e,N),z(!0),A.current&&A.current(),U.current=!1,"right"===R&&k?k.dispatchEvent(new Event("scroll")):j&&j.dispatchEvent(new Event("scroll")),G(!1),null==h||h()};if(!L||!j)return U.current=!1,G(!1),void(null==h||h());if(F&&k){if(!c){var D=0;D="right"===R?F?F.getBoundingClientRect().top:0:L?L.getBoundingClientRect().top:0;var J=p.current,K=(null==J?void 0:J.getBoundingClientRect().top)||0,Q=J?J.scrollTop+D-K-150:0;return J?void l(J,Q,200,O):void O()}var W=L.getBoundingClientRect().top-j.getBoundingClientRect().top+j.scrollTop,X=F.getBoundingClientRect().top-k.getBoundingClientRect().top+k.scrollTop,Y=200;if("left"===R){var $=X-(W-j.scrollTop);$<0&&x.current&&(x.current.style.height="".concat(Math.abs($),"px")),requestAnimationFrame(function(){var e,n=k.scrollHeight-k.clientHeight;if($<0)e=0;else{if($>n){var t=$-n;return C.current&&(C.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){l(k,$,Y,O)})}e=$}l(k,e,Y,O)})}else{var _=W-(X-k.scrollTop);requestAnimationFrame(function(){var e,n=j.scrollHeight-j.clientHeight;if(_<0)e=0;else{if(_>n)return void requestAnimationFrame(function(){return l(j,n,Y,O)});e=_}l(j,e,Y,O)})}}else O()}))}},[K,F,s,q,c,d,te,re]);return{isSideBySide:q,setIsSideBySide:H,isArrowVisible:M,setIsArrowVisible:z,isResizing:j,setIsResizing:k,isSideBySideLoading:D,setIsSideBySideLoading:G,activeSideBySideSection:K,setActiveSideBySideSection:Q,scrollLock:U,sideBySideCacheRef:W,isSideBySideRef:X,activeSideBySideSectionRef:Y,activeSideBySideRightSectionRef:Z,sideBySideLineRef:$,highlightedClauseRefs:_,clearClauseHighlight:ee,applyAlignmentPadding:ne,resetSideBySide:re,activateSideBySide:ie}};export{o as useSideBySide};
2
+ //# sourceMappingURL=useSideBySide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSideBySide.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{__assign as l}from"tslib";import{useCallback as n}from"react";import{generateColorPalette as i,getFirstDeviationOutputValue as o,getFirstDeviationColor as e,safeStringify as u}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as t}from"../CognitiveCompareConstants.js";var v=function(v){var d=v.proposedSections,a=v.existingSections,r=v.maintainRelativeOrder,s=v.cognitiveMap,f=v.deviationData,c=v.treeData,p=v.resolvedComparisonConfig,b=n(function(n,u){var v,s,f;void 0===u&&(u="left");var c=null,p=null;if("left"===u)if(c=d[n],r&&c){var b=a.filter(function(l){var n;return null===(n=c.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex)});p=b.find(function(l){return l.evaluationResult})||b[0]}else p=a[n];else if(p=a[n],r&&p){var m=d.filter(function(l){var n;return null===(n=l.refIndexes)||void 0===n?void 0:n.includes(p.selfIndex)});c=m.find(function(l){return l.evaluationResult})||m[0]}else c=d[n];var _=(null==c?void 0:c.relation)&&"not_defined"!==c.relation,g=(null==p?void 0:p.relation)&&"not_defined"!==p.relation,C=!(!(null==c?void 0:c.cognitiveData)&&!(null==p?void 0:p.cognitiveData));if(!_&&!g&&!C)return l(l({},i(t)),{label:"Not Defined"});var D=null!==(s=null!==(v=null==c?void 0:c.evaluationResult)&&void 0!==v?v:null==p?void 0:p.evaluationResult)&&void 0!==s?s:null,S=o(D),R=e(D);return l(l({},i(R)),null!=D?{label:null!==(f=S)&&void 0!==f?f:""}:{label:null})},[d,a,s,p,r]),m=n(function(n){for(var v,r,s=n.split("-").map(Number),f=d[s[0]],c=a[s[0]],p=1;p<s.length;p++)(null==f?void 0:f.subsections)&&(f=f.subsections[s[p]]),(null==c?void 0:c.subsections)&&(c=c.subsections[s[p]]);if(!f&&!c)return null;var b=(null==f?void 0:f.relation)&&"not_defined"!==f.relation,m=(null==c?void 0:c.relation)&&"not_defined"!==c.relation;u(null==f?void 0:f.id)||u(null==c?void 0:c.id);var _=!(!(null==f?void 0:f.cognitiveData)&&!(null==c?void 0:c.cognitiveData));if(!b&&!m&&!_)return l(l({},i(t)),{label:null});var g=null!==(r=null!==(v=null==f?void 0:f.evaluationResult)&&void 0!==v?v:null==c?void 0:c.evaluationResult)&&void 0!==r?r:null,C=o(g),D=e(g);return l(l({},i(D)),null!=g?{label:null!=C?C:""}:{label:null})},[d,a,s,p]),_=n(function(n,e){var u,v,d,a,r,s,p,b,m,_,g,C,D,S,R,x,y,I,j,h,N;if(!n||null==e)return null;var B=null!==(r=null!==(v=null===(u=null==f?void 0:f[n])||void 0===u?void 0:u.evaluation_result)&&void 0!==v?v:null===(a=null===(d=null==c?void 0:c.nodes)||void 0===d?void 0:d[n])||void 0===a?void 0:a.evaluation_result)&&void 0!==r?r:null;if(!B||"object"!=typeof B)return null;var K=null!==(_=null!==(m=null!==(p=null===(s=null==B?void 0:B.deviations)||void 0===s?void 0:s[e])&&void 0!==p?p:null===(b=null==B?void 0:B.deviation_entries)||void 0===b?void 0:b[e])&&void 0!==m?m:null==B?void 0:B[e])&&void 0!==_?_:null,M=null!==(h=null!==(y=null!==(R=null!==(D=null===(C=null===(g=null==K?void 0:K.evaluation_outputs)||void 0===g?void 0:g.metadata)||void 0===C?void 0:C.label_color)&&void 0!==D?D:null===(S=null==K?void 0:K.evaluation_outputs)||void 0===S?void 0:S.label_color)&&void 0!==R?R:null===(x=null==K?void 0:K.metadata)||void 0===x?void 0:x.label_color)&&void 0!==y?y:null===(j=null===(I=null==B?void 0:B.evaluation_outputs)||void 0===I?void 0:I.metadata)||void 0===j?void 0:j.label_color)&&void 0!==h?h:t,O=null!==(N=o(K))&&void 0!==N?N:o(B);return l(l({},i(M)),{label:O})},[f,c]);return{getSectionCompareStyle:b,getSubSectionCompareStyle:m,getDeviationStyleByKey:_}};export{v as useStyleHelpers};
2
+ //# sourceMappingURL=useStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStyles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";
1
+ export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{default as CognitiveCompare}from"./features/CognitiveCompare/CognitiveCompare.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ declare const CognitiveCompareTest: () => import("react/jsx-runtime").JSX.Element;
2
+ export default CognitiveCompareTest;
3
+ //# sourceMappingURL=CognitiveCompareTest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,oBAAoB,+CA2MzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CommonConstants.d.ts","sourceRoot":"","sources":["../../../../src/CommonConstants/CommonConstants.tsx"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5C,eAAO,MAAM,OAAO,EAAE,aAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,EAAE,aAAuB,CAAC;AAChD,eAAO,MAAM,6BAA6B,yCAAwC,CAAA"}
1
+ {"version":3,"file":"CommonConstants.d.ts","sourceRoot":"","sources":["../../../../src/CommonConstants/CommonConstants.tsx"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5C,eAAO,MAAM,OAAO,EAAE,aAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,EAAE,aAAuB,CAAC;AAChD,eAAO,MAAM,6BAA6B,yCAAyC,CAAA"}
@@ -2,4 +2,5 @@ export declare const DefaultPdfIcon: () => import("react/jsx-runtime").JSX.Eleme
2
2
  export declare const DefaultFullScreenIcon: () => import("react/jsx-runtime").JSX.Element;
3
3
  export declare const DefaultDownloadIcon: () => import("react/jsx-runtime").JSX.Element;
4
4
  export declare const DefaultCloseIcon: () => import("react/jsx-runtime").JSX.Element;
5
+ export declare const DefaultFullScreenCloseIcon: () => import("react/jsx-runtime").JSX.Element;
5
6
  //# sourceMappingURL=PdfViewerIcons.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PdfViewerIcons.d.ts","sourceRoot":"","sources":["../../../../../src/assests/svg/PdfViewerIcons.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,+CAI1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,+CAIjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,+CAM/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAK5B,CAAC"}
1
+ {"version":3,"file":"PdfViewerIcons.d.ts","sourceRoot":"","sources":["../../../../../src/assests/svg/PdfViewerIcons.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,+CAI1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,+CAIjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,+CAM/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAK5B,CAAC;AAEF,eAAO,MAAM,0BAA0B,+CAetC,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const SparkleIcon: () => import("react/jsx-runtime").JSX.Element;
2
+ export default SparkleIcon;
3
+ //# sourceMappingURL=SparkleIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SparkleIcon.d.ts","sourceRoot":"","sources":["../../../../../src/assests/svg/SparkleIcon.tsx"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW,+CAqBhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,27 @@
1
+ import React, { CSSProperties } from "react";
2
+ interface CitationAnchorProps {
3
+ href: string;
4
+ children: any;
5
+ chevronUpComponent?: React.ReactNode;
6
+ chevronDownComponent?: React.ReactNode;
7
+ customStyle?: {
8
+ citationButtonWrapper?: CSSProperties;
9
+ arrow?: CSSProperties;
10
+ citationButton?: CSSProperties;
11
+ expandableContent?: CSSProperties;
12
+ bookHeader?: CSSProperties;
13
+ relative?: CSSProperties;
14
+ pageColor?: CSSProperties;
15
+ highlightedText?: CSSProperties;
16
+ expandedWrapper?: CSSProperties;
17
+ expandableContainer?: CSSProperties;
18
+ bookBodyContent?: CSSProperties;
19
+ customScrollbarClass?: CSSProperties;
20
+ relativeWrapper?: CSSProperties;
21
+ };
22
+ defaultState?: boolean;
23
+ metaData?: any;
24
+ }
25
+ declare const CitationAnchor: React.FC<CitationAnchorProps>;
26
+ export default CitationAnchor;
27
+ //# sourceMappingURL=CitationAnchor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAKf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;AA6FD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiKjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ type Props = {
2
+ title?: string;
3
+ content?: string;
4
+ citations?: Record<string, any>;
5
+ styles?: Record<string, any>;
6
+ docData?: Record<string, any> | null;
7
+ open: boolean;
8
+ };
9
+ declare function CitationRenderer({ content, title, citations, styles, docData, open }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export default CitationRenderer;
11
+ //# sourceMappingURL=CitationRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CitationRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationRenderer.tsx"],"names":[],"mappings":"AAKA,KAAK,KAAK,GAAG;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACrC,IAAI,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,iBAAS,gBAAgB,CAAC,EACtB,OAAY,EACZ,KAAU,EACV,SAAc,EACd,MAAW,EACX,OAAmC,EACnC,IAAI,EACP,EAAE,KAAK,2CA2DP;AAED,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { CognitiveCompareProps } from "./CognitiveCompareTypes";
2
+ import { SHARED_MARKDOWN_STYLES } from "./CognitiveCompareConfig";
3
+ declare const CognitiveCompare: ({ componentHeaderText, treeData, comparisonConfig, leftColumnTitleText, rightColumnTitleText, markdownStyles, resetTrigger, displayConfig, popupConfig, deviationData, deviationNodeIdToView, resetDeviationNodeId, isProposingFix, proposingFixNodeId, isRedlineFlow, }: CognitiveCompareProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SHARED_MARKDOWN_STYLES };
5
+ export default CognitiveCompare;
6
+ //# sourceMappingURL=CognitiveCompare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AAwCA,OAAO,EAEL,qBAAqB,EAMtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AA0BlC,QAAA,MAAM,gBAAgB,6QAwBnB,qBAAqB,4CA83EvB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { ComparisonConfig, FieldConfigItem } from "./CognitiveCompareTypes";
2
+ export declare const DEFAULT_FIELD_CONFIG: FieldConfigItem[];
3
+ export declare const DEFAULT_COMPARISON_CONFIG: ComparisonConfig;
4
+ export declare const SHARED_MARKDOWN_STYLES: {
5
+ fontSize: string;
6
+ color: string;
7
+ lineHeight: number;
8
+ wordBreak: string;
9
+ overflowWrap: string;
10
+ overflow: string;
11
+ "& p": {
12
+ mt: number;
13
+ mb: number;
14
+ };
15
+ "& p:last-child": {
16
+ mb: number;
17
+ };
18
+ "& ul": {
19
+ mt: number;
20
+ mb: number;
21
+ pl: number;
22
+ listStyleType: string;
23
+ };
24
+ "& ol": {
25
+ mt: number;
26
+ mb: number;
27
+ pl: number;
28
+ listStyleType: string;
29
+ };
30
+ "& li": {
31
+ mb: number;
32
+ };
33
+ "& strong": {
34
+ fontWeight: number;
35
+ };
36
+ "& code": {
37
+ whiteSpace: string;
38
+ wordBreak: string;
39
+ };
40
+ };
41
+ export declare const DEFAULT_POPUP_CONFIG: {
42
+ tabs: {
43
+ deviation: {
44
+ key: string;
45
+ label: string;
46
+ subtitle: string;
47
+ placeholderTitle: string;
48
+ placeholderBody: string;
49
+ };
50
+ association: {
51
+ key: string;
52
+ label: string;
53
+ subtitle: string;
54
+ };
55
+ };
56
+ decisionStrengthLabel: string;
57
+ sectionTitles: {
58
+ decisioningFactors: string;
59
+ gaps: string;
60
+ };
61
+ emptyStateMessage: string;
62
+ accentColor: string;
63
+ };
64
+ //# sourceMappingURL=CognitiveCompareConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CognitiveCompareConfig.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE5E,eAAO,MAAM,oBAAoB,EAAE,eAAe,EAGjD,CAAC;AACF,eAAO,MAAM,yBAAyB,EAAE,gBA6CvC,CAAC;AAmBF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAclC,CAAC;AAIF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;CAsBhC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { RuleData, SectionPopupState, SummaryPopupState } from "./CognitiveCompareTypes";
2
+ export declare const DEFAULT_DEVIAION_COLOR = "#3730A3";
3
+ export declare const POPUP_GAP = 12;
4
+ export declare const POPUP_WIDTH = 680;
5
+ export declare const VIEWPORT_MARGIN = 12;
6
+ export declare const ARROW_SIZE = 10;
7
+ export declare const DEFAULT_RULE_FALLBACK: RuleData;
8
+ export declare const DEFAULT_COMPONENT_HEADER_TEXT = "Contract Comparison";
9
+ export declare const EMPTY_SECTION_POPUP_STATE: SectionPopupState;
10
+ export declare const EMPTY_SUMMARY_POPUP_STATE: SummaryPopupState;
11
+ //# sourceMappingURL=CognitiveCompareConstants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CognitiveCompareConstants.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEzF,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAEhD,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,WAAW,MAAM,CAAC;AAC/B,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,UAAU,KAAK,CAAC;AAG7B,eAAO,MAAM,qBAAqB,EAAE,QAAgC,CAAC;AACrE,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;AACnE,eAAO,MAAM,yBAAyB,EAAE,iBAavC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAC,iBAMtC,CAAA"}
@@ -0,0 +1,282 @@
1
+ /// <reference types="react" />
2
+ export interface ComparisonFieldAnalysis {
3
+ relation: string;
4
+ score: number;
5
+ highlights?: {
6
+ ruleA_spans?: string[];
7
+ ruleB_spans?: string[];
8
+ };
9
+ }
10
+ export interface ComparisonAnalysis {
11
+ rule_difference_comparison: {
12
+ summary: {
13
+ overall_score: number;
14
+ overall_summary: string;
15
+ };
16
+ fields: {
17
+ [key: string]: ComparisonFieldAnalysis | {
18
+ score: number;
19
+ mappings: Record<string, unknown>[];
20
+ };
21
+ };
22
+ };
23
+ }
24
+ export interface DeviationDataEntry {
25
+ deviation_title?: string;
26
+ deviation_impact?: string;
27
+ deviation_summary?: string;
28
+ deviation_explanation?: string[];
29
+ deviation_entries?: Record<string, any>;
30
+ evaluation_outputs?: Record<string, any>;
31
+ cognitive_decisioning?: {
32
+ decisioning_factors?: string[];
33
+ gaps_in_decision?: string[];
34
+ citations?: Record<string, any>;
35
+ decision_strength?: string | null;
36
+ };
37
+ deviations?: Record<string, any>;
38
+ }
39
+ export interface CognitiveDecisioningEntry {
40
+ section_id: string;
41
+ decisioning?: string | string[];
42
+ gap?: string | string[];
43
+ relevance_score: number;
44
+ metadata?: unknown;
45
+ decisioning_metadata?: unknown;
46
+ gap_metadata?: unknown;
47
+ citations?: Record<string, any>;
48
+ isMissingRationale?: boolean;
49
+ }
50
+ export interface RuleData {
51
+ id: string;
52
+ title: string;
53
+ scope?: string;
54
+ description?: string;
55
+ wta?: string;
56
+ wnta?: string;
57
+ [key: string]: unknown;
58
+ similarity?: number;
59
+ summaryText?: string;
60
+ variantType?: string;
61
+ tierName?: string;
62
+ analysis?: ComparisonAnalysis;
63
+ isLoading?: boolean;
64
+ sections?: {
65
+ id?: string;
66
+ title: string;
67
+ content: string;
68
+ subsections?: SectionBlock[];
69
+ relation?: string;
70
+ score?: number;
71
+ cognitiveRelevanceScore?: number;
72
+ cognitiveData?: CognitiveDecisioningEntry;
73
+ }[];
74
+ }
75
+ export type ProposedRuleData = {
76
+ title?: string;
77
+ description?: string;
78
+ sections?: Record<string, unknown>[];
79
+ };
80
+ export type IDisplayConfig = {
81
+ isHeaderVisible?: boolean;
82
+ isToggleVisible?: boolean;
83
+ maintainRelativeOrder?: boolean;
84
+ isLoading?: boolean;
85
+ showDeviationBadges?: boolean;
86
+ enableDeviationSchemaBackwardCompatibility?: boolean;
87
+ displayEmailNotifier?: boolean;
88
+ expandAllSections?: boolean;
89
+ expandLevels?: number;
90
+ };
91
+ export interface CognitiveCompareProps {
92
+ componentHeaderText?: string;
93
+ treeData?: Record<string, any> | null;
94
+ comparisonConfig?: Partial<ComparisonConfig>;
95
+ fieldConfig?: {
96
+ key: string;
97
+ label: string;
98
+ analysisKey: string;
99
+ }[];
100
+ highlightedField?: string | null;
101
+ onBadgeClick?: (id: string, isOpen: boolean) => void;
102
+ activeBadgeId?: string | null;
103
+ leftColumnTitleText?: string;
104
+ rightColumnTitleText?: string;
105
+ markdownStyles?: React.CSSProperties & Record<string, any>;
106
+ displayConfig: IDisplayConfig;
107
+ popupConfig?: CognitivePopupConfig;
108
+ deviationData?: Record<string, any>;
109
+ deviationNodeIdToView?: {
110
+ id: string;
111
+ trigger: number;
112
+ displayImpact?: boolean;
113
+ };
114
+ resetDeviationNodeId?: () => void;
115
+ resetTrigger?: number;
116
+ isProposingFix?: boolean;
117
+ proposingFixNodeId?: string;
118
+ isRedlineFlow?: boolean;
119
+ }
120
+ export type StyleVariant = {
121
+ bg: string;
122
+ border: string;
123
+ badgeBg: string;
124
+ badgeBorder: string;
125
+ badgeText: string;
126
+ highlightBg: string;
127
+ label: string | null;
128
+ };
129
+ export type FieldConfigItem = {
130
+ key: string;
131
+ label: string;
132
+ analysisKey: string;
133
+ };
134
+ export type RelationStyleToken = Omit<StyleVariant, "label">;
135
+ export type ComparisonConfig = {
136
+ fields: FieldConfigItem[];
137
+ thresholds: {
138
+ exact: number;
139
+ high: number;
140
+ medium: number;
141
+ };
142
+ };
143
+ export interface PopupPosition {
144
+ top: number;
145
+ left: number;
146
+ arrowLeft: number;
147
+ openAbove: boolean;
148
+ maxHeight: number;
149
+ }
150
+ export interface CognitivePopupProps {
151
+ open: boolean;
152
+ onClose: () => void;
153
+ sectionTitle: string;
154
+ referenceSectionTitle: string;
155
+ cognitiveData: CognitiveDecisioningEntry | null;
156
+ relevanceScore?: number;
157
+ anchorEl: HTMLElement | null;
158
+ sectionAnchorEl: HTMLElement | null;
159
+ scrollContainerEl: HTMLElement | null;
160
+ containerEl?: HTMLElement | null;
161
+ badgeStyle?: StyleVariant | null;
162
+ baseLayoutRef?: any;
163
+ popupRef: React.RefObject<HTMLDivElement>;
164
+ position: PopupPosition | null;
165
+ markdownStyles?: React.CSSProperties & Record<string, any>;
166
+ docData?: Record<string, any> | null;
167
+ deviationData?: DeviationDataEntry | null;
168
+ isLoading?: boolean;
169
+ }
170
+ export type SectionBlock = {
171
+ id?: string;
172
+ title: string;
173
+ content: string;
174
+ change_history?: string;
175
+ subsections?: SectionBlock[];
176
+ relation?: string;
177
+ score?: number;
178
+ cognitiveRelevanceScore?: number;
179
+ cognitiveData?: CognitiveDecisioningEntry;
180
+ selfIndex?: number;
181
+ refIndexes?: number[];
182
+ evaluationResult?: DeviationDataEntry;
183
+ displayContent?: boolean;
184
+ displayTitle?: boolean;
185
+ };
186
+ export type SectionPopupState = {
187
+ open: boolean;
188
+ sectionTitle: string;
189
+ refSectionTitle: string;
190
+ cognitiveData: CognitiveDecisioningEntry | null;
191
+ anchorEl: HTMLElement | null;
192
+ isOrphan: boolean;
193
+ sectionAnchorEl: HTMLElement | null;
194
+ badgeStyle: StyleVariant | null;
195
+ sectionIdx: number | string | null;
196
+ docData: Record<string, any> | null;
197
+ deviationData?: DeviationDataEntry | null;
198
+ isLoading?: boolean;
199
+ };
200
+ export type Row = {
201
+ left?: SectionBlock;
202
+ right?: SectionBlock;
203
+ };
204
+ export interface CognitivePopupConfig {
205
+ tabs?: {
206
+ deviation?: {
207
+ label?: string;
208
+ subtitle?: string;
209
+ placeholderTitle?: string;
210
+ placeholderBody?: string;
211
+ };
212
+ association?: {
213
+ label?: string;
214
+ subtitle?: string;
215
+ };
216
+ };
217
+ decisionStrengthLabel?: string;
218
+ sectionTitles?: {
219
+ decisioningFactors?: string;
220
+ gaps?: string;
221
+ };
222
+ emptyStateMessage?: string;
223
+ accentColor?: string;
224
+ }
225
+ export type InlineDeviationBadge = {
226
+ id: string;
227
+ actionId: string;
228
+ label: string;
229
+ highlight: string;
230
+ side: "left" | "right";
231
+ style: any;
232
+ isOrphan: boolean;
233
+ score?: number | null;
234
+ badgeRef: React.RefObject<HTMLDivElement>;
235
+ onClick: (e: React.MouseEvent) => void;
236
+ };
237
+ export interface CachedBadgePosition {
238
+ lhsScrollY: number;
239
+ rhsScrollY: number;
240
+ x1: number;
241
+ x2: number;
242
+ containerTop: number;
243
+ leftIdx: number | string;
244
+ rhsArrayIdx: number | string;
245
+ styleColor: string;
246
+ styleId: string;
247
+ }
248
+ export type CognitiveSummaryPopupProps = {
249
+ open: boolean;
250
+ anchorEl: HTMLElement | null;
251
+ containerEl?: HTMLElement | null;
252
+ clipTopEl?: HTMLElement | null;
253
+ onClose: () => void;
254
+ summary: string | Record<string, any> | null;
255
+ scrollContainerEl?: HTMLElement | null;
256
+ markdownStyles?: React.CSSProperties & Record<string, any>;
257
+ isLoading?: boolean;
258
+ displayImpact?: boolean;
259
+ isScrollLocked?: boolean;
260
+ };
261
+ export type SummaryPopupState = {
262
+ open: boolean;
263
+ anchorEl: HTMLElement | null;
264
+ summary: string | Record<string, any> | null;
265
+ markdownStyles?: React.CSSProperties & Record<string, any>;
266
+ isLoading?: boolean;
267
+ displayImpact?: boolean;
268
+ };
269
+ export type HighlightMatch = {
270
+ idx?: number;
271
+ highlight: string;
272
+ start: number;
273
+ end: number;
274
+ trimmedStart?: number;
275
+ trimmedEnd?: number;
276
+ orphaned?: boolean;
277
+ badges: any[];
278
+ color: string;
279
+ usedLooseMatch?: boolean;
280
+ };
281
+ export type DivRefMap<Key extends string | number = string | number> = Record<Key, React.RefObject<HTMLDivElement>>;
282
+ //# sourceMappingURL=CognitiveCompareTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,E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