@viswa-test/test-citation 0.0.87 → 0.0.89
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/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.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/CognitiveCompare.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("@mui/material"),o=require("lucide-react"),r=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("./OverlayComponent.js"),u=require("./CognitiveComparehelpers.js"),c=require("./CognitiveCompareConfig.js"),a=require("./CognitiveCompareConstants.js"),s=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),v=require("./LoaderComponent.js"),g=require("./components/ThreeDotsLoader.js"),f=require("./hooks/useCompareData.js"),p=require("./hooks/useComparePopups.js"),h=require("./hooks/useSectionRefs.js"),x=require("./hooks/useAccordionState.js"),_=require("./hooks/useDeviationNavigation.js"),m=require("./components/CompareHeader.js"),R=require("./components/SectionAccordion.js"),y=require("./components/SubSectionAccordion.js"),S=require("./components/CognitiveSummaryPopup.js");exports.SHARED_MARKDOWN_STYLES=c.SHARED_MARKDOWN_STYLES,exports.default=function(A){var b,E,I,T,B,C,D,O,w,j,N,P,F,k,M,L=A.componentHeaderText,V=void 0===L?a.DEFAULT_COMPONENT_HEADER_TEXT:L,H=A.treeData,G=A.comparisonConfig,q=A.leftColumnTitleText,z=A.rightColumnTitleText,W=A.markdownStyles,Y=A.displayConfig,K=void 0===Y?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0}:Y,U=A.popupConfig,X=A.deviationData,J=void 0===X?{}:X,Q=A.deviationNodeIdToView,Z=t.useState(K.maintainRelativeOrder),$=Z[0],ee=Z[1],ne=t.useState(!1),te=ne[0],ie=ne[1],oe=t.useState(!1),re=oe[0],le=oe[1],ue=t.useState(null),ce=ue[0],ae=ue[1],se=t.useState(!1),de=se[0],ve=se[1],ge=t.useState(!1),fe=ge[0],pe=ge[1],he=t.useState(!1),xe=he[0],_e=he[1],me=t.useState(null),Re=me[0],ye=me[1],Se=t.useRef(!1),Ae=t.useState(new Set),be=Ae[0],Ee=Ae[1],Ie=t.useState([]),Te=Ie[0],Be=Ie[1],Ce=t.useRef(null),De=t.useRef(!1),Oe=t.useRef(null),we=t.useRef({}),je=t.useRef([]),Ne=t.useRef(!1),Pe=t.useRef(!1),Fe=t.useRef(null),ke=t.useRef(function(){}),Me=t.useMemo(function(){return(null==H?void 0:H.cognitive_decisioning)||{}},[H]),Le=t.useState({width:0,height:0}),Ve=Le[0],He=Le[1],Ge=t.useMemo(function(){return e.__assign(e.__assign({},c.SHARED_MARKDOWN_STYLES),W)},[W]),qe=t.useRef(null),ze=t.useRef(null),We=t.useRef(null),Ye=t.useRef(null),Ke=t.useRef(null),Ue=t.useRef(null),Xe=t.useRef(null),Je=t.useRef(null),Qe=t.useRef(!1),Ze=t.useRef(null),$e=t.useRef(null),en=p.useComparePopups(qe),nn=en.cognitivePopup,tn=en.setCognitivePopup,on=en.moreFunctions,rn=en.setMoreFunctions,ln=en.position,un=en.setPosition,cn=en.activeBadgeId,an=en.summaryPopup,sn=en.setSummaryPopup,dn=en.closeSummaryPopup,vn=en.setActiveBadgeId,gn=en.popupRef,fn=en.closeCognitivePopup,pn=en.closeMoreFunctionsPopup,hn=t.useMemo(function(){var e,n,t,i,o,r,l;return{fields:null!==(e=null==G?void 0:G.fields)&&void 0!==e?e:c.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(t=null===(n=null==G?void 0:G.thresholds)||void 0===n?void 0:n.high)&&void 0!==t?t:c.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(i=null==G?void 0:G.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:c.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==G?void 0:G.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:c.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[G]),xn=t.useState(null),_n=xn[0];xn[1];var mn=null===(I=null===(b=null==H?void 0:H.documents)||void 0===b?void 0:b[null===(E=null==H?void 0:H.input_index_map)||void 0===E?void 0:E[0]])||void 0===I?void 0:I.title,Rn=null===(C=null===(T=null==H?void 0:H.documents)||void 0===T?void 0:T[null===(B=null==H?void 0:H.input_index_map)||void 0===B?void 0:B[1]])||void 0===C?void 0:C.title,yn=u.safeStringify(q||mn||"Uploaded Contract"),Sn=u.safeStringify(z||Rn||"Reference Template"),An=f.useCognitiveTreeData(H,$,J,hn),bn=An.activeProposed,En=An.existingRule,In=An.proposedSections,Tn=An.existingSections,Bn=An.visibleFields,Cn=An.parentDeviationRecord,Dn=An.deviationNumberRegistry,On=An.parseError;t.useEffect(function(){On&&ae("Failed to load comparison: ".concat(On))},[On]);var wn=In.length>0||Tn.length>0,jn=h.useSectionRefs(Bn.map(function(e){return e.key}),Math.max(In.length,Tn.length)),Nn=jn.leftRefs,Pn=jn.rightRefs,Fn=jn.sectionLeftRefs,kn=jn.sectionRightRefs,Mn=jn.lhsBadgeRefs,Ln=jn.rhsBadgeRefs,Vn=jn.sectionRightRowRefs,Hn=jn.subSectionLeftRefs,Gn=jn.subSectionRightRefs,qn=jn.sectionRowRefs,zn=jn.getSectionRowRef,Wn=jn.getSubSectionRef,Yn=jn.getBadgeRef,Kn=En.analysis,Un=u.safeStringify(null===(O=null===(D=null==Kn?void 0:Kn.rule_difference_comparison)||void 0===D?void 0:D.summary)||void 0===O?void 0:O.overall_summary),Xn=!!Un.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Jn=null!==(w=null==H?void 0:H.base_root_id)&&void 0!==w?w:"-1";null==H||H[Jn];var Qn=(null===(j=null==J?void 0:J[Jn])||void 0===j?void 0:j.evaluation_result)||(null===(P=null===(N=null==H?void 0:H.nodes)||void 0===N?void 0:N[Jn])||void 0===P?void 0:P.evaluation_result)||null,Zn=u.extractDeviationScore(Qn),$n=u.generateColorPalette(null!==(M=null===(k=null===(F=null==Qn?void 0:Qn.evaluation_outputs)||void 0===F?void 0:F.metadata)||void 0===k?void 0:k.label_color)&&void 0!==M?M:""),et=t.useCallback(function(){var e,n,t,i,o,r;ve(!1),Pe.current=!1;var l=Fe.current,c=gt.current;if(null!==l)if("string"==typeof l&&l.includes(u.DEVIATION_BADGE_SEPARATOR)){var a=l.split(u.DEVIATION_BADGE_SEPARATOR);(s=(null===(e=Hn.current[a[2]])||void 0===e?void 0:e.current)||(null===(n=Fn.current[Number(a[2])])||void 0===n?void 0:n.current))&&(s.style.paddingTop="0px")}else{var s;(s=null===(t=Fn.current[l])||void 0===t?void 0:t.current)&&(s.style.paddingTop="0px")}if(null!==c)if("string"==typeof c&&c.includes(u.DEVIATION_BADGE_SEPARATOR)){a=c.split(u.DEVIATION_BADGE_SEPARATOR);(d=(null===(i=Gn.current[a[3]])||void 0===i?void 0:i.current)||(null===(o=kn.current[Number(a[3])])||void 0===o?void 0:o.current))&&(d.style.paddingTop="0px")}else{var d;(d=null===(r=kn.current[c])||void 0===r?void 0:r.current)&&(d.style.paddingTop="0px")}ye(null),Fe.current=null,gt.current=null,pe(!1),le(!1),Ye.current&&(Ye.current.style.height="0px"),Ke.current&&(Ke.current.style.height="0px"),Ue.current&&(Ue.current.style.height="0px"),Xe.current&&(Xe.current.style.height="0px")},[]),nt=x.useAccordionState({maintainRelativeOrder:!!$,proposedSections:In,existingSections:Tn,activeSideBySideSection:Re,connectedSections:be,resetSideBySide:et,setConnectedSections:Ee,setConnectedLines:Be,cachedConnectedPositions:je,svgContainerRef:Ce,isAnimatingRef:De,animationTimerRef:Oe,calculateLinesRef:ke,sectionLeftRefs:Fn,sectionRightRefs:kn,subSectionLeftRefs:Hn,subSectionRightRefs:Gn}),tt=nt.expandedSections,it=nt.expandedSubSections,ot=nt.setExpandedSubSections,rt=nt.toggleSection,lt=t.useCallback(function(e,n,t,i,o,r,l){var c,a,s,d=u.safeStringify(null==n?void 0:n.id)||u.safeStringify(null==t?void 0:t.id)||"",v=(d?Me[d]:null)||(null==n?void 0:n.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:d,decisioning:[],gap:[],relevance_score:0},g=null!==(a=null===(c=qn.current[i])||void 0===c?void 0:c.current)&&void 0!==a?a:null;return{isLoading:null!==(s=null==K?void 0:K.isLoading)&&void 0!==s&&s,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:v,anchorEl:e,sectionAnchorEl:g,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==H?void 0:H.documents,input_index_map:null==H?void 0:H.input_index_map},deviationData:(null==n?void 0:n.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,isOrphan:!!o}},[Me,H]),ut=t.useCallback(function(e){pn(),un(null),tn(e)},[pn]),ct=function(e,n,t,i,o,r){var l;if(e.stopPropagation(),on.open&&on.sectionIdx===o)pn();else{var c=e.currentTarget,a="left";(null===(l=We.current)||void 0===l?void 0:l.contains(c))&&(a="right");Pe.current&&et(),Ee(new Set),Be([]),je.current=[],fn(),an.open?Ft():dn(),requestAnimationFrame(function(){var e=function(){var e,n,t,i;if("string"==typeof o&&o.includes(u.DEVIATION_BADGE_SEPARATOR)){var r=o.split(u.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Ln.current[l])||void 0===e?void 0:e.current:null===(n=Mn.current[l])||void 0===n?void 0:n.current}return"right"===a?null===(t=Ln.current[o])||void 0===t?void 0:t.current:null===(i=Mn.current[o])||void 0===i?void 0:i.current}()||c;rn(lt(e,n,i,o,t,r))})}},at=t.useCallback(function(){null!==on.sectionIdx&&on.anchorEl?ut(e.__assign(e.__assign({},on),{open:!0})):pn()},[on,pn,ut]),st=t.useCallback(function(){var e=on.sectionIdx,n=on.isOrphan;pn(),dn(),null!==e&&(n?ae("No counterpart exists to connect to."):(Pe.current&&et(),Be([]),je.current=[],Ee(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){ke.current&&ke.current()},50)))},[on.sectionIdx,on.isOrphan,pn,dn,et]),dt=t.useRef(null),vt=t.useRef(null),gt=t.useRef(null),ft=t.useRef(null),pt=t.useRef(null),ht=t.useRef(null),xt=t.useState([]),_t=xt[0],mt=xt[1];t.useRef(null);var Rt=t.useState(null),yt=Rt[0],St=Rt[1];t.useEffect(function(){if(_n){var e=hn.fields.find(function(e){return e.analysisKey===_n||e.key===_n});if(e){var n=Nn.current[e.key]||Pn.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[_n,hn.fields]);var At=t.useCallback(function(e){var n,t,i,o,r,l,u,c,a,s=null===(n=null==Kn?void 0:Kn.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!s||!s[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=s[e],v=(null==d?void 0:d.relation)||(null===(i=null===(t=null==d?void 0:d.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var g=d.mappings[0]||{};return{score:d.score,relation:g.relation||"",highlightsA:(null===(l=g.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=g.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Kn]),bt=t.useCallback(function(n,t){var i,o,r,l,c,s,d;void 0===t&&(t="left");var v=null,g=null;if("left"===t)if(v=In[n],$&&v){var f=Tn.filter(function(e){var n;return null===(n=v.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)});g=f.find(function(e){return e.evaluationResult})||f[0]}else g=Tn[n];else if(g=Tn[n],$&&g){var p=In.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(g.selfIndex)});v=p.find(function(e){return e.evaluationResult})||p[0]}else v=In[n];var h=(null==v?void 0:v.relation)&&"not_defined"!==v.relation,x=(null==g?void 0:g.relation)&&"not_defined"!==g.relation,_=!(!(null==v?void 0:v.cognitiveData)&&!(null==g?void 0:g.cognitiveData));if(!h&&!x&&!_)return e.__assign(e.__assign({},u.generateColorPalette(a.DEFAULT_DEVIAION_COLOR)),{label:"Not Defined"});var m=null!==(o=null!==(i=null==v?void 0:v.evaluationResult)&&void 0!==i?i:null==g?void 0:g.evaluationResult)&&void 0!==o?o:null,R=null===(r=null==m?void 0:m.evaluation_outputs)||void 0===r?void 0:r.output_value,y=null!==(s=null===(c=null===(l=null==m?void 0:m.evaluation_outputs)||void 0===l?void 0:l.metadata)||void 0===c?void 0:c.label_color)&&void 0!==s?s:a.DEFAULT_DEVIAION_COLOR;return null!=m?e.__assign(e.__assign({},u.generateColorPalette(y)),{label:null!==(d=R)&&void 0!==d?d:""}):e.__assign(e.__assign({},u.generateColorPalette(y)),{label:null})},[In,Tn,Me,hn,$]),Et=t.useCallback(function(n){for(var t,i,o,r,l,c,s,d,v,g=n.split("-").map(Number),f=In[g[0]],p=Tn[g[0]],h=1;h<g.length;h++)(null==f?void 0:f.subsections)&&(f=f.subsections[g[h]]),(null==p?void 0:p.subsections)&&(p=p.subsections[g[h]]);if(!f&&!p)return null;var x=(null==f?void 0:f.relation)&&"not_defined"!==f.relation,_=(null==p?void 0:p.relation)&&"not_defined"!==p.relation,m=u.safeStringify(null==f?void 0:f.id)||u.safeStringify(null==p?void 0:p.id)||"",R=!(!(null==f?void 0:f.cognitiveData)&&!(null==p?void 0:p.cognitiveData));if(!x&&!_&&!R)return e.__assign(e.__assign({},u.generateColorPalette(a.DEFAULT_DEVIAION_COLOR)),{label:"Not Defined"});null!==(i=null!==(t=null==f?void 0:f.cognitiveRelevanceScore)&&void 0!==t?t:null==p?void 0:p.cognitiveRelevanceScore)&&void 0!==i||m&&(null===(o=Me[m])||void 0===o||o.relevance_score);var y=null!==(l=null!==(r=null==f?void 0:f.evaluationResult)&&void 0!==r?r:null==p?void 0:p.evaluationResult)&&void 0!==l?l:null,S=null===(c=null==y?void 0:y.evaluation_outputs)||void 0===c?void 0:c.output_value,A=null!==(v=null===(d=null===(s=null==y?void 0:y.evaluation_outputs)||void 0===s?void 0:s.metadata)||void 0===d?void 0:d.label_color)&&void 0!==v?v:a.DEFAULT_DEVIAION_COLOR;return null!=y?e.__assign(e.__assign({},u.generateColorPalette(A)),{label:null!=S?S:""}):e.__assign(e.__assign({},u.generateColorPalette(A)),{label:null})},[In,Tn,Me,hn]),It=t.useCallback(function(){var e,n,t,i,o,r,l,c,a,s,d,v,g,f,p,h,x,_,m,R,y,S;if(!Qe.current&&!De.current){Qe.current=!0;try{if(!dt.current)return;var A=function(e){var n=e.split("-"),t=n[0];if(!tt[t]&&!1===$)return!1;if($&&!tt["left-".concat(t)]&&!tt["right-".concat(t)]&&!tt[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!it[i])return!1;return!0},b=dt.current.getBoundingClientRect();He({width:b.width,height:b.height});var E=[];if(Bn.forEach(function(e){var n,t,i=e.key,o=null===(n=Nn.current[i])||void 0===n?void 0:n.current,r=null===(t=Pn.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")}),!De.current){for(var I=0;I<Math.max(In.length,Tn.length);I++){var T=null===(e=Fn.current[I])||void 0===e?void 0:e.current,B=null===(n=kn.current[I])||void 0===n?void 0:n.current;T&&(T.style.height="auto",T.style.minHeight="0px"),B&&(B.style.height="auto",B.style.minHeight="0px")}$||Object.keys(Hn.current).forEach(function(e){var n,t;if(A(e)){var i=null===(n=Hn.current[e])||void 0===n?void 0:n.current,o=null===(t=Gn.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 C={};Bn.forEach(function(e){var n,t,i=e.key,o=null===(n=Nn.current[i])||void 0===n?void 0:n.current,r=null===(t=Pn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),u=r.getBoundingClientRect();C[i]=Math.max(l.height,u.height)}});var D={left:{},right:{}},O={};if(!De.current)if($){if(de&&null!==Re)if("number"==typeof Re){var w=Re,j=In[w],N=null===(o=Fn.current[w])||void 0===o?void 0:o.current;N&&j&&(j.refIndexes||[]).forEach(function(e){var n,t=Tn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=kn.current[t])||void 0===n?void 0:n.current;if(i&&(tt["left-".concat(w)]||tt["right-".concat(t)])){var o=Math.max(N.getBoundingClientRect().height,i.getBoundingClientRect().height);D.left[w]=Math.max(D.left[w]||0,o),D.right[t]=Math.max(D.right[t]||0,o)}})}else{var P=Re.split(u.DEVIATION_BADGE_SEPARATOR)[2];if(P){T=null===(r=Hn.current[P])||void 0===r?void 0:r.current,B=null===(l=Gn.current[P])||void 0===l?void 0:l.current;if(T&&B){F=Math.max(T.getBoundingClientRect().height,B.getBoundingClientRect().height);O[P]=Math.max(O[P]||0,F)}}}}else{Object.keys(Hn.current).forEach(function(e){var n,t;if(A(e)){var i=null===(n=Hn.current[e])||void 0===n?void 0:n.current,o=null===(t=Gn.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(),u=Math.max(r.height,l.height);O[e]=u,i.style.minHeight="".concat(u,"px"),o.style.minHeight="".concat(u,"px")}}});for(I=0;I<Math.min(In.length,Tn.length);I++){var T=null===(t=Fn.current[I])||void 0===t?void 0:t.current,B=null===(i=kn.current[I])||void 0===i?void 0:i.current;if(T&&B){var F=Math.max(T.getBoundingClientRect().height,B.getBoundingClientRect().height);D.left[I]=F,D.right[I]=F}}}if(Bn.forEach(function(e){var n,t,i=e.key,o=null===(n=Nn.current[i])||void 0===n?void 0:n.current,r=null===(t=Pn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=C[i];o.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}),De.current||(Object.entries(D.left).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=Fn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(D.right).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=kn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),$||Object.keys(O).forEach(function(e){var n,t,i=null===(n=Hn.current[e])||void 0===n?void 0:n.current,o=null===(t=Gn.current[e])||void 0===t?void 0:t.current;if(i&&o&&O[e]){var r=O[e];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),$)In.forEach(function(e,n){var t;(null===(t=Fn.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,o,r,l,u,c,a,s,d,v=Tn.findIndex(function(n){return n.selfIndex===e});if(-1!==v){var g=null===(t=Mn.current[n])||void 0===t?void 0:t.current,f=null===(i=Ln.current[v])||void 0===i?void 0:i.current;if(g&&f){var p=g.getBoundingClientRect(),h=f.getBoundingClientRect(),x=p.right-b.left,_=h.left-b.left,m=p.top+p.height/2-b.top,R=h.top+h.height/2-b.top;if(de&&Re===n){var y=null!==(r=null===(o=Je.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,S=null!==(u=null===(l=We.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==u?u:0,A=y+(null!==(a=null===(c=Je.current)||void 0===c?void 0:c.clientHeight)&&void 0!==a?a:1/0),I=S+(null!==(d=null===(s=We.current)||void 0===s?void 0:s.clientHeight)&&void 0!==d?d:1/0),T=p.top+p.height/2,B=h.top+h.height/2,C=function(e,n,t){return Math.max(n,Math.min(t,e))};m=C(T,y,A)-b.top,R=C(B,S,I)-b.top}var D=bt(n);D&&E.push({id:"line-".concat(n,"-").concat(v),x1:x,y1:m,x2:_,y2:R,style:D,sectionIdx:n,targetRightIdx:v})}}})});else{for(I=0;I<Math.min(In.length,Tn.length);I++){var k=null===(c=Fn.current[I])||void 0===c?void 0:c.current,M=null===(a=kn.current[I])||void 0===a?void 0:a.current;if(k&&M){var L=k.getBoundingClientRect(),V=M.getBoundingClientRect(),H=Math.max(L.top,V.top)+18-b.top,G=(null===(s=Tn[I])||void 0===s?void 0:s.id)||"sec-".concat(I);(J=bt(I))&&E.push({id:G,x1:L.right-b.left,y1:H,x2:V.left-b.left,y2:H,style:J,sectionIdx:I,hasCognitive:!!((null===(d=In[I])||void 0===d?void 0:d.cognitiveData)||(null===(v=Tn[I])||void 0===v?void 0:v.cognitiveData)||G&&Me[G]),isSubSection:!1})}}Object.keys(Hn.current).forEach(function(e){var n,t,i,o,r,l;if(A(e)){var c=null===(n=Hn.current[e])||void 0===n?void 0:n.current,a=null===(t=Gn.current[e])||void 0===t?void 0:t.current;if(c&&a){for(var s=e.split("-").map(Number),d=In[s[0]],v=Tn[s[0]],g=1;g<s.length;g++)(null==d?void 0:d.subsections)&&(d=d.subsections[s[g]]),(null==v?void 0:v.subsections)&&(v=v.subsections[s[g]]);var f=!!d&&((null===(i=d.displayTitle)||void 0===i||i)&&u.hasValue(d.title)),p=!!d&&((null===(o=d.displayContent)||void 0===o||o)&&u.hasValue(d.content)),h=!!v&&((null===(r=v.displayTitle)||void 0===r||r)&&u.hasValue(v.title)),x=!!v&&((null===(l=v.displayContent)||void 0===l||l)&&u.hasValue(v.content));if(f&&p||h&&x){var _=c.getBoundingClientRect(),m=a.getBoundingClientRect(),R=Math.max(_.top,m.top)+16-b.top,y=Et(e);y&&"Not Defined"!==y.label&&E.push({id:"subsec-".concat(e),x1:_.right-b.left,y1:R,x2:m.left-b.left,y2:R,style:y,sectionIdx:s[0],isSubSection:!0,subSectionKeyPath:e,hasCognitive:!(!(null==d?void 0:d.cognitiveData)&&!(null==v?void 0:v.cognitiveData))})}}}})}if(de&&"string"==typeof Re&&Re.includes(u.DEVIATION_BADGE_SEPARATOR)){var q=Re.split(u.DEVIATION_BADGE_SEPARATOR),z=q[0],W=q[1],Y=q[2],K=(q[3],"".concat(z).concat(u.DEVIATION_BADGE_SEPARATOR).concat(W)),U=null===(g=Mn.current[K])||void 0===g?void 0:g.current,X=null===(f=Ln.current[K])||void 0===f?void 0:f.current;if(U&&X){var J,Q=U.getBoundingClientRect(),Z=X.getBoundingClientRect(),ee=Q.right-b.left,ne=Z.left-b.left,te=Q.top+Q.height/2-b.top,ie=Z.top+Z.height/2-b.top;if($){var oe=null!==(h=null===(p=Je.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==h?h:0,re=null!==(_=null===(x=We.current)||void 0===x?void 0:x.getBoundingClientRect().top)&&void 0!==_?_:0,le=oe+(null!==(R=null===(m=Je.current)||void 0===m?void 0:m.clientHeight)&&void 0!==R?R:1/0),ue=re+(null!==(S=null===(y=We.current)||void 0===y?void 0:y.clientHeight)&&void 0!==S?S:1/0),ce=function(e,n,t){return Math.max(n,Math.min(t,e))};te=ce(Q.top+Q.height/2,oe,le)-b.top,ie=ce(Z.top+Z.height/2,re,ue)-b.top}(J=Et(Y))&&E.push({id:"line-subsec-".concat(K),x1:ee,y1:te,x2:ne,y2:ie,style:J,sectionIdx:Number(Y.split("-")[0]),isSubSection:!0,subSectionKeyPath:Re})}}if(mt(E),pt.current&&ht.current){var ae=pt.current.getBoundingClientRect(),se=ht.current.getBoundingClientRect(),ve=(ae.top+ae.height/2-b.top+se.top+se.height/2-b.top)/2;St({x1:ae.right-b.left,x2:se.left-b.left,y:ve})}else St(null);if(be.size>0){var ge=[],fe=Je.current,pe=We.current;if(fe&&pe){var he=[],xe=fe.getBoundingClientRect().top,_e=pe.getBoundingClientRect().top,me=xe+fe.clientHeight,ye=_e+pe.clientHeight,Se=fe.scrollTop,Ae=pe.scrollTop,Ee=b.top,Ie=function(e,n,t){return Math.max(n,Math.min(t,e))};be.forEach(function(e){var n,t,i,o,r;if("string"==typeof e&&e.includes(u.DEVIATION_BADGE_SEPARATOR)){var l=e.split(u.DEVIATION_BADGE_SEPARATOR),c=l[0],a=l[1],s=l[2],d=(l[3],"".concat(c).concat(u.DEVIATION_BADGE_SEPARATOR).concat(a)),v=null===(n=Mn.current[d])||void 0===n?void 0:n.current,g=null===(t=Ln.current[d])||void 0===t?void 0:t.current;if(!v||!g)return;var f=v.getBoundingClientRect(),p=g.getBoundingClientRect(),h=Et(s),x=(N=f.right-b.left)+.5*((P=p.left-b.left-0)-N),_=f.top+f.height/2,m=p.top+p.height/2,R=_-xe+Se,y=m-_e+Ae,S="conn-subsec-".concat(d);he.push({lhsScrollY:R,rhsScrollY:y,x1:N,x2:P,containerTop:Ee,leftIdx:e,rhsArrayIdx:e,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:S});var A=Ie(_,xe,me),E=Ie(m,_e,ye),I=A-Ee,T=E-Ee,B=m>=_e-4&&m<=ye+4,C="";C=(F=_>=xe-4&&_<=me+4)&&B?u.getBentArrowPath(N,I,P,T):F&&!B?"M ".concat(N,",").concat(I," L ").concat(x,",").concat(I," L ").concat(x,",").concat(T):!F&&B?"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T," L ").concat(P,",").concat(T):"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T),ge.push({id:S,pathD:C,style:h,leftIdx:e,rhsArrayIdx:e})}else if($){var D=e,O=In[D];if(!(null===(r=null==O?void 0:O.refIndexes)||void 0===r?void 0:r.length))return;O.refIndexes.forEach(function(e){var n,t,i=Tn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=Mn.current[D])||void 0===n?void 0:n.current,r=null===(t=Ln.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect(),a=bt(D),s=l.right-b.left,d=c.left-b.left-0,v=s+.5*(d-s),g=l.top+l.height/2,f=c.top+c.height/2,p=g-xe+Se,h=f-_e+Ae,x="conn-".concat(D,"-").concat(i);he.push({lhsScrollY:p,rhsScrollY:h,x1:s,x2:d,containerTop:Ee,leftIdx:D,rhsArrayIdx:i,styleColor:(null==a?void 0:a.badgeBorder)||"#6366F1",styleId:x});var _=Ie(g,xe,me),m=Ie(f,_e,ye),R=_-Ee,y=m-Ee,S=g>=xe-4&&g<=me+4,A=f>=_e-4&&f<=ye+4,E="";E=S&&A?u.getBentArrowPath(s,R,d,y):S&&!A?"M ".concat(s,",").concat(R," L ").concat(v,",").concat(R," L ").concat(v,",").concat(y):!S&&A?"M ".concat(v,",").concat(R," L ").concat(v,",").concat(y," L ").concat(d,",").concat(y):"M ".concat(v,",").concat(R," L ").concat(v,",").concat(y),ge.push({id:x,pathD:E,style:a,leftIdx:D,rhsArrayIdx:i})}}})}else{var w=e,j=w;v=null===(i=Mn.current[w])||void 0===i?void 0:i.current,g=null===(o=Ln.current[j])||void 0===o?void 0:o.current;if(!v||!g)return;var N,P;f=v.getBoundingClientRect(),p=g.getBoundingClientRect(),h=bt(w),x=(N=f.right-b.left)+.5*((P=p.left-b.left-0)-N),_=f.top+f.height/2,m=p.top+p.height/2,R=_-xe+Se,y=m-_e+Ae,S="conn-".concat(w,"-").concat(j);he.push({lhsScrollY:R,rhsScrollY:y,x1:N,x2:P,containerTop:Ee,leftIdx:w,rhsArrayIdx:j,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:S});var F;A=Ie(_,xe,me),E=Ie(m,_e,ye),I=A-Ee,T=E-Ee,B=m>=_e-4&&m<=ye+4,C="";C=(F=_>=xe-4&&_<=me+4)&&B?u.getBentArrowPath(N,I,P,T):F&&!B?"M ".concat(N,",").concat(I," L ").concat(x,",").concat(I," L ").concat(x,",").concat(T):!F&&B?"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T," L ").concat(P,",").concat(T):"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T),ge.push({id:S,pathD:C,style:h,leftIdx:w,rhsArrayIdx:j})}}),je.current=he}Be(ge)}else Be([]),je.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{Qe.current=!1}}},[Bn,In,Tn,Me,hn,At,bt,$,de,Re,be,tt,it]),Tt=t.useCallback(function(){var e,n,t,i,o,r,l,c,a,s,d,v,g,f,p=je.current;if(p.length&&!De.current){var h=null!==(n=null===(e=Je.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,x=null!==(i=null===(t=We.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,_=null!==(r=null===(o=Je.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(c=null===(l=We.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,R=null!==(s=null===(a=Je.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==s?s:0,y=null!==(v=null===(d=We.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==v?v:0,S=R+_,A=y+m,b=null!==(f=null===(g=dt.current)||void 0===g?void 0:g.getBoundingClientRect().top)&&void 0!==f?f:0,E=function(e,n,t){return Math.max(n,Math.min(t,e))};p.forEach(function(e){var n=e.lhsScrollY-h+R,t=e.rhsScrollY-x+y,i=we.current[e.styleId+"-stroke"],o=we.current[e.styleId+"-bg"];if(i||o){var r,l=E(n,R,S),c=E(t,y,A),a=l-b,s=c-b,d=n>=R-4&&n<=S+4,v=t>=y-4&&t<=A+4,g=e.x1+.5*(e.x2-e.x1);r=d&&v?u.getBentArrowPath(e.x1,a,e.x2,s):d&&!v?"M ".concat(e.x1,",").concat(a," L ").concat(g,",").concat(a," L ").concat(g,",").concat(s):!d&&v?"M ".concat(g,",").concat(a," L ").concat(g,",").concat(s," L ").concat(e.x2,",").concat(s):"M ".concat(g,",").concat(a," L ").concat(g,",").concat(s),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);t.useEffect(function(){ke.current=It},[It]);var Bt=t.useRef(null),Ct=t.useRef(null),Dt=t.useCallback(function(){je.current.length>0&&!De.current||(null!==Bt.current&&clearTimeout(Bt.current),Bt.current=setTimeout(function(){ke.current(),Bt.current=null},50))},[]),Ot=t.useCallback(function(){_e(!0),pe(!1),null!==Ct.current&&clearTimeout(Ct.current),null!==Bt.current&&(clearTimeout(Bt.current),Bt.current=null),Ct.current=setTimeout(function(){var e,n,t,i,o,r,l,c,a,s;if(je.current=[],Pe.current&&null!==Fe.current&&null!==gt.current){var d=Fe.current,v=gt.current,g=null,f=null,p=null,h=null;if("string"==typeof d&&d.includes(u.DEVIATION_BADGE_SEPARATOR)){var x=d.split(u.DEVIATION_BADGE_SEPARATOR),_="".concat(x[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(x[1]);g=(null===(e=Mn.current[_])||void 0===e?void 0:e.current)||null,f=(null===(n=Ln.current[_])||void 0===n?void 0:n.current)||null,p=(null===(t=Hn.current[x[2]])||void 0===t?void 0:t.current)||(null===(i=Fn.current[Number(x[2])])||void 0===i?void 0:i.current)||null,h=(null===(o=Gn.current[x[3]])||void 0===o?void 0:o.current)||(null===(r=kn.current[Number(x[3])])||void 0===r?void 0:r.current)||null}else g=(null===(l=qn.current[d])||void 0===l?void 0:l.current)||null,p=(null===(c=Fn.current[d])||void 0===c?void 0:c.current)||null,f=(null===(a=Vn.current[v])||void 0===a?void 0:a.current)||null,h=(null===(s=kn.current[v])||void 0===s?void 0:s.current)||null;if(g&&f&&p&&h){if(p.style.paddingTop="0px",h.style.paddingTop="0px",!$){var m=g.getBoundingClientRect(),R=f.getBoundingClientRect(),y=m.top-R.top;y>0?h.style.paddingTop="".concat(y,"px"):y<0&&(p.style.paddingTop="".concat(Math.abs(y),"px"))}var S=Je.current,A=We.current;if(S&&A){var b=g.getBoundingClientRect().top-S.getBoundingClientRect().top+S.scrollTop,E=f.getBoundingClientRect().top-A.getBoundingClientRect().top+A.scrollTop-(b-S.scrollTop);Math.abs(A.scrollTop-E)>1&&(A.scrollTop=E)}}}ke.current(),Pe.current&&pe(!0),_e(!1),Ct.current=null},150)},[$,In,Tn]),wt=t.useCallback(function(e){var n,t,i,o,r,l,c,a,s,d;if(null!==Ze.current&&$e.current&&Math.abs(e.currentTarget.scrollTop-Ze.current)<=2){var v=$e.current;Ze.current=null,$e.current=null,v()}if(!Se.current){if($||Dt(),Pe.current){var g=Fe.current,f=gt.current,p=Je.current,h=We.current;if(null!==g&&null!==f&&p&&h){var x="string"==typeof g&&g.includes(u.DEVIATION_BADGE_SEPARATOR)?null===(n=Mn.current["".concat(g.split(u.DEVIATION_BADGE_SEPARATOR)[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(g.split(u.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===n?void 0:n.current:null===(t=qn.current[g])||void 0===t?void 0:t.current,_="string"==typeof f&&f.includes(u.DEVIATION_BADGE_SEPARATOR)?null===(i=Ln.current["".concat(f.split(u.DEVIATION_BADGE_SEPARATOR)[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(f.split(u.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===i?void 0:i.current:null===(o=Vn.current[f])||void 0===o?void 0:o.current;if(x&&_&&ft.current){var m=void 0,R=void 0;if("string"==typeof g&&g.includes(u.DEVIATION_BADGE_SEPARATOR)){var y=g.split(u.DEVIATION_BADGE_SEPARATOR),S="".concat(y[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(y[1]);m=null===(r=Mn.current[S])||void 0===r?void 0:r.current,R=null===(l=Ln.current[S])||void 0===l?void 0:l.current}else m=null===(c=Mn.current[g])||void 0===c?void 0:c.current,R=null===(a=Ln.current[f])||void 0===a?void 0:a.current;var A=null!==(d=null===(s=dt.current)||void 0===s?void 0:s.getBoundingClientRect().top)&&void 0!==d?d:0,b=p.getBoundingClientRect().top,E=b+p.clientHeight;h.getBoundingClientRect().top;h.clientHeight;if(m&&R){var I=m.getBoundingClientRect(),T=R.getBoundingClientRect(),B=I.top+I.height/2;T.top,T.height;var C=((O=B,w=b,j=E,Math.max(w,Math.min(j,O)))-A).toString();ft.current.setAttribute("y1",C),ft.current.setAttribute("y2",C);var D=B>=b-4&&B<=E+4;ft.current.setAttribute("visibility",D?"visible":"hidden")}}}}var O,w,j;je.current.length>0&&!Ne.current&&(Ne.current=!0,requestAnimationFrame(function(){Tt(),Ne.current=!1}))}},[Tt,$,Dt]);t.useEffect(function(){var e=setTimeout(Dt,250);window.addEventListener("resize",Ot);var n=null,t=null;return qe.current&&(n=new ResizeObserver(Dt)).observe(qe.current),dt.current&&(t=new ResizeObserver(Dt)).observe(dt.current),function(){clearTimeout(e),null!==Bt.current&&clearTimeout(Bt.current),null!==Ct.current&&clearTimeout(Ct.current),window.removeEventListener("resize",Ot),null==n||n.disconnect(),null==t||t.disconnect()}},[bn,En,Kn,Bn,tt,it,In,Tn,hn,Dt,Ot,de,Re,fe,be]),t.useEffect(function(){Pe.current=de},[de]),t.useEffect(function(){Fe.current=Re},[Re]);var jt=t.useCallback(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";pn(),null!=e&&(n?ae("No counterpart exists for this section."):de&&Re===e?r?et():null==l||l():(Ee(new Set([e])),Be([]),je.current=[],le(!0),Se.current=!0,ye(e),Fe.current=e,ve(!0),Pe.current=!0,pe(!1),Ye.current&&(Ye.current.style.height="0px"),Ke.current&&(Ke.current.style.height="0px"),Ue.current&&(Ue.current.style.height="0px"),Xe.current&&(Xe.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i,o,r,a="string"==typeof e&&e.includes(u.DEVIATION_BADGE_SEPARATOR),s=null,d=null,v=null;if(a){var g=e.split(u.DEVIATION_BADGE_SEPARATOR),f="".concat(g[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(g[1]);s=(null===(n=Mn.current[f])||void 0===n?void 0:n.current)||null,d=(null===(t=Ln.current[f])||void 0===t?void 0:t.current)||null,v=d?e:null}else if(s=(null===(i=qn.current[e])||void 0===i?void 0:i.current)||null,$){var p=In[e],h=(null==p?void 0:p.refIndexes)||[];if(h.length>0){var x=h[0],_=Tn.findIndex(function(e){return e.selfIndex===x});-1!==_&&(d=(null===(r=Vn.current[_])||void 0===r?void 0:r.current)||null,v=_)}}else d=(null===(o=Vn.current[e])||void 0===o?void 0:o.current)||null,v=d?e:null;gt.current=v;var m=Je.current,R=We.current,y=function(){!function(){var n,t,i,o,r,l,c,s,d,g,f,p,h=null,x=null,_=null,m=null;if(a){var R=e.split(u.DEVIATION_BADGE_SEPARATOR),y="".concat(R[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(R[1]);h=(null===(n=Hn.current[R[2]])||void 0===n?void 0:n.current)||(null===(t=Fn.current[Number(R[2])])||void 0===t?void 0:t.current)||null,x=(null===(i=Gn.current[R[3]])||void 0===i?void 0:i.current)||(null===(o=kn.current[Number(R[3])])||void 0===o?void 0:o.current)||null,_=(null===(r=Mn.current[y])||void 0===r?void 0:r.current)||h,m=(null===(l=Ln.current[y])||void 0===l?void 0:l.current)||x}else{var S=Number(e),A=null!==v?Number(v):S;h=(null===(c=Fn.current[S])||void 0===c?void 0:c.current)||null,x=(null===(s=kn.current[A])||void 0===s?void 0:s.current)||null,_=(null===(d=Mn.current[S])||void 0===d?void 0:d.current)||(null===(g=qn.current[S])||void 0===g?void 0:g.current)||h,m=(null===(f=Ln.current[A])||void 0===f?void 0:f.current)||(null===(p=Vn.current[A])||void 0===p?void 0:p.current)||x}if(_&&m&&h&&x){h.style.paddingTop="0px",x.style.paddingTop="0px";var b=_.getBoundingClientRect(),E=m.getBoundingClientRect(),I=b.top-E.top;I>0?x.style.paddingTop="".concat(I,"px"):I<0&&(h.style.paddingTop="".concat(Math.abs(I),"px"))}}(),pe(!0),ke.current&&ke.current(),Se.current=!1,"right"===c&&R?R.dispatchEvent(new Event("scroll")):m&&m.dispatchEvent(new Event("scroll")),le(!1),null==l||l()};if(!s||!m)return Se.current=!1,le(!1),void(null==l||l());if(d&&R){if(!$){var S=0;S="right"===c?d?d.getBoundingClientRect().top:0:s?s.getBoundingClientRect().top:0;var A=qe.current,b=(null==A?void 0:A.getBoundingClientRect().top)||0,E=A?A.scrollTop+S-b-150:0;return A?void u.smoothScrollTo(A,E,200,y):void y()}var I=s.getBoundingClientRect().top-m.getBoundingClientRect().top+m.scrollTop,T=d.getBoundingClientRect().top-R.getBoundingClientRect().top+R.scrollTop,B=200;if("left"===c){var C=T-(I-m.scrollTop);C<0&&Ye.current&&(Ye.current.style.height="".concat(Math.abs(C),"px")),requestAnimationFrame(function(){var e,n=R.scrollHeight-R.clientHeight;if(C<0)e=0;else{if(C>n){var t=C-n;return Ke.current&&(Ke.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){u.smoothScrollTo(R,C,B,y)})}e=C}u.smoothScrollTo(R,e,B,y)})}else{var D=I-(T-R.scrollTop);D<0&&Ue.current&&(Ue.current.style.height="".concat(Math.abs(D),"px")),requestAnimationFrame(function(){var e,n=m.scrollHeight-m.clientHeight;if(D<0)e=0;else{if(D>n){var t=D-n;return Xe.current&&(Xe.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){u.smoothScrollTo(m,D,B,y)})}e=D}u.smoothScrollTo(m,e,B,y)})}}else y()})))},[Re,pn,Tn,de,$,In,et]),Nt=t.useCallback(function(e,n,t,i){var o,r="string"==typeof i?u.safeStringify(i).trim():u.safeStringify(null==i?void 0:i.deviation_summary).trim(),l=e.currentTarget;fn();var c="left";(null===(o=We.current)||void 0===o?void 0:o.contains(l))&&(c="right");var a=function(){var e,t,i,o;if("string"==typeof n&&n.includes(u.DEVIATION_BADGE_SEPARATOR)){var r=n.split(u.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===c?null===(e=Ln.current[l])||void 0===e?void 0:e.current:null===(t=Mn.current[l])||void 0===t?void 0:t.current}return"right"===c?null===(i=Ln.current[n])||void 0===i?void 0:i.current:null===(o=Mn.current[n])||void 0===o?void 0:o.current};if(t)return et(),Ee(new Set),Be([]),je.current=[],void(r&&requestAnimationFrame(function(){var e=a()||l;sn({open:!0,anchorEl:e,summary:i})}));jt(n,t,r?{toggleIfSame:!1,sourceSide:c,onReady:function(){var e=a()||l;sn({open:!0,anchorEl:e,summary:i})}}:{toggleIfSame:!1,sourceSide:c})},[jt,fn,sn,et]),Pt=t.useCallback(function(){var e,n=on.sectionIdx,t=on.isOrphan;if(dn(),null!=n){var i="left";on.anchorEl&&(null===(e=We.current)||void 0===e?void 0:e.contains(on.anchorEl))&&(i="right"),jt(n,t,{sourceSide:i})}},[jt,on.isOrphan,on.sectionIdx,on.anchorEl,dn]),Ft=t.useCallback(function(){dn(),et(),Ee(new Set),Be([]),je.current=[]},[dn,et]),kt=null!==on.sectionIdx&&be.has(on.sectionIdx),Mt=_.useDeviationNavigation({proposedSections:In,existingSections:Tn,parentDeviationRecord:Cn,expandedSections:tt,maintainRelativeOrder:!!$,scrollContainerRef:qe,leftContainerRef:Je,lhsBadgeRefs:Mn,rhsBadgeRefs:Ln}),Lt=Mt.showDeviationNavigation,Vt=Mt.showOpenNodeRef,Ht=t.useMemo(function(){if(!Q)return null;for(var e in Cn){if((Cn[e]||[]).some(function(e){return e.id===Q}))return e}return null},[Q,Cn]),Gt=t.useRef(null),qt=t.useRef(null);t.useEffect(function(){if(Q&&Gt.current!==Q){qt.current!==Q&&(dn(),fn(),et(),Ee(new Set),Be([]),je.current=[],qt.current=Q);var n=!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,a,s,d;if(!n){var v=null,g=null;for(var f in Cn){var p=Cn[f].find(function(e){return e.id===Q});if(p){v=f,g=p;break}}if(g&&v){var h=In.findIndex(function(e){return e.id===v}),x=Tn.findIndex(function(e){return e.id===v}),_=-1===h&&-1!==x;if(_){if(!($?!!tt["right-".concat(x)]:!!tt[String(x)]))return rt(x,"right"),t+=1,void(i=setTimeout(l,450))}else if(!($?!!tt["left-".concat(h)]:!!tt[String(h)])&&h>=0)return rt(h,"left"),t+=1,void(i=setTimeout(l,450));var m=r(In,g.id),R=r(Tn,g.id);if(m&&!R&&!_){var y=m.split("-"),S=Number(y[0]);if($){var A=null===(a=null===(c=In[S])||void 0===c?void 0:c.refIndexes)||void 0===a?void 0:a[0],b=Tn.findIndex(function(e){return e.selfIndex===A});-1!==b&&(S=b)}R=e.__spreadArray([S],y.slice(1),!0).join("-")}if(m||R){var E,I=m||"",T=R||"",B="".concat(g.id).concat(u.DEVIATION_BADGE_SEPARATOR,"0").concat(u.DEVIATION_BADGE_SEPARATOR).concat(I).concat(u.DEVIATION_BADGE_SEPARATOR).concat(T),C="".concat(g.id).concat(u.DEVIATION_BADGE_SEPARATOR,"0"),D=null===(s=Mn.current[C])||void 0===s?void 0:s.current,O=null===(d=Ln.current[C])||void 0===d?void 0:d.current,w=_?O:D;if(E=$?_?We.current:Je.current:qe.current,w&&E){var j=w.getBoundingClientRect();if(0===j.height)return void((t+=1)<20&&(i=setTimeout(l,o)));var N=E.getBoundingClientRect(),P=j.top-N.top+E.scrollTop-N.height/2+j.height/2,F=function(){var e,t,i,o,r;if(!n){Gt.current=Q;var l=window.getComputedStyle(w).color;D&&(D.style.transition="box-shadow 300ms ease-in-out",D.style.boxShadow="0 0 10px ".concat(l)),O&&(O.style.transition="box-shadow 300ms ease-in-out",O.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){D&&(D.style.boxShadow=""),O&&(O.style.boxShadow="")},2e3);var u=(null===(t=null===(e=g.evaluationResult)||void 0===e?void 0:e.deviations)||void 0===t?void 0:t[0])||g,c=(null===(i=g.evaluationResult)||void 0===i?void 0:i.evaluation_outputs)||g.evaluation_outputs;if(D&&O&&!_)jt(B,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var e,n=(null===(e=Mn.current[C])||void 0===e?void 0:e.current)||D;sn({open:!0,anchorEl:n,summary:{deviation_summary:u.deviation_summary||u,evaluation_outputs:c}})}});else{var a=_?(null===(o=Ln.current[C])||void 0===o?void 0:o.current)||O:(null===(r=Mn.current[C])||void 0===r?void 0:r.current)||D;sn({open:!0,anchorEl:a,summary:{deviation_summary:u.deviation_summary||u,evaluation_outputs:c}})}}};Math.abs(E.scrollTop-P)<=2?F():(Ze.current=P,$e.current=F,E.scrollTo({top:P,behavior:"smooth"}),i&&clearTimeout(i),i=setTimeout(function(){if($e.current){Ze.current=null;var e=$e.current;$e.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(){n=!0,i&&clearTimeout(i)}}},[Q,Cn,In,Tn,$,tt,rt,jt,sn]);var zt=function(e){var t=e.section,i=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,u=void 0===l?"left":l,c=e.parentNodeId,a=void 0===c?"":c;return n.jsx(y.default,{section:t,keyPath:i,depth:r,columnKey:u,parentNodeId:a,expandedSubSections:it,setExpandedSubSections:ot,maintainRelativeOrder:$||!1,proposedSections:In,existingSections:Tn,treeData:H,deviationNumberRegistry:Dn,connectedSections:be,activeSideBySideSection:Re,resolvedMarkdownStyles:Ge,getSubSectionRef:Wn,getSubSectionCompareStyle:Et,getBadgeRef:Yn,openMoreFunctionsPopup:ct,openSummaryPopup:Nt,resetSideBySide:et,setConnectedSections:Ee,setConnectedLines:Be,cachedConnectedPositions:je})};return n.jsxs(i.Box,e.__assign({ref:ze,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},$?{}:{overflow:"visible"}),{position:"relative"})},{children:[te&&n.jsx(i.Box,e.__assign({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:n.jsx(v.default,{})})),an.open&&n.jsx(S.default,{open:an.open,anchorEl:an.anchorEl,containerEl:vt.current,clipTopEl:pt.current,scrollContainerEl:qe.current,onClose:Ft,summary:an.summary}),n.jsx(d.default,{open:on.open,anchorEl:on.anchorEl,sectionTitle:on.sectionTitle,referenceSectionTitle:on.refSectionTitle,onClose:pn,onOpenCognitiveCompare:at,onOpenSideBySide:Pt,onConnect:st,isConnected:kt,isOrphan:on.isOrphan}),nn.open&&n.jsx(s.default,{open:nn.open,popupRef:gn,position:ln,popupConfig:U,onClose:function(){un(null),tn(function(n){return e.__assign(e.__assign({},n),{open:!1})}),vn(null)},markdownStyles:W,sectionTitle:nn.sectionTitle,referenceSectionTitle:nn.refSectionTitle,cognitiveData:nn.cognitiveData,anchorEl:nn.anchorEl,sectionAnchorEl:nn.sectionAnchorEl,scrollContainerEl:qe.current,badgeStyle:nn.badgeStyle,docData:nn.docData,deviationData:nn.deviationData,isLoading:nn.isLoading}),n.jsx(i.Snackbar,e.__assign({open:!!ce,autoHideDuration:8e3,onClose:function(){return ae(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(i.Alert,e.__assign({onClose:function(){return ae(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:ce}))})),n.jsx(m.default,{componentHeaderText:V,displayConfig:K,maintainRelativeOrder:$,onToggleView:function(e){ie(!0),setTimeout(function(){ee(!e),et(),dn(),Ee(new Set),Be([]),je.current=[],setTimeout(function(){ie(!1)},400)},50)}}),n.jsx(i.Box,e.__assign({ref:qe,onScroll:wt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:$?"hidden":"auto",borderTop:Un&&Xn?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(i.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},$?{flex:1,minHeight:0}:{})},{children:n.jsxs(i.Box,e.__assign({ref:dt,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},$?{flex:1,overflow:"visible"}:{})},{children:[n.jsxs("svg",e.__assign({ref:Ce,style:{position:"absolute",top:0,left:0,width:Ve.width||"100%",height:Ve.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:xe?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[yt&&n.jsx("g",{children:n.jsx("line",{x1:yt.x1,y1:yt.y,x2:yt.x2,y2:yt.y,stroke:$n.badgeBorder,strokeWidth:"1.5"})}),_t.map(function(t){var l,c,s,d,v,f,p=t.x1+.5*(t.x2-t.x1),h=(t.y1+t.y2)/2;if("Not Defined"===t.style.label&&!t.hasCognitive)return null;if(t.isSubSection?de&&Re===t.subSectionKeyPath&&fe:de&&Re===t.sectionIdx&&fe)return null;if(!$){var x=t.isSubSection?u.getBentArrowPath(t.x1,t.y1,t.x2,t.y2):"M ".concat(t.x1," ").concat(t.y1," L ").concat(t.x2," ").concat(t.y2),_=In[t.sectionIdx]||{title:"",content:""},m=Tn[t.sectionIdx]||{title:"",content:""};if(console.log("Base and Ref Sections for Badge:",_,m),t.isSubSection&&t.subSectionKeyPath){var R=t.subSectionKeyPath.includes(u.DEVIATION_BADGE_SEPARATOR)?t.subSectionKeyPath.split(u.DEVIATION_BADGE_SEPARATOR):[],y=R[2]||t.subSectionKeyPath,S=R[3]||y,A=y.split("-").map(Number),b=S.split("-").map(Number),E=null,I=null;A.length>0&&(E=In[A[0]]),b.length>0&&(I=Tn[b[0]]);var T=(null==E?void 0:E.title)||"",B=(null==I?void 0:I.title)||"";console.log("Root Parent Titles:",T,B);for(var C=1;C<A.length;C++)(null==E?void 0:E.subsections)&&(E=E.subsections[A[C]]);for(C=1;C<b.length;C++)(null==I?void 0:I.subsections)&&(I=I.subsections[b[C]]);E&&(_=e.__assign(e.__assign({},E),{title:T||E.title})),console.log("Base Section for Subsection Badge:",_),I&&(m=e.__assign(e.__assign({},I),{title:B||I.title})),console.log("Ref Section for Subsection Badge:",m)}var D=!(null===(l=_.cognitiveData)||void 0===l?void 0:l.isMissingRationale)||Boolean(null===(s=null===(c=_.cognitiveData)||void 0===c?void 0:c.decisioning)||void 0===s?void 0:s.length),O=(null===(f=null===(v=null===(d=_.evaluationResult)||void 0===d?void 0:d.cognitive_decisioning)||void 0===v?void 0:v.decisioning_factors)||void 0===f?void 0:f.length)||!1,w=D||O;return n.jsxs("g",{children:[n.jsx("path",{d:x,fill:"none",stroke:t.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),n.jsx("foreignObject",e.__assign({x:p-100,y:h-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n.jsxs(i.Box,e.__assign({onClick:function(e){e.stopPropagation(),w&&(nn.open&&cn===t.id?fn():(vn(t.id),ut(lt(e.currentTarget,_,m,t.sectionIdx,t.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:t.style.badgeBg,color:t.style.badgeText,border:"1px solid ".concat(t.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:w?"pointer":"default"}},{children:[t.style.badgeText===a.DEFAULT_DEVIAION_COLOR&&null==t.style.label?n.jsx(g.default,{color:t.style.badgeText}):0===t.style.label?"Same":t.style.label,n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(r.ButtonCognitiveIcon,{})})),w&&n.jsx(o.ChevronDown,{size:11,style:{transform:nn.open&&cn===t.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},t.id)}return null}),Te.map(function(t){var i,o=t.pathD,r=(null===(i=t.style)||void 0===i?void 0:i.badgeBorder)||"#6366F1",l="conn-marker-".concat(t.id),u="".concat(t.id,"-bg"),c="".concat(t.id,"-stroke");return n.jsxs("g",{children:[n.jsx("defs",{children:n.jsx("clipPath",e.__assign({id:"connections-clip"},{children:n.jsx("marker",e.__assign({id:l,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:n.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:r})}))}))}),n.jsx("path",{ref:function(e){we.current[u]=e},d:o,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),n.jsx("path",{ref:function(e){we.current[c]=e},d:o,fill:"none",stroke:r,strokeWidth:"1.75",markerEnd:"url(#".concat(l,")")})]},t.id)})]})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},$?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(i.Box,e.__assign({ref:pt,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:n.jsx(i.Tooltip,e.__assign({title:yn,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:yn}))}))})),n.jsxs(i.Box,e.__assign({ref:Je,onScroll:wt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},$?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:Ue,style:{width:"100%",height:"0px",flexShrink:0}}),wn&&In.map(function(t,r){var l,c,a=!t.title&&!t.content;if($&&a)return null;var s=t,d=bt(r,"left"),v=$?!(null===(l=s.refIndexes)||void 0===l?void 0:l.length)||s.selfIndex<0:!Tn[r],f=$?"number"==typeof s.selfIndex&&s.selfIndex>=0?s.selfIndex+1:null:r+1,p=be.has(r),h=u.extractDeviationScore(s.evaluationResult,null==d?void 0:d.deviationLabel);return n.jsx(i.Box,e.__assign({ref:zn(r),sx:{mb:1,width:"100%"}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:Fn.current[r],sx:e.__assign({width:"100%",display:"flex"},p&&{borderRadius:"6px",outline:"2px solid ".concat((null==d?void 0:d.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:n.jsx(R.default,{section:t,idx:r,columnKey:"left",colRef:zn("left-accordion-".concat(r)),mb:0,treeData:H,proposedSections:In,existingSections:Tn,deviationNumberRegistry:Dn,getSectionCompareStyle:bt,getBadgeRef:Yn,connectedSections:be,openMoreFunctionsPopup:ct,openSummaryPopup:Nt,deviationNodeIdToView:Q,deviationTargetParentId:Ht,parentNodeId:(null===(c=null==H?void 0:H.input_index_map)||void 0===c?void 0:c[0])||"",isExpanded:$?!!tt["left-".concat(r)]:!!tt[String(r)],onToggle:function(){Ft(),rt(r,"left")},navigation:t.id?Lt[t.id]:null,showOpenNodeRef:Vt,resolvedMarkdownStyles:Ge,maintainRelativeOrder:$,renderSubSections:zt})})),$&&d&&n.jsxs(i.Box,e.__assign({ref:Mn.current[r],onClick:function(e){var n=$?Tn.find(function(e){var n;return null===(n=s.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Tn[r]||{title:"",content:""};ct(e,t,v,n,r,d)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:d.badgeBg,color:d.badgeText,border:"1px solid ".concat(d.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!==f&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(d.badgeBorder)}},{children:f})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!K.isLoading||null!=s.evaluationResult&&null!=s.evaluationResult?v?"No Deviation Found":"N/A"===h||"NA"===h?"N/A":0==h||null==h?"Same":"".concat(h):n.jsx(g.default,{color:d.badgeText})})),n.jsx(o.EllipsisVertical,{size:11,color:d.badgeText})]}))]}))}),"left-row-".concat(r))}),n.jsx("div",{ref:Xe,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(i.Box,e.__assign({ref:vt,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(i.Box,e.__assign({onClick:function(n){n.stopPropagation(),nn.open&&cn===Jn?fn():(vn(Jn),ut(lt(n.currentTarget,{title:"",content:"",evaluationResult:Qn,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Jn,!0,e.__assign(e.__assign({},$n),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-5px",borderRadius:"20px",bgcolor:$n.badgeBg,color:$n.badgeText,border:"1px solid ".concat($n.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=Zn?Zn:n.jsx(g.default,{}),n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(r.ButtonCognitiveIcon,{})})),n.jsx(o.ChevronDown,{size:11,style:{transform:nn.open&&cn===Jn?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},$?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[re&&n.jsx(l.default,{sections:11}),n.jsx(i.Box,e.__assign({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:n.jsx(i.Tooltip,e.__assign({title:Sn,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Sn}))}))})),n.jsxs(i.Box,e.__assign({ref:We,onScroll:wt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},$?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-120px",pl:"140px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:Ye,style:{width:"100%",height:"0px",flexShrink:0}}),wn&&Tn.map(function(t,o){var r,l=t,u=[],c=!1,a=null,s=-1;if($){u=In.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=In.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0});var d=In.findIndex(function(e,n){var t;return be.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(c=-1!==d)&&(a=bt(d))}else u=[o+1],(c=be.has(o))&&(a=bt(o));var v=bt($&&-1!==s?s:o);return n.jsx(i.Box,e.__assign({ref:Vn.current[o],sx:{mb:1,width:"100%"}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:kn.current[o],sx:e.__assign({width:"100%",display:"flex"},c&&a&&{borderRadius:"6px",outline:"2px solid ".concat(a.badgeBorder),outlineOffset:"1px"})},{children:n.jsx(R.default,{section:t,idx:o,columnKey:"right",colRef:zn("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==H?void 0:H.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:$?!!tt["right-".concat(o)]:!!tt[String(o)],treeData:H,proposedSections:In,existingSections:Tn,deviationNumberRegistry:Dn,getBadgeRef:Yn,getSectionCompareStyle:bt,connectedSections:be,openMoreFunctionsPopup:ct,openSummaryPopup:Nt,deviationNodeIdToView:Q,deviationTargetParentId:Ht,onToggle:function(){Ft(),rt(o,"right")},navigation:t.id?Lt[t.id]:null,showOpenNodeRef:Vt,resolvedMarkdownStyles:Ge,maintainRelativeOrder:$,renderSubSections:zt})})),$&&v&&n.jsx(i.Box,e.__assign({ref:Ln.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:v.badgeBg,color:v.badgeText,border:"1px solid ".concat(v.badgeBorder),borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:u.length>0?u.join(", "):"-"}))]}))}),"right-row-".concat(o))}),n.jsx("div",{ref:Ke,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("@mui/material"),o=require("lucide-react"),r=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("./OverlayComponent.js"),u=require("./CognitiveComparehelpers.js"),c=require("./CognitiveCompareConfig.js"),a=require("./CognitiveCompareConstants.js"),s=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),v=require("./LoaderComponent.js"),g=require("./components/ThreeDotsLoader.js"),f=require("./hooks/useCompareData.js"),p=require("./hooks/useComparePopups.js"),h=require("./hooks/useSectionRefs.js"),x=require("./hooks/useAccordionState.js"),m=require("./hooks/useDeviationNavigation.js"),_=require("./components/CompareHeader.js"),R=require("./components/SectionAccordion.js"),y=require("./components/SubSectionAccordion.js"),S=require("./components/CognitiveSummaryPopup.js");exports.SHARED_MARKDOWN_STYLES=c.SHARED_MARKDOWN_STYLES,exports.default=function(A){var b,E,I,T,B,C,D,O,w,N,j,P,F,k,M,L=A.componentHeaderText,V=void 0===L?a.DEFAULT_COMPONENT_HEADER_TEXT:L,H=A.treeData,G=A.comparisonConfig,q=A.leftColumnTitleText,z=A.rightColumnTitleText,W=A.markdownStyles,Y=A.displayConfig,K=void 0===Y?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0}:Y,U=A.popupConfig,X=A.deviationData,J=void 0===X?{}:X,Q=A.deviationNodeIdToView,Z=A.resetDeviationNodeId,$=t.useState(K.maintainRelativeOrder),ee=$[0],ne=$[1],te=t.useState(!1),ie=te[0],oe=te[1],re=t.useState(!1),le=re[0],ue=re[1],ce=t.useState(null),ae=ce[0],se=ce[1],de=t.useState(!1),ve=de[0],ge=de[1],fe=t.useState(!1),pe=fe[0],he=fe[1],xe=t.useState(!1),me=xe[0],_e=xe[1],Re=t.useState(null),ye=Re[0],Se=Re[1],Ae=t.useRef(!1),be=t.useState(new Set),Ee=be[0],Ie=be[1],Te=t.useState([]),Be=Te[0],Ce=Te[1],De=t.useRef(null),Oe=t.useRef(!1),we=t.useRef(null),Ne=t.useRef({}),je=t.useRef([]),Pe=t.useRef(!1),Fe=t.useRef(!1),ke=t.useRef(null),Me=t.useRef(function(){}),Le=t.useMemo(function(){return(null==H?void 0:H.cognitive_decisioning)||{}},[H]),Ve=t.useState({width:0,height:0}),He=Ve[0],Ge=Ve[1],qe=t.useMemo(function(){return e.__assign(e.__assign({},c.SHARED_MARKDOWN_STYLES),W)},[W]),ze=t.useRef(null),We=t.useRef(null),Ye=t.useRef(null),Ke=t.useRef(null),Ue=t.useRef(null),Xe=t.useRef(null),Je=t.useRef(null),Qe=t.useRef(null),Ze=t.useRef(!1),$e=t.useRef(null),en=t.useRef(null),nn=p.useComparePopups(ze),tn=nn.cognitivePopup,on=nn.setCognitivePopup,rn=nn.moreFunctions,ln=nn.setMoreFunctions,un=nn.position,cn=nn.setPosition,an=nn.activeBadgeId,sn=nn.summaryPopup,dn=nn.setSummaryPopup,vn=nn.closeSummaryPopup,gn=nn.setActiveBadgeId,fn=nn.popupRef,pn=nn.closeCognitivePopup,hn=nn.closeMoreFunctionsPopup,xn=t.useMemo(function(){var e,n,t,i,o,r,l;return{fields:null!==(e=null==G?void 0:G.fields)&&void 0!==e?e:c.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(t=null===(n=null==G?void 0:G.thresholds)||void 0===n?void 0:n.high)&&void 0!==t?t:c.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(i=null==G?void 0:G.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:c.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==G?void 0:G.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:c.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[G]),mn=t.useState(null),_n=mn[0];mn[1];var Rn=null===(I=null===(b=null==H?void 0:H.documents)||void 0===b?void 0:b[null===(E=null==H?void 0:H.input_index_map)||void 0===E?void 0:E[0]])||void 0===I?void 0:I.title,yn=null===(C=null===(T=null==H?void 0:H.documents)||void 0===T?void 0:T[null===(B=null==H?void 0:H.input_index_map)||void 0===B?void 0:B[1]])||void 0===C?void 0:C.title,Sn=u.safeStringify(q||Rn||"Uploaded Contract"),An=u.safeStringify(z||yn||"Reference Template"),bn=f.useCognitiveTreeData(H,ee,J,xn),En=bn.activeProposed,In=bn.existingRule,Tn=bn.proposedSections,Bn=bn.existingSections,Cn=bn.visibleFields,Dn=bn.parentDeviationRecord,On=bn.deviationNumberRegistry,wn=bn.parseError;t.useEffect(function(){wn&&se("Failed to load comparison: ".concat(wn))},[wn]);var Nn=Tn.length>0||Bn.length>0,jn=h.useSectionRefs(Cn.map(function(e){return e.key}),Math.max(Tn.length,Bn.length)),Pn=jn.leftRefs,Fn=jn.rightRefs,kn=jn.sectionLeftRefs,Mn=jn.sectionRightRefs,Ln=jn.lhsBadgeRefs,Vn=jn.rhsBadgeRefs,Hn=jn.sectionRightRowRefs,Gn=jn.subSectionLeftRefs,qn=jn.subSectionRightRefs,zn=jn.sectionRowRefs,Wn=jn.getSectionRowRef,Yn=jn.getSubSectionRef,Kn=jn.getBadgeRef,Un=In.analysis,Xn=u.safeStringify(null===(O=null===(D=null==Un?void 0:Un.rule_difference_comparison)||void 0===D?void 0:D.summary)||void 0===O?void 0:O.overall_summary),Jn=!!Xn.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Qn=null!==(w=null==H?void 0:H.base_root_id)&&void 0!==w?w:"-1";null==H||H[Qn];var Zn=(null===(N=null==J?void 0:J[Qn])||void 0===N?void 0:N.evaluation_result)||(null===(P=null===(j=null==H?void 0:H.nodes)||void 0===j?void 0:j[Qn])||void 0===P?void 0:P.evaluation_result)||null,$n=u.extractDeviationScore(Zn),et=u.generateColorPalette(null!==(M=null===(k=null===(F=null==Zn?void 0:Zn.evaluation_outputs)||void 0===F?void 0:F.metadata)||void 0===k?void 0:k.label_color)&&void 0!==M?M:""),nt=t.useCallback(function(){var e,n,t,i,o,r;ge(!1),Fe.current=!1;var l=ke.current,c=ft.current;if(null!==l)if("string"==typeof l&&l.includes(u.DEVIATION_BADGE_SEPARATOR)){var a=l.split(u.DEVIATION_BADGE_SEPARATOR);(s=(null===(e=Gn.current[a[2]])||void 0===e?void 0:e.current)||(null===(n=kn.current[Number(a[2])])||void 0===n?void 0:n.current))&&(s.style.paddingTop="0px")}else{var s;(s=null===(t=kn.current[l])||void 0===t?void 0:t.current)&&(s.style.paddingTop="0px")}if(null!==c)if("string"==typeof c&&c.includes(u.DEVIATION_BADGE_SEPARATOR)){a=c.split(u.DEVIATION_BADGE_SEPARATOR);(d=(null===(i=qn.current[a[3]])||void 0===i?void 0:i.current)||(null===(o=Mn.current[Number(a[3])])||void 0===o?void 0:o.current))&&(d.style.paddingTop="0px")}else{var d;(d=null===(r=Mn.current[c])||void 0===r?void 0:r.current)&&(d.style.paddingTop="0px")}Se(null),ke.current=null,ft.current=null,he(!1),ue(!1),Ke.current&&(Ke.current.style.height="0px"),Ue.current&&(Ue.current.style.height="0px"),Xe.current&&(Xe.current.style.height="0px"),Je.current&&(Je.current.style.height="0px")},[]),tt=x.useAccordionState({maintainRelativeOrder:!!ee,proposedSections:Tn,existingSections:Bn,activeSideBySideSection:ye,connectedSections:Ee,resetSideBySide:nt,setConnectedSections:Ie,setConnectedLines:Ce,cachedConnectedPositions:je,svgContainerRef:De,isAnimatingRef:Oe,animationTimerRef:we,calculateLinesRef:Me,sectionLeftRefs:kn,sectionRightRefs:Mn,subSectionLeftRefs:Gn,subSectionRightRefs:qn}),it=tt.expandedSections,ot=tt.expandedSubSections,rt=tt.setExpandedSubSections,lt=tt.toggleSection,ut=t.useCallback(function(e,n,t,i,o,r,l){var c,a,s,d=u.safeStringify(null==n?void 0:n.id)||u.safeStringify(null==t?void 0:t.id)||"",v=(d?Le[d]:null)||(null==n?void 0:n.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:d,decisioning:[],gap:[],relevance_score:0},g=null!==(a=null===(c=zn.current[i])||void 0===c?void 0:c.current)&&void 0!==a?a:null;return{isLoading:null!==(s=null==K?void 0:K.isLoading)&&void 0!==s&&s,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:v,anchorEl:e,sectionAnchorEl:g,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==H?void 0:H.documents,input_index_map:null==H?void 0:H.input_index_map},deviationData:(null==n?void 0:n.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,isOrphan:!!o}},[Le,H]),ct=t.useCallback(function(e){hn(),cn(null),on(e)},[hn]),at=function(e,n,t,i,o,r){var l;if(e.stopPropagation(),rn.open&&rn.sectionIdx===o)hn();else{var c=e.currentTarget,a="left";(null===(l=Ye.current)||void 0===l?void 0:l.contains(c))&&(a="right");Fe.current&&nt(),Ie(new Set),Ce([]),je.current=[],pn(),sn.open?kt():vn(),requestAnimationFrame(function(){var e=function(){var e,n,t,i;if("string"==typeof o&&o.includes(u.DEVIATION_BADGE_SEPARATOR)){var r=o.split(u.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Vn.current[l])||void 0===e?void 0:e.current:null===(n=Ln.current[l])||void 0===n?void 0:n.current}return"right"===a?null===(t=Vn.current[o])||void 0===t?void 0:t.current:null===(i=Ln.current[o])||void 0===i?void 0:i.current}()||c;ln(ut(e,n,i,o,t,r))})}},st=t.useCallback(function(){null!==rn.sectionIdx&&rn.anchorEl?ct(e.__assign(e.__assign({},rn),{open:!0})):hn()},[rn,hn,ct]),dt=t.useCallback(function(){var e=rn.sectionIdx,n=rn.isOrphan;hn(),vn(),null!==e&&(n?se("No counterpart exists to connect to."):(Fe.current&&nt(),Ce([]),je.current=[],Ie(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Me.current&&Me.current()},50)))},[rn.sectionIdx,rn.isOrphan,hn,vn,nt]),vt=t.useRef(null),gt=t.useRef(null),ft=t.useRef(null),pt=t.useRef(null),ht=t.useRef(null),xt=t.useRef(null),mt=t.useState([]),_t=mt[0],Rt=mt[1];t.useRef(null);var yt=t.useState(null),St=yt[0],At=yt[1];t.useEffect(function(){if(_n){var e=xn.fields.find(function(e){return e.analysisKey===_n||e.key===_n});if(e){var n=Pn.current[e.key]||Fn.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[_n,xn.fields]);var bt=t.useCallback(function(e){var n,t,i,o,r,l,u,c,a,s=null===(n=null==Un?void 0:Un.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!s||!s[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=s[e],v=(null==d?void 0:d.relation)||(null===(i=null===(t=null==d?void 0:d.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var g=d.mappings[0]||{};return{score:d.score,relation:g.relation||"",highlightsA:(null===(l=g.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=g.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Un]),Et=t.useCallback(function(n,t){var i,o,r,l,c,s,d;void 0===t&&(t="left");var v=null,g=null;if("left"===t)if(v=Tn[n],ee&&v){var f=Bn.filter(function(e){var n;return null===(n=v.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)});g=f.find(function(e){return e.evaluationResult})||f[0]}else g=Bn[n];else if(g=Bn[n],ee&&g){var p=Tn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(g.selfIndex)});v=p.find(function(e){return e.evaluationResult})||p[0]}else v=Tn[n];var h=(null==v?void 0:v.relation)&&"not_defined"!==v.relation,x=(null==g?void 0:g.relation)&&"not_defined"!==g.relation,m=!(!(null==v?void 0:v.cognitiveData)&&!(null==g?void 0:g.cognitiveData));if(!h&&!x&&!m)return e.__assign(e.__assign({},u.generateColorPalette(a.DEFAULT_DEVIAION_COLOR)),{label:"Not Defined"});var _=null!==(o=null!==(i=null==v?void 0:v.evaluationResult)&&void 0!==i?i:null==g?void 0:g.evaluationResult)&&void 0!==o?o:null,R=null===(r=null==_?void 0:_.evaluation_outputs)||void 0===r?void 0:r.output_value,y=null!==(s=null===(c=null===(l=null==_?void 0:_.evaluation_outputs)||void 0===l?void 0:l.metadata)||void 0===c?void 0:c.label_color)&&void 0!==s?s:a.DEFAULT_DEVIAION_COLOR;return null!=_?e.__assign(e.__assign({},u.generateColorPalette(y)),{label:null!==(d=R)&&void 0!==d?d:""}):e.__assign(e.__assign({},u.generateColorPalette(y)),{label:null})},[Tn,Bn,Le,xn,ee]),It=t.useCallback(function(n){for(var t,i,o,r,l,c,s,d,v,g=n.split("-").map(Number),f=Tn[g[0]],p=Bn[g[0]],h=1;h<g.length;h++)(null==f?void 0:f.subsections)&&(f=f.subsections[g[h]]),(null==p?void 0:p.subsections)&&(p=p.subsections[g[h]]);if(!f&&!p)return null;var x=(null==f?void 0:f.relation)&&"not_defined"!==f.relation,m=(null==p?void 0:p.relation)&&"not_defined"!==p.relation,_=u.safeStringify(null==f?void 0:f.id)||u.safeStringify(null==p?void 0:p.id)||"",R=!(!(null==f?void 0:f.cognitiveData)&&!(null==p?void 0:p.cognitiveData));if(!x&&!m&&!R)return e.__assign(e.__assign({},u.generateColorPalette(a.DEFAULT_DEVIAION_COLOR)),{label:"Not Defined"});null!==(i=null!==(t=null==f?void 0:f.cognitiveRelevanceScore)&&void 0!==t?t:null==p?void 0:p.cognitiveRelevanceScore)&&void 0!==i||_&&(null===(o=Le[_])||void 0===o||o.relevance_score);var y=null!==(l=null!==(r=null==f?void 0:f.evaluationResult)&&void 0!==r?r:null==p?void 0:p.evaluationResult)&&void 0!==l?l:null,S=null===(c=null==y?void 0:y.evaluation_outputs)||void 0===c?void 0:c.output_value,A=null!==(v=null===(d=null===(s=null==y?void 0:y.evaluation_outputs)||void 0===s?void 0:s.metadata)||void 0===d?void 0:d.label_color)&&void 0!==v?v:a.DEFAULT_DEVIAION_COLOR;return null!=y?e.__assign(e.__assign({},u.generateColorPalette(A)),{label:null!=S?S:""}):e.__assign(e.__assign({},u.generateColorPalette(A)),{label:null})},[Tn,Bn,Le,xn]),Tt=t.useCallback(function(){var e,n,t,i,o,r,l,c,a,s,d,v,g,f,p,h,x,m,_,R,y,S;if(!Ze.current&&!Oe.current){Ze.current=!0;try{if(!vt.current)return;var A=function(e){var n=e.split("-"),t=n[0];if(!it[t]&&!1===ee)return!1;if(ee&&!it["left-".concat(t)]&&!it["right-".concat(t)]&&!it[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!ot[i])return!1;return!0},b=vt.current.getBoundingClientRect();Ge({width:b.width,height:b.height});var E=[];if(Cn.forEach(function(e){var n,t,i=e.key,o=null===(n=Pn.current[i])||void 0===n?void 0:n.current,r=null===(t=Fn.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")}),!Oe.current){for(var I=0;I<Math.max(Tn.length,Bn.length);I++){var T=null===(e=kn.current[I])||void 0===e?void 0:e.current,B=null===(n=Mn.current[I])||void 0===n?void 0:n.current;T&&(T.style.height="auto",T.style.minHeight="0px"),B&&(B.style.height="auto",B.style.minHeight="0px")}ee||Object.keys(Gn.current).forEach(function(e){var n,t;if(A(e)){var i=null===(n=Gn.current[e])||void 0===n?void 0:n.current,o=null===(t=qn.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 C={};Cn.forEach(function(e){var n,t,i=e.key,o=null===(n=Pn.current[i])||void 0===n?void 0:n.current,r=null===(t=Fn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),u=r.getBoundingClientRect();C[i]=Math.max(l.height,u.height)}});var D={left:{},right:{}},O={};if(!Oe.current)if(ee){if(ve&&null!==ye)if("number"==typeof ye){var w=ye,N=Tn[w],j=null===(o=kn.current[w])||void 0===o?void 0:o.current;j&&N&&(N.refIndexes||[]).forEach(function(e){var n,t=Bn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=Mn.current[t])||void 0===n?void 0:n.current;if(i&&(it["left-".concat(w)]||it["right-".concat(t)])){var o=Math.max(j.getBoundingClientRect().height,i.getBoundingClientRect().height);D.left[w]=Math.max(D.left[w]||0,o),D.right[t]=Math.max(D.right[t]||0,o)}})}else{var P=ye.split(u.DEVIATION_BADGE_SEPARATOR)[2];if(P){T=null===(r=Gn.current[P])||void 0===r?void 0:r.current,B=null===(l=qn.current[P])||void 0===l?void 0:l.current;if(T&&B){F=Math.max(T.getBoundingClientRect().height,B.getBoundingClientRect().height);O[P]=Math.max(O[P]||0,F)}}}}else{Object.keys(Gn.current).forEach(function(e){var n,t;if(A(e)){var i=null===(n=Gn.current[e])||void 0===n?void 0:n.current,o=null===(t=qn.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(),u=Math.max(r.height,l.height);O[e]=u,i.style.minHeight="".concat(u,"px"),o.style.minHeight="".concat(u,"px")}}});for(I=0;I<Math.min(Tn.length,Bn.length);I++){var T=null===(t=kn.current[I])||void 0===t?void 0:t.current,B=null===(i=Mn.current[I])||void 0===i?void 0:i.current;if(T&&B){var F=Math.max(T.getBoundingClientRect().height,B.getBoundingClientRect().height);D.left[I]=F,D.right[I]=F}}}if(Cn.forEach(function(e){var n,t,i=e.key,o=null===(n=Pn.current[i])||void 0===n?void 0:n.current,r=null===(t=Fn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=C[i];o.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}),Oe.current||(Object.entries(D.left).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=kn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(D.right).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=Mn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),ee||Object.keys(O).forEach(function(e){var n,t,i=null===(n=Gn.current[e])||void 0===n?void 0:n.current,o=null===(t=qn.current[e])||void 0===t?void 0:t.current;if(i&&o&&O[e]){var r=O[e];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),ee)Tn.forEach(function(e,n){var t;(null===(t=kn.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,o,r,l,u,c,a,s,d,v=Bn.findIndex(function(n){return n.selfIndex===e});if(-1!==v){var g=null===(t=Ln.current[n])||void 0===t?void 0:t.current,f=null===(i=Vn.current[v])||void 0===i?void 0:i.current;if(g&&f){var p=g.getBoundingClientRect(),h=f.getBoundingClientRect(),x=p.right-b.left,m=h.left-b.left,_=p.top+p.height/2-b.top,R=h.top+h.height/2-b.top;if(ve&&ye===n){var y=null!==(r=null===(o=Qe.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,S=null!==(u=null===(l=Ye.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==u?u:0,A=y+(null!==(a=null===(c=Qe.current)||void 0===c?void 0:c.clientHeight)&&void 0!==a?a:1/0),I=S+(null!==(d=null===(s=Ye.current)||void 0===s?void 0:s.clientHeight)&&void 0!==d?d:1/0),T=p.top+p.height/2,B=h.top+h.height/2,C=function(e,n,t){return Math.max(n,Math.min(t,e))};_=C(T,y,A)-b.top,R=C(B,S,I)-b.top}var D=Et(n);D&&E.push({id:"line-".concat(n,"-").concat(v),x1:x,y1:_,x2:m,y2:R,style:D,sectionIdx:n,targetRightIdx:v})}}})});else{for(I=0;I<Math.min(Tn.length,Bn.length);I++){var k=null===(c=kn.current[I])||void 0===c?void 0:c.current,M=null===(a=Mn.current[I])||void 0===a?void 0:a.current;if(k&&M){var L=k.getBoundingClientRect(),V=M.getBoundingClientRect(),H=Math.max(L.top,V.top)+18-b.top,G=(null===(s=Bn[I])||void 0===s?void 0:s.id)||"sec-".concat(I);(J=Et(I))&&E.push({id:G,x1:L.right-b.left,y1:H,x2:V.left-b.left,y2:H,style:J,sectionIdx:I,hasCognitive:!!((null===(d=Tn[I])||void 0===d?void 0:d.cognitiveData)||(null===(v=Bn[I])||void 0===v?void 0:v.cognitiveData)||G&&Le[G]),isSubSection:!1})}}Object.keys(Gn.current).forEach(function(e){var n,t,i,o,r,l;if(A(e)){var c=null===(n=Gn.current[e])||void 0===n?void 0:n.current,a=null===(t=qn.current[e])||void 0===t?void 0:t.current;if(c&&a){for(var s=e.split("-").map(Number),d=Tn[s[0]],v=Bn[s[0]],g=1;g<s.length;g++)(null==d?void 0:d.subsections)&&(d=d.subsections[s[g]]),(null==v?void 0:v.subsections)&&(v=v.subsections[s[g]]);var f=!!d&&((null===(i=d.displayTitle)||void 0===i||i)&&u.hasValue(d.title)),p=!!d&&((null===(o=d.displayContent)||void 0===o||o)&&u.hasValue(d.content)),h=!!v&&((null===(r=v.displayTitle)||void 0===r||r)&&u.hasValue(v.title)),x=!!v&&((null===(l=v.displayContent)||void 0===l||l)&&u.hasValue(v.content));if(f&&p||h&&x){var m=c.getBoundingClientRect(),_=a.getBoundingClientRect(),R=Math.max(m.top,_.top)+16-b.top,y=It(e);y&&"Not Defined"!==y.label&&E.push({id:"subsec-".concat(e),x1:m.right-b.left,y1:R,x2:_.left-b.left,y2:R,style:y,sectionIdx:s[0],isSubSection:!0,subSectionKeyPath:e,hasCognitive:!(!(null==d?void 0:d.cognitiveData)&&!(null==v?void 0:v.cognitiveData))})}}}})}if(ve&&"string"==typeof ye&&ye.includes(u.DEVIATION_BADGE_SEPARATOR)){var q=ye.split(u.DEVIATION_BADGE_SEPARATOR),z=q[0],W=q[1],Y=q[2],K=(q[3],"".concat(z).concat(u.DEVIATION_BADGE_SEPARATOR).concat(W)),U=null===(g=Ln.current[K])||void 0===g?void 0:g.current,X=null===(f=Vn.current[K])||void 0===f?void 0:f.current;if(U&&X){var J,Q=U.getBoundingClientRect(),Z=X.getBoundingClientRect(),$=Q.right-b.left,ne=Z.left-b.left,te=Q.top+Q.height/2-b.top,ie=Z.top+Z.height/2-b.top;if(ee){var oe=null!==(h=null===(p=Qe.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==h?h:0,re=null!==(m=null===(x=Ye.current)||void 0===x?void 0:x.getBoundingClientRect().top)&&void 0!==m?m:0,le=oe+(null!==(R=null===(_=Qe.current)||void 0===_?void 0:_.clientHeight)&&void 0!==R?R:1/0),ue=re+(null!==(S=null===(y=Ye.current)||void 0===y?void 0:y.clientHeight)&&void 0!==S?S:1/0),ce=function(e,n,t){return Math.max(n,Math.min(t,e))};te=ce(Q.top+Q.height/2,oe,le)-b.top,ie=ce(Z.top+Z.height/2,re,ue)-b.top}(J=It(Y))&&E.push({id:"line-subsec-".concat(K),x1:$,y1:te,x2:ne,y2:ie,style:J,sectionIdx:Number(Y.split("-")[0]),isSubSection:!0,subSectionKeyPath:ye})}}if(Rt(E),ht.current&&xt.current){var ae=ht.current.getBoundingClientRect(),se=xt.current.getBoundingClientRect(),de=(ae.top+ae.height/2-b.top+se.top+se.height/2-b.top)/2;At({x1:ae.right-b.left,x2:se.left-b.left,y:de})}else At(null);if(Ee.size>0){var ge=[],fe=Qe.current,pe=Ye.current;if(fe&&pe){var he=[],xe=fe.getBoundingClientRect().top,me=pe.getBoundingClientRect().top,_e=xe+fe.clientHeight,Re=me+pe.clientHeight,Se=fe.scrollTop,Ae=pe.scrollTop,be=b.top,Ie=function(e,n,t){return Math.max(n,Math.min(t,e))};Ee.forEach(function(e){var n,t,i,o,r;if("string"==typeof e&&e.includes(u.DEVIATION_BADGE_SEPARATOR)){var l=e.split(u.DEVIATION_BADGE_SEPARATOR),c=l[0],a=l[1],s=l[2],d=(l[3],"".concat(c).concat(u.DEVIATION_BADGE_SEPARATOR).concat(a)),v=null===(n=Ln.current[d])||void 0===n?void 0:n.current,g=null===(t=Vn.current[d])||void 0===t?void 0:t.current;if(!v||!g)return;var f=v.getBoundingClientRect(),p=g.getBoundingClientRect(),h=It(s),x=(j=f.right-b.left)+.5*((P=p.left-b.left-0)-j),m=f.top+f.height/2,_=p.top+p.height/2,R=m-xe+Se,y=_-me+Ae,S="conn-subsec-".concat(d);he.push({lhsScrollY:R,rhsScrollY:y,x1:j,x2:P,containerTop:be,leftIdx:e,rhsArrayIdx:e,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:S});var A=Ie(m,xe,_e),E=Ie(_,me,Re),I=A-be,T=E-be,B=_>=me-4&&_<=Re+4,C="";C=(F=m>=xe-4&&m<=_e+4)&&B?u.getBentArrowPath(j,I,P,T):F&&!B?"M ".concat(j,",").concat(I," L ").concat(x,",").concat(I," L ").concat(x,",").concat(T):!F&&B?"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T," L ").concat(P,",").concat(T):"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T),ge.push({id:S,pathD:C,style:h,leftIdx:e,rhsArrayIdx:e})}else if(ee){var D=e,O=Tn[D];if(!(null===(r=null==O?void 0:O.refIndexes)||void 0===r?void 0:r.length))return;O.refIndexes.forEach(function(e){var n,t,i=Bn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=Ln.current[D])||void 0===n?void 0:n.current,r=null===(t=Vn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect(),a=Et(D),s=l.right-b.left,d=c.left-b.left-0,v=s+.5*(d-s),g=l.top+l.height/2,f=c.top+c.height/2,p=g-xe+Se,h=f-me+Ae,x="conn-".concat(D,"-").concat(i);he.push({lhsScrollY:p,rhsScrollY:h,x1:s,x2:d,containerTop:be,leftIdx:D,rhsArrayIdx:i,styleColor:(null==a?void 0:a.badgeBorder)||"#6366F1",styleId:x});var m=Ie(g,xe,_e),_=Ie(f,me,Re),R=m-be,y=_-be,S=g>=xe-4&&g<=_e+4,A=f>=me-4&&f<=Re+4,E="";E=S&&A?u.getBentArrowPath(s,R,d,y):S&&!A?"M ".concat(s,",").concat(R," L ").concat(v,",").concat(R," L ").concat(v,",").concat(y):!S&&A?"M ".concat(v,",").concat(R," L ").concat(v,",").concat(y," L ").concat(d,",").concat(y):"M ".concat(v,",").concat(R," L ").concat(v,",").concat(y),ge.push({id:x,pathD:E,style:a,leftIdx:D,rhsArrayIdx:i})}}})}else{var w=e,N=w;v=null===(i=Ln.current[w])||void 0===i?void 0:i.current,g=null===(o=Vn.current[N])||void 0===o?void 0:o.current;if(!v||!g)return;var j,P;f=v.getBoundingClientRect(),p=g.getBoundingClientRect(),h=Et(w),x=(j=f.right-b.left)+.5*((P=p.left-b.left-0)-j),m=f.top+f.height/2,_=p.top+p.height/2,R=m-xe+Se,y=_-me+Ae,S="conn-".concat(w,"-").concat(N);he.push({lhsScrollY:R,rhsScrollY:y,x1:j,x2:P,containerTop:be,leftIdx:w,rhsArrayIdx:N,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:S});var F;A=Ie(m,xe,_e),E=Ie(_,me,Re),I=A-be,T=E-be,B=_>=me-4&&_<=Re+4,C="";C=(F=m>=xe-4&&m<=_e+4)&&B?u.getBentArrowPath(j,I,P,T):F&&!B?"M ".concat(j,",").concat(I," L ").concat(x,",").concat(I," L ").concat(x,",").concat(T):!F&&B?"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T," L ").concat(P,",").concat(T):"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T),ge.push({id:S,pathD:C,style:h,leftIdx:w,rhsArrayIdx:N})}}),je.current=he}Ce(ge)}else Ce([]),je.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{Ze.current=!1}}},[Cn,Tn,Bn,Le,xn,bt,Et,ee,ve,ye,Ee,it,ot]),Bt=t.useCallback(function(){var e,n,t,i,o,r,l,c,a,s,d,v,g,f,p=je.current;if(p.length&&!Oe.current){var h=null!==(n=null===(e=Qe.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,x=null!==(i=null===(t=Ye.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,m=null!==(r=null===(o=Qe.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,_=null!==(c=null===(l=Ye.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,R=null!==(s=null===(a=Qe.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==s?s:0,y=null!==(v=null===(d=Ye.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==v?v:0,S=R+m,A=y+_,b=null!==(f=null===(g=vt.current)||void 0===g?void 0:g.getBoundingClientRect().top)&&void 0!==f?f:0,E=function(e,n,t){return Math.max(n,Math.min(t,e))};p.forEach(function(e){var n=e.lhsScrollY-h+R,t=e.rhsScrollY-x+y,i=Ne.current[e.styleId+"-stroke"],o=Ne.current[e.styleId+"-bg"];if(i||o){var r,l=E(n,R,S),c=E(t,y,A),a=l-b,s=c-b,d=n>=R-4&&n<=S+4,v=t>=y-4&&t<=A+4,g=e.x1+.5*(e.x2-e.x1);r=d&&v?u.getBentArrowPath(e.x1,a,e.x2,s):d&&!v?"M ".concat(e.x1,",").concat(a," L ").concat(g,",").concat(a," L ").concat(g,",").concat(s):!d&&v?"M ".concat(g,",").concat(a," L ").concat(g,",").concat(s," L ").concat(e.x2,",").concat(s):"M ".concat(g,",").concat(a," L ").concat(g,",").concat(s),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);t.useEffect(function(){Me.current=Tt},[Tt]);var Ct=t.useRef(null),Dt=t.useRef(null),Ot=t.useCallback(function(){je.current.length>0&&!Oe.current||(null!==Ct.current&&clearTimeout(Ct.current),Ct.current=setTimeout(function(){Me.current(),Ct.current=null},50))},[]),wt=t.useCallback(function(){_e(!0),he(!1),null!==Dt.current&&clearTimeout(Dt.current),null!==Ct.current&&(clearTimeout(Ct.current),Ct.current=null),Dt.current=setTimeout(function(){var e,n,t,i,o,r,l,c,a,s;if(je.current=[],Fe.current&&null!==ke.current&&null!==ft.current){var d=ke.current,v=ft.current,g=null,f=null,p=null,h=null;if("string"==typeof d&&d.includes(u.DEVIATION_BADGE_SEPARATOR)){var x=d.split(u.DEVIATION_BADGE_SEPARATOR),m="".concat(x[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(x[1]);g=(null===(e=Ln.current[m])||void 0===e?void 0:e.current)||null,f=(null===(n=Vn.current[m])||void 0===n?void 0:n.current)||null,p=(null===(t=Gn.current[x[2]])||void 0===t?void 0:t.current)||(null===(i=kn.current[Number(x[2])])||void 0===i?void 0:i.current)||null,h=(null===(o=qn.current[x[3]])||void 0===o?void 0:o.current)||(null===(r=Mn.current[Number(x[3])])||void 0===r?void 0:r.current)||null}else g=(null===(l=zn.current[d])||void 0===l?void 0:l.current)||null,p=(null===(c=kn.current[d])||void 0===c?void 0:c.current)||null,f=(null===(a=Hn.current[v])||void 0===a?void 0:a.current)||null,h=(null===(s=Mn.current[v])||void 0===s?void 0:s.current)||null;if(g&&f&&p&&h){if(p.style.paddingTop="0px",h.style.paddingTop="0px",!ee){var _=g.getBoundingClientRect(),R=f.getBoundingClientRect(),y=_.top-R.top;y>0?h.style.paddingTop="".concat(y,"px"):y<0&&(p.style.paddingTop="".concat(Math.abs(y),"px"))}var S=Qe.current,A=Ye.current;if(S&&A){var b=g.getBoundingClientRect().top-S.getBoundingClientRect().top+S.scrollTop,E=f.getBoundingClientRect().top-A.getBoundingClientRect().top+A.scrollTop-(b-S.scrollTop);Math.abs(A.scrollTop-E)>1&&(A.scrollTop=E)}}}Me.current(),Fe.current&&he(!0),_e(!1),Dt.current=null},150)},[ee,Tn,Bn]),Nt=t.useCallback(function(e){var n,t,i,o,r,l,c,a,s,d;if(null!==$e.current&&en.current&&Math.abs(e.currentTarget.scrollTop-$e.current)<=2){var v=en.current;$e.current=null,en.current=null,v()}if(!Ae.current){if(ee||Ot(),Fe.current){var g=ke.current,f=ft.current,p=Qe.current,h=Ye.current;if(null!==g&&null!==f&&p&&h){var x="string"==typeof g&&g.includes(u.DEVIATION_BADGE_SEPARATOR)?null===(n=Ln.current["".concat(g.split(u.DEVIATION_BADGE_SEPARATOR)[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(g.split(u.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===n?void 0:n.current:null===(t=zn.current[g])||void 0===t?void 0:t.current,m="string"==typeof f&&f.includes(u.DEVIATION_BADGE_SEPARATOR)?null===(i=Vn.current["".concat(f.split(u.DEVIATION_BADGE_SEPARATOR)[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(f.split(u.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===i?void 0:i.current:null===(o=Hn.current[f])||void 0===o?void 0:o.current;if(x&&m&&pt.current){var _=void 0,R=void 0;if("string"==typeof g&&g.includes(u.DEVIATION_BADGE_SEPARATOR)){var y=g.split(u.DEVIATION_BADGE_SEPARATOR),S="".concat(y[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(y[1]);_=null===(r=Ln.current[S])||void 0===r?void 0:r.current,R=null===(l=Vn.current[S])||void 0===l?void 0:l.current}else _=null===(c=Ln.current[g])||void 0===c?void 0:c.current,R=null===(a=Vn.current[f])||void 0===a?void 0:a.current;var A=null!==(d=null===(s=vt.current)||void 0===s?void 0:s.getBoundingClientRect().top)&&void 0!==d?d:0,b=p.getBoundingClientRect().top,E=b+p.clientHeight;h.getBoundingClientRect().top;h.clientHeight;if(_&&R){var I=_.getBoundingClientRect(),T=R.getBoundingClientRect(),B=I.top+I.height/2;T.top,T.height;var C=((O=B,w=b,N=E,Math.max(w,Math.min(N,O)))-A).toString();pt.current.setAttribute("y1",C),pt.current.setAttribute("y2",C);var D=B>=b-4&&B<=E+4;pt.current.setAttribute("visibility",D?"visible":"hidden")}}}}var O,w,N;je.current.length>0&&!Pe.current&&(Pe.current=!0,requestAnimationFrame(function(){Bt(),Pe.current=!1}))}},[Bt,ee,Ot]);t.useEffect(function(){var e=setTimeout(Ot,250);window.addEventListener("resize",wt);var n=null,t=null;return ze.current&&(n=new ResizeObserver(Ot)).observe(ze.current),vt.current&&(t=new ResizeObserver(Ot)).observe(vt.current),function(){clearTimeout(e),null!==Ct.current&&clearTimeout(Ct.current),null!==Dt.current&&clearTimeout(Dt.current),window.removeEventListener("resize",wt),null==n||n.disconnect(),null==t||t.disconnect()}},[En,In,Un,Cn,it,ot,Tn,Bn,xn,Ot,wt,ve,ye,pe,Ee]),t.useEffect(function(){Fe.current=ve},[ve]),t.useEffect(function(){ke.current=ye},[ye]);var jt=t.useCallback(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?se("No counterpart exists for this section."):ve&&ye===e?r?nt():null==l||l():(Ie(new Set([e])),Ce([]),je.current=[],ue(!0),Ae.current=!0,Se(e),ke.current=e,ge(!0),Fe.current=!0,he(!1),Ke.current&&(Ke.current.style.height="0px"),Ue.current&&(Ue.current.style.height="0px"),Xe.current&&(Xe.current.style.height="0px"),Je.current&&(Je.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i,o,r,a="string"==typeof e&&e.includes(u.DEVIATION_BADGE_SEPARATOR),s=null,d=null,v=null;if(a){var g=e.split(u.DEVIATION_BADGE_SEPARATOR),f="".concat(g[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(g[1]);s=(null===(n=Ln.current[f])||void 0===n?void 0:n.current)||null,d=(null===(t=Vn.current[f])||void 0===t?void 0:t.current)||null,v=d?e:null}else if(s=(null===(i=zn.current[e])||void 0===i?void 0:i.current)||null,ee){var p=Tn[e],h=(null==p?void 0:p.refIndexes)||[];if(h.length>0){var x=h[0],m=Bn.findIndex(function(e){return e.selfIndex===x});-1!==m&&(d=(null===(r=Hn.current[m])||void 0===r?void 0:r.current)||null,v=m)}}else d=(null===(o=Hn.current[e])||void 0===o?void 0:o.current)||null,v=d?e:null;ft.current=v;var _=Qe.current,R=Ye.current,y=function(){!function(){var n,t,i,o,r,l,c,s,d,g,f,p,h=null,x=null,m=null,_=null;if(a){var R=e.split(u.DEVIATION_BADGE_SEPARATOR),y="".concat(R[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(R[1]);h=(null===(n=Gn.current[R[2]])||void 0===n?void 0:n.current)||(null===(t=kn.current[Number(R[2])])||void 0===t?void 0:t.current)||null,x=(null===(i=qn.current[R[3]])||void 0===i?void 0:i.current)||(null===(o=Mn.current[Number(R[3])])||void 0===o?void 0:o.current)||null,m=(null===(r=Ln.current[y])||void 0===r?void 0:r.current)||h,_=(null===(l=Vn.current[y])||void 0===l?void 0:l.current)||x}else{var S=Number(e),A=null!==v?Number(v):S;h=(null===(c=kn.current[S])||void 0===c?void 0:c.current)||null,x=(null===(s=Mn.current[A])||void 0===s?void 0:s.current)||null,m=(null===(d=Ln.current[S])||void 0===d?void 0:d.current)||(null===(g=zn.current[S])||void 0===g?void 0:g.current)||h,_=(null===(f=Vn.current[A])||void 0===f?void 0:f.current)||(null===(p=Hn.current[A])||void 0===p?void 0:p.current)||x}if(m&&_&&h&&x){h.style.paddingTop="0px",x.style.paddingTop="0px";var b=m.getBoundingClientRect(),E=_.getBoundingClientRect(),I=b.top-E.top;I>0?x.style.paddingTop="".concat(I,"px"):I<0&&(h.style.paddingTop="".concat(Math.abs(I),"px"))}}(),he(!0),Me.current&&Me.current(),Ae.current=!1,"right"===c&&R?R.dispatchEvent(new Event("scroll")):_&&_.dispatchEvent(new Event("scroll")),ue(!1),null==l||l()};if(!s||!_)return Ae.current=!1,ue(!1),void(null==l||l());if(d&&R){if(!ee){var S=0;S="right"===c?d?d.getBoundingClientRect().top:0:s?s.getBoundingClientRect().top:0;var A=ze.current,b=(null==A?void 0:A.getBoundingClientRect().top)||0,E=A?A.scrollTop+S-b-150:0;return A?void u.smoothScrollTo(A,E,200,y):void y()}var I=s.getBoundingClientRect().top-_.getBoundingClientRect().top+_.scrollTop,T=d.getBoundingClientRect().top-R.getBoundingClientRect().top+R.scrollTop,B=200;if("left"===c){var C=T-(I-_.scrollTop);C<0&&Ke.current&&(Ke.current.style.height="".concat(Math.abs(C),"px")),requestAnimationFrame(function(){var e,n=R.scrollHeight-R.clientHeight;if(C<0)e=0;else{if(C>n){var t=C-n;return Ue.current&&(Ue.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){u.smoothScrollTo(R,C,B,y)})}e=C}u.smoothScrollTo(R,e,B,y)})}else{var D=I-(T-R.scrollTop);D<0&&Xe.current&&(Xe.current.style.height="".concat(Math.abs(D),"px")),requestAnimationFrame(function(){var e,n=_.scrollHeight-_.clientHeight;if(D<0)e=0;else{if(D>n){var t=D-n;return Je.current&&(Je.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){u.smoothScrollTo(_,D,B,y)})}e=D}u.smoothScrollTo(_,e,B,y)})}}else y()})))},[ye,hn,Bn,ve,ee,Tn,nt]),Pt=t.useCallback(function(e,n,t,i){var o,r="string"==typeof i?u.safeStringify(i).trim():u.safeStringify(null==i?void 0:i.deviation_summary).trim(),l=e.currentTarget;pn();var c="left";(null===(o=Ye.current)||void 0===o?void 0:o.contains(l))&&(c="right");var a=function(){var e,t,i,o;if("string"==typeof n&&n.includes(u.DEVIATION_BADGE_SEPARATOR)){var r=n.split(u.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===c?null===(e=Vn.current[l])||void 0===e?void 0:e.current:null===(t=Ln.current[l])||void 0===t?void 0:t.current}return"right"===c?null===(i=Vn.current[n])||void 0===i?void 0:i.current:null===(o=Ln.current[n])||void 0===o?void 0:o.current};if(t)return nt(),Ie(new Set),Ce([]),je.current=[],void(r&&requestAnimationFrame(function(){var e=a()||l;dn({open:!0,anchorEl:e,summary:i})}));jt(n,t,r?{toggleIfSame:!1,sourceSide:c,onReady:function(){var e=a()||l;dn({open:!0,anchorEl:e,summary:i})}}:{toggleIfSame:!1,sourceSide:c})},[jt,pn,dn,nt]),Ft=t.useCallback(function(){var e,n=rn.sectionIdx,t=rn.isOrphan;if(vn(),null!=n){var i="left";rn.anchorEl&&(null===(e=Ye.current)||void 0===e?void 0:e.contains(rn.anchorEl))&&(i="right"),jt(n,t,{sourceSide:i})}},[jt,rn.isOrphan,rn.sectionIdx,rn.anchorEl,vn]),kt=t.useCallback(function(){vn(),nt(),Ie(new Set),Ce([]),je.current=[]},[vn,nt]),Mt=null!==rn.sectionIdx&&Ee.has(rn.sectionIdx),Lt=m.useDeviationNavigation({proposedSections:Tn,existingSections:Bn,parentDeviationRecord:Dn,expandedSections:it,maintainRelativeOrder:!!ee,scrollContainerRef:ze,leftContainerRef:Qe,lhsBadgeRefs:Ln,rhsBadgeRefs:Vn}),Vt=Lt.showDeviationNavigation,Ht=Lt.showOpenNodeRef,Gt=t.useMemo(function(){if(!Q)return null;for(var e in Dn){if((Dn[e]||[]).some(function(e){return e.id===Q}))return e}return null},[Q,Dn]),qt=t.useRef(null),zt=t.useRef(null);t.useEffect(function(){if(Q&&qt.current!==Q){zt.current!==Q&&(vn(),pn(),nt(),Ie(new Set),Ce([]),je.current=[],zt.current=Q);var n=!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,a,s,d;if(!n){var v=null,g=null;for(var f in Dn){var p=Dn[f].find(function(e){return e.id===Q});if(p){v=f,g=p;break}}if(g&&v){var h=Tn.findIndex(function(e){return e.id===v}),x=Bn.findIndex(function(e){return e.id===v}),m=-1===h&&-1!==x;if(m){if(!(ee?!!it["right-".concat(x)]:!!it[String(x)]))return lt(x,"right"),t+=1,void(i=setTimeout(l,450))}else if(!(ee?!!it["left-".concat(h)]:!!it[String(h)])&&h>=0)return lt(h,"left"),t+=1,void(i=setTimeout(l,450));var _=r(Tn,g.id),R=r(Bn,g.id);if(_&&!R&&!m){var y=_.split("-"),S=Number(y[0]);if(ee){var A=null===(a=null===(c=Tn[S])||void 0===c?void 0:c.refIndexes)||void 0===a?void 0:a[0],b=Bn.findIndex(function(e){return e.selfIndex===A});-1!==b&&(S=b)}R=e.__spreadArray([S],y.slice(1),!0).join("-")}if(_||R){var E,I=_||"",T=R||"",B="".concat(g.id).concat(u.DEVIATION_BADGE_SEPARATOR,"0").concat(u.DEVIATION_BADGE_SEPARATOR).concat(I).concat(u.DEVIATION_BADGE_SEPARATOR).concat(T),C="".concat(g.id).concat(u.DEVIATION_BADGE_SEPARATOR,"0"),D=null===(s=Ln.current[C])||void 0===s?void 0:s.current,O=null===(d=Vn.current[C])||void 0===d?void 0:d.current,w=m?O:D;if(E=ee?m?Ye.current:Qe.current:ze.current,w&&E){var N=w.getBoundingClientRect();if(0===N.height)return void((t+=1)<20&&(i=setTimeout(l,o)));var j=E.getBoundingClientRect(),P=N.top-j.top+E.scrollTop-j.height/2+N.height/2,F=function(){var e,t,i,o,r;if(!n){qt.current=Q;var l=window.getComputedStyle(w).color;D&&(D.style.transition="box-shadow 300ms ease-in-out",D.style.boxShadow="0 0 10px ".concat(l)),O&&(O.style.transition="box-shadow 300ms ease-in-out",O.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){D&&(D.style.boxShadow=""),O&&(O.style.boxShadow="")},2e3);var u=(null===(t=null===(e=g.evaluationResult)||void 0===e?void 0:e.deviations)||void 0===t?void 0:t[0])||g,c=(null===(i=g.evaluationResult)||void 0===i?void 0:i.evaluation_outputs)||g.evaluation_outputs;if(!(D&&O&&!m)){var a=m?(null===(o=Vn.current[C])||void 0===o?void 0:o.current)||O:(null===(r=Ln.current[C])||void 0===r?void 0:r.current)||D;return dn({open:!0,anchorEl:a,summary:{deviation_summary:u.deviation_summary||u,evaluation_outputs:c}}),void(null==Z||Z())}jt(B,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var e,n=(null===(e=Ln.current[C])||void 0===e?void 0:e.current)||D;dn({open:!0,anchorEl:n,summary:{deviation_summary:u.deviation_summary||u,evaluation_outputs:c}})}})}};Math.abs(E.scrollTop-P)<=2?F():($e.current=P,en.current=F,E.scrollTo({top:P,behavior:"smooth"}),i&&clearTimeout(i),i=setTimeout(function(){if(en.current){$e.current=null;var e=en.current;en.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(){n=!0,i&&clearTimeout(i)}}},[Q,Dn,Tn,Bn,ee,it,lt,jt,dn]);var Wt=function(e){var t=e.section,i=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,u=void 0===l?"left":l,c=e.parentNodeId,a=void 0===c?"":c;return n.jsx(y.default,{section:t,keyPath:i,depth:r,columnKey:u,parentNodeId:a,expandedSubSections:ot,setExpandedSubSections:rt,maintainRelativeOrder:ee||!1,proposedSections:Tn,existingSections:Bn,treeData:H,deviationNumberRegistry:On,connectedSections:Ee,activeSideBySideSection:ye,resolvedMarkdownStyles:qe,getSubSectionRef:Yn,getSubSectionCompareStyle:It,getBadgeRef:Kn,openMoreFunctionsPopup:at,openSummaryPopup:Pt,resetSideBySide:nt,setConnectedSections:Ie,setConnectedLines:Ce,cachedConnectedPositions:je})};return n.jsxs(i.Box,e.__assign({ref:We,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},ee?{}:{overflow:"visible"}),{position:"relative"})},{children:[ie&&n.jsx(i.Box,e.__assign({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:n.jsx(v.default,{})})),sn.open&&n.jsx(S.default,{open:sn.open,anchorEl:sn.anchorEl,containerEl:gt.current,clipTopEl:ht.current,scrollContainerEl:ze.current,onClose:kt,summary:sn.summary}),n.jsx(d.default,{open:rn.open,anchorEl:rn.anchorEl,sectionTitle:rn.sectionTitle,referenceSectionTitle:rn.refSectionTitle,onClose:hn,onOpenCognitiveCompare:st,onOpenSideBySide:Ft,onConnect:dt,isConnected:Mt,isOrphan:rn.isOrphan}),tn.open&&n.jsx(s.default,{open:tn.open,popupRef:fn,position:un,popupConfig:U,onClose:function(){cn(null),on(function(n){return e.__assign(e.__assign({},n),{open:!1})}),gn(null)},markdownStyles:W,sectionTitle:tn.sectionTitle,referenceSectionTitle:tn.refSectionTitle,cognitiveData:tn.cognitiveData,anchorEl:tn.anchorEl,sectionAnchorEl:tn.sectionAnchorEl,scrollContainerEl:ze.current,badgeStyle:tn.badgeStyle,docData:tn.docData,deviationData:tn.deviationData,isLoading:tn.isLoading}),n.jsx(i.Snackbar,e.__assign({open:!!ae,autoHideDuration:8e3,onClose:function(){return se(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(i.Alert,e.__assign({onClose:function(){return se(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:ae}))})),n.jsx(_.default,{componentHeaderText:V,displayConfig:K,maintainRelativeOrder:ee,onToggleView:function(e){oe(!0),setTimeout(function(){ne(!e),nt(),vn(),Ie(new Set),Ce([]),je.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){oe(!1)},600)})})},50)}}),n.jsx(i.Box,e.__assign({ref:ze,onScroll:Nt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:ee?"hidden":"auto",borderTop:Xn&&Jn?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(i.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},ee?{flex:1,minHeight:0}:{})},{children:n.jsxs(i.Box,e.__assign({ref:vt,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},ee?{flex:1,overflow:"visible"}:{})},{children:[n.jsxs("svg",e.__assign({ref:De,style:{position:"absolute",top:0,left:0,width:He.width||"100%",height:He.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:me?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[St&&n.jsx("g",{children:n.jsx("line",{x1:St.x1,y1:St.y,x2:St.x2,y2:St.y,stroke:et.badgeBorder,strokeWidth:"1.5"})}),_t.map(function(t){var l,c,s,d,v,f,p=t.x1+.5*(t.x2-t.x1),h=(t.y1+t.y2)/2;if("Not Defined"===t.style.label&&!t.hasCognitive)return null;if(t.isSubSection?ve&&ye===t.subSectionKeyPath&&pe:ve&&ye===t.sectionIdx&&pe)return null;if(!ee){var x=t.isSubSection?u.getBentArrowPath(t.x1,t.y1,t.x2,t.y2):"M ".concat(t.x1," ").concat(t.y1," L ").concat(t.x2," ").concat(t.y2),m=Tn[t.sectionIdx]||{title:"",content:""},_=Bn[t.sectionIdx]||{title:"",content:""};if(console.log("Base and Ref Sections for Badge:",m,_),t.isSubSection&&t.subSectionKeyPath){var R=t.subSectionKeyPath.includes(u.DEVIATION_BADGE_SEPARATOR)?t.subSectionKeyPath.split(u.DEVIATION_BADGE_SEPARATOR):[],y=R[2]||t.subSectionKeyPath,S=R[3]||y,A=y.split("-").map(Number),b=S.split("-").map(Number),E=null,I=null;A.length>0&&(E=Tn[A[0]]),b.length>0&&(I=Bn[b[0]]);var T=(null==E?void 0:E.title)||"",B=(null==I?void 0:I.title)||"";console.log("Root Parent Titles:",T,B);for(var C=1;C<A.length;C++)(null==E?void 0:E.subsections)&&(E=E.subsections[A[C]]);for(C=1;C<b.length;C++)(null==I?void 0:I.subsections)&&(I=I.subsections[b[C]]);E&&(m=e.__assign(e.__assign({},E),{title:T||E.title})),console.log("Base Section for Subsection Badge:",m),I&&(_=e.__assign(e.__assign({},I),{title:B||I.title})),console.log("Ref Section for Subsection Badge:",_)}var D=!(null===(l=m.cognitiveData)||void 0===l?void 0:l.isMissingRationale)||Boolean(null===(s=null===(c=m.cognitiveData)||void 0===c?void 0:c.decisioning)||void 0===s?void 0:s.length),O=(null===(f=null===(v=null===(d=m.evaluationResult)||void 0===d?void 0:d.cognitive_decisioning)||void 0===v?void 0:v.decisioning_factors)||void 0===f?void 0:f.length)||!1,w=D||O;return n.jsxs("g",{children:[n.jsx("path",{d:x,fill:"none",stroke:t.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),n.jsx("foreignObject",e.__assign({x:p-100,y:h-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n.jsxs(i.Box,e.__assign({onClick:function(e){e.stopPropagation(),w&&(tn.open&&an===t.id?pn():(gn(t.id),ct(ut(e.currentTarget,m,_,t.sectionIdx,t.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:t.style.badgeBg,color:t.style.badgeText,border:"1px solid ".concat(t.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:w?"pointer":"default"}},{children:[t.style.badgeText===a.DEFAULT_DEVIAION_COLOR&&null==t.style.label?n.jsx(g.default,{color:t.style.badgeText}):0===t.style.label?"Same":t.style.label,n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(r.ButtonCognitiveIcon,{})})),w&&n.jsx(o.ChevronDown,{size:11,style:{transform:tn.open&&an===t.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},t.id)}return null}),Be.map(function(t){var i,o=t.pathD,r=(null===(i=t.style)||void 0===i?void 0:i.badgeBorder)||"#6366F1",l="conn-marker-".concat(t.id),u="".concat(t.id,"-bg"),c="".concat(t.id,"-stroke");return n.jsxs("g",{children:[n.jsx("defs",{children:n.jsx("clipPath",e.__assign({id:"connections-clip"},{children:n.jsx("marker",e.__assign({id:l,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:n.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:r})}))}))}),n.jsx("path",{ref:function(e){Ne.current[u]=e},d:o,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),n.jsx("path",{ref:function(e){Ne.current[c]=e},d:o,fill:"none",stroke:r,strokeWidth:"1.75",markerEnd:"url(#".concat(l,")")})]},t.id)})]})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},ee?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(i.Box,e.__assign({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:n.jsx(i.Tooltip,e.__assign({title:Sn,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Sn}))}))})),n.jsxs(i.Box,e.__assign({ref:Qe,onScroll:Nt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},ee?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:Xe,style:{width:"100%",height:"0px",flexShrink:0}}),Nn&&Tn.map(function(t,r){var l,c,a=!t.title&&!t.content;if(ee&&a)return null;var s=t,d=Et(r,"left"),v=ee?!(null===(l=s.refIndexes)||void 0===l?void 0:l.length)||s.selfIndex<0:!Bn[r],f=ee?"number"==typeof s.selfIndex&&s.selfIndex>=0?s.selfIndex+1:null:r+1,p=Ee.has(r),h=u.extractDeviationScore(s.evaluationResult,null==d?void 0:d.deviationLabel);return n.jsx(i.Box,e.__assign({ref:Wn(r),sx:{mb:1,width:"100%"}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:kn.current[r],sx:e.__assign({width:"100%",display:"flex"},p&&{borderRadius:"6px",outline:"2px solid ".concat((null==d?void 0:d.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:n.jsx(R.default,{section:t,idx:r,columnKey:"left",colRef:Wn("left-accordion-".concat(r)),mb:0,treeData:H,proposedSections:Tn,existingSections:Bn,deviationNumberRegistry:On,getSectionCompareStyle:Et,getBadgeRef:Kn,connectedSections:Ee,openMoreFunctionsPopup:at,openSummaryPopup:Pt,deviationNodeIdToView:Q,deviationTargetParentId:Gt,parentNodeId:(null===(c=null==H?void 0:H.input_index_map)||void 0===c?void 0:c[0])||"",isExpanded:ee?!!it["left-".concat(r)]:!!it[String(r)],onToggle:function(){kt(),lt(r,"left")},navigation:t.id?Vt[t.id]:null,showOpenNodeRef:Ht,resolvedMarkdownStyles:qe,maintainRelativeOrder:ee,renderSubSections:Wt})})),ee&&d&&n.jsxs(i.Box,e.__assign({ref:Ln.current[r],onClick:function(e){var n=ee?Bn.find(function(e){var n;return null===(n=s.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Bn[r]||{title:"",content:""};at(e,t,v,n,r,d)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:d.badgeBg,color:d.badgeText,border:"1px solid ".concat(d.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!==f&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(d.badgeBorder)}},{children:f})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!K.isLoading||null!=s.evaluationResult&&null!=s.evaluationResult?v?"No Deviation Found":"N/A"===h||"NA"===h?"N/A":0==h||null==h?"Same":"".concat(h):n.jsx(g.default,{color:d.badgeText})})),n.jsx(o.EllipsisVertical,{size:11,color:d.badgeText})]}))]}))}),"left-row-".concat(r))}),n.jsx("div",{ref:Je,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(i.Box,e.__assign({ref:gt,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(i.Box,e.__assign({onClick:function(n){n.stopPropagation(),tn.open&&an===Qn?pn():(gn(Qn),ct(ut(n.currentTarget,{title:"",content:"",evaluationResult:Zn,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Qn,!0,e.__assign(e.__assign({},et),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-5px",borderRadius:"20px",bgcolor:et.badgeBg,color:et.badgeText,border:"1px solid ".concat(et.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=$n?$n:n.jsx(g.default,{}),n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(r.ButtonCognitiveIcon,{})})),n.jsx(o.ChevronDown,{size:11,style:{transform:tn.open&&an===Qn?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},ee?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[le&&n.jsx(l.default,{sections:11}),n.jsx(i.Box,e.__assign({ref:xt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(i.Tooltip,e.__assign({title:An,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:An}))}))})),n.jsxs(i.Box,e.__assign({ref:Ye,onScroll:Nt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},ee?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-120px",pl:"140px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:Ke,style:{width:"100%",height:"0px",flexShrink:0}}),Nn&&Bn.map(function(t,o){var r,l=t,u=[],c=!1,a=null,s=-1;if(ee){u=Tn.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=Tn.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0});var d=Tn.findIndex(function(e,n){var t;return Ee.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(c=-1!==d)&&(a=Et(d))}else u=[o+1],(c=Ee.has(o))&&(a=Et(o));var v=Et(ee&&-1!==s?s:o);return n.jsx(i.Box,e.__assign({ref:Hn.current[o],sx:{mb:1,width:"100%"}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:Mn.current[o],sx:e.__assign({width:"100%",display:"flex"},c&&a&&{borderRadius:"6px",outline:"2px solid ".concat(a.badgeBorder),outlineOffset:"1px"})},{children:n.jsx(R.default,{section:t,idx:o,columnKey:"right",colRef:Wn("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==H?void 0:H.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:ee?!!it["right-".concat(o)]:!!it[String(o)],treeData:H,proposedSections:Tn,existingSections:Bn,deviationNumberRegistry:On,getBadgeRef:Kn,getSectionCompareStyle:Et,connectedSections:Ee,openMoreFunctionsPopup:at,openSummaryPopup:Pt,deviationNodeIdToView:Q,deviationTargetParentId:Gt,onToggle:function(){kt(),lt(o,"right")},navigation:t.id?Vt[t.id]:null,showOpenNodeRef:Ht,resolvedMarkdownStyles:qe,maintainRelativeOrder:ee,renderSubSections:Wt})})),ee&&v&&n.jsx(i.Box,e.__assign({ref:Vn.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:v.badgeBg,color:v.badgeText,border:"1px solid ".concat(v.badgeBorder),borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:u.length>0?u.join(", "):"-"}))]}))}),"right-row-".concat(o))}),n.jsx("div",{ref:Ue,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),r=require("../hooks/memoizedMarkdown.js"),l=require("../CognitiveComparehelpers.js"),d=require("../CognitiveCompareConstants.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(i),u=function(e){var n=function(e){for(var n=(null==e?void 0:e.parentElement)||null;n;){var i=window.getComputedStyle(n).overflowY;if(("auto"===i||"scroll"===i)&&n.scrollHeight>n.clientHeight)return n;n=n.parentElement}return null}(e),i=e.getBoundingClientRect(),t=(null==n?void 0:n.getBoundingClientRect())||{top:0,bottom:window.innerHeight};return i.top>=t.top&&i.bottom<=t.bottom};exports.default=function(a){var c,v,f,p,g,x,h,m,_,y,b,I,w,R,S,A,E=a.section,C=a.idx,j=a.columnKey,D=a.colRef,F=a.mb,T=void 0===F?1:F,k=a.parentNodeId,B=void 0===k?"":k,O=a.isExpanded,M=a.onToggle,P=a.navigation,N=a.showOpenNodeRef,V=a.resolvedMarkdownStyles,W=a.maintainRelativeOrder,q=a.renderSubSections,G=a.treeData,z=a.proposedSections,H=void 0===z?[]:z,K=a.existingSections,Y=void 0===K?[]:K,L=a.deviationNumberRegistry,U=void 0===L?{}:L,X=a.getBadgeRef,$=a.openSummaryPopup,J=a.getSectionCompareStyle,Q=a.connectedSections,Z=a.openMoreFunctionsPopup,ee=a.deviationNodeIdToView,ne=a.deviationTargetParentId,ie=(null===(c=E.displayTitle)||void 0===c||c)&&l.hasValue(E.title),te=(null===(v=E.displayContent)||void 0===v||v)&&l.hasValue(E.content),oe=!ie&&!te,re={current:1},le=E.title;ie||(le=te?"No Title Found":"No Matching Section Found");var de=E.evaluationResult;if(!de&&"right"===j)if(W){var ae=null===(f=E.refIndexes)||void 0===f?void 0:f[0],se=H.find(function(e){return e.selfIndex===ae});de=null==se?void 0:se.evaluationResult}else de=null===(p=H[C])||void 0===p?void 0:p.evaluationResult;var ue=null===(g=null==G?void 0:G.input_index_map)||void 0===g?void 0:g[0],ce=null===(x=null==G?void 0:G.input_index_map)||void 0===x?void 0:x[1],ve="left"===j?ce:ue,fe="left"===j?E:H[C],pe="right"===j?E:Y[C];if(W)if("left"===j){var ge=null===(h=E.refIndexes)||void 0===h?void 0:h[0],xe=Y.findIndex(function(e){return e.selfIndex===ge});pe=-1!==xe?Y[xe]:void 0}else{var he=null===(m=E.refIndexes)||void 0===m?void 0:m[0],me=H.findIndex(function(e){return e.selfIndex===he});fe=-1!==me?H[me]:void 0}var _e="left"===j?!pe:!fe,ye=de||(null==fe?void 0:fe.evaluationResult)||(null==pe?void 0:pe.evaluationResult),be=null!==(b=null===(y=null===(_=null==ye?void 0:ye.evaluation_outputs)||void 0===_?void 0:_.metadata)||void 0===y?void 0:y.label_color)&&void 0!==b?b:d.DEFAULT_DEVIAION_COLOR,Ie=l.generateColorPalette(be),we=Ie.highlightBg,Re=null!==(w=null===(I=null==ye?void 0:ye.evaluation_outputs)||void 0===I?void 0:I.output_value)&&void 0!==w?w:null,Se=(null==ye?void 0:ye.deviations)||{},Ae=C+1,Ee=E.id;if("right"===j&&W){var Ce=null===(R=E.refIndexes)||void 0===R?void 0:R[0];-1!==(me=H.findIndex(function(e){return e.selfIndex===Ce}))&&(Ae=me+1,Ee=H[me].id)}var je,De=i.useRef(ee),Fe=i.useRef(ne||null),Te=[],ke=Object.entries(Se).map(function(n){var i,t,o,r,d,a=n[0],s=n[1],u="".concat(Ee).concat(l.DEVIATION_BADGE_SEPARATOR).concat(a),c=U[u];if(!c)return null;var v=s[B],f=l.isMissingStr(v);if(f)v="";else if(!v)return null;Te.push(v);var p=C,g=C;if(W)if("left"===j){var x=null===(i=E.refIndexes)||void 0===i?void 0:i[0],h=Y.findIndex(function(e){return e.selfIndex===x});g=-1!==h?h:C}else{var m=null===(t=E.refIndexes)||void 0===t?void 0:t[0],_=H.findIndex(function(e){return e.selfIndex===m});p=-1!==_?_:C}var y="".concat(Ee).concat(l.DEVIATION_BADGE_SEPARATOR).concat(a).concat(l.DEVIATION_BADGE_SEPARATOR).concat(p).concat(l.DEVIATION_BADGE_SEPARATOR).concat(g),b="left"===j?null===(o=Y[g])||void 0===o?void 0:o.content:null===(r=H[p])||void 0===r?void 0:r.content,I=s[ve],w=l.safeStringify(b),R=Object.keys(Se).map(function(e){return{key:e,text:Se[e][ve]}}).filter(function(e){return!l.isMissingStr(e.text)}).sort(function(e,n){return n.text.length-e.text.length}),S=new Set;R.forEach(function(e){var n=e.text.replace(/\\(['’])/g,"$1").replace(/\\n/g,"\n");if(n){var i=new RegExp(l.escapeRegExp(n));i.test(w)&&(S.add(e.key),w=w.replace(i,"__TOKEN_".concat(e.key,"__")))}});var A=!l.isMissingStr(I)&&!S.has(a),D=_e||l.isMissingStr(I)||A,F="".concat(Ae,".").concat(c),T=C;if("right"===j&&W){var k=null===(d=E.refIndexes)||void 0===d?void 0:d[0],O=H.findIndex(function(e){return e.selfIndex===k});-1!==O&&(T=O)}var M=J?J(T):null,P=M?e.__assign(e.__assign({},M),{badgeBg:Ie.badgeBg,badgeBorder:Ie.badgeBorder,badgeText:Ie.badgeText}):e.__assign({},Ie),N=(null==s?void 0:s.deviation_summary)?{deviation_summary:s.deviation_summary,deviation_title:null==ye?void 0:ye.deviation_title,evaluation_outputs:null==ye?void 0:ye.evaluation_outputs}:null;return{id:u,actionId:y,label:F,highlight:v,side:j,style:P,score:Re,isConnected:null==Q?void 0:Q.has(y),isOrphan:D,isMissingClause:f,badgeRef:X(j,u),onClick:function(e){e.stopPropagation(),Z&&Z(e,fe||{id:"orphan-left",title:"",content:""},D,pe||{id:"orphan-right",title:"",content:""},y,P)},onSummaryClick:function(e){e.stopPropagation(),$(e,y,D,N)}}}).filter(Boolean),Be=E.id&&j===(null==P?void 0:P.columnKey)?P:null,Oe=s.default.useRef(!1);return i.useEffect(function(){O||(Oe.current=!1)},[O]),i.useEffect(function(){De.current=ee,Fe.current=ne||null},[ee,ne]),i.useEffect(function(){var e=!!De.current&&!!Fe.current&&Ee===Fe.current,n=!!De.current&&(E.subsections||[]).some(function(e){return e.id===De.current});if(O&&!Oe.current&&!e&&!n){var i=setTimeout(function(){var e,n=null===(e=null==Be?void 0:Be.firstDeviationRef)||void 0===e?void 0:e.current,i=null==Be?void 0:Be.firstDeviationPosition;n?"inside"===i||u(n)?Oe.current=!0:(Oe.current=!0,n.scrollIntoView({behavior:"smooth",block:"center"})):Oe.current=!0},600);return function(){return clearTimeout(i)}}},[O,Ee,null==Be?void 0:Be.firstDeviationPosition,null==Be?void 0:Be.firstDeviationRef]),n.jsxs(t.Box,e.__assign({ref:D,sx:{mb:T,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:[O&&(null==Be?void 0:Be.showAbove)&&n.jsx("div",e.__assign({style:{position:"sticky",top:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==Be?void 0:Be.showAboveRef)||void 0===e?void 0:e.current)||void 0===n?void 0:n.scrollIntoView({behavior:"smooth",block:"center"})}},{children:n.jsx("div",e.__assign({style:e.__assign({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===j?"+":"-"," 130px))"),position:"absolute",paddingTop:"20px"},"left"===j?{right:"0px"}:{left:"0px"})},{children:n.jsx(o.ChevronUp,{color:window.getComputedStyle(null===(S=null==Be?void 0:Be.showAboveRef)||void 0===S?void 0:S.current).color})}))})),n.jsxs(t.Accordion,e.__assign({disableGutters:!0,expanded:!oe&&O,onChange:function(){oe||(M(),N.current=E.id)},sx:{boxShadow:"none",border:oe?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:oe?"#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:[n.jsx(t.AccordionSummary,e.__assign({expandIcon:oe?null:n.jsx(o.ChevronDown,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:oe?"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:ie&&n.jsx(t.Tooltip,e.__assign({title:le,placement:"top"},{children:n.jsx(t.Typography,e.__assign({component:"div",sx:{fontSize:"12px",color:oe?"#94A3B8":"#19213D",fontWeight:oe?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:(je=le,je?l.safeStringify(je).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,i){return e.startsWith("**")&&e.endsWith("**")?n.jsx("strong",{children:e.slice(2,-2)},i):n.jsx(s.default.Fragment,{children:e},i)}):null)}))}))})),!oe&&n.jsxs(t.AccordionDetails,e.__assign({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[te&&n.jsx(r.MemoizedMarkdown,{content:E.content,sxStyles:V,highlights:Te,maintainRelativeOrder:W,highlightBg:we,deviationBadges:ke}),(E.subsections||[]).map(function(e,n){return q({section:e,keyPath:"".concat(C,"-").concat(n),depth:0,columnKey:j,parentNodeId:B,devCounter:re})})]}))]})),O&&(null==Be?void 0:Be.showBelow)&&n.jsx("div",e.__assign({style:{position:"sticky",bottom:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==Be?void 0:Be.showBelowRef)||void 0===e?void 0:e.current)||void 0===n?void 0:n.scrollIntoView({behavior:"smooth",block:"center"})}},{children:n.jsx("div",e.__assign({style:e.__assign({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===j?"+":"-"," 130px))"),position:"absolute",paddingBottom:"20px"},"left"===j?{right:"0px"}:{left:"0px"})},{children:n.jsx(o.ChevronDown,{color:window.getComputedStyle(null===(A=null==Be?void 0:Be.showBelowRef)||void 0===A?void 0:A.current).color})}))}))]}),"".concat(j,"-sec-").concat(C))};
|
|
2
2
|
//# sourceMappingURL=SectionAccordion.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 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 D from"./LoaderComponent.js";import k 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=Y.resetDeviationNodeId,ye=o(pe.maintainRelativeOrder),be=ye[0],Se=ye[1],Re=o(!1),Ce=Re[0],Ie=Re[1],Te=o(!1),Be=Te[0],we=Te[1],Ee=o(null),Fe=Ee[0],_e=Ee[1],Me=o(!1),De=Me[0],ke=Me[1],Ae=o(!1),He=Ae[0],Ne=Ae[1],Le=o(!1),Pe=Le[0],Oe=Le[1],je=o(null),ze=je[0],We=je[1],Ye=r(!1),Ke=o(new Set),qe=Ke[0],Ve=Ke[1],Xe=o([]),Je=Xe[0],Ue=Xe[1],Ge=r(null),Qe=r(!1),Ze=r(null),$e=r({}),en=r([]),nn=r(!1),tn=r(!1),on=r(null),rn=r(function(){}),ln=l(function(){return(null==ce?void 0:ce.cognitive_decisioning)||{}},[ce]),cn=o({width:0,height:0}),un=cn[0],dn=cn[1],an=l(function(){return e(e({},T),se)},[se]),sn=r(null),vn=r(null),pn=r(null),fn=r(null),gn=r(null),hn=r(null),xn=r(null),mn=r(null),yn=r(!1),bn=r(null),Sn=r(null),Rn=H(sn),Cn=Rn.cognitivePopup,In=Rn.setCognitivePopup,Tn=Rn.moreFunctions,Bn=Rn.setMoreFunctions,wn=Rn.position,En=Rn.setPosition,Fn=Rn.activeBadgeId,_n=Rn.summaryPopup,Mn=Rn.setSummaryPopup,Dn=Rn.closeSummaryPopup,kn=Rn.setActiveBadgeId,An=Rn.popupRef,Hn=Rn.closeCognitivePopup,Nn=Rn.closeMoreFunctionsPopup,Ln=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]),Pn=o(null),On=Pn[0];Pn[1];var jn=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,zn=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,Wn=m(de||jn||"Uploaded Contract"),Yn=m(ae||zn||"Reference Template"),Kn=A(ce,be,he,Ln),qn=Kn.activeProposed,Vn=Kn.existingRule,Xn=Kn.proposedSections,Jn=Kn.existingSections,Un=Kn.visibleFields,Gn=Kn.parentDeviationRecord,Qn=Kn.deviationNumberRegistry,Zn=Kn.parseError;c(function(){Zn&&_e("Failed to load comparison: ".concat(Zn))},[Zn]);var $n=Xn.length>0||Jn.length>0,et=N(Un.map(function(e){return e.key}),Math.max(Xn.length,Jn.length)),nt=et.leftRefs,tt=et.rightRefs,it=et.sectionLeftRefs,ot=et.sectionRightRefs,rt=et.lhsBadgeRefs,lt=et.rhsBadgeRefs,ct=et.sectionRightRowRefs,ut=et.subSectionLeftRefs,dt=et.subSectionRightRefs,at=et.sectionRowRefs,st=et.getSectionRowRef,vt=et.getSubSectionRef,pt=et.getBadgeRef,ft=Vn.analysis,gt=m(null===(Q=null===(G=null==ft?void 0:ft.rule_difference_comparison)||void 0===G?void 0:G.summary)||void 0===Q?void 0:Q.overall_summary),ht=!!gt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),xt=null!==(Z=null==ce?void 0:ce.base_root_id)&&void 0!==Z?Z:"-1";null==ce||ce[xt];var mt=(null===($=null==he?void 0:he[xt])||void 0===$?void 0:$.evaluation_result)||(null===(ne=null===(ee=null==ce?void 0:ce.nodes)||void 0===ee?void 0:ee[xt])||void 0===ne?void 0:ne.evaluation_result)||null,yt=y(mt),bt=b(null!==(oe=null===(ie=null===(te=null==mt?void 0:mt.evaluation_outputs)||void 0===te?void 0:te.metadata)||void 0===ie?void 0:ie.label_color)&&void 0!==oe?oe:""),St=u(function(){var e,n,t,i,o,r;ke(!1),tn.current=!1;var l=on.current,c=At.current;if(null!==l)if("string"==typeof l&&l.includes(S)){var u=l.split(S);(d=(null===(e=ut.current[u[2]])||void 0===e?void 0:e.current)||(null===(n=it.current[Number(u[2])])||void 0===n?void 0:n.current))&&(d.style.paddingTop="0px")}else{var d;(d=null===(t=it.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=dt.current[u[3]])||void 0===i?void 0:i.current)||(null===(o=ot.current[Number(u[3])])||void 0===o?void 0:o.current))&&(a.style.paddingTop="0px")}else{var a;(a=null===(r=ot.current[c])||void 0===r?void 0:r.current)&&(a.style.paddingTop="0px")}We(null),on.current=null,At.current=null,Ne(!1),we(!1),fn.current&&(fn.current.style.height="0px"),gn.current&&(gn.current.style.height="0px"),hn.current&&(hn.current.style.height="0px"),xn.current&&(xn.current.style.height="0px")},[]),Rt=L({maintainRelativeOrder:!!be,proposedSections:Xn,existingSections:Jn,activeSideBySideSection:ze,connectedSections:qe,resetSideBySide:St,setConnectedSections:Ve,setConnectedLines:Ue,cachedConnectedPositions:en,svgContainerRef:Ge,isAnimatingRef:Qe,animationTimerRef:Ze,calculateLinesRef:rn,sectionLeftRefs:it,sectionRightRefs:ot,subSectionLeftRefs:ut,subSectionRightRefs:dt}),Ct=Rt.expandedSections,It=Rt.expandedSubSections,Tt=Rt.setExpandedSubSections,Bt=Rt.toggleSection,wt=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?ln[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=at.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}},[ln,ce]),Et=u(function(e){Nn(),En(null),In(e)},[Nn]),Ft=function(e,n,t,i,o,r){var l;if(e.stopPropagation(),Tn.open&&Tn.sectionIdx===o)Nn();else{var c=e.currentTarget,u="left";(null===(l=pn.current)||void 0===l?void 0:l.contains(c))&&(u="right");tn.current&&St(),Ve(new Set),Ue([]),en.current=[],Hn(),_n.open?ii():Dn(),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=lt.current[l])||void 0===e?void 0:e.current:null===(n=rt.current[l])||void 0===n?void 0:n.current}return"right"===u?null===(t=lt.current[o])||void 0===t?void 0:t.current:null===(i=rt.current[o])||void 0===i?void 0:i.current}()||c;Bn(wt(e,n,i,o,t,r))})}},_t=u(function(){null!==Tn.sectionIdx&&Tn.anchorEl?Et(e(e({},Tn),{open:!0})):Nn()},[Tn,Nn,Et]),Mt=u(function(){var e=Tn.sectionIdx,n=Tn.isOrphan;Nn(),Dn(),null!==e&&(n?_e("No counterpart exists to connect to."):(tn.current&&St(),Ue([]),en.current=[],Ve(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){rn.current&&rn.current()},50)))},[Tn.sectionIdx,Tn.isOrphan,Nn,Dn,St]),Dt=r(null),kt=r(null),At=r(null),Ht=r(null),Nt=r(null),Lt=r(null),Pt=o([]),Ot=Pt[0],jt=Pt[1];r(null);var zt=o(null),Wt=zt[0],Yt=zt[1];c(function(){if(On){var e=Ln.fields.find(function(e){return e.analysisKey===On||e.key===On});if(e){var n=nt.current[e.key]||tt.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[On,Ln.fields]);var Kt=u(function(e){var n,t,i,o,r,l,c,u,d,a=null===(n=null==ft?void 0:ft.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}},[ft]),qt=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=Xn[n],be&&a){var v=Jn.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=Jn[n];else if(s=Jn[n],be&&s){var p=Xn.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=Xn[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})},[Xn,Jn,ln,Ln,be]),Vt=u(function(n){for(var t,i,o,r,l,c,u,d,a,s=n.split("-").map(Number),v=Xn[s[0]],p=Jn[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=ln[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})},[Xn,Jn,ln,Ln]),Xt=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(!yn.current&&!Qe.current){yn.current=!0;try{if(!Dt.current)return;var T=function(e){var n=e.split("-"),t=n[0];if(!Ct[t]&&!1===be)return!1;if(be&&!Ct["left-".concat(t)]&&!Ct["right-".concat(t)]&&!Ct[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!It[i])return!1;return!0},B=Dt.current.getBoundingClientRect();dn({width:B.width,height:B.height});var w=[];if(Un.forEach(function(e){var n,t,i=e.key,o=null===(n=nt.current[i])||void 0===n?void 0:n.current,r=null===(t=tt.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")}),!Qe.current){for(var E=0;E<Math.max(Xn.length,Jn.length);E++){var F=null===(e=it.current[E])||void 0===e?void 0:e.current,_=null===(n=ot.current[E])||void 0===n?void 0:n.current;F&&(F.style.height="auto",F.style.minHeight="0px"),_&&(_.style.height="auto",_.style.minHeight="0px")}be||Object.keys(ut.current).forEach(function(e){var n,t;if(T(e)){var i=null===(n=ut.current[e])||void 0===n?void 0:n.current,o=null===(t=dt.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={};Un.forEach(function(e){var n,t,i=e.key,o=null===(n=nt.current[i])||void 0===n?void 0:n.current,r=null===(t=tt.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 D={left:{},right:{}},k={};if(!Qe.current)if(be){if(De&&null!==ze)if("number"==typeof ze){var A=ze,H=Xn[A],N=null===(o=it.current[A])||void 0===o?void 0:o.current;N&&H&&(H.refIndexes||[]).forEach(function(e){var n,t=Jn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=ot.current[t])||void 0===n?void 0:n.current;if(i&&(Ct["left-".concat(A)]||Ct["right-".concat(t)])){var o=Math.max(N.getBoundingClientRect().height,i.getBoundingClientRect().height);D.left[A]=Math.max(D.left[A]||0,o),D.right[t]=Math.max(D.right[t]||0,o)}})}else{var L=ze.split(S)[2];if(L){F=null===(r=ut.current[L])||void 0===r?void 0:r.current,_=null===(l=dt.current[L])||void 0===l?void 0:l.current;if(F&&_){P=Math.max(F.getBoundingClientRect().height,_.getBoundingClientRect().height);k[L]=Math.max(k[L]||0,P)}}}}else{Object.keys(ut.current).forEach(function(e){var n,t;if(T(e)){var i=null===(n=ut.current[e])||void 0===n?void 0:n.current,o=null===(t=dt.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);k[e]=c,i.style.minHeight="".concat(c,"px"),o.style.minHeight="".concat(c,"px")}}});for(E=0;E<Math.min(Xn.length,Jn.length);E++){var F=null===(t=it.current[E])||void 0===t?void 0:t.current,_=null===(i=ot.current[E])||void 0===i?void 0:i.current;if(F&&_){var P=Math.max(F.getBoundingClientRect().height,_.getBoundingClientRect().height);D.left[E]=P,D.right[E]=P}}}if(Un.forEach(function(e){var n,t,i=e.key,o=null===(n=nt.current[i])||void 0===n?void 0:n.current,r=null===(t=tt.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")}}),Qe.current||(Object.entries(D.left).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"))}),Object.entries(D.right).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=ot.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),be||Object.keys(k).forEach(function(e){var n,t,i=null===(n=ut.current[e])||void 0===n?void 0:n.current,o=null===(t=dt.current[e])||void 0===t?void 0:t.current;if(i&&o&&k[e]){var r=k[e];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),be)Xn.forEach(function(e,n){var t;(null===(t=it.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=Jn.findIndex(function(n){return n.selfIndex===e});if(-1!==v){var p=null===(t=rt.current[n])||void 0===t?void 0:t.current,f=null===(i=lt.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(De&&ze===n){var S=null!==(r=null===(o=mn.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,R=null!==(c=null===(l=pn.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==c?c:0,C=S+(null!==(d=null===(u=mn.current)||void 0===u?void 0:u.clientHeight)&&void 0!==d?d:1/0),I=R+(null!==(s=null===(a=pn.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 _=qt(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(Xn.length,Jn.length);E++){var O=null===(c=it.current[E])||void 0===c?void 0:c.current,j=null===(u=ot.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=Jn[E])||void 0===d?void 0:d.id)||"sec-".concat(E);(Z=qt(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=Xn[E])||void 0===a?void 0:a.cognitiveData)||(null===(s=Jn[E])||void 0===s?void 0:s.cognitiveData)||K&&ln[K]),isSubSection:!1})}}Object.keys(ut.current).forEach(function(e){var n,t,i,o,r,l;if(T(e)){var c=null===(n=ut.current[e])||void 0===n?void 0:n.current,u=null===(t=dt.current[e])||void 0===t?void 0:t.current;if(c&&u){for(var d=e.split("-").map(Number),a=Xn[d[0]],s=Jn[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=Vt(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(De&&"string"==typeof ze&&ze.includes(S)){var q=ze.split(S),V=q[0],X=q[1],J=q[2],U=(q[3],"".concat(V).concat(S).concat(X)),G=null===(v=rt.current[U])||void 0===v?void 0:v.current,Q=null===(p=lt.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(be){var re=null!==(g=null===(f=mn.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==g?g:0,le=null!==(x=null===(h=pn.current)||void 0===h?void 0:h.getBoundingClientRect().top)&&void 0!==x?x:0,ce=re+(null!==(y=null===(m=mn.current)||void 0===m?void 0:m.clientHeight)&&void 0!==y?y:1/0),ue=le+(null!==(I=null===(b=pn.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=Vt(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:ze})}}if(jt(w),Nt.current&&Lt.current){var ae=Nt.current.getBoundingClientRect(),se=Lt.current.getBoundingClientRect(),ve=(ae.top+ae.height/2-B.top+se.top+se.height/2-B.top)/2;Yt({x1:ae.right-B.left,x2:se.left-B.left,y:ve})}else Yt(null);if(qe.size>0){var pe=[],fe=mn.current,ge=pn.current;if(fe&&ge){var he=[],xe=fe.getBoundingClientRect().top,me=ge.getBoundingClientRect().top,ye=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))};qe.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=rt.current[a])||void 0===n?void 0:n.current,v=null===(t=lt.current[a])||void 0===t?void 0:t.current;if(!s||!v)return;var p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),g=Vt(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,ye),T=Te(m,me,Se),w=I-Ie,E=T-Ie,F=m>=me-4&&m<=Se+4,_="";_=(L=x>=xe-4&&x<=ye+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(be){var M=e,D=Xn[M];if(!(null===(r=null==D?void 0:D.refIndexes)||void 0===r?void 0:r.length))return;D.refIndexes.forEach(function(e){var n,t,i=Jn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=rt.current[M])||void 0===n?void 0:n.current,r=null===(t=lt.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect(),u=qt(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,ye),m=Te(p,me,Se),y=x-Ie,b=m-Ie,S=v>=xe-4&&v<=ye+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 k=e,A=k;s=null===(i=rt.current[k])||void 0===i?void 0:i.current,v=null===(o=lt.current[A])||void 0===o?void 0:o.current;if(!s||!v)return;var H,N;p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),g=qt(k),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(k,"-").concat(A);he.push({lhsScrollY:y,rhsScrollY:b,x1:H,x2:N,containerTop:Ie,leftIdx:k,rhsArrayIdx:A,styleColor:(null==g?void 0:g.badgeBorder)||"#6366F1",styleId:R});var L;I=Te(x,xe,ye),T=Te(m,me,Se),w=I-Ie,E=T-Ie,F=m>=me-4&&m<=Se+4,_="";_=(L=x>=xe-4&&x<=ye+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:k,rhsArrayIdx:A})}}),en.current=he}Ue(pe)}else Ue([]),en.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{yn.current=!1}}},[Un,Xn,Jn,ln,Ln,Kt,qt,be,De,ze,qe,Ct,It]),Jt=u(function(){var e,n,t,i,o,r,l,c,u,d,a,s,v,p,f=en.current;if(f.length&&!Qe.current){var g=null!==(n=null===(e=mn.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,h=null!==(i=null===(t=pn.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,x=null!==(r=null===(o=mn.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(c=null===(l=pn.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,y=null!==(d=null===(u=mn.current)||void 0===u?void 0:u.getBoundingClientRect().top)&&void 0!==d?d:0,b=null!==(s=null===(a=pn.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=Dt.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=$e.current[e.styleId+"-stroke"],o=$e.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(){rn.current=Xt},[Xt]);var Ut=r(null),Gt=r(null),Qt=u(function(){en.current.length>0&&!Qe.current||(null!==Ut.current&&clearTimeout(Ut.current),Ut.current=setTimeout(function(){rn.current(),Ut.current=null},50))},[]),Zt=u(function(){Oe(!0),Ne(!1),null!==Gt.current&&clearTimeout(Gt.current),null!==Ut.current&&(clearTimeout(Ut.current),Ut.current=null),Gt.current=setTimeout(function(){var e,n,t,i,o,r,l,c,u,d;if(en.current=[],tn.current&&null!==on.current&&null!==At.current){var a=on.current,s=At.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=rt.current[x])||void 0===e?void 0:e.current)||null,p=(null===(n=lt.current[x])||void 0===n?void 0:n.current)||null,f=(null===(t=ut.current[h[2]])||void 0===t?void 0:t.current)||(null===(i=it.current[Number(h[2])])||void 0===i?void 0:i.current)||null,g=(null===(o=dt.current[h[3]])||void 0===o?void 0:o.current)||(null===(r=ot.current[Number(h[3])])||void 0===r?void 0:r.current)||null}else v=(null===(l=at.current[a])||void 0===l?void 0:l.current)||null,f=(null===(c=it.current[a])||void 0===c?void 0:c.current)||null,p=(null===(u=ct.current[s])||void 0===u?void 0:u.current)||null,g=(null===(d=ot.current[s])||void 0===d?void 0:d.current)||null;if(v&&p&&f&&g){if(f.style.paddingTop="0px",g.style.paddingTop="0px",!be){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=mn.current,C=pn.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)}}}rn.current(),tn.current&&Ne(!0),Oe(!1),Gt.current=null},150)},[be,Xn,Jn]),$t=u(function(e){var n,t,i,o,r,l,c,u,d,a;if(null!==bn.current&&Sn.current&&Math.abs(e.currentTarget.scrollTop-bn.current)<=2){var s=Sn.current;bn.current=null,Sn.current=null,s()}if(!Ye.current){if(be||Qt(),tn.current){var v=on.current,p=At.current,f=mn.current,g=pn.current;if(null!==v&&null!==p&&f&&g){var h="string"==typeof v&&v.includes(S)?null===(n=rt.current["".concat(v.split(S)[0]).concat(S).concat(v.split(S)[1])])||void 0===n?void 0:n.current:null===(t=at.current[v])||void 0===t?void 0:t.current,x="string"==typeof p&&p.includes(S)?null===(i=lt.current["".concat(p.split(S)[0]).concat(S).concat(p.split(S)[1])])||void 0===i?void 0:i.current:null===(o=ct.current[p])||void 0===o?void 0:o.current;if(h&&x&&Ht.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=rt.current[R])||void 0===r?void 0:r.current,y=null===(l=lt.current[R])||void 0===l?void 0:l.current}else m=null===(c=rt.current[v])||void 0===c?void 0:c.current,y=null===(u=lt.current[p])||void 0===u?void 0:u.current;var C=null!==(a=null===(d=Dt.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,D=I,k=T,Math.max(D,Math.min(k,M)))-C).toString();Ht.current.setAttribute("y1",F),Ht.current.setAttribute("y2",F);var _=E>=I-4&&E<=T+4;Ht.current.setAttribute("visibility",_?"visible":"hidden")}}}}var M,D,k;en.current.length>0&&!nn.current&&(nn.current=!0,requestAnimationFrame(function(){Jt(),nn.current=!1}))}},[Jt,be,Qt]);c(function(){var e=setTimeout(Qt,250);window.addEventListener("resize",Zt);var n=null,t=null;return sn.current&&(n=new ResizeObserver(Qt)).observe(sn.current),Dt.current&&(t=new ResizeObserver(Qt)).observe(Dt.current),function(){clearTimeout(e),null!==Ut.current&&clearTimeout(Ut.current),null!==Gt.current&&clearTimeout(Gt.current),window.removeEventListener("resize",Zt),null==n||n.disconnect(),null==t||t.disconnect()}},[qn,Vn,ft,Un,Ct,It,Xn,Jn,Ln,Qt,Zt,De,ze,He,qe]),c(function(){tn.current=De},[De]),c(function(){on.current=ze},[ze]);var ei=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";Nn(),null!=e&&(n?_e("No counterpart exists for this section."):De&&ze===e?r?St():null==l||l():(Ve(new Set([e])),Ue([]),en.current=[],we(!0),Ye.current=!0,We(e),on.current=e,ke(!0),tn.current=!0,Ne(!1),fn.current&&(fn.current.style.height="0px"),gn.current&&(gn.current.style.height="0px"),hn.current&&(hn.current.style.height="0px"),xn.current&&(xn.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=rt.current[p])||void 0===n?void 0:n.current)||null,a=(null===(t=lt.current[p])||void 0===t?void 0:t.current)||null,s=a?e:null}else if(d=(null===(i=at.current[e])||void 0===i?void 0:i.current)||null,be){var f=Xn[e],g=(null==f?void 0:f.refIndexes)||[];if(g.length>0){var h=g[0],x=Jn.findIndex(function(e){return e.selfIndex===h});-1!==x&&(a=(null===(r=ct.current[x])||void 0===r?void 0:r.current)||null,s=x)}}else a=(null===(o=ct.current[e])||void 0===o?void 0:o.current)||null,s=a?e:null;At.current=s;var m=mn.current,y=pn.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=ut.current[y[2]])||void 0===n?void 0:n.current)||(null===(t=it.current[Number(y[2])])||void 0===t?void 0:t.current)||null,h=(null===(i=dt.current[y[3]])||void 0===i?void 0:i.current)||(null===(o=ot.current[Number(y[3])])||void 0===o?void 0:o.current)||null,x=(null===(r=rt.current[b])||void 0===r?void 0:r.current)||g,m=(null===(l=lt.current[b])||void 0===l?void 0:l.current)||h}else{var R=Number(e),C=null!==s?Number(s):R;g=(null===(c=it.current[R])||void 0===c?void 0:c.current)||null,h=(null===(d=ot.current[C])||void 0===d?void 0:d.current)||null,x=(null===(a=rt.current[R])||void 0===a?void 0:a.current)||(null===(v=at.current[R])||void 0===v?void 0:v.current)||g,m=(null===(p=lt.current[C])||void 0===p?void 0:p.current)||(null===(f=ct.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"))}}(),Ne(!0),rn.current&&rn.current(),Ye.current=!1,"right"===c&&y?y.dispatchEvent(new Event("scroll")):m&&m.dispatchEvent(new Event("scroll")),we(!1),null==l||l()};if(!d||!m)return Ye.current=!1,we(!1),void(null==l||l());if(a&&y){if(!be){var R=0;R="right"===c?a?a.getBoundingClientRect().top:0:d?d.getBoundingClientRect().top:0;var C=sn.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&&fn.current&&(fn.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 gn.current&&(gn.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&&hn.current&&(hn.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 xn.current&&(xn.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){I(m,M,F,b)})}e=M}I(m,e,F,b)})}}else b()})))},[ze,Nn,Jn,De,be,Xn,St]),ni=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;Hn();var c="left";(null===(o=pn.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=lt.current[l])||void 0===e?void 0:e.current:null===(t=rt.current[l])||void 0===t?void 0:t.current}return"right"===c?null===(i=lt.current[n])||void 0===i?void 0:i.current:null===(o=rt.current[n])||void 0===o?void 0:o.current};if(t)return St(),Ve(new Set),Ue([]),en.current=[],void(r&&requestAnimationFrame(function(){var e=u()||l;Mn({open:!0,anchorEl:e,summary:i})}));ei(n,t,r?{toggleIfSame:!1,sourceSide:c,onReady:function(){var e=u()||l;Mn({open:!0,anchorEl:e,summary:i})}}:{toggleIfSame:!1,sourceSide:c})},[ei,Hn,Mn,St]),ti=u(function(){var e,n=Tn.sectionIdx,t=Tn.isOrphan;if(Dn(),null!=n){var i="left";Tn.anchorEl&&(null===(e=pn.current)||void 0===e?void 0:e.contains(Tn.anchorEl))&&(i="right"),ei(n,t,{sourceSide:i})}},[ei,Tn.isOrphan,Tn.sectionIdx,Tn.anchorEl,Dn]),ii=u(function(){Dn(),St(),Ve(new Set),Ue([]),en.current=[]},[Dn,St]),oi=null!==Tn.sectionIdx&&qe.has(Tn.sectionIdx),ri=P({proposedSections:Xn,existingSections:Jn,parentDeviationRecord:Gn,expandedSections:Ct,maintainRelativeOrder:!!be,scrollContainerRef:sn,leftContainerRef:mn,lhsBadgeRefs:rt,rhsBadgeRefs:lt}),li=ri.showDeviationNavigation,ci=ri.showOpenNodeRef,ui=l(function(){if(!xe)return null;for(var e in Gn){if((Gn[e]||[]).some(function(e){return e.id===xe}))return e}return null},[xe,Gn]),di=r(null),ai=r(null);c(function(){if(xe&&di.current!==xe){ai.current!==xe&&(Dn(),Hn(),St(),Ve(new Set),Ue([]),en.current=[],ai.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 Gn){var f=Gn[p].find(function(e){return e.id===xe});if(f){s=p,v=f;break}}if(v&&s){var g=Xn.findIndex(function(e){return e.id===s}),h=Jn.findIndex(function(e){return e.id===s}),x=-1===g&&-1!==h;if(x){if(!(be?!!Ct["right-".concat(h)]:!!Ct[String(h)]))return Bt(h,"right"),t+=1,void(i=setTimeout(l,450))}else if(!(be?!!Ct["left-".concat(g)]:!!Ct[String(g)])&&g>=0)return Bt(g,"left"),t+=1,void(i=setTimeout(l,450));var m=r(Xn,v.id),y=r(Jn,v.id);if(m&&!y&&!x){var b=m.split("-"),R=Number(b[0]);if(be){var C=null===(u=null===(c=Xn[R])||void 0===c?void 0:c.refIndexes)||void 0===u?void 0:u[0],I=Jn.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=rt.current[F])||void 0===d?void 0:d.current,M=null===(a=lt.current[F])||void 0===a?void 0:a.current,D=x?M:_;if(T=be?x?pn.current:mn.current:sn.current,D&&T){var k=D.getBoundingClientRect();if(0===k.height)return void((t+=1)<20&&(i=setTimeout(l,o)));var A=T.getBoundingClientRect(),H=k.top-A.top+T.scrollTop-A.height/2+k.height/2,N=function(){var n,t,i,o,r;if(!e){di.current=xe;var l=window.getComputedStyle(D).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)){var d=x?(null===(o=lt.current[F])||void 0===o?void 0:o.current)||M:(null===(r=rt.current[F])||void 0===r?void 0:r.current)||_;return Mn({open:!0,anchorEl:d,summary:{deviation_summary:c.deviation_summary||c,evaluation_outputs:u}}),void(null==me||me())}ei(E,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var e,n=(null===(e=rt.current[F])||void 0===e?void 0:e.current)||_;Mn({open:!0,anchorEl:n,summary:{deviation_summary:c.deviation_summary||c,evaluation_outputs:u}})}})}};Math.abs(T.scrollTop-H)<=2?N():(bn.current=H,Sn.current=N,T.scrollTo({top:H,behavior:"smooth"}),i&&clearTimeout(i),i=setTimeout(function(){if(Sn.current){bn.current=null;var e=Sn.current;Sn.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,Gn,Xn,Jn,be,Ct,Bt,ei,Mn]);var si=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:It,setExpandedSubSections:Tt,maintainRelativeOrder:be||!1,proposedSections:Xn,existingSections:Jn,treeData:ce,deviationNumberRegistry:Qn,connectedSections:qe,activeSideBySideSection:ze,resolvedMarkdownStyles:an,getSubSectionRef:vt,getSubSectionCompareStyle:Vt,getBadgeRef:pt,openMoreFunctionsPopup:Ft,openSummaryPopup:ni,resetSideBySide:St,setConnectedSections:Ve,setConnectedLines:Ue,cachedConnectedPositions:en})};return t(d,e({ref:vn,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},be?{}:{overflow:"visible"}),{position:"relative"})},{children:[Ce&&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(D,{})})),_n.open&&i(W,{open:_n.open,anchorEl:_n.anchorEl,containerEl:kt.current,clipTopEl:Nt.current,scrollContainerEl:sn.current,onClose:ii,summary:_n.summary}),i(M,{open:Tn.open,anchorEl:Tn.anchorEl,sectionTitle:Tn.sectionTitle,referenceSectionTitle:Tn.refSectionTitle,onClose:Nn,onOpenCognitiveCompare:_t,onOpenSideBySide:ti,onConnect:Mt,isConnected:oi,isOrphan:Tn.isOrphan}),Cn.open&&i(_,{open:Cn.open,popupRef:An,position:wn,popupConfig:fe,onClose:function(){En(null),In(function(n){return e(e({},n),{open:!1})}),kn(null)},markdownStyles:se,sectionTitle:Cn.sectionTitle,referenceSectionTitle:Cn.refSectionTitle,cognitiveData:Cn.cognitiveData,anchorEl:Cn.anchorEl,sectionAnchorEl:Cn.sectionAnchorEl,scrollContainerEl:sn.current,badgeStyle:Cn.badgeStyle,docData:Cn.docData,deviationData:Cn.deviationData,isLoading:Cn.isLoading}),i(a,e({open:!!Fe,autoHideDuration:8e3,onClose:function(){return _e(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(s,e({onClose:function(){return _e(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Fe}))})),i(O,{componentHeaderText:le,displayConfig:pe,maintainRelativeOrder:be,onToggleView:function(e){Ie(!0),setTimeout(function(){Se(!e),St(),Dn(),Ve(new Set),Ue([]),en.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){Ie(!1)},600)})})},50)}}),i(d,e({ref:sn,onScroll:$t,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:be?"hidden":"auto",borderTop:gt&&ht?"none":"1.5px solid #EEF0F4"}},{children:i(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},be?{flex:1,minHeight:0}:{})},{children:t(d,e({ref:Dt,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},be?{flex:1,overflow:"visible"}:{})},{children:[t("svg",e({ref:Ge,style:{position:"absolute",top:0,left:0,width:un.width||"100%",height:un.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:Pe?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[Wt&&i("g",{children:i("line",{x1:Wt.x1,y1:Wt.y,x2:Wt.x2,y2:Wt.y,stroke:bt.badgeBorder,strokeWidth:"1.5"})}),Ot.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?De&&ze===n.subSectionKeyPath&&He:De&&ze===n.sectionIdx&&He)return null;if(!be){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=Xn[n.sectionIdx]||{title:"",content:""},x=Jn[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=Xn[R[0]]),I.length>0&&(B=Jn[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),D=(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||D;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&&(Cn.open&&Fn===n.id?Hn():(kn(n.id),Et(wt(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(k,{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:Cn.open&&Fn===n.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},n.id)}return null}),Je.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){$e.current[u]=e},d:r,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),i("path",{ref:function(e){$e.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)"},be?{flex:1,overflow:"visible"}:{})},{children:[i(d,e({ref:Nt,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:Wn,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:Wn}))}))})),t(d,e({ref:mn,onScroll:$t,sx:e({p:"12px",display:"flex",flexDirection:"column"},be?{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:hn,style:{width:"100%",height:"0px",flexShrink:0}}),$n&&Xn.map(function(n,o){var r,l,c=!n.title&&!n.content;if(be&&c)return null;var u=n,a=qt(o,"left"),s=be?!(null===(r=u.refIndexes)||void 0===r?void 0:r.length)||u.selfIndex<0:!Jn[o],v=be?"number"==typeof u.selfIndex&&u.selfIndex>=0?u.selfIndex+1:null:o+1,p=qe.has(o),f=y(u.evaluationResult,null==a?void 0:a.deviationLabel);return i(d,e({ref:st(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"},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:st("left-accordion-".concat(o)),mb:0,treeData:ce,proposedSections:Xn,existingSections:Jn,deviationNumberRegistry:Qn,getSectionCompareStyle:qt,getBadgeRef:pt,connectedSections:qe,openMoreFunctionsPopup:Ft,openSummaryPopup:ni,deviationNodeIdToView:xe,deviationTargetParentId:ui,parentNodeId:(null===(l=null==ce?void 0:ce.input_index_map)||void 0===l?void 0:l[0])||"",isExpanded:be?!!Ct["left-".concat(o)]:!!Ct[String(o)],onToggle:function(){ii(),Bt(o,"left")},navigation:n.id?li[n.id]:null,showOpenNodeRef:ci,resolvedMarkdownStyles:an,maintainRelativeOrder:be,renderSubSections:si})})),be&&a&&t(d,e({ref:rt.current[o],onClick:function(e){var t=be?Jn.find(function(e){var n;return null===(n=u.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Jn[o]||{title:"",content:""};Ft(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(k,{color:a.badgeText})})),i(g,{size:11,color:a.badgeText})]}))]}))}),"left-row-".concat(o))}),i("div",{ref:xn,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(),Cn.open&&Fn===xt?Hn():(kn(xt),Et(wt(n.currentTarget,{title:"",content:"",evaluationResult:mt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,xt,!0,e(e({},bt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-5px",borderRadius:"20px",bgcolor:bt.badgeBg,color:bt.badgeText,border:"1px solid ".concat(bt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=yt?yt:i(k,{}),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:Cn.open&&Fn===xt?"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},be?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Be&&i(x,{sections:11}),i(d,e({ref:Lt,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:Yn,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:Yn}))}))})),t(d,e({ref:pn,onScroll:$t,sx:e({p:"12px",display:"flex",flexDirection:"column"},be?{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:fn,style:{width:"100%",height:"0px",flexShrink:0}}),$n&&Jn.map(function(n,o){var r,l=n,c=[],u=!1,a=null,s=-1;if(be){c=Xn.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=Xn.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0});var v=Xn.findIndex(function(e,n){var t;return qe.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(u=-1!==v)&&(a=qt(v))}else c=[o+1],(u=qe.has(o))&&(a=qt(o));var p=qt(be&&-1!==s?s:o);return i(d,e({ref:ct.current[o],sx:{mb:1,width:"100%"}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[i(d,e({ref:ot.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:st("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:be?!!Ct["right-".concat(o)]:!!Ct[String(o)],treeData:ce,proposedSections:Xn,existingSections:Jn,deviationNumberRegistry:Qn,getBadgeRef:pt,getSectionCompareStyle:qt,connectedSections:qe,openMoreFunctionsPopup:Ft,openSummaryPopup:ni,deviationNodeIdToView:xe,deviationTargetParentId:ui,onToggle:function(){ii(),Bt(o,"right")},navigation:n.id?li[n.id]:null,showOpenNodeRef:ci,resolvedMarkdownStyles:an,maintainRelativeOrder:be,renderSubSections:si})})),be&&p&&i(d,e({ref:lt.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:gn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{Y as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as n,jsx as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import o,{useRef as i,useEffect as l}from"react";import{Box as r,Accordion as d,AccordionSummary as a,Tooltip as u,Typography as c,AccordionDetails as s}from"@mui/material";import{ChevronUp as v,ChevronDown as f}from"lucide-react";import{MemoizedMarkdown as p}from"../hooks/memoizedMarkdown.js";import{hasValue as m,generateColorPalette as h,isMissingStr as g,safeStringify as x,escapeRegExp as b,DEVIATION_BADGE_SEPARATOR as y}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as w}from"../CognitiveCompareConstants.js";var I=function(e){var n=function(e){for(var n=(null==e?void 0:e.parentElement)||null;n;){var t=window.getComputedStyle(n).overflowY;if(("auto"===t||"scroll"===t)&&n.scrollHeight>n.clientHeight)return n;n=n.parentElement}return null}(e),t=e.getBoundingClientRect(),o=(null==n?void 0:n.getBoundingClientRect())||{top:0,bottom:window.innerHeight};return t.top>=o.top&&t.bottom<=o.bottom},R=function(R){var S,F,k,C,_,B,A,T,E,M,W,D,N,O,P,j,z=R.section,H=R.idx,K=R.columnKey,V=R.colRef,Y=R.mb,G=void 0===Y?1:Y,X=R.parentNodeId,$=void 0===X?"":X,q=R.isExpanded,J=R.onToggle,L=R.navigation,Q=R.showOpenNodeRef,U=R.resolvedMarkdownStyles,Z=R.maintainRelativeOrder,ee=R.renderSubSections,ne=R.treeData,te=R.proposedSections,oe=void 0===te?[]:te,ie=R.existingSections,le=void 0===ie?[]:ie,re=R.deviationNumberRegistry,de=void 0===re?{}:re,ae=R.getBadgeRef,ue=R.openSummaryPopup,ce=R.getSectionCompareStyle,se=R.connectedSections,ve=R.openMoreFunctionsPopup,fe=R.deviationNodeIdToView,pe=R.deviationTargetParentId,me=(null===(S=z.displayTitle)||void 0===S||S)&&m(z.title),he=(null===(F=z.displayContent)||void 0===F||F)&&m(z.content),ge=!me&&!he,xe={current:1},be=z.title;me||(be=he?"No Title Found":"No Matching Section Found");var ye=z.evaluationResult;if(!ye&&"right"===K)if(Z){var we=null===(k=z.refIndexes)||void 0===k?void 0:k[0],Ie=oe.find(function(e){return e.selfIndex===we});ye=null==Ie?void 0:Ie.evaluationResult}else ye=null===(C=oe[H])||void 0===C?void 0:C.evaluationResult;var Re=null===(_=null==ne?void 0:ne.input_index_map)||void 0===_?void 0:_[0],Se=null===(B=null==ne?void 0:ne.input_index_map)||void 0===B?void 0:B[1],Fe="left"===K?Se:Re,ke="left"===K?z:oe[H],Ce="right"===K?z:le[H];if(Z)if("left"===K){var _e=null===(A=z.refIndexes)||void 0===A?void 0:A[0],Be=le.findIndex(function(e){return e.selfIndex===_e});Ce=-1!==Be?le[Be]:void 0}else{var Ae=null===(T=z.refIndexes)||void 0===T?void 0:T[0],Te=oe.findIndex(function(e){return e.selfIndex===Ae});ke=-1!==Te?oe[Te]:void 0}var Ee="left"===K?!Ce:!ke,Me=ye||(null==ke?void 0:ke.evaluationResult)||(null==Ce?void 0:Ce.evaluationResult),We=null!==(W=null===(M=null===(E=null==Me?void 0:Me.evaluation_outputs)||void 0===E?void 0:E.metadata)||void 0===M?void 0:M.label_color)&&void 0!==W?W:w,De=h(We),Ne=De.highlightBg,Oe=null!==(N=null===(D=null==Me?void 0:Me.evaluation_outputs)||void 0===D?void 0:D.output_value)&&void 0!==N?N:null,Pe=(null==Me?void 0:Me.deviations)||{},je=H+1,ze=z.id;if("right"===K&&Z){var He=null===(O=z.refIndexes)||void 0===O?void 0:O[0];-1!==(Te=oe.findIndex(function(e){return e.selfIndex===He}))&&(je=Te+1,ze=oe[Te].id)}var Ke,Ve=i(fe),Ye=i(pe||null),Ge=[],Xe=Object.entries(Pe).map(function(n){var t,o,i,l,r,d=n[0],a=n[1],u="".concat(ze).concat(y).concat(d),c=de[u];if(!c)return null;var s=a[$],v=g(s);if(v)s="";else if(!s)return null;Ge.push(s);var f=H,p=H;if(Z)if("left"===K){var m=null===(t=z.refIndexes)||void 0===t?void 0:t[0],h=le.findIndex(function(e){return e.selfIndex===m});p=-1!==h?h:H}else{var w=null===(o=z.refIndexes)||void 0===o?void 0:o[0],I=oe.findIndex(function(e){return e.selfIndex===w});f=-1!==I?I:H}var R="".concat(ze).concat(y).concat(d).concat(y).concat(f).concat(y).concat(p),S="left"===K?null===(i=le[p])||void 0===i?void 0:i.content:null===(l=oe[f])||void 0===l?void 0:l.content,F=a[Fe],k=x(S),C=Object.keys(Pe).map(function(e){return{key:e,text:Pe[e][Fe]}}).filter(function(e){return!g(e.text)}).sort(function(e,n){return n.text.length-e.text.length}),_=new Set;C.forEach(function(e){var n=e.text.replace(/\\(['’])/g,"$1").replace(/\\n/g,"\n");if(n){var t=new RegExp(b(n));t.test(k)&&(_.add(e.key),k=k.replace(t,"__TOKEN_".concat(e.key,"__")))}});var B=!g(F)&&!_.has(d),A=Ee||g(F)||B,T="".concat(je,".").concat(c),E=H;if("right"===K&&Z){var M=null===(r=z.refIndexes)||void 0===r?void 0:r[0],W=oe.findIndex(function(e){return e.selfIndex===M});-1!==W&&(E=W)}var D=ce?ce(E):null,N=D?e(e({},D),{badgeBg:De.badgeBg,badgeBorder:De.badgeBorder,badgeText:De.badgeText}):e({},De),O=(null==a?void 0:a.deviation_summary)?{deviation_summary:a.deviation_summary,deviation_title:null==Me?void 0:Me.deviation_title,evaluation_outputs:null==Me?void 0:Me.evaluation_outputs}:null;return{id:u,actionId:R,label:T,highlight:s,side:K,style:N,score:Oe,isConnected:null==se?void 0:se.has(R),isOrphan:A,isMissingClause:v,badgeRef:ae(K,u),onClick:function(e){e.stopPropagation(),ve&&ve(e,ke||{id:"orphan-left",title:"",content:""},A,Ce||{id:"orphan-right",title:"",content:""},R,N)},onSummaryClick:function(e){e.stopPropagation(),ue(e,R,A,O)}}}).filter(Boolean),$e=z.id&&K===(null==L?void 0:L.columnKey)?L:null,qe=o.useRef(!1);return l(function(){q||(qe.current=!1)},[q]),l(function(){Ve.current=fe,Ye.current=pe||null},[fe,pe]),l(function(){var e=!!Ve.current&&!!Ye.current&&ze===Ye.current,n=!!Ve.current&&(z.subsections||[]).some(function(e){return e.id===Ve.current});if(q&&!qe.current&&!e&&!n){var t=setTimeout(function(){var e,n=null===(e=null==$e?void 0:$e.firstDeviationRef)||void 0===e?void 0:e.current,t=null==$e?void 0:$e.firstDeviationPosition;n?"inside"===t||I(n)?qe.current=!0:(qe.current=!0,n.scrollIntoView({behavior:"smooth",block:"center"})):qe.current=!0},600);return function(){return clearTimeout(t)}}},[q,ze,null==$e?void 0:$e.firstDeviationPosition,null==$e?void 0:$e.firstDeviationRef]),n(r,e({ref:V,sx:{mb:G,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:[q&&(null==$e?void 0:$e.showAbove)&&t("div",e({style:{position:"sticky",top:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==$e?void 0:$e.showAboveRef)||void 0===e?void 0:e.current)||void 0===n?void 0:n.scrollIntoView({behavior:"smooth",block:"center"})}},{children:t("div",e({style:e({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===K?"+":"-"," 130px))"),position:"absolute",paddingTop:"20px"},"left"===K?{right:"0px"}:{left:"0px"})},{children:t(v,{color:window.getComputedStyle(null===(P=null==$e?void 0:$e.showAboveRef)||void 0===P?void 0:P.current).color})}))})),n(d,e({disableGutters:!0,expanded:!ge&&q,onChange:function(){ge||(J(),Q.current=z.id)},sx:{boxShadow:"none",border:ge?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:ge?"#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:[t(a,e({expandIcon:ge?null:t(f,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:ge?"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:me&&t(u,e({title:be,placement:"top"},{children:t(c,e({component:"div",sx:{fontSize:"12px",color:ge?"#94A3B8":"#19213D",fontWeight:ge?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:(Ke=be,Ke?x(Ke).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,n){return e.startsWith("**")&&e.endsWith("**")?t("strong",{children:e.slice(2,-2)},n):t(o.Fragment,{children:e},n)}):null)}))}))})),!ge&&n(s,e({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[he&&t(p,{content:z.content,sxStyles:U,highlights:Ge,maintainRelativeOrder:Z,highlightBg:Ne,deviationBadges:Xe}),(z.subsections||[]).map(function(e,n){return ee({section:e,keyPath:"".concat(H,"-").concat(n),depth:0,columnKey:K,parentNodeId:$,devCounter:xe})})]}))]})),q&&(null==$e?void 0:$e.showBelow)&&t("div",e({style:{position:"sticky",bottom:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==$e?void 0:$e.showBelowRef)||void 0===e?void 0:e.current)||void 0===n?void 0:n.scrollIntoView({behavior:"smooth",block:"center"})}},{children:t("div",e({style:e({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===K?"+":"-"," 130px))"),position:"absolute",paddingBottom:"20px"},"left"===K?{right:"0px"}:{left:"0px"})},{children:t(f,{color:window.getComputedStyle(null===(j=null==$e?void 0:$e.showBelowRef)||void 0===j?void 0:j.current).color})}))}))]}),"".concat(K,"-sec-").concat(H))};export{R as default};
|
|
2
2
|
//# sourceMappingURL=SectionAccordion.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,6 +1,6 @@
|
|
|
1
1
|
import { CognitiveCompareProps } from "./CognitiveCompareTypes";
|
|
2
2
|
import { SHARED_MARKDOWN_STYLES } from "./CognitiveCompareConfig";
|
|
3
|
-
declare const CognitiveCompare: ({ componentHeaderText, treeData, comparisonConfig, leftColumnTitleText, rightColumnTitleText, markdownStyles, displayConfig, popupConfig, deviationData, deviationNodeIdToView, }: CognitiveCompareProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const CognitiveCompare: ({ componentHeaderText, treeData, comparisonConfig, leftColumnTitleText, rightColumnTitleText, markdownStyles, displayConfig, popupConfig, deviationData, deviationNodeIdToView, resetDeviationNodeId, }: CognitiveCompareProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export { SHARED_MARKDOWN_STYLES };
|
|
5
5
|
export default CognitiveCompare;
|
|
6
6
|
//# sourceMappingURL=CognitiveCompare.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAEL,qBAAqB,EAMtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAiBlC,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAEL,qBAAqB,EAMtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAiBlC,QAAA,MAAM,gBAAgB,4MAYnB,qBAAqB,4CA6gGvB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":"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
|
|
1
|
+
{"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionAccordion.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/components/SectionAccordion.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SectionAccordion.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/components/SectionAccordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAoBjD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AA0C3E,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,YAAY,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC5C,eAAe,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC5D,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5C,qBAAqB,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,gBAAgB,EAAE,CAChB,CAAC,EAAE,KAAK,CAAC,UAAU,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,kBAAkB,GAAG,IAAI,KAC/B,IAAI,CAAC;IACV,iBAAiB,EAAE,CAAC,IAAI,EAAE;QACxB,OAAO,EAAE,YAAY,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAC5B,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;KACjC,KAAK,KAAK,CAAC,SAAS,CAAC;IAGtB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;IACzB,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IACtG,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;IAC9C,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC,sBAAsB,CAAC,EAAE,CACvB,CAAC,EAAE,KAAK,CAAC,UAAU,EACnB,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,GAAG,EACX,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,GAAG,KACP,IAAI,CAAC;CACX,CAAC;AAEF,QAAA,MAAM,gBAAgB,yYAyBnB,qBAAqB,4CA+bvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viswa-test/test-citation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.89",
|
|
4
4
|
"author": "Viswa Koduru",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"dist"
|
|
145
145
|
],
|
|
146
146
|
"scripts": {
|
|
147
|
-
"start": "
|
|
147
|
+
"start": "craco start",
|
|
148
148
|
"build": "rollup -c",
|
|
149
149
|
"tsupBuild": "tsup src/index.ts",
|
|
150
150
|
"test": "craco test",
|