@e-llm-studio/citation 0.0.199 → 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.
- package/README.md +157 -28
- package/dist/assests/svg/PdfViewerIcons.js +1 -1
- package/dist/assests/svg/SparkleIcon.js +2 -0
- package/dist/assests/svg/SparkleIcon.js.map +1 -0
- package/dist/cjs/assests/svg/PdfViewerIcons.js +1 -1
- package/dist/cjs/assests/svg/SparkleIcon.js +2 -0
- package/dist/cjs/assests/svg/SparkleIcon.js.map +1 -0
- package/dist/cjs/features/ChatDrawer/ChatDrawer.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CitationAnchor.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CitationRenderer.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompareConfig.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompareConfig.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompareConstants.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompareConstants.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CognitivePopup.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CompareContext.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CompareContext.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/LoaderComponent.js +2 -0
- package/dist/cjs/features/CognitiveCompare/LoaderComponent.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/MoreFunctionsPopup.js +2 -0
- package/dist/cjs/features/CognitiveCompare/MoreFunctionsPopup.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/OverlayComponent.js +2 -0
- package/dist/cjs/features/CognitiveCompare/OverlayComponent.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/ResizableSplitPane.js +2 -0
- package/dist/cjs/features/CognitiveCompare/ResizableSplitPane.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/CognitiveSummaryPopup.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/CognitiveSummaryPopup.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/CompareHeader.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/CompareHeader.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/LHSSectionRow.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/LHSSectionRow.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/ScrollLockToggle.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/ScrollLockToggle.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/ThreeDotsLoader.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/ThreeDotsLoader.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/connectedLines.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/connectedLines.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useAccordionState.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useAccordionState.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useComparePopups.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useComparePopups.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useDeviationNavigation.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useDeviationNavigation.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useResizeHandler.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useResizeHandler.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useSectionRefs.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useSectionRefs.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useStyles.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useStyles.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/features/ChatDrawer/ChatDrawer.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +2 -0
- package/dist/features/CognitiveCompare/CitationAnchor.js.map +1 -0
- package/dist/features/CognitiveCompare/CitationRenderer.js +2 -0
- package/dist/features/CognitiveCompare/CitationRenderer.js.map +1 -0
- package/dist/features/CognitiveCompare/CognitiveCompare.js +2 -0
- package/dist/features/CognitiveCompare/CognitiveCompare.js.map +1 -0
- package/dist/features/CognitiveCompare/CognitiveCompareConfig.js +2 -0
- package/dist/features/CognitiveCompare/CognitiveCompareConfig.js.map +1 -0
- package/dist/features/CognitiveCompare/CognitiveCompareConstants.js +2 -0
- package/dist/features/CognitiveCompare/CognitiveCompareConstants.js.map +1 -0
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +2 -0
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js.map +1 -0
- package/dist/features/CognitiveCompare/CognitivePopup.js +2 -0
- package/dist/features/CognitiveCompare/CognitivePopup.js.map +1 -0
- package/dist/features/CognitiveCompare/CompareContext.js +2 -0
- package/dist/features/CognitiveCompare/CompareContext.js.map +1 -0
- package/dist/features/CognitiveCompare/LoaderComponent.js +2 -0
- package/dist/features/CognitiveCompare/LoaderComponent.js.map +1 -0
- package/dist/features/CognitiveCompare/MoreFunctionsPopup.js +2 -0
- package/dist/features/CognitiveCompare/MoreFunctionsPopup.js.map +1 -0
- package/dist/features/CognitiveCompare/OverlayComponent.js +2 -0
- package/dist/features/CognitiveCompare/OverlayComponent.js.map +1 -0
- package/dist/features/CognitiveCompare/ResizableSplitPane.js +2 -0
- package/dist/features/CognitiveCompare/ResizableSplitPane.js.map +1 -0
- package/dist/features/CognitiveCompare/components/CognitiveSummaryPopup.js +2 -0
- package/dist/features/CognitiveCompare/components/CognitiveSummaryPopup.js.map +1 -0
- package/dist/features/CognitiveCompare/components/CompareHeader.js +2 -0
- package/dist/features/CognitiveCompare/components/CompareHeader.js.map +1 -0
- package/dist/features/CognitiveCompare/components/LHSSectionRow.js +2 -0
- package/dist/features/CognitiveCompare/components/LHSSectionRow.js.map +1 -0
- package/dist/features/CognitiveCompare/components/RHSSectionRow.js +2 -0
- package/dist/features/CognitiveCompare/components/RHSSectionRow.js.map +1 -0
- package/dist/features/CognitiveCompare/components/ScrollLockToggle.js +2 -0
- package/dist/features/CognitiveCompare/components/ScrollLockToggle.js.map +1 -0
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +2 -0
- package/dist/features/CognitiveCompare/components/SectionAccordion.js.map +1 -0
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +2 -0
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js.map +1 -0
- package/dist/features/CognitiveCompare/components/SvgConnectors.js +2 -0
- package/dist/features/CognitiveCompare/components/SvgConnectors.js.map +1 -0
- package/dist/features/CognitiveCompare/components/ThreeDotsLoader.js +2 -0
- package/dist/features/CognitiveCompare/components/ThreeDotsLoader.js.map +1 -0
- package/dist/features/CognitiveCompare/components/connectedLines.js +2 -0
- package/dist/features/CognitiveCompare/components/connectedLines.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +2 -0
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useAccordionState.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useAccordionState.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useCompareData.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useCompareData.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useComparePopups.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useComparePopups.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useDeviationNavigation.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useDeviationNavigation.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useResizeHandler.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useResizeHandler.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useSectionRefs.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useSectionRefs.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useStyles.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useStyles.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/types/src/CognitiveCompareTest.d.ts +3 -0
- package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -0
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/assests/svg/PdfViewerIcons.d.ts +1 -0
- package/dist/types/src/assests/svg/PdfViewerIcons.d.ts.map +1 -1
- package/dist/types/src/assests/svg/SparkleIcon.d.ts +3 -0
- package/dist/types/src/assests/svg/SparkleIcon.d.ts.map +1 -0
- package/dist/types/src/features/ChatDrawer/ChatDrawer.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts +27 -0
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts +11 -0
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareConfig.d.ts +64 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareConfig.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts +11 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +282 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +63 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts +7 -0
- package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +67 -0
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/LoaderComponent.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/LoaderComponent.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts +17 -0
- package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/OverlayComponent.d.ts +5 -0
- package/dist/types/src/features/CognitiveCompare/OverlayComponent.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/ResizableSplitPane.d.ts +9 -0
- package/dist/types/src/features/CognitiveCompare/ResizableSplitPane.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/CognitiveSummaryPopup.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/components/CognitiveSummaryPopup.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/CompareHeader.d.ts +12 -0
- package/dist/types/src/features/CognitiveCompare/components/CompareHeader.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/LHSSectionRow.d.ts +9 -0
- package/dist/types/src/features/CognitiveCompare/components/LHSSectionRow.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts +9 -0
- package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/ScrollLockToggle.d.ts +11 -0
- package/dist/types/src/features/CognitiveCompare/components/ScrollLockToggle.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts +17 -0
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts +13 -0
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts +36 -0
- package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/ThreeDotsLoader.d.ts +8 -0
- package/dist/types/src/features/CognitiveCompare/components/ThreeDotsLoader.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts +8 -0
- package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts +13 -0
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useAccordionState.d.ts +32 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useAccordionState.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +13 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +24 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useComparePopups.d.ts +22 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useComparePopups.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useDeviationNavigation.d.ts +32 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useDeviationNavigation.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts +27 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useResizeHandler.d.ts +5 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useResizeHandler.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useSectionRefs.d.ts +19 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useSectionRefs.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts +35 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useStyles.d.ts +15 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useStyles.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as n,jsx as e}from"react/jsx-runtime";import{ChevronUp as l,ChevronDown as o}from"lucide-react";import{useState as t}from"react";import r from"./ResizableSplitPane.js";import d from"../PdfViewer/PdfViewer.js";import{DefaultFullScreenCloseIcon as a,DefaultFullScreenIcon as u}from"../../assests/svg/PdfViewerIcons.js";var s=function(n){var l,o,t,a,u,s,c,p,g,v,h,f=n.href,m=n.metaData,x=n.citationTitle,b=n.isFullscreen,_=function(i){try{return new URL(i,window.location.origin).searchParams.get("citationNumber")}catch(i){return null}}(f);if(!_)return null;var y=(null===(l=null==m?void 0:m.citations)||void 0===l?void 0:l[_])||{},w=(null===(o=null==m?void 0:m.docData)||void 0===o?void 0:o.documents)||{},C=(null===(t=null==m?void 0:m.docData)||void 0===t?void 0:t.input_index_map)||{},P=null==C?void 0:C[0],F=null==C?void 0:C[1],S=P?w[P]:null,D=F?w[F]:null,k=P?y[P]:null,j=F?y[F]:null;if(["contract","clause"].includes(x)){var z=k?e(d,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:S.title,pdfUrl:S.signed_url,highlightText:[null!==(a=null==k?void 0:k.highlighted_text)&&void 0!==a?a:""],highlightPages:{1:null===(u=null==k?void 0:k.custom_metadata)||void 0===u?void 0:u.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(s=null==k?void 0:k.custom_metadata)||void 0===s?void 0:s.pdf_start_page_number,null===(c=null==k?void 0:k.custom_metadata)||void 0===c?void 0:c.pdf_end_page_number]}):null,R=j?e(d,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:D.title,pdfUrl:D.signed_url,jumpToPageValue:1,highlightText:[null!==(p=null==j?void 0:j.highlighted_text)&&void 0!==p?p:""],highlightPages:{1:null===(g=null==j?void 0:j.custom_metadata)||void 0===g?void 0:g.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(v=null==j?void 0:j.custom_metadata)||void 0===v?void 0:v.pdf_start_page_number,null===(h=null==j?void 0:j.custom_metadata)||void 0===h?void 0:h.pdf_end_page_number]}):null;return e("div",k||j?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:e(r,{leftComponent:z,rightComponent:R,isFullscreen:b})}):{children:"Missing PDF Citation. Please try again later"})}return e("div",{children:"No Citation Found. Please try again later"})},c=function(r){var d,c,p,g=r.href,v=r.children,h=r.metaData,f=r.chevronUpComponent,m=void 0===f?null:f,x=r.chevronDownComponent,b=void 0===x?null:x,_=r.customStyle,y=void 0===_?{}:_,w=r.defaultState,C=t(void 0!==w&&w),P=C[0],F=C[1],S=t(!1),D=S[0],k=S[1],j="string"==typeof v&&(null===(d=null==v?void 0:v.split("\n"))||void 0===d?void 0:d.length)>1?v.split("\n").join(" "):v,z="string"==typeof v?v:v[0],R=null!=m?m:function(i){var n,o;return e(l,{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!==(c=null==y?void 0:y.arrow)&&void 0!==c?c:{}),T=null!=b?b:function(i){var n,l;return e(o,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(l=null==i?void 0:i.color)&&void 0!==l?l:"rgb(214, 51, 132)"})}(null!==(p=null==y?void 0:y.arrow)&&void 0!==p?p:{});return n("span",i({style:i({display:"inline"},y.relativeWrapper||{})},{children:[e("div",i({style:i({display:"inline",marginTop:0},y.citationButtonWrapper||{})},{children:n("button",i({type:"button",onClick:function(){return F(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"},y.citationButton||{})},{children:[e("span",{children:j}),e("span",i({style:{display:"flex",alignItems:"center"}},{children:P?R:T}))]}))})),P&&n("div",i({style:D?{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(){k(function(i){return!i})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:e(D?a:u,{})}))})),e("div",i({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:e(s,{href:g,children:v,metaData:h,citationTitle:z,isFullscreen:D})}))]}))]}))};export{c as default};
|
|
2
|
+
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CitationAnchor.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as i,jsxs as r}from"react/jsx-runtime";import{useMemo as t}from"react";import{Box as e,Typography as n}from"@mui/material";import c from"react-markdown";import d from"./CitationAnchor.js";function l(l){var a=l.content,m=void 0===a?"":a,p=l.title,s=void 0===p?"":p,f=l.citations,x=void 0===f?{}:f,h=l.styles,u=void 0===h?{}:h,v=l.docData,D=void 0===v?{}:v,b=l.open,y=t(function(){return{a:function(o){var r=o.href,t=void 0===r?"":r,e=o.children;return i(d,{href:t,children:e,metaData:{citations:x,docData:D}})}}},[b,x,D]);return r(e,o({sx:{borderRadius:"8px",border:"1px solid #E4E7EC",bgcolor:"#FCFCFD"}},{children:[i(e,o({sx:{px:1.5,py:.75,borderBottom:"1px solid #EAECF0"}},{children:i(n,o({sx:{fontSize:"15px",fontWeight:600,color:"#344054",lineHeight:1.25}},{children:s}))})),i(e,o({sx:{px:1.5,py:1.1,display:"flex",flexDirection:"column",gap:.95}},{children:i(e,o({sx:{display:"flex",flexDirection:"column"}},{children:i(n,o({component:"div",sx:o({},u)},{children:i(c,o({components:y},{children:m}))}))}))}))]}))}export{l as default};
|
|
2
|
+
//# sourceMappingURL=CitationRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CitationRenderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e,__spreadArray as n}from"tslib";import{jsx as i,jsxs as t}from"react/jsx-runtime";import{useState as o,useRef as r,useMemo as l,useEffect as u,useCallback as c}from"react";import{Box as a,Snackbar as s,Alert as d,Tooltip as v,Typography as f}from"@mui/material";import{ChevronDown as p}from"lucide-react";import{ButtonCognitiveIcon as g}from"../../assests/svg/ButtonCognitiveIcon.js";import m from"./OverlayComponent.js";import{safeStringify as h,extractDeviationScore as S,generateColorPalette as x,findKeyPathByNodeId as R,DEVIATION_BADGE_SEPARATOR as y,hasMeaningfulRedlineTags as b,scrollAndHighlightClause as C}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as w,DEFAULT_FIELD_CONFIG as _,DEFAULT_COMPARISON_CONFIG as B}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as F,EMPTY_SUMMARY_POPUP_STATE as E,DEFAULT_COMPONENT_HEADER_TEXT as I}from"./CognitiveCompareConstants.js";import T from"./CognitivePopup.js";import A from"./MoreFunctionsPopup.js";import D from"./LoaderComponent.js";import k from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as O}from"./hooks/useCompareData.js";import{useComparePopups as j}from"./hooks/useComparePopups.js";import{useSectionRefs as L}from"./hooks/useSectionRefs.js";import{useAccordionState as P}from"./hooks/useAccordionState.js";import{useDeviationNavigation as N}from"./hooks/useDeviationNavigation.js";import z from"./components/CompareHeader.js";import H from"./components/SubSectionAccordion.js";import M from"./components/LHSSectionRow.js";import q from"./components/RHSSectionRow.js";import W from"./components/CognitiveSummaryPopup.js";import{CompareContextProvider as V}from"./CompareContext.js";import{useStyleHelpers as K}from"./hooks/useStyles.js";import{useResizeHandler as Y}from"./hooks/useResizeHandler.js";import{useLinesCalculator as J}from"./hooks/useLinesCalculator.js";import{useSideBySide as X}from"./hooks/useSideBySide.js";import $ from"./components/SvgConnectors.js";var U=function(U){var G,Q,Z,ee,ne,ie,te,oe,re,le,ue,ce,ae,se,de,ve,fe,pe,ge,me,he,Se,xe,Re,ye,be,Ce,we,_e,Be,Fe,Ee,Ie,Te,Ae,De=U.componentHeaderText,ke=void 0===De?I:De,Oe=U.treeData,je=U.comparisonConfig,Le=U.leftColumnTitleText,Pe=U.rightColumnTitleText,Ne=U.markdownStyles,ze=U.resetTrigger,He=U.displayConfig,Me=void 0===He?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0}:He,qe=U.popupConfig,We=U.deviationData,Ve=void 0===We?{}:We,Ke=U.deviationNodeIdToView,Ye=U.resetDeviationNodeId,Je=U.isProposingFix,Xe=void 0!==Je&&Je,$e=U.proposingFixNodeId,Ue=U.isRedlineFlow,Ge=o(Me.maintainRelativeOrder),Qe=Ge[0],Ze=Ge[1],en=null!==(G=null==Me?void 0:Me.expandLevels)&&void 0!==G?G:0,nn=!!(null==Me?void 0:Me.expandAllSections),tn=!!Qe||!!(null==Me?void 0:Me.showDeviationBadges),on=o(!1),rn=on[0],ln=on[1],un=o(null),cn=un[0],an=un[1],sn=o(null===(Z=null!==(Q=null==Oe?void 0:Oe.newEvaluationResult)&&void 0!==Q?Q:null==Me?void 0:Me.enableDeviationSchemaBackwardCompatibility)||void 0===Z||Z)[0],dn=o(new Set),vn=dn[0],fn=dn[1],pn=o([]),gn=pn[0],mn=pn[1],hn=o(!1),Sn=hn[0],xn=hn[1],Rn=r(null),yn=r(null),bn=r(null),Cn=r(null),wn=r(null),_n=r(!1),Bn=r(null),Fn=r({}),En=r([]),In=r(function(){}),Tn=r(null),An=r(function(){}),Dn=l(function(){return JSON.stringify(Ve||{})},[JSON.stringify(Ve)]),kn=l(function(){return Ve||{}},[Dn]),On=l(function(){return(null==Oe?void 0:Oe.cognitive_decisioning)||{}},[Oe]),jn=l(function(){return e(e({},w),Ne)},[Ne]),Ln=r(null),Pn=r(null),Nn=r(null),zn=r(null),Hn=r(null),Mn=r(null),qn=r(null),Wn=r(null),Vn=r(null),Kn=r(null),Yn=j(Ln),Jn=Yn.cognitivePopup,Xn=Yn.setCognitivePopup,$n=Yn.moreFunctions,Un=Yn.setMoreFunctions,Gn=Yn.position,Qn=Yn.setPosition,Zn=Yn.activeBadgeId,ei=Yn.summaryPopup,ni=Yn.setSummaryPopup,ii=Yn.closeSummaryPopup,ti=Yn.setActiveBadgeId,oi=Yn.popupRef,ri=Yn.handleOpenCognitiveCompare,li=Yn.openCognitivePopupFromState,ui=Yn.closeCognitivePopup,ci=Yn.closeMoreFunctionsPopup,ai=l(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==je?void 0:je.fields)&&void 0!==e?e:_,thresholds:{high:null!==(i=null===(n=null==je?void 0:je.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:B.thresholds.high,medium:null!==(o=null===(t=null==je?void 0:je.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:B.thresholds.medium,exact:null!==(l=null===(r=null==je?void 0:je.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:B.thresholds.exact}}},[je]),si=o(null),di=si[0];si[1];var vi=null===(ie=null===(ee=null==Oe?void 0:Oe.documents)||void 0===ee?void 0:ee[null===(ne=null==Oe?void 0:Oe.input_index_map)||void 0===ne?void 0:ne[0]])||void 0===ie?void 0:ie.title,fi=null===(re=null===(te=null==Oe?void 0:Oe.documents)||void 0===te?void 0:te[null===(oe=null==Oe?void 0:Oe.input_index_map)||void 0===oe?void 0:oe[1]])||void 0===re?void 0:re.title,pi=h(Le||vi||"Uploaded Contract"),gi=null===(ae=null===(ce=null===(le=null==Oe?void 0:Oe.documents)||void 0===le?void 0:le[null===(ue=null==Oe?void 0:Oe.input_index_map)||void 0===ue?void 0:ue[0]])||void 0===ce?void 0:ce.metadata)||void 0===ae?void 0:ae.file_name,mi=h(gi),hi=null===(fe=null===(ve=null===(se=null==Oe?void 0:Oe.documents)||void 0===se?void 0:se[null===(de=null==Oe?void 0:Oe.input_index_map)||void 0===de?void 0:de[1]])||void 0===ve?void 0:ve.metadata)||void 0===fe?void 0:fe.file_name,Si=h(hi),xi=h(Pe||fi||"Reference Template"),Ri=O(Oe,Qe,kn,ai,sn),yi=Ri.activeProposed,bi=Ri.existingRule,Ci=Ri.proposedSections,wi=Ri.existingSections,_i=Ri.visibleFields,Bi=Ri.parentDeviationRecord,Fi=Ri.deviationNumberRegistry,Ei=Ri.parseError;u(function(){Ei&&an("Failed to load comparison: ".concat(Ei))},[Ei]);var Ii=Ci.length>0||wi.length>0,Ti=l(function(){if(!Ue)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)||"";b(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(Ci),i(wi),"".concat(e,":").concat(n)},[Ue,Ci,wi]);u(function(){if(Ci.length||wi.length)if(nn){var e={},n={},i=function(i,t){i.forEach(function(i,o){var r,l=Qe?"".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(Ci,"left"),i(wi,"right"),dt(e),ft(n)}else if(en>0){var t={},o={},r=function(e,n,i){e.forEach(function(e,r){var l;if(i>=1){var u=Qe?"".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(Ci,"left",en),r(wi,"right",en),dt(t),ft(o)}},[nn,en,Ci,wi,Qe]);var Ai=L(_i.map(function(e){return e.key}),Math.max(Ci.length,wi.length)),Di=Ai.leftRefs,ki=Ai.rightRefs,Oi=Ai.sectionLeftRefs,ji=Ai.sectionRightRefs,Li=Ai.lhsBadgeRefs,Pi=Ai.rhsBadgeRefs,Ni=Ai.sectionRightRowRefs,zi=Ai.subSectionLeftRefs,Hi=Ai.subSectionRightRefs,Mi=Ai.sectionRowRefs,qi=Ai.getSectionRowRef,Wi=Ai.getSubSectionRef,Vi=Ai.getBadgeRef,Ki=X({maintainRelativeOrder:Qe,proposedSections:Ci,existingSections:wi,leftContainerRef:Wn,rightContainerRef:Nn,scrollContainerRef:Ln,sectionLeftRefs:Oi,sectionRightRefs:ji,subSectionLeftRefs:zi,subSectionRightRefs:Hi,lhsBadgeRefs:Li,rhsBadgeRefs:Pi,sectionRowRefs:Mi,sectionRightRowRefs:Ni,rhsTopSpacerRef:zn,rhsBottomSpacerRef:Hn,lhsTopSpacerRef:Mn,lhsBottomSpacerRef:qn,calculateLinesRef:In,setConnectedSections:fn,setConnectedLines:mn,cachedConnectedPositions:En,closeMoreFunctionsPopup:ci,setErrorToast:an,moreFunctions:$n,closeSummaryPopup:ii}),Yi=Ki.isSideBySide,Ji=Ki.isArrowVisible,Xi=Ki.setIsArrowVisible,$i=Ki.isResizing,Ui=Ki.setIsResizing,Gi=Ki.isSideBySideLoading,Qi=Ki.activeSideBySideSection,Zi=Ki.scrollLock,et=Ki.sideBySideCacheRef,nt=Ki.isSideBySideRef,it=Ki.activeSideBySideRightSectionRef,tt=Ki.activeSideBySideSectionRef,ot=Ki.sideBySideLineRef,rt=Ki.highlightedClauseRefs,lt=Ki.clearClauseHighlight,ut=Ki.resetSideBySide,ct=Ki.activateSideBySide,at=P({maintainRelativeOrder:!!Qe,proposedSections:Ci,existingSections:wi,activeSideBySideSection:Qi,connectedSections:vn,resetSideBySide:ut,setConnectedSections:fn,setConnectedLines:mn,cachedConnectedPositions:En,svgContainerRef:Rn,isAnimatingRef:_n,animationTimerRef:Bn,calculateLinesRef:In,sectionLeftRefs:Oi,sectionRightRefs:ji,subSectionLeftRefs:zi,subSectionRightRefs:Hi}),st=at.expandedSections,dt=at.setExpandedSections,vt=at.expandedSubSections,ft=at.setExpandedSubSections,pt=at.handleSubSectionToggle,gt=at.toggleSection,mt=at.forceExpandCrossWiredSections,ht=function(){var e,n;if(null!=Qi){var i=null===(e=Oi.current[Qi])||void 0===e?void 0:e.current,t=null===(n=ji.current[Qi])||void 0===n?void 0:n.current,o=Nn.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"})}}},St=c(function(e){null==e||e.stopPropagation(),xn(function(e){var n=!e;return n&&requestAnimationFrame(function(){ht()}),n})},[ht]);u(function(){Ue&&"off"!==Ti&&"0:0"!==Ti&&(et.current=null,En.current=[],requestAnimationFrame(function(){var e;null===(e=In.current)||void 0===e||e.call(In)}))},[Ue,Ti]);var xt=l(function(){var e=new Map,n=new Map,i=1;if(Qe)Ci.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),wi.forEach(function(t){if(t.id){var o=Ci.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(Ci.length,wi.length),o=0;o<t;o++){var r=Ci[o],l=wi[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}},[Ci,wi,Qe]),Rt=bi.analysis,yt=h(null===(ge=null===(pe=null==Rt?void 0:Rt.rule_difference_comparison)||void 0===pe?void 0:pe.summary)||void 0===ge?void 0:ge.overall_summary),bt=!!yt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Ct=null!==(me=null==Oe?void 0:Oe.base_root_id)&&void 0!==me?me:"-1";null==Oe||Oe[Ct];var wt=sn?null!==(Ee=null!==(_e=Ve&&(null===(we=null==Ve?void 0:Ve[Ct])||void 0===we?void 0:we.evaluation_result))&&void 0!==_e?_e:null===(Fe=null===(Be=null==Oe?void 0:Oe.nodes)||void 0===Be?void 0:Be[Ct])||void 0===Fe?void 0:Fe.evaluation_result)&&void 0!==Ee?Ee:null:null!==(Ce=null!==(xe=Ve&&(null===(Se=null===(he=null==Ve?void 0:Ve[Ct])||void 0===he?void 0:he.evaluation_result)||void 0===Se?void 0:Se[0]))&&void 0!==xe?xe:null===(be=null===(ye=null===(Re=null==Oe?void 0:Oe.nodes)||void 0===Re?void 0:Re[Ct])||void 0===ye?void 0:ye.evaluation_result)||void 0===be?void 0:be[0])&&void 0!==Ce?Ce:null,_t=S(wt),Bt=x(null!==(Ae=null===(Te=null===(Ie=null==wt?void 0:wt.evaluation_outputs)||void 0===Ie?void 0:Ie.metadata)||void 0===Te?void 0:Te.label_color)&&void 0!==Ae?Ae:F),Ft=r(ut);u(function(){Ft.current=ut},[ut]);var Et=r(ui);u(function(){Et.current=ui},[ui]);var It=c(function(e,n,i,t,o,r){return Ao.current(e,n,i,t,o,r)},[]),Tt=c(function(e,n,i,t,o){return Do.current(e,n,i,t,o)},[]),At=c(function(){return ko.current()},[]),Dt=c(function(e,n){return Oo.current(e,n)},[]),kt=c(function(e){return jo.current(e)},[]),Ot=c(function(e){return Lo.current(e)},[]),jt=c(function(){return Po.current()},[]),Lt=c(function(){var e,n;lt(),null===(e=Ft.current)||void 0===e||e.call(Ft),xn(!1),fn(new Set),mn([]),En.current=[],Qt([]),eo(null),ni(E),null===(n=Et.current)||void 0===n||n.call(Et),requestAnimationFrame(function(){var e;null===(e=In.current)||void 0===e||e.call(In)})},[]),Pt=r(Lt);u(function(){Pt.current=Lt},[Lt]),u(function(){ze&&Pt.current()},[ze]);var Nt=c(function(n,i,t,o,r,l,u){var c,a,s,d=h(null==i?void 0:i.id)||h(null==t?void 0:t.id)||"",v=(d?On[d]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:d,decisioning:[],gap:[],relevance_score:0},f=null!==(a=null===(c=Mi.current[o])||void 0===c?void 0:c.current)&&void 0!==a?a:null;return{isLoading:null!==(s=null==Me?void 0:Me.isLoading)&&void 0!==s&&s,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:v,anchorEl:n,sectionAnchorEl:f,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==Oe?void 0:Oe.documents,input_index_map:null==Oe?void 0:Oe.input_index_map},deviationData: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(y)))return u(l);var c=o.split(y)[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)}(),isOrphan:!!r}},[On,Oe]),zt=c(function(e,n,i,t,o,r){var l;if(e.stopPropagation(),$n.open&&$n.sectionIdx===o)ci();else{var u=e.currentTarget,c="left";(null===(l=Nn.current)||void 0===l?void 0:l.contains(u))&&(c="right");lt(),nt.current&&ut(),fn(new Set),mn([]),En.current=[],ui(),ei.open?vo():ii(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(y)){var r=o.split(y),l="".concat(r[0]).concat(y).concat(r[1]);return"right"===c?null===(e=Pi.current[l])||void 0===e?void 0:e.current:null===(n=Li.current[l])||void 0===n?void 0:n.current}return"right"===c?null===(i=Pi.current[o])||void 0===i?void 0:i.current:null===(t=Li.current[o])||void 0===t?void 0:t.current}()||u;Un(Nt(e,n,t,o,i,r))})}},[$n.open,$n.sectionIdx,ci,ii,Nt]),Ht=c(function(){var e=$n.sectionIdx,n=$n.isOrphan;ci(),ii(),null!==e&&(n?an("No counterpart exists to connect to."):(mt(e),lt(),nt.current&&ut(),mn([]),En.current=[],fn(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){In.current&&In.current()},50)))},[$n.sectionIdx,$n.isOrphan,ci,ii,ut]),Mt=c(function(){var e=wn.current;if(e){wn.current=null;var n=Ci.findIndex(function(n){return n.id===e}),i=wi.findIndex(function(n){return n.id===e}),t=-1===n?R(Ci,e):null,o=-1===i?R(wi,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?(rt.current.add(r),C(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(Qe)-1!==r&&Wn.current&&c(function(){return u(n,t,Oi,zi)},Wn.current),-1!==l&&Nn.current&&c(function(){return u(i,o,ji,Hi)},Nn.current);else{var a=Ln.current;if(!a)return;c(function(){return-1!==r?u(n,t,Oi,zi):u(i,o,ji,Hi)},a)}}},[Ci,wi,Qe,Oi,ji,zi,Hi,Wn,Nn,Ln]),qt=c(function(n){if(n){lt(),ut(),fn(new Set),mn([]),En.current=[],ii(),ui();var i=Ci.findIndex(function(e){return e.id===n}),t=wi.findIndex(function(e){return e.id===n}),o=-1===i?R(Ci,n):null,r=-1===t?R(wi,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;wn.current=n,dt(function(n){var i,t=e({},n),o=!1;-1!==l&&(t[i=Qe?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=Qe?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),ft(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(){wn.current===n&&Wt.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[Ci,wi,Qe,dt,ft,ut,ii,ui]),Wt=r(Mt);u(function(){Wt.current=Mt},[Mt]);var Vt=r(null);u(function(){if(di){var e=ai.fields.find(function(e){return e.analysisKey===di||e.key===di});if(e){var n=Di.current[e.key]||ki.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[di,ai.fields]);var Kt=c(function(e){var n,i,t,o,r,l,u,c,a,s=null===(n=null==Rt?void 0:Rt.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}},[Rt]),Yt=K({proposedSections:Ci,existingSections:wi,maintainRelativeOrder:Qe,cognitiveMap:On,deviationData:Ve,treeData:Oe,resolvedComparisonConfig:ai}),Jt=Yt.getSectionCompareStyle,Xt=Yt.getSubSectionCompareStyle,$t=Yt.getDeviationStyleByKey,Ut=J({containerRef:yn,leftContainerRef:Wn,rightContainerRef:Nn,svgContainerRef:Rn,pathRefs:Fn,leftHeaderRef:bn,rightHeaderRef:Cn,proposedSections:Ci,existingSections:wi,visibleFields:_i,leftRefs:Di,rightRefs:ki,sectionLeftRefs:Oi,sectionRightRefs:ji,subSectionLeftRefs:zi,subSectionRightRefs:Hi,lhsBadgeRefs:Li,rhsBadgeRefs:Pi,sectionRowRefs:Mi,expandedSections:st,expandedSubSections:vt,connectedSections:vn,isSideBySide:Yi,activeSideBySideSection:Qi,maintainRelativeOrder:Qe,cognitiveMap:On,getSectionCompareStyle:Jt,getSubSectionCompareStyle:Xt,getDeviationStyleByKey:$t,isArrowVisible:Ji,isAnimatingRef:_n,isSideBySideRef:nt,sideBySideCacheRef:et,sideBySideLineRef:ot,activeSideBySideSectionRef:tt,activeSideBySideRightSectionRef:it,connectedLines:gn,setConnectedLines:mn,cachedConnectedPositions:En,calculateLinesRef:In,resizeTimerRef:Tn,scrollLock:Zi,scrollSyncLocked:Sn,handleResizeRef:An,activeProposed:yi,existingRule:bi,analysisData:Rt,pendingScrollTargetRef:Vn,pendingScrollCallbackRef:Kn,resolvedComparisonConfig:ai,getFieldData:Kt}),Gt=Ut.lines,Qt=Ut.setLines,Zt=Ut.overallConnector,eo=Ut.setOverallConnector,no=Ut.svgDimensions,io=Ut.handleColumnScroll;u(function(){ei.anchorEl&&requestAnimationFrame(function(){requestAnimationFrame(function(){var e;null===(e=In.current)||void 0===e||e.call(In)})})},[ei.anchorEl,Sn]);var to=c(function(){lt(),xn(!1),dt({}),ft({}),ut(),fn(new Set),mn([]),En.current=[],ii(),ui(),ci(),requestAnimationFrame(function(){In.current&&In.current()})},[dt,ft,ut,ii,ui,ci]);u(function(){Yi||0!==vn.size||xn(!1)},[Yi,vn]);var oo=l(function(){return Object.values(st).some(Boolean)||Object.values(vt).some(Boolean)},[st,vt]),ro=r(null),lo=r(0),uo=r(0),co=r(0),ao=Y({timerRef:ro,ruleComponentRef:Pn,scrollContainerRef:Ln,containerRef:yn,maintainRelativeOrder:Qe,proposedSections:Ci,existingSections:wi,isSideBySideRef:nt,activeSideBySideSectionRef:tt,activeSideBySideRightSectionRef:it,sectionRowRefs:Mi,sectionRightRowRefs:Ni,sectionLeftRefs:Oi,sectionRightRefs:ji,subSectionLeftRefs:zi,subSectionRightRefs:Hi,lhsBadgeRefs:Li,rhsBadgeRefs:Pi,leftContainerRef:Wn,rightContainerRef:Nn,calculateLinesRef:In,handleResizeRef:An,setIsResizing:Ui,setIsArrowVisible:Xi,sideBySideCacheRef:et,cachedConnectedPositions:En}).handleResize;u(function(){An.current=ao},[ao,An]),u(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 Pn.current&&o.push(e(Pn.current,lo,n,function(){return An.current()},function(){})),Ln.current&&o.push(e(Ln.current,uo,i,function(){return An.current()},function(){return In.current()})),yn.current&&o.push(e(yn.current,co,t,function(){return An.current()},function(){return In.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),u(function(){nt.current=Yi},[Yi]),u(function(){tt.current=Qi},[Qi]);var so=c(function(){var e,n=$n.sectionIdx,i=$n.isOrphan;if(ii(),null!=n){var t="left";$n.anchorEl&&(null===(e=Nn.current)||void 0===e?void 0:e.contains($n.anchorEl))&&(t="right"),mt(n),ct(n,i,{sourceSide:t})}},[ct,$n.isOrphan,$n.sectionIdx,$n.anchorEl,ii]),vo=c(function(){ii(),ut(),fn(new Set),mn([]),En.current=[]},[ii,ut]),fo=null!==$n.sectionIdx&&vn.has($n.sectionIdx),po=N({proposedSections:Ci,existingSections:wi,parentDeviationRecord:Bi,expandedSections:st,maintainRelativeOrder:!!Qe,scrollContainerRef:Ln,leftContainerRef:Wn,rightContainerRef:Nn,lhsBadgeRefs:Li,rhsBadgeRefs:Pi}),go=po.showDeviationNavigation,mo=po.showOpenNodeRef,ho=po.adjustScrollForPopup,So=c(function(e,n,i,t,o){var r,l="string"==typeof t?h(t).trim():h(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;ui();var c="left";(null===(r=Nn.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(y)){var r=n.split(y),l="".concat(r[0]).concat(y).concat(r[1]);return"right"===c?null===(e=Pi.current[l])||void 0===e?void 0:e.current:null===(i=Li.current[l])||void 0===i?void 0:i.current}return"right"===c?null===(t=Pi.current[n])||void 0===t?void 0:t.current:null===(o=Li.current[n])||void 0===o?void 0:o.current};if(i)return ut(),fn(new Set),mn([]),En.current=[],void(l&&(mt(n),requestAnimationFrame(function(){var e=a()||u;ni({open:!0,anchorEl:e,summary:t,displayImpact:o})})));mt(n),l?requestAnimationFrame(function(){ct(n,i,{toggleIfSame:!1,sourceSide:c,onReady:function(){var e=a()||u;ni({open:!0,anchorEl:e,summary:t,displayImpact:o})}})}):requestAnimationFrame(function(){ct(n,i,{toggleIfSame:!1,sourceSide:c})})},[ct,ui,ni,ut,mt]),xo=l(function(){var e;if(!Ke)return null;var n=null===(e=null==Ke?void 0:Ke.id)||void 0===e?void 0:e.split(":")[0];for(var i in Bi){if((Bi[i]||[]).some(function(e){return e.id===n}))return i}return null},[Ke,Bi]),Ro=r({id:null,triggerMs:null}),yo=r(null);u(function(){var i;if(null==Ke?void 0:Ke.id){var t=Number(Ke.trigger),o=Ro.current;if((null==o?void 0:o.triggerMs)!==t){if(!(Ke.id.includes(":")&&/:\d+$/.test(Ke.id)))return Ro.current={id:Ke.id,triggerMs:t},void qt(Ke.id);var r=null===(i=null==Ke?void 0:Ke.id)||void 0===i?void 0:i.split(":"),l=r[0],u=r[1],c=null!=u?u:"0";yo.current!==Ke.id&&(ii(),ui(),ut(),fn(new Set),mn([]),En.current=[],yo.current=Ke.id);var a=!1,s=0,d=null,v=150,f=function(e,n){for(var i=function(e,t){if(!e)return null;if(e.id===n)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},p=function(){var i,o,r,u;if(!a){var g=function(){Ro.current={id:Ke.id,triggerMs:t}},m=null,h=null;for(var S in Bi){var x=Bi[S].find(function(e){return e.id===l});if(x){m=S,h=x;break}}if(h&&m){var R=Ci.findIndex(function(e){return e.id===m}),b=wi.findIndex(function(e){return e.id===m}),C=-1===R&&-1!==b,w=f(Ci,h.id),_=f(wi,h.id);if(w&&!_&&!C){var B=w.split("-"),F=Number(B[0]);if(Qe){var E=null===(o=null===(i=Ci[F])||void 0===i?void 0:i.refIndexes)||void 0===o?void 0:o[0],I=wi.findIndex(function(e){return e.selfIndex===E});-1!==I&&(F=I)}_=n([F],B.slice(1),!0).join("-")}if(w||_){var T=w?Number(w.split("-")[0]):R,A=_?Number(_.split("-")[0]):b,D=Ci[T],k=wi[A],O=D&&!D.title&&!D.content,j=k&&!k.title&&!k.content,L=C||(!w&&!!_||O&&!j);if(L){if(!(Qe?!!st["right-".concat(A)]:!!st[String(A)])&&A>=0)return gt(A,"right"),s+=1,void(d=setTimeout(p,450))}else if(!(Qe?!!st["left-".concat(T)]:!!st[String(T)])&&T>=0)return gt(T,"left"),s+=1,void(d=setTimeout(p,450));var P,N=w||"",z=_||"",H="".concat(h.id).concat(y).concat(c).concat(y).concat(N).concat(y).concat(z),M="".concat(h.id).concat(y).concat(c),q=null===(r=Li.current[M])||void 0===r?void 0:r.current,W=null===(u=Pi.current[M])||void 0===u?void 0:u.current,V=L||!q&&!!W,K=V?W:q;if(P=Qe?V?Nn.current:Wn.current:Ln.current,K&&P){var Y=K.getBoundingClientRect();if(0===Y.height)return void((s+=1)<2?d=setTimeout(p,v):g());var J=P.getBoundingClientRect(),X=Y.top-J.top+P.scrollTop-J.height/2+Y.height/2,$=w&&w.includes("-")||_&&_.includes("-"),U=function(){var n,i,t,o,r;if(!a){g();var l=K instanceof Element?window.getComputedStyle(K).color:"";q&&(q.style.transition="box-shadow 300ms ease-in-out",q.style.boxShadow="0 0 10px ".concat(l)),W&&(W.style.transition="box-shadow 300ms ease-in-out",W.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){q&&(q.style.boxShadow=""),W&&(W.style.boxShadow="")},2e3);var u=(null===(i=null===(n=h.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===i?void 0:i[c])||h,s=(null===(t=h.evaluationResult)||void 0===t?void 0:t.evaluation_outputs)||h.evaluation_outputs;if(!(!!q&&!!W)){var d=V?(null===(o=Pi.current[$?M:A])||void 0===o?void 0:o.current)||W:(null===(r=Li.current[$?M:T])||void 0===r?void 0:r.current)||q;return ho(d,function(){ni({open:!0,anchorEl:d,displayImpact:Ke.displayImpact,summary:e(e({},u),{evaluation_outputs:s})})},{skipScroll:!0}),void(null==Ye||Ye())}ct(H,!1,{toggleIfSame:!1,sourceSide:C?"right":"left",onReady:function(){var n,i;g();var t=V?(null===(n=Pi.current[M])||void 0===n?void 0:n.current)||W:(null===(i=Li.current[M])||void 0===i?void 0:i.current)||q;ni({open:!0,anchorEl:t,displayImpact:Ke.displayImpact,summary:e({},u)}),null==Ye||Ye()}})}};Math.abs(P.scrollTop-X)<=2?U():(Vn.current=X,Kn.current=U,P.scrollTo({top:X,behavior:"smooth"}),d&&clearTimeout(d),d=setTimeout(function(){if(Kn.current){Vn.current=null;var e=Kn.current;Kn.current=null,e()}},800))}else(s+=1)<2?d=setTimeout(p,v):g()}else(s+=1)<2?d=setTimeout(p,v):g()}else(s+=1)<2?d=setTimeout(p,v):g()}};return d=setTimeout(p,v),function(){a=!0,d&&clearTimeout(d)}}}},[Ke,Bi,Ci,wi,Qe,st,gt,ct,ni,qt]),u(function(){var n,i,t;if(ei.open){var o=ei.anchorEl;if(o&&!o.isConnected){var r=(null===(n=o.dataset)||void 0===n?void 0:n.deviationRefId)||Object.keys(Li.current).find(function(e){var n,i;return(null===(i=null===(n=Li.current[e])||void 0===n?void 0:n.current)||void 0===i?void 0:i.textContent)===o.textContent})||Object.keys(Pi.current).find(function(e){var n,i;return(null===(i=null===(n=Pi.current[e])||void 0===n?void 0:n.current)||void 0===i?void 0:i.textContent)===o.textContent});if(r){var l=(null===(i=Pi.current[r])||void 0===i?void 0:i.current)||(null===(t=Li.current[r])||void 0===t?void 0:t.current);l&&l.isConnected&&ni(function(n){return e(e({},n),{anchorEl:l})})}}}},[ei.open,ei.anchorEl,Sn,vn,st]);var bo=Jn.open,Co=Jn.sectionIdx,wo=Jn.isOrphan,_o=Jn.badgeStyle,Bo=Jn.anchorEl,Fo=Jn.sectionAnchorEl;u(function(){var n;if(bo&&null!=Co&&Co!==Ct){var i="string"==typeof Co?Co.split(y)[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(Ci,i):null,r=i&&"string"==typeof i?t(wi,i):null,l="number"==typeof Co?Ci[Co]||null:o||i&&((null===(n=null==Oe?void 0:Oe.nodes)||void 0===n?void 0:n[i])||(null==Oe?void 0:Oe[i]))||null,u="number"==typeof Co?wi[Co]||null:r,c=Nt(Bo,l,u,Co,wo,_o);Xn(function(n){return n.open?n.cognitiveData===c.cognitiveData&&n.deviationData===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})}},[bo,Co,wo,_o,Bo,Fo,Ci,wi,Oe,Ve,Nt]);var Eo=c(function(e){var n=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,u=void 0===l?"left":l,c=e.parentNodeId,a=void 0===c?"":c,s=e.sectionOffset;return i(H,{section:n,keyPath:t,depth:r,columnKey:u,parentNodeId:a,sectionOffset:s})},[]),Io=l(function(){return Ci.map(function(e,n){var t;return i(M,{section:e,idx:n},null!==(t=null==e?void 0:e.id)&&void 0!==t?t:"left-row-".concat(n))})},[Ci]),To=l(function(){return wi.map(function(e,n){var t;return i(q,{section:e,idx:n},null!==(t=null==e?void 0:e.id)&&void 0!==t?t:"right-row-".concat(n))})},[wi]),Ao=r(zt);u(function(){Ao.current=zt},[zt]);var Do=r(So);u(function(){Do.current=So},[So]);var ko=r(vo);u(function(){ko.current=vo},[vo]);var Oo=r(gt);u(function(){Oo.current=gt},[gt]);var jo=r(pt);u(function(){jo.current=pt},[pt]);var Lo=r(Eo);u(function(){Lo.current=Eo},[Eo]);var Po=r(ut);u(function(){Po.current=ut},[ut]);var No=l(function(){return{maintainRelativeOrder:!!Qe,showDeviationBadges:tn,isProposingFix:Xe,proposingFixNodeId:$e,isRedlineFlow:Ue,isSideBySide:Yi,activeSideBySideSection:Qi,scrollSyncLocked:Sn,toggleScrollSyncLocked:St,summaryPopupAnchorEl:ei.anchorEl,connectedSections:vn,proposedSections:Ci,existingSections:wi,deviationNumberRegistry:Fi,treeData:Oe,displayConfig:Me,resolvedMarkdownStyles:jn,unifiedNumbering:xt,expandedSections:st,expandedSubSections:vt,setExpandedSubSections:ft,getSectionCompareStyle:Jt,getSubSectionCompareStyle:Xt,getBadgeRef:Vi,getSectionRowRef:qi,getSubSectionRef:Wi,sectionLeftRefs:Oi,sectionRightRefs:ji,sectionRowRefs:Mi,sectionRightRowRefs:Ni,subSectionLeftRefs:zi,subSectionRightRefs:Hi,lhsBadgeRefs:Li,rhsBadgeRefs:Pi,openMoreFunctionsPopup:It,handleOpenSummaryPopup:Tt,openSummaryPopup:Tt,handleCloseSummaryPopup:At,toggleSection:Dt,handleSubSectionToggle:kt,renderSubSectionAccordion:Ot,resetSideBySide:jt,setConnectedSections:fn,setConnectedLines:mn,cachedConnectedPositions:En,showDeviationNavigation:go,showOpenNodeRef:mo,deviationNodeIdToView:null==Ke?void 0:Ke.id,deviationTargetParentId:xo}},[Qe,tn,Xe,$e,Ue,Yi,Qi,Sn,St,ei.anchorEl,vn,Ci,wi,Fi,Oe,Me,jn,xt,st,vt,ft,Jt,Xt,Vi,qi,Wi,go,mo,Ke,xo]);return i(V,e({value:No},{children:t(a,e({ref:Pn,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},Qe?{}:{overflow:"visible"}),{position:"relative"})},{children:[rn&&i(a,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:i(D,{})})),ei.open&&i(W,{open:ei.open,anchorEl:ei.anchorEl,containerEl:Vt.current,clipTopEl:bn.current,scrollContainerEl:Ln.current,onClose:vo,summary:ei.summary,displayImpact:ei.displayImpact,isScrollLocked:Sn}),i(A,{open:$n.open,anchorEl:$n.anchorEl,maintainRelativeOrder:!!Qe,sectionTitle:$n.sectionTitle,referenceSectionTitle:$n.refSectionTitle,onClose:ci,onOpenCognitiveCompare:ri,onOpenSideBySide:so,onConnect:Ht,isConnected:fo,isOrphan:$n.isOrphan}),Jn.open&&i(T,{open:Jn.open,popupRef:oi,position:Gn,popupConfig:qe,onClose:function(){Qn(null),Xn(function(n){return e(e({},n),{open:!1})}),ti(null)},markdownStyles:Ne,sectionTitle:mi,referenceSectionTitle:Si,cognitiveData:Jn.cognitiveData,anchorEl:Jn.anchorEl,sectionAnchorEl:Jn.sectionAnchorEl,scrollContainerEl:Ln.current,badgeStyle:Jn.badgeStyle,docData:Jn.docData,deviationData:Jn.deviationData,isLoading:Jn.isLoading}),i(s,e({open:!!cn,autoHideDuration:8e3,onClose:function(){return an(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(d,e({onClose:function(){return an(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:cn}))})),i(z,{componentHeaderText:ke,displayConfig:Me,maintainRelativeOrder:Qe,onCollapseAll:to,showCollapseAll:oo,onToggleView:function(e){ln(!0),setTimeout(function(){Ze(!e),xn(!1),ut(),ii(),fn(new Set),mn([]),En.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){ln(!1)},600)})})},50)}}),i(a,e({ref:Ln,onScroll:io,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:Qe?"hidden":"auto",borderTop:yt&&bt?"none":"1.5px solid #EEF0F4"}},{children:i(a,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},Qe?{flex:1,minHeight:0}:{})},{children:t(a,e({ref:yn,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},Qe?{flex:1,overflow:"visible"}:{})},{children:[i($,{svgContainerRef:Rn,svgDimensions:no,isResizing:$i,overallConnector:Zt,rootDeviationStyle:Bt,lines:Gt,isSideBySide:Yi,activeSideBySideSection:Qi,isArrowVisible:Ji,maintainRelativeOrder:Qe,proposedSections:Ci,existingSections:wi,cognitivePopup:Jn,activeBadgeId:Zn,closeCognitivePopup:ui,setActiveBadgeId:ti,openCognitivePopupFromState:li,buildSectionPopupState:Nt,connectedLines:gn,pathRefs:Fn}),t(a,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)"},Qe?{flex:1,overflow:"visible"}:{})},{children:[i(a,e({ref:bn,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:i(v,e({title:pi,placement:"top"},{children:i(f,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:pi}))}))})),t(a,e({ref:Wn,onScroll:io,sx:e({p:"12px",display:"flex",flexDirection:"column"},Qe?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-180px",pr:"192px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:Mn,style:{width:"100%",height:"0px",flexShrink:0}}),Ii&&Io,i("div",{ref:qn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(a,e({ref:Vt,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:i(a,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(a,e({onClick:function(n){n.stopPropagation(),Jn.open&&Zn===Ct?ui():(ti(Ct),li(Nt(n.currentTarget,{title:"",content:"",evaluationResult:wt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Ct,!0,e(e({},Bt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Bt.badgeBg,color:Bt.badgeText,border:"1px solid ".concat(Bt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=_t?_t:i(k,{}),i(a,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(g,{})})),i(p,{size:11,style:{transform:Jn.open&&Zn===Ct?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),t(a,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},Qe?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Gi&&i(m,{sections:11}),i(a,e({ref:Cn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:i(v,e({title:xi,placement:"top"},{children:i(f,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:xi}))}))})),t(a,e({ref:Nn,onScroll:io,sx:e({p:"12px",display:"flex",flexDirection:"column"},Qe?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:zn,style:{width:"100%",height:"0px",flexShrink:0}}),Ii&&To,i("div",{ref:Hn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};export{U as default};
|
|
2
|
+
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CognitiveCompare.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=[{key:"title",label:"Title",analysisKey:"title"},{key:"description",label:"Description",analysisKey:"description"}],i={fields:e,thresholds:{exact:90,high:70,medium:40}},t={fontSize:"13px",color:"#0B0E1A",lineHeight:1.4,wordBreak:"break-word",overflowWrap:"break-word",overflow:"hidden","& p":{mt:0,mb:1.5},"& p:last-child":{mb:0},"& ul":{mt:0,mb:1.5,pl:2.5,listStyleType:"disc"},"& ol":{mt:0,mb:1.5,pl:2.5,listStyleType:"decimal"},"& li":{mb:.5},"& strong":{fontWeight:600},"& code":{whiteSpace:"pre-wrap",wordBreak:"break-word"}},a={tabs:{deviation:{key:"deviation",label:"Deviation Analysis",subtitle:"Why this is a deviation?",placeholderTitle:"Deviation Analysis",placeholderBody:"Deviation analysis content will appear here..."},association:{key:"association",label:"Association Logic",subtitle:"Why these sections are paired?"}},decisionStrengthLabel:"Decision Strength",sectionTitles:{decisioningFactors:"Decision Making Factors",gaps:"Gaps in Decision"},emptyStateMessage:"No cognitive decisioning data available for this section.",accentColor:"#5928ED"};export{i as DEFAULT_COMPARISON_CONFIG,e as DEFAULT_FIELD_CONFIG,a as DEFAULT_POPUP_CONFIG,t as SHARED_MARKDOWN_STYLES};
|
|
2
|
+
//# sourceMappingURL=CognitiveCompareConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CognitiveCompareConfig.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var l="#3730A3",n=12,a=680,o=12,t=10,e="Contract Comparison",i={isLoading:!1,open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,isOrphan:!1,docData:null,deviationData:null},c={open:!1,anchorEl:null,summary:"",markdownStyles:{},displayImpact:!1};export{t as ARROW_SIZE,e as DEFAULT_COMPONENT_HEADER_TEXT,l as DEFAULT_DEVIAION_COLOR,i as EMPTY_SECTION_POPUP_STATE,c as EMPTY_SUMMARY_POPUP_STATE,n as POPUP_GAP,a as POPUP_WIDTH,o as VIEWPORT_MARGIN};
|
|
2
|
+
//# sourceMappingURL=CognitiveCompareConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CognitiveCompareConstants.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{DEFAULT_DEVIAION_COLOR as t}from"./CognitiveCompareConstants.js";var n=function(t){return null==t?"":"string"==typeof t?t:Array.isArray(t)?t.map(n).join("\n\n"):"object"==typeof t?JSON.stringify(t):String(t)},o=function(t){return null!=t&&("string"==typeof t?t.trim().length>0:!Array.isArray(t)||t.length>0&&t.some(function(t){return o(t)}))},e=function(t,o,e){var r,i=e[o],u=null===(r=null==t?void 0:t.comparison_inputs)||void 0===r?void 0:r[i];return{title:n((null==u?void 0:u.title)||""),content:n((null==u?void 0:u.content)||""),change_history:n((null==u?void 0:u.change_history)||""),attributes:(null==u?void 0:u.additional_attributes)||null,subsections:(null==u?void 0:u.subsections)||[]}},r=function(t){if(!t.mapping_rationale)return{cognitiveData:{decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0,citations:[]},score:0,relation:"N/A"};var n=t.mapping_rationale,o=parseInt(n.decision_strength||"0");return{cognitiveData:{decisioning:n.decisioning_factors||[],gap:n.gaps_in_decision||[],relevance_score:o,citations:n.citations},score:0,relation:"N/A"}};function i(t){var n=function(t,n){var o=function(t){var n=function(t){return 4===t.length?"#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]:t}(t).replace("#",""),o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}(t),e=o.r,r=o.g,i=o.b;return function(t,n,o){return"#"+[t,n,o].map(function(t){return t.toString(16).padStart(2,"0")}).join("").toUpperCase()}(Math.round(e+(255-e)*n),Math.round(r+(255-r)*n),Math.round(i+(255-i)*n))};return{bg:n(t,.8),border:n(t,.5),badgeBg:n(t,.8),badgeBorder:n(t,.5),badgeText:t.toUpperCase(),highlightBg:n(t,.8)}}function u(t,n){var o;return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=this;clearTimeout(o),o=setTimeout(function(){return t.apply(i,e)},n)}}var l=function(t,n){var o,e,r,i,u,l;if(t.content!==n.content)return!1;if(t.overlayContent!==n.overlayContent)return!1;if(t.sxStyles!==n.sxStyles)return!1;if(t.maintainRelativeOrder!==n.maintainRelativeOrder)return!1;if(t.highlightBg!==n.highlightBg)return!1;if(t.suppressHighlightBg!==n.suppressHighlightBg)return!1;if(t.collisionKey!==n.collisionKey)return!1;var a=t.highlights||[],s=n.highlights||[];if(a.length!==s.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==s[c])return!1;var v=t.deviationBadges||[],d=n.deviationBadges||[];if(v.length!==d.length)return!1;for(c=0;c<v.length;c++){if(v[c].id!==d[c].id)return!1;if(v[c].actionId!==d[c].actionId)return!1;if(v[c].label!==d[c].label)return!1;if(v[c].score!==d[c].score)return!1;if(v[c].isOrphan!==d[c].isOrphan)return!1;if(v[c].isConnected!==d[c].isConnected)return!1;if(v[c].showScrollLockToggle!==d[c].showScrollLockToggle)return!1;if(v[c].scrollSyncLocked!==d[c].scrollSyncLocked)return!1;if((null===(o=v[c].style)||void 0===o?void 0:o.badgeBg)!==(null===(e=d[c].style)||void 0===e?void 0:e.badgeBg))return!1;if((null===(r=v[c].style)||void 0===r?void 0:r.badgeBorder)!==(null===(i=d[c].style)||void 0===i?void 0:i.badgeBorder))return!1;if((null===(u=v[c].style)||void 0===u?void 0:u.badgeText)!==(null===(l=d[c].style)||void 0===l?void 0:l.badgeText))return!1}return!0},a="::",s=function(t){if(!t)return!0;var n=t.trim().toLowerCase();return n.includes("no equivalent")||"n/a"===n||"na"===n||"none"===n},c=function(t){var n;if("string"!=typeof t||!t)return!1;for(var o=/<(updated|deleted|changed|change)\b[^>]*>([\s\S]*?)<\/\1>/gi,e=null;null!==(e=o.exec(t));){if((null!==(n=e[2])&&void 0!==n?n:"").replace(/<[^>]*>/g,"").trim().length>0)return!0}return!1},v=function(t){return"string"==typeof t&&t?t.replace(/<\/?(updated|deleted|changed|change)\b[^>]*>/gi,""):""},d=function(t,n){var o,e,r,i,u,l,a;if(!t)return n;var s=null!==(l=null!==(i=null!==(e=null===(o=t.evaluation_output)||void 0===o?void 0:o.output_score)&&void 0!==e?e:null===(r=t.evaluation_outputs)||void 0===r?void 0:r.output_score)&&void 0!==i?i:null===(u=t.evaluation_outputs)||void 0===u?void 0:u.output_value)&&void 0!==l?l:t.output_score;return null!==(a=null!=s?s:n)&&void 0!==a?a:""},f=function(t,n,o,e,r){void 0===r&&(r=14);var i=t+.5*(o-t),u=e-n;if(Math.abs(u)<3)return"M ".concat(t," ").concat(n," H ").concat(o);var l=u>0?1:-1,a=Math.min(r,Math.abs(u)/2,Math.abs(i-t)/2,Math.abs(o-i)/2);return["M ".concat(t," ").concat(n),"H ".concat(i-a),"Q ".concat(i," ").concat(n," ").concat(i," ").concat(n+l*a),"V ".concat(e-l*a),"Q ".concat(i," ").concat(e," ").concat(i+a," ").concat(e),"H ".concat(o)].join(" ")},g=function(t,n,o,e,r){void 0===o&&(o=300);var i=t.style.scrollBehavior;t.style.scrollBehavior="auto";var u=t.scrollTop,l=n-u,a=null,s=function(c){null===a&&(a=c);var v,d=c-a;d<o?(t.scrollTop=(v=d,v/=o,l*(--v*v*v+1)+u),r&&r(),requestAnimationFrame(s)):(t.scrollTop=n,t.style.scrollBehavior=i,r&&r(),e&&e())};requestAnimationFrame(s)},p=["#B91C1C","#A16207","#1D4ED8","#000000"],h=function(t){var n=p.findIndex(function(n){return n.toLowerCase()===t.toLowerCase()});return-1===n?p.length:n},b=function(n){for(var o,e,r,i,u,l,a,s,c,v,d,f,g,p=[],b=0,m=Object.keys((null==n?void 0:n.deviations)||{}).sort(function(t,n){return Number(t)-Number(n)});b<m.length;b++){var y=m[b];(C=null===(i=null===(r=null===(e=null===(o=null==n?void 0:n.deviations)||void 0===o?void 0:o[y])||void 0===e?void 0:e.evaluation_outputs)||void 0===r?void 0:r.metadata)||void 0===i?void 0:i.label_color)&&p.push(C)}for(var _=0,B=Object.keys((null==n?void 0:n.deviation_entries)||{}).sort(function(t,n){return Number(t)-Number(n)});_<B.length;_++){y=B[_];(C=null===(s=null===(a=null===(l=null===(u=null==n?void 0:n.deviation_entries)||void 0===u?void 0:u[y])||void 0===l?void 0:l.evaluation_outputs)||void 0===a?void 0:a.metadata)||void 0===s?void 0:s.label_color)&&p.push(C)}for(var T=0,x=Object.keys(n||{}).filter(function(t){return/^\d+$/.test(t)}).sort(function(t,n){return Number(t)-Number(n)});T<x.length;T++){var C;y=x[T];(C=null===(d=null===(v=null===(c=null==n?void 0:n[y])||void 0===c?void 0:c.evaluation_outputs)||void 0===v?void 0:v.metadata)||void 0===d?void 0:d.label_color)&&p.push(C)}return 0===p.length?(null===(g=null===(f=null==n?void 0:n.evaluation_outputs)||void 0===f?void 0:f.metadata)||void 0===g?void 0:g.label_color)?n.evaluation_outputs.metadata.label_color:t:p.sort(function(t,n){return h(t)-h(n)})[0]},m=function(t){for(var n,o,e,r,i,u,l,a,s,c=0,v=Object.keys((null==t?void 0:t.deviations)||{}).sort(function(t,n){return Number(t)-Number(n)});c<v.length;c++){var d=v[c];if(b=null===(e=null===(o=null===(n=null==t?void 0:t.deviations)||void 0===n?void 0:n[d])||void 0===o?void 0:o.evaluation_outputs)||void 0===e?void 0:e.output_value)return b}for(var f=0,g=Object.keys((null==t?void 0:t.deviation_entries)||{}).sort(function(t,n){return Number(t)-Number(n)});f<g.length;f++){d=g[f];if(b=null===(u=null===(i=null===(r=null==t?void 0:t.deviation_entries)||void 0===r?void 0:r[d])||void 0===i?void 0:i.evaluation_outputs)||void 0===u?void 0:u.output_value)return b}for(var p=0,h=Object.keys(t||{}).filter(function(t){return/^\d+$/.test(t)}).sort(function(t,n){return Number(t)-Number(n)});p<h.length;p++){var b;d=h[p];if(b=null===(a=null===(l=null==t?void 0:t[d])||void 0===l?void 0:l.evaluation_outputs)||void 0===a?void 0:a.output_value)return b}return(null===(s=null==t?void 0:t.evaluation_outputs)||void 0===s?void 0:s.output_value)?t.evaluation_outputs.output_value:null},y=function(t,n){var o=function(t){var n=t.replace("#","");return[parseInt(n.substring(0,2),16),parseInt(n.substring(2,4),16),parseInt(n.substring(4,6),16)]},e=function(t){var n=Math.round(t).toString(16);return 1===n.length?"0"+n:n};try{var r=o(t),i=o(n),u=(r[0]+i[0])/2*.95,l=(r[1]+i[1])/2*.95,a=(r[2]+i[2])/2*.95;return"#".concat(e(u)).concat(e(l)).concat(e(a))}catch(t){return"#FDE68A"}},_=function(t,n,o){if(!t)return null;if(t.id===o)return n;if(!Array.isArray(t.subsections))return null;for(var e=0;e<t.subsections.length;e++){var r=_(t.subsections[e],"".concat(n,"-").concat(e),o);if(r)return r}return null},B=function(t,n){for(var o=0;o<t.length;o++){var e=_(t[o],String(o),n);if(e)return e}return null},T=new WeakMap,x=function(t){if(t){var n=T.get(t);null!=n&&(clearTimeout(n),T.delete(t)),t.style.transition="box-shadow 300ms ease-out, outline 300ms ease-out",requestAnimationFrame(function(){t.style.outline="",t.style.boxShadow=""}),window.setTimeout(function(){t.style.transition="",t.style.borderRadius=""},300)}},C=function(t){if(t){var n=T.get(t);null!=n&&clearTimeout(n),t.style.transition="box-shadow 300ms ease-in-out, outline 300ms ease-in-out",t.style.outline="2px solid #ff9494",t.style.borderRadius="6px",t.style.boxShadow="0 0 12px 2px rgba(244, 113, 113, 0.33)";var o=window.setTimeout(function(){x(t)},3e3);T.set(t,o)}},A=function(t,n){var o=n.getBoundingClientRect(),e=t.getBoundingClientRect(),r=n.scrollTop+e.top-o.top-o.height/2+e.height/2;n.scrollTo({top:r,behavior:"smooth"});var i=function(){return C(t)};if("onscrollend"in n)n.addEventListener("scrollend",i,{once:!0});else{var u=n.scrollTop,l=function(){n.scrollTop===u?i():(u=n.scrollTop,requestAnimationFrame(l))};requestAnimationFrame(l)}};export{a as DEVIATION_BADGE_SEPARATOR,l as areMarkdownPropsEqual,u as debounce,d as extractDeviationScore,B as findKeyPathByNodeId,i as generateColorPalette,f as getBentArrowPath,b as getFirstDeviationColor,m as getFirstDeviationOutputValue,r as getRationale,e as getSideData,c as hasMeaningfulRedlineTags,o as hasValue,C as highlightClause,s as isMissingStr,y as mixHexColors,_ as recursivelyFindSubSectionIdxById,x as resetClauseHighlight,n as safeStringify,A as scrollAndHighlightClause,g as smoothScrollTo,v as stripRedlineTags};
|
|
2
|
+
//# sourceMappingURL=CognitiveComparehelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CognitiveComparehelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as i,Fragment as n,jsx as t}from"react/jsx-runtime";import{useMemo as e,useState as r,useEffect as l}from"react";import{Box as a,Typography as c,IconButton as s,Tooltip as d}from"@mui/material";import{X as p}from"lucide-react";import v from"react-dom";import x from"../../assests/svg/SparkleIcon.js";import{SHARED_MARKDOWN_STYLES as h,DEFAULT_POPUP_CONFIG as u}from"./CognitiveCompareConfig.js";import b from"./CitationRenderer.js";var g=10,f=function(f){var m,y,w,F,k,S,C,D,_,E,R,z,W,I,T,j,A,B,L,H,M=f.open,O=f.onClose,G=f.sectionTitle,N=f.referenceSectionTitle,P=f.cognitiveData,Y=f.relevanceScore,q=f.anchorEl,J=f.badgeStyle,K=f.popupRef,Q=f.position,U=f.markdownStyles,V=f.docData,X=f.popupConfig,Z=f.deviationData,$=void 0===Z?null:Z,oo=f.isLoading,io=o(o({},h),U),no=e(function(){var i,n;return o(o(o({},u),X),{tabs:{deviation:o(o({},u.tabs.deviation),null===(i=null==X?void 0:X.tabs)||void 0===i?void 0:i.deviation),association:o(o({},u.tabs.association),null===(n=null==X?void 0:X.tabs)||void 0===n?void 0:n.association)},sectionTitles:o(o({},u.sectionTitles),null==X?void 0:X.sectionTitles)})},[X]),to=null==P?void 0:P.isMissingRationale,eo=r(to?no.tabs.deviation.key:no.tabs.association.key),ro=eo[0],lo=eo[1];l(function(){M&&lo(to?no.tabs.deviation.key:no.tabs.association.key)},[M,to,no.tabs.deviation.key,no.tabs.association.key]);var ao=e(function(){if(!J)return{border:no.accentColor,shadow:"".concat(no.accentColor,"2E")};var o=J.badgeText;return"#9F1239"===o||"#B42318"===o?{border:"#E11D48",shadow:"rgba(225,29,72,0.15)"}:"#1D4ED8"===o?{border:"#3B82F6",shadow:"rgba(59,130,246,0.15)"}:"#A16207"===o?{border:"#F59E0B",shadow:"rgba(245,158,11,0.15)"}:{border:no.accentColor,shadow:"".concat(no.accentColor,"2E")}},[J,no.accentColor]);l(function(){if(M){var o=function(o){var i;(null===(i=K.current)||void 0===i?void 0:i.contains(o.target))||(null==q?void 0:q.contains(o.target))||O()};return document.addEventListener("mousedown",o),function(){return document.removeEventListener("mousedown",o)}}},[M,O,q,K]);var co=to?[]:[no.tabs.deviation,no.tabs.association];if(1===co.length&&co[0].key===no.tabs.deviation.key)return null;if(!M||!P)return null;var so=null!==(w=null!==(y=ro===no.tabs.deviation.key?null===(m=null==$?void 0:$.cognitive_decisioning)||void 0===m?void 0:m.decision_strength:P.relevance_score)&&void 0!==y?y:Y)&&void 0!==w?w:0,po=P.decisioning,vo=Array.isArray(po)?po:"string"==typeof po&&po.trim()?[po]:[],xo=P.gap,ho=Array.isArray(xo)?xo:"string"==typeof xo&&xo.trim()?[xo]:[],uo=Q?Q.left-150:-9999,bo=(null!==(F=null==Q?void 0:Q.arrowLeft)&&void 0!==F?F:60)+150,go=i(a,o({ref:K,sx:{position:"fixed",top:null!==(k=null==Q?void 0:Q.top)&&void 0!==k?k:-9999,left:uo,zIndex:9999,width:"".concat(1050,"px"),maxWidth:"min(".concat(1050,"px, calc(100vw - ").concat(uo>0?uo:0,"px - ").concat(12,"px))"),bgcolor:"#FFFFFF",borderRadius:"14px",border:"1.5px solid ".concat(ao.border),boxShadow:"0px 8px 32px ".concat(ao.shadow,", 0px 0px 0px 3px ").concat(ao.shadow),overflow:"visible",display:"flex",flexDirection:"column",maxHeight:(null==Q?void 0:Q.maxHeight)?"min(60vh, ".concat(Q.maxHeight,"px)"):"60vh",visibility:Q?"visible":"hidden"}},{children:[Q&&(Q.openAbove?i(n,{children:[t(a,{sx:{position:"absolute",bottom:-11,left:bo-g,width:0,height:0,borderLeft:"".concat(g,"px solid transparent"),borderRight:"".concat(g,"px solid transparent"),borderTop:"".concat(11,"px solid ").concat(ao.border),zIndex:1}}),t(a,{sx:{position:"absolute",bottom:-9,left:bo-g+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderTop:"".concat(g,"px solid #FFFFFF"),zIndex:2}})]}):i(n,{children:[t(a,{sx:{position:"absolute",top:-11,left:bo-g,width:0,height:0,borderLeft:"".concat(g,"px solid transparent"),borderRight:"".concat(g,"px solid transparent"),borderBottom:"".concat(11,"px solid ").concat(ao.border),zIndex:1}}),t(a,{sx:{position:"absolute",top:-9,left:bo-g+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderBottom:"".concat(g,"px solid #FFFFFF"),zIndex:2}})]})),i(a,o({sx:{px:2.5,pt:2,pb:1.5,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:2,flexShrink:0}},{children:[i(a,o({sx:{flex:1,minWidth:0}},{children:[("no counterpart"!==G||"no counterpart"!==N)&&i(c,o({sx:{fontSize:"16px",fontWeight:600,color:"#101828",lineHeight:1.3,display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap",overflow:"hidden",width:"100%"}},{children:[t(a,o({component:"span",title:G,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"0 1 auto",maxWidth:"calc(50% - 16px)",minWidth:0}},{children:G})),t(a,o({component:"span",sx:{color:"#667085",fontWeight:400,flexShrink:0,mx:.5}},{children:"↔"})),t(a,o({component:"span",title:N||"Reference Section",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0}},{children:N||"Reference Section"}))]})),t(a,o({sx:{mt:.75,display:"inline-flex",alignItems:"center",gap:.75}},{children:t(c,o({sx:{fontSize:"no counterpart"!==G||"no counterpart"!==N?"13px":"16px",fontWeight:400,color:"#5928ED",lineHeight:1}},{children:null===(S=Object.values(no.tabs).find(function(o){return o.key===ro}))||void 0===S?void 0:S.subtitle}))}))]})),i(a,o({sx:{display:"flex",alignItems:"center",gap:1.5,flexShrink:0}},{children:[i(a,o({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:.5,borderRadius:"20px",bgcolor:"#FFFFFF",border:"1px solid #5928ED",fontSize:"12px",fontWeight:600,color:"#5928ED"}},{children:[t(x,{}),no.decisionStrengthLabel," ",so,"%"]})),t(s,o({onClick:O,size:"small",sx:{color:"#667085",width:24,height:24,"&:hover":{bgcolor:"transparent",color:"#101828"}}},{children:t(p,{size:22})}))]}))]})),t(a,o({sx:{display:"flex",borderBottom:"1px solid #E4E7EC",px:2.5,flexShrink:0}},{children:co.map(function(i){var n=ro===i.key,e=i.key===no.tabs.deviation.key,r=co.length>1&&e&&oo,l=t(a,o({onClick:function(){r||lo(i.key)},sx:{pb:"10px",pt:"4px",mr:3,px:2,cursor:r?"not-allowed":"pointer",opacity:r?.5:1,fontSize:"14px",fontWeight:n?600:400,color:n?no.accentColor:"#667085",backgroundColor:n?"".concat(no.accentColor,"14"):"transparent",borderBottom:n?"2px solid ".concat(no.accentColor):"2px solid transparent",transition:"all 0.15s",userSelect:"none"}},{children:i.label}),i.key);return r?t(d,o({title:"Fetching deviation data",arrow:!0,placement:"top"},{children:t("span",{children:l})}),i.key):l})})),t(a,o({sx:{flex:1,minHeight:0,overflowY:"auto",px:2.5,py:2,display:"flex",flexDirection:"column",gap:1.5,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"".concat(ao.border,"55"),borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:ao.border},scrollbarWidth:"thin",scrollbarColor:"".concat(ao.border,"55 transparent")}},{children:ro===no.tabs.deviation.key?$?i(n,{children:[(null===(D=(null===(C=null==$?void 0:$.cognitive_decisioning)||void 0===C?void 0:C.decisioning_factors)||[])||void 0===D?void 0:D.length)>0&&t(b,{title:"Decision Making Factors",content:null===(E=null===(_=null==$?void 0:$.cognitive_decisioning)||void 0===_?void 0:_.decisioning_factors)||void 0===E?void 0:E.join("\n\n"),citations:null===(R=null==$?void 0:$.cognitive_decisioning)||void 0===R?void 0:R.citations,styles:io,docData:V,open:M}),(null===(W=(null===(z=null==$?void 0:$.cognitive_decisioning)||void 0===z?void 0:z.gaps_in_decision)||[])||void 0===W?void 0:W.length)>0&&t(b,{title:"Gaps in Decision",content:null===(T=null===(I=null==$?void 0:$.cognitive_decisioning)||void 0===I?void 0:I.gaps_in_decision)||void 0===T?void 0:T.join("\n\n"),citations:null===(j=null==$?void 0:$.cognitive_decisioning)||void 0===j?void 0:j.citations,styles:io,docData:V,open:M}),0===(null===(B=(null===(A=null==$?void 0:$.cognitive_decisioning)||void 0===A?void 0:A.decisioning_factors)||[])||void 0===B?void 0:B.length)&&0===(null===(H=(null===(L=null==$?void 0:$.cognitive_decisioning)||void 0===L?void 0:L.gaps_in_decision)||[])||void 0===H?void 0:H.length)&&t(a,o({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:t(c,o({sx:{fontSize:"13px",color:"#64748B"}},{children:"No cognitive decisioning data available for this section."}))}))]}):t(b,{title:"Deviation Analysis",content:"Deviation analysis content will appear here. This tab shows\n structural and semantic deviations identified between the two\n sections being compared.",citations:{},styles:io,docData:V,open:M}):i(n,{children:[vo.length>0&&t(b,{title:no.sectionTitles.decisioningFactors,content:vo.join("\n\n"),citations:P.citations,styles:io,open:M,docData:V}),ho.length>0&&t(b,{title:no.sectionTitles.gaps,content:ho.join("\n\n"),citations:P.citations,styles:io,open:M,docData:V}),0===vo.length&&0===ho.length&&t(a,o({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:t(c,o({sx:{fontSize:"13px",color:"#64748B"}},{children:no.emptyStateMessage}))}))]})}))]}));return v.createPortal(go,document.body)};export{f as default};
|
|
2
|
+
//# sourceMappingURL=CognitivePopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CognitivePopup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createContext as r,useContext as e}from"react";var o=r(null),t=o.Provider,n=function(){var r=e(o);if(!r)throw new Error("useCompareContext must be used within CompareContextProvider");return r};export{t as CompareContextProvider,n as useCompareContext};
|
|
2
|
+
//# sourceMappingURL=CompareContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompareContext.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as a}from"react/jsx-runtime";import{Box as i,Typography as n}from"@mui/material";var r=function(){return t(i,e({sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center","@keyframes bounce":{"0%":{transform:"translateY(0) scale(1)",opacity:.6},"100%":{transform:"translateY(-12px) scale(1.15)",opacity:1}},"@keyframes glowPulse":{"0%, 100%":{textShadow:"0 0 6px rgba(89,40,237,0.2)"},"50%":{textShadow:"0 0 14px rgba(89,40,237,0.45)"}}}},{children:[a(n,e({sx:{mb:2,fontSize:"20px",fontWeight:600,fontFamily:"sans-serif",color:"#5928ED",letterSpacing:"0.8px",animation:"glowPulse 2s ease-in-out infinite"}},{children:"Switching views..."})),a(i,e({sx:{display:"flex",gap:"8px"}},{children:[0,1,2].map(function(e){return a(i,{sx:{width:"12px",height:"12px",borderRadius:"50%",background:"linear-gradient(145deg, #7c5cff, #5928ED)",boxShadow:"0 4px 12px rgba(89,40,237,0.5), 0 0 8px rgba(89,40,237,0.3)",animation:"bounce 0.6s infinite alternate",animationDelay:"".concat(.15*e,"s")}},e)})}))]}))};export{r as default};
|
|
2
|
+
//# sourceMappingURL=LoaderComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as i,jsxs as n,Fragment as t}from"react/jsx-runtime";import{Menu as o,Box as r,Typography as l,MenuItem as s}from"@mui/material";import{ButtonCognitiveIcon as c}from"../../assests/svg/ButtonCognitiveIcon.js";var d=function(){return i("svg",e({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{d:"M2 6.5L5 9.5L11 3.5",stroke:"#15803D",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}))},C=[{key:"connect",title:"Connect",icon:i("svg",e({width:"15",height:"18",viewBox:"0 0 15 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{d:"M14.8237 3.89331C14.547 5.57188 13.0559 6.77501 11.3572 6.69242C9.65857 6.60983 8.2925 5.26384 8.18312 3.56742C4.75678 3.67456 3.54027 4.4759 3.73893 6.10536C3.81259 6.71474 4.18089 7.04063 4.85723 7.19911C5.26794 7.2951 5.7233 7.30849 6.13625 7.27054C6.17419 7.26608 6.21437 7.26385 6.25232 7.25938C6.50455 7.19911 6.76125 7.14777 7.01794 7.1076C7.77911 6.9826 8.55366 6.9201 9.29027 6.96027C11.3617 7.07188 12.7724 7.98483 12.8438 9.92233C12.913 11.7996 11.6229 13.1299 9.5425 14.0205C8.87509 14.3063 8.1675 14.5272 7.45991 14.6946C7.14071 14.7705 6.87286 14.8219 6.67419 14.8554C6.49786 16.5496 5.07821 17.842 3.37509 17.8554C1.67196 17.8688 0.229997 16.6031 0.0246403 14.9112C-0.180717 13.2192 0.917498 11.6455 2.57375 11.2527C4.23 10.8598 5.91973 11.7728 6.49562 13.3755C6.70544 13.3375 6.91303 13.2951 7.12062 13.246C7.75009 13.0987 8.37955 12.9022 8.95991 12.6522C10.538 11.9781 11.3996 11.0875 11.3595 9.9759C11.3237 8.98036 10.6095 8.52054 9.21214 8.44465C8.5983 8.41117 7.92643 8.46474 7.26348 8.57411C7.07821 8.60536 6.90857 8.63661 6.75902 8.6701C6.67196 8.68795 6.61169 8.70358 6.58491 8.71027L6.51571 8.72367C6.4666 8.73036 6.38402 8.74152 6.27687 8.75268C5.71884 8.80402 5.11393 8.78617 4.52464 8.65001C3.2925 8.36206 2.42866 7.59643 2.26794 6.2884C1.9175 3.47143 4.02241 2.16563 8.42866 2.07188C9.07821 0.500452 10.8037 -0.336602 12.4376 0.129916C14.0737 0.596434 15.1005 2.21474 14.8237 3.89331V3.89331ZM3.34161 12.6478C3.09741 12.6478 2.85562 12.6959 2.63002 12.7894C2.40442 12.8828 2.19944 13.0198 2.02678 13.1925C1.85412 13.3652 1.71717 13.5702 1.62373 13.7958C1.5303 14.0214 1.48222 14.2632 1.48223 14.5074C1.48224 14.7516 1.53036 14.9934 1.62382 15.219C1.71728 15.4446 1.85426 15.6495 2.02694 15.8222C2.19962 15.9949 2.40462 16.1318 2.63022 16.2252C2.85583 16.3187 3.09764 16.3668 3.34183 16.3667C3.83499 16.3667 4.30795 16.1708 4.65665 15.822C5.00535 15.4733 5.20123 15.0003 5.2012 14.5071C5.20117 14.014 5.00524 13.541 4.65649 13.1923C4.30775 12.8436 3.83477 12.6477 3.34161 12.6478ZM11.5224 1.49152C11.2782 1.49154 11.0364 1.53965 10.8108 1.63311C10.5852 1.72657 10.3802 1.86355 10.2076 2.03623C10.0349 2.20891 9.89797 2.41391 9.80454 2.63952C9.7111 2.86513 9.66302 3.10693 9.66303 3.35112C9.66305 3.59531 9.71116 3.83711 9.80462 4.06271C9.89808 4.28831 10.0351 4.49329 10.2077 4.66594C10.3804 4.8386 10.5854 4.97556 10.811 5.06899C11.0366 5.16243 11.2784 5.21051 11.5226 5.2105C12.0158 5.21047 12.4888 5.01453 12.8375 4.66579C13.1862 4.31704 13.382 3.84406 13.382 3.3509C13.382 2.85773 13.186 2.38478 12.8373 2.03608C12.4886 1.68738 12.0156 1.49149 11.5224 1.49152V1.49152Z",fill:"#1D2939",fillOpacity:"0.85"})}))},{key:"side-by-side",title:"Side by Side",icon:i("svg",e({width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{d:"M3.19922 8.19922H13.1992M3.19922 8.19922L4.86589 10.6992M3.19922 8.19922L4.86589 5.69922M13.1992 8.19922L11.5326 10.6992M13.1992 8.19922L11.5326 5.69922M15.6992 0.699219V15.6992M0.699219 0.699219V15.6992",stroke:"#3F4957",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}))},{key:"cognitive-decisioning",title:"Cognitive Decisioning",icon:i(c,{})}],a=function(c){var a=c.open,h=c.anchorEl;c.sectionTitle,c.referenceSectionTitle;var p=c.onClose,g=c.onOpenCognitiveCompare,x=c.onOpenSideBySide,f=c.onConnect,m=c.isConnected,u=void 0!==m&&m,y=c.isOrphan,v=c.maintainRelativeOrder;return i(o,e({open:a,anchorEl:h,onClose:p,disableScrollLock:!0,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},PaperProps:{sx:{ml:.75,minWidth:190,maxWidth:220,borderRadius:"12px",border:"1px solid #E4E7EC",boxShadow:"0px 12px 28px rgba(16, 24, 40, 0.12)",overflow:"hidden"}},MenuListProps:{sx:{p:.5,bgcolor:"#FFFFFF"}}},{children:C.filter(function(e){return v||"side-by-side"!==e.key}).map(function(o){var c="connect"===o.key,C=c&&u,a=y&&("connect"===o.key||"side-by-side"===o.key),h=n(t,{children:[i(r,e({sx:e(e({width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"& svg":{display:"block"}},a&&{opacity:.15}),C&&{"& svg path":{fill:"#15803D",fillOpacity:1}})},{children:o.icon})),n(r,e({sx:{minWidth:0,display:"flex",flexDirection:"column",flex:1}},{children:[i(l,e({sx:{fontSize:"12px",fontWeight:500,color:a?"#98A2B3":C?"#15803D":"#101828",lineHeight:1.2,whiteSpace:"nowrap"}},{children:c?u?"Disconnect":"Connect":o.title})),a&&i(l,e({sx:{mt:.35,fontSize:"10px",lineHeight:1.3,color:"#98A2B3",whiteSpace:"normal"}},{children:"No counterpart exists to connect to."}))]})),C&&!a&&i(r,e({sx:{display:"flex",alignItems:"center",justifyContent:"center",ml:"auto"}},{children:i(d,{})}))]});return a?i(r,e({"aria-disabled":"true",sx:{px:1.25,py:1,minHeight:22,borderRadius:"10px",display:"flex",alignItems:"flex-start",gap:1,cursor:"not-allowed",userSelect:"none"}},{children:h}),o.key):i(s,e({onClick:function(){return e=o.key,void(y&&("connect"===e||"side-by-side"===e)||("connect"!==e?"side-by-side"!==e?g():x():f()));var e},sx:{px:1.25,py:1,minHeight:40,borderRadius:"10px",display:"flex",alignItems:"center",gap:1,bgcolor:C?"#F0FDF4":"transparent","&:hover":{bgcolor:C?"#DCFCE7":"#F9FAFB"}}},{children:h}),o.key)})}))};export{a as default};
|
|
2
|
+
//# sourceMappingURL=MoreFunctionsPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoreFunctionsPopup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as r}from"tslib";import{jsxs as t,jsx as a}from"react/jsx-runtime";import{Box as e,Skeleton as n,Typography as i}from"@mui/material";var o=function(o){var s=o.sections,l=void 0===s?8:s;return t(e,r({sx:{position:"absolute",inset:0,zIndex:50,backdropFilter:"blur(6px)",backgroundColor:"rgba(255,255,255,0.7)",borderRadius:"8px",overflow:"hidden"}},{children:[a(e,r({sx:{p:2,display:"flex",flexDirection:"column",gap:2,willChange:"transform",animation:"wander 20s ease-in-out infinite alternate","@keyframes wander":{"0%":{transform:"translate3d(0, 0px, 0)"},"20%":{transform:"translate3d(0, -15%, 0)"},"40%":{transform:"translate3d(0, -5%, 0)"},"60%":{transform:"translate3d(0, -30%, 0)"},"80%":{transform:"translate3d(0, -10%, 0)"},"100%":{transform:"translate3d(0, -40%, 0)"}}}},{children:Array.from({length:l}).map(function(i,o){return t(e,r({sx:{border:"1px solid #E3E6EA",borderRadius:"6px",p:1.5,bgcolor:"#fff",opacity:.6}},{children:[a(n,{variant:"text",width:"40%",height:24}),a(n,{variant:"text",width:"80%"}),a(n,{variant:"text",width:"70%"}),a(n,{variant:"rectangular",height:40,sx:{mt:1}})]}),o)})})),t(e,r({sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"#FFFFFF",p:3,borderRadius:"8px",boxShadow:"0px 8px 24px rgba(0, 0, 0, 0.12)",textAlign:"center",width:"80%",maxWidth:"340px",zIndex:10}},{children:[a(i,r({sx:{fontWeight:600,fontSize:"16px",color:"#0F172A",mb:1}},{children:"Aligning sections..."})),a(i,r({sx:{fontSize:"13px",color:"#64748B",lineHeight:1.5}},{children:"Placing corresponding clauses side by side for comparison."}))]}))]}))};export{o as default};
|
|
2
|
+
//# sourceMappingURL=OverlayComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as n,Fragment as t}from"react/jsx-runtime";import{useRef as l,useState as o,useCallback as r}from"react";var d=function(d){var c=d.leftComponent,h=d.rightComponent,u=d.isFullscreen,s=void 0!==u&&u,f=l(null),a=o(50),m=a[0],v=a[1],p=o(!1),x=p[0],w=p[1],y=null!=c,g=null!=h,M=r(function(){y&&g&&w(!0)},[y,g]),D=r(function(e){if(x&&f.current){var i=f.current.getBoundingClientRect(),n=(e.clientX-i.left)/i.width*100;n=Math.max(25,Math.min(75,n)),v(n)}},[x]),b=r(function(){w(!1)},[]),k={minWidth:0,minHeight:0,height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"};return i("div",e({ref:f,onMouseMove:D,onMouseUp:b,onMouseLeave:b,style:{display:"flex",width:"calc(100% - 1px)",height:s?"100%":"400px",border:"1px solid #ddd",overflow:"hidden",userSelect:x?"none":"auto"}},{children:[y&&!g&&n("div",e({style:e(e({},k),{width:"100%"})},{children:c})),!y&&g&&n("div",e({style:e(e({},k),{width:"100%"})},{children:h})),y&&g&&i(t,{children:[n("div",e({style:e(e({},k),{width:"".concat(m,"%"),flexShrink:0})},{children:c})),n("div",{onMouseDown:M,style:{width:"6px",background:"#D0D5DD",cursor:"col-resize",flexShrink:0}}),n("div",e({style:e(e({},k),{flex:1})},{children:h}))]})]}))};export{d as default};
|
|
2
|
+
//# sourceMappingURL=ResizableSplitPane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResizableSplitPane.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import{Popper as i,Paper as o,Box as r,Typography as l,IconButton as a,Accordion as c,AccordionSummary as d,AccordionDetails as s}from"@mui/material";import{Info as u,X as p,ChevronDown as f}from"lucide-react";import{useRef as m,useState as h,useEffect as x,useMemo as g}from"react";function v(v){var b,w,y,S=v.open,C=v.anchorEl,E=v.containerEl,I=v.clipTopEl,z=v.scrollContainerEl,B=v.onClose,R=v.summary;v.markdownStyles,v.isLoading;var F=v.displayImpact,H=v.isScrollLocked,W=m(null),k=m(null),L=h(null),A=L[0],_=L[1],M=h(null),P=M[0],O=M[1],T=h(null);T[0];var N=T[1],Y=h(0),j=Y[0],J=Y[1],q="string"==typeof R?{deviation_summary:R}:null!=R?R:{},D=h(!1),G=D[0],V=D[1];x(function(){S&&V(!1)},[S]);var Z=q.deviation_title,K=q.deviation_summary,Q=q.deviation_impact,U=q.evaluation_outputs,X=!!String(Q||"").trim(),$=h(!!F),ee=$[0],ne=$[1];x(function(){X&&ne(!!F)},[F,X,R]);var te=(null===(b=null==U?void 0:U.metadata)||void 0===b?void 0:b.label_color)||"#6366F1",ie=null!==(w=null==E?void 0:E.getBoundingClientRect().width)&&void 0!==w?w:180,oe=Math.max(148,ie+120),re=g(function(){if(!C||!E)return null;var e=C.getBoundingClientRect();if(0===e.width&&0===e.height)return null;var n=E.getBoundingClientRect();return{top:e.top,bottom:e.bottom,left:n.left+n.width/2}},[C,E]);x(function(){if(!S||!C||!E)return _(null),O(null),void N(null);var e=function(){null!==W.current&&cancelAnimationFrame(W.current),W.current=requestAnimationFrame(function(){var e,n,t=null==C?void 0:C.getBoundingClientRect(),i=null==I?void 0:I.getBoundingClientRect(),o=null==z?void 0:z.getBoundingClientRect();if(0!==t.width||0!==t.height){var r=E.getBoundingClientRect();_({top:t.top,bottom:t.bottom,left:r.left+r.width/2}),O(null!==(e=null==i?void 0:i.bottom)&&void 0!==e?e:null),N(null!==(n=null==o?void 0:o.bottom)&&void 0!==n?n:null),k.current&&J(k.current.offsetHeight)}})};e();var n=function(e){for(var n=[],t=(null==e?void 0:e.parentElement)||null;t;){var i=window.getComputedStyle(t);("auto"===i.overflowY||"scroll"===i.overflowY)&&t.scrollHeight>t.clientHeight&&n.push(t),t=t.parentElement}return n}(C);return window.addEventListener("scroll",e,{passive:!0,capture:!0}),window.addEventListener("resize",e),n.forEach(function(n){n.addEventListener("scroll",e,{passive:!0})}),function(){null!==W.current&&cancelAnimationFrame(W.current),window.removeEventListener("scroll",e,{capture:!0}),window.removeEventListener("resize",e),n.forEach(function(n){n.removeEventListener("scroll",e)})}},[S,C,E,I,z,H]);var le=null!==(y=null!=A?A:re)&&void 0!==y?y:"hidden",ae="hidden"===le?"hidden":le.bottom+20,ce=null!=P&&"number"==typeof ae&&ae<P?Math.min(j,P-ae):0,de=g(function(){return"hidden"===le?{getBoundingClientRect:function(){return{width:0,height:0,top:0,bottom:0,left:0,right:0,x:0,y:0,toJSON:function(){}}}}:{getBoundingClientRect:function(){return{width:0,height:le.bottom-le.top,top:le.top,bottom:le.bottom,left:le.left,right:le.left,x:le.left,y:le.top,toJSON:function(){}}}}},[le]);return R?n(i,e({open:S&&!G,disablePortal:!0,popperOptions:{strategy:"fixed"},anchorEl:de,placement:"bottom",modifiers:[{name:"offset",options:{offset:[0,20]}},{name:"preventOverflow",enabled:!0,options:{boundary:z||"clippingParents",tether:!1}},{name:"flip",enabled:!0,options:{boundary:z||"clippingParents",fallbackPlacements:["top"]}}],sx:{zIndex:21,visibility:"hidden"===le?"hidden":"visible",opacity:"hidden"===le?0:1,transition:"opacity 0.15s ease-in-out"}},{children:t(o,e({ref:k,sx:e(e({p:1.5,borderRadius:"12px",width:oe,maxWidth:oe},ce>0&&{clipPath:"inset(".concat(ce,"px 0px 0px 0px round 12px)")}),{transition:"transform 80ms linear",willChange:"transform",backfaceVisibility:"hidden",transform:"translateZ(0)",boxShadow:"0px 10px 24px rgba(15, 23, 42, 0.18)",border:"1px solid ".concat(te,"26"),borderTop:"3px solid ".concat(te),overflow:"hidden",bgcolor:"#fff"})},{children:[t(r,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.75}},{children:[t(r,e({sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0}},{children:[n(u,{size:14,color:te}),n(l,e({sx:{fontSize:"11px",fontWeight:700,color:te,fontFamily:'"Inter", sans-serif',textTransform:"uppercase",letterSpacing:"0.4px",lineHeight:1.2}},{children:"Summary"}))]})),n(a,e({size:"small",onClick:B,sx:{p:.25,ml:.5,color:"#64748B"}},{children:n(p,{size:14})}))]})),t(r,e({sx:{display:"flex",flexDirection:"column",gap:1.5,maxHeight:"300px",overflowY:"auto",pr:.5}},{children:[t(r,{children:[Z&&n(l,e({sx:{fontSize:"12px",color:"#334155",fontFamily:'"Inter", sans-serif',lineHeight:1.6,fontWeight:700,overflowWrap:"anywhere"}},{children:Z})),n(l,e({sx:{fontSize:"11px",color:"#334155",lineHeight:1.6,fontFamily:'"Inter", sans-serif',fontWeight:400,overflowWrap:"anywhere",whiteSpace:"pre-wrap"}},{children:K||"No summary available."}))]}),X&&t(c,e({expanded:ee,onChange:function(e,n){return ne(n)},disableGutters:!0,elevation:0,sx:{backgroundColor:"".concat(te,"0A"),border:"1px solid ".concat(te,"33"),borderRadius:"4px",fontFamily:'"Inter", sans-serif',overflow:"hidden",flexShrink:0,"&:before":{display:"none"},"&.Mui-expanded":{margin:0}}},{children:[n(d,e({expandIcon:n(f,{size:16,color:te}),sx:{minHeight:"10px",px:1.5,"& .MuiAccordionSummary-content":{py:"5px",my:0},"&.Mui-expanded":{minHeight:"10px",borderBottom:"1px solid ".concat(te,"1A")}}},{children:n(l,e({sx:{fontSize:"11px",fontWeight:700,color:te,fontFamily:'"Inter", sans-serif',textTransform:"uppercase",letterSpacing:"0.5px"}},{children:"Impact"}))})),n(s,e({sx:{p:1.5,backgroundColor:"#fff"}},{children:n(l,e({sx:{fontSize:"11px",color:"#475569",lineHeight:1.6,fontWeight:400,fontFamily:'"Inter", sans-serif',overflowWrap:"anywhere",whiteSpace:"pre-wrap"}},{children:String(Q).replace("Impact -","").trim()}))}))]}))]}))]}))})):null}export{v as default};
|
|
2
|
+
//# sourceMappingURL=CognitiveSummaryPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CognitiveSummaryPopup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as o}from"react/jsx-runtime";import{Box as t,Typography as r,Button as l,FormControlLabel as n,Switch as a}from"@mui/material";var s=function(s){var d=s.componentHeaderText,c=s.displayConfig,p=s.maintainRelativeOrder,h=s.onToggleView,f=s.onCollapseAll,g=s.showCollapseAll;return c.isHeaderVisible||c.isToggleVisible?i(t,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[o(t,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:c.isHeaderVisible&&o(r,e({sx:{fontSize:"16px",fontWeight:600,color:"#0F172A"}},{children:d}))})),i(t,e({sx:{display:"flex",alignItems:"center",gap:2}},{children:[c.displayEmailNotifier&&i(t,e({sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:1,backgroundColor:"#f5f5f5",px:.5,py:.25,borderRadius:1,border:"1px solid #a0a0a0",paddingX:.8}},{children:[i("svg",e({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-bell-ring-icon lucide-bell-ring"},{children:[o("path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}),o("path",{d:"M22 8c0-2.3-.8-4.3-2-6"}),o("path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}),o("path",{d:"M4 2C2.8 3.7 2 5.7 2 8"})]})),o(r,e({variant:"caption",sx:{color:"black",textAlign:"center",fontSize:"13px",fontWeight:500}},{children:"You'll be notified on completion"}))]})),c.isToggleVisible&&i(t,e({sx:{display:"flex",alignItems:"center",gap:2}},{children:[g&&o(l,e({variant:"outlined",size:"small",onClick:f,sx:{textTransform:"none",fontWeight:600,fontSize:"12px",color:"#5928ED",borderColor:"#5928ED",height:26,"&:hover":{borderColor:"#3E1BB3",backgroundColor:"rgba(89, 40, 237, 0.04)"}}},{children:"Collapse All"})),o(n,{control:o(a,{checked:!p,onChange:function(e){return h(e.target.checked)},color:"primary",size:"small",sx:{width:100,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"3px",transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(75px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:"#5928ED",opacity:1,border:0,"&::before":{content:'"Side by Side"',position:"absolute",left:8,top:5,fontSize:10,color:"#fff",fontWeight:600}}},"& .MuiSwitch-thumb:before":{position:"absolute",width:"100%",height:"100%",left:0,top:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:700,color:"#5928ED"}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:20,height:20,boxShadow:"0px 1px 3px rgba(0,0,0,0.2)"},"& .MuiSwitch-track":{borderRadius:13,backgroundColor:"#CBD5E1",opacity:1,position:"relative","&::before":{content:'"Side By Side"',position:"absolute",right:8,top:5,left:30,fontSize:10,color:"#1E293B",fontWeight:600}}}}),label:"",sx:{m:0}})]}))]}))]})):null};export{s as default};
|
|
2
|
+
//# sourceMappingURL=CompareHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompareHeader.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as o,jsxs as n}from"react/jsx-runtime";import i from"react";import{Box as t}from"@mui/material";import{EllipsisVertical as r}from"lucide-react";import l from"./SectionAccordion.js";import a from"./ThreeDotsLoader.js";import{extractDeviationScore as d}from"../CognitiveComparehelpers.js";import{useCompareContext as c}from"../CompareContext.js";var s=i.memo(function(i){var s,p,u,v=i.section,f=i.idx,g=c(),m=g.maintainRelativeOrder,x=g.existingSections;g.proposedSections;var h=g.connectedSections,S=g.expandedSections,b=g.displayConfig,R=g.treeData;g.deviationNumberRegistry;var y=g.getSectionCompareStyle;g.getBadgeRef;var w=g.getSectionRowRef,B=g.sectionLeftRefs,C=g.lhsBadgeRefs,I=g.openMoreFunctionsPopup,N=g.handleOpenSummaryPopup,k=g.handleCloseSummaryPopup,P=g.toggleSection;g.showDeviationBadges,g.renderSubSectionAccordion,g.isProposingFix,g.proposingFixNodeId,g.isRedlineFlow,g.isSideBySide,g.activeSideBySideSection,g.scrollSyncLocked,g.toggleScrollSyncLocked,g.summaryPopupAnchorEl,g.deviationNodeIdToView,g.deviationTargetParentId;var D=g.showDeviationNavigation;g.showOpenNodeRef,g.resolvedMarkdownStyles;var T=g.unifiedNumbering,A=!v.title&&!v.content;if(m&&A)return null;var L=v,j=y(f,"left"),z=m?!(null===(s=L.refIndexes)||void 0===s?void 0:s.length)||L.selfIndex<0:!x[f],F=h.has(f);null===(p=C.current[f])||void 0===p||p.current;var O=d(L.evaluationResult,null==j?void 0:j.deviationLabel),W=T.leftNums.get(L.id);return o(t,e({ref:w(f),sx:{mb:1,width:"100%"}},{children:o(t,e({ref:B.current[f],sx:e({width:"100%",display:"flex",flexDirection:"column",minWidth:0},F&&{borderRadius:"6px",outline:"2px solid ".concat((null==j?void 0:j.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:n(t,e({sx:{position:"relative",width:"100%"}},{children:[o(l,{section:v,idx:f,columnKey:"left",colRef:w("left-accordion-".concat(f)),mb:0,parentNodeId:(null===(u=null==R?void 0:R.input_index_map)||void 0===u?void 0:u[0])||"",isExpanded:m?!!S["left-".concat(f)]:!!S[String(f)],onToggle:function(){k(),P(f,"left")},navigation:v.id?D[v.id]:null}),m&&j&&n(t,e({ref:C.current[f],onClick:function(e){var o,n,i,t=b.enableDeviationSchemaBackwardCompatibility?null!==(o=L.evaluationResult)&&void 0!==o?o:null:null!==(i=null===(n=L.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==i?i:null;N(e,String(f),z,t)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:j.badgeBg,color:j.badgeText,border:"1px solid ".concat(j.badgeBorder),borderRadius:"12px",px:1.2,py:.3,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[n(t,e({component:"span",onClick:function(e){var o,n,i;e.stopPropagation();var t=b.enableDeviationSchemaBackwardCompatibility?null!==(o=L.evaluationResult)&&void 0!==o?o:null:null!==(i=null===(n=L.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==i?i:null;N(e,String(f),z,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:z?"default":"pointer",borderRight:"1px solid ".concat(j.badgeBorder),"&:hover":z?{}:{bgColor:"".concat(j.badgeBorder,"22")}}},{children:[null!=W&&o(t,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(j.badgeBorder)}},{children:W})),o(t,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:!b.isLoading||null!=L.evaluationResult&&void 0!==L.evaluationResult?"N/A"===O||"NA"===O?"N/A":0==O||null==O?"Same":"".concat(O):o(a,{color:j.badgeText})}))]})),o(t,e({component:"span",onClick:function(e){e.stopPropagation();var o=m?x.find(function(e){var o;return null===(o=L.refIndexes)||void 0===o?void 0:o.includes(e.selfIndex)})||{title:"",content:""}:x[f]||{title:"",content:""};I(e,v,z,o,f,j)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(j.badgeBorder,"22")}}},{children:o(r,{size:11,color:j.badgeText})}))]}))]}))}))}),"left-row-".concat(f))});export{s as default};
|
|
2
|
+
//# sourceMappingURL=LHSSectionRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LHSSectionRow.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
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{useCompareContext as s}from"../CompareContext.js";var p=t.memo(function(t){var p,u,g,x=t.section,v=t.idx,f=s(),m=f.maintainRelativeOrder;f.existingSections;var h=f.proposedSections,b=f.connectedSections,S=f.expandedSections,R=f.displayConfig,y=f.treeData;f.deviationNumberRegistry;var I=f.getSectionCompareStyle;f.getBadgeRef;var w=f.getSectionRowRef,B=f.sectionRightRefs,C=f.rhsBadgeRefs,k=f.openMoreFunctionsPopup,T=f.handleOpenSummaryPopup,N=f.handleCloseSummaryPopup,P=f.toggleSection;f.showDeviationBadges,f.renderSubSectionAccordion,f.isProposingFix,f.proposingFixNodeId,f.isRedlineFlow;var D=f.isSideBySide,j=f.activeSideBySideSection,z=f.scrollSyncLocked,L=f.toggleScrollSyncLocked,F=f.summaryPopupAnchorEl;f.deviationNodeIdToView,f.deviationTargetParentId;var O=f.showDeviationNavigation;f.showOpenNodeRef,f.resolvedMarkdownStyles;var A=f.unifiedNumbering,E=x,M=!1,W=null,_=-1;if(m){_=h.findIndex(function(e){var o;return(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(E.selfIndex))&&e.selfIndex>=0});var K=h.findIndex(function(e,o){var n;return b.has(o)&&(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(E.selfIndex))});(M=-1!==K)&&(W=I(K,"left"))}else(M=b.has(v))&&(W=I(v,"right"));var V=m&&-1!==_?I(_,"left"):I(v,"right"),X=m?-1!==_||!(null===(p=E.refIndexes)||void 0===p?void 0:p.length)&&h.some(function(e){return e.id&&e.id===E.id}):Boolean(h[v]),Y=m?E.selfIndex<0||!X:!h[v],q=A.rightNums.get(E.id),G=null===(u=C.current[v])||void 0===u?void 0:u.current,H=M||D&&(j===v||j===_)||!!F&&F===G;return o(r,e({ref:w(v),sx:{mb:1,width:"100%"}},{children:o(r,e({ref:B.current[v],sx:e({width:"100%",display:"flex"},M&&W&&{borderRadius:"6px",outline:"2px solid ".concat(W.badgeBorder),outlineOffset:"1px"})},{children:n(r,e({sx:{position:"relative",width:"100%"}},{children:[o(a,{section:x,idx:v,columnKey:"right",colRef:w("right-accordion-".concat(v)),mb:0,parentNodeId:(null===(g=null==y?void 0:y.input_index_map)||void 0===g?void 0:g[1])||"",isExpanded:m?!!S["right-".concat(v)]:!!S[String(v)],onToggle:function(){N(),P(v,"right")},navigation:x.id?O[x.id]:null}),m&&V&&o(r,e({ref:C.current[v],"data-section-id":E.id,onClick:function(e){var o,n,i;if(Y){var t=R.enableDeviationSchemaBackwardCompatibility?null!==(o=E.evaluationResult)&&void 0!==o?o:null:null!==(i=null===(n=E.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==i?i:null;T(e,String(v),Y,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Y?"4px":"0px",fontSize:"11px",bgcolor:V.badgeBg,color:V.badgeText,border:"1px solid ".concat(V.badgeBorder),borderRadius:Y?"12px":"10px",px:Y?1.2:1,py:.3,fontWeight:Y?600:700,cursor:Y?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:Y?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:Y?n(i,{children:[n(r,e({component:"span",onClick:function(e){var o,n,i;e.stopPropagation();var t=R.enableDeviationSchemaBackwardCompatibility?null!==(o=E.evaluationResult)&&void 0!==o?o:null:null!==(i=null===(n=E.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==i?i:null;T(e,String(v),Y,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(V.badgeBorder),"&:hover":{bgcolor:"".concat(V.badgeBorder,"22")}}},{children:[null!=q&&o(r,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(V.badgeBorder)}},{children:q})),o(r,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:!R.isLoading||null!=E.evaluationResult&&void 0!==E.evaluationResult?V.label?"".concat(V.label):"100% Deviation":o(d,{color:V.badgeText})}))]})),n(r,e({component:"span",onClick:function(e){e.stopPropagation();var o=m?h.find(function(e){var o;return null===(o=e.refIndexes)||void 0===o?void 0:o.includes(E.selfIndex)})||{title:"",content:""}:h[v]||{title:"",content:""};k(e,o,Y,E,v,V)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(V.badgeBorder,"22")}}},{children:[o(l,{size:11,color:V.badgeText}),H&&o(c,{locked:z,onToggle:L,color:V.badgeText,borderColor:V.badgeBorder,size:11})]}))]}):o(i,{children:o(r,e({component:"span",sx:{px:.2}},{children:null!=q?q:""}))})}))]}))}))}),"right-row-".concat(v))});export{p as default};
|
|
2
|
+
//# sourceMappingURL=RHSSectionRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RHSSectionRow.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Tooltip as i,Box as t}from"@mui/material";var n=function(n){var l=n.locked,c=n.onToggle,s=n.color,d=void 0===s?"#3730A3":s,a=n.borderColor,h=void 0===a?"#C7D2FE":a,u=n.size,p=void 0===u?12:u,k=l?function(i){var t=i.size,n=i.color;return r("svg",o({xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-lock-icon lucide-lock"},{children:[e("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}))}:function(i){var t=i.size,n=i.color;return r("svg",o({xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-lock-open-icon lucide-lock-open"},{children:[e("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e("path",{d:"M7 11V7a5 5 0 0 1 9.9-1"})]}))};return e(i,o({title:l?"Unlock scroll":"Lock scroll",placement:"top"},{children:e(t,o({component:"span",onClick:c,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:.5,borderLeft:"1px solid ".concat(h),cursor:"pointer"}},{children:e(k,{size:p,color:d})}))}))};export{n as default};
|
|
2
|
+
//# sourceMappingURL=ScrollLockToggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollLockToggle.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import o,{useEffect as t}from"react";import{Box as l,Accordion as r,AccordionSummary as d,Tooltip as a,Typography as c,AccordionDetails as u}from"@mui/material";import{ChevronUp as s,ChevronDown as v}from"lucide-react";import{MemoizedMarkdown as f}from"../hooks/memoizedMarkdown.js";import{useCompareContext as p}from"../CompareContext.js";import{hasValue as h,hasMeaningfulRedlineTags as g,stripRedlineTags as m,generateColorPalette as x,isMissingStr as I,safeStringify as b,DEVIATION_BADGE_SEPARATOR as y}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as w}from"../CognitiveCompareConstants.js";var S=function(S){var _,k,F,R,B,C,M,A,O,W,T,j,E,N=S.section,P=S.idx,D=S.columnKey,K=S.colRef,L=S.mb,z=void 0===L?1:L,V=S.isExpanded,G=S.onToggle,H=S.navigation,X=S.parentNodeId,Y=void 0===X?"":X,q=p(),J=q.showOpenNodeRef,Q=q.resolvedMarkdownStyles,U=q.maintainRelativeOrder,Z=q.showDeviationBadges,$=void 0!==Z&&Z,nn=q.renderSubSectionAccordion,en=q.treeData,on=q.proposedSections,tn=q.existingSections,ln=q.deviationNumberRegistry,rn=q.getBadgeRef,dn=q.openSummaryPopup,an=q.getSectionCompareStyle,cn=q.connectedSections,un=q.openMoreFunctionsPopup;q.deviationNodeIdToView,q.deviationTargetParentId;var sn=q.isProposingFix,vn=q.proposingFixNodeId,fn=q.isRedlineFlow,pn=q.isSideBySide,hn=q.activeSideBySideSection,gn=q.scrollSyncLocked,mn=q.toggleScrollSyncLocked,xn=q.summaryPopupAnchorEl,In="".concat(pn?"1":"0","-").concat(String(null!=hn?hn:"")),bn=(null===(_=N.displayTitle)||void 0===_||_)&&h(N.title),yn=!!sn&&!!vn&&"left"===D&&N.id===vn,wn=g(N.content),Sn="boolean"==typeof fn?fn:wn,_n=wn,kn=Sn&&wn,Fn=kn?m(N.content):N.content,Rn=kn?N.content:void 0,Bn=(null===(k=N.displayContent)||void 0===k||k||wn)&&h(N.content),Cn=!bn&&!Bn,Mn=N.title;bn||(Mn=Bn?"No Title Found":"No Matching Section Found");var An=N.evaluationResult;if(!An&&"right"===D)if(U){var On=null===(F=N.refIndexes)||void 0===F?void 0:F[0],Wn=on.find(function(n){return n.selfIndex===On});An=null==Wn?void 0:Wn.evaluationResult}else An=null===(R=on[P])||void 0===R?void 0:R.evaluationResult;var Tn=null===(B=null==en?void 0:en.input_index_map)||void 0===B?void 0:B[0],jn=null===(C=null==en?void 0:en.input_index_map)||void 0===C?void 0:C[1],En="left"===D?jn:Tn,Nn=function(n,e){var i;if(!e||!n)return null;for(var o=0,t=n;o<t.length;o++){var l=t[o];if(l.id===e)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var r=Nn(l.subsections,e);if(r)return r}}return null},Pn="left"===D?N:Nn(on,N.id),Dn="right"===D?N:Nn(tn,N.id),Kn=o.useMemo(function(){if(!U)return 0;var n=1/0,e=function(i,o,t,l){var r;if(i){var d=i.id;if(l&&"right"===D){var a=on.filter(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(i.selfIndex)});a.length>0&&(d=a[0].id)}var c=i.id||(null==o?void 0:o.id)||(null==t?void 0:t.id),u=(null===(r=i.evaluationResult)||void 0===r?void 0:r.deviations)||{};Object.keys(u).forEach(function(e){var i="".concat(d).concat(y).concat(e),o=null==ln?void 0:ln[i];null!=o&&o<n&&(n=o);var t="".concat(c).concat(y).concat(e),l=null==ln?void 0:ln[t];null!=l&&l<n&&(n=l)});for(var s=i.subsections||[],v=(null==o?void 0:o.subsections)||[],f=(null==t?void 0:t.subsections)||[],p=Math.max(s.length,v.length,f.length),h=0;h<p;h++)e(s[h],v[h],f[h],!1)}};return e(N,Pn,Dn,!0),n!==1/0?n-1:0},[N,Pn,Dn,D,ln,U,on]);if(U)if("left"===D){var Ln=null===(M=N.refIndexes)||void 0===M?void 0:M[0],zn=tn.findIndex(function(n){return n.selfIndex===Ln});Dn=-1!==zn?tn[zn]:Nn(tn,N.id)}else{var Vn=null===(A=N.refIndexes)||void 0===A?void 0:A[0],Gn=on.findIndex(function(n){return n.selfIndex===Vn});Pn=-1!==Gn?on[Gn]:Nn(on,N.id)}var Hn="left"===D?!Dn:!Pn,Xn=An||(null==Pn?void 0:Pn.evaluationResult)||(null==Dn?void 0:Dn.evaluationResult),Yn=null!==(T=null===(W=null===(O=null==Xn?void 0:Xn.evaluation_outputs)||void 0===O?void 0:O.metadata)||void 0===W?void 0:W.label_color)&&void 0!==T?T:w,qn=x(Yn).highlightBg,Jn=(null==Xn?void 0:Xn.deviations)||{},Qn=P+1,Un=N.id;if(U){var Zn=1,$n=new Map;if(on.forEach(function(n){!n.title&&!n.content||n.id&&$n.set(n.id,Zn++)}),"left"===D)Qn=$n.get(N.id)||P+1;else{var ne=on.filter(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(N.selfIndex)});if(ne.length>0)Qn=$n.get(ne[0].id)||P+1,Un=ne[0].id;else for(var ee=Zn,ie=function(n){if(!n.title&&!n.content)return"continue";var e=on.some(function(e){var i;return null===(i=e.refIndexes)||void 0===i?void 0:i.includes(n.selfIndex)});if(!e){if(n.id===N.id)return Qn=ee,"break";ee++}},oe=0,te=tn;oe<te.length;oe++){if("break"===ie(te[oe]))break}}}var le=Object.entries(Jn).map(function(n){var e=n[0],i=n[1],o="".concat(Un).concat(y).concat(e);return{deviationKey:e,deviationMap:i,refId:o,currentIndex:ln[o]}}).filter(function(n){return void 0!==n.currentIndex&&null!==n.currentIndex});le.sort(function(n,e){return n.currentIndex-e.currentIndex});var re,de=le.map(function(e){var i,o,t,l,r,d,a=e.deviationKey,c=e.deviationMap,u=e.refId,s=e.currentIndex;U&&void 0!==Kn&&(s-=Kn);var v=c[Y],f=I(v);if(f)v="";else if(!v)return null;var p=P,h=P;if(U)if("left"===D){var g=null===(i=N.refIndexes)||void 0===i?void 0:i[0],m=tn.findIndex(function(n){return n.selfIndex===g});if(-1!==m)h=m;else{var b=tn.findIndex(function(n){return n.id===N.id});h=-1!==b?b:P}}else{var w=null===(o=N.refIndexes)||void 0===o?void 0:o[0],S=on.findIndex(function(n){return n.selfIndex===w});if(-1!==S)p=S;else{var _=on.findIndex(function(n){return n.id===N.id});p=-1!==_?_:P}}var k="".concat(Un).concat(y).concat(a).concat(y).concat(p).concat(y).concat(h),F=c[En],R=Hn||I(F),B="".concat(Qn,".").concat(s),C=P;if("right"===D&&U){var M=null===(t=N.refIndexes)||void 0===t?void 0:t[0],A=on.findIndex(function(n){return n.selfIndex===M});if(-1!==A)C=A;else{_=on.findIndex(function(n){return n.id===N.id});-1!==_&&(C=_)}}var O=an?an(C):null,W=(null==c?void 0:c.evaluation_outputs)||(null==Xn?void 0:Xn.evaluation_outputs),T=null!==(l=null==W?void 0:W.output_value)&&void 0!==l?l:null,j=null!==(d=null===(r=null==W?void 0:W.metadata)||void 0===r?void 0:r.label_color)&&void 0!==d?d:Yn,E=x(j),K=O?n(n({},O),{badgeBg:E.badgeBg,badgeBorder:E.badgeBorder,badgeText:E.badgeText}):n({},E),L=(null==c?void 0:c.deviation_summary)?{deviation_summary:c.deviation_summary,deviation_title:(null==c?void 0:c.deviation_title)||(null==Xn?void 0:Xn.deviation_title),deviation_impact:(null==c?void 0:c.deviation_impact)||(null==Xn?void 0:Xn.deviation_impact),deviation_explanation:(null==c?void 0:c.deviation_explanation)||(null==Xn?void 0:Xn.deviation_explanation),evaluation_outputs:W,cognitive_decisioning:(null==c?void 0:c.cognitive_decisioning)||(null==Xn?void 0:Xn.cognitive_decisioning)}:null,z=0,V=Fn||"";if(v&&V){var G=V.split(/\n{2,}/),H=G.findIndex(function(n){return n.includes(v)});if(-1!==H){var X=Object.entries(Jn).filter(function(n){n[0];var e=n[1][Y];return e&&G[H].includes(e)}).sort(function(n,e){return G[H].indexOf(n[1][Y])-G[H].indexOf(e[1][Y])}),q=X.filter(function(n){n[0];var e=n[1][Y];return e&&(e.includes(v)||v.includes(e))});q.length>1&&(z=Math.max(0,q.findIndex(function(n){return n[0]===a})))}}var J=rn(D,u);return{id:u,actionId:k,label:B,highlight:v,side:D,style:K,stackIndex:z,score:T,isConnected:null==cn?void 0:cn.has(k),showScrollLockToggle:(null==cn?void 0:cn.has(k))||pn&&hn===k||!!xn&&xn===J.current,scrollSyncLocked:gn,toggleScrollSyncLocked:mn,isOrphan:R,isMissingClause:f,badgeRef:J,onClick:function(n){n.stopPropagation(),un&&un(n,Pn||{id:"orphan-left",title:"",content:""},R,Dn||{id:"orphan-right",title:"",content:""},k,K)},onSummaryClick:function(n){n.stopPropagation(),dn(n,k,R,L)}}}).filter(Boolean),ae=$||!Sn&&yn?de:[],ce=de.map(function(n){return n.highlight}).filter(Boolean),ue=N.id&&D===(null==H?void 0:H.columnKey)?H:null,se=o.useRef(!1);return t(function(){V||(se.current=!1)},[V]),e(l,n({ref:K,sx:{mb:z,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:[V&&(null==ue?void 0:ue.showAbove)&&i("div",n({style:{position:"sticky",top:0,height:"0px",cursor:"pointer"},onClick:function(){var n,e;return null===(e=null===(n=null==ue?void 0:ue.showAboveRef)||void 0===n?void 0:n.current)||void 0===e?void 0:e.scrollIntoView({behavior:"smooth",block:"center"})}},{children:i("div",n({style:n({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===D?"+":"-"," 130px))"),position:"absolute",paddingTop:"20px"},"left"===D?{right:"0px"}:{left:"0px"})},{children:i(s,{color:(null===(j=null==ue?void 0:ue.showAboveRef)||void 0===j?void 0:j.current)?window.getComputedStyle(ue.showAboveRef.current).color:void 0})}))})),e(r,n({disableGutters:!0,expanded:!Cn&&V,onChange:function(){Cn||(G(),J.current=N.id)},sx:{boxShadow:"none",border:Cn?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:Cn?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flexGrow:1,width:"100%",display:"flex",flexDirection:"column",minWidth:0,"&:before":{display:"none"},"& .MuiAccordion-heading":{position:"sticky",top:-12,zIndex:10,background:"#fff"}}},{children:[i(d,n({expandIcon:Cn?null:i(v,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:Cn?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:bn&&i(a,n({title:Mn,placement:"top"},{children:i(c,n({component:"div",sx:{fontSize:"12px",color:Cn?"#94A3B8":"#19213D",fontWeight:Cn?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:(re=Mn,re?b(re).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(n,e){return n.startsWith("**")&&n.endsWith("**")?i("strong",{children:n.slice(2,-2)},e):i(o.Fragment,{children:n},e)}):null)}))}))})),!Cn&&e(u,n({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[Bn&&i(f,{content:Fn,overlayContent:Rn,sxStyles:Q,highlights:ce,maintainRelativeOrder:U,highlightBg:qn,suppressHighlightBg:_n,deviationBadges:ae,collisionKey:In}),(N.subsections||[]).map(function(n,e){return nn({section:n,keyPath:"".concat(P,"-").concat(e),depth:0,columnKey:D,parentNodeId:Y,sectionOffset:Kn})})]}))]})),V&&(null==ue?void 0:ue.showBelow)&&i("div",n({style:{position:"sticky",bottom:0,height:"0px",cursor:"pointer"},onClick:function(){var n,e;return null===(e=null===(n=null==ue?void 0:ue.showBelowRef)||void 0===n?void 0:n.current)||void 0===e?void 0:e.scrollIntoView({behavior:"smooth",block:"center"})}},{children:i("div",n({style:n({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===D?"+":"-"," 130px))"),position:"absolute",paddingBottom:"20px"},"left"===D?{right:"0px"}:{left:"0px"})},{children:i(v,{color:(null===(E=null==ue?void 0:ue.showBelowRef)||void 0===E?void 0:E.current)?window.getComputedStyle(ue.showBelowRef.current).color:void 0})}))}))]}),"".concat(D,"-sec-").concat(P))};export{S as default};
|
|
2
|
+
//# sourceMappingURL=SectionAccordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionAccordion.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as n}from"tslib";import{jsx as i,jsxs as e}from"react/jsx-runtime";import t,{useRef as o,useEffect as l}from"react";import{Box as r,Accordion as d,AccordionSummary as a,Typography as u,AccordionDetails as c}from"@mui/material";import{ChevronDown as s}from"lucide-react";import{MemoizedMarkdown as v}from"../hooks/memoizedMarkdown.js";import{useCompareContext as f}from"../CompareContext.js";import{hasValue as p,hasMeaningfulRedlineTags as h,stripRedlineTags as m,generateColorPalette as g,isMissingStr as x,DEVIATION_BADGE_SEPARATOR as y}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as S}from"../CognitiveCompareConstants.js";var b=t.memo(function(t){var I,_,k,w,C,P,B,F,R,O,M=t.section,E=t.keyPath,j=t.depth,N=void 0===j?0:j,K=t.columnKey,W=void 0===K?"left":K,L=t.parentNodeId,T=void 0===L?"":L,z=t.sectionOffset,A=f(),D=A.expandedSubSections,H=A.setExpandedSubSections,G=A.maintainRelativeOrder,U=A.showDeviationBadges,V=void 0!==U&&U,q=A.proposedSections,J=A.existingSections,Q=A.treeData,X=A.deviationNumberRegistry,Y=A.connectedSections,Z=A.activeSideBySideSection,$=A.isSideBySide,nn=A.scrollSyncLocked,en=A.toggleScrollSyncLocked,tn=A.summaryPopupAnchorEl,on=A.resolvedMarkdownStyles,ln=A.getSubSectionRef,rn=A.getSubSectionCompareStyle,dn=A.getBadgeRef,an=A.openMoreFunctionsPopup,un=A.openSummaryPopup,cn=A.resetSideBySide,sn=A.setConnectedSections,vn=A.setConnectedLines,fn=A.cachedConnectedPositions,pn=A.isProposingFix,hn=A.proposingFixNodeId,mn=A.isRedlineFlow,gn=null!=Z?Z:"",xn=(null===(I=M.displayTitle)||void 0===I||I)&&p(M.title),yn=!!pn&&!!hn&&"left"===W&&M.id===hn,Sn=h(M.content),bn="boolean"==typeof mn?mn:Sn,In=Sn,_n=bn&&Sn,kn=_n?m(M.content):M.content,wn=_n?M.content:void 0,Cn=(null===(_=M.displayContent)||void 0===_||_||Sn)&&p(M.content),Pn=!xn&&!Cn,Bn=xn?M.title:Cn?"No Title Found":"No Matching Section Found",Fn=!!D[E],Rn=ln(W,E),On=E.split("-").map(Number)[0],Mn=q[On],En=J[On],jn=On,Nn=On,Kn=function(n,i,e){if(!n||!i)return null;if(n.id===i)return{section:n,keyPath:e};for(var t=(n.subsections||[]).map(function(n,i){return{section:n,keyPath:"".concat(e,"-").concat(i)}}),o=function(){var n=t.shift();return(null==n?void 0:n.section)?n.section.id===i?{value:n}:void(n.section.subsections||[]).forEach(function(i,e){t.push({section:i,keyPath:"".concat(n.keyPath,"-").concat(e)})}):"continue"};t.length>0;){var l=o();if("object"==typeof l)return l.value}return null};if(G)if("left"===W){var Wn=null===(k=null==Mn?void 0:Mn.refIndexes)||void 0===k?void 0:k[0],Ln=J.findIndex(function(n){return n.selfIndex===Wn});-1!==Ln&&(En=J[Ln],Nn=Ln)}else{var Tn=null===(w=null==En?void 0:En.refIndexes)||void 0===w?void 0:w[0],zn=q.findIndex(function(n){return n.selfIndex===Tn});-1!==zn&&(Mn=q[zn],jn=zn)}var An=function(n,i){if(!i||!n)return null;for(var e=0;e<n.length;e++){var t=Kn(n[e],i,String(e));if(t)return t}return null},Dn=null,Hn=null,Gn="",Un="";if(G)"left"===W?(Dn=M,Gn=E,(Vn=Kn(En,M.id,String(Nn)))||(Vn=An(J,M.id)),Hn=(null==Vn?void 0:Vn.section)||null,Un=(null==Vn?void 0:Vn.keyPath)||""):(Hn=M,Un=E,(qn=Kn(Mn,M.id,String(jn)))||(qn=An(q,M.id)),Dn=(null==qn?void 0:qn.section)||null,Gn=(null==qn?void 0:qn.keyPath)||"");else if("left"===W){Dn=M,Gn=E;var Vn=An(J,M.id);Hn=(null==Vn?void 0:Vn.section)||null,Un=(null==Vn?void 0:Vn.keyPath)||""}else{Hn=M,Un=E;var qn=An(q,M.id);Dn=(null==qn?void 0:qn.section)||null,Gn=(null==qn?void 0:qn.keyPath)||""}var Jn=(Gn?rn(Gn):null)||rn(E),Qn=null===(C=null==Q?void 0:Q.input_index_map)||void 0===C?void 0:C[0],Xn=null===(P=null==Q?void 0:Q.input_index_map)||void 0===P?void 0:P[1],Yn="left"===W?Xn:Qn,Zn="left"===W?!Hn:!Dn,$n=M.evaluationResult||(null==Dn?void 0:Dn.evaluationResult)||(null==Hn?void 0:Hn.evaluationResult),ni=On+1,ii=M.id||(null==Dn?void 0:Dn.id)||(null==Hn?void 0:Hn.id);if(G){var ei=1,ti=new Map;if(q.forEach(function(n){!n.title&&!n.content||n.id&&ti.set(n.id,ei++)}),"left"===W)ni=ti.get(null==Mn?void 0:Mn.id)||On+1;else{var oi=q.filter(function(n){var i;return null===(i=n.refIndexes)||void 0===i?void 0:i.includes(null==En?void 0:En.selfIndex)});if(oi.length>0)ni=ti.get(oi[0].id)||On+1;else for(var li=ei,ri=function(n){if(!n.title&&!n.content)return"continue";var i=q.some(function(i){var e;return null===(e=i.refIndexes)||void 0===e?void 0:e.includes(n.selfIndex)});if(!i){if(n.id===(null==En?void 0:En.id))return ni=li,"break";li++}},di=0,ai=J;di<ai.length;di++){if("break"===ri(ai[di]))break}}}var ui=null!==(R=null===(F=null===(B=null==$n?void 0:$n.evaluation_outputs)||void 0===B?void 0:B.metadata)||void 0===F?void 0:F.label_color)&&void 0!==R?R:S,ci=g(ui).highlightBg,si=(null==$n?void 0:$n.deviations)||{},vi=Object.entries(si).map(function(n){var i=n[0],e=n[1],t="".concat(ii).concat(y).concat(i);return{deviationKey:i,deviationMap:e,refId:t,currentIndex:X[t]}}).filter(function(n){return void 0!==n.currentIndex&&null!==n.currentIndex});vi.sort(function(n,i){return n.currentIndex-i.currentIndex});var fi=vi.map(function(i){var e,t,o,l=i.deviationKey,r=i.deviationMap,d=i.refId,a=i.currentIndex;G&&void 0!==z&&(a-=z);var u=r[T],c=x(u);if(c)u="";else if(!u)return null;var s=r[Yn],v=Zn||x(s),f="".concat(ni,".").concat(a),p="".concat(ii).concat(y).concat(l).concat(y).concat(Gn).concat(y).concat(Un),h=(null==r?void 0:r.evaluation_outputs)||(null==$n?void 0:$n.evaluation_outputs),m=null!==(e=null==h?void 0:h.output_value)&&void 0!==e?e:null,S=null!==(o=null===(t=null==h?void 0:h.metadata)||void 0===t?void 0:t.label_color)&&void 0!==o?o:ui,b=g(S),I=n({},b),_=(null==r?void 0:r.deviation_summary)?{deviation_summary:r.deviation_summary||(null==$n?void 0:$n.deviation_summary),deviation_title:(null==r?void 0:r.deviation_title)||(null==$n?void 0:$n.deviation_title),deviation_impact:(null==r?void 0:r.deviation_impact)||(null==$n?void 0:$n.deviation_impact),deviation_explanation:(null==r?void 0:r.deviation_explanation)||(null==$n?void 0:$n.deviation_explanation),evaluation_outputs:h,cognitive_decisioning:(null==r?void 0:r.cognitive_decisioning)||(null==$n?void 0:$n.cognitive_decisioning)}:null,k=0,w=kn||"";if(u&&w){var C=w.split(/\n{2,}/),P=C.findIndex(function(n){return n.includes(u)});if(-1!==P){var B=Object.entries(si).filter(function(n){n[0];var i=n[1][T];return i&&C[P].includes(i)}).sort(function(n,i){return C[P].indexOf(n[1][T])-C[P].indexOf(i[1][T])}),F=B.filter(function(n){n[0];var i=n[1][T];return i&&(i.includes(u)||u.includes(i))});F.length>1&&(k=Math.max(0,F.findIndex(function(n){return n[0]===l})))}}var R=dn(W,d);return{id:d,actionId:p,label:f,highlight:u,side:W,style:I,stackIndex:k,score:m,isConnected:Y.has(p),showScrollLockToggle:Y.has(p)||$&&Z===p||!!tn&&tn===R.current,scrollSyncLocked:nn,toggleScrollSyncLocked:en,isOrphan:v,isMissingClause:c,badgeRef:R,onClick:function(i){i.stopPropagation();var e=Dn?n(n({},Dn),{title:(null==Mn?void 0:Mn.title)||(null==Dn?void 0:Dn.title)||""}):{id:"orphan-left",title:"",content:""},t=Hn?n(n({},Hn),{title:(null==En?void 0:En.title)||(null==Hn?void 0:Hn.title)||""}):{id:"orphan-right",title:"",content:""};an(i,e,v,t,p,I)},onSummaryClick:function(n){n.stopPropagation(),un(n,p,v,_)}}}).filter(Boolean).sort(function(n,i){return parseFloat(n.label)-parseFloat(i.label)}),pi=V||!bn&&yn?fi:[],hi=fi.map(function(n){return n.highlight}).filter(Boolean),mi=o(!1);l(function(){Fn||(mi.current=!1)},[Fn]),l(function(){if(Fn&&!mi.current){var n=setTimeout(function(){var n,i;mi.current=!0;var e=null===(i=null===(n=fi[0])||void 0===n?void 0:n.badgeRef)||void 0===i?void 0:i.current;e&&e.scrollIntoView({behavior:"smooth",block:"center"})},350);return function(){return clearTimeout(n)}}},[Fn,fi]);var gi=fi.find(function(n){return Y.has(n.actionId)}),xi=!!gi;if(!(xn||Cn||M.subsections&&0!==M.subsections.length))return null;var yi=(null===(O=null==gi?void 0:gi.style)||void 0===O?void 0:O.badgeBorder)||(null==Jn?void 0:Jn.badgeBorder),Si=xi&&yi?{borderRadius:"4px",outline:"2px solid ".concat(yi),outlineOffset:"1px"}:{};return i(r,xn?n({ref:Rn,sx:{mt:1,width:"100%",minWidth:0,position:"relative"}},{children:i(r,n({sx:n({width:"100%"},Si)},{children:e(d,n({disableGutters:!0,expanded:!Pn&&Fn,onChange:function(){if(!Pn){if(Fn){var i=String(Z||""),e=i.includes(Gn)||i.includes(Un);e||Y.forEach(function(n){(String(n).includes(Gn)||String(n).includes(Un))&&(e=!0)}),e&&(cn(),sn(new Set),vn([]),fn.current=[])}H(function(i){var e;return n(n({},i),((e={})[E]=!i[E],e))})}},sx:{mt:0,boxShadow:"none",border:Pn?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF",minWidth:0,"&:before":{display:"none"}}},{children:[i(a,n({expandIcon:Pn?null:i(s,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"}}},{children:i(u,n({component:"div",sx:{fontSize:"11px",fontWeight:600,color:Pn?"#94A3B8":"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:Bn||"Untitled Subsection"}))})),!Pn&&e(c,n({sx:{pt:0,pb:1,minWidth:0}},{children:[Cn&&i(v,{content:kn,overlayContent:wn,sxStyles:on,deviationBadges:pi,maintainRelativeOrder:G,highlightBg:ci,suppressHighlightBg:In,highlights:hi,collisionKey:gn}),(M.subsections||[]).map(function(n,e){return i(b,{section:n,keyPath:"".concat(E,"-").concat(e),depth:N+1,columnKey:W,parentNodeId:T},"".concat(E,"-").concat(e))})]}))]}))}))}):n({ref:Rn,sx:{mt:0===N?1:.75,width:"100%",minWidth:0,position:"relative"}},{children:!Pn&&e(r,n({sx:n({width:"100%"},Si)},{children:[Cn&&i(v,{content:kn,overlayContent:wn,sxStyles:on,deviationBadges:pi,maintainRelativeOrder:G,highlightBg:ci,suppressHighlightBg:In,highlights:hi,collisionKey:gn}),(M.subsections||[]).map(function(n,e){return i(b,{section:n,keyPath:"".concat(E,"-").concat(e),depth:N+1,columnKey:W,parentNodeId:T,sectionOffset:z},"".concat(E,"-").concat(e))})]}))}))});export{b as default};
|
|
2
|
+
//# sourceMappingURL=SubSectionAccordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubSectionAccordion.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as i}from"react/jsx-runtime";import{ChevronDown as n}from"lucide-react";import{ButtonCognitiveIcon as o}from"../../../assests/svg/ButtonCognitiveIcon.js";import{getBentArrowPath as l,DEVIATION_BADGE_SEPARATOR as s}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as r}from"../CognitiveCompareConstants.js";import a from"./ThreeDotsLoader.js";import d from"./connectedLines.js";import{Box as c}from"@mui/material";function u(u){var g=u.svgContainerRef,p=u.svgDimensions,v=u.isResizing,h=u.overallConnector,y=u.rootDeviationStyle,f=u.lines,m=u.isSideBySide,x=u.activeSideBySideSection,b=u.isArrowVisible,S=u.maintainRelativeOrder,C=u.proposedSections,I=u.existingSections,w=u.cognitivePopup,B=u.activeBadgeId,P=u.closeCognitivePopup,R=u.setActiveBadgeId,j=u.openCognitivePopupFromState,D=u.buildSectionPopupState,k=u.connectedLines,K=u.pathRefs;return t("svg",e({ref:g,style:{position:"absolute",top:0,left:0,width:p.width||"100%",height:p.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:v?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[h&&i("g",{children:i("line",{x1:h.x1,y1:h.y,x2:h.x2,y2:h.y,stroke:y.badgeBorder,strokeWidth:"1.5"})}),f.map(function(d){var u,g,p,v,h,y,f,k=d.x1+.5*(d.x2-d.x1),K=(d.y1+d.y2)/2;if("Not Defined"===d.style.label&&!d.hasCognitive)return null;if(d.isSubSection?m&&x===d.subSectionKeyPath&&b:m&&x===d.sectionIdx&&b)return null;if(S)return null;var L=d.isSubSection?l(d.x1,d.y1,d.x2,d.y2):"M ".concat(d.x1," ").concat(d.y1," L ").concat(d.x2," ").concat(d.y2),T=C[d.sectionIdx]||{title:"",content:""},z=I[null!==(u=d.targetRightIdx)&&void 0!==u?u:d.sectionIdx]||{title:"",content:""};if(d.isSubSection&&d.subSectionKeyPath){var E=d.subSectionKeyPath.includes(s)?d.subSectionKeyPath.split(s):[],A=E[2]||d.subSectionKeyPath,N=E[3]||A,O=A.split("-").map(Number),W=N.split("-").map(Number),F=null,M=null;O.length>0&&(F=C[O[0]]||null),W.length>0&&(M=I[W[0]]||null);for(var _=(null==F?void 0:F.title)||"",V=(null==M?void 0:M.title)||"",q=1;q<O.length;q+=1)(null==F?void 0:F.subsections)&&(F=F.subsections[O[q]]||null);for(q=1;q<W.length;q+=1)(null==M?void 0:M.subsections)&&(M=M.subsections[W[q]]||null);F&&(T=e(e({},F),{title:_||F.title})),M&&(z=e(e({},M),{title:V||M.title}))}var G=!(null===(g=T.cognitiveData)||void 0===g?void 0:g.isMissingRationale)||Boolean(null===(v=null===(p=T.cognitiveData)||void 0===p?void 0:p.decisioning)||void 0===v?void 0:v.length),H=(null===(f=null===(y=null===(h=T.evaluationResult)||void 0===h?void 0:h.cognitive_decisioning)||void 0===y?void 0:y.decisioning_factors)||void 0===f?void 0:f.length)||!1,J=G||H;return t("g",{children:[i("path",{d:L,fill:"none",stroke:d.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i("foreignObject",e({x:k-100,y:K-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(c,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t(c,e({onClick:function(e){e.stopPropagation(),J&&(w.open&&B===d.id?P():(R(d.id),j(D(e.currentTarget,T,z,d.sectionIdx,!1,d.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:d.style.badgeBg,color:d.style.badgeText,border:"1px solid ".concat(d.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:J?"pointer":"default"}},{children:[d.style.badgeText===r&&null==d.style.label?i(a,{color:d.style.badgeText}):null==d.style.label?null:"0"===String(d.style.label)?"Same":d.style.label,i(c,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(o,{})})),J&&i(n,{size:11,style:{transform:w.open&&B===d.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},d.id)}),i(d,{maintainRelativeOrder:S,connectedLines:k,pathRefs:K})]}))}export{u as default};
|
|
2
|
+
//# sourceMappingURL=SvgConnectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgConnectors.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import{Box as o}from"@mui/material";var r=function(r){var i=r.size,a=void 0===i?6:i,n=r.color,s=void 0===n?"text.secondary":n,c=r.gap;return e(o,t({sx:{display:"flex",gap:void 0===c?.5:c,alignItems:"center"}},{children:[0,.16,.32].map(function(t,r){return e(o,{sx:{width:a,height:a,bgcolor:s,borderRadius:"50%",animation:"threeDotsBounce 1.4s infinite ease-in-out both",animationDelay:"".concat(t,"s"),"@keyframes threeDotsBounce":{"0%, 80%, 100%":{transform:"scale(0)",opacity:.3},"40%":{transform:"scale(1)",opacity:1}}}},r)})}))};export{r as default};
|
|
2
|
+
//# sourceMappingURL=ThreeDotsLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreeDotsLoader.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as r}from"tslib";import{jsx as o,Fragment as e,jsxs as t}from"react/jsx-runtime";import{Box as n}from"@mui/material";import i from"./ScrollLockToggle.js";import{useCompareContext as c}from"../CompareContext.js";var l=function(l){var a=l.connectedLines,d=l.pathRefs,s=l.maintainRelativeOrder,f=c(),p=f.scrollSyncLocked,h=f.toggleScrollSyncLocked;return o(e,{children:a.map(function(e){var c,l,a=e.pathD,f=(null===(c=e.style)||void 0===c?void 0:c.badgeBorder)||"#6366F1",m="conn-marker-".concat(e.id),u="".concat(e.id,"-bg"),g="".concat(e.id,"-stroke"),k="".concat(e.id,"-btn"),v=void 0!==e.x1?e.x1+40:0,x=void 0!==e.y1?e.y1:0;return t("g",{children:[o("defs",{children:o("clipPath",r({id:"connections-clip"},{children:o("marker",r({id:m,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:o("polygon",{points:"0 0, 8 3, 0 6",fill:f})}))}))}),o("path",{ref:function(r){d.current[u]=r},d:a,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),o("path",{ref:function(r){d.current[g]=r},d:a,fill:"none",stroke:f,strokeWidth:"1.75",markerEnd:"url(#".concat(m,")")}),s&&void 0!==e.x1&&o("foreignObject",r({ref:function(r){d.current[k]=r},x:v-12,y:x-12,width:"24",height:"24",style:{pointerEvents:"auto",overflow:"visible"}},{children:o(n,r({onClick:function(r){r.stopPropagation(),h&&h(r)},sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",bgcolor:"#FFFFFF",borderRadius:"50%",border:"1px solid ".concat(f),cursor:"pointer",transition:"transform 0.2s ease","&:hover":{transform:"scale(1.05)",boxShadow:"0px 2px 4px rgba(0,0,0,0.1)"}}},{children:o(i,{locked:p,onToggle:h,color:(null===(l=e.style)||void 0===l?void 0:l.badgeText)||f,borderColor:"transparent",size:12})}))}))]},e.id)})})};export{l as default};
|
|
2
|
+
//# sourceMappingURL=connectedLines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectedLines.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as n,__rest as e}from"tslib";import{jsx as t,jsxs as r,Fragment as i}from"react/jsx-runtime";import{Box as o,Typography as a}from"@mui/material";import l,{useRef as c,useMemo as d,useLayoutEffect as s}from"react";import{DEFAULT_DEVIAION_COLOR as u}from"../CognitiveCompareConstants.js";import{EllipsisVertical as h}from"lucide-react";import p from"react-markdown";import{mixHexColors as g,areMarkdownPropsEqual as f}from"../CognitiveComparehelpers.js";import v from"rehype-raw";import m from"remark-gfm";var x=function(n){return"function"==typeof n?n:(null==n?void 0:n.default)||n},b=[x(m)],y=[x(v)],E=l.memo(function(f){var v=f.content,m=f.overlayContent,x=f.sxStyles,E=f.deviationBadges,C=void 0===E?[]:E,B=f.highlights,k=void 0===B?[]:B;f.maintainRelativeOrder;var S=f.highlightBg,F=f.suppressHighlightBg,w=void 0!==F&&F,A=f.collisionKey,z=c(null),T=!!m,I=d(function(){return C.reduce(function(e,t){var r;return n(n({},e),((r={})[t.id]=t,r))},{})},[C]),O=c({badgeMap:I,highlightBg:S,hideHighlightBg:T,suppressHighlightBg:w});O.current={badgeMap:I,highlightBg:S,hideHighlightBg:T,suppressHighlightBg:w};var M=function(e,t){return l.Children.map(e,function(e){var r;if(!l.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?M(e.props.children,t):e.props.children,o=l.cloneElement(e,n(n({},e.props),{children:i}));return t(o)})},j=d(function(){return{mark:function(r){var i,o,a,l,c=r.children,d=e(r,["children"]),s=O.current,u=s.badgeMap,h=s.highlightBg,p=s.hideHighlightBg,g=s.suppressHighlightBg,f=d["data-badge-id"],v=f?u[f]:null,m=d["data-highlight-color"],x=null!==(l=null!==(o=null!=m?m:null===(i=null==v?void 0:v.style)||void 0===i?void 0:i.highlightBg)&&void 0!==o?o:null===(a=null==v?void 0:v.style)||void 0===a?void 0:a.badgeBg)&&void 0!==l?l:h,b="true"===d["data-is-suggested-deviation-fix"]||g;return t("span",n({style:n(n(n({},b?{}:{backgroundColor:x}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),p?{color:"transparent"}:{})},{children:c}))},span:function(i){var a,l,c,d,s,p,g=i.children,f=e(i,["children"]),v=O.current.badgeMap,m=f["data-badge-id"];if(!m)return t("span",n({},f,{children:g}));var x=v[m];if(!x)return t("span",n({},f,{children:g}));var b="number"==typeof x.stackIndex?x.stackIndex:0,y="translateY(calc(-20% + ".concat(12*b,"px + var(--badge-nudge, 0px)))");return r(o,n({component:"span",sx:{position:"static",display:"inline"}},{children:[r(o,n({ref:x.badgeRef,className:"deviation-badge","data-side":x.side||"right",sx:n(n({fontStyle:"normal",position:"absolute",zIndex:30+b,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=x.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(l=x.style)||void 0===l?void 0:l.badgeText)||u,border:"1px solid ".concat((null===(c=x.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===x.side?{right:"-16px",transform:"".concat(y," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(y," translateX(calc(-100% - 8px))")}),x.isConnected&&x.style&&{outline:"2px solid ".concat(x.style.badgeBorder),outlineOffset:"1px"})},{children:[r(o,n({onClick:function(n){n.stopPropagation(),x.onSummaryClick&&x.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[t(o,n({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:x.label})),("left"===x.side||x.isOrphan)&&t(o,n({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=x.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=x.score&&"N/A"!==x.score&&"NA"!==x.score&&0!==x.score?"".concat(x.score):"N/A"===x.score||"NA"===x.score?"N/A":"Same"}))]})),("left"===x.side||x.isOrphan)&&t(o,n({onClick:function(n){n.stopPropagation(),x.onClick&&x.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(s=x.style)||void 0===s?void 0:s.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:t(h,{size:12,color:(null===(p=x.style)||void 0===p?void 0:p.badgeText)||"#3730A3"})}))]})),g]}))},table:function(e){var r=e.children;return t(o,n({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:r}))},thead:function(e){var r=e.children;return t(o,n({component:"thead"},{children:r}))},tbody:function(e){var r=e.children;return t(o,n({component:"tbody"},{children:r}))},tr:function(e){var r=e.children;return t(o,n({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:r}))},th:function(e){var r=e.children;return t(o,n({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:r}))},td:function(e){var r=e.children;return t(o,n({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:r}))},code:function(e){var r=e.children;return t("span",n({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(e){var r=e.children;return t("span",n({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var e=n.children;return t(i,{children:e})},deleted:function(e){var r=e.children,i=M(r,function(n){return l.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return t("span",n({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(e){var r=e.children,i=M(r,function(n){return l.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return t("span",n({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))}}},[]),P=function(n){if(!n||"string"!=typeof n)return"";var e=n.replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n"),t=(e=(e=(e=e.replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).split(/(\n{2,})/);return e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r,i=null!==(r=n[t+1])&&void 0!==r?r:"";return/^[#>|\-*+]/.test(i)||/^\d+\./.test(n.slice(t+1))?"\n":" "})}).join(""),e},D=function(n){return n.replace(/[\.,;:]/g," ")},H=d(function(){return C.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[C]),N=function(n){return'<span data-badge-id="'.concat(n,'">')},R=d(function(){var e=P(v||""),t=w?D(e):e,r=(C||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:P((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||S}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var l=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(i=a[2])&&void 0!==i?i:"",d=null!==(o=a[3])&&void 0!==o?o:"";return c?l+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+c+"</mark>"+d:n}(n,e,t),a=o;return!i&&r.length>0&&(i=!0,a=N(r[0].id)+o+"</span>"),""+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&w){var c=D(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,s=1;s<i.length;s++)d=g(d,i[s].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var l=new Set(Object.keys(i));(k||[]).forEach(function(n){if(n){var r=P(n);if(r&&!l.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&w){var c=D(r);-1!==(i=t.indexOf(c))&&(o=!0)}if(-1!==i){var d=e.slice(0,i);(d.match(/</g)||[]).length===(d.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:S||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var c=[],d={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=c;i<o.length;i++){var a=o[i],l=a.start,s=a.end,u=t<s&&r>s&&t>=l,h=t<l&&r>l&&r<=s;if(t>=l&&r<=s){n.orphaned=!0,d[e]=a.matchIdx;break}u&&(t=s),h&&(r=l)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&c.push({start:t,end:r,matchIdx:e})});var s={};Object.entries(d).forEach(function(n){var e=n[0],t=n[1],r=Number(e);s[t]||(s[t]=[]),s[t].push(r)});var u=a.map(function(e,t){return n(n({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return u.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),s=Math.max(d,t.end-e);if(!(d>=s)){var u=g(r,t.color||"");l+=n.slice(c,d);var h="",p="";(t.badges||[]).forEach(function(n){h+=N(n.id),p="</span>"+p}),l+=h+o(n.slice(d,s),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",u,t.badges||[])+p,c=s}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,s[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[v,C,k,S,w]),$=d(function(){return m?P(m||""):""},[m]),L=!!m,q={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},W=n(n(n(n({},x),q),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),L?{color:"transparent"}:{}),X=n(n(n({},x),q),{position:"relative",overflow:"visible",whiteSpace:"pre-wrap",gridArea:"1 / 1",zIndex:1,pointerEvents:"none"});return s(function(){if(z.current){var n=function(){var n=Array.from(z.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=z.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,l=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=l})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(z.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[R,A,H]),r(o,n({ref:z,sx:{position:"relative",display:"grid"}},{children:[t(a,n({component:"div",sx:n(n({},W),{padding:"3px"})},{children:t(p,n({components:j,remarkPlugins:b,rehypePlugins:y},{children:R.replace(/#{3}/g,"")}))})),L&&t(a,n({component:"div",sx:X},{children:t(p,n({components:j,remarkPlugins:b,rehypePlugins:y},{children:$}))}))]}))},f);export{E as MemoizedMarkdown};
|
|
2
|
+
//# sourceMappingURL=memoizedMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memoizedMarkdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as n}from"tslib";import{useState as e,useCallback as t}from"react";import{DEVIATION_BADGE_SEPARATOR as i}from"../CognitiveComparehelpers.js";var r=function(r){var o=r.maintainRelativeOrder,c=r.proposedSections,u=r.existingSections,s=r.activeSideBySideSection,f=r.connectedSections,l=r.resetSideBySide,a=r.setConnectedSections,d=r.setConnectedLines,v=r.cachedConnectedPositions,S=r.svgContainerRef,p=r.isAnimatingRef,g=r.animationTimerRef,m=r.calculateLinesRef,x=r.sectionLeftRefs,h=r.sectionRightRefs,y=r.subSectionLeftRefs,R=r.subSectionRightRefs,I=e({}),b=I[0],C=I[1],E=e({}),H=E[0],L=E[1],T=function(n){p.current=!0,g.current&&clearTimeout(g.current),S.current&&(S.current.style.opacity="0"),g.current=setTimeout(function(){p.current=!1,m.current(),S.current&&(S.current.style.opacity="1")},n)},w=t(function(e){if(e&&"string"==typeof e&&e.includes(i)){var t=e.split(i),r=t[2],c=t[3],u=r?Number(r.split("-")[0]):-1,s=c?Number(c.split("-")[0]):-1;C(function(e){var t,i=n({},e),r=!1;-1!==u&&(i[t=o?"left-".concat(u):String(u)]||(i[t]=!0,r=!0));-1!==s&&(i[t=o?"right-".concat(s):String(s)]||(i[t]=!0,r=!0));return r?i:e}),L(function(e){var t=n({},e),i=!1,o=function(n){if(n)for(var e=n.split("-"),r=e[0],o=1;o<e.length;o++)r+="-".concat(e[o]),t[r]||(t[r]=!0,i=!0)};return o(r),o(c),i?t:e})}},[o,C,L]);return{expandedSections:b,setExpandedSections:C,expandedSubSections:H,setExpandedSubSections:L,handleSubSectionToggle:function(e){var t,i,r=null===(t=y.current[e])||void 0===t?void 0:t.current,o=null===(i=R.current[e])||void 0===i?void 0:i.current;r&&(r.style.minHeight="0px"),o&&(o.style.minHeight="0px"),T(450),L(function(t){var i;return n(n({},t),((i={})[e]=!t[e],i))})},toggleSection:function(e,t){var r,S,p=null===(r=x.current[e])||void 0===r?void 0:r.current,g=null===(S=h.current[e])||void 0===S?void 0:S.current;p&&(p.style.minHeight="0px"),g&&(g.style.minHeight="0px"),T(650);var m=o?"".concat(t,"-").concat(e):String(e);if(!!b[m]){var y=new Set([String(e)]);if(o)if("left"===t){var R=c[e];((null==R?void 0:R.refIndexes)||[]).forEach(function(n){var e=u.findIndex(function(e){return e.selfIndex===n});-1!==e&&y.add(String(e))})}else{var I=u[e];c.forEach(function(n,e){var t;(null===(t=n.refIndexes)||void 0===t?void 0:t.includes(null==I?void 0:I.selfIndex))&&y.add(String(e))})}var E=function(n){var e,t;if(null===n)return!1;var r=String(n),o=r.split("-")[0];if(y.has(o))return!0;if(r.includes(i)){var c=r.split(i),u=null===(e=c[2])||void 0===e?void 0:e.split("-")[0],s=null===(t=c[3])||void 0===t?void 0:t.split("-")[0];if(u&&y.has(u))return!0;if(s&&y.has(s))return!0}return!1},H=E(s),L=Array.from(f).some(function(n){return E(n)});(H||L)&&(l(),a(new Set),d([]),v.current=[])}C(function(i){var r=n({},i),s=!i[m];if(!o)return r[String(e)]=s,r;if(r[m]=s,"left"===t){((null==(f=c[e])?void 0:f.refIndexes)||[]).forEach(function(n){var e=u.findIndex(function(e){return e.selfIndex===n});-1!==e&&(r["right-".concat(e)]=s)})}else{var f,l=null==(f=u[e])?void 0:f.selfIndex;c.forEach(function(n,e){var t;(null===(t=n.refIndexes)||void 0===t?void 0:t.includes(l))&&(r["left-".concat(e)]=s)})}return r})},forceExpandCrossWiredSections:w}};export{r as useAccordionState};
|
|
2
|
+
//# sourceMappingURL=useAccordionState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccordionState.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as i,__spreadArray as n}from"tslib";import{useMemo as e}from"react";import{getSideData as t,safeStringify as o,getRationale as l,hasValue as s,isMissingStr as d,DEVIATION_BADGE_SEPARATOR as r}from"../CognitiveComparehelpers.js";var u={id:"",title:"",similarity:0,sections:[]},a=function(a,v,c,f,_){void 0===_&&(_=!0);var p="string"==typeof c?c:JSON.stringify(c||{}),b=e(function(){var e,s,d,r;if(!a||0===Object.keys(a).length)return{activeProposed:{},activeVariants:[],parseError:"Tree data is required"};var u=JSON.parse(p);try{var c=a.nodes||a,f=[],b=[],h=a.base_root_id,g=a.input_index_map||{0:"left",1:"right"},m=a[h]||c[h];if(!m||!1===m.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[],parseError:null};var y=function(n,e,t){if(!n||"object"!=typeof n)return n||null;if(n.deviations)return n;if(_)return n;var o=Object.keys(n).filter(function(i){return/^\d+$/.test(i)});if(!o.length)return n;var l=o.sort(function(i,n){return Number(i)-Number(n)}),s={},d={},r=null;return l.forEach(function(i){var o,l,u,a,v,c=n[i];if(c&&"object"==typeof c){r||(r=c);var f=!(null==c?void 0:c.status)||"pending"===c.status,_=f&&((null===(l=null==c?void 0:c.deviation_highlights)||void 0===l?void 0:l[e])||(null===(u=null==c?void 0:c.deviation_highlights)||void 0===u?void 0:u[g[0]]))||[],p=f&&((null===(a=null==c?void 0:c.deviation_highlights)||void 0===a?void 0:a[t])||(null===(v=null==c?void 0:c.deviation_highlights)||void 0===v?void 0:v[g[1]]))||[];s[i]=((o={})[g[0]]=_[0]||"",o[g[1]]=p[0]||"",o.deviation_summary=(null==c?void 0:c.deviation_summary)||"",o.deviation_title=null==c?void 0:c.deviation_title,o.deviation_impact=null==c?void 0:c.deviation_impact,o.deviation_explanation=null==c?void 0:c.deviation_explanation,o.evaluation_outputs=null==c?void 0:c.evaluation_outputs,o.cognitive_decisioning=null==c?void 0:c.cognitive_decisioning,o.deviation_highlights=null==c?void 0:c.deviation_highlights,o),d[i]=c}}),i(i({},n),{deviation_title:(null==r?void 0:r.deviation_title)||(null==n?void 0:n.deviation_title),deviation_impact:(null==r?void 0:r.deviation_impact)||(null==n?void 0:n.deviation_impact),deviation_summary:(null==r?void 0:r.deviation_summary)||(null==n?void 0:n.deviation_summary),deviation_explanation:(null==r?void 0:r.deviation_explanation)||(null==n?void 0:n.deviation_explanation),evaluation_outputs:(null==r?void 0:r.evaluation_outputs)||(null==n?void 0:n.evaluation_outputs),cognitive_decisioning:(null==r?void 0:r.cognitive_decisioning)||(null==n?void 0:n.cognitive_decisioning),deviations:s,deviation_entries:d})},x=function(i){var n=new Map,e=function(i){i.forEach(function(i){var t;i.id&&n.set(i.id,i),(null===(t=i.subsections)||void 0===t?void 0:t.length)&&e(i.subsections)})};e(i);var t=function(i,e){for(var o,l=[],s=function(i){var s=i.ref_parent_section_node_id;if(s&&n.has(s)&&s!==(null==e?void 0:e.id)){var d=n.get(s);d.subsections||(d.subsections=[]),d.subsections.some(function(n){return n.id===i.id})||d.subsections.push(i)}else(null===(o=i.subsections)||void 0===o?void 0:o.length)&&(i.subsections=t(i.subsections,i)),l.push(i)},d=0,r=i;d<r.length;d++){s(r[d])}return l},o=t(i),l=function(i){i.forEach(function(i){i.subsections&&i.subsections.length>0&&(i.subsections.sort(function(i,n){return i.selfIndex<0&&n.selfIndex>=0?1:i.selfIndex>=0&&n.selfIndex<0?-1:(i.selfIndex||0)-(n.selfIndex||0)}),l(i.subsections))})};return l(o),o},I=function(n,e){var s,d,r,v,f,_=a[n]||c[n];if(!_||!1===_.display_node)return null;var p=_.comparison_inputs?Object.keys(_.comparison_inputs):[],b=g[0],h=g[1];p.length>0&&(b=p.includes(g[0])?g[0]:p[0],h=p.includes(g[1])?g[1]:p.length>1?p[1]:p[0]);var m=t(_,e,g),x=!1!==(null===(s=m.attributes)||void 0===s?void 0:s.display_title),E=!1!==(null===(d=m.attributes)||void 0===d?void 0:d.display_content),N=!!o(m.title).trim(),S=!!o(m.content).trim(),j=l(_),O=(null===(r=null==u?void 0:u[n])||void 0===r?void 0:r.evaluation_result)||_.evaluation_result||null,R=y(O,b,h),k=[];_.next&&Object.values(_.next).forEach(function(i){var n=c[i];if(n&&!1!==n.display_node){var t=I(i,e);t&&k.push(t)}});var P=!(!N&&!S);return i(i({id:n,title:N?m.title:"",content:S?m.content:"",change_history:S?m.change_history:"",displayTitle:x,displayContent:E,subsections:k},P?j:{score:void 0,relation:"not_defined"}),{evaluationResult:R,selfIndex:void 0!==(null===(v=m.attributes)||void 0===v?void 0:v.display_index)?Number(m.attributes.display_index):-1,ref_parent_section_node_id:null===(f=m.attributes)||void 0===f?void 0:f.ref_parent_section_node_id})};if(v){var E=function(e,o){var s,d,r,v,f,_,p,b,h,m,x,I,N,S,j,O,R,k,P,C,T,V,D,w,J,M,U,q,F,$,z,A;void 0===o&&(o=0);var B=[],G=[];if(!e)return{refSections:B,baseSections:G};var H={},K={},L=-1,Q=-1;for(var W in e){var X=e[W],Y=a[X]||c[X];if(Y&&!1!==Y.display_node){var Z=Y.comparison_inputs?Object.keys(Y.comparison_inputs):[],ii=g[0],ni=g[1];Z.length>0&&(ii=Z.includes(g[0])?g[0]:Z[0],ni=Z.includes(g[1])?g[1]:Z.length>1?Z[1]:Z[0]);var ei=l(Y),ti=(null===(s=null==u?void 0:u[X])||void 0===s?void 0:s.evaluation_result)||Y.evaluation_result||null,oi=y(ti,ii,ni),li=t(Y,"1",g),si=t(Y,"0",g),di=!1!==(null===(d=li.attributes)||void 0===d?void 0:d.display_title)&&((null===(v=null===(r=li.title)||void 0===r?void 0:r.trim)||void 0===v?void 0:v.call(r))||"")||!1!==(null===(f=li.attributes)||void 0===f?void 0:f.display_content)&&((null===(p=null===(_=li.content)||void 0===_?void 0:_.trim)||void 0===p?void 0:p.call(_))||""),ri=!1!==(null===(b=si.attributes)||void 0===b?void 0:b.display_title)&&((null===(m=null===(h=si.title)||void 0===h?void 0:h.trim)||void 0===m?void 0:m.call(h))||"")||!1!==(null===(x=si.attributes)||void 0===x?void 0:x.display_content)&&((null===(N=null===(I=si.content)||void 0===I?void 0:I.trim)||void 0===N?void 0:N.call(I))||""),ui=Number(null!==(j=null===(S=li.attributes)||void 0===S?void 0:S.display_index)&&void 0!==j?j:L--),ai=Number(null!==(R=null===(O=si.attributes)||void 0===O?void 0:O.display_index)&&void 0!==R?R:Q--),vi=0===o?String(ui):"".concat(ui,"_").concat(X),ci=0===o?String(ai):"".concat(ai,"_").concat(X),fi=H[vi]||i(i({id:X,title:!1!==(null===(k=li.attributes)||void 0===k?void 0:k.display_title)?li.title:"",content:!1!==(null===(P=li.attributes)||void 0===P?void 0:P.display_content)?li.content:"",change_history:!1!==(null===(C=li.attributes)||void 0===C?void 0:C.display_content)?li.change_history:"",subsections:[]},di?ei:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:ui,evaluationResult:oi,displayContent:null===(T=li.attributes)||void 0===T?void 0:T.display_content,displayTitle:null===(V=li.attributes)||void 0===V?void 0:V.display_title,ref_parent_section_node_id:null===(D=li.attributes)||void 0===D?void 0:D.ref_parent_section_node_id}),_i=K[ci]||i(i({id:X,title:!1!==(null===(w=si.attributes)||void 0===w?void 0:w.display_title)?si.title:"",content:!1!==(null===(J=si.attributes)||void 0===J?void 0:J.display_content)?si.content:"",change_history:!1!==(null===(M=si.attributes)||void 0===M?void 0:M.display_content)?si.change_history:"",subsections:[]},ri?ei:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:ai,evaluationResult:oi,displayContent:null===(U=si.attributes)||void 0===U?void 0:U.display_content,displayTitle:null===(q=si.attributes)||void 0===q?void 0:q.display_title});Number(ui)>=0&&Number(ai)>=0&&((null===(F=fi.refIndexes)||void 0===F?void 0:F.includes(Number(ai)))||null===($=fi.refIndexes)||void 0===$||$.push(Number(ai)),(null===(z=_i.refIndexes)||void 0===z?void 0:z.includes(Number(ui)))||null===(A=_i.refIndexes)||void 0===A||A.push(Number(ui))),H[vi]=fi,K[ci]=_i;var pi=E(Y.next,o+1),bi=pi.refSections,hi=pi.baseSections;bi.length>0&&(fi.subsections=n(n([],fi.subsections||[],!0),bi,!0)),hi.length>0&&(_i.subsections=n(n([],_i.subsections||[],!0),hi,!0))}}B=Object.values(H),G=Object.values(K);var gi=function(i,n){return i.selfIndex<0&&n.selfIndex>=0?1:i.selfIndex>=0&&n.selfIndex<0?-1:i.selfIndex-n.selfIndex};return B.sort(gi),G.sort(gi),{refSections:B,baseSections:G}},N=E(m.next),S=N.refSections,j=N.baseSections;b=x(S),f=j}else m.next&&Object.values(m.next).forEach(function(i){var n=a[i]||c[i];n&&!1!==n.display_node&&(f.push(I(i,"0")||{id:i,title:"",content:"",subsections:[]}),b.push(I(i,"1")||{id:i,title:"",content:"",subsections:[]}))}),b=x(b);return{activeProposed:{title:(null===(s=null===(e=m.comparison_inputs)||void 0===e?void 0:e[g[0]])||void 0===s?void 0:s.title)||"Uploaded Contract",description:m.decision_scope_description||"",sections:f},activeVariants:[{id:"tree-variant-1",title:(null===(r=null===(d=m.comparison_inputs)||void 0===d?void 0:d[g[1]])||void 0===r?void 0:r.title)||"Reference Template",similarity:0,sections:b,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:m.decision_scope_description||""},fields:{}}}}],parseError:null}}catch(i){return console.error("Data Transformation Error: ",i),{activeProposed:{},activeVariants:[],parseError:i instanceof Error?i.message:"Unknown Parsing Error"}}},[a,v,p,_]),h=b.activeProposed,g=b.activeVariants,m=b.parseError,y=(null==g?void 0:g[0])||u,x=e(function(){return(null==h?void 0:h.sections)||[]},[null==h?void 0:h.sections]),I=e(function(){return y.sections||[]},[y.sections]),E=x.length>0||I.length>0,N=e(function(){return f.fields.filter(function(i){var n=i.key;return(!E||"description"!==n)&&(s(null==h?void 0:h[n])||s(y[n]))})},[h,y,E,f.fields]),S=e(function(){var i,n,e={},t={},o={},l=0,s=null===(i=null==a?void 0:a.input_index_map)||void 0===i?void 0:i[0],u=null===(n=null==a?void 0:a.input_index_map)||void 0===n?void 0:n[1],c=function(i,n,a,v,f,_){var p,b,h,g,m,y,x,I;if(i&&function(i,n){var e,l=(null===(e=null==i?void 0:i.evaluationResult)||void 0===e?void 0:e.deviations)||{};Object.keys(l).sort().forEach(function(e){var a=l[e];if(a){var v=!d(a[s]),c=!d(a[u]);if(v||c){var f="".concat(i.id).concat(r).concat(e);void 0===t[f]&&(void 0===o[n]&&(o[n]=1),t[f]=o[n]++)}}})}(i,v),i&&!f){var E=(null==_?void 0:_.id)||"fallback_parent_".concat(l++);e[E]||(e[E]=[]),e[E].push(i)}for(var N=Math.max((null===(p=null==n?void 0:n.subsections)||void 0===p?void 0:p.length)||0,(null===(b=null==a?void 0:a.subsections)||void 0===b?void 0:b.length)||0,(null===(h=null==i?void 0:i.subsections)||void 0===h?void 0:h.length)||0),S=0;S<N;S++)c((null===(g=null==i?void 0:i.subsections)||void 0===g?void 0:g[S])||(null===(m=null==n?void 0:n.subsections)||void 0===m?void 0:m[S])||(null===(y=null==a?void 0:a.subsections)||void 0===y?void 0:y[S]),null===(x=null==n?void 0:n.subsections)||void 0===x?void 0:x[S],null===(I=null==a?void 0:a.subsections)||void 0===I?void 0:I[S],v,!1,_)};return x.forEach(function(i,n){var e,t=n+1;v&&void 0!==i.selfIndex&&i.selfIndex>=0&&(t=i.selfIndex+1);var o=null;if(v){var l=null===(e=i.refIndexes)||void 0===e?void 0:e[0];o=I.find(function(i){return i.selfIndex===l})}else o=I[n];c(i,i,o,t,!0,i)}),I.forEach(function(i,n){var e,t=n+1,o=!1;if(v){var l=null===(e=i.refIndexes)||void 0===e?void 0:e[0],s=x.find(function(i){return i.selfIndex===l});s&&void 0!==s.selfIndex&&s.selfIndex>=0?t=s.selfIndex+1:(o=!0,void 0!==i.selfIndex&&i.selfIndex>=0&&(t=i.selfIndex+1))}else n>=x.length&&(o=!0);o&&c(i,null,i,t,!0,i)}),{parentDeviationRecord:e,registry:t}},[x,I,v,a]),j=S.parentDeviationRecord,O=S.registry;return{activeProposed:h,activeVariants:g,existingRule:y,proposedSections:x,existingSections:I,visibleFields:N,parentDeviationRecord:j,deviationNumberRegistry:O,parseError:m}};export{a as useCognitiveTreeData};
|
|
2
|
+
//# sourceMappingURL=useCompareData.js.map
|