@viswa-test/test-citation 0.0.87 → 0.0.88
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/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/CognitiveSummaryPopup.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useDeviationNavigation.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/features/CognitiveCompare/components/CognitiveSummaryPopup.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useDeviationNavigation.js +1 -1
- package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +0 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/CognitiveSummaryPopup.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/components/CognitiveSummaryPopup.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useDeviationNavigation.d.ts +0 -2
- package/dist/types/src/features/CognitiveCompare/hooks/useDeviationNavigation.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as n,jsx as i}from"react/jsx-runtime";import{ChevronUp as l,ChevronDown as t}from"lucide-react";import{useState as o,useRef as r,useEffect as d}from"react";import a from"./ResizableSplitPane.js";import u from"../PdfViewer/PdfViewer.js";import{DefaultFullScreenCloseIcon as s,DefaultFullScreenIcon as c}from"../../assests/svg/PdfViewerIcons.js";var g=function(g){var v,p,h,f=g.href,m=g.children,x=g.metaData,b=g.chevronUpComponent,_=void 0===b?null:b,y=g.chevronDownComponent,C=void 0===y?null:y,w=g.customStyle,F=void 0===w?{}:w,P=g.defaultState,S=o(void 0!==P&&P),D=S[0],E=S[1],j=o(!1),k=j[0],z=j[1],R=r(null),A="string"==typeof m&&(null===(v=null==m?void 0:m.split("\n"))||void 0===v?void 0:v.length)>1?m.split("\n").join(" "):m,I="string"==typeof m?m:m[0],T=null!=_?_:function(e){var n,t;return i(l,{size:null!==(n=null==e?void 0:e.fontSize)&&void 0!==n?n:16,color:null!==(t=null==e?void 0:e.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(p=null==F?void 0:F.arrow)&&void 0!==p?p:{}),V=null!=C?C:function(e){var n,l;return i(t,{size:null!==(n=null==e?void 0:e.fontSize)&&void 0!==n?n:16,color:null!==(l=null==e?void 0:e.color)&&void 0!==l?l:"rgb(214, 51, 132)"})}(null!==(h=null==F?void 0:F.arrow)&&void 0!==h?h:{}),W=["contract","clause"];d(function(){var e=function(){z(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),function(){return document.removeEventListener("fullscreenchange",e)}},[]);return n("span",e({style:e({display:"inline"},F.relativeWrapper||{})},{children:[i("div",e({style:e({display:"inline",marginTop:0},F.citationButtonWrapper||{})},{children:n("button",e({type:"button",onClick:function(){return E(function(e){return!e})},style:e({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"},F.citationButton||{})},{children:[i("span",{children:A}),i("span",e({style:{display:"flex",alignItems:"center"}},{children:D?T:V}))]}))})),D&&n("div",e({ref:R,style:e({boxSizing:"border-box",border:k?"none":"1px solid #E4E7EC",borderRadius:k?"0":"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%",height:k?"100vh":"auto"},k?{position:"fixed",inset:0,zIndex:99999,backgroundColor:"#FAFAFA"}:{})},{children:[i("div",e({style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:i("button",e({onClick:function(){var e=R.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Fullscreen error: ".concat(e.message))}))},title:k?"Exit fullscreen":"Fullscreen",style:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:i(k?s:c,{})}))})),i("div",e({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:i(function(){var n,l,t,o,r,d,s,c,g,v,p;console.log("citation details ->","href ->",f,"children ->",m,"metaData ->",x,"citationDisplayTitle ->",A);var h=function(e){try{return new URL(e,window.location.origin).searchParams.get("citationNumber")}catch(e){return null}}(f);if(!h)return null;var b=(null===(n=null==x?void 0:x.citations)||void 0===n?void 0:n[h])||{},_=(null===(l=null==x?void 0:x.docData)||void 0===l?void 0:l.documents)||{},y=(null===(t=null==x?void 0:x.docData)||void 0===t?void 0:t.input_index_map)||{},C=null==y?void 0:y[0],w=null==y?void 0:y[1],F=C?_[C]:null,P=w?_[w]:null,S=C?b[C]:null,D=w?b[w]:null;if(W.includes(I)){console.log("leftDocument",F,"rightDocument",P),console.log("leftCitation",S,"rightCitation",D);var E=S?i(u,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:F.title,pdfUrl:F.signed_url,highlightText:[null!==(o=null==S?void 0:S.highlighted_text)&&void 0!==o?o:""],highlightPages:{1:null===(r=null==S?void 0:S.custom_metadata)||void 0===r?void 0:r.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(d=null==S?void 0:S.custom_metadata)||void 0===d?void 0:d.pdf_start_page_number,null===(s=null==S?void 0:S.custom_metadata)||void 0===s?void 0:s.pdf_end_page_number]}):null,j=D?i(u,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:P.title,pdfUrl:P.signed_url,jumpToPageValue:1,highlightText:[null!==(c=null==D?void 0:D.highlighted_text)&&void 0!==c?c:""],highlightPages:{1:null===(g=null==D?void 0:D.custom_metadata)||void 0===g?void 0:g.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(v=null==D?void 0:D.custom_metadata)||void 0===v?void 0:v.pdf_start_page_number,null===(p=null==D?void 0:D.custom_metadata)||void 0===p?void 0:p.pdf_end_page_number]}):null;return i("div",S||D?e({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:i(a,{leftComponent:E,rightComponent:j,isFullscreen:k})}):{children:"Missing PDF Citation. Please try again later"})}return i("div",{children:"No Citation Found. Please try again later"})},{})}))]}))]}))};export{g as default};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as t,jsx as i}from"react/jsx-runtime";import{useState as o,useRef as r,useMemo as l,useEffect as c,useCallback as u}from"react";import{Box as d,Snackbar as a,Alert as s,Tooltip as v,Typography as p}from"@mui/material";import{ChevronDown as f,EllipsisVertical as g}from"lucide-react";import{ButtonCognitiveIcon as h}from"../../assests/svg/ButtonCognitiveIcon.js";import x from"./OverlayComponent.js";import{safeStringify as m,extractDeviationScore as y,generateColorPalette as b,DEVIATION_BADGE_SEPARATOR as S,hasValue as R,getBentArrowPath as C,smoothScrollTo as I}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as T,DEFAULT_FIELD_CONFIG as B,DEFAULT_COMPARISON_CONFIG as w}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as E,DEFAULT_COMPONENT_HEADER_TEXT as F}from"./CognitiveCompareConstants.js";import _ from"./CognitivePopup.js";import M from"./MoreFunctionsPopup.js";import k from"./LoaderComponent.js";import D from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as A}from"./hooks/useCompareData.js";import{useComparePopups as H}from"./hooks/useComparePopups.js";import{useSectionRefs as N}from"./hooks/useSectionRefs.js";import{useAccordionState as L}from"./hooks/useAccordionState.js";import{useDeviationNavigation as P}from"./hooks/useDeviationNavigation.js";import O from"./components/CompareHeader.js";import j from"./components/SectionAccordion.js";import z from"./components/SubSectionAccordion.js";import W from"./components/CognitiveSummaryPopup.js";var Y=function(Y){var K,q,V,X,J,U,G,Q,Z,$,ee,ne,te,ie,oe,re=Y.componentHeaderText,le=void 0===re?F:re,ce=Y.treeData,ue=Y.comparisonConfig,de=Y.leftColumnTitleText,ae=Y.rightColumnTitleText,se=Y.markdownStyles,ve=Y.displayConfig,pe=void 0===ve?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0}:ve,fe=Y.popupConfig,ge=Y.deviationData,he=void 0===ge?{}:ge,xe=Y.deviationNodeIdToView,me=o(pe.maintainRelativeOrder),ye=me[0],be=me[1],Se=o(!1),Re=Se[0],Ce=Se[1],Ie=o(!1),Te=Ie[0],Be=Ie[1],we=o(null),Ee=we[0],Fe=we[1],_e=o(!1),Me=_e[0],ke=_e[1],De=o(!1),Ae=De[0],He=De[1],Ne=o(!1),Le=Ne[0],Pe=Ne[1],Oe=o(null),je=Oe[0],ze=Oe[1],We=r(!1),Ye=o(new Set),Ke=Ye[0],qe=Ye[1],Ve=o([]),Xe=Ve[0],Je=Ve[1],Ue=r(null),Ge=r(!1),Qe=r(null),Ze=r({}),$e=r([]),en=r(!1),nn=r(!1),tn=r(null),on=r(function(){}),rn=l(function(){return(null==ce?void 0:ce.cognitive_decisioning)||{}},[ce]),ln=o({width:0,height:0}),cn=ln[0],un=ln[1],dn=l(function(){return e(e({},T),se)},[se]),an=r(null),sn=r(null),vn=r(null),pn=r(null),fn=r(null),gn=r(null),hn=r(null),xn=r(null),mn=r(!1),yn=r(null),bn=r(null),Sn=H(an),Rn=Sn.cognitivePopup,Cn=Sn.setCognitivePopup,In=Sn.moreFunctions,Tn=Sn.setMoreFunctions,Bn=Sn.position,wn=Sn.setPosition,En=Sn.activeBadgeId,Fn=Sn.summaryPopup,_n=Sn.setSummaryPopup,Mn=Sn.closeSummaryPopup,kn=Sn.setActiveBadgeId,Dn=Sn.popupRef,An=Sn.closeCognitivePopup,Hn=Sn.closeMoreFunctionsPopup,Nn=l(function(){var e,n,t,i,o,r,l;return{fields:null!==(e=null==ue?void 0:ue.fields)&&void 0!==e?e:B,thresholds:{high:null!==(t=null===(n=null==ue?void 0:ue.thresholds)||void 0===n?void 0:n.high)&&void 0!==t?t:w.thresholds.high,medium:null!==(o=null===(i=null==ue?void 0:ue.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:w.thresholds.medium,exact:null!==(l=null===(r=null==ue?void 0:ue.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:w.thresholds.exact}}},[ue]),Ln=o(null),Pn=Ln[0];Ln[1];var On=null===(V=null===(K=null==ce?void 0:ce.documents)||void 0===K?void 0:K[null===(q=null==ce?void 0:ce.input_index_map)||void 0===q?void 0:q[0]])||void 0===V?void 0:V.title,jn=null===(U=null===(X=null==ce?void 0:ce.documents)||void 0===X?void 0:X[null===(J=null==ce?void 0:ce.input_index_map)||void 0===J?void 0:J[1]])||void 0===U?void 0:U.title,zn=m(de||On||"Uploaded Contract"),Wn=m(ae||jn||"Reference Template"),Yn=A(ce,ye,he,Nn),Kn=Yn.activeProposed,qn=Yn.existingRule,Vn=Yn.proposedSections,Xn=Yn.existingSections,Jn=Yn.visibleFields,Un=Yn.parentDeviationRecord,Gn=Yn.deviationNumberRegistry,Qn=Yn.parseError;c(function(){Qn&&Fe("Failed to load comparison: ".concat(Qn))},[Qn]);var Zn=Vn.length>0||Xn.length>0,$n=N(Jn.map(function(e){return e.key}),Math.max(Vn.length,Xn.length)),et=$n.leftRefs,nt=$n.rightRefs,tt=$n.sectionLeftRefs,it=$n.sectionRightRefs,ot=$n.lhsBadgeRefs,rt=$n.rhsBadgeRefs,lt=$n.sectionRightRowRefs,ct=$n.subSectionLeftRefs,ut=$n.subSectionRightRefs,dt=$n.sectionRowRefs,at=$n.getSectionRowRef,st=$n.getSubSectionRef,vt=$n.getBadgeRef,pt=qn.analysis,ft=m(null===(Q=null===(G=null==pt?void 0:pt.rule_difference_comparison)||void 0===G?void 0:G.summary)||void 0===Q?void 0:Q.overall_summary),gt=!!ft.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),ht=null!==(Z=null==ce?void 0:ce.base_root_id)&&void 0!==Z?Z:"-1";null==ce||ce[ht];var xt=(null===($=null==he?void 0:he[ht])||void 0===$?void 0:$.evaluation_result)||(null===(ne=null===(ee=null==ce?void 0:ce.nodes)||void 0===ee?void 0:ee[ht])||void 0===ne?void 0:ne.evaluation_result)||null,mt=y(xt),yt=b(null!==(oe=null===(ie=null===(te=null==xt?void 0:xt.evaluation_outputs)||void 0===te?void 0:te.metadata)||void 0===ie?void 0:ie.label_color)&&void 0!==oe?oe:""),bt=u(function(){var e,n,t,i,o,r;ke(!1),nn.current=!1;var l=tn.current,c=Dt.current;if(null!==l)if("string"==typeof l&&l.includes(S)){var u=l.split(S);(d=(null===(e=ct.current[u[2]])||void 0===e?void 0:e.current)||(null===(n=tt.current[Number(u[2])])||void 0===n?void 0:n.current))&&(d.style.paddingTop="0px")}else{var d;(d=null===(t=tt.current[l])||void 0===t?void 0:t.current)&&(d.style.paddingTop="0px")}if(null!==c)if("string"==typeof c&&c.includes(S)){u=c.split(S);(a=(null===(i=ut.current[u[3]])||void 0===i?void 0:i.current)||(null===(o=it.current[Number(u[3])])||void 0===o?void 0:o.current))&&(a.style.paddingTop="0px")}else{var a;(a=null===(r=it.current[c])||void 0===r?void 0:r.current)&&(a.style.paddingTop="0px")}ze(null),tn.current=null,Dt.current=null,He(!1),Be(!1),pn.current&&(pn.current.style.height="0px"),fn.current&&(fn.current.style.height="0px"),gn.current&&(gn.current.style.height="0px"),hn.current&&(hn.current.style.height="0px")},[]),St=L({maintainRelativeOrder:!!ye,proposedSections:Vn,existingSections:Xn,activeSideBySideSection:je,connectedSections:Ke,resetSideBySide:bt,setConnectedSections:qe,setConnectedLines:Je,cachedConnectedPositions:$e,svgContainerRef:Ue,isAnimatingRef:Ge,animationTimerRef:Qe,calculateLinesRef:on,sectionLeftRefs:tt,sectionRightRefs:it,subSectionLeftRefs:ct,subSectionRightRefs:ut}),Rt=St.expandedSections,Ct=St.expandedSubSections,It=St.setExpandedSubSections,Tt=St.toggleSection,Bt=u(function(e,n,t,i,o,r,l){var c,u,d,a=m(null==n?void 0:n.id)||m(null==t?void 0:t.id)||"",s=(a?rn[a]:null)||(null==n?void 0:n.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:a,decisioning:[],gap:[],relevance_score:0},v=null!==(u=null===(c=dt.current[i])||void 0===c?void 0:c.current)&&void 0!==u?u:null;return{isLoading:null!==(d=null==pe?void 0:pe.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==n?void 0:n.displayTitle)?null==n?void 0:n.title:"no title",refSectionTitle:(null==t?void 0:t.displayTitle)?null==t?void 0:t.title:"no title",cognitiveData:s,anchorEl:e,sectionAnchorEl:v,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==ce?void 0:ce.documents,input_index_map:null==ce?void 0:ce.input_index_map},deviationData:(null==n?void 0:n.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,isOrphan:!!o}},[rn,ce]),wt=u(function(e){Hn(),wn(null),Cn(e)},[Hn]),Et=function(e,n,t,i,o,r){var l;if(e.stopPropagation(),In.open&&In.sectionIdx===o)Hn();else{var c=e.currentTarget,u="left";(null===(l=vn.current)||void 0===l?void 0:l.contains(c))&&(u="right");nn.current&&bt(),qe(new Set),Je([]),$e.current=[],An(),Fn.open?ti():Mn(),requestAnimationFrame(function(){var e=function(){var e,n,t,i;if("string"==typeof o&&o.includes(S)){var r=o.split(S),l="".concat(r[0]).concat(S).concat(r[1]);return"right"===u?null===(e=rt.current[l])||void 0===e?void 0:e.current:null===(n=ot.current[l])||void 0===n?void 0:n.current}return"right"===u?null===(t=rt.current[o])||void 0===t?void 0:t.current:null===(i=ot.current[o])||void 0===i?void 0:i.current}()||c;Tn(Bt(e,n,i,o,t,r))})}},Ft=u(function(){null!==In.sectionIdx&&In.anchorEl?wt(e(e({},In),{open:!0})):Hn()},[In,Hn,wt]),_t=u(function(){var e=In.sectionIdx,n=In.isOrphan;Hn(),Mn(),null!==e&&(n?Fe("No counterpart exists to connect to."):(nn.current&&bt(),Je([]),$e.current=[],qe(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){on.current&&on.current()},50)))},[In.sectionIdx,In.isOrphan,Hn,Mn,bt]),Mt=r(null),kt=r(null),Dt=r(null),At=r(null),Ht=r(null),Nt=r(null),Lt=o([]),Pt=Lt[0],Ot=Lt[1];r(null);var jt=o(null),zt=jt[0],Wt=jt[1];c(function(){if(Pn){var e=Nn.fields.find(function(e){return e.analysisKey===Pn||e.key===Pn});if(e){var n=et.current[e.key]||nt.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Pn,Nn.fields]);var Yt=u(function(e){var n,t,i,o,r,l,c,u,d,a=null===(n=null==pt?void 0:pt.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!a||!a[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=a[e],v=(null==s?void 0:s.relation)||(null===(i=null===(t=null==s?void 0:s.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(r=null===(o=null==s?void 0:s.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==s?void 0:s.mappings)&&s.mappings.length>0;if(s.mappings){var p=s.mappings[0]||{};return{score:s.score,relation:p.relation||"",highlightsA:(null===(l=p.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(c=p.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!v}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(u=s.highlights)||void 0===u?void 0:u.ruleA_spans)||[],highlightsB:(null===(d=s.highlights)||void 0===d?void 0:d.ruleB_spans)||[],hasContent:!!v}},[pt]),Kt=u(function(n,t){var i,o,r,l,c,u,d;void 0===t&&(t="left");var a=null,s=null;if("left"===t)if(a=Vn[n],ye&&a){var v=Xn.filter(function(e){var n;return null===(n=a.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)});s=v.find(function(e){return e.evaluationResult})||v[0]}else s=Xn[n];else if(s=Xn[n],ye&&s){var p=Vn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(s.selfIndex)});a=p.find(function(e){return e.evaluationResult})||p[0]}else a=Vn[n];var f=(null==a?void 0:a.relation)&&"not_defined"!==a.relation,g=(null==s?void 0:s.relation)&&"not_defined"!==s.relation,h=!(!(null==a?void 0:a.cognitiveData)&&!(null==s?void 0:s.cognitiveData));if(!f&&!g&&!h)return e(e({},b(E)),{label:"Not Defined"});var x=null!==(o=null!==(i=null==a?void 0:a.evaluationResult)&&void 0!==i?i:null==s?void 0:s.evaluationResult)&&void 0!==o?o:null,m=null===(r=null==x?void 0:x.evaluation_outputs)||void 0===r?void 0:r.output_value,y=null!==(u=null===(c=null===(l=null==x?void 0:x.evaluation_outputs)||void 0===l?void 0:l.metadata)||void 0===c?void 0:c.label_color)&&void 0!==u?u:E;return e(e({},b(y)),null!=x?{label:null!==(d=m)&&void 0!==d?d:""}:{label:null})},[Vn,Xn,rn,Nn,ye]),qt=u(function(n){for(var t,i,o,r,l,c,u,d,a,s=n.split("-").map(Number),v=Vn[s[0]],p=Xn[s[0]],f=1;f<s.length;f++)(null==v?void 0:v.subsections)&&(v=v.subsections[s[f]]),(null==p?void 0:p.subsections)&&(p=p.subsections[s[f]]);if(!v&&!p)return null;var g=(null==v?void 0:v.relation)&&"not_defined"!==v.relation,h=(null==p?void 0:p.relation)&&"not_defined"!==p.relation,x=m(null==v?void 0:v.id)||m(null==p?void 0:p.id)||"",y=!(!(null==v?void 0:v.cognitiveData)&&!(null==p?void 0:p.cognitiveData));if(!g&&!h&&!y)return e(e({},b(E)),{label:"Not Defined"});null!==(i=null!==(t=null==v?void 0:v.cognitiveRelevanceScore)&&void 0!==t?t:null==p?void 0:p.cognitiveRelevanceScore)&&void 0!==i||x&&(null===(o=rn[x])||void 0===o||o.relevance_score);var S=null!==(l=null!==(r=null==v?void 0:v.evaluationResult)&&void 0!==r?r:null==p?void 0:p.evaluationResult)&&void 0!==l?l:null,R=null===(c=null==S?void 0:S.evaluation_outputs)||void 0===c?void 0:c.output_value,C=null!==(a=null===(d=null===(u=null==S?void 0:S.evaluation_outputs)||void 0===u?void 0:u.metadata)||void 0===d?void 0:d.label_color)&&void 0!==a?a:E;return e(e({},b(C)),null!=S?{label:null!=R?R:""}:{label:null})},[Vn,Xn,rn,Nn]),Vt=u(function(){var e,n,t,i,o,r,l,c,u,d,a,s,v,p,f,g,h,x,m,y,b,I;if(!mn.current&&!Ge.current){mn.current=!0;try{if(!Mt.current)return;var T=function(e){var n=e.split("-"),t=n[0];if(!Rt[t]&&!1===ye)return!1;if(ye&&!Rt["left-".concat(t)]&&!Rt["right-".concat(t)]&&!Rt[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!Ct[i])return!1;return!0},B=Mt.current.getBoundingClientRect();un({width:B.width,height:B.height});var w=[];if(Jn.forEach(function(e){var n,t,i=e.key,o=null===(n=et.current[i])||void 0===n?void 0:n.current,r=null===(t=nt.current[i])||void 0===t?void 0:t.current;o&&r&&(o.style.height="auto",r.style.height="auto",o.style.minHeight="0px",r.style.minHeight="0px")}),!Ge.current){for(var E=0;E<Math.max(Vn.length,Xn.length);E++){var F=null===(e=tt.current[E])||void 0===e?void 0:e.current,_=null===(n=it.current[E])||void 0===n?void 0:n.current;F&&(F.style.height="auto",F.style.minHeight="0px"),_&&(_.style.height="auto",_.style.minHeight="0px")}ye||Object.keys(ct.current).forEach(function(e){var n,t;if(T(e)){var i=null===(n=ct.current[e])||void 0===n?void 0:n.current,o=null===(t=ut.current[e])||void 0===t?void 0:t.current;i&&o&&(i.style.height="auto",o.style.height="auto",i.style.minHeight="0px",o.style.minHeight="0px")}})}var M={};Jn.forEach(function(e){var n,t,i=e.key,o=null===(n=et.current[i])||void 0===n?void 0:n.current,r=null===(t=nt.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect();M[i]=Math.max(l.height,c.height)}});var k={left:{},right:{}},D={};if(!Ge.current)if(ye){if(Me&&null!==je)if("number"==typeof je){var A=je,H=Vn[A],N=null===(o=tt.current[A])||void 0===o?void 0:o.current;N&&H&&(H.refIndexes||[]).forEach(function(e){var n,t=Xn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=it.current[t])||void 0===n?void 0:n.current;if(i&&(Rt["left-".concat(A)]||Rt["right-".concat(t)])){var o=Math.max(N.getBoundingClientRect().height,i.getBoundingClientRect().height);k.left[A]=Math.max(k.left[A]||0,o),k.right[t]=Math.max(k.right[t]||0,o)}})}else{var L=je.split(S)[2];if(L){F=null===(r=ct.current[L])||void 0===r?void 0:r.current,_=null===(l=ut.current[L])||void 0===l?void 0:l.current;if(F&&_){P=Math.max(F.getBoundingClientRect().height,_.getBoundingClientRect().height);D[L]=Math.max(D[L]||0,P)}}}}else{Object.keys(ct.current).forEach(function(e){var n,t;if(T(e)){var i=null===(n=ct.current[e])||void 0===n?void 0:n.current,o=null===(t=ut.current[e])||void 0===t?void 0:t.current;if(i&&o&&null!==i.offsetParent&&null!==o.offsetParent){var r=i.getBoundingClientRect(),l=o.getBoundingClientRect(),c=Math.max(r.height,l.height);D[e]=c,i.style.minHeight="".concat(c,"px"),o.style.minHeight="".concat(c,"px")}}});for(E=0;E<Math.min(Vn.length,Xn.length);E++){var F=null===(t=tt.current[E])||void 0===t?void 0:t.current,_=null===(i=it.current[E])||void 0===i?void 0:i.current;if(F&&_){var P=Math.max(F.getBoundingClientRect().height,_.getBoundingClientRect().height);k.left[E]=P,k.right[E]=P}}}if(Jn.forEach(function(e){var n,t,i=e.key,o=null===(n=et.current[i])||void 0===n?void 0:n.current,r=null===(t=nt.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=M[i];o.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}),Ge.current||(Object.entries(k.left).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=tt.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(k.right).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=it.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),ye||Object.keys(D).forEach(function(e){var n,t,i=null===(n=ct.current[e])||void 0===n?void 0:n.current,o=null===(t=ut.current[e])||void 0===t?void 0:t.current;if(i&&o&&D[e]){var r=D[e];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),ye)Vn.forEach(function(e,n){var t;(null===(t=tt.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,o,r,l,c,u,d,a,s,v=Xn.findIndex(function(n){return n.selfIndex===e});if(-1!==v){var p=null===(t=ot.current[n])||void 0===t?void 0:t.current,f=null===(i=rt.current[v])||void 0===i?void 0:i.current;if(p&&f){var g=p.getBoundingClientRect(),h=f.getBoundingClientRect(),x=g.right-B.left,m=h.left-B.left,y=g.top+g.height/2-B.top,b=h.top+h.height/2-B.top;if(Me&&je===n){var S=null!==(r=null===(o=xn.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,R=null!==(c=null===(l=vn.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==c?c:0,C=S+(null!==(d=null===(u=xn.current)||void 0===u?void 0:u.clientHeight)&&void 0!==d?d:1/0),I=R+(null!==(s=null===(a=vn.current)||void 0===a?void 0:a.clientHeight)&&void 0!==s?s:1/0),T=g.top+g.height/2,E=h.top+h.height/2,F=function(e,n,t){return Math.max(n,Math.min(t,e))};y=F(T,S,C)-B.top,b=F(E,R,I)-B.top}var _=Kt(n);_&&w.push({id:"line-".concat(n,"-").concat(v),x1:x,y1:y,x2:m,y2:b,style:_,sectionIdx:n,targetRightIdx:v})}}})});else{for(E=0;E<Math.min(Vn.length,Xn.length);E++){var O=null===(c=tt.current[E])||void 0===c?void 0:c.current,j=null===(u=it.current[E])||void 0===u?void 0:u.current;if(O&&j){var z=O.getBoundingClientRect(),W=j.getBoundingClientRect(),Y=Math.max(z.top,W.top)+18-B.top,K=(null===(d=Xn[E])||void 0===d?void 0:d.id)||"sec-".concat(E);(Z=Kt(E))&&w.push({id:K,x1:z.right-B.left,y1:Y,x2:W.left-B.left,y2:Y,style:Z,sectionIdx:E,hasCognitive:!!((null===(a=Vn[E])||void 0===a?void 0:a.cognitiveData)||(null===(s=Xn[E])||void 0===s?void 0:s.cognitiveData)||K&&rn[K]),isSubSection:!1})}}Object.keys(ct.current).forEach(function(e){var n,t,i,o,r,l;if(T(e)){var c=null===(n=ct.current[e])||void 0===n?void 0:n.current,u=null===(t=ut.current[e])||void 0===t?void 0:t.current;if(c&&u){for(var d=e.split("-").map(Number),a=Vn[d[0]],s=Xn[d[0]],v=1;v<d.length;v++)(null==a?void 0:a.subsections)&&(a=a.subsections[d[v]]),(null==s?void 0:s.subsections)&&(s=s.subsections[d[v]]);var p=!!a&&((null===(i=a.displayTitle)||void 0===i||i)&&R(a.title)),f=!!a&&((null===(o=a.displayContent)||void 0===o||o)&&R(a.content)),g=!!s&&((null===(r=s.displayTitle)||void 0===r||r)&&R(s.title)),h=!!s&&((null===(l=s.displayContent)||void 0===l||l)&&R(s.content));if(p&&f||g&&h){var x=c.getBoundingClientRect(),m=u.getBoundingClientRect(),y=Math.max(x.top,m.top)+16-B.top,b=qt(e);b&&"Not Defined"!==b.label&&w.push({id:"subsec-".concat(e),x1:x.right-B.left,y1:y,x2:m.left-B.left,y2:y,style:b,sectionIdx:d[0],isSubSection:!0,subSectionKeyPath:e,hasCognitive:!(!(null==a?void 0:a.cognitiveData)&&!(null==s?void 0:s.cognitiveData))})}}}})}if(Me&&"string"==typeof je&&je.includes(S)){var q=je.split(S),V=q[0],X=q[1],J=q[2],U=(q[3],"".concat(V).concat(S).concat(X)),G=null===(v=ot.current[U])||void 0===v?void 0:v.current,Q=null===(p=rt.current[U])||void 0===p?void 0:p.current;if(G&&Q){var Z,$=G.getBoundingClientRect(),ee=Q.getBoundingClientRect(),ne=$.right-B.left,te=ee.left-B.left,ie=$.top+$.height/2-B.top,oe=ee.top+ee.height/2-B.top;if(ye){var re=null!==(g=null===(f=xn.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==g?g:0,le=null!==(x=null===(h=vn.current)||void 0===h?void 0:h.getBoundingClientRect().top)&&void 0!==x?x:0,ce=re+(null!==(y=null===(m=xn.current)||void 0===m?void 0:m.clientHeight)&&void 0!==y?y:1/0),ue=le+(null!==(I=null===(b=vn.current)||void 0===b?void 0:b.clientHeight)&&void 0!==I?I:1/0),de=function(e,n,t){return Math.max(n,Math.min(t,e))};ie=de($.top+$.height/2,re,ce)-B.top,oe=de(ee.top+ee.height/2,le,ue)-B.top}(Z=qt(J))&&w.push({id:"line-subsec-".concat(U),x1:ne,y1:ie,x2:te,y2:oe,style:Z,sectionIdx:Number(J.split("-")[0]),isSubSection:!0,subSectionKeyPath:je})}}if(Ot(w),Ht.current&&Nt.current){var ae=Ht.current.getBoundingClientRect(),se=Nt.current.getBoundingClientRect(),ve=(ae.top+ae.height/2-B.top+se.top+se.height/2-B.top)/2;Wt({x1:ae.right-B.left,x2:se.left-B.left,y:ve})}else Wt(null);if(Ke.size>0){var pe=[],fe=xn.current,ge=vn.current;if(fe&&ge){var he=[],xe=fe.getBoundingClientRect().top,me=ge.getBoundingClientRect().top,be=xe+fe.clientHeight,Se=me+ge.clientHeight,Re=fe.scrollTop,Ce=ge.scrollTop,Ie=B.top,Te=function(e,n,t){return Math.max(n,Math.min(t,e))};Ke.forEach(function(e){var n,t,i,o,r;if("string"==typeof e&&e.includes(S)){var l=e.split(S),c=l[0],u=l[1],d=l[2],a=(l[3],"".concat(c).concat(S).concat(u)),s=null===(n=ot.current[a])||void 0===n?void 0:n.current,v=null===(t=rt.current[a])||void 0===t?void 0:t.current;if(!s||!v)return;var p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),g=qt(d),h=(H=p.right-B.left)+.5*((N=f.left-B.left-0)-H),x=p.top+p.height/2,m=f.top+f.height/2,y=x-xe+Re,b=m-me+Ce,R="conn-subsec-".concat(a);he.push({lhsScrollY:y,rhsScrollY:b,x1:H,x2:N,containerTop:Ie,leftIdx:e,rhsArrayIdx:e,styleColor:(null==g?void 0:g.badgeBorder)||"#6366F1",styleId:R});var I=Te(x,xe,be),T=Te(m,me,Se),w=I-Ie,E=T-Ie,F=m>=me-4&&m<=Se+4,_="";_=(L=x>=xe-4&&x<=be+4)&&F?C(H,w,N,E):L&&!F?"M ".concat(H,",").concat(w," L ").concat(h,",").concat(w," L ").concat(h,",").concat(E):!L&&F?"M ".concat(h,",").concat(w," L ").concat(h,",").concat(E," L ").concat(N,",").concat(E):"M ".concat(h,",").concat(w," L ").concat(h,",").concat(E),pe.push({id:R,pathD:_,style:g,leftIdx:e,rhsArrayIdx:e})}else if(ye){var M=e,k=Vn[M];if(!(null===(r=null==k?void 0:k.refIndexes)||void 0===r?void 0:r.length))return;k.refIndexes.forEach(function(e){var n,t,i=Xn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=ot.current[M])||void 0===n?void 0:n.current,r=null===(t=rt.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect(),u=Kt(M),d=l.right-B.left,a=c.left-B.left-0,s=d+.5*(a-d),v=l.top+l.height/2,p=c.top+c.height/2,f=v-xe+Re,g=p-me+Ce,h="conn-".concat(M,"-").concat(i);he.push({lhsScrollY:f,rhsScrollY:g,x1:d,x2:a,containerTop:Ie,leftIdx:M,rhsArrayIdx:i,styleColor:(null==u?void 0:u.badgeBorder)||"#6366F1",styleId:h});var x=Te(v,xe,be),m=Te(p,me,Se),y=x-Ie,b=m-Ie,S=v>=xe-4&&v<=be+4,R=p>=me-4&&p<=Se+4,I="";I=S&&R?C(d,y,a,b):S&&!R?"M ".concat(d,",").concat(y," L ").concat(s,",").concat(y," L ").concat(s,",").concat(b):!S&&R?"M ".concat(s,",").concat(y," L ").concat(s,",").concat(b," L ").concat(a,",").concat(b):"M ".concat(s,",").concat(y," L ").concat(s,",").concat(b),pe.push({id:h,pathD:I,style:u,leftIdx:M,rhsArrayIdx:i})}}})}else{var D=e,A=D;s=null===(i=ot.current[D])||void 0===i?void 0:i.current,v=null===(o=rt.current[A])||void 0===o?void 0:o.current;if(!s||!v)return;var H,N;p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),g=Kt(D),h=(H=p.right-B.left)+.5*((N=f.left-B.left-0)-H),x=p.top+p.height/2,m=f.top+f.height/2,y=x-xe+Re,b=m-me+Ce,R="conn-".concat(D,"-").concat(A);he.push({lhsScrollY:y,rhsScrollY:b,x1:H,x2:N,containerTop:Ie,leftIdx:D,rhsArrayIdx:A,styleColor:(null==g?void 0:g.badgeBorder)||"#6366F1",styleId:R});var L;I=Te(x,xe,be),T=Te(m,me,Se),w=I-Ie,E=T-Ie,F=m>=me-4&&m<=Se+4,_="";_=(L=x>=xe-4&&x<=be+4)&&F?C(H,w,N,E):L&&!F?"M ".concat(H,",").concat(w," L ").concat(h,",").concat(w," L ").concat(h,",").concat(E):!L&&F?"M ".concat(h,",").concat(w," L ").concat(h,",").concat(E," L ").concat(N,",").concat(E):"M ".concat(h,",").concat(w," L ").concat(h,",").concat(E),pe.push({id:R,pathD:_,style:g,leftIdx:D,rhsArrayIdx:A})}}),$e.current=he}Je(pe)}else Je([]),$e.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{mn.current=!1}}},[Jn,Vn,Xn,rn,Nn,Yt,Kt,ye,Me,je,Ke,Rt,Ct]),Xt=u(function(){var e,n,t,i,o,r,l,c,u,d,a,s,v,p,f=$e.current;if(f.length&&!Ge.current){var g=null!==(n=null===(e=xn.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,h=null!==(i=null===(t=vn.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,x=null!==(r=null===(o=xn.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(c=null===(l=vn.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,y=null!==(d=null===(u=xn.current)||void 0===u?void 0:u.getBoundingClientRect().top)&&void 0!==d?d:0,b=null!==(s=null===(a=vn.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==s?s:0,S=y+x,R=b+m,I=null!==(p=null===(v=Mt.current)||void 0===v?void 0:v.getBoundingClientRect().top)&&void 0!==p?p:0,T=function(e,n,t){return Math.max(n,Math.min(t,e))};f.forEach(function(e){var n=e.lhsScrollY-g+y,t=e.rhsScrollY-h+b,i=Ze.current[e.styleId+"-stroke"],o=Ze.current[e.styleId+"-bg"];if(i||o){var r,l=T(n,y,S),c=T(t,b,R),u=l-I,d=c-I,a=n>=y-4&&n<=S+4,s=t>=b-4&&t<=R+4,v=e.x1+.5*(e.x2-e.x1);r=a&&s?C(e.x1,u,e.x2,d):a&&!s?"M ".concat(e.x1,",").concat(u," L ").concat(v,",").concat(u," L ").concat(v,",").concat(d):!a&&s?"M ".concat(v,",").concat(u," L ").concat(v,",").concat(d," L ").concat(e.x2,",").concat(d):"M ".concat(v,",").concat(u," L ").concat(v,",").concat(d),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);c(function(){on.current=Vt},[Vt]);var Jt=r(null),Ut=r(null),Gt=u(function(){$e.current.length>0&&!Ge.current||(null!==Jt.current&&clearTimeout(Jt.current),Jt.current=setTimeout(function(){on.current(),Jt.current=null},50))},[]),Qt=u(function(){Pe(!0),He(!1),null!==Ut.current&&clearTimeout(Ut.current),null!==Jt.current&&(clearTimeout(Jt.current),Jt.current=null),Ut.current=setTimeout(function(){var e,n,t,i,o,r,l,c,u,d;if($e.current=[],nn.current&&null!==tn.current&&null!==Dt.current){var a=tn.current,s=Dt.current,v=null,p=null,f=null,g=null;if("string"==typeof a&&a.includes(S)){var h=a.split(S),x="".concat(h[0]).concat(S).concat(h[1]);v=(null===(e=ot.current[x])||void 0===e?void 0:e.current)||null,p=(null===(n=rt.current[x])||void 0===n?void 0:n.current)||null,f=(null===(t=ct.current[h[2]])||void 0===t?void 0:t.current)||(null===(i=tt.current[Number(h[2])])||void 0===i?void 0:i.current)||null,g=(null===(o=ut.current[h[3]])||void 0===o?void 0:o.current)||(null===(r=it.current[Number(h[3])])||void 0===r?void 0:r.current)||null}else v=(null===(l=dt.current[a])||void 0===l?void 0:l.current)||null,f=(null===(c=tt.current[a])||void 0===c?void 0:c.current)||null,p=(null===(u=lt.current[s])||void 0===u?void 0:u.current)||null,g=(null===(d=it.current[s])||void 0===d?void 0:d.current)||null;if(v&&p&&f&&g){if(f.style.paddingTop="0px",g.style.paddingTop="0px",!ye){var m=v.getBoundingClientRect(),y=p.getBoundingClientRect(),b=m.top-y.top;b>0?g.style.paddingTop="".concat(b,"px"):b<0&&(f.style.paddingTop="".concat(Math.abs(b),"px"))}var R=xn.current,C=vn.current;if(R&&C){var I=v.getBoundingClientRect().top-R.getBoundingClientRect().top+R.scrollTop,T=p.getBoundingClientRect().top-C.getBoundingClientRect().top+C.scrollTop-(I-R.scrollTop);Math.abs(C.scrollTop-T)>1&&(C.scrollTop=T)}}}on.current(),nn.current&&He(!0),Pe(!1),Ut.current=null},150)},[ye,Vn,Xn]),Zt=u(function(e){var n,t,i,o,r,l,c,u,d,a;if(null!==yn.current&&bn.current&&Math.abs(e.currentTarget.scrollTop-yn.current)<=2){var s=bn.current;yn.current=null,bn.current=null,s()}if(!We.current){if(ye||Gt(),nn.current){var v=tn.current,p=Dt.current,f=xn.current,g=vn.current;if(null!==v&&null!==p&&f&&g){var h="string"==typeof v&&v.includes(S)?null===(n=ot.current["".concat(v.split(S)[0]).concat(S).concat(v.split(S)[1])])||void 0===n?void 0:n.current:null===(t=dt.current[v])||void 0===t?void 0:t.current,x="string"==typeof p&&p.includes(S)?null===(i=rt.current["".concat(p.split(S)[0]).concat(S).concat(p.split(S)[1])])||void 0===i?void 0:i.current:null===(o=lt.current[p])||void 0===o?void 0:o.current;if(h&&x&&At.current){var m=void 0,y=void 0;if("string"==typeof v&&v.includes(S)){var b=v.split(S),R="".concat(b[0]).concat(S).concat(b[1]);m=null===(r=ot.current[R])||void 0===r?void 0:r.current,y=null===(l=rt.current[R])||void 0===l?void 0:l.current}else m=null===(c=ot.current[v])||void 0===c?void 0:c.current,y=null===(u=rt.current[p])||void 0===u?void 0:u.current;var C=null!==(a=null===(d=Mt.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==a?a:0,I=f.getBoundingClientRect().top,T=I+f.clientHeight;g.getBoundingClientRect().top;g.clientHeight;if(m&&y){var B=m.getBoundingClientRect(),w=y.getBoundingClientRect(),E=B.top+B.height/2;w.top,w.height;var F=((M=E,k=I,D=T,Math.max(k,Math.min(D,M)))-C).toString();At.current.setAttribute("y1",F),At.current.setAttribute("y2",F);var _=E>=I-4&&E<=T+4;At.current.setAttribute("visibility",_?"visible":"hidden")}}}}var M,k,D;$e.current.length>0&&!en.current&&(en.current=!0,requestAnimationFrame(function(){Xt(),en.current=!1}))}},[Xt,ye,Gt]);c(function(){var e=setTimeout(Gt,250);window.addEventListener("resize",Qt);var n=null,t=null;return an.current&&(n=new ResizeObserver(Gt)).observe(an.current),Mt.current&&(t=new ResizeObserver(Gt)).observe(Mt.current),function(){clearTimeout(e),null!==Jt.current&&clearTimeout(Jt.current),null!==Ut.current&&clearTimeout(Ut.current),window.removeEventListener("resize",Qt),null==n||n.disconnect(),null==t||t.disconnect()}},[Kn,qn,pt,Jn,Rt,Ct,Vn,Xn,Nn,Gt,Qt,Me,je,Ae,Ke]),c(function(){nn.current=Me},[Me]),c(function(){tn.current=je},[je]);var $t=u(function(e,n,t){var i,o,r=null===(i=null==t?void 0:t.toggleIfSame)||void 0===i||i,l=null==t?void 0:t.onReady,c=null!==(o=null==t?void 0:t.sourceSide)&&void 0!==o?o:"left";Hn(),null!=e&&(n?Fe("No counterpart exists for this section."):Me&&je===e?r?bt():null==l||l():(qe(new Set([e])),Je([]),$e.current=[],Be(!0),We.current=!0,ze(e),tn.current=e,ke(!0),nn.current=!0,He(!1),pn.current&&(pn.current.style.height="0px"),fn.current&&(fn.current.style.height="0px"),gn.current&&(gn.current.style.height="0px"),hn.current&&(hn.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i,o,r,u="string"==typeof e&&e.includes(S),d=null,a=null,s=null;if(u){var v=e.split(S),p="".concat(v[0]).concat(S).concat(v[1]);d=(null===(n=ot.current[p])||void 0===n?void 0:n.current)||null,a=(null===(t=rt.current[p])||void 0===t?void 0:t.current)||null,s=a?e:null}else if(d=(null===(i=dt.current[e])||void 0===i?void 0:i.current)||null,ye){var f=Vn[e],g=(null==f?void 0:f.refIndexes)||[];if(g.length>0){var h=g[0],x=Xn.findIndex(function(e){return e.selfIndex===h});-1!==x&&(a=(null===(r=lt.current[x])||void 0===r?void 0:r.current)||null,s=x)}}else a=(null===(o=lt.current[e])||void 0===o?void 0:o.current)||null,s=a?e:null;Dt.current=s;var m=xn.current,y=vn.current,b=function(){!function(){var n,t,i,o,r,l,c,d,a,v,p,f,g=null,h=null,x=null,m=null;if(u){var y=e.split(S),b="".concat(y[0]).concat(S).concat(y[1]);g=(null===(n=ct.current[y[2]])||void 0===n?void 0:n.current)||(null===(t=tt.current[Number(y[2])])||void 0===t?void 0:t.current)||null,h=(null===(i=ut.current[y[3]])||void 0===i?void 0:i.current)||(null===(o=it.current[Number(y[3])])||void 0===o?void 0:o.current)||null,x=(null===(r=ot.current[b])||void 0===r?void 0:r.current)||g,m=(null===(l=rt.current[b])||void 0===l?void 0:l.current)||h}else{var R=Number(e),C=null!==s?Number(s):R;g=(null===(c=tt.current[R])||void 0===c?void 0:c.current)||null,h=(null===(d=it.current[C])||void 0===d?void 0:d.current)||null,x=(null===(a=ot.current[R])||void 0===a?void 0:a.current)||(null===(v=dt.current[R])||void 0===v?void 0:v.current)||g,m=(null===(p=rt.current[C])||void 0===p?void 0:p.current)||(null===(f=lt.current[C])||void 0===f?void 0:f.current)||h}if(x&&m&&g&&h){g.style.paddingTop="0px",h.style.paddingTop="0px";var I=x.getBoundingClientRect(),T=m.getBoundingClientRect(),B=I.top-T.top;B>0?h.style.paddingTop="".concat(B,"px"):B<0&&(g.style.paddingTop="".concat(Math.abs(B),"px"))}}(),He(!0),on.current&&on.current(),We.current=!1,"right"===c&&y?y.dispatchEvent(new Event("scroll")):m&&m.dispatchEvent(new Event("scroll")),Be(!1),null==l||l()};if(!d||!m)return We.current=!1,Be(!1),void(null==l||l());if(a&&y){if(!ye){var R=0;R="right"===c?a?a.getBoundingClientRect().top:0:d?d.getBoundingClientRect().top:0;var C=an.current,T=(null==C?void 0:C.getBoundingClientRect().top)||0,B=C?C.scrollTop+R-T-150:0;return C?void I(C,B,200,b):void b()}var w=d.getBoundingClientRect().top-m.getBoundingClientRect().top+m.scrollTop,E=a.getBoundingClientRect().top-y.getBoundingClientRect().top+y.scrollTop,F=200;if("left"===c){var _=E-(w-m.scrollTop);_<0&&pn.current&&(pn.current.style.height="".concat(Math.abs(_),"px")),requestAnimationFrame(function(){var e,n=y.scrollHeight-y.clientHeight;if(_<0)e=0;else{if(_>n){var t=_-n;return fn.current&&(fn.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){I(y,_,F,b)})}e=_}I(y,e,F,b)})}else{var M=w-(E-y.scrollTop);M<0&&gn.current&&(gn.current.style.height="".concat(Math.abs(M),"px")),requestAnimationFrame(function(){var e,n=m.scrollHeight-m.clientHeight;if(M<0)e=0;else{if(M>n){var t=M-n;return hn.current&&(hn.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){I(m,M,F,b)})}e=M}I(m,e,F,b)})}}else b()})))},[je,Hn,Xn,Me,ye,Vn,bt]),ei=u(function(e,n,t,i){var o,r="string"==typeof i?m(i).trim():m(null==i?void 0:i.deviation_summary).trim(),l=e.currentTarget;An();var c="left";(null===(o=vn.current)||void 0===o?void 0:o.contains(l))&&(c="right");var u=function(){var e,t,i,o;if("string"==typeof n&&n.includes(S)){var r=n.split(S),l="".concat(r[0]).concat(S).concat(r[1]);return"right"===c?null===(e=rt.current[l])||void 0===e?void 0:e.current:null===(t=ot.current[l])||void 0===t?void 0:t.current}return"right"===c?null===(i=rt.current[n])||void 0===i?void 0:i.current:null===(o=ot.current[n])||void 0===o?void 0:o.current};if(t)return bt(),qe(new Set),Je([]),$e.current=[],void(r&&requestAnimationFrame(function(){var e=u()||l;_n({open:!0,anchorEl:e,summary:i})}));$t(n,t,r?{toggleIfSame:!1,sourceSide:c,onReady:function(){var e=u()||l;_n({open:!0,anchorEl:e,summary:i})}}:{toggleIfSame:!1,sourceSide:c})},[$t,An,_n,bt]),ni=u(function(){var e,n=In.sectionIdx,t=In.isOrphan;if(Mn(),null!=n){var i="left";In.anchorEl&&(null===(e=vn.current)||void 0===e?void 0:e.contains(In.anchorEl))&&(i="right"),$t(n,t,{sourceSide:i})}},[$t,In.isOrphan,In.sectionIdx,In.anchorEl,Mn]),ti=u(function(){Mn(),bt(),qe(new Set),Je([]),$e.current=[]},[Mn,bt]),ii=null!==In.sectionIdx&&Ke.has(In.sectionIdx),oi=P({proposedSections:Vn,existingSections:Xn,parentDeviationRecord:Un,expandedSections:Rt,maintainRelativeOrder:!!ye,scrollContainerRef:an,leftContainerRef:xn,lhsBadgeRefs:ot,rhsBadgeRefs:rt}),ri=oi.showDeviationNavigation,li=oi.showOpenNodeRef,ci=l(function(){if(!xe)return null;for(var e in Un){if((Un[e]||[]).some(function(e){return e.id===xe}))return e}return null},[xe,Un]),ui=r(null),di=r(null);c(function(){if(xe&&ui.current!==xe){di.current!==xe&&(Mn(),An(),bt(),qe(new Set),Je([]),$e.current=[],di.current=xe);var e=!1,t=0,i=null,o=150,r=function(e,n){for(var t=function(e,i){if(!e)return null;if(e.id===n)return i;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=t(e.subsections[o],"".concat(i,"-").concat(o));if(r)return r}return null},i=0;i<e.length;i++){var o=t(e[i],String(i));if(o)return o}return null},l=function(){var c,u,d,a;if(!e){var s=null,v=null;for(var p in Un){var f=Un[p].find(function(e){return e.id===xe});if(f){s=p,v=f;break}}if(v&&s){var g=Vn.findIndex(function(e){return e.id===s}),h=Xn.findIndex(function(e){return e.id===s}),x=-1===g&&-1!==h;if(x){if(!(ye?!!Rt["right-".concat(h)]:!!Rt[String(h)]))return Tt(h,"right"),t+=1,void(i=setTimeout(l,450))}else if(!(ye?!!Rt["left-".concat(g)]:!!Rt[String(g)])&&g>=0)return Tt(g,"left"),t+=1,void(i=setTimeout(l,450));var m=r(Vn,v.id),y=r(Xn,v.id);if(m&&!y&&!x){var b=m.split("-"),R=Number(b[0]);if(ye){var C=null===(u=null===(c=Vn[R])||void 0===c?void 0:c.refIndexes)||void 0===u?void 0:u[0],I=Xn.findIndex(function(e){return e.selfIndex===C});-1!==I&&(R=I)}y=n([R],b.slice(1),!0).join("-")}if(m||y){var T,B=m||"",w=y||"",E="".concat(v.id).concat(S,"0").concat(S).concat(B).concat(S).concat(w),F="".concat(v.id).concat(S,"0"),_=null===(d=ot.current[F])||void 0===d?void 0:d.current,M=null===(a=rt.current[F])||void 0===a?void 0:a.current,k=x?M:_;if(T=ye?x?vn.current:xn.current:an.current,k&&T){var D=k.getBoundingClientRect();if(0===D.height)return void((t+=1)<20&&(i=setTimeout(l,o)));var A=T.getBoundingClientRect(),H=D.top-A.top+T.scrollTop-A.height/2+D.height/2,N=function(){var n,t,i,o,r;if(!e){ui.current=xe;var l=window.getComputedStyle(k).color;_&&(_.style.transition="box-shadow 300ms ease-in-out",_.style.boxShadow="0 0 10px ".concat(l)),M&&(M.style.transition="box-shadow 300ms ease-in-out",M.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){_&&(_.style.boxShadow=""),M&&(M.style.boxShadow="")},2e3);var c=(null===(t=null===(n=v.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===t?void 0:t[0])||v,u=(null===(i=v.evaluationResult)||void 0===i?void 0:i.evaluation_outputs)||v.evaluation_outputs;if(_&&M&&!x)$t(E,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var e,n=(null===(e=ot.current[F])||void 0===e?void 0:e.current)||_;_n({open:!0,anchorEl:n,summary:{deviation_summary:c.deviation_summary||c,evaluation_outputs:u}})}});else{var d=x?(null===(o=rt.current[F])||void 0===o?void 0:o.current)||M:(null===(r=ot.current[F])||void 0===r?void 0:r.current)||_;_n({open:!0,anchorEl:d,summary:{deviation_summary:c.deviation_summary||c,evaluation_outputs:u}})}}};Math.abs(T.scrollTop-H)<=2?N():(yn.current=H,bn.current=N,T.scrollTo({top:H,behavior:"smooth"}),i&&clearTimeout(i),i=setTimeout(function(){if(bn.current){yn.current=null;var e=bn.current;bn.current=null,e()}},800))}else(t+=1)<20&&(i=setTimeout(l,o))}else(t+=1)<20&&(i=setTimeout(l,o))}else(t+=1)<20&&(i=setTimeout(l,o))}};return i=setTimeout(l,o),function(){e=!0,i&&clearTimeout(i)}}},[xe,Un,Vn,Xn,ye,Rt,Tt,$t,_n]);var ai=function(e){var n=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,c=void 0===l?"left":l,u=e.parentNodeId;return i(z,{section:n,keyPath:t,depth:r,columnKey:c,parentNodeId:void 0===u?"":u,expandedSubSections:Ct,setExpandedSubSections:It,maintainRelativeOrder:ye||!1,proposedSections:Vn,existingSections:Xn,treeData:ce,deviationNumberRegistry:Gn,connectedSections:Ke,activeSideBySideSection:je,resolvedMarkdownStyles:dn,getSubSectionRef:st,getSubSectionCompareStyle:qt,getBadgeRef:vt,openMoreFunctionsPopup:Et,openSummaryPopup:ei,resetSideBySide:bt,setConnectedSections:qe,setConnectedLines:Je,cachedConnectedPositions:$e})};return t(d,e({ref:sn,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},ye?{}:{overflow:"visible"}),{position:"relative"})},{children:[Re&&i(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:i(k,{})})),Fn.open&&i(W,{open:Fn.open,anchorEl:Fn.anchorEl,containerEl:kt.current,clipTopEl:Ht.current,scrollContainerEl:an.current,onClose:ti,summary:Fn.summary}),i(M,{open:In.open,anchorEl:In.anchorEl,sectionTitle:In.sectionTitle,referenceSectionTitle:In.refSectionTitle,onClose:Hn,onOpenCognitiveCompare:Ft,onOpenSideBySide:ni,onConnect:_t,isConnected:ii,isOrphan:In.isOrphan}),Rn.open&&i(_,{open:Rn.open,popupRef:Dn,position:Bn,popupConfig:fe,onClose:function(){wn(null),Cn(function(n){return e(e({},n),{open:!1})}),kn(null)},markdownStyles:se,sectionTitle:Rn.sectionTitle,referenceSectionTitle:Rn.refSectionTitle,cognitiveData:Rn.cognitiveData,anchorEl:Rn.anchorEl,sectionAnchorEl:Rn.sectionAnchorEl,scrollContainerEl:an.current,badgeStyle:Rn.badgeStyle,docData:Rn.docData,deviationData:Rn.deviationData,isLoading:Rn.isLoading}),i(a,e({open:!!Ee,autoHideDuration:8e3,onClose:function(){return Fe(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(s,e({onClose:function(){return Fe(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ee}))})),i(O,{componentHeaderText:le,displayConfig:pe,maintainRelativeOrder:ye,onToggleView:function(e){Ce(!0),setTimeout(function(){be(!e),bt(),Mn(),qe(new Set),Je([]),$e.current=[],setTimeout(function(){Ce(!1)},400)},50)}}),i(d,e({ref:an,onScroll:Zt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:ye?"hidden":"auto",borderTop:ft&>?"none":"1.5px solid #EEF0F4"}},{children:i(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},ye?{flex:1,minHeight:0}:{})},{children:t(d,e({ref:Mt,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},ye?{flex:1,overflow:"visible"}:{})},{children:[t("svg",e({ref:Ue,style:{position:"absolute",top:0,left:0,width:cn.width||"100%",height:cn.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:Le?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[zt&&i("g",{children:i("line",{x1:zt.x1,y1:zt.y,x2:zt.x2,y2:zt.y,stroke:yt.badgeBorder,strokeWidth:"1.5"})}),Pt.map(function(n){var o,r,l,c,u,a,s=n.x1+.5*(n.x2-n.x1),v=(n.y1+n.y2)/2;if("Not Defined"===n.style.label&&!n.hasCognitive)return null;if(n.isSubSection?Me&&je===n.subSectionKeyPath&&Ae:Me&&je===n.sectionIdx&&Ae)return null;if(!ye){var p=n.isSubSection?C(n.x1,n.y1,n.x2,n.y2):"M ".concat(n.x1," ").concat(n.y1," L ").concat(n.x2," ").concat(n.y2),g=Vn[n.sectionIdx]||{title:"",content:""},x=Xn[n.sectionIdx]||{title:"",content:""};if(console.log("Base and Ref Sections for Badge:",g,x),n.isSubSection&&n.subSectionKeyPath){var m=n.subSectionKeyPath.includes(S)?n.subSectionKeyPath.split(S):[],y=m[2]||n.subSectionKeyPath,b=m[3]||y,R=y.split("-").map(Number),I=b.split("-").map(Number),T=null,B=null;R.length>0&&(T=Vn[R[0]]),I.length>0&&(B=Xn[I[0]]);var w=(null==T?void 0:T.title)||"",F=(null==B?void 0:B.title)||"";console.log("Root Parent Titles:",w,F);for(var _=1;_<R.length;_++)(null==T?void 0:T.subsections)&&(T=T.subsections[R[_]]);for(_=1;_<I.length;_++)(null==B?void 0:B.subsections)&&(B=B.subsections[I[_]]);T&&(g=e(e({},T),{title:w||T.title})),console.log("Base Section for Subsection Badge:",g),B&&(x=e(e({},B),{title:F||B.title})),console.log("Ref Section for Subsection Badge:",x)}var M=!(null===(o=g.cognitiveData)||void 0===o?void 0:o.isMissingRationale)||Boolean(null===(l=null===(r=g.cognitiveData)||void 0===r?void 0:r.decisioning)||void 0===l?void 0:l.length),k=(null===(a=null===(u=null===(c=g.evaluationResult)||void 0===c?void 0:c.cognitive_decisioning)||void 0===u?void 0:u.decisioning_factors)||void 0===a?void 0:a.length)||!1,A=M||k;return t("g",{children:[i("path",{d:p,fill:"none",stroke:n.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i("foreignObject",e({x:s-100,y:v-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t(d,e({onClick:function(e){e.stopPropagation(),A&&(Rn.open&&En===n.id?An():(kn(n.id),wt(Bt(e.currentTarget,g,x,n.sectionIdx,n.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:n.style.badgeBg,color:n.style.badgeText,border:"1px solid ".concat(n.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:A?"pointer":"default"}},{children:[n.style.badgeText===E&&null==n.style.label?i(D,{color:n.style.badgeText}):0===n.style.label?"Same":n.style.label,i(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(h,{})})),A&&i(f,{size:11,style:{transform:Rn.open&&En===n.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},n.id)}return null}),Xe.map(function(n){var o,r=n.pathD,l=(null===(o=n.style)||void 0===o?void 0:o.badgeBorder)||"#6366F1",c="conn-marker-".concat(n.id),u="".concat(n.id,"-bg"),d="".concat(n.id,"-stroke");return t("g",{children:[i("defs",{children:i("clipPath",e({id:"connections-clip"},{children:i("marker",e({id:c,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:i("polygon",{points:"0 0, 8 3, 0 6",fill:l})}))}))}),i("path",{ref:function(e){Ze.current[u]=e},d:r,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),i("path",{ref:function(e){Ze.current[d]=e},d:r,fill:"none",stroke:l,strokeWidth:"1.75",markerEnd:"url(#".concat(c,")")})]},n.id)})]})),t(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},ye?{flex:1,overflow:"visible"}:{})},{children:[i(d,e({ref:Ht,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:zn,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:zn}))}))})),t(d,e({ref:xn,onScroll:Zt,sx:e({p:"12px",display:"flex",flexDirection:"column"},ye?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:gn,style:{width:"100%",height:"0px",flexShrink:0}}),Zn&&Vn.map(function(n,o){var r,l,c=!n.title&&!n.content;if(ye&&c)return null;var u=n,a=Kt(o,"left"),s=ye?!(null===(r=u.refIndexes)||void 0===r?void 0:r.length)||u.selfIndex<0:!Xn[o],v=ye?"number"==typeof u.selfIndex&&u.selfIndex>=0?u.selfIndex+1:null:o+1,p=Ke.has(o),f=y(u.evaluationResult,null==a?void 0:a.deviationLabel);return i(d,e({ref:at(o),sx:{mb:1,width:"100%"}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[i(d,e({ref:tt.current[o],sx:e({width:"100%",display:"flex"},p&&{borderRadius:"6px",outline:"2px solid ".concat((null==a?void 0:a.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:i(j,{section:n,idx:o,columnKey:"left",colRef:at("left-accordion-".concat(o)),mb:0,treeData:ce,proposedSections:Vn,existingSections:Xn,deviationNumberRegistry:Gn,getSectionCompareStyle:Kt,getBadgeRef:vt,connectedSections:Ke,openMoreFunctionsPopup:Et,openSummaryPopup:ei,deviationNodeIdToView:xe,deviationTargetParentId:ci,parentNodeId:(null===(l=null==ce?void 0:ce.input_index_map)||void 0===l?void 0:l[0])||"",isExpanded:ye?!!Rt["left-".concat(o)]:!!Rt[String(o)],onToggle:function(){ti(),Tt(o,"left")},navigation:n.id?ri[n.id]:null,showOpenNodeRef:li,resolvedMarkdownStyles:dn,maintainRelativeOrder:ye,renderSubSections:ai})})),ye&&a&&t(d,e({ref:ot.current[o],onClick:function(e){var t=ye?Xn.find(function(e){var n;return null===(n=u.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Xn[o]||{title:"",content:""};Et(e,n,s,t,o,a)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:a.badgeBg,color:a.badgeText,border:"1px solid ".concat(a.badgeBorder),borderRadius:"12px",px:1.2,py:.4,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[null!==v&&i(d,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(a.badgeBorder)}},{children:v})),i(d,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:!pe.isLoading||null!=u.evaluationResult&&null!=u.evaluationResult?s?"No Deviation Found":"N/A"===f||"NA"===f?"N/A":0==f||null==f?"Same":"".concat(f):i(D,{color:a.badgeText})})),i(g,{size:11,color:a.badgeText})]}))]}))}),"left-row-".concat(o))}),i("div",{ref:hn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(d,e({ref:kt,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:i(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(d,e({onClick:function(n){n.stopPropagation(),Rn.open&&En===ht?An():(kn(ht),wt(Bt(n.currentTarget,{title:"",content:"",evaluationResult:xt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,ht,!0,e(e({},yt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-5px",borderRadius:"20px",bgcolor:yt.badgeBg,color:yt.badgeText,border:"1px solid ".concat(yt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=mt?mt:i(D,{}),i(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(h,{})})),i(f,{size:11,style:{transform:Rn.open&&En===ht?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),t(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},ye?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Te&&i(x,{sections:11}),i(d,e({ref:Nt,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:Wn,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Wn}))}))})),t(d,e({ref:vn,onScroll:Zt,sx:e({p:"12px",display:"flex",flexDirection:"column"},ye?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-120px",pl:"140px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:pn,style:{width:"100%",height:"0px",flexShrink:0}}),Zn&&Xn.map(function(n,o){var r,l=n,c=[],u=!1,a=null,s=-1;if(ye){c=Vn.filter(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1}),s=Vn.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0});var v=Vn.findIndex(function(e,n){var t;return Ke.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(u=-1!==v)&&(a=Kt(v))}else c=[o+1],(u=Ke.has(o))&&(a=Kt(o));var p=Kt(ye&&-1!==s?s:o);return i(d,e({ref:lt.current[o],sx:{mb:1,width:"100%"}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[i(d,e({ref:it.current[o],sx:e({width:"100%",display:"flex"},u&&a&&{borderRadius:"6px",outline:"2px solid ".concat(a.badgeBorder),outlineOffset:"1px"})},{children:i(j,{section:n,idx:o,columnKey:"right",colRef:at("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==ce?void 0:ce.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:ye?!!Rt["right-".concat(o)]:!!Rt[String(o)],treeData:ce,proposedSections:Vn,existingSections:Xn,deviationNumberRegistry:Gn,getBadgeRef:vt,getSectionCompareStyle:Kt,connectedSections:Ke,openMoreFunctionsPopup:Et,openSummaryPopup:ei,deviationNodeIdToView:xe,deviationTargetParentId:ci,onToggle:function(){ti(),Tt(o,"right")},navigation:n.id?ri[n.id]:null,showOpenNodeRef:li,resolvedMarkdownStyles:dn,maintainRelativeOrder:ye,renderSubSections:ai})})),ye&&p&&i(d,e({ref:rt.current[o],"data-section-id":l.id,sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:p.badgeBg,color:p.badgeText,border:"1px solid ".concat(p.badgeBorder),borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:c.length>0?c.join(", "):"-"}))]}))}),"right-row-".concat(o))}),i("div",{ref:fn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{Y as default};
|
|
1
|
+
import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as t,jsx as i}from"react/jsx-runtime";import{useState as o,useRef as r,useMemo as l,useEffect as c,useCallback as u}from"react";import{Box as d,Snackbar as a,Alert as s,Tooltip as v,Typography as p}from"@mui/material";import{ChevronDown as f,EllipsisVertical as g}from"lucide-react";import{ButtonCognitiveIcon as h}from"../../assests/svg/ButtonCognitiveIcon.js";import x from"./OverlayComponent.js";import{safeStringify as m,extractDeviationScore as y,generateColorPalette as b,DEVIATION_BADGE_SEPARATOR as S,hasValue as R,getBentArrowPath as C,smoothScrollTo as T}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as I,DEFAULT_FIELD_CONFIG as B,DEFAULT_COMPARISON_CONFIG as w}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as E,DEFAULT_COMPONENT_HEADER_TEXT as F}from"./CognitiveCompareConstants.js";import _ from"./CognitivePopup.js";import k from"./MoreFunctionsPopup.js";import M from"./LoaderComponent.js";import D from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as H}from"./hooks/useCompareData.js";import{useComparePopups as A}from"./hooks/useComparePopups.js";import{useSectionRefs as L}from"./hooks/useSectionRefs.js";import{useAccordionState as O}from"./hooks/useAccordionState.js";import{useDeviationNavigation as P}from"./hooks/useDeviationNavigation.js";import j from"./components/CompareHeader.js";import N from"./components/SectionAccordion.js";import z from"./components/SubSectionAccordion.js";import W from"./components/CognitiveSummaryPopup.js";var Y=function(Y){var K,V,X,q,J,U,G,Q,Z,$,ee,ne,te,ie,oe,re=Y.componentHeaderText,le=void 0===re?F:re,ce=Y.treeData,ue=Y.comparisonConfig,de=Y.leftColumnTitleText,ae=Y.rightColumnTitleText,se=Y.markdownStyles,ve=Y.displayConfig,pe=void 0===ve?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0}:ve,fe=Y.popupConfig,ge=Y.deviationData,he=void 0===ge?{}:ge,xe=Y.deviationNodeIdToView,me=o(pe.maintainRelativeOrder),ye=me[0],be=me[1],Se=o(!1),Re=Se[0],Ce=Se[1],Te=o(!1),Ie=Te[0],Be=Te[1],we=o(null),Ee=we[0],Fe=we[1],_e=o(!1),ke=_e[0],Me=_e[1],De=o(!1),He=De[0],Ae=De[1],Le=o(!1),Oe=Le[0],Pe=Le[1],je=o(null),Ne=je[0],ze=je[1],We=r(!1),Ye=o(new Set),Ke=Ye[0],Ve=Ye[1],Xe=o([]),qe=Xe[0],Je=Xe[1],Ue=r(null),Ge=r(!1),Qe=r(null),Ze=r({}),$e=r([]),en=r(!1),nn=r(!1),tn=r(null),on=r(function(){}),rn=l(function(){return(null==ce?void 0:ce.cognitive_decisioning)||{}},[ce]),ln=o({width:0,height:0}),cn=ln[0],un=ln[1],dn=l(function(){return e(e({},I),se)},[se]),an=r(null),sn=r(null),vn=r(null),pn=r(null),fn=r(null),gn=r(null),hn=r(null),xn=r(null),mn=r(!1),yn=A(an),bn=yn.cognitivePopup,Sn=yn.setCognitivePopup,Rn=yn.moreFunctions,Cn=yn.setMoreFunctions,Tn=yn.position,In=yn.setPosition,Bn=yn.activeBadgeId,wn=yn.summaryPopup,En=yn.setSummaryPopup,Fn=yn.closeSummaryPopup,_n=yn.setActiveBadgeId,kn=yn.popupRef,Mn=yn.closeCognitivePopup,Dn=yn.closeMoreFunctionsPopup,Hn=l(function(){var e,n,t,i,o,r,l;return{fields:null!==(e=null==ue?void 0:ue.fields)&&void 0!==e?e:B,thresholds:{high:null!==(t=null===(n=null==ue?void 0:ue.thresholds)||void 0===n?void 0:n.high)&&void 0!==t?t:w.thresholds.high,medium:null!==(o=null===(i=null==ue?void 0:ue.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:w.thresholds.medium,exact:null!==(l=null===(r=null==ue?void 0:ue.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:w.thresholds.exact}}},[ue]),An=o(null),Ln=An[0];An[1];var On=null===(X=null===(K=null==ce?void 0:ce.documents)||void 0===K?void 0:K[null===(V=null==ce?void 0:ce.input_index_map)||void 0===V?void 0:V[0]])||void 0===X?void 0:X.title,Pn=null===(U=null===(q=null==ce?void 0:ce.documents)||void 0===q?void 0:q[null===(J=null==ce?void 0:ce.input_index_map)||void 0===J?void 0:J[1]])||void 0===U?void 0:U.title,jn=m(de||On||"Uploaded Contract"),Nn=m(ae||Pn||"Reference Template"),zn=H(ce,ye,he,Hn),Wn=zn.activeProposed,Yn=zn.existingRule,Kn=zn.proposedSections,Vn=zn.existingSections,Xn=zn.visibleFields,qn=zn.parentDeviationRecord,Jn=zn.deviationNumberRegistry,Un=zn.parseError;c(function(){Un&&Fe("Failed to load comparison: ".concat(Un))},[Un]);var Gn=Kn.length>0||Vn.length>0,Qn=L(Xn.map(function(e){return e.key}),Math.max(Kn.length,Vn.length)),Zn=Qn.leftRefs,$n=Qn.rightRefs,et=Qn.sectionLeftRefs,nt=Qn.sectionRightRefs,tt=Qn.lhsBadgeRefs,it=Qn.rhsBadgeRefs,ot=Qn.sectionRightRowRefs,rt=Qn.subSectionLeftRefs,lt=Qn.subSectionRightRefs,ct=Qn.sectionRowRefs,ut=Qn.getSectionRowRef,dt=Qn.getSubSectionRef,at=Qn.getBadgeRef,st=Yn.analysis,vt=m(null===(Q=null===(G=null==st?void 0:st.rule_difference_comparison)||void 0===G?void 0:G.summary)||void 0===Q?void 0:Q.overall_summary),pt=!!vt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),ft=null!==(Z=null==ce?void 0:ce.base_root_id)&&void 0!==Z?Z:"-1";null==ce||ce[ft];var gt=(null===($=null==he?void 0:he[ft])||void 0===$?void 0:$.evaluation_result)||(null===(ne=null===(ee=null==ce?void 0:ce.nodes)||void 0===ee?void 0:ee[ft])||void 0===ne?void 0:ne.evaluation_result)||null,ht=y(gt),xt=b(null!==(oe=null===(ie=null===(te=null==gt?void 0:gt.evaluation_outputs)||void 0===te?void 0:te.metadata)||void 0===ie?void 0:ie.label_color)&&void 0!==oe?oe:""),mt=u(function(){var e,n,t,i;Me(!1),nn.current=!1;var o=tn.current,r=kt.current;if(null!==o)if("string"==typeof o&&o.includes(S)){var l=o.split(S);(c=null===(e=rt.current[l[2]])||void 0===e?void 0:e.current)&&(c.style.paddingTop="0px")}else{var c;(c=null===(n=et.current[o])||void 0===n?void 0:n.current)&&(c.style.paddingTop="0px")}if(null!==r)if("string"==typeof r&&r.includes(S)){l=r.split(S);(u=null===(t=lt.current[l[3]])||void 0===t?void 0:t.current)&&(u.style.paddingTop="0px")}else{var u;(u=null===(i=nt.current[r])||void 0===i?void 0:i.current)&&(u.style.paddingTop="0px")}ze(null),tn.current=null,kt.current=null,Ae(!1),Be(!1),pn.current&&(pn.current.style.height="0px"),fn.current&&(fn.current.style.height="0px"),gn.current&&(gn.current.style.height="0px"),hn.current&&(hn.current.style.height="0px")},[]),yt=O({maintainRelativeOrder:!!ye,proposedSections:Kn,existingSections:Vn,activeSideBySideSection:Ne,connectedSections:Ke,resetSideBySide:mt,setConnectedSections:Ve,setConnectedLines:Je,cachedConnectedPositions:$e,svgContainerRef:Ue,isAnimatingRef:Ge,animationTimerRef:Qe,calculateLinesRef:on,sectionLeftRefs:et,sectionRightRefs:nt,subSectionLeftRefs:rt,subSectionRightRefs:lt}),bt=yt.expandedSections,St=yt.expandedSubSections,Rt=yt.setExpandedSubSections,Ct=yt.toggleSection,Tt=u(function(e,n,t,i,o,r,l){var c,u,d,a=m(null==n?void 0:n.id)||m(null==t?void 0:t.id)||"",s=(a?rn[a]:null)||(null==n?void 0:n.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:a,decisioning:[],gap:[],relevance_score:0},v=null!==(u=null===(c=ct.current[i])||void 0===c?void 0:c.current)&&void 0!==u?u:null;return{isLoading:null!==(d=null==pe?void 0:pe.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==n?void 0:n.displayTitle)?null==n?void 0:n.title:"no title",refSectionTitle:(null==t?void 0:t.displayTitle)?null==t?void 0:t.title:"no title",cognitiveData:s,anchorEl:e,sectionAnchorEl:v,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==ce?void 0:ce.documents,input_index_map:null==ce?void 0:ce.input_index_map},deviationData:(null==n?void 0:n.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,isOrphan:!!o}},[rn,ce]),It=u(function(e){Dn(),In(null),Sn(e)},[Dn]),Bt=function(e,n,t,i,o,r){e.stopPropagation(),Rn.open&&Rn.sectionIdx===o?Dn():(Mn(),Cn(Tt(e.currentTarget,n,i,o,t,r)))},wt=u(function(){null!==Rn.sectionIdx&&Rn.anchorEl?It(e(e({},Rn),{open:!0})):Dn()},[Rn,Dn,It]),Et=u(function(){var e=Rn.sectionIdx,n=Rn.isOrphan;Dn(),Fn(),null!==e&&(n?Fe("No counterpart exists to connect to."):(nn.current&&mt(),Je([]),$e.current=[],Ve(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){on.current&&on.current()},50)))},[Rn.sectionIdx,Rn.isOrphan,Dn,Fn,mt]),Ft=r(null),_t=r(null),kt=r(null),Mt=r(null),Dt=r(null),Ht=r(null),At=o([]),Lt=At[0],Ot=At[1];r(null);var Pt=o(null),jt=Pt[0],Nt=Pt[1];c(function(){if(Ln){var e=Hn.fields.find(function(e){return e.analysisKey===Ln||e.key===Ln});if(e){var n=Zn.current[e.key]||$n.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Ln,Hn.fields]);var zt=u(function(e){var n,t,i,o,r,l,c,u,d,a=null===(n=null==st?void 0:st.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!a||!a[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=a[e],v=(null==s?void 0:s.relation)||(null===(i=null===(t=null==s?void 0:s.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(r=null===(o=null==s?void 0:s.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==s?void 0:s.mappings)&&s.mappings.length>0;if(s.mappings){var p=s.mappings[0]||{};return{score:s.score,relation:p.relation||"",highlightsA:(null===(l=p.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(c=p.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!v}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(u=s.highlights)||void 0===u?void 0:u.ruleA_spans)||[],highlightsB:(null===(d=s.highlights)||void 0===d?void 0:d.ruleB_spans)||[],hasContent:!!v}},[st]),Wt=u(function(n,t){var i,o,r,l,c,u,d;void 0===t&&(t="left");var a=null,s=null;if("left"===t)if(a=Kn[n],ye&&a){var v=Vn.filter(function(e){var n;return null===(n=a.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)});s=v.find(function(e){return e.evaluationResult})||v[0]}else s=Vn[n];else if(s=Vn[n],ye&&s){var p=Kn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(s.selfIndex)});a=p.find(function(e){return e.evaluationResult})||p[0]}else a=Kn[n];var f=(null==a?void 0:a.relation)&&"not_defined"!==a.relation,g=(null==s?void 0:s.relation)&&"not_defined"!==s.relation,h=!(!(null==a?void 0:a.cognitiveData)&&!(null==s?void 0:s.cognitiveData));if(!f&&!g&&!h)return e(e({},b(E)),{label:"Not Defined"});var x=null!==(o=null!==(i=null==a?void 0:a.evaluationResult)&&void 0!==i?i:null==s?void 0:s.evaluationResult)&&void 0!==o?o:null,m=null===(r=null==x?void 0:x.evaluation_outputs)||void 0===r?void 0:r.output_value,y=null!==(u=null===(c=null===(l=null==x?void 0:x.evaluation_outputs)||void 0===l?void 0:l.metadata)||void 0===c?void 0:c.label_color)&&void 0!==u?u:E;return e(e({},b(y)),null!=x?{label:null!==(d=m)&&void 0!==d?d:""}:{label:null})},[Kn,Vn,rn,Hn,ye]),Yt=u(function(n){for(var t,i,o,r,l,c,u,d,a,s=n.split("-").map(Number),v=Kn[s[0]],p=Vn[s[0]],f=1;f<s.length;f++)(null==v?void 0:v.subsections)&&(v=v.subsections[s[f]]),(null==p?void 0:p.subsections)&&(p=p.subsections[s[f]]);if(!v&&!p)return null;var g=(null==v?void 0:v.relation)&&"not_defined"!==v.relation,h=(null==p?void 0:p.relation)&&"not_defined"!==p.relation,x=m(null==v?void 0:v.id)||m(null==p?void 0:p.id)||"",y=!(!(null==v?void 0:v.cognitiveData)&&!(null==p?void 0:p.cognitiveData));if(!g&&!h&&!y)return e(e({},b(E)),{label:"Not Defined"});null!==(i=null!==(t=null==v?void 0:v.cognitiveRelevanceScore)&&void 0!==t?t:null==p?void 0:p.cognitiveRelevanceScore)&&void 0!==i||x&&(null===(o=rn[x])||void 0===o||o.relevance_score);var S=null!==(l=null!==(r=null==v?void 0:v.evaluationResult)&&void 0!==r?r:null==p?void 0:p.evaluationResult)&&void 0!==l?l:null,R=null===(c=null==S?void 0:S.evaluation_outputs)||void 0===c?void 0:c.output_value,C=null!==(a=null===(d=null===(u=null==S?void 0:S.evaluation_outputs)||void 0===u?void 0:u.metadata)||void 0===d?void 0:d.label_color)&&void 0!==a?a:E;return e(e({},b(C)),null!=S?{label:null!=R?R:""}:{label:null})},[Kn,Vn,rn,Hn]),Kt=u(function(){var e,n,t,i,o,r,l,c,u,d,a,s,v,p,f,g,h,x;if(!mn.current&&!Ge.current){mn.current=!0;try{if(!Ft.current)return;var m=function(e){var n=e.split("-"),t=n[0];if(!bt[t]&&!1===ye)return!1;if(ye&&!bt["left-".concat(t)]&&!bt["right-".concat(t)]&&!bt[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!St[i])return!1;return!0},y=Ft.current.getBoundingClientRect();un({width:y.width,height:y.height});var b=[];if(Xn.forEach(function(e){var n,t,i=e.key,o=null===(n=Zn.current[i])||void 0===n?void 0:n.current,r=null===(t=$n.current[i])||void 0===t?void 0:t.current;o&&r&&(o.style.height="auto",r.style.height="auto",o.style.minHeight="0px",r.style.minHeight="0px")}),!Ge.current){for(var T=0;T<Math.max(Kn.length,Vn.length);T++){var I=null===(e=et.current[T])||void 0===e?void 0:e.current,B=null===(n=nt.current[T])||void 0===n?void 0:n.current;I&&(I.style.height="auto",I.style.minHeight="0px"),B&&(B.style.height="auto",B.style.minHeight="0px")}ye||Object.keys(rt.current).forEach(function(e){var n,t;if(m(e)){var i=null===(n=rt.current[e])||void 0===n?void 0:n.current,o=null===(t=lt.current[e])||void 0===t?void 0:t.current;i&&o&&(i.style.height="auto",o.style.height="auto",i.style.minHeight="0px",o.style.minHeight="0px")}})}var w={};Xn.forEach(function(e){var n,t,i=e.key,o=null===(n=Zn.current[i])||void 0===n?void 0:n.current,r=null===(t=$n.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect();w[i]=Math.max(l.height,c.height)}});var E={left:{},right:{}},F={};if(!Ge.current)if(ye){if(ke&&null!==Ne)if("number"==typeof Ne){var _=Ne,k=Kn[_],M=null===(o=et.current[_])||void 0===o?void 0:o.current;M&&k&&(k.refIndexes||[]).forEach(function(e){var n,t=Vn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=nt.current[t])||void 0===n?void 0:n.current;if(i&&(bt["left-".concat(_)]||bt["right-".concat(t)])){var o=Math.max(M.getBoundingClientRect().height,i.getBoundingClientRect().height);E.left[_]=Math.max(E.left[_]||0,o),E.right[t]=Math.max(E.right[t]||0,o)}})}else{var D=Ne.split(S)[2];if(D){I=null===(r=rt.current[D])||void 0===r?void 0:r.current,B=null===(l=lt.current[D])||void 0===l?void 0:l.current;if(I&&B){H=Math.max(I.getBoundingClientRect().height,B.getBoundingClientRect().height);F[D]=Math.max(F[D]||0,H)}}}}else{Object.keys(rt.current).forEach(function(e){var n,t;if(m(e)){var i=null===(n=rt.current[e])||void 0===n?void 0:n.current,o=null===(t=lt.current[e])||void 0===t?void 0:t.current;if(i&&o&&null!==i.offsetParent&&null!==o.offsetParent){var r=i.getBoundingClientRect(),l=o.getBoundingClientRect(),c=Math.max(r.height,l.height);F[e]=c,i.style.minHeight="".concat(c,"px"),o.style.minHeight="".concat(c,"px")}}});for(T=0;T<Math.min(Kn.length,Vn.length);T++){var I=null===(t=et.current[T])||void 0===t?void 0:t.current,B=null===(i=nt.current[T])||void 0===i?void 0:i.current;if(I&&B){var H=Math.max(I.getBoundingClientRect().height,B.getBoundingClientRect().height);E.left[T]=H,E.right[T]=H}}}if(Xn.forEach(function(e){var n,t,i=e.key,o=null===(n=Zn.current[i])||void 0===n?void 0:n.current,r=null===(t=$n.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=w[i];o.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}),Ge.current||(Object.entries(E.left).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=et.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(E.right).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=nt.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),ye||Object.keys(F).forEach(function(e){var n,t,i=null===(n=rt.current[e])||void 0===n?void 0:n.current,o=null===(t=lt.current[e])||void 0===t?void 0:t.current;if(i&&o&&F[e]){var r=F[e];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),ye)Kn.forEach(function(e,n){var t;(null===(t=et.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,o,r,l,c,u=Vn.findIndex(function(n){return n.selfIndex===e});if(-1!==u){var d=null===(t=tt.current[n])||void 0===t?void 0:t.current,a=null===(i=it.current[u])||void 0===i?void 0:i.current;if(d&&a){var s,v,p,f=d.getBoundingClientRect(),g=a.getBoundingClientRect(),h=f.right-y.left,x=g.left-y.left,m=f.top+f.height/2-y.top,S=g.top+g.height/2-y.top;if(ke&&Ne===n){var R=null!==(r=null===(o=xn.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,C=R+(null!==(c=null===(l=xn.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0),T=f.top+f.height/2;s=T,v=R,p=C,S=m=Math.max(v,Math.min(p,s))-y.top}var I=Wt(n);I&&b.push({id:"line-".concat(n,"-").concat(u),x1:h,y1:m,x2:x,y2:S,style:I,sectionIdx:n,targetRightIdx:u})}}})});else{for(T=0;T<Math.min(Kn.length,Vn.length);T++){var A=null===(c=et.current[T])||void 0===c?void 0:c.current,L=null===(u=nt.current[T])||void 0===u?void 0:u.current;if(A&&L){var O=A.getBoundingClientRect(),P=L.getBoundingClientRect(),j=Math.max(O.top,P.top)+18-y.top,N=(null===(d=Vn[T])||void 0===d?void 0:d.id)||"sec-".concat(T);(J=Wt(T))&&b.push({id:N,x1:O.right-y.left,y1:j,x2:P.left-y.left,y2:j,style:J,sectionIdx:T,hasCognitive:!!((null===(a=Kn[T])||void 0===a?void 0:a.cognitiveData)||(null===(s=Vn[T])||void 0===s?void 0:s.cognitiveData)||N&&rn[N]),isSubSection:!1})}}Object.keys(rt.current).forEach(function(e){var n,t,i,o,r,l;if(m(e)){var c=null===(n=rt.current[e])||void 0===n?void 0:n.current,u=null===(t=lt.current[e])||void 0===t?void 0:t.current;if(c&&u){for(var d=e.split("-").map(Number),a=Kn[d[0]],s=Vn[d[0]],v=1;v<d.length;v++)(null==a?void 0:a.subsections)&&(a=a.subsections[d[v]]),(null==s?void 0:s.subsections)&&(s=s.subsections[d[v]]);var p=!!a&&((null===(i=a.displayTitle)||void 0===i||i)&&R(a.title)),f=!!a&&((null===(o=a.displayContent)||void 0===o||o)&&R(a.content)),g=!!s&&((null===(r=s.displayTitle)||void 0===r||r)&&R(s.title)),h=!!s&&((null===(l=s.displayContent)||void 0===l||l)&&R(s.content));if(p&&f||g&&h){var x=c.getBoundingClientRect(),S=u.getBoundingClientRect(),C=Math.max(x.top,S.top)+16-y.top,T=Yt(e);T&&"Not Defined"!==T.label&&b.push({id:"subsec-".concat(e),x1:x.right-y.left,y1:C,x2:S.left-y.left,y2:C,style:T,sectionIdx:d[0],isSubSection:!0,subSectionKeyPath:e,hasCognitive:!(!(null==a?void 0:a.cognitiveData)&&!(null==s?void 0:s.cognitiveData))})}}}})}if(ke&&"string"==typeof Ne&&Ne.includes(S)){var z=Ne.split(S),W=z[0],Y=z[1],K=z[2],V=(z[3],"".concat(W).concat(S).concat(Y)),X=null===(v=tt.current[V])||void 0===v?void 0:v.current,q=null===(p=it.current[V])||void 0===p?void 0:p.current;if(X&&q){var J,U=X.getBoundingClientRect(),G=q.getBoundingClientRect(),Q=U.right-y.left,Z=G.left-y.left,$=U.top+U.height/2-y.top,ee=(G.top,G.height,y.top);if(ye){var ne=null!==(g=null===(f=xn.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==g?g:0,te=ne+(null!==(x=null===(h=xn.current)||void 0===h?void 0:h.clientHeight)&&void 0!==x?x:1/0);me=U.top+U.height/2,be=ne,Se=te,$=Math.max(be,Math.min(Se,me))-y.top}ee=$,(J=Yt(K))&&b.push({id:"line-subsec-".concat(V),x1:Q,y1:$,x2:Z,y2:ee,style:J,sectionIdx:Number(K.split("-")[0]),isSubSection:!0,subSectionKeyPath:Ne})}}if(Ot(b),Dt.current&&Ht.current){var ie=Dt.current.getBoundingClientRect(),oe=Ht.current.getBoundingClientRect(),re=(ie.top+ie.height/2-y.top+oe.top+oe.height/2-y.top)/2;Nt({x1:ie.right-y.left,x2:oe.left-y.left,y:re})}else Nt(null);if(Ke.size>0){var le=[],ce=xn.current,ue=vn.current;if(ce&&ue){var de=[],ae=ce.getBoundingClientRect().top,se=ue.getBoundingClientRect().top,ve=ae+ce.clientHeight,pe=se+ue.clientHeight,fe=ce.scrollTop,ge=ue.scrollTop,he=y.top,xe=function(e,n,t){return Math.max(n,Math.min(t,e))};Ke.forEach(function(e){var n,t,i,o,r;if("string"==typeof e&&e.includes(S)){var l=e.split(S),c=l[0],u=l[1],d=l[2],a=(l[3],"".concat(c).concat(S).concat(u)),s=null===(n=tt.current[a])||void 0===n?void 0:n.current,v=null===(t=it.current[a])||void 0===t?void 0:t.current;if(!s||!v)return;var p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),g=Yt(d),h=(A=p.right-y.left)+.5*((L=f.left-y.left-0)-A),x=p.top+p.height/2,m=f.top+f.height/2,b=x-ae+fe,R=m-se+ge,T="conn-subsec-".concat(a);de.push({lhsScrollY:b,rhsScrollY:R,x1:A,x2:L,containerTop:he,leftIdx:e,rhsArrayIdx:e,styleColor:(null==g?void 0:g.badgeBorder)||"#6366F1",styleId:T});var I=xe(x,ae,ve),B=xe(m,se,pe),w=I-he,E=B-he,F=m>=se-4&&m<=pe+4,_="";_=(O=x>=ae-4&&x<=ve+4)&&F?C(A,w,L,E):O&&!F?"M ".concat(A,",").concat(w," L ").concat(h,",").concat(w," L ").concat(h,",").concat(E):!O&&F?"M ".concat(h,",").concat(w," L ").concat(h,",").concat(E," L ").concat(L,",").concat(E):"M ".concat(h,",").concat(w," L ").concat(h,",").concat(E),le.push({id:T,pathD:_,style:g,leftIdx:e,rhsArrayIdx:e})}else if(ye){var k=e,M=Kn[k];if(!(null===(r=null==M?void 0:M.refIndexes)||void 0===r?void 0:r.length))return;M.refIndexes.forEach(function(e){var n,t,i=Vn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=tt.current[k])||void 0===n?void 0:n.current,r=null===(t=it.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect(),u=Wt(k),d=l.right-y.left,a=c.left-y.left-0,s=d+.5*(a-d),v=l.top+l.height/2,p=c.top+c.height/2,f=v-ae+fe,g=p-se+ge,h="conn-".concat(k,"-").concat(i);de.push({lhsScrollY:f,rhsScrollY:g,x1:d,x2:a,containerTop:he,leftIdx:k,rhsArrayIdx:i,styleColor:(null==u?void 0:u.badgeBorder)||"#6366F1",styleId:h});var x=xe(v,ae,ve),m=xe(p,se,pe),b=x-he,S=m-he,R=v>=ae-4&&v<=ve+4,T=p>=se-4&&p<=pe+4,I="";I=R&&T?C(d,b,a,S):R&&!T?"M ".concat(d,",").concat(b," L ").concat(s,",").concat(b," L ").concat(s,",").concat(S):!R&&T?"M ".concat(s,",").concat(b," L ").concat(s,",").concat(S," L ").concat(a,",").concat(S):"M ".concat(s,",").concat(b," L ").concat(s,",").concat(S),le.push({id:h,pathD:I,style:u,leftIdx:k,rhsArrayIdx:i})}}})}else{var D=e,H=D;s=null===(i=tt.current[D])||void 0===i?void 0:i.current,v=null===(o=it.current[H])||void 0===o?void 0:o.current;if(!s||!v)return;var A,L;p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),g=Wt(D),h=(A=p.right-y.left)+.5*((L=f.left-y.left-0)-A),x=p.top+p.height/2,m=f.top+f.height/2,b=x-ae+fe,R=m-se+ge,T="conn-".concat(D,"-").concat(H);de.push({lhsScrollY:b,rhsScrollY:R,x1:A,x2:L,containerTop:he,leftIdx:D,rhsArrayIdx:H,styleColor:(null==g?void 0:g.badgeBorder)||"#6366F1",styleId:T});var O;I=xe(x,ae,ve),B=xe(m,se,pe),w=I-he,E=B-he,F=m>=se-4&&m<=pe+4,_="";_=(O=x>=ae-4&&x<=ve+4)&&F?C(A,w,L,E):O&&!F?"M ".concat(A,",").concat(w," L ").concat(h,",").concat(w," L ").concat(h,",").concat(E):!O&&F?"M ".concat(h,",").concat(w," L ").concat(h,",").concat(E," L ").concat(L,",").concat(E):"M ".concat(h,",").concat(w," L ").concat(h,",").concat(E),le.push({id:T,pathD:_,style:g,leftIdx:D,rhsArrayIdx:H})}}),$e.current=de}Je(le)}else Je([]),$e.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{mn.current=!1}var me,be,Se}},[Xn,Kn,Vn,rn,Hn,zt,Wt,ye,ke,Ne,Ke,bt,St]),Vt=u(function(){var e,n,t,i,o,r,l,c,u,d,a,s,v,p,f=$e.current;if(f.length&&!Ge.current){var g=null!==(n=null===(e=xn.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,h=null!==(i=null===(t=vn.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,x=null!==(r=null===(o=xn.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(c=null===(l=vn.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,y=null!==(d=null===(u=xn.current)||void 0===u?void 0:u.getBoundingClientRect().top)&&void 0!==d?d:0,b=null!==(s=null===(a=vn.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==s?s:0,S=y+x,R=b+m,T=null!==(p=null===(v=Ft.current)||void 0===v?void 0:v.getBoundingClientRect().top)&&void 0!==p?p:0,I=function(e,n,t){return Math.max(n,Math.min(t,e))};f.forEach(function(e){var n=e.lhsScrollY-g+y,t=e.rhsScrollY-h+b,i=Ze.current[e.styleId+"-stroke"],o=Ze.current[e.styleId+"-bg"];if(i||o){var r,l=I(n,y,S),c=I(t,b,R),u=l-T,d=c-T,a=n>=y-4&&n<=S+4,s=t>=b-4&&t<=R+4,v=e.x1+.5*(e.x2-e.x1);r=a&&s?C(e.x1,u,e.x2,d):a&&!s?"M ".concat(e.x1,",").concat(u," L ").concat(v,",").concat(u," L ").concat(v,",").concat(d):!a&&s?"M ".concat(v,",").concat(u," L ").concat(v,",").concat(d," L ").concat(e.x2,",").concat(d):"M ".concat(v,",").concat(u," L ").concat(v,",").concat(d),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);c(function(){on.current=Kt},[Kt]);var Xt=r(null),qt=r(null),Jt=u(function(){$e.current.length>0&&!Ge.current||(null!==Xt.current&&clearTimeout(Xt.current),Xt.current=setTimeout(function(){on.current(),Xt.current=null},50))},[]),Ut=u(function(){Pe(!0),Ae(!1),null!==qt.current&&clearTimeout(qt.current),null!==Xt.current&&(clearTimeout(Xt.current),Xt.current=null),qt.current=setTimeout(function(){var e,n,t,i,o,r,l,c;if($e.current=[],nn.current&&null!==tn.current&&null!==kt.current){var u=tn.current,d=kt.current,a=null,s=null,v=null,p=null;if("string"==typeof u&&u.includes(S)){var f=u.split(S),g="".concat(f[0]).concat(S).concat(f[1]);a=(null===(e=tt.current[g])||void 0===e?void 0:e.current)||null,s=(null===(n=it.current[g])||void 0===n?void 0:n.current)||null,v=(null===(t=rt.current[f[2]])||void 0===t?void 0:t.current)||null,p=(null===(i=lt.current[f[3]])||void 0===i?void 0:i.current)||null}else a=(null===(o=ct.current[u])||void 0===o?void 0:o.current)||null,v=(null===(r=et.current[u])||void 0===r?void 0:r.current)||null,s=(null===(l=ot.current[d])||void 0===l?void 0:l.current)||null,p=(null===(c=nt.current[d])||void 0===c?void 0:c.current)||null;if(a&&s&&v&&p){if(v.style.paddingTop="0px",p.style.paddingTop="0px",!ye){var h=a.getBoundingClientRect(),x=s.getBoundingClientRect(),m=h.top-x.top;m>0?p.style.paddingTop="".concat(m,"px"):m<0&&(v.style.paddingTop="".concat(Math.abs(m),"px"))}var y=xn.current,b=vn.current;if(y&&b){var R=a.getBoundingClientRect().top-y.getBoundingClientRect().top+y.scrollTop,C=s.getBoundingClientRect().top-b.getBoundingClientRect().top+b.scrollTop-(R-y.scrollTop);Math.abs(b.scrollTop-C)>1&&(b.scrollTop=C)}}}on.current(),nn.current&&Ae(!0),Pe(!1),qt.current=null},150)},[ye,Kn,Vn]),Gt=u(function(e){var n,t,i,o,r,l,c,u,d,a;if(!We.current){if(ye||Jt(),nn.current){var s=tn.current,v=kt.current,p=xn.current,f=vn.current;if(null!==s&&null!==v&&p&&f){var g="string"==typeof s&&s.includes(S)?null===(n=tt.current["".concat(s.split(S)[0]).concat(S).concat(s.split(S)[1])])||void 0===n?void 0:n.current:null===(t=ct.current[s])||void 0===t?void 0:t.current,h="string"==typeof v&&v.includes(S)?null===(i=it.current["".concat(v.split(S)[0]).concat(S).concat(v.split(S)[1])])||void 0===i?void 0:i.current:null===(o=ot.current[v])||void 0===o?void 0:o.current;if(g&&h){var x=g.getBoundingClientRect().top-p.getBoundingClientRect().top+p.scrollTop,m=h.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;if(e.currentTarget===p){var y=m-(x-p.scrollTop),b=f.scrollHeight-f.clientHeight,R=Math.max(0,Math.min(y,b));Math.abs(f.scrollTop-R)>1&&(f.scrollTop=R)}else if(e.currentTarget===f){var C=x-(m-f.scrollTop),T=p.scrollHeight-p.clientHeight,I=Math.max(0,Math.min(C,T));Math.abs(p.scrollTop-I)>1&&(p.scrollTop=I)}if(Mt.current){var B=void 0,w=void 0;if("string"==typeof s&&s.includes(S)){var E=s.split(S),F="".concat(E[0]).concat(S).concat(E[1]);B=null===(r=tt.current[F])||void 0===r?void 0:r.current,w=null===(l=it.current[F])||void 0===l?void 0:l.current}else B=null===(c=tt.current[s])||void 0===c?void 0:c.current,w=null===(u=it.current[v])||void 0===u?void 0:u.current;var _=null!==(a=null===(d=Ft.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==a?a:0,k=p.getBoundingClientRect().top,M=k+p.clientHeight;f.getBoundingClientRect().top;f.clientHeight;if(B&&w){var D=B.getBoundingClientRect(),H=w.getBoundingClientRect(),A=D.top+D.height/2;H.top,H.height;var L=((P=A,j=k,N=M,Math.max(j,Math.min(N,P)))-_).toString();Mt.current.setAttribute("y1",L),Mt.current.setAttribute("y2",L);var O=A>=k-4&&A<=M+4;Mt.current.setAttribute("visibility",O?"visible":"hidden")}}}}}var P,j,N;$e.current.length>0&&!en.current&&(en.current=!0,requestAnimationFrame(function(){Vt(),en.current=!1}))}},[Vt,ye,Jt]);c(function(){var e=setTimeout(Jt,250);window.addEventListener("resize",Ut);var n=null,t=null;return an.current&&(n=new ResizeObserver(Jt)).observe(an.current),Ft.current&&(t=new ResizeObserver(Jt)).observe(Ft.current),function(){clearTimeout(e),null!==Xt.current&&clearTimeout(Xt.current),null!==qt.current&&clearTimeout(qt.current),window.removeEventListener("resize",Ut),null==n||n.disconnect(),null==t||t.disconnect()}},[Wn,Yn,st,Xn,bt,St,Kn,Vn,Hn,Jt,Ut,ke,Ne,He,Ke]),c(function(){nn.current=ke},[ke]),c(function(){tn.current=Ne},[Ne]);var Qt=u(function(e,n,t){var i,o,r,l,c,u,d=null===(i=null==t?void 0:t.toggleIfSame)||void 0===i||i,a=null==t?void 0:t.onReady,s=null!==(o=null==t?void 0:t.sourceSide)&&void 0!==o?o:"left";if(Dn(),null!=e)if(n)Fe("No counterpart exists for this section.");else if(ke&&Ne===e)d?mt():null==a||a();else{if(!ye){var v=tn.current,p=kt.current;if(null!==v)if("string"==typeof v&&v.includes(S)){var f=v.split(S);(g=null===(r=rt.current[f[2]])||void 0===r?void 0:r.current)&&(g.style.paddingTop="0px")}else{var g;(g=null===(l=et.current[v])||void 0===l?void 0:l.current)&&(g.style.paddingTop="0px")}if(null!==p)if("string"==typeof p&&p.includes(S)){f=p.split(S);(h=null===(c=lt.current[f[3]])||void 0===c?void 0:c.current)&&(h.style.paddingTop="0px")}else{var h;(h=null===(u=nt.current[p])||void 0===u?void 0:u.current)&&(h.style.paddingTop="0px")}}Ve(new Set),Je([]),$e.current=[],Be(!0),We.current=!0,ze(e),tn.current=e,Me(!0),nn.current=!0,Ae(!1),pn.current&&(pn.current.style.height="0px"),fn.current&&(fn.current.style.height="0px"),gn.current&&(gn.current.style.height="0px"),hn.current&&(hn.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i,o,r,l,c,u,d,v,p=null,f=null,g=null,h=null,x=null;if("string"==typeof e&&e.includes(S)){var m=e.split(S),y="".concat(m[0]).concat(S).concat(m[1]);p=(null===(n=tt.current[y])||void 0===n?void 0:n.current)||null,x=(f=(null===(t=it.current[y])||void 0===t?void 0:t.current)||null)?e:null,g=(null===(i=rt.current[m[2]])||void 0===i?void 0:i.current)||null,h=(null===(o=lt.current[m[3]])||void 0===o?void 0:o.current)||null}else if(p=(null===(r=ct.current[e])||void 0===r?void 0:r.current)||null,g=(null===(l=et.current[e])||void 0===l?void 0:l.current)||null,ye){var b=Kn[e],R=(null==b?void 0:b.refIndexes)||[];if(R.length>0){var C=R[0],I=Vn.findIndex(function(e){return e.selfIndex===C});-1!==I&&(f=(null===(d=ot.current[I])||void 0===d?void 0:d.current)||null,h=(null===(v=nt.current[I])||void 0===v?void 0:v.current)||null,x=I)}}else f=(null===(c=ot.current[e])||void 0===c?void 0:c.current)||null,h=(null===(u=nt.current[e])||void 0===u?void 0:u.current)||null,x=f?e:null;kt.current=x;var B=xn.current,w=vn.current;if(!p||!B)return We.current=!1,Be(!1),void(null==a||a());if(!f||!w)return Ae(!0),on.current(),We.current=!1,Be(!1),void(null==a||a());if(!ye){var E=p.getBoundingClientRect(),F=f.getBoundingClientRect(),_=E.top-F.top;g&&h&&(g.style.paddingTop="0px",h.style.paddingTop="0px",_>0?h.style.paddingTop="".concat(_,"px"):_<0&&(g.style.paddingTop="".concat(Math.abs(_),"px")));var k=0;k="right"===s?f?f.getBoundingClientRect().top:(null==h?void 0:h.getBoundingClientRect().top)||0:p?p.getBoundingClientRect().top:(null==g?void 0:g.getBoundingClientRect().top)||0;var M=an.current,D=M?M.scrollTop+k-150:0;return M?void T(M,D,200,function(){Ae(!0),on.current(),We.current=!1,Be(!1),null==a||a()}):(Ae(!0),on.current(),We.current=!1,Be(!1),void(null==a||a()))}var H=p.getBoundingClientRect().top-B.getBoundingClientRect().top+B.scrollTop,A=f.getBoundingClientRect().top-w.getBoundingClientRect().top+w.scrollTop,L=200;if("left"===s){var O=A-(H-B.scrollTop);O<0&&pn.current&&(pn.current.style.height="".concat(Math.abs(O),"px")),requestAnimationFrame(function(){var e,n=w.scrollHeight-w.clientHeight;if(O<0)e=0;else{if(O>n){var t=O-n;return fn.current&&(fn.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){T(w,O,L,function(){Ae(!0),on.current(),We.current=!1,Be(!1),null==a||a()})})}e=O}T(w,e,L,function(){Ae(!0),on.current(),We.current=!1,Be(!1),null==a||a()})})}else{var P=H-(A-w.scrollTop);P<0&&gn.current&&(gn.current.style.height="".concat(Math.abs(P),"px")),requestAnimationFrame(function(){var e,n=B.scrollHeight-B.clientHeight;if(P<0)e=0;else{if(P>n){var t=P-n;return hn.current&&(hn.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){T(B,P,L,function(){Ae(!0),on.current(),We.current=!1,Be(!1),null==a||a()})})}e=P}T(B,e,L,function(){Ae(!0),on.current(),We.current=!1,Be(!1),null==a||a()})})}})}},[Ne,Dn,Vn,ke,ye,Kn,mt]),Zt=u(function(e,n,t,i){var o,r="string"==typeof i?m(i).trim():m(null==i?void 0:i.deviation_summary).trim(),l=e.currentTarget;Mn();var c="left";(null===(o=vn.current)||void 0===o?void 0:o.contains(l))&&(c="right"),t?r&&En({open:!0,anchorEl:l,summary:i}):Qt(n,t,r?{toggleIfSame:!1,sourceSide:c,onReady:function(){En({open:!0,anchorEl:l,summary:i})}}:{toggleIfSame:!1,sourceSide:c})},[Qt,Mn,En]),$t=u(function(){var e,n=Rn.sectionIdx,t=Rn.isOrphan;if(Fn(),null!=n){var i="left";Rn.anchorEl&&(null===(e=vn.current)||void 0===e?void 0:e.contains(Rn.anchorEl))&&(i="right"),Qt(n,t,{sourceSide:i})}},[Qt,Rn.isOrphan,Rn.sectionIdx,Rn.anchorEl,Fn]),ei=u(function(){Fn(),mt()},[Fn,mt]),ni=null!==Rn.sectionIdx&&Ke.has(Rn.sectionIdx),ti=P({proposedSections:Kn,existingSections:Vn,parentDeviationRecord:qn,expandedSections:bt,maintainRelativeOrder:!!ye,scrollContainerRef:an,leftContainerRef:xn,lhsBadgeRefs:tt,rhsBadgeRefs:it}),ii=ti.showDeviationNavigation,oi=ti.showOpenNodeRef,ri=l(function(){if(!xe)return null;for(var e in qn){if((qn[e]||[]).some(function(e){return e.id===xe}))return e}return null},[xe,qn]),li=r(null);c(function(){if(xe&&li.current!==xe){var e=!1,t=0,i=null,o=150,r=function(e,n){for(var t=function(e,i){if(!e)return null;if(e.id===n)return i;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=t(e.subsections[o],"".concat(i,"-").concat(o));if(r)return r}return null},i=0;i<e.length;i++){var o=t(e[i],String(i));if(o)return o}return null},l=function(){var c,u,d,a;if(!e){var s=null,v=null;for(var p in qn){var f=qn[p].find(function(e){return e.id===xe});if(f){s=p,v=f;break}}if(v&&s){var g=Kn.findIndex(function(e){return e.id===s});if(!(ye?!!bt["left-".concat(g)]:!!bt[String(g)])&&g>=0)return Ct(g,"left"),t+=1,void(i=setTimeout(l,450));var h=r(Kn,v.id),x=r(Vn,v.id);if(h&&!x){var m=h.split("-"),y=Number(m[0]);if(ye){var b=null===(u=null===(c=Kn[y])||void 0===c?void 0:c.refIndexes)||void 0===u?void 0:u[0],R=Vn.findIndex(function(e){return e.selfIndex===b});-1!==R&&(y=R)}x=n([y],m.slice(1),!0).join("-")}if(h&&x){var C="".concat(v.id).concat(S,"0").concat(S).concat(h).concat(S).concat(x),I="".concat(v.id).concat(S,"0"),B=null===(d=tt.current[I])||void 0===d?void 0:d.current,w=null===(a=it.current[I])||void 0===a?void 0:a.current,E=ye?xn.current:an.current;if(B&&E){var F=B.getBoundingClientRect();if(0===F.height)return void((t+=1)<20&&(i=setTimeout(l,o)));var _=E.getBoundingClientRect(),k=F.top-_.top+E.scrollTop-_.height/2+F.height/2,M=function(){var e=window.getComputedStyle(B).color;B.style.transition="box-shadow 300ms ease-in-out",B.style.boxShadow="0 0 10px ".concat(e),w&&(w.style.transition="box-shadow 300ms ease-in-out",w.style.boxShadow="0 0 10px ".concat(e)),setTimeout(function(){B&&(B.style.boxShadow=""),w&&(w.style.boxShadow="")},2e3)},D=function(){var e,n,t,i=(null==v?void 0:v.evaluationResult)||(null===(e=null==he?void 0:he[null==v?void 0:v.id])||void 0===e?void 0:e.evaluation_result)||(null===(t=null===(n=null==ce?void 0:ce.nodes)||void 0===n?void 0:n[null==v?void 0:v.id])||void 0===t?void 0:t.evaluation_result)||null,o=(null==i?void 0:i.deviations)||{},r=Object.keys(o).sort()[0]||null,l=r?o[r]:null,c=(null==l?void 0:l.deviation_summary)||"";En({open:!0,anchorEl:B,summary:{deviation_summary:c,deviation_title:null==i?void 0:i.deviation_title,evaluation_outputs:null==i?void 0:i.evaluation_outputs}})};li.current=xe,ye?(E.scrollTo({top:k,behavior:"smooth"}),Qt(C,!1,{toggleIfSame:!1}),D(),setTimeout(function(){on.current()},0),M()):T(E,k,300,function(){e||(Qt(C,!1,{toggleIfSame:!1}),D(),setTimeout(function(){on.current()},0),M())})}else(t+=1)<20&&(i=setTimeout(l,o))}else(t+=1)<20&&(i=setTimeout(l,o))}else(t+=1)<20&&(i=setTimeout(l,o))}};return i=setTimeout(l,o),function(){e=!0,i&&clearTimeout(i)}}},[xe,qn,Kn,Vn,ye,bt,Ct,he,ce,En,Qt]);var ci=function(e){var n=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,c=void 0===l?"left":l,u=e.parentNodeId;return i(z,{section:n,keyPath:t,depth:r,columnKey:c,parentNodeId:void 0===u?"":u,expandedSubSections:St,setExpandedSubSections:Rt,maintainRelativeOrder:ye||!1,proposedSections:Kn,existingSections:Vn,treeData:ce,deviationNumberRegistry:Jn,connectedSections:Ke,activeSideBySideSection:Ne,resolvedMarkdownStyles:dn,getSubSectionRef:dt,getSubSectionCompareStyle:Yt,getBadgeRef:at,openMoreFunctionsPopup:Bt,openSummaryPopup:Zt,resetSideBySide:mt,setConnectedSections:Ve,setConnectedLines:Je,cachedConnectedPositions:$e})};return t(d,e({ref:sn,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},ye?{}:{overflow:"visible"}),{position:"relative"})},{children:[Re&&i(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:i(M,{})})),wn.open&&i(W,{open:wn.open,anchorEl:wn.anchorEl,containerEl:_t.current,clipTopEl:Dt.current,onClose:ei,summary:wn.summary}),i(k,{open:Rn.open,anchorEl:Rn.anchorEl,sectionTitle:Rn.sectionTitle,referenceSectionTitle:Rn.refSectionTitle,onClose:Dn,onOpenCognitiveCompare:wt,onOpenSideBySide:$t,onConnect:Et,isConnected:ni,isOrphan:Rn.isOrphan}),bn.open&&i(_,{open:bn.open,popupRef:kn,position:Tn,popupConfig:fe,onClose:function(){In(null),Sn(function(n){return e(e({},n),{open:!1})}),_n(null)},markdownStyles:se,sectionTitle:bn.sectionTitle,referenceSectionTitle:bn.refSectionTitle,cognitiveData:bn.cognitiveData,anchorEl:bn.anchorEl,sectionAnchorEl:bn.sectionAnchorEl,scrollContainerEl:an.current,badgeStyle:bn.badgeStyle,docData:bn.docData,deviationData:bn.deviationData,isLoading:bn.isLoading}),i(a,e({open:!!Ee,autoHideDuration:8e3,onClose:function(){return Fe(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(s,e({onClose:function(){return Fe(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ee}))})),i(j,{componentHeaderText:le,displayConfig:pe,maintainRelativeOrder:ye,onToggleView:function(e){Ce(!0),setTimeout(function(){be(!e),mt(),Ve(new Set),Je([]),$e.current=[],setTimeout(function(){Ce(!1)},400)},50)}}),i(d,e({ref:an,onScroll:Gt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:ye?"hidden":"auto",borderTop:vt&&pt?"none":"1.5px solid #EEF0F4"}},{children:i(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},ye?{flex:1,minHeight:0}:{})},{children:t(d,e({ref:Ft,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},ye?{flex:1,overflow:"visible"}:{})},{children:[t("svg",e({ref:Ue,style:{position:"absolute",top:0,left:0,width:cn.width||"100%",height:cn.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:Oe?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[jt&&i("g",{children:i("line",{x1:jt.x1,y1:jt.y,x2:jt.x2,y2:jt.y,stroke:xt.badgeBorder,strokeWidth:"1.5"})}),Lt.map(function(n){var o,r,l,c,u,a,s=n.x1+.5*(n.x2-n.x1),v=(n.y1+n.y2)/2;if("Not Defined"===n.style.label&&!n.hasCognitive)return null;if(n.isSubSection?ke&&Ne===n.subSectionKeyPath&&He:ke&&Ne===n.sectionIdx&&He)return t("g",e({style:{transition:"opacity 0.2s"}},{children:[i("defs",{children:i("marker",e({id:"arr-".concat(n.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:i("polygon",{points:"0 0, 7 2.5, 0 5",fill:n.style.badgeBorder||"#6366F1"})}))}),i("line",{ref:Mt,x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(n.id,")")})]}),n.id);if(!ye){var p=n.isSubSection?C(n.x1,n.y1,n.x2,n.y2):"M ".concat(n.x1," ").concat(n.y1," L ").concat(n.x2," ").concat(n.y2),g=Kn[n.sectionIdx]||{title:"",content:""},x=Vn[n.sectionIdx]||{title:"",content:""};if(console.log("Base and Ref Sections for Badge:",g,x),n.isSubSection&&n.subSectionKeyPath){var m=n.subSectionKeyPath.split(S)[2].split("-").map(Number),y=Kn[m[0]],b=Vn[m[0]],R=(null==y?void 0:y.title)||"",T=(null==b?void 0:b.title)||"";console.log("Root Parent Titles:",R,T);for(var I=1;I<m.length;I++)(null==y?void 0:y.subsections)&&(y=y.subsections[m[I]]),(null==b?void 0:b.subsections)&&(b=b.subsections[m[I]]);y&&(g=e(e({},y),{title:R||y.title})),console.log("Base Section for Subsection Badge:",g),b&&(x=e(e({},b),{title:T||b.title})),console.log("Ref Section for Subsection Badge:",x)}var B=!(null===(o=g.cognitiveData)||void 0===o?void 0:o.isMissingRationale)||Boolean(null===(l=null===(r=g.cognitiveData)||void 0===r?void 0:r.decisioning)||void 0===l?void 0:l.length),w=(null===(a=null===(u=null===(c=g.evaluationResult)||void 0===c?void 0:c.cognitive_decisioning)||void 0===u?void 0:u.decisioning_factors)||void 0===a?void 0:a.length)||!1,F=B||w;return t("g",{children:[i("path",{d:p,fill:"none",stroke:n.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i("foreignObject",e({x:s-100,y:v-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t(d,e({onClick:function(e){e.stopPropagation(),F&&(bn.open&&Bn===n.id?Mn():(_n(n.id),It(Tt(e.currentTarget,g,x,n.sectionIdx,n.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:n.style.badgeBg,color:n.style.badgeText,border:"1px solid ".concat(n.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:F?"pointer":"default"}},{children:[n.style.badgeText===E&&null==n.style.label?i(D,{color:n.style.badgeText}):0===n.style.label?"Same":n.style.label,i(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(h,{})})),F&&i(f,{size:11,style:{transform:bn.open&&Bn===n.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},n.id)}return null}),qe.map(function(n){var o,r=n.pathD,l=(null===(o=n.style)||void 0===o?void 0:o.badgeBorder)||"#6366F1",c="conn-marker-".concat(n.id),u="".concat(n.id,"-bg"),d="".concat(n.id,"-stroke");return t("g",{children:[i("defs",{children:i("clipPath",e({id:"connections-clip"},{children:i("marker",e({id:c,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:i("polygon",{points:"0 0, 8 3, 0 6",fill:l})}))}))}),i("path",{ref:function(e){Ze.current[u]=e},d:r,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),i("path",{ref:function(e){Ze.current[d]=e},d:r,fill:"none",stroke:l,strokeWidth:"1.75",markerEnd:"url(#".concat(c,")")})]},n.id)})]})),t(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},ye?{flex:1,overflow:"visible"}:{})},{children:[i(d,e({ref:Dt,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:jn,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:jn}))}))})),t(d,e({ref:xn,onScroll:Gt,sx:e({p:"12px",display:"flex",flexDirection:"column"},ye?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:gn,style:{width:"100%",height:"0px",flexShrink:0}}),Gn&&Kn.map(function(n,o){var r,l,c=!n.title&&!n.content;if(ye&&c)return null;var u=n,a=Wt(o,"left"),s=ye?!(null===(r=u.refIndexes)||void 0===r?void 0:r.length)||u.selfIndex<0:!Vn[o],v=ye?"number"==typeof u.selfIndex&&u.selfIndex>=0?u.selfIndex+1:null:o+1,p=Ke.has(o),f=y(u.evaluationResult,null==a?void 0:a.deviationLabel);return i(d,e({ref:ut(o),sx:{mb:1,width:"100%"}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[i(d,e({ref:et.current[o],sx:e({width:"100%",display:"flex"},p&&{borderRadius:"6px",outline:"2px solid ".concat((null==a?void 0:a.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:i(N,{section:n,idx:o,columnKey:"left",colRef:ut("left-accordion-".concat(o)),mb:0,treeData:ce,proposedSections:Kn,existingSections:Vn,deviationNumberRegistry:Jn,getSectionCompareStyle:Wt,getBadgeRef:at,connectedSections:Ke,openMoreFunctionsPopup:Bt,openSummaryPopup:Zt,deviationNodeIdToView:xe,deviationTargetParentId:ri,parentNodeId:(null===(l=null==ce?void 0:ce.input_index_map)||void 0===l?void 0:l[0])||"",isExpanded:ye?!!bt["left-".concat(o)]:!!bt[String(o)],onToggle:function(){bt[ye?"left-".concat(o):String(o)]&&Fn(),Ct(o,"left")},navigation:n.id?ii[n.id]:null,showOpenNodeRef:oi,resolvedMarkdownStyles:dn,maintainRelativeOrder:ye,renderSubSections:ci})})),ye&&a&&t(d,e({ref:tt.current[o],onClick:function(e){var t=ye?Vn.find(function(e){var n;return null===(n=u.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Vn[o]||{title:"",content:""};Bt(e,n,s,t,o,a)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:a.badgeBg,color:a.badgeText,border:"1px solid ".concat(a.badgeBorder),borderRadius:"12px",px:1.2,py:.4,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[null!==v&&i(d,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(a.badgeBorder)}},{children:v})),i(d,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:!pe.isLoading||null!=u.evaluationResult&&null!=u.evaluationResult?s?"No Deviation Found":"N/A"===f||"NA"===f?"N/A":0==f||null==f?"Same":"".concat(f):i(D,{color:a.badgeText})})),i(g,{size:11,color:a.badgeText})]}))]}))}),"left-row-".concat(o))}),i("div",{ref:hn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(d,e({ref:_t,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:i(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(d,e({onClick:function(n){n.stopPropagation(),bn.open&&Bn===ft?Mn():(_n(ft),It(Tt(n.currentTarget,{title:"",content:"",evaluationResult:gt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,ft,!0,e(e({},xt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-5px",borderRadius:"20px",bgcolor:xt.badgeBg,color:xt.badgeText,border:"1px solid ".concat(xt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=ht?ht:i(D,{}),i(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(h,{})})),i(f,{size:11,style:{transform:bn.open&&Bn===ft?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),t(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},ye?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Ie&&i(x,{sections:11}),i(d,e({ref:Ht,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:Nn,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Nn}))}))})),t(d,e({ref:vn,onScroll:Gt,sx:e({p:"12px",display:"flex",flexDirection:"column"},ye?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-120px",pl:"140px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:pn,style:{width:"100%",height:"0px",flexShrink:0}}),Gn&&Vn.map(function(n,o){var r,l=n,c=[],u=!1,a=null,s=-1;if(ye){c=Kn.filter(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1}),s=Kn.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0});var v=Kn.findIndex(function(e,n){var t;return Ke.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(u=-1!==v)&&(a=Wt(v))}else c=[o+1],(u=Ke.has(o))&&(a=Wt(o));var p=Wt(ye&&-1!==s?s:o);return i(d,e({ref:ot.current[o],sx:{mb:1,width:"100%"}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[i(d,e({ref:nt.current[o],sx:e({width:"100%",display:"flex"},u&&a&&{borderRadius:"6px",outline:"2px solid ".concat(a.badgeBorder),outlineOffset:"1px"})},{children:i(N,{section:n,idx:o,columnKey:"right",colRef:ut("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==ce?void 0:ce.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:ye?!!bt["right-".concat(o)]:!!bt[String(o)],treeData:ce,proposedSections:Kn,existingSections:Vn,deviationNumberRegistry:Jn,getBadgeRef:at,getSectionCompareStyle:Wt,connectedSections:Ke,openMoreFunctionsPopup:Bt,openSummaryPopup:Zt,deviationNodeIdToView:xe,deviationTargetParentId:ri,onToggle:function(){bt[ye?"right-".concat(o):String(o)]&&Fn(),Ct(o,"right")},navigation:n.id?ii[n.id]:null,showOpenNodeRef:oi,resolvedMarkdownStyles:dn,maintainRelativeOrder:ye,renderSubSections:ci})})),ye&&!Ie&&p&&i(d,e({ref:it.current[o],"data-section-id":l.id,sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:p.badgeBg,color:p.badgeText,border:"1px solid ".concat(p.badgeBorder),borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:c.length>0?c.join(", "):"-"}))]}))}),"right-row-".concat(o))}),i("div",{ref:fn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{Y as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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)},t=function(n){return null!=n&&("string"==typeof n?n.trim().length>0:!Array.isArray(n)||n.length>0&&n.some(function(n){return t(n)}))},r=function(t,r,e){var i,o=e[r],a=null===(i=null==t?void 0:t.comparison_inputs)||void 0===i?void 0:i[o];return{title:n((null==a?void 0:a.title)||""),content:n((null==a?void 0:a.content)||""),attributes:(null==a?void 0:a.additional_attributes)||null,subsections:(null==a?void 0:a.subsections)||[]}},e=function(n){if(!n.mapping_rationale)return{cognitiveData:{decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0,citations:[]},score:0,relation:"N/A"};var t=n.mapping_rationale,r=parseInt(t.decision_strength||"0");return{cognitiveData:{decisioning:t.decisioning_factors||[],gap:t.gaps_in_decision||[],relevance_score:r,citations:t.citations},score:0,relation:"N/A"}};function i(n){var t=function(n,t){var r=function(n){var t=function(n){return 4===n.length?"#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]:n}(n).replace("#",""),r=parseInt(t,16);return{r:r>>16&255,g:r>>8&255,b:255&r}}(n),e=r.r,i=r.g,o=r.b;return function(n,t,r){return"#"+[n,t,r].map(function(n){return n.toString(16).padStart(2,"0")}).join("").toUpperCase()}(Math.round(e+(255-e)*t),Math.round(i+(255-i)*t),Math.round(o+(255-o)*t))};return{bg:t(n,.8),border:t(n,.5),badgeBg:t(n,.8),badgeBorder:t(n,.5),badgeText:n.toUpperCase(),highlightBg:t(n,.8)}}function o(n,t){var r;return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var o=this;clearTimeout(r),r=setTimeout(function(){return n.apply(o,e)},t)}}var a=function(n,t){
|
|
1
|
+
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)},t=function(n){return null!=n&&("string"==typeof n?n.trim().length>0:!Array.isArray(n)||n.length>0&&n.some(function(n){return t(n)}))},r=function(t,r,e){var i,o=e[r],a=null===(i=null==t?void 0:t.comparison_inputs)||void 0===i?void 0:i[o];return{title:n((null==a?void 0:a.title)||""),content:n((null==a?void 0:a.content)||""),attributes:(null==a?void 0:a.additional_attributes)||null,subsections:(null==a?void 0:a.subsections)||[]}},e=function(n){if(!n.mapping_rationale)return{cognitiveData:{decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0,citations:[]},score:0,relation:"N/A"};var t=n.mapping_rationale,r=parseInt(t.decision_strength||"0");return{cognitiveData:{decisioning:t.decisioning_factors||[],gap:t.gaps_in_decision||[],relevance_score:r,citations:t.citations},score:0,relation:"N/A"}};function i(n){var t=function(n,t){var r=function(n){var t=function(n){return 4===n.length?"#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]:n}(n).replace("#",""),r=parseInt(t,16);return{r:r>>16&255,g:r>>8&255,b:255&r}}(n),e=r.r,i=r.g,o=r.b;return function(n,t,r){return"#"+[n,t,r].map(function(n){return n.toString(16).padStart(2,"0")}).join("").toUpperCase()}(Math.round(e+(255-e)*t),Math.round(i+(255-i)*t),Math.round(o+(255-o)*t))};return{bg:t(n,.8),border:t(n,.5),badgeBg:t(n,.8),badgeBorder:t(n,.5),badgeText:n.toUpperCase(),highlightBg:t(n,.8)}}function o(n,t){var r;return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var o=this;clearTimeout(r),r=setTimeout(function(){return n.apply(o,e)},t)}}var a=function(n,t){if(n.content!==t.content)return!1;if(n.sxStyles!==t.sxStyles)return!1;if(n.maintainRelativeOrder!==t.maintainRelativeOrder)return!1;var r=n.highlights||[],e=t.highlights||[];if(r.length!==e.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==e[i])return!1;var o=n.deviationBadges||[],a=t.deviationBadges||[];if(o.length!==a.length)return!1;for(i=0;i<o.length;i++){if(o[i].id!==a[i].id)return!1;if(o[i].label!==a[i].label)return!1;if(o[i].isConnected!==a[i].isConnected)return!1}return!0},u="::",l=function(n){if(!n)return!0;var t=n.trim().toLowerCase();return t.includes("no equivalent")||"n/a"===t||"na"===t||"none"===t},c=function(n,t){var r,e,i,o,a,u,l;if(!n)return t;var c=null!==(u=null!==(o=null!==(e=null===(r=n.evaluation_output)||void 0===r?void 0:r.output_score)&&void 0!==e?e:null===(i=n.evaluation_outputs)||void 0===i?void 0:i.output_score)&&void 0!==o?o:null===(a=n.evaluation_outputs)||void 0===a?void 0:a.output_value)&&void 0!==u?u:n.output_score;return null!==(l=null!=c?c:t)&&void 0!==l?l:""},s=function(n,t,r,e,i){void 0===i&&(i=14);var o=n+.5*(r-n),a=e-t;if(Math.abs(a)<3)return"M ".concat(n," ").concat(t," H ").concat(r);var u=a>0?1:-1,l=Math.min(i,Math.abs(a)/2,Math.abs(o-n)/2,Math.abs(r-o)/2);return["M ".concat(n," ").concat(t),"H ".concat(o-l),"Q ".concat(o," ").concat(t," ").concat(o," ").concat(t+u*l),"V ".concat(e-u*l),"Q ".concat(o," ").concat(e," ").concat(o+l," ").concat(e),"H ".concat(r)].join(" ")},v=function(n,t,r,e,i){void 0===r&&(r=300);var o=n.style.scrollBehavior;n.style.scrollBehavior="auto";var a=n.scrollTop,u=t-a,l=null,c=function(s){null===l&&(l=s);var v,g=s-l;g<r?(n.scrollTop=(v=g,v/=r,u*(--v*v*v+1)+a),i&&i(),requestAnimationFrame(c)):(n.scrollTop=t,n.style.scrollBehavior=o,i&&i(),e&&e())};requestAnimationFrame(c)},g=function(n){var t=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return t=(t=(t=(t=t.replace(/['’‘`]/g,"['’‘`]")).replace(/["”“]/g,'["”“]')).replace(/[-—–]/g,"[-—–]")).replace(/\s+/g,"\\s+")};export{u as DEVIATION_BADGE_SEPARATOR,a as areMarkdownPropsEqual,o as debounce,g as escapeRegExp,c as extractDeviationScore,i as generateColorPalette,s as getBentArrowPath,e as getRationale,r as getSideData,t as hasValue,l as isMissingStr,n as safeStringify,v as smoothScrollTo};
|
|
2
2
|
//# sourceMappingURL=CognitiveComparehelpers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{Popper as o,Paper as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{Popper as o,Paper as i,Box as l,Typography as r,IconButton as a}from"@mui/material";import{Info as d,X as c}from"lucide-react";import{useRef as u,useState as s,useEffect as m}from"react";function p(p){var f,g,h,v=p.open,x=p.anchorEl,b=p.containerEl,w=p.clipTopEl,y=p.onClose,C=p.summary;p.markdownStyles,p.isLoading;var B=u(null),R=s(null),z=R[0],E=R[1],S=s(null),L=S[0],W=S[1],_="string"==typeof C?{deviation_summary:C}:null!=C?C:{};_.deviation_title;var F=_.deviation_summary,k=_.evaluation_outputs,A=(null===(f=null==k?void 0:k.metadata)||void 0===f?void 0:f.label_color)||"#6366F1",I=null!==(g=null==b?void 0:b.getBoundingClientRect().width)&&void 0!==g?g:180,T=Math.max(148,I+70),j=x&&b?{top:x.getBoundingClientRect().top,bottom:x.getBoundingClientRect().bottom,left:b.getBoundingClientRect().left+b.getBoundingClientRect().width/2}:null;m(function(){if(!v||!x||!b)return E(null),void W(null);var t=function(){null!==B.current&&cancelAnimationFrame(B.current),B.current=requestAnimationFrame(function(){var t,e=x.getBoundingClientRect(),n=b.getBoundingClientRect(),o=null==w?void 0:w.getBoundingClientRect();E({top:e.top,bottom:e.bottom,left:n.left+n.width/2}),W(null!==(t=null==o?void 0:o.bottom)&&void 0!==t?t:null)})};t();var e=!0;return window.addEventListener("scroll",t,{passive:!0,capture:e}),window.addEventListener("resize",t),function(){null!==B.current&&cancelAnimationFrame(B.current),window.removeEventListener("scroll",t,e),window.removeEventListener("resize",t)}},[v,x,b,w]);var H=null!==(h=null!=z?z:j)&&void 0!==h?h:{top:0,bottom:0,left:0},M=H.bottom+20,N=null!=L?Math.max(0,L-M):0;return C?e(o,t({open:v,disablePortal:!0,popperOptions:{strategy:"fixed"},anchorEl:{getBoundingClientRect:function(){return{width:0,height:0,top:H.top,bottom:H.top,left:H.left,right:H.left,x:H.left,y:H.top,toJSON:function(){}}}},placement:"bottom",modifiers:[{name:"offset",options:{offset:[0,20]}}],sx:{zIndex:10}},{children:n(i,t({sx:t(t({p:1.5,borderRadius:"12px",width:T,maxWidth:T},N>0&&{clipPath:"inset(".concat(N,"px 0 0 0 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(A,"26"),borderTop:"3px solid ".concat(A),overflow:"hidden",bgcolor:"#fff"})},{children:[n(l,t({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.75}},{children:[n(l,t({sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0}},{children:[e(d,{size:14,color:A}),e(r,t({sx:{fontSize:"11px",fontWeight:700,color:A,textTransform:"uppercase",letterSpacing:"0.4px",lineHeight:1.2}},{children:"Summary"}))]})),e(a,t({size:"small",onClick:y,sx:{p:.25,ml:.5,color:"#64748B"}},{children:e(c,{size:14})}))]})),e(r,t({sx:{fontSize:"12px",color:"#475569",lineHeight:1.5,fontWeight:400,overflowWrap:"anywhere"}},{children:F||"No summary available."}))]}))})):null}export{p as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveSummaryPopup.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t,{useEffect as i}from"react";import{Box as l,Accordion as r,AccordionSummary as d,Tooltip as a,Typography as u,AccordionDetails as c}from"@mui/material";import{ChevronUp as s,ChevronDown as v}from"lucide-react";import{MemoizedMarkdown as f}from"../hooks/memoizedMarkdown.js";import{hasValue as p,generateColorPalette as h,isMissingStr as m,safeStringify as g,escapeRegExp as x,DEVIATION_BADGE_SEPARATOR as b}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as y}from"../CognitiveCompareConstants.js";var w=function(w){var I,F,B,S,k,R,_,C,A,T,E,M,W,O,D,N,j=w.section,P=w.idx,z=w.columnKey,K=w.colRef,V=w.mb,G=void 0===V?1:V,X=w.parentNodeId,Y=void 0===X?"":X,H=w.isExpanded,$=w.onToggle,q=w.navigation,J=w.showOpenNodeRef,L=w.resolvedMarkdownStyles,Q=w.maintainRelativeOrder,U=w.renderSubSections,Z=w.treeData,ee=w.proposedSections,ne=void 0===ee?[]:ee,oe=w.existingSections,te=void 0===oe?[]:oe,ie=w.deviationNumberRegistry,le=void 0===ie?{}:ie,re=w.getBadgeRef,de=w.openSummaryPopup,ae=w.getSectionCompareStyle,ue=w.connectedSections,ce=w.openMoreFunctionsPopup,se=w.deviationNodeIdToView,ve=w.deviationTargetParentId,fe=(null===(I=j.displayTitle)||void 0===I||I)&&p(j.title),pe=(null===(F=j.displayContent)||void 0===F||F)&&p(j.content),he=!fe&&!pe,me={current:1},ge=j.title;fe||(ge=pe?"No Title Found":"No Matching Section Found");var xe=j.evaluationResult;if(!xe&&"right"===z)if(Q){var be=null===(B=j.refIndexes)||void 0===B?void 0:B[0],ye=ne.find(function(e){return e.selfIndex===be});xe=null==ye?void 0:ye.evaluationResult}else xe=null===(S=ne[P])||void 0===S?void 0:S.evaluationResult;var we=null===(k=null==Z?void 0:Z.input_index_map)||void 0===k?void 0:k[0],Ie=null===(R=null==Z?void 0:Z.input_index_map)||void 0===R?void 0:R[1],Fe="left"===z?Ie:we,Be="left"===z?j:ne[P],Se="right"===z?j:te[P];if(Q)if("left"===z){var ke=null===(_=j.refIndexes)||void 0===_?void 0:_[0],Re=te.findIndex(function(e){return e.selfIndex===ke});Se=-1!==Re?te[Re]:void 0}else{var _e=null===(C=j.refIndexes)||void 0===C?void 0:C[0],Ce=ne.findIndex(function(e){return e.selfIndex===_e});Be=-1!==Ce?ne[Ce]:void 0}var Ae="left"===z?!Se:!Be,Te=xe||(null==Be?void 0:Be.evaluationResult)||(null==Se?void 0:Se.evaluationResult),Ee=null!==(E=null===(T=null===(A=null==Te?void 0:Te.evaluation_outputs)||void 0===A?void 0:A.metadata)||void 0===T?void 0:T.label_color)&&void 0!==E?E:y,Me=h(Ee),We=Me.highlightBg,Oe=null!==(W=null===(M=null==Te?void 0:Te.evaluation_outputs)||void 0===M?void 0:M.output_value)&&void 0!==W?W:null,De=(null==Te?void 0:Te.deviations)||{},Ne=P+1,je=j.id;if("right"===z&&Q){var Pe=null===(O=j.refIndexes)||void 0===O?void 0:O[0];-1!==(Ce=ne.findIndex(function(e){return e.selfIndex===Pe}))&&(Ne=Ce+1,je=ne[Ce].id)}var ze,Ke=[],Ve=Object.entries(De).map(function(n){var o,t,i,l=n[0],r=n[1],d="".concat(je).concat(b).concat(l),a=le[d];if(!a)return null;var u=r[Y],c=m(u);if(c)u="";else if(!u)return null;Ke.push(u);var s=r[Fe],v="left"===z?null===(o=ne[P])||void 0===o?void 0:o.content:null===(t=te[P])||void 0===t?void 0:t.content,f=g(v),p=Object.keys(De).map(function(e){return{key:e,text:De[e][Fe]}}).filter(function(e){return!m(e.text)}).sort(function(e,n){return n.text.length-e.text.length}),h=new Set;p.forEach(function(e){var n=e.text.replace(/\\(['’])/g,"$1").replace(/\\n/g,"\n");if(n){var o=new RegExp(x(n));o.test(f)&&(h.add(e.key),f=f.replace(o,"__TOKEN_".concat(e.key,"__")))}});var y=!m(s)&&!h.has(l),w=Ae||m(s)||y,I="".concat(Ne,".").concat(a),F="".concat(je).concat(b).concat(l).concat(b).concat(P).concat(b).concat(P),B=P;if("right"===z&&Q){var S=null===(i=j.refIndexes)||void 0===i?void 0:i[0],k=ne.findIndex(function(e){return e.selfIndex===S});-1!==k&&(B=k)}var R=ae?ae(B):null,_=!1;u&&(_=Object.values(De).map(function(e){return e[Y]}).filter(Boolean).some(function(e){return e.length>u.length&&e.includes(u)}));var C=R?e(e({},R),{badgeBg:Me.badgeBg,badgeBorder:Me.badgeBorder,badgeText:Me.badgeText}):e({},Me);_&&(C.badgeBg="#FFFBEB",C.badgeBorder="#FCD34D",C.badgeText="#B45309",C.highlightBg="#FDE68A");var A=(null==r?void 0:r.deviation_summary)?{deviation_summary:r.deviation_summary,deviation_title:null==Te?void 0:Te.deviation_title,evaluation_outputs:null==Te?void 0:Te.evaluation_outputs}:null;return{id:d,actionId:F,label:I,highlight:u,side:z,style:C,score:Oe,isConnected:null==ue?void 0:ue.has(F),isOrphan:w,isMissingClause:c,badgeRef:re(z,d),onClick:function(e){e.stopPropagation(),ce&&ce(e,Be||{id:"orphan-left",title:"",content:""},w,Se||{id:"orphan-right",title:"",content:""},F,C)},onSummaryClick:function(e){e.stopPropagation(),de(e,F,w,A)}}}).filter(Boolean),Ge=j.id&&z===(null==q?void 0:q.columnKey)?q:null,Xe=t.useRef(!1);return i(function(){H||(Xe.current=!1)},[H]),i(function(){var e=!!se&&!!ve&&je===ve,n=!!se&&(j.subsections||[]).some(function(e){return e.id===se});if(H&&!Xe.current&&!e&&!n){var o=setTimeout(function(){var e,n;Xe.current=!0,null===(n=null===(e=null==Ge?void 0:Ge.showBelowRef)||void 0===e?void 0:e.current)||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},600);return function(){return clearTimeout(o)}}},[H,se,ve,je,null==Ge?void 0:Ge.showBelow]),n(l,e({ref:K,sx:{mb:G,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:[H&&(null==Ge?void 0:Ge.showAbove)&&o("div",e({style:{position:"sticky",top:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==Ge?void 0:Ge.showAboveRef)||void 0===e?void 0:e.current)||void 0===n?void 0:n.scrollIntoView({behavior:"smooth",block:"center"})}},{children:o("div",e({style:e({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===z?"+":"-"," 130px))"),position:"absolute",paddingTop:"20px"},"left"===z?{right:"0px"}:{left:"0px"})},{children:o(s,{color:window.getComputedStyle(null===(D=null==Ge?void 0:Ge.showAboveRef)||void 0===D?void 0:D.current).color})}))})),n(r,e({disableGutters:!0,expanded:!he&&H,onChange:function(){he||($(),J.current=j.id)},sx:{boxShadow:"none",border:he?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:he?"#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:[o(d,e({expandIcon:he?null:o(v,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:he?"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:fe&&o(a,e({title:ge,placement:"top"},{children:o(u,e({component:"div",sx:{fontSize:"12px",color:he?"#94A3B8":"#19213D",fontWeight:he?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:(ze=ge,ze?g(ze).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,n){return e.startsWith("**")&&e.endsWith("**")?o("strong",{children:e.slice(2,-2)},n):o(t.Fragment,{children:e},n)}):null)}))}))})),!he&&n(c,e({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[pe&&o(f,{content:j.content,sxStyles:L,highlights:Ke,maintainRelativeOrder:Q,highlightBg:We,deviationBadges:Ve}),(j.subsections||[]).map(function(e,n){return U({section:e,keyPath:"".concat(P,"-").concat(n),depth:0,columnKey:z,parentNodeId:Y,devCounter:me})})]}))]})),H&&(null==Ge?void 0:Ge.showBelow)&&o("div",e({style:{position:"sticky",bottom:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==Ge?void 0:Ge.showBelowRef)||void 0===e?void 0:e.current)||void 0===n?void 0:n.scrollIntoView({behavior:"smooth",block:"center"})}},{children:o("div",e({style:e({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===z?"+":"-"," 130px))"),position:"absolute",paddingBottom:"20px"},"left"===z?{right:"0px"}:{left:"0px"})},{children:o(v,{color:window.getComputedStyle(null===(N=null==Ge?void 0:Ge.showBelowRef)||void 0===N?void 0:N.current).color})}))}))]}),"".concat(z,"-sec-").concat(P))};export{w as default};
|
|
2
2
|
//# sourceMappingURL=SectionAccordion.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__spreadArray as t,__assign as i}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import o from"react";import{Box as l,Accordion as d,AccordionSummary as a,Typography as r,AccordionDetails as u}from"@mui/material";import{ChevronDown as s}from"lucide-react";import{MemoizedMarkdown as c}from"../hooks/memoizedMarkdown.js";import{hasValue as v,generateColorPalette as p,isMissingStr as h,DEVIATION_BADGE_SEPARATOR as m}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as f}from"../CognitiveCompareConstants.js";var g=o.memo(function(o){var x,b,S,y,B,F,C,_,R,w,I,j=o.section,O=o.keyPath,k=o.depth,E=void 0===k?0:k,P=o.columnKey,W=void 0===P?"left":P,M=o.parentNodeId,D=void 0===M?"":M,N=o.expandedSubSections,z=o.setExpandedSubSections,A=o.maintainRelativeOrder,T=o.proposedSections,G=o.existingSections,H=o.treeData,K=o.deviationNumberRegistry,L=o.connectedSections,U=o.activeSideBySideSection,q=o.resolvedMarkdownStyles,J=o.getSubSectionRef,Q=o.getSubSectionCompareStyle,V=o.getBadgeRef,X=o.openMoreFunctionsPopup,Y=o.openSummaryPopup,Z=o.resetSideBySide,$=o.setConnectedSections,tt=o.setConnectedLines,it=o.cachedConnectedPositions,et=(null===(x=j.displayTitle)||void 0===x||x)&&v(j.title),nt=(null===(b=j.displayContent)||void 0===b||b)&&v(j.content),ot=!et&&!nt,lt=et?j.title:nt?"No Title Found":"No Matching Section Found",dt=!!N[O],at=J(W,O),rt=O.split("-").map(Number),ut=rt[0],st=T[ut],ct=G[ut],vt=O,pt=O;if(A)if("left"===W){var ht=null===(S=null==st?void 0:st.refIndexes)||void 0===S?void 0:S[0],mt=G.findIndex(function(t){return t.selfIndex===ht});-1!==mt&&(ct=G[mt],pt=t([mt],rt.slice(1),!0).join("-"))}else{var ft=null===(y=null==ct?void 0:ct.refIndexes)||void 0===y?void 0:y[0];-1!==(St=T.findIndex(function(t){return t.selfIndex===ft}))&&(st=T[St],vt=t([St],rt.slice(1),!0).join("-"))}for(var gt=st,xt=ct,bt=1;bt<rt.length;bt++)(null==gt?void 0:gt.subsections)&&(gt=gt.subsections[rt[bt]]),(null==xt?void 0:xt.subsections)&&(xt=xt.subsections[rt[bt]]);var St,yt=Q(vt)||Q(O),Bt=null===(B=null==H?void 0:H.input_index_map)||void 0===B?void 0:B[0],Ft=null===(F=null==H?void 0:H.input_index_map)||void 0===F?void 0:F[1],Ct="left"===W?Ft:Bt,_t="left"===W?!xt:!gt,Rt=j.evaluationResult||(null==gt?void 0:gt.evaluationResult)||(null==xt?void 0:xt.evaluationResult),wt=null!==(_=null===(C=null==Rt?void 0:Rt.evaluation_outputs)||void 0===C?void 0:C.output_value)&&void 0!==_?_:null,It=ut+1,jt=j.id;"right"===W&&A&&((null==gt?void 0:gt.id)&&(jt=gt.id),st&&-1!==(St=T.findIndex(function(t){return t.id===st.id}))&&(It=St+1));var Ot=null!==(I=null===(w=null===(R=null==Rt?void 0:Rt.evaluation_outputs)||void 0===R?void 0:R.metadata)||void 0===w?void 0:w.label_color)&&void 0!==I?I:f,kt=p(Ot),Et=kt.highlightBg,Pt=(null==Rt?void 0:Rt.deviations)||{},Wt=[],Mt=Object.entries(Pt).map(function(t){var e,n,o,l=t[0],d=t[1],a="".concat(jt).concat(m).concat(l),r=K[a];if(!r)return null;var u=d[D],s=h(u);if(s)u="";else if(!u)return null;Wt.push(u);var c=d[Ct],v=!1;c&&(v=Object.values(Pt).map(function(t){return t[Ct]}).filter(Boolean).some(function(t){return t.length>c.length&&t.includes(c)}));var p=_t||h(c)||v,f="".concat(It,".").concat(r),g="".concat(jt).concat(m).concat(l).concat(m).concat(vt).concat(m).concat(pt),x=i({},kt),b=!1;u&&(b=Object.values(Pt).map(function(t){return t[D]}).filter(Boolean).some(function(t){return t.length>u.length&&t.includes(u)}));b&&(x.badgeBg="#FFFBEB",x.badgeBorder="#FCD34D",x.badgeText="#B45309",x.highlightBg="#FDE68A");var S=(null==d?void 0:d.deviation_summary)?{deviation_summary:d.deviation_summary||(null===(e=j.evaluationResult)||void 0===e?void 0:e.deviation_summary),deviation_title:null===(n=j.evaluationResult)||void 0===n?void 0:n.deviation_title,evaluation_outputs:null===(o=j.evaluationResult)||void 0===o?void 0:o.evaluation_outputs}:null;return{id:a,actionId:g,label:f,highlight:u,side:W,style:x,score:wt,isConnected:L.has(g),isOrphan:p,isMissingClause:s,badgeRef:V(W,a),onClick:function(t){t.stopPropagation();var e=gt?i(i({},gt),{title:(null==st?void 0:st.title)||(null==gt?void 0:gt.title)||""}):{id:"orphan-left",title:"",content:""},n=xt?i(i({},xt),{title:(null==ct?void 0:ct.title)||(null==xt?void 0:xt.title)||""}):{id:"orphan-right",title:"",content:""};X(t,e,p,n,g,x)},onSummaryClick:function(t){t.stopPropagation(),Y(t,g,p,S)}}}).filter(Boolean),Dt=Mt.some(function(t){return L.has(t.actionId)});if(!(et||nt||j.subsections&&0!==j.subsections.length))return null;var Nt=!A&&et&&nt,zt=Dt&&yt?{borderRadius:"4px",outline:"2px solid ".concat(yt.badgeBorder),outlineOffset:"1px"}:{};return e(l,et?i({ref:at,sx:{mt:1,width:"100%",minWidth:0,position:"relative"}},{children:e(l,i({sx:i({width:"100%"},zt)},{children:n(d,i({disableGutters:!0,expanded:!ot&&dt,onChange:function(){if(!ot){if(dt){var t=String(U||""),e=t.includes(vt)||t.includes(pt);e||L.forEach(function(t){(String(t).includes(vt)||String(t).includes(pt))&&(e=!0)}),e&&(Z(),$(new Set),tt([]),it.current=[])}z(function(t){var e;return i(i({},t),((e={})[O]=!t[O],e))})}},sx:{mt:0,boxShadow:"none",border:ot?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF",minWidth:0,"&:before":{display:"none"}}},{children:[e(a,i({expandIcon:ot?null:e(s,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"}}},{children:e(r,i({component:"div",sx:{fontSize:"11px",fontWeight:600,color:ot?"#94A3B8":"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:lt||"Untitled Subsection"}))})),!ot&&n(u,i({sx:{pt:0,pb:1,minWidth:0}},{children:[nt&&e(c,{content:j.content,sxStyles:q,deviationBadges:Nt?[]:Mt,maintainRelativeOrder:A,highlightBg:Et,highlights:Wt}),(j.subsections||[]).map(function(t,n){return e(g,i({},o,{section:t,keyPath:"".concat(O,"-").concat(n),depth:E+1}),"".concat(O,"-").concat(n))})]}))]}))}))}):i({ref:at,sx:{mt:0===E?1:.75,width:"100%",minWidth:0,position:"relative"}},{children:!ot&&n(l,i({sx:i({width:"100%"},zt)},{children:[nt&&e(c,{content:j.content,sxStyles:q,deviationBadges:Mt,maintainRelativeOrder:A,highlightBg:Et,highlights:Wt}),(j.subsections||[]).map(function(t,n){return e(g,i({},o,{section:t,keyPath:"".concat(O,"-").concat(n),depth:E+1}),"".concat(O,"-").concat(n))})]}))}))});export{g as default};
|
|
2
2
|
//# sourceMappingURL=SubSectionAccordion.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__rest as
|
|
1
|
+
import{__assign as e,__rest as r,__spreadArray as n}from"tslib";import{jsx as o,jsxs as i}from"react/jsx-runtime";import{Box as t,Typography as a}from"@mui/material";import l,{useMemo as c}from"react";import{DEFAULT_DEVIAION_COLOR as s}from"../CognitiveCompareConstants.js";import{EllipsisVertical as p}from"lucide-react";import d from"react-markdown";import{safeStringify as f,areMarkdownPropsEqual as g}from"../CognitiveComparehelpers.js";import h from"rehype-raw";var u=l.memo(function(l){var g=l.content,u=l.sxStyles,m=l.deviationBadges,v=void 0===m?[]:m,x=l.highlights,b=void 0===x?[]:x,y=l.maintainRelativeOrder,_=void 0===y||y,C=l.highlightBg,w=c(function(){return v.reduce(function(r,n){var o;return e(e({},r),((o={})[n.id]=n,o))},{})},[v]),E=c(function(){return{mark:function(r){var n=r.children;return o("span",e({style:{backgroundColor:C,borderRadius:"2px"}},{children:n}))},span:function(n){var a,l,c,d,f,g,h=n.children,u=r(n,["children"]),m=u["data-badge-id"];if(!m)return o("span",e({},u,{children:h}));var v=w[m];return v?i(t,e({component:"span",sx:{position:"static",display:"inline"}},{children:[i(t,e({ref:v.badgeRef,sx:e(e({fontStyle:"normal",position:"absolute",zIndex:30,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=v.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(l=v.style)||void 0===l?void 0:l.badgeText)||s,border:"1px solid ".concat((null===(c=v.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"},"left"===v.side?{right:"-16px",transform:"translateY(-20%) translateX(calc(100% + 8px))"}:{left:"-16px",transform:"translateY(-20%) translateX(calc(-100% - 8px))"}),v.isConnected&&v.style&&{outline:"2px solid ".concat(v.style.badgeBorder),outlineOffset:"1px"})},{children:[i(t,e({onClick:function(e){e.stopPropagation(),v.onSummaryClick&&v.onSummaryClick(e)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[o(t,e({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:v.label})),("left"===v.side||v.isOrphan)&&o(t,e({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=v.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=v.score&&"N/A"!==v.score&&"NA"!==v.score&&0!==v.score?"".concat(v.score):"N/A"===v.score||"NA"===v.score?"N/A":"Same"}))]})),("left"===v.side||v.isOrphan)&&o(t,e({onClick:function(e){e.stopPropagation(),v.onClick&&v.onClick(e)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(f=v.style)||void 0===f?void 0:f.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:o(p,{size:12,color:(null===(g=v.style)||void 0===g?void 0:g.badgeText)||"#3730A3"})}))]})),h]})):o("span",e({},u,{children:h}))}}},[w,_]),S=c(function(){var e=function(e){return e?e.replace(/\\([''])/g,"$1").replace(/\\n/g,"\n").replace(/\r\n/g,"\n").split(/(\n{2,})/).map(function(e){return e.startsWith("\n")?e:e.replace(/\n/g," ")}).join(""):""},r=function(e,r,n){return void 0===r&&(r=""),void 0===n&&(n=""),r+e.split(/(\n{2,})/).map(function(e){return/^\n{2,}$/.test(e)?e:e.trim()?"<mark>".concat(e,"</mark>"):e}).join("")+n},o=e(f(g||"")),i=n([],v,!0).sort(function(e,r){var n,o;return((null===(n=r.highlight)||void 0===n?void 0:n.length)||0)-((null===(o=e.highlight)||void 0===o?void 0:o.length)||0)}),t={},a=0;i.forEach(function(n){if(n&&n.highlight){var i=e(n.highlight);if(i){var l=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c="__DEV_TOKEN_".concat(a++,"__");t[c]=r(i,'<span data-badge-id="'.concat(n.id,'">'),"</span>"),o=o.replace(i,c);var s="__HIGHLIGHT_TOKEN_".concat(a++,"__");t[s]=r(i),o=o.replace(new RegExp(l,"g"),s)}}});var l=new Set(i.map(function(r){return e(r.highlight)}).filter(Boolean));return b.forEach(function(n){if(n){var i=e(n);if(i&&!l.has(i)){var c=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s="__PLAIN_TOKEN_".concat(a++,"__");t[s]=r(i),o=o.replace(new RegExp(c,"g"),s)}}}),Object.keys(t).forEach(function(e){o=o.split(e).join(t[e])}),o},[g,v,b]);return o(a,e({component:"div",sx:e(e({},u),{position:"relative",overflow:"visible",whiteSpace:"pre-wrap","& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}})},{children:o(d,e({components:E,rehypePlugins:[h]},{children:f(S).replace(/\\n/g,"\n")}))}))},g);export{u as MemoizedMarkdown};
|
|
2
2
|
//# sourceMappingURL=memoizedMarkdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{useState as o,useRef as
|
|
1
|
+
import{__assign as e}from"tslib";import{useState as o,useRef as n,useEffect as t}from"react";import{debounce as i,DEVIATION_BADGE_SEPARATOR as r}from"../CognitiveComparehelpers.js";var l=function(l){var u=l.proposedSections,c=l.existingSections,d=l.parentDeviationRecord,v=l.expandedSections,f=l.maintainRelativeOrder,a=l.scrollContainerRef,s=l.leftContainerRef,h=l.lhsBadgeRefs,w=l.rhsBadgeRefs,g=o({}),R=g[0],b=g[1],m=n();return t(function(){if(a.current){var o=f?s.current:a.current;if(o){var n=null,t=setTimeout(function(){var t=function(e,o){var n=e.getBoundingClientRect(),t=o.getBoundingClientRect();return n.bottom<t.top?"above":n.top>t.bottom?"below":"inside"};n=i(function(){b(function(o){var n=e({},o);return u.forEach(function(e,o){var i=f?!!v["left-".concat(o)]:!!v[String(o)],l=!1,u=!1,c=null,s=null;i&&(null==e?void 0:e.id)&&(d[e.id]||[]).forEach(function(o){var n="".concat(o.id).concat(r,"0"),i=h.current[n];if((null==i?void 0:i.current)&&a.current){var d=t(i.current,a.current);"above"===d?(l=!0,c=i):"below"!==d||u?m.current===e.id&&(m.current=""):(u=!0,s=i)}}),e.id&&(n[e.id]={showAbove:l,showBelow:u,showAboveRef:c,showBelowRef:s,columnKey:"left"})}),f||c.forEach(function(e,o){var i=!!v[String(o)],l=!1,u=!1,c=null,f=null;i&&(null==e?void 0:e.id)&&(d[e.id]||[]).forEach(function(o){var i,d,v,s,h,g=!(null===(i=o.refIndexes)||void 0===i?void 0:i.length)||void 0!==o.selfIndex&&o.selfIndex<0,R="".concat(o.id).concat(r,"0"),b=w.current[R];if((null==b?void 0:b.current)&&a.current&&g&&(null==e?void 0:e.id)){var p=t(b.current,a.current);if("above"===p){var B=null===(v=null===(d=n[e.id])||void 0===d?void 0:d.showAboveRef)||void 0===v?void 0:v.current;(!B||B.getBoundingClientRect().top<b.current.getBoundingClientRect().top)&&(l=!0,c=b)}else if("below"!==p||u)m.current===e.id&&(m.current="");else{var C=null===(h=null===(s=n[e.id])||void 0===s?void 0:s.showBelowRef)||void 0===h?void 0:h.current;(!C||C.getBoundingClientRect().top>b.current.getBoundingClientRect().top)&&(u=!0,f=b)}}}),e.id&&i&&(l&&(n[e.id]=n[e.id]||{showAbove:!1,showAboveRef:null,showBelow:!1,showBelowRef:null,columnKey:"right"},n[e.id].showAbove=l,n[e.id].showAboveRef=c,n[e.id].columnKey="right"),u&&(n[e.id]=n[e.id]||{showAbove:!1,showAboveRef:null,showBelow:!1,showBelowRef:null,columnKey:"right"},n[e.id].showBelow=u,n[e.id].showBelowRef=f,n[e.id].columnKey="right"))}),n})},100),n(),null==o||o.addEventListener("scroll",n)},0);return function(){clearTimeout(t),n&&o.removeEventListener("scroll",n)}}}},[u,c,d,v,f,a,s,h,w]),{showDeviationNavigation:R,showOpenNodeRef:m}};export{l as useDeviationNavigation};
|
|
2
2
|
//# sourceMappingURL=useDeviationNavigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,oBAAoB,+CAsBzB,CAAA;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonConstants.d.ts","sourceRoot":"","sources":["../../../../src/CommonConstants/CommonConstants.tsx"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5C,eAAO,MAAM,OAAO,EAAE,aAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,EAAE,aAAuB,CAAC;AAChD,eAAO,MAAM,6BAA6B,yCAAyC,CAAA;AAEnF,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"CommonConstants.d.ts","sourceRoot":"","sources":["../../../../src/CommonConstants/CommonConstants.tsx"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5C,eAAO,MAAM,OAAO,EAAE,aAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,EAAE,aAAuB,CAAC;AAChD,eAAO,MAAM,6BAA6B,yCAAyC,CAAA;AAEnF,eAAO,MAAM,iBAAiB,EAAE,GAg+M/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAKf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAKf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsSjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|