@viswa-test/test-citation 0.0.99 → 0.0.100
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/CognitiveComparehelpers.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.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 +5 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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"),f=require("./components/ThreeDotsLoader.js"),g=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,N,j,P,F,k,M,V,L,G,H,q,z,W,Y,K,U,X,J=A.componentHeaderText,$=void 0===J?a.DEFAULT_COMPONENT_HEADER_TEXT:J,Q=A.treeData,Z=A.comparisonConfig,ee=A.leftColumnTitleText,ne=A.rightColumnTitleText,te=A.markdownStyles,ie=A.displayConfig,oe=void 0===ie?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!0}:ie,re=A.popupConfig,le=A.deviationData,ue=void 0===le?{}:le,ce=A.deviationNodeIdToView,ae=A.resetDeviationNodeId,se=t.useState(oe.maintainRelativeOrder),de=se[0],ve=se[1],fe=!!de||!!(null==oe?void 0:oe.showDeviationBadges),ge=t.useState(!1),pe=ge[0],he=ge[1],xe=t.useState(!1),_e=xe[0],me=xe[1],Re=t.useState(null),ye=Re[0],Se=Re[1],Ae=t.useState(!1),be=Ae[0],Ee=Ae[1],Ie=t.useState(null===(E=null!==(b=null==Q?void 0:Q.newEvaluationResult)&&void 0!==b?b:null==oe?void 0:oe.enableDeviationSchemaBackwardCompatibility)||void 0===E||E)[0],Te=t.useState(!1),Be=Te[0],Ce=Te[1],De=t.useState(!1),Oe=De[0],we=De[1],Ne=t.useState(null),je=Ne[0],Pe=Ne[1],Fe=t.useRef(!1),ke=t.useState(new Set),Me=ke[0],Ve=ke[1],Le=t.useState([]),Ge=Le[0],He=Le[1],qe=t.useRef(null),ze=t.useRef(!1),We=t.useRef(null),Ye=t.useRef({}),Ke=t.useRef([]),Ue=t.useRef(!1),Xe=t.useRef(!1),Je=t.useRef(null),$e=t.useRef(function(){}),Qe=t.useMemo(function(){return(null==Q?void 0:Q.cognitive_decisioning)||{}},[Q]),Ze=t.useState({width:0,height:0}),en=Ze[0],nn=Ze[1],tn=t.useMemo(function(){return e.__assign(e.__assign({},c.SHARED_MARKDOWN_STYLES),te)},[te]),on=t.useRef(null),rn=t.useRef(null),ln=t.useRef(null),un=t.useRef(null),cn=t.useRef(null),an=t.useRef(null),sn=t.useRef(null),dn=t.useRef(null),vn=t.useRef(!1),fn=t.useRef(null),gn=t.useRef(null),pn=p.useComparePopups(on),hn=pn.cognitivePopup,xn=pn.setCognitivePopup,_n=pn.moreFunctions,mn=pn.setMoreFunctions,Rn=pn.position,yn=pn.setPosition,Sn=pn.activeBadgeId,An=pn.summaryPopup,bn=pn.setSummaryPopup,En=pn.closeSummaryPopup,In=pn.setActiveBadgeId,Tn=pn.popupRef,Bn=pn.closeCognitivePopup,Cn=pn.closeMoreFunctionsPopup,Dn=t.useMemo(function(){var e,n,t,i,o,r,l;return{fields:null!==(e=null==Z?void 0:Z.fields)&&void 0!==e?e:c.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(t=null===(n=null==Z?void 0:Z.thresholds)||void 0===n?void 0:n.high)&&void 0!==t?t:c.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(i=null==Z?void 0:Z.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:c.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==Z?void 0:Z.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:c.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[Z]),On=t.useState(null),wn=On[0];On[1];var Nn=null===(B=null===(I=null==Q?void 0:Q.documents)||void 0===I?void 0:I[null===(T=null==Q?void 0:Q.input_index_map)||void 0===T?void 0:T[0]])||void 0===B?void 0:B.title,jn=null===(O=null===(C=null==Q?void 0:Q.documents)||void 0===C?void 0:C[null===(D=null==Q?void 0:Q.input_index_map)||void 0===D?void 0:D[1]])||void 0===O?void 0:O.title,Pn=u.safeStringify(ee||Nn||"Uploaded Contract"),Fn=u.safeStringify(ne||jn||"Reference Template"),kn=g.useCognitiveTreeData(Q,de,ue,Dn,Ie),Mn=kn.activeProposed,Vn=kn.existingRule,Ln=kn.proposedSections,Gn=kn.existingSections,Hn=kn.visibleFields,qn=kn.parentDeviationRecord,zn=kn.deviationNumberRegistry,Wn=kn.parseError;t.useEffect(function(){Wn&&Se("Failed to load comparison: ".concat(Wn))},[Wn]);var Yn=Ln.length>0||Gn.length>0,Kn=h.useSectionRefs(Hn.map(function(e){return e.key}),Math.max(Ln.length,Gn.length)),Un=Kn.leftRefs,Xn=Kn.rightRefs,Jn=Kn.sectionLeftRefs,$n=Kn.sectionRightRefs,Qn=Kn.lhsBadgeRefs,Zn=Kn.rhsBadgeRefs,et=Kn.sectionRightRowRefs,nt=Kn.subSectionLeftRefs,tt=Kn.subSectionRightRefs,it=Kn.sectionRowRefs,ot=Kn.getSectionRowRef,rt=Kn.getSubSectionRef,lt=Kn.getBadgeRef,ut=Vn.analysis,ct=u.safeStringify(null===(N=null===(w=null==ut?void 0:ut.rule_difference_comparison)||void 0===w?void 0:w.summary)||void 0===N?void 0:N.overall_summary),at=!!ct.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),st=null!==(j=null==Q?void 0:Q.base_root_id)&&void 0!==j?j:"-1";null==Q||Q[st];var dt=Ie?null!==(Y=null!==(q=ue&&(null===(H=null==ue?void 0:ue[st])||void 0===H?void 0:H.evaluation_result))&&void 0!==q?q:null===(W=null===(z=null==Q?void 0:Q.nodes)||void 0===z?void 0:z[st])||void 0===W?void 0:W.evaluation_result)&&void 0!==Y?Y:null:null!==(G=null!==(k=ue&&(null===(F=null===(P=null==ue?void 0:ue[st])||void 0===P?void 0:P.evaluation_result)||void 0===F?void 0:F[0]))&&void 0!==k?k:null===(L=null===(V=null===(M=null==Q?void 0:Q.nodes)||void 0===M?void 0:M[st])||void 0===V?void 0:V.evaluation_result)||void 0===L?void 0:L[0])&&void 0!==G?G:null,vt=u.extractDeviationScore(dt),ft=u.generateColorPalette(null!==(X=null===(U=null===(K=null==dt?void 0:dt.evaluation_outputs)||void 0===K?void 0:K.metadata)||void 0===U?void 0:U.label_color)&&void 0!==X?X:""),gt=t.useCallback(function(){var e,n,t,i,o,r;Ee(!1),Xe.current=!1;var l=Je.current,c=Bt.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=nt.current[a[2]])||void 0===e?void 0:e.current)||(null===(n=Jn.current[Number(a[2])])||void 0===n?void 0:n.current))&&(s.style.paddingTop="0px")}else{var s;(s=null===(t=Jn.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=tt.current[a[3]])||void 0===i?void 0:i.current)||(null===(o=$n.current[Number(a[3])])||void 0===o?void 0:o.current))&&(d.style.paddingTop="0px")}else{var d;(d=null===(r=$n.current[c])||void 0===r?void 0:r.current)&&(d.style.paddingTop="0px")}Pe(null),Je.current=null,Bt.current=null,Ce(!1),me(!1),un.current&&(un.current.style.height="0px"),cn.current&&(cn.current.style.height="0px"),an.current&&(an.current.style.height="0px"),sn.current&&(sn.current.style.height="0px")},[]),pt=x.useAccordionState({maintainRelativeOrder:!!de,proposedSections:Ln,existingSections:Gn,activeSideBySideSection:je,connectedSections:Me,resetSideBySide:gt,setConnectedSections:Ve,setConnectedLines:He,cachedConnectedPositions:Ke,svgContainerRef:qe,isAnimatingRef:ze,animationTimerRef:We,calculateLinesRef:$e,sectionLeftRefs:Jn,sectionRightRefs:$n,subSectionLeftRefs:nt,subSectionRightRefs:tt}),ht=pt.expandedSections,xt=pt.setExpandedSections,_t=pt.expandedSubSections,mt=pt.setExpandedSubSections,Rt=pt.toggleSection,yt=t.useCallback(function(n,t,i,o,r,l,c){var a,s,d,v=u.safeStringify(null==t?void 0:t.id)||u.safeStringify(null==i?void 0:i.id)||"",f=(v?Qe[v]:null)||(null==t?void 0:t.cognitiveData)||(null==i?void 0:i.cognitiveData)||{section_id:v,decisioning:[],gap:[],relevance_score:0},g=null!==(s=null===(a=it.current[o])||void 0===a?void 0:a.current)&&void 0!==s?s:null;return{isLoading:null!==(d=null==oe?void 0:oe.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==t?void 0:t.displayTitle)?null==t?void 0:t.title:"no title",refSectionTitle:(null==i?void 0:i.displayTitle)?null==i?void 0:i.title:"no title",cognitiveData:f,anchorEl:n,sectionAnchorEl:g,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==Q?void 0:Q.documents,input_index_map:null==Q?void 0:Q.input_index_map},deviationData:function(){var n,r,l=(null==t?void 0:t.evaluationResult)||(null==i?void 0:i.evaluationResult)||null,c=function(n){var t=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var t=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(t&&n[t])return n[t]}var i=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(i.length&&e[i[0]])return e[i[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return t?e.__assign(e.__assign({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==t?void 0:t.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==t?void 0:t.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==t?void 0:t.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==t?void 0:t.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==t?void 0:t.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==t?void 0:t.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(u.DEVIATION_BADGE_SEPARATOR)))return c(l);var a=o.split(u.DEVIATION_BADGE_SEPARATOR)[1];if(!a)return l;var s=(null==t?void 0:t.evaluationResult)||(null==i?void 0:i.evaluationResult)||{},d=(null===(n=null==s?void 0:s.deviation_entries)||void 0===n?void 0:n[a])||(null===(r=null==s?void 0:s.deviations)||void 0===r?void 0:r[a])||null;return d?e.__assign(e.__assign(e.__assign({},s),d),{deviation_summary:(null==d?void 0:d.deviation_summary)||(null==s?void 0:s.deviation_summary),deviation_title:(null==d?void 0:d.deviation_title)||(null==s?void 0:s.deviation_title),deviation_impact:(null==d?void 0:d.deviation_impact)||(null==s?void 0:s.deviation_impact),deviation_explanation:(null==d?void 0:d.deviation_explanation)||(null==s?void 0:s.deviation_explanation),evaluation_outputs:(null==d?void 0:d.evaluation_outputs)||(null==s?void 0:s.evaluation_outputs),cognitive_decisioning:(null==d?void 0:d.cognitive_decisioning)||(null==s?void 0:s.cognitive_decisioning)}):c(l)}(),isOrphan:!!r}},[Qe,Q]),St=t.useCallback(function(e){Cn(),yn(null),xn(e)},[Cn]),At=function(e,n,t,i,o,r){var l;if(e.stopPropagation(),_n.open&&_n.sectionIdx===o)Cn();else{var c=e.currentTarget,a="left";(null===(l=ln.current)||void 0===l?void 0:l.contains(c))&&(a="right");Xe.current&>(),Ve(new Set),He([]),Ke.current=[],Bn(),An.open?ii():En(),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=Zn.current[l])||void 0===e?void 0:e.current:null===(n=Qn.current[l])||void 0===n?void 0:n.current}return"right"===a?null===(t=Zn.current[o])||void 0===t?void 0:t.current:null===(i=Qn.current[o])||void 0===i?void 0:i.current}()||c;mn(yt(e,n,i,o,t,r))})}},bt=t.useCallback(function(){null!==_n.sectionIdx&&_n.anchorEl?St(e.__assign(e.__assign({},_n),{open:!0})):Cn()},[_n,Cn,St]),Et=t.useCallback(function(){var e=_n.sectionIdx,n=_n.isOrphan;Cn(),En(),null!==e&&(n?Se("No counterpart exists to connect to."):(Xe.current&>(),He([]),Ke.current=[],Ve(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){$e.current&&$e.current()},50)))},[_n.sectionIdx,_n.isOrphan,Cn,En,gt]),It=t.useRef(null),Tt=t.useRef(null),Bt=t.useRef(null),Ct=t.useRef(null),Dt=t.useRef(null),Ot=t.useRef(null),wt=t.useState([]),Nt=wt[0],jt=wt[1];t.useRef(null);var Pt=t.useState(null),Ft=Pt[0],kt=Pt[1];t.useEffect(function(){if(wn){var e=Dn.fields.find(function(e){return e.analysisKey===wn||e.key===wn});if(e){var n=Un.current[e.key]||Xn.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[wn,Dn.fields]);var Mt=t.useCallback(function(e){var n,t,i,o,r,l,u,c,a,s=null===(n=null==ut?void 0:ut.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 f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[ut]),Vt=t.useCallback(function(n,t){var i,o,r,l,c,s,d;void 0===t&&(t="left");var v=null,f=null;if("left"===t)if(v=Ln[n],de&&v){var g=Gn.filter(function(e){var n;return null===(n=v.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)});f=g.find(function(e){return e.evaluationResult})||g[0]}else f=Gn[n];else if(f=Gn[n],de&&f){var p=Ln.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(f.selfIndex)});v=p.find(function(e){return e.evaluationResult})||p[0]}else v=Ln[n];var h=(null==v?void 0:v.relation)&&"not_defined"!==v.relation,x=(null==f?void 0:f.relation)&&"not_defined"!==f.relation,_=!(!(null==v?void 0:v.cognitiveData)&&!(null==f?void 0:f.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==f?void 0:f.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})},[Ln,Gn,Qe,Dn,de]),Lt=t.useCallback(function(n){for(var t,i,o,r,l,c,s,d,v,f=n.split("-").map(Number),g=Ln[f[0]],p=Gn[f[0]],h=1;h<f.length;h++)(null==g?void 0:g.subsections)&&(g=g.subsections[f[h]]),(null==p?void 0:p.subsections)&&(p=p.subsections[f[h]]);if(!g&&!p)return null;var x=(null==g?void 0:g.relation)&&"not_defined"!==g.relation,_=(null==p?void 0:p.relation)&&"not_defined"!==p.relation,m=u.safeStringify(null==g?void 0:g.id)||u.safeStringify(null==p?void 0:p.id)||"",R=!(!(null==g?void 0:g.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==g?void 0:g.cognitiveRelevanceScore)&&void 0!==t?t:null==p?void 0:p.cognitiveRelevanceScore)&&void 0!==i||m&&(null===(o=Qe[m])||void 0===o||o.relevance_score);var y=null!==(l=null!==(r=null==g?void 0:g.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})},[Ln,Gn,Qe,Dn]),Gt=t.useCallback(function(){xt({}),mt({}),gt(),Ve(new Set),He([]),Ke.current=[],En(),Bn(),Cn(),requestAnimationFrame(function(){$e.current&&$e.current()})},[xt,mt,gt,En,Bn,Cn]),Ht=t.useMemo(function(){return Object.values(ht).some(Boolean)||Object.values(_t).some(Boolean)},[ht,_t]),qt=t.useCallback(function(){var e,n,t,i,o,r,l,c,a,s,d,v,f,g,p,h,x,_,m,R,y,S;if(!vn.current&&!ze.current){vn.current=!0;try{if(!It.current)return;var A=function(e){var n=e.split("-"),t=n[0];if(!ht[t]&&!1===de)return!1;if(de&&!ht["left-".concat(t)]&&!ht["right-".concat(t)]&&!ht[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!_t[i])return!1;return!0},b=It.current.getBoundingClientRect();nn({width:b.width,height:b.height});var E=[];if(Hn.forEach(function(e){var n,t,i=e.key,o=null===(n=Un.current[i])||void 0===n?void 0:n.current,r=null===(t=Xn.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")}),!ze.current){for(var I=0;I<Math.max(Ln.length,Gn.length);I++){var T=null===(e=Jn.current[I])||void 0===e?void 0:e.current,B=null===(n=$n.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")}de||Object.keys(nt.current).forEach(function(e){var n,t;if(A(e)){var i=null===(n=nt.current[e])||void 0===n?void 0:n.current,o=null===(t=tt.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={};Hn.forEach(function(e){var n,t,i=e.key,o=null===(n=Un.current[i])||void 0===n?void 0:n.current,r=null===(t=Xn.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(!ze.current)if(de){if(be&&null!==je)if("number"==typeof je){var w=je,N=Ln[w],j=null===(o=Jn.current[w])||void 0===o?void 0:o.current;j&&N&&(N.refIndexes||[]).forEach(function(e){var n,t=Gn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=$n.current[t])||void 0===n?void 0:n.current;if(i&&(ht["left-".concat(w)]||ht["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=je.split(u.DEVIATION_BADGE_SEPARATOR)[2];if(P){T=null===(r=nt.current[P])||void 0===r?void 0:r.current,B=null===(l=tt.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(nt.current).forEach(function(e){var n,t;if(A(e)){var i=null===(n=nt.current[e])||void 0===n?void 0:n.current,o=null===(t=tt.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(Ln.length,Gn.length);I++){var T=null===(t=Jn.current[I])||void 0===t?void 0:t.current,B=null===(i=$n.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(Hn.forEach(function(e){var n,t,i=e.key,o=null===(n=Un.current[i])||void 0===n?void 0:n.current,r=null===(t=Xn.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")}}),ze.current||(Object.entries(D.left).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=Jn.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=$n.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),de||Object.keys(O).forEach(function(e){var n,t,i=null===(n=nt.current[e])||void 0===n?void 0:n.current,o=null===(t=tt.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")}})),de)Ln.forEach(function(e,n){var t;(null===(t=Jn.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=Gn.findIndex(function(n){return n.selfIndex===e});if(-1!==v){var f=null===(t=Qn.current[n])||void 0===t?void 0:t.current,g=null===(i=Zn.current[v])||void 0===i?void 0:i.current;if(f&&g){var p=f.getBoundingClientRect(),h=g.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(be&&je===n){var y=null!==(r=null===(o=dn.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,S=null!==(u=null===(l=ln.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==u?u:0,A=y+(null!==(a=null===(c=dn.current)||void 0===c?void 0:c.clientHeight)&&void 0!==a?a:1/0),I=S+(null!==(d=null===(s=ln.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=Vt(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(Ln.length,Gn.length);I++){var k=null===(c=Jn.current[I])||void 0===c?void 0:c.current,M=null===(a=$n.current[I])||void 0===a?void 0:a.current;if(k&&M){var V=k.getBoundingClientRect(),L=M.getBoundingClientRect(),G=Math.max(V.top,L.top)+18-b.top,H=(null===(s=Gn[I])||void 0===s?void 0:s.id)||"sec-".concat(I);(J=Vt(I))&&E.push({id:H,x1:V.right-b.left,y1:G,x2:L.left-b.left,y2:G,style:J,sectionIdx:I,hasCognitive:!!((null===(d=Ln[I])||void 0===d?void 0:d.cognitiveData)||(null===(v=Gn[I])||void 0===v?void 0:v.cognitiveData)||H&&Qe[H]),isSubSection:!1})}}Object.keys(nt.current).forEach(function(e){var n,t,i,o,r,l;if(A(e)){var c=null===(n=nt.current[e])||void 0===n?void 0:n.current,a=null===(t=tt.current[e])||void 0===t?void 0:t.current;if(c&&a){for(var s=e.split("-").map(Number),d=Ln[s[0]],v=Gn[s[0]],f=1;f<s.length;f++)(null==d?void 0:d.subsections)&&(d=d.subsections[s[f]]),(null==v?void 0:v.subsections)&&(v=v.subsections[s[f]]);var g=!!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(g&&p||h&&x){var _=c.getBoundingClientRect(),m=a.getBoundingClientRect(),R=Math.max(_.top,m.top)+16-b.top,y=Lt(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(be&&"string"==typeof je&&je.includes(u.DEVIATION_BADGE_SEPARATOR)){var q=je.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===(f=Qn.current[K])||void 0===f?void 0:f.current,X=null===(g=Zn.current[K])||void 0===g?void 0:g.current;if(U&&X){var J,$=U.getBoundingClientRect(),Q=X.getBoundingClientRect(),Z=$.right-b.left,ee=Q.left-b.left,ne=$.top+$.height/2-b.top,te=Q.top+Q.height/2-b.top;if(de){var ie=null!==(h=null===(p=dn.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==h?h:0,oe=null!==(_=null===(x=ln.current)||void 0===x?void 0:x.getBoundingClientRect().top)&&void 0!==_?_:0,re=ie+(null!==(R=null===(m=dn.current)||void 0===m?void 0:m.clientHeight)&&void 0!==R?R:1/0),le=oe+(null!==(S=null===(y=ln.current)||void 0===y?void 0:y.clientHeight)&&void 0!==S?S:1/0),ue=function(e,n,t){return Math.max(n,Math.min(t,e))};ne=ue($.top+$.height/2,ie,re)-b.top,te=ue(Q.top+Q.height/2,oe,le)-b.top}(J=Lt(Y))&&E.push({id:"line-subsec-".concat(K),x1:Z,y1:ne,x2:ee,y2:te,style:J,sectionIdx:Number(Y.split("-")[0]),isSubSection:!0,subSectionKeyPath:je})}}if(jt(E),Dt.current&&Ot.current){var ce=Dt.current.getBoundingClientRect(),ae=Ot.current.getBoundingClientRect(),se=(ce.top+ce.height/2-b.top+ae.top+ae.height/2-b.top)/2;kt({x1:ce.right-b.left,x2:ae.left-b.left,y:se})}else kt(null);if(Me.size>0){var ve=[],fe=dn.current,ge=ln.current;if(fe&&ge){var pe=[],he=fe.getBoundingClientRect().top,xe=ge.getBoundingClientRect().top,_e=he+fe.clientHeight,me=xe+ge.clientHeight,Re=fe.scrollTop,ye=ge.scrollTop,Se=b.top,Ae=function(e,n,t){return Math.max(n,Math.min(t,e))};Me.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=Qn.current[d])||void 0===n?void 0:n.current,f=null===(t=Zn.current[d])||void 0===t?void 0:t.current;if(!v||!f)return;var g=v.getBoundingClientRect(),p=f.getBoundingClientRect(),h=Lt(s),x=(j=g.right-b.left)+.5*((P=p.left-b.left-0)-j),_=g.top+g.height/2,m=p.top+p.height/2,R=_-he+Re,y=m-xe+ye,S="conn-subsec-".concat(d);pe.push({lhsScrollY:R,rhsScrollY:y,x1:j,x2:P,containerTop:Se,leftIdx:e,rhsArrayIdx:e,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:S});var A=Ae(_,he,_e),E=Ae(m,xe,me),I=A-Se,T=E-Se,B=m>=xe-4&&m<=me+4,C="";C=(F=_>=he-4&&_<=_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),ve.push({id:S,pathD:C,style:h,leftIdx:e,rhsArrayIdx:e})}else if(de){var D=e,O=Ln[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=Gn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=Qn.current[D])||void 0===n?void 0:n.current,r=null===(t=Zn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect(),a=Vt(D),s=l.right-b.left,d=c.left-b.left-0,v=s+.5*(d-s),f=l.top+l.height/2,g=c.top+c.height/2,p=f-he+Re,h=g-xe+ye,x="conn-".concat(D,"-").concat(i);pe.push({lhsScrollY:p,rhsScrollY:h,x1:s,x2:d,containerTop:Se,leftIdx:D,rhsArrayIdx:i,styleColor:(null==a?void 0:a.badgeBorder)||"#6366F1",styleId:x});var _=Ae(f,he,_e),m=Ae(g,xe,me),R=_-Se,y=m-Se,S=f>=he-4&&f<=_e+4,A=g>=xe-4&&g<=me+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),ve.push({id:x,pathD:E,style:a,leftIdx:D,rhsArrayIdx:i})}}})}else{var w=e,N=w;v=null===(i=Qn.current[w])||void 0===i?void 0:i.current,f=null===(o=Zn.current[N])||void 0===o?void 0:o.current;if(!v||!f)return;var j,P;g=v.getBoundingClientRect(),p=f.getBoundingClientRect(),h=Vt(w),x=(j=g.right-b.left)+.5*((P=p.left-b.left-0)-j),_=g.top+g.height/2,m=p.top+p.height/2,R=_-he+Re,y=m-xe+ye,S="conn-".concat(w,"-").concat(N);pe.push({lhsScrollY:R,rhsScrollY:y,x1:j,x2:P,containerTop:Se,leftIdx:w,rhsArrayIdx:N,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:S});var F;A=Ae(_,he,_e),E=Ae(m,xe,me),I=A-Se,T=E-Se,B=m>=xe-4&&m<=me+4,C="";C=(F=_>=he-4&&_<=_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),ve.push({id:S,pathD:C,style:h,leftIdx:w,rhsArrayIdx:N})}}),Ke.current=pe}He(ve)}else He([]),Ke.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{vn.current=!1}}},[Hn,Ln,Gn,Qe,Dn,Mt,Vt,de,be,je,Me,ht,_t]),zt=t.useCallback(function(){var e,n,t,i,o,r,l,c,a,s,d,v,f,g,p=Ke.current;if(p.length&&!ze.current){var h=null!==(n=null===(e=dn.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,x=null!==(i=null===(t=ln.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,_=null!==(r=null===(o=dn.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(c=null===(l=ln.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,R=null!==(s=null===(a=dn.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==s?s:0,y=null!==(v=null===(d=ln.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==v?v:0,S=R+_,A=y+m,b=null!==(g=null===(f=It.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==g?g: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=Ye.current[e.styleId+"-stroke"],o=Ye.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,f=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(f,",").concat(a," L ").concat(f,",").concat(s):!d&&v?"M ".concat(f,",").concat(a," L ").concat(f,",").concat(s," L ").concat(e.x2,",").concat(s):"M ".concat(f,",").concat(a," L ").concat(f,",").concat(s),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);t.useEffect(function(){$e.current=qt},[qt]);var Wt=t.useRef(null),Yt=t.useRef(null),Kt=t.useCallback(function(){Ke.current.length>0&&!ze.current||(null!==Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(function(){$e.current(),Wt.current=null},50))},[]),Ut=t.useCallback(function(){we(!0),Ce(!1),null!==Yt.current&&clearTimeout(Yt.current),null!==Wt.current&&(clearTimeout(Wt.current),Wt.current=null),Yt.current=setTimeout(function(){var e,n,t,i,o,r,l,c,a,s;if(Ke.current=[],Xe.current&&null!==Je.current&&null!==Bt.current){var d=Je.current,v=Bt.current,f=null,g=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]);f=(null===(e=Qn.current[_])||void 0===e?void 0:e.current)||null,g=(null===(n=Zn.current[_])||void 0===n?void 0:n.current)||null,p=(null===(t=nt.current[x[2]])||void 0===t?void 0:t.current)||(null===(i=Jn.current[Number(x[2])])||void 0===i?void 0:i.current)||null,h=(null===(o=tt.current[x[3]])||void 0===o?void 0:o.current)||(null===(r=$n.current[Number(x[3])])||void 0===r?void 0:r.current)||null}else f=(null===(l=it.current[d])||void 0===l?void 0:l.current)||null,p=(null===(c=Jn.current[d])||void 0===c?void 0:c.current)||null,g=(null===(a=et.current[v])||void 0===a?void 0:a.current)||null,h=(null===(s=$n.current[v])||void 0===s?void 0:s.current)||null;if(f&&g&&p&&h){if(p.style.paddingTop="0px",h.style.paddingTop="0px",!de){var m=f.getBoundingClientRect(),R=g.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=dn.current,A=ln.current;if(S&&A){var b=f.getBoundingClientRect().top-S.getBoundingClientRect().top+S.scrollTop,E=g.getBoundingClientRect().top-A.getBoundingClientRect().top+A.scrollTop-(b-S.scrollTop);Math.abs(A.scrollTop-E)>1&&(A.scrollTop=E)}}}$e.current(),Xe.current&&Ce(!0),we(!1),Yt.current=null},150)},[de,Ln,Gn]),Xt=t.useCallback(function(e){var n,t,i,o,r,l,c,a,s,d;if(null!==fn.current&&gn.current&&Math.abs(e.currentTarget.scrollTop-fn.current)<=2){var v=gn.current;fn.current=null,gn.current=null,v()}if(!Fe.current){if(de||Kt(),Xe.current){var f=Je.current,g=Bt.current,p=dn.current,h=ln.current;if(null!==f&&null!==g&&p&&h){var x="string"==typeof f&&f.includes(u.DEVIATION_BADGE_SEPARATOR)?null===(n=Qn.current["".concat(f.split(u.DEVIATION_BADGE_SEPARATOR)[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(f.split(u.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===n?void 0:n.current:null===(t=it.current[f])||void 0===t?void 0:t.current,_="string"==typeof g&&g.includes(u.DEVIATION_BADGE_SEPARATOR)?null===(i=Zn.current["".concat(g.split(u.DEVIATION_BADGE_SEPARATOR)[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(g.split(u.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===i?void 0:i.current:null===(o=et.current[g])||void 0===o?void 0:o.current;if(x&&_&&Ct.current){var m=void 0,R=void 0;if("string"==typeof f&&f.includes(u.DEVIATION_BADGE_SEPARATOR)){var y=f.split(u.DEVIATION_BADGE_SEPARATOR),S="".concat(y[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(y[1]);m=null===(r=Qn.current[S])||void 0===r?void 0:r.current,R=null===(l=Zn.current[S])||void 0===l?void 0:l.current}else m=null===(c=Qn.current[f])||void 0===c?void 0:c.current,R=null===(a=Zn.current[g])||void 0===a?void 0:a.current;var A=null!==(d=null===(s=It.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,N=E,Math.max(w,Math.min(N,O)))-A).toString();Ct.current.setAttribute("y1",C),Ct.current.setAttribute("y2",C);var D=B>=b-4&&B<=E+4;Ct.current.setAttribute("visibility",D?"visible":"hidden")}}}}var O,w,N;Ke.current.length>0&&!Ue.current&&(Ue.current=!0,requestAnimationFrame(function(){zt(),Ue.current=!1}))}},[zt,de,Kt]),Jt=t.useRef(0),$t=t.useRef(0),Qt=t.useRef(0),Zt=t.useRef(function(){});t.useRef(null),t.useEffect(function(){Zt.current=Ut},[Ut]),t.useEffect(function(){var e=setTimeout(Kt,250),n=function(){return Zt.current()};return window.addEventListener("resize",n),function(){clearTimeout(e),null!==Wt.current&&clearTimeout(Wt.current),null!==Yt.current&&clearTimeout(Yt.current),window.removeEventListener("resize",n)}},[Mn,Vn,ut,Hn,ht,_t,Ln,Gn,Dn,Kt,be,je,Be,Me]),t.useEffect(function(){var e=function(e,n,t,i,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){var r,l,u;t.current=null;var c=e[e.length-1];if(c){var a=null!==(u=null===(l=null===(r=c.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:c.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,i())}})});return r.observe(e),r},n={current:null},t={current:null},i={current:null},o=[],r=[n,t,i];return rn.current&&o.push(e(rn.current,Jt,n,function(){return Zt.current()},function(){})),on.current&&o.push(e(on.current,$t,t,function(){return Zt.current()},function(){return $e.current()})),It.current&&o.push(e(It.current,Qt,i,function(){return Zt.current()},function(){return $e.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),t.useEffect(function(){Xe.current=be},[be]),t.useEffect(function(){Je.current=je},[je]);var ei=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";Cn(),null!=e&&(n?Se("No counterpart exists for this section."):be&&je===e?r?gt():null==l||l():(Ve(new Set([e])),He([]),Ke.current=[],me(!0),Fe.current=!0,Pe(e),Je.current=e,Ee(!0),Xe.current=!0,Ce(!1),un.current&&(un.current.style.height="0px"),cn.current&&(cn.current.style.height="0px"),an.current&&(an.current.style.height="0px"),sn.current&&(sn.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 f=e.split(u.DEVIATION_BADGE_SEPARATOR),g="".concat(f[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(f[1]);s=(null===(n=Qn.current[g])||void 0===n?void 0:n.current)||null,d=(null===(t=Zn.current[g])||void 0===t?void 0:t.current)||null,v=d?e:null}else if(s=(null===(i=it.current[e])||void 0===i?void 0:i.current)||null,de){var p=Ln[e],h=(null==p?void 0:p.refIndexes)||[];if(h.length>0){var x=h[0],_=Gn.findIndex(function(e){return e.selfIndex===x});-1!==_&&(d=(null===(r=et.current[_])||void 0===r?void 0:r.current)||null,v=_)}}else d=(null===(o=et.current[e])||void 0===o?void 0:o.current)||null,v=d?e:null;Bt.current=v;var m=dn.current,R=ln.current,y=function(){!function(){var n,t,i,o,r,l,c,s,d,f,g,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=nt.current[R[2]])||void 0===n?void 0:n.current)||(null===(t=Jn.current[Number(R[2])])||void 0===t?void 0:t.current)||null,x=(null===(i=tt.current[R[3]])||void 0===i?void 0:i.current)||(null===(o=$n.current[Number(R[3])])||void 0===o?void 0:o.current)||null,_=(null===(r=Qn.current[y])||void 0===r?void 0:r.current)||h,m=(null===(l=Zn.current[y])||void 0===l?void 0:l.current)||x}else{var S=Number(e),A=null!==v?Number(v):S;h=(null===(c=Jn.current[S])||void 0===c?void 0:c.current)||null,x=(null===(s=$n.current[A])||void 0===s?void 0:s.current)||null,_=(null===(d=Qn.current[S])||void 0===d?void 0:d.current)||(null===(f=it.current[S])||void 0===f?void 0:f.current)||h,m=(null===(g=Zn.current[A])||void 0===g?void 0:g.current)||(null===(p=et.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"))}}(),Ce(!0),$e.current&&$e.current(),Fe.current=!1,"right"===c&&R?R.dispatchEvent(new Event("scroll")):m&&m.dispatchEvent(new Event("scroll")),me(!1),null==l||l()};if(!s||!m)return Fe.current=!1,me(!1),void(null==l||l());if(d&&R){if(!de){var S=0;S="right"===c?d?d.getBoundingClientRect().top:0:s?s.getBoundingClientRect().top:0;var A=on.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&&un.current&&(un.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 cn.current&&(cn.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&&an.current&&(an.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 sn.current&&(sn.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()})))},[je,Cn,Gn,be,de,Ln,gt]),ni=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;Bn();var c="left";(null===(o=ln.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=Zn.current[l])||void 0===e?void 0:e.current:null===(t=Qn.current[l])||void 0===t?void 0:t.current}return"right"===c?null===(i=Zn.current[n])||void 0===i?void 0:i.current:null===(o=Qn.current[n])||void 0===o?void 0:o.current};if(t)return gt(),Ve(new Set),He([]),Ke.current=[],void(r&&requestAnimationFrame(function(){var e=a()||l;bn({open:!0,anchorEl:e,summary:i})}));ei(n,t,r?{toggleIfSame:!1,sourceSide:c,onReady:function(){var e=a()||l;bn({open:!0,anchorEl:e,summary:i})}}:{toggleIfSame:!1,sourceSide:c})},[ei,Bn,bn,gt]),ti=t.useCallback(function(){var e,n=_n.sectionIdx,t=_n.isOrphan;if(En(),null!=n){var i="left";_n.anchorEl&&(null===(e=ln.current)||void 0===e?void 0:e.contains(_n.anchorEl))&&(i="right"),ei(n,t,{sourceSide:i})}},[ei,_n.isOrphan,_n.sectionIdx,_n.anchorEl,En]),ii=t.useCallback(function(){En(),gt(),Ve(new Set),He([]),Ke.current=[]},[En,gt]),oi=null!==_n.sectionIdx&&Me.has(_n.sectionIdx),ri=_.useDeviationNavigation({proposedSections:Ln,existingSections:Gn,parentDeviationRecord:qn,expandedSections:ht,maintainRelativeOrder:!!de,scrollContainerRef:on,leftContainerRef:dn,lhsBadgeRefs:Qn,rhsBadgeRefs:Zn}),li=ri.showDeviationNavigation,ui=ri.showOpenNodeRef,ci=t.useMemo(function(){if(!ce)return null;var e=ce.split(":")[0];for(var n in qn){if((qn[n]||[]).some(function(n){return n.id===e}))return n}return null},[ce,qn]),ai=t.useRef(null),si=t.useRef(null);t.useEffect(function(){if(ce&&ai.current!==ce){var n=ce.split(":"),t=n[0],i=n[1],o=null!=i?i:"0";si.current!==ce&&(En(),Bn(),gt(),Ve(new Set),He([]),Ke.current=[],si.current=ce);var r=!1,l=0,c=null,a=150,s=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},d=function(){var n,i,v,f;if(!r){var g=null,p=null;for(var h in qn){var x=qn[h].find(function(e){return e.id===t});if(x){g=h,p=x;break}}if(p&&g){var _=Ln.findIndex(function(e){return e.id===g}),m=Gn.findIndex(function(e){return e.id===g}),R=-1===_&&-1!==m,y=s(Ln,p.id),S=s(Gn,p.id);if(y&&!S&&!R){var A=y.split("-"),b=Number(A[0]);if(de){var E=null===(i=null===(n=Ln[b])||void 0===n?void 0:n.refIndexes)||void 0===i?void 0:i[0],I=Gn.findIndex(function(e){return e.selfIndex===E});-1!==I&&(b=I)}S=e.__spreadArray([b],A.slice(1),!0).join("-")}if(y||S){var T=R||!y&&!!S,B=y?Number(y.split("-")[0]):_,C=S?Number(S.split("-")[0]):m;if(T){if(!(de?!!ht["right-".concat(C)]:!!ht[String(C)])&&C>=0)return Rt(C,"right"),l+=1,void(c=setTimeout(d,450))}else if(!(de?!!ht["left-".concat(B)]:!!ht[String(B)])&&B>=0)return Rt(B,"left"),l+=1,void(c=setTimeout(d,450));var D,O=y||"",w=S||"",N="".concat(p.id).concat(u.DEVIATION_BADGE_SEPARATOR).concat(o).concat(u.DEVIATION_BADGE_SEPARATOR).concat(O).concat(u.DEVIATION_BADGE_SEPARATOR).concat(w),j="".concat(p.id).concat(u.DEVIATION_BADGE_SEPARATOR).concat(o),P=null===(v=Qn.current[j])||void 0===v?void 0:v.current,F=null===(f=Zn.current[j])||void 0===f?void 0:f.current,k=T||!P&&!!F,M=k?F:P;if(D=de?k?ln.current:dn.current:on.current,M&&D){var V=M.getBoundingClientRect();if(0===V.height)return void((l+=1)<20&&(c=setTimeout(d,a)));var L=D.getBoundingClientRect(),G=V.top-L.top+D.scrollTop-L.height/2+V.height/2,H=function(){var n,t,i,l,u;if(!r){ai.current=ce;var c=window.getComputedStyle(M).color;P&&(P.style.transition="box-shadow 300ms ease-in-out",P.style.boxShadow="0 0 10px ".concat(c)),F&&(F.style.transition="box-shadow 300ms ease-in-out",F.style.boxShadow="0 0 10px ".concat(c)),setTimeout(function(){P&&(P.style.boxShadow=""),F&&(F.style.boxShadow="")},2e3);var a=(null===(t=null===(n=p.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===t?void 0:t[o])||p,s=(null===(i=p.evaluationResult)||void 0===i?void 0:i.evaluation_outputs)||p.evaluation_outputs;if(!(!!P&&!!F)){var d=k?(null===(l=Zn.current[j])||void 0===l?void 0:l.current)||F:(null===(u=Qn.current[j])||void 0===u?void 0:u.current)||P;return bn({open:!0,anchorEl:d,summary:e.__assign(e.__assign({},a),{evaluation_outputs:s})}),void(null==ae||ae())}ei(N,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var n,t=(null===(n=Qn.current[j])||void 0===n?void 0:n.current)||P;bn({open:!0,anchorEl:t,summary:e.__assign(e.__assign({},a),{evaluation_outputs:s})})}})}};Math.abs(D.scrollTop-G)<=2?H():(fn.current=G,gn.current=H,D.scrollTo({top:G,behavior:"smooth"}),c&&clearTimeout(c),c=setTimeout(function(){if(gn.current){fn.current=null;var e=gn.current;gn.current=null,e()}},800))}else(l+=1)<20&&(c=setTimeout(d,a))}else(l+=1)<20&&(c=setTimeout(d,a))}else(l+=1)<20&&(c=setTimeout(d,a))}};return c=setTimeout(d,a),function(){r=!0,c&&clearTimeout(c)}}},[ce,qn,Ln,Gn,de,ht,Rt,ei,bn]);var di=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:_t,setExpandedSubSections:mt,maintainRelativeOrder:de||!1,proposedSections:Ln,existingSections:Gn,treeData:Q,deviationNumberRegistry:zn,connectedSections:Me,activeSideBySideSection:je,resolvedMarkdownStyles:tn,getSubSectionRef:rt,getSubSectionCompareStyle:Lt,getBadgeRef:lt,openMoreFunctionsPopup:At,openSummaryPopup:ni,showDeviationBadges:fe,resetSideBySide:gt,setConnectedSections:Ve,setConnectedLines:He,cachedConnectedPositions:Ke})};return n.jsxs(i.Box,e.__assign({ref:rn,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},de?{}:{overflow:"visible"}),{position:"relative"})},{children:[pe&&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:Tt.current,clipTopEl:Dt.current,scrollContainerEl:on.current,onClose:ii,summary:An.summary}),n.jsx(d.default,{open:_n.open,anchorEl:_n.anchorEl,sectionTitle:_n.sectionTitle,referenceSectionTitle:_n.refSectionTitle,onClose:Cn,onOpenCognitiveCompare:bt,onOpenSideBySide:ti,onConnect:Et,isConnected:oi,isOrphan:_n.isOrphan}),hn.open&&n.jsx(s.default,{open:hn.open,popupRef:Tn,position:Rn,popupConfig:re,onClose:function(){yn(null),xn(function(n){return e.__assign(e.__assign({},n),{open:!1})}),In(null)},markdownStyles:te,sectionTitle:hn.sectionTitle,referenceSectionTitle:hn.refSectionTitle,cognitiveData:hn.cognitiveData,anchorEl:hn.anchorEl,sectionAnchorEl:hn.sectionAnchorEl,scrollContainerEl:on.current,badgeStyle:hn.badgeStyle,docData:hn.docData,deviationData:hn.deviationData,isLoading:hn.isLoading}),n.jsx(i.Snackbar,e.__assign({open:!!ye,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:ye}))})),n.jsx(m.default,{componentHeaderText:$,displayConfig:oe,maintainRelativeOrder:de,onCollapseAll:Gt,showCollapseAll:Ht,onToggleView:function(e){he(!0),setTimeout(function(){ve(!e),gt(),En(),Ve(new Set),He([]),Ke.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){he(!1)},600)})})},50)}}),n.jsx(i.Box,e.__assign({ref:on,onScroll:Xt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:de?"hidden":"auto",borderTop:ct&&at?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(i.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},de?{flex:1,minHeight:0}:{})},{children:n.jsxs(i.Box,e.__assign({ref:It,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},de?{flex:1,overflow:"visible"}:{})},{children:[n.jsxs("svg",e.__assign({ref:qe,style:{position:"absolute",top:0,left:0,width:en.width||"100%",height:en.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:Oe?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[Ft&&n.jsx("g",{children:n.jsx("line",{x1:Ft.x1,y1:Ft.y,x2:Ft.x2,y2:Ft.y,stroke:ft.badgeBorder,strokeWidth:"1.5"})}),Nt.map(function(t){var l,c,s,d,v,g,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?be&&je===t.subSectionKeyPath&&Be:be&&je===t.sectionIdx&&Be)return null;if(!de){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),_=Ln[t.sectionIdx]||{title:"",content:""},m=Gn[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=Ln[A[0]]),b.length>0&&(I=Gn[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===(g=null===(v=null===(d=_.evaluationResult)||void 0===d?void 0:d.cognitive_decisioning)||void 0===v?void 0:v.decisioning_factors)||void 0===g?void 0:g.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&&(hn.open&&Sn===t.id?Bn():(In(t.id),St(yt(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(f.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:hn.open&&Sn===t.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},t.id)}return null}),Ge.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){Ye.current[u]=e},d:o,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),n.jsx("path",{ref:function(e){Ye.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)"},de?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(i.Box,e.__assign({ref:Dt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:n.jsx(i.Tooltip,e.__assign({title:Pn,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:Pn}))}))})),n.jsxs(i.Box,e.__assign({ref:dn,onScroll:Xt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},de?{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:an,style:{width:"100%",height:"0px",flexShrink:0}}),Yn&&Ln.map(function(t,r){var l,c,a=!t.title&&!t.content;if(de&&a)return null;var s=t,d=Vt(r,"left"),v=de?!(null===(l=s.refIndexes)||void 0===l?void 0:l.length)||s.selfIndex<0:!Gn[r],g=de?"number"==typeof s.selfIndex&&s.selfIndex>=0?s.selfIndex+1:null:r+1,p=Me.has(r),h=u.extractDeviationScore(s.evaluationResult,null==d?void 0:d.deviationLabel);return n.jsx(i.Box,e.__assign({ref:ot(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:Jn.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:ot("left-accordion-".concat(r)),mb:0,treeData:Q,proposedSections:Ln,existingSections:Gn,deviationNumberRegistry:zn,getSectionCompareStyle:Vt,getBadgeRef:lt,connectedSections:Me,openMoreFunctionsPopup:At,openSummaryPopup:ni,deviationNodeIdToView:ce,deviationTargetParentId:ci,parentNodeId:(null===(c=null==Q?void 0:Q.input_index_map)||void 0===c?void 0:c[0])||"",isExpanded:de?!!ht["left-".concat(r)]:!!ht[String(r)],onToggle:function(){ii(),Rt(r,"left")},navigation:t.id?li[t.id]:null,showOpenNodeRef:ui,resolvedMarkdownStyles:tn,maintainRelativeOrder:de,showDeviationBadges:fe,renderSubSections:di})})),de&&d&&n.jsxs(i.Box,e.__assign({ref:Qn.current[r],onClick:function(e){var n=de?Gn.find(function(e){var n;return null===(n=s.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Gn[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!==g&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(d.badgeBorder)}},{children:g})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!oe.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(f.default,{color:d.badgeText})})),n.jsx(o.EllipsisVertical,{size:11,color:d.badgeText})]}))]}))}),"left-row-".concat(r))}),n.jsx("div",{ref:sn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(i.Box,e.__assign({ref:Tt,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(),hn.open&&Sn===st?Bn():(In(st),St(yt(n.currentTarget,{title:"",content:"",evaluationResult:dt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,st,!0,e.__assign(e.__assign({},ft),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:ft.badgeBg,color:ft.badgeText,border:"1px solid ".concat(ft.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=vt?vt:n.jsx(f.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:hn.open&&Sn===st?"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},de?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[_e&&n.jsx(l.default,{sections:11}),n.jsx(i.Box,e.__assign({ref:Ot,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:Fn,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:Fn}))}))})),n.jsxs(i.Box,e.__assign({ref:ln,onScroll:Xt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},de?{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:un,style:{width:"100%",height:"0px",flexShrink:0}}),Yn&&Gn.map(function(t,o){var r,l=t,u=[],c=!1,a=null,s=-1;if(de){u=Ln.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=Ln.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0});var d=Ln.findIndex(function(e,n){var t;return Me.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(c=-1!==d)&&(a=Vt(d))}else u=[o+1],(c=Me.has(o))&&(a=Vt(o));var v=Vt(de&&-1!==s?s:o);return n.jsx(i.Box,e.__assign({ref:et.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:$n.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:ot("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==Q?void 0:Q.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:de?!!ht["right-".concat(o)]:!!ht[String(o)],treeData:Q,proposedSections:Ln,existingSections:Gn,deviationNumberRegistry:zn,getBadgeRef:lt,getSectionCompareStyle:Vt,connectedSections:Me,openMoreFunctionsPopup:At,openSummaryPopup:ni,deviationNodeIdToView:ce,deviationTargetParentId:ci,onToggle:function(){ii(),Rt(o,"right")},navigation:t.id?li[t.id]:null,showOpenNodeRef:ui,resolvedMarkdownStyles:tn,maintainRelativeOrder:de,showDeviationBadges:fe,renderSubSections:di})})),de&&v&&n.jsx(i.Box,e.__assign({ref:Zn.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:cn,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"),f=require("./components/ThreeDotsLoader.js"),g=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(b){var A,E,T,I,B,C,D,O,w,N,j,P,F,k,M,V,L,G,H,q,z,W,Y,K,U,X,J=b.componentHeaderText,$=void 0===J?a.DEFAULT_COMPONENT_HEADER_TEXT:J,Q=b.treeData,Z=b.comparisonConfig,ee=b.leftColumnTitleText,ne=b.rightColumnTitleText,te=b.markdownStyles,ie=b.resetTrigger,oe=b.displayConfig,re=void 0===oe?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!0}:oe,le=b.popupConfig,ue=b.deviationData,ce=void 0===ue?{}:ue,ae=b.deviationNodeIdToView,se=b.resetDeviationNodeId,de=t.useState(re.maintainRelativeOrder),ve=de[0],fe=de[1],ge=!!ve||!!(null==re?void 0:re.showDeviationBadges),pe=t.useState(!1),he=pe[0],xe=pe[1],_e=t.useState(!1),me=_e[0],Re=_e[1],ye=t.useState(null),Se=ye[0],be=ye[1],Ae=t.useState(!1),Ee=Ae[0],Te=Ae[1],Ie=t.useState(null===(E=null!==(A=null==Q?void 0:Q.newEvaluationResult)&&void 0!==A?A:null==re?void 0:re.enableDeviationSchemaBackwardCompatibility)||void 0===E||E)[0],Be=t.useState(!1),Ce=Be[0],De=Be[1],Oe=t.useState(!1),we=Oe[0],Ne=Oe[1],je=t.useState(null),Pe=je[0],Fe=je[1],ke=t.useRef(!1),Me=t.useState(new Set),Ve=Me[0],Le=Me[1],Ge=t.useState([]),He=Ge[0],qe=Ge[1],ze=t.useRef(null),We=t.useRef(!1),Ye=t.useRef(null),Ke=t.useRef({}),Ue=t.useRef([]),Xe=t.useRef(!1),Je=t.useRef(!1),$e=t.useRef(null),Qe=t.useRef(function(){}),Ze=t.useMemo(function(){return(null==Q?void 0:Q.cognitive_decisioning)||{}},[Q]),en=t.useState({width:0,height:0}),nn=en[0],tn=en[1],on=t.useMemo(function(){return e.__assign(e.__assign({},c.SHARED_MARKDOWN_STYLES),te)},[te]),rn=t.useRef(null),ln=t.useRef(null),un=t.useRef(null),cn=t.useRef(null),an=t.useRef(null),sn=t.useRef(null),dn=t.useRef(null),vn=t.useRef(null),fn=t.useRef(!1),gn=t.useRef(null),pn=t.useRef(null),hn=p.useComparePopups(rn),xn=hn.cognitivePopup,_n=hn.setCognitivePopup,mn=hn.moreFunctions,Rn=hn.setMoreFunctions,yn=hn.position,Sn=hn.setPosition,bn=hn.activeBadgeId,An=hn.summaryPopup,En=hn.setSummaryPopup,Tn=hn.closeSummaryPopup,In=hn.setActiveBadgeId,Bn=hn.popupRef,Cn=hn.closeCognitivePopup,Dn=hn.closeMoreFunctionsPopup,On=t.useMemo(function(){var e,n,t,i,o,r,l;return{fields:null!==(e=null==Z?void 0:Z.fields)&&void 0!==e?e:c.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(t=null===(n=null==Z?void 0:Z.thresholds)||void 0===n?void 0:n.high)&&void 0!==t?t:c.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(i=null==Z?void 0:Z.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:c.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==Z?void 0:Z.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:c.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[Z]),wn=t.useState(null),Nn=wn[0];wn[1];var jn=null===(B=null===(T=null==Q?void 0:Q.documents)||void 0===T?void 0:T[null===(I=null==Q?void 0:Q.input_index_map)||void 0===I?void 0:I[0]])||void 0===B?void 0:B.title,Pn=null===(O=null===(C=null==Q?void 0:Q.documents)||void 0===C?void 0:C[null===(D=null==Q?void 0:Q.input_index_map)||void 0===D?void 0:D[1]])||void 0===O?void 0:O.title,Fn=u.safeStringify(ee||jn||"Uploaded Contract"),kn=u.safeStringify(ne||Pn||"Reference Template"),Mn=g.useCognitiveTreeData(Q,ve,ce,On,Ie),Vn=Mn.activeProposed,Ln=Mn.existingRule,Gn=Mn.proposedSections,Hn=Mn.existingSections,qn=Mn.visibleFields,zn=Mn.parentDeviationRecord,Wn=Mn.deviationNumberRegistry,Yn=Mn.parseError;t.useEffect(function(){Yn&&be("Failed to load comparison: ".concat(Yn))},[Yn]);var Kn=Gn.length>0||Hn.length>0,Un=h.useSectionRefs(qn.map(function(e){return e.key}),Math.max(Gn.length,Hn.length)),Xn=Un.leftRefs,Jn=Un.rightRefs,$n=Un.sectionLeftRefs,Qn=Un.sectionRightRefs,Zn=Un.lhsBadgeRefs,et=Un.rhsBadgeRefs,nt=Un.sectionRightRowRefs,tt=Un.subSectionLeftRefs,it=Un.subSectionRightRefs,ot=Un.sectionRowRefs,rt=Un.getSectionRowRef,lt=Un.getSubSectionRef,ut=Un.getBadgeRef,ct=Ln.analysis,at=u.safeStringify(null===(N=null===(w=null==ct?void 0:ct.rule_difference_comparison)||void 0===w?void 0:w.summary)||void 0===N?void 0:N.overall_summary),st=!!at.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),dt=null!==(j=null==Q?void 0:Q.base_root_id)&&void 0!==j?j:"-1";null==Q||Q[dt];var vt=Ie?null!==(Y=null!==(q=ce&&(null===(H=null==ce?void 0:ce[dt])||void 0===H?void 0:H.evaluation_result))&&void 0!==q?q:null===(W=null===(z=null==Q?void 0:Q.nodes)||void 0===z?void 0:z[dt])||void 0===W?void 0:W.evaluation_result)&&void 0!==Y?Y:null:null!==(G=null!==(k=ce&&(null===(F=null===(P=null==ce?void 0:ce[dt])||void 0===P?void 0:P.evaluation_result)||void 0===F?void 0:F[0]))&&void 0!==k?k:null===(L=null===(V=null===(M=null==Q?void 0:Q.nodes)||void 0===M?void 0:M[dt])||void 0===V?void 0:V.evaluation_result)||void 0===L?void 0:L[0])&&void 0!==G?G:null,ft=u.extractDeviationScore(vt),gt=u.generateColorPalette(null!==(X=null===(U=null===(K=null==vt?void 0:vt.evaluation_outputs)||void 0===K?void 0:K.metadata)||void 0===U?void 0:U.label_color)&&void 0!==X?X:""),pt=t.useCallback(function(){var e,n,t,i,o,r;Te(!1),Je.current=!1;var l=$e.current,c=Dt.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=tt.current[a[2]])||void 0===e?void 0:e.current)||(null===(n=$n.current[Number(a[2])])||void 0===n?void 0:n.current))&&(s.style.paddingTop="0px")}else{var s;(s=null===(t=$n.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=it.current[a[3]])||void 0===i?void 0:i.current)||(null===(o=Qn.current[Number(a[3])])||void 0===o?void 0:o.current))&&(d.style.paddingTop="0px")}else{var d;(d=null===(r=Qn.current[c])||void 0===r?void 0:r.current)&&(d.style.paddingTop="0px")}Fe(null),$e.current=null,Dt.current=null,De(!1),Re(!1),cn.current&&(cn.current.style.height="0px"),an.current&&(an.current.style.height="0px"),sn.current&&(sn.current.style.height="0px"),dn.current&&(dn.current.style.height="0px")},[]),ht=t.useCallback(function(){pt(),Le(new Set),qe([]),Ue.current=[],En(a.EMPTY_SUMMARY_POPUP_STATE)},[]);t.useEffect(function(){ht()},[ie]);var xt=x.useAccordionState({maintainRelativeOrder:!!ve,proposedSections:Gn,existingSections:Hn,activeSideBySideSection:Pe,connectedSections:Ve,resetSideBySide:pt,setConnectedSections:Le,setConnectedLines:qe,cachedConnectedPositions:Ue,svgContainerRef:ze,isAnimatingRef:We,animationTimerRef:Ye,calculateLinesRef:Qe,sectionLeftRefs:$n,sectionRightRefs:Qn,subSectionLeftRefs:tt,subSectionRightRefs:it}),_t=xt.expandedSections,mt=xt.setExpandedSections,Rt=xt.expandedSubSections,yt=xt.setExpandedSubSections,St=xt.toggleSection,bt=t.useCallback(function(n,t,i,o,r,l,c){var a,s,d,v=u.safeStringify(null==t?void 0:t.id)||u.safeStringify(null==i?void 0:i.id)||"",f=(v?Ze[v]:null)||(null==t?void 0:t.cognitiveData)||(null==i?void 0:i.cognitiveData)||{section_id:v,decisioning:[],gap:[],relevance_score:0},g=null!==(s=null===(a=ot.current[o])||void 0===a?void 0:a.current)&&void 0!==s?s:null;return{isLoading:null!==(d=null==re?void 0:re.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==t?void 0:t.displayTitle)?null==t?void 0:t.title:"no title",refSectionTitle:(null==i?void 0:i.displayTitle)?null==i?void 0:i.title:"no title",cognitiveData:f,anchorEl:n,sectionAnchorEl:g,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==Q?void 0:Q.documents,input_index_map:null==Q?void 0:Q.input_index_map},deviationData:function(){var n,r,l=(null==t?void 0:t.evaluationResult)||(null==i?void 0:i.evaluationResult)||null,c=function(n){var t=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var t=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(t&&n[t])return n[t]}var i=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(i.length&&e[i[0]])return e[i[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return t?e.__assign(e.__assign({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==t?void 0:t.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==t?void 0:t.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==t?void 0:t.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==t?void 0:t.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==t?void 0:t.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==t?void 0:t.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(u.DEVIATION_BADGE_SEPARATOR)))return c(l);var a=o.split(u.DEVIATION_BADGE_SEPARATOR)[1];if(!a)return l;var s=(null==t?void 0:t.evaluationResult)||(null==i?void 0:i.evaluationResult)||{},d=(null===(n=null==s?void 0:s.deviation_entries)||void 0===n?void 0:n[a])||(null===(r=null==s?void 0:s.deviations)||void 0===r?void 0:r[a])||null;return d?e.__assign(e.__assign(e.__assign({},s),d),{deviation_summary:(null==d?void 0:d.deviation_summary)||(null==s?void 0:s.deviation_summary),deviation_title:(null==d?void 0:d.deviation_title)||(null==s?void 0:s.deviation_title),deviation_impact:(null==d?void 0:d.deviation_impact)||(null==s?void 0:s.deviation_impact),deviation_explanation:(null==d?void 0:d.deviation_explanation)||(null==s?void 0:s.deviation_explanation),evaluation_outputs:(null==d?void 0:d.evaluation_outputs)||(null==s?void 0:s.evaluation_outputs),cognitive_decisioning:(null==d?void 0:d.cognitive_decisioning)||(null==s?void 0:s.cognitive_decisioning)}):c(l)}(),isOrphan:!!r}},[Ze,Q]),At=t.useCallback(function(e){Dn(),Sn(null),_n(e)},[Dn]),Et=function(e,n,t,i,o,r){var l;if(e.stopPropagation(),mn.open&&mn.sectionIdx===o)Dn();else{var c=e.currentTarget,a="left";(null===(l=un.current)||void 0===l?void 0:l.contains(c))&&(a="right");Je.current&&pt(),Le(new Set),qe([]),Ue.current=[],Cn(),An.open?li():Tn(),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=et.current[l])||void 0===e?void 0:e.current:null===(n=Zn.current[l])||void 0===n?void 0:n.current}return"right"===a?null===(t=et.current[o])||void 0===t?void 0:t.current:null===(i=Zn.current[o])||void 0===i?void 0:i.current}()||c;Rn(bt(e,n,i,o,t,r))})}},Tt=t.useCallback(function(){null!==mn.sectionIdx&&mn.anchorEl?At(e.__assign(e.__assign({},mn),{open:!0})):Dn()},[mn,Dn,At]),It=t.useCallback(function(){var e=mn.sectionIdx,n=mn.isOrphan;Dn(),Tn(),null!==e&&(n?be("No counterpart exists to connect to."):(Je.current&&pt(),qe([]),Ue.current=[],Le(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Qe.current&&Qe.current()},50)))},[mn.sectionIdx,mn.isOrphan,Dn,Tn,pt]),Bt=t.useRef(null),Ct=t.useRef(null),Dt=t.useRef(null),Ot=t.useRef(null),wt=t.useRef(null),Nt=t.useRef(null),jt=t.useState([]),Pt=jt[0],Ft=jt[1];t.useRef(null);var kt=t.useState(null),Mt=kt[0],Vt=kt[1];t.useEffect(function(){if(Nn){var e=On.fields.find(function(e){return e.analysisKey===Nn||e.key===Nn});if(e){var n=Xn.current[e.key]||Jn.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Nn,On.fields]);var Lt=t.useCallback(function(e){var n,t,i,o,r,l,u,c,a,s=null===(n=null==ct?void 0:ct.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 f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[ct]),Gt=t.useCallback(function(n,t){var i,o,r;void 0===t&&(t="left");var l=null,c=null;if("left"===t)if(l=Gn[n],ve&&l){var s=Hn.filter(function(e){var n;return null===(n=l.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)});c=s.find(function(e){return e.evaluationResult})||s[0]}else c=Hn[n];else if(c=Hn[n],ve&&c){var d=Gn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(c.selfIndex)});l=d.find(function(e){return e.evaluationResult})||d[0]}else l=Gn[n];var v=(null==l?void 0:l.relation)&&"not_defined"!==l.relation,f=(null==c?void 0:c.relation)&&"not_defined"!==c.relation,g=!(!(null==l?void 0:l.cognitiveData)&&!(null==c?void 0:c.cognitiveData));if(!v&&!f&&!g)return e.__assign(e.__assign({},u.generateColorPalette(a.DEFAULT_DEVIAION_COLOR)),{label:"Not Defined"});var p=null!==(o=null!==(i=null==l?void 0:l.evaluationResult)&&void 0!==i?i:null==c?void 0:c.evaluationResult)&&void 0!==o?o:null,h=u.getFirstDeviationOutputValue(p),x=u.getFirstDeviationColor(p);return null!=p?e.__assign(e.__assign({},u.generateColorPalette(x)),{label:null!==(r=h)&&void 0!==r?r:""}):e.__assign(e.__assign({},u.generateColorPalette(x)),{label:null})},[Gn,Hn,Ze,On,ve]),Ht=t.useCallback(function(n){for(var t,i,o,r,l,c=n.split("-").map(Number),s=Gn[c[0]],d=Hn[c[0]],v=1;v<c.length;v++)(null==s?void 0:s.subsections)&&(s=s.subsections[c[v]]),(null==d?void 0:d.subsections)&&(d=d.subsections[c[v]]);if(!s&&!d)return null;var f=(null==s?void 0:s.relation)&&"not_defined"!==s.relation,g=(null==d?void 0:d.relation)&&"not_defined"!==d.relation,p=u.safeStringify(null==s?void 0:s.id)||u.safeStringify(null==d?void 0:d.id)||"",h=!(!(null==s?void 0:s.cognitiveData)&&!(null==d?void 0:d.cognitiveData));if(!f&&!g&&!h)return e.__assign(e.__assign({},u.generateColorPalette(a.DEFAULT_DEVIAION_COLOR)),{label:"Not Defined"});null!==(i=null!==(t=null==s?void 0:s.cognitiveRelevanceScore)&&void 0!==t?t:null==d?void 0:d.cognitiveRelevanceScore)&&void 0!==i||p&&(null===(o=Ze[p])||void 0===o||o.relevance_score);var x=null!==(l=null!==(r=null==s?void 0:s.evaluationResult)&&void 0!==r?r:null==d?void 0:d.evaluationResult)&&void 0!==l?l:null,_=u.getFirstDeviationOutputValue(x),m=u.getFirstDeviationColor(x);return null!=x?e.__assign(e.__assign({},u.generateColorPalette(m)),{label:null!=_?_:""}):e.__assign(e.__assign({},u.generateColorPalette(m)),{label:null})},[Gn,Hn,Ze,On]),qt=t.useCallback(function(n,t){var i,o,r,l,c,s,d,v,f,g,p,h,x,_,m,R,y;if(!n||null==t)return null;var S=null!==(d=null!==(c=null!==(o=null===(i=null==ce?void 0:ce[n])||void 0===i?void 0:i.evaluation_result)&&void 0!==o?o:null===(l=null===(r=null==Q?void 0:Q.nodes)||void 0===r?void 0:r[n])||void 0===l?void 0:l.evaluation_result)&&void 0!==c?c:null===(s=null==Q?void 0:Q[n])||void 0===s?void 0:s.evaluation_result)&&void 0!==d?d:null;if(!S||"object"!=typeof S)return null;var b=null!==(p=null!==(f=null===(v=null==S?void 0:S.deviations)||void 0===v?void 0:v[t])&&void 0!==f?f:null===(g=null==S?void 0:S.deviation_entries)||void 0===g?void 0:g[t])&&void 0!==p?p:null==S?void 0:S[t],A=null!==(y=null!==(_=null===(x=null===(h=null==b?void 0:b.evaluation_outputs)||void 0===h?void 0:h.metadata)||void 0===x?void 0:x.label_color)&&void 0!==_?_:null===(R=null===(m=null==S?void 0:S.evaluation_outputs)||void 0===m?void 0:m.metadata)||void 0===R?void 0:R.label_color)&&void 0!==y?y:a.DEFAULT_DEVIAION_COLOR;return e.__assign(e.__assign({},u.generateColorPalette(A)),{label:null})},[ce,Q]),zt=t.useCallback(function(){mt({}),yt({}),pt(),Le(new Set),qe([]),Ue.current=[],Tn(),Cn(),Dn(),requestAnimationFrame(function(){Qe.current&&Qe.current()})},[mt,yt,pt,Tn,Cn,Dn]),Wt=t.useMemo(function(){return Object.values(_t).some(Boolean)||Object.values(Rt).some(Boolean)},[_t,Rt]),Yt=t.useCallback(function(){var e,n,t,i,o,r,l,c,a,s,d,v,f,g,p,h,x,_,m,R,y,S,b;if(!fn.current&&!We.current){fn.current=!0;try{if(!Bt.current)return;var A=function(e){var n=e.split("-"),t=n[0];if(!_t[t]&&!1===ve)return!1;if(ve&&!_t["left-".concat(t)]&&!_t["right-".concat(t)]&&!_t[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!Rt[i])return!1;return!0},E=Bt.current.getBoundingClientRect();tn({width:E.width,height:E.height});var T=[];if(qn.forEach(function(e){var n,t,i=e.key,o=null===(n=Xn.current[i])||void 0===n?void 0:n.current,r=null===(t=Jn.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")}),!We.current){for(var I=0;I<Math.max(Gn.length,Hn.length);I++){var B=null===(e=$n.current[I])||void 0===e?void 0:e.current,C=null===(n=Qn.current[I])||void 0===n?void 0:n.current;B&&(B.style.height="auto",B.style.minHeight="0px"),C&&(C.style.height="auto",C.style.minHeight="0px")}ve||Object.keys(tt.current).forEach(function(e){var n,t;if(A(e)){var i=null===(n=tt.current[e])||void 0===n?void 0:n.current,o=null===(t=it.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 D={};qn.forEach(function(e){var n,t,i=e.key,o=null===(n=Xn.current[i])||void 0===n?void 0:n.current,r=null===(t=Jn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),u=r.getBoundingClientRect();D[i]=Math.max(l.height,u.height)}});var O={left:{},right:{}},w={};if(!We.current)if(ve){if(Ee&&null!==Pe)if("number"==typeof Pe){var N=Pe,j=Gn[N],P=null===(o=$n.current[N])||void 0===o?void 0:o.current;P&&j&&(j.refIndexes||[]).forEach(function(e){var n,t=Hn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=Qn.current[t])||void 0===n?void 0:n.current;if(i&&(_t["left-".concat(N)]||_t["right-".concat(t)])){var o=Math.max(P.getBoundingClientRect().height,i.getBoundingClientRect().height);O.left[N]=Math.max(O.left[N]||0,o),O.right[t]=Math.max(O.right[t]||0,o)}})}else{var F=Pe.split(u.DEVIATION_BADGE_SEPARATOR)[2];if(F){B=null===(r=tt.current[F])||void 0===r?void 0:r.current,C=null===(l=it.current[F])||void 0===l?void 0:l.current;if(B&&C){k=Math.max(B.getBoundingClientRect().height,C.getBoundingClientRect().height);w[F]=Math.max(w[F]||0,k)}}}}else{Object.keys(tt.current).forEach(function(e){var n,t;if(A(e)){var i=null===(n=tt.current[e])||void 0===n?void 0:n.current,o=null===(t=it.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);w[e]=u,i.style.minHeight="".concat(u,"px"),o.style.minHeight="".concat(u,"px")}}});for(I=0;I<Math.min(Gn.length,Hn.length);I++){var B=null===(t=$n.current[I])||void 0===t?void 0:t.current,C=null===(i=Qn.current[I])||void 0===i?void 0:i.current;if(B&&C){var k=Math.max(B.getBoundingClientRect().height,C.getBoundingClientRect().height);O.left[I]=k,O.right[I]=k}}}if(qn.forEach(function(e){var n,t,i=e.key,o=null===(n=Xn.current[i])||void 0===n?void 0:n.current,r=null===(t=Jn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=D[i];o.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}),We.current||(Object.entries(O.left).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=$n.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(O.right).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=Qn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),ve||Object.keys(w).forEach(function(e){var n,t,i=null===(n=tt.current[e])||void 0===n?void 0:n.current,o=null===(t=it.current[e])||void 0===t?void 0:t.current;if(i&&o&&w[e]){var r=w[e];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),ve)Gn.forEach(function(e,n){var t;(null===(t=$n.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=Hn.findIndex(function(n){return n.selfIndex===e});if(-1!==v){var f=null===(t=Zn.current[n])||void 0===t?void 0:t.current,g=null===(i=et.current[v])||void 0===i?void 0:i.current;if(f&&g){var p=f.getBoundingClientRect(),h=g.getBoundingClientRect(),x=p.right-E.left,_=h.left-E.left,m=p.top+p.height/2-E.top,R=h.top+h.height/2-E.top;if(Ee&&Pe===n){var y=null!==(r=null===(o=vn.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,S=null!==(u=null===(l=un.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==u?u:0,b=y+(null!==(a=null===(c=vn.current)||void 0===c?void 0:c.clientHeight)&&void 0!==a?a:1/0),A=S+(null!==(d=null===(s=un.current)||void 0===s?void 0:s.clientHeight)&&void 0!==d?d:1/0),I=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(I,y,b)-E.top,R=C(B,S,A)-E.top}var D=Gt(n);D&&T.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(Gn.length,Hn.length);I++){var M=null===(c=$n.current[I])||void 0===c?void 0:c.current,V=null===(a=Qn.current[I])||void 0===a?void 0:a.current;if(M&&V){var L=M.getBoundingClientRect(),G=V.getBoundingClientRect(),H=Math.max(L.top,G.top)+18-E.top,q=(null===(s=Hn[I])||void 0===s?void 0:s.id)||"sec-".concat(I);($=Gt(I))&&T.push({id:q,x1:L.right-E.left,y1:H,x2:G.left-E.left,y2:H,style:$,sectionIdx:I,hasCognitive:!!((null===(d=Gn[I])||void 0===d?void 0:d.cognitiveData)||(null===(v=Hn[I])||void 0===v?void 0:v.cognitiveData)||q&&Ze[q]),isSubSection:!1})}}Object.keys(tt.current).forEach(function(e){var n,t,i,o,r,l;if(A(e)){var c=null===(n=tt.current[e])||void 0===n?void 0:n.current,a=null===(t=it.current[e])||void 0===t?void 0:t.current;if(c&&a){for(var s=e.split("-").map(Number),d=Gn[s[0]],v=Hn[s[0]],f=1;f<s.length;f++)(null==d?void 0:d.subsections)&&(d=d.subsections[s[f]]),(null==v?void 0:v.subsections)&&(v=v.subsections[s[f]]);var g=!!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(g&&p||h&&x){var _=c.getBoundingClientRect(),m=a.getBoundingClientRect(),R=Math.max(_.top,m.top)+16-E.top,y=Ht(e);y&&"Not Defined"!==y.label&&T.push({id:"subsec-".concat(e),x1:_.right-E.left,y1:R,x2:m.left-E.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(Ee&&"string"==typeof Pe&&Pe.includes(u.DEVIATION_BADGE_SEPARATOR)){var z=Pe.split(u.DEVIATION_BADGE_SEPARATOR),W=z[0],Y=z[1],K=z[2],U=(z[3],"".concat(W).concat(u.DEVIATION_BADGE_SEPARATOR).concat(Y)),X=null===(f=Zn.current[U])||void 0===f?void 0:f.current,J=null===(g=et.current[U])||void 0===g?void 0:g.current;if(X&&J){var $,Q=X.getBoundingClientRect(),Z=J.getBoundingClientRect(),ee=Q.right-E.left,ne=Z.left-E.left,te=Q.top+Q.height/2-E.top,ie=Z.top+Z.height/2-E.top;if(ve){var oe=null!==(h=null===(p=vn.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==h?h:0,re=null!==(_=null===(x=un.current)||void 0===x?void 0:x.getBoundingClientRect().top)&&void 0!==_?_:0,le=oe+(null!==(R=null===(m=vn.current)||void 0===m?void 0:m.clientHeight)&&void 0!==R?R:1/0),ue=re+(null!==(S=null===(y=un.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)-E.top,ie=ce(Z.top+Z.height/2,re,ue)-E.top}($=null!==(b=qt(W,Y))&&void 0!==b?b:Ht(K))&&T.push({id:"line-subsec-".concat(U),x1:ee,y1:te,x2:ne,y2:ie,style:$,sectionIdx:Number(K.split("-")[0]),isSubSection:!0,subSectionKeyPath:Pe})}}if(Ft(T),wt.current&&Nt.current){var ae=wt.current.getBoundingClientRect(),se=Nt.current.getBoundingClientRect(),de=(ae.top+ae.height/2-E.top+se.top+se.height/2-E.top)/2;Vt({x1:ae.right-E.left,x2:se.left-E.left,y:de})}else Vt(null);if(Ve.size>0){var fe=[],ge=vn.current,pe=un.current;if(ge&&pe){var he=[],xe=ge.getBoundingClientRect().top,_e=pe.getBoundingClientRect().top,me=xe+ge.clientHeight,Re=_e+pe.clientHeight,ye=ge.scrollTop,Se=pe.scrollTop,be=E.top,Ae=function(e,n,t){return Math.max(n,Math.min(t,e))};Ve.forEach(function(e){var n,t,i,o,r,l;if("string"==typeof e&&e.includes(u.DEVIATION_BADGE_SEPARATOR)){var c=e.split(u.DEVIATION_BADGE_SEPARATOR),a=c[0],s=c[1],d=c[2],v=(c[3],"".concat(a).concat(u.DEVIATION_BADGE_SEPARATOR).concat(s)),f=null===(n=Zn.current[v])||void 0===n?void 0:n.current,g=null===(t=et.current[v])||void 0===t?void 0:t.current;if(!f||!g)return;var p=f.getBoundingClientRect(),h=g.getBoundingClientRect(),x=null!==(i=qt(a,s))&&void 0!==i?i:Ht(d),_=(P=p.right-E.left)+.5*((F=h.left-E.left-0)-P),m=p.top+p.height/2,R=h.top+h.height/2,y=m-xe+ye,S=R-_e+Se,b="conn-subsec-".concat(v);he.push({lhsScrollY:y,rhsScrollY:S,x1:P,x2:F,containerTop:be,leftIdx:e,rhsArrayIdx:e,styleColor:(null==x?void 0:x.badgeBorder)||"#6366F1",styleId:b});var A=Ae(m,xe,me),T=Ae(R,_e,Re),I=A-be,B=T-be,C=R>=_e-4&&R<=Re+4,D="";D=(k=m>=xe-4&&m<=me+4)&&C?u.getBentArrowPath(P,I,F,B):k&&!C?"M ".concat(P,",").concat(I," L ").concat(_,",").concat(I," L ").concat(_,",").concat(B):!k&&C?"M ".concat(_,",").concat(I," L ").concat(_,",").concat(B," L ").concat(F,",").concat(B):"M ".concat(_,",").concat(I," L ").concat(_,",").concat(B),fe.push({id:b,pathD:D,style:x,leftIdx:e,rhsArrayIdx:e})}else if(ve){var O=e,w=Gn[O];if(!(null===(l=null==w?void 0:w.refIndexes)||void 0===l?void 0:l.length))return;w.refIndexes.forEach(function(e){var n,t,i=Hn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=Zn.current[O])||void 0===n?void 0:n.current,r=null===(t=et.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect(),a=Gt(O),s=l.right-E.left,d=c.left-E.left-0,v=s+.5*(d-s),f=l.top+l.height/2,g=c.top+c.height/2,p=f-xe+ye,h=g-_e+Se,x="conn-".concat(O,"-").concat(i);he.push({lhsScrollY:p,rhsScrollY:h,x1:s,x2:d,containerTop:be,leftIdx:O,rhsArrayIdx:i,styleColor:(null==a?void 0:a.badgeBorder)||"#6366F1",styleId:x});var _=Ae(f,xe,me),m=Ae(g,_e,Re),R=_-be,y=m-be,S=f>=xe-4&&f<=me+4,b=g>=_e-4&&g<=Re+4,A="";A=S&&b?u.getBentArrowPath(s,R,d,y):S&&!b?"M ".concat(s,",").concat(R," L ").concat(v,",").concat(R," L ").concat(v,",").concat(y):!S&&b?"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),fe.push({id:x,pathD:A,style:a,leftIdx:O,rhsArrayIdx:i})}}})}else{var N=e,j=N;f=null===(o=Zn.current[N])||void 0===o?void 0:o.current,g=null===(r=et.current[j])||void 0===r?void 0:r.current;if(!f||!g)return;var P,F;p=f.getBoundingClientRect(),h=g.getBoundingClientRect(),x=Gt(N),_=(P=p.right-E.left)+.5*((F=h.left-E.left-0)-P),m=p.top+p.height/2,R=h.top+h.height/2,y=m-xe+ye,S=R-_e+Se,b="conn-".concat(N,"-").concat(j);he.push({lhsScrollY:y,rhsScrollY:S,x1:P,x2:F,containerTop:be,leftIdx:N,rhsArrayIdx:j,styleColor:(null==x?void 0:x.badgeBorder)||"#6366F1",styleId:b});var k;A=Ae(m,xe,me),T=Ae(R,_e,Re),I=A-be,B=T-be,C=R>=_e-4&&R<=Re+4,D="";D=(k=m>=xe-4&&m<=me+4)&&C?u.getBentArrowPath(P,I,F,B):k&&!C?"M ".concat(P,",").concat(I," L ").concat(_,",").concat(I," L ").concat(_,",").concat(B):!k&&C?"M ".concat(_,",").concat(I," L ").concat(_,",").concat(B," L ").concat(F,",").concat(B):"M ".concat(_,",").concat(I," L ").concat(_,",").concat(B),fe.push({id:b,pathD:D,style:x,leftIdx:N,rhsArrayIdx:j})}}),Ue.current=he}qe(fe)}else qe([]),Ue.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{fn.current=!1}}},[qn,Gn,Hn,Ze,On,Lt,Gt,qt,ve,Ee,Pe,Ve,_t,Rt]),Kt=t.useCallback(function(){var e,n,t,i,o,r,l,c,a,s,d,v,f,g,p=Ue.current;if(p.length&&!We.current){var h=null!==(n=null===(e=vn.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,x=null!==(i=null===(t=un.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,_=null!==(r=null===(o=vn.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(c=null===(l=un.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,R=null!==(s=null===(a=vn.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==s?s:0,y=null!==(v=null===(d=un.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==v?v:0,S=R+_,b=y+m,A=null!==(g=null===(f=Bt.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==g?g: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=Ke.current[e.styleId+"-stroke"],o=Ke.current[e.styleId+"-bg"];if(i||o){var r,l=E(n,R,S),c=E(t,y,b),a=l-A,s=c-A,d=n>=R-4&&n<=S+4,v=t>=y-4&&t<=b+4,f=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(f,",").concat(a," L ").concat(f,",").concat(s):!d&&v?"M ".concat(f,",").concat(a," L ").concat(f,",").concat(s," L ").concat(e.x2,",").concat(s):"M ".concat(f,",").concat(a," L ").concat(f,",").concat(s),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);t.useEffect(function(){Qe.current=Yt},[Yt]);var Ut=t.useRef(null),Xt=t.useRef(null),Jt=t.useCallback(function(){Ue.current.length>0&&!We.current||(null!==Ut.current&&clearTimeout(Ut.current),Ut.current=setTimeout(function(){Qe.current(),Ut.current=null},50))},[]),$t=t.useCallback(function(){Ne(!0),De(!1),null!==Xt.current&&clearTimeout(Xt.current),null!==Ut.current&&(clearTimeout(Ut.current),Ut.current=null),Xt.current=setTimeout(function(){var e,n,t,i,o,r,l,c,a,s;if(Ue.current=[],Je.current&&null!==$e.current&&null!==Dt.current){var d=$e.current,v=Dt.current,f=null,g=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]);f=(null===(e=Zn.current[_])||void 0===e?void 0:e.current)||null,g=(null===(n=et.current[_])||void 0===n?void 0:n.current)||null,p=(null===(t=tt.current[x[2]])||void 0===t?void 0:t.current)||(null===(i=$n.current[Number(x[2])])||void 0===i?void 0:i.current)||null,h=(null===(o=it.current[x[3]])||void 0===o?void 0:o.current)||(null===(r=Qn.current[Number(x[3])])||void 0===r?void 0:r.current)||null}else f=(null===(l=ot.current[d])||void 0===l?void 0:l.current)||null,p=(null===(c=$n.current[d])||void 0===c?void 0:c.current)||null,g=(null===(a=nt.current[v])||void 0===a?void 0:a.current)||null,h=(null===(s=Qn.current[v])||void 0===s?void 0:s.current)||null;if(f&&g&&p&&h){if(p.style.paddingTop="0px",h.style.paddingTop="0px",!ve){var m=f.getBoundingClientRect(),R=g.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=vn.current,b=un.current;if(S&&b){var A=f.getBoundingClientRect().top-S.getBoundingClientRect().top+S.scrollTop,E=g.getBoundingClientRect().top-b.getBoundingClientRect().top+b.scrollTop-(A-S.scrollTop);Math.abs(b.scrollTop-E)>1&&(b.scrollTop=E)}}}Qe.current(),Je.current&&De(!0),Ne(!1),Xt.current=null},150)},[ve,Gn,Hn]),Qt=t.useCallback(function(e){var n,t,i,o,r,l,c,a,s,d;if(null!==gn.current&&pn.current&&Math.abs(e.currentTarget.scrollTop-gn.current)<=2){var v=pn.current;gn.current=null,pn.current=null,v()}if(!ke.current){if(ve||Jt(),Je.current){var f=$e.current,g=Dt.current,p=vn.current,h=un.current;if(null!==f&&null!==g&&p&&h){var x="string"==typeof f&&f.includes(u.DEVIATION_BADGE_SEPARATOR)?null===(n=Zn.current["".concat(f.split(u.DEVIATION_BADGE_SEPARATOR)[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(f.split(u.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===n?void 0:n.current:null===(t=ot.current[f])||void 0===t?void 0:t.current,_="string"==typeof g&&g.includes(u.DEVIATION_BADGE_SEPARATOR)?null===(i=et.current["".concat(g.split(u.DEVIATION_BADGE_SEPARATOR)[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(g.split(u.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===i?void 0:i.current:null===(o=nt.current[g])||void 0===o?void 0:o.current;if(x&&_&&Ot.current){var m=void 0,R=void 0;if("string"==typeof f&&f.includes(u.DEVIATION_BADGE_SEPARATOR)){var y=f.split(u.DEVIATION_BADGE_SEPARATOR),S="".concat(y[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(y[1]);m=null===(r=Zn.current[S])||void 0===r?void 0:r.current,R=null===(l=et.current[S])||void 0===l?void 0:l.current}else m=null===(c=Zn.current[f])||void 0===c?void 0:c.current,R=null===(a=et.current[g])||void 0===a?void 0:a.current;var b=null!==(d=null===(s=Bt.current)||void 0===s?void 0:s.getBoundingClientRect().top)&&void 0!==d?d:0,A=p.getBoundingClientRect().top,E=A+p.clientHeight;h.getBoundingClientRect().top;h.clientHeight;if(m&&R){var T=m.getBoundingClientRect(),I=R.getBoundingClientRect(),B=T.top+T.height/2;I.top,I.height;var C=((O=B,w=A,N=E,Math.max(w,Math.min(N,O)))-b).toString();Ot.current.setAttribute("y1",C),Ot.current.setAttribute("y2",C);var D=B>=A-4&&B<=E+4;Ot.current.setAttribute("visibility",D?"visible":"hidden")}}}}var O,w,N;Ue.current.length>0&&!Xe.current&&(Xe.current=!0,requestAnimationFrame(function(){Kt(),Xe.current=!1}))}},[Kt,ve,Jt]),Zt=t.useRef(0),ei=t.useRef(0),ni=t.useRef(0),ti=t.useRef(function(){});t.useRef(null),t.useEffect(function(){ti.current=$t},[$t]),t.useEffect(function(){var e=setTimeout(Jt,250),n=function(){return ti.current()};return window.addEventListener("resize",n),function(){clearTimeout(e),null!==Ut.current&&clearTimeout(Ut.current),null!==Xt.current&&clearTimeout(Xt.current),window.removeEventListener("resize",n)}},[Vn,Ln,ct,qn,_t,Rt,Gn,Hn,On,Jt,Ee,Pe,Ce,Ve]),t.useEffect(function(){var e=function(e,n,t,i,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){var r,l,u;t.current=null;var c=e[e.length-1];if(c){var a=null!==(u=null===(l=null===(r=c.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:c.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,i())}})});return r.observe(e),r},n={current:null},t={current:null},i={current:null},o=[],r=[n,t,i];return ln.current&&o.push(e(ln.current,Zt,n,function(){return ti.current()},function(){})),rn.current&&o.push(e(rn.current,ei,t,function(){return ti.current()},function(){return Qe.current()})),Bt.current&&o.push(e(Bt.current,ni,i,function(){return ti.current()},function(){return Qe.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),t.useEffect(function(){Je.current=Ee},[Ee]),t.useEffect(function(){$e.current=Pe},[Pe]);var ii=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";Dn(),null!=e&&(n?be("No counterpart exists for this section."):Ee&&Pe===e?r?pt():null==l||l():(Le(new Set([e])),qe([]),Ue.current=[],Re(!0),ke.current=!0,Fe(e),$e.current=e,Te(!0),Je.current=!0,De(!1),cn.current&&(cn.current.style.height="0px"),an.current&&(an.current.style.height="0px"),sn.current&&(sn.current.style.height="0px"),dn.current&&(dn.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 f=e.split(u.DEVIATION_BADGE_SEPARATOR),g="".concat(f[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(f[1]);s=(null===(n=Zn.current[g])||void 0===n?void 0:n.current)||null,d=(null===(t=et.current[g])||void 0===t?void 0:t.current)||null,v=d?e:null}else if(s=(null===(i=ot.current[e])||void 0===i?void 0:i.current)||null,ve){var p=Gn[e],h=(null==p?void 0:p.refIndexes)||[];if(h.length>0){var x=h[0],_=Hn.findIndex(function(e){return e.selfIndex===x});-1!==_&&(d=(null===(r=nt.current[_])||void 0===r?void 0:r.current)||null,v=_)}}else d=(null===(o=nt.current[e])||void 0===o?void 0:o.current)||null,v=d?e:null;Dt.current=v;var m=vn.current,R=un.current,y=function(){!function(){var n,t,i,o,r,l,c,s,d,f,g,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=tt.current[R[2]])||void 0===n?void 0:n.current)||(null===(t=$n.current[Number(R[2])])||void 0===t?void 0:t.current)||null,x=(null===(i=it.current[R[3]])||void 0===i?void 0:i.current)||(null===(o=Qn.current[Number(R[3])])||void 0===o?void 0:o.current)||null,_=(null===(r=Zn.current[y])||void 0===r?void 0:r.current)||h,m=(null===(l=et.current[y])||void 0===l?void 0:l.current)||x}else{var S=Number(e),b=null!==v?Number(v):S;h=(null===(c=$n.current[S])||void 0===c?void 0:c.current)||null,x=(null===(s=Qn.current[b])||void 0===s?void 0:s.current)||null,_=(null===(d=Zn.current[S])||void 0===d?void 0:d.current)||(null===(f=ot.current[S])||void 0===f?void 0:f.current)||h,m=(null===(g=et.current[b])||void 0===g?void 0:g.current)||(null===(p=nt.current[b])||void 0===p?void 0:p.current)||x}if(_&&m&&h&&x){h.style.paddingTop="0px",x.style.paddingTop="0px";var A=_.getBoundingClientRect(),E=m.getBoundingClientRect(),T=A.top-E.top;T>0?x.style.paddingTop="".concat(T,"px"):T<0&&(h.style.paddingTop="".concat(Math.abs(T),"px"))}}(),De(!0),Qe.current&&Qe.current(),ke.current=!1,"right"===c&&R?R.dispatchEvent(new Event("scroll")):m&&m.dispatchEvent(new Event("scroll")),Re(!1),null==l||l()};if(!s||!m)return ke.current=!1,Re(!1),void(null==l||l());if(d&&R){if(!ve){var S=0;S="right"===c?d?d.getBoundingClientRect().top:0:s?s.getBoundingClientRect().top:0;var b=rn.current,A=(null==b?void 0:b.getBoundingClientRect().top)||0,E=b?b.scrollTop+S-A-150:0;return b?void u.smoothScrollTo(b,E,200,y):void y()}var T=s.getBoundingClientRect().top-m.getBoundingClientRect().top+m.scrollTop,I=d.getBoundingClientRect().top-R.getBoundingClientRect().top+R.scrollTop,B=200;if("left"===c){var C=I-(T-m.scrollTop);C<0&&cn.current&&(cn.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 an.current&&(an.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=T-(I-R.scrollTop);D<0&&sn.current&&(sn.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 dn.current&&(dn.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()})))},[Pe,Dn,Hn,Ee,ve,Gn,pt]),oi=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;Cn();var c="left";(null===(o=un.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=et.current[l])||void 0===e?void 0:e.current:null===(t=Zn.current[l])||void 0===t?void 0:t.current}return"right"===c?null===(i=et.current[n])||void 0===i?void 0:i.current:null===(o=Zn.current[n])||void 0===o?void 0:o.current};if(t)return pt(),Le(new Set),qe([]),Ue.current=[],void(r&&requestAnimationFrame(function(){var e=a()||l;En({open:!0,anchorEl:e,summary:i})}));ii(n,t,r?{toggleIfSame:!1,sourceSide:c,onReady:function(){var e=a()||l;En({open:!0,anchorEl:e,summary:i})}}:{toggleIfSame:!1,sourceSide:c})},[ii,Cn,En,pt]),ri=t.useCallback(function(){var e,n=mn.sectionIdx,t=mn.isOrphan;if(Tn(),null!=n){var i="left";mn.anchorEl&&(null===(e=un.current)||void 0===e?void 0:e.contains(mn.anchorEl))&&(i="right"),ii(n,t,{sourceSide:i})}},[ii,mn.isOrphan,mn.sectionIdx,mn.anchorEl,Tn]),li=t.useCallback(function(){Tn(),pt(),Le(new Set),qe([]),Ue.current=[]},[Tn,pt]),ui=null!==mn.sectionIdx&&Ve.has(mn.sectionIdx),ci=_.useDeviationNavigation({proposedSections:Gn,existingSections:Hn,parentDeviationRecord:zn,expandedSections:_t,maintainRelativeOrder:!!ve,scrollContainerRef:rn,leftContainerRef:vn,lhsBadgeRefs:Zn,rhsBadgeRefs:et}),ai=ci.showDeviationNavigation,si=ci.showOpenNodeRef,di=t.useMemo(function(){if(!ae)return null;var e=ae.id.split(":")[0];for(var n in zn){if((zn[n]||[]).some(function(n){return n.id===e}))return n}return null},[ae,zn]),vi=t.useRef({id:null,triggerMs:null}),fi=t.useRef(null);t.useEffect(function(){if(null==ae?void 0:ae.id){var n=Number(ae.trigger),t=vi.current;if(!(t.id===ae.id&&null!=t.triggerMs&&n-t.triggerMs<=1e3)){vi.current={id:ae.id,triggerMs:n};var i=ae.id.split(":"),o=i[0],r=i[1],l=null!=r?r:"0";fi.current!==ae.id&&(Tn(),Cn(),pt(),Le(new Set),qe([]),Ue.current=[],fi.current=ae.id);var c=!1,a=0,s=null,d=150,v=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},f=function(){var n,t,i,r;if(!c){var g=null,p=null;for(var h in zn){var x=zn[h].find(function(e){return e.id===o});if(x){g=h,p=x;break}}if(p&&g){var _=Gn.findIndex(function(e){return e.id===g}),m=Hn.findIndex(function(e){return e.id===g}),R=-1===_&&-1!==m,y=v(Gn,p.id),S=v(Hn,p.id);if(y&&!S&&!R){var b=y.split("-"),A=Number(b[0]);if(ve){var E=null===(t=null===(n=Gn[A])||void 0===n?void 0:n.refIndexes)||void 0===t?void 0:t[0],T=Hn.findIndex(function(e){return e.selfIndex===E});-1!==T&&(A=T)}S=e.__spreadArray([A],b.slice(1),!0).join("-")}if(y||S){var I=R||!y&&!!S,B=y?Number(y.split("-")[0]):_,C=S?Number(S.split("-")[0]):m;if(I){if(!(ve?!!_t["right-".concat(C)]:!!_t[String(C)])&&C>=0)return St(C,"right"),a+=1,void(s=setTimeout(f,450))}else if(!(ve?!!_t["left-".concat(B)]:!!_t[String(B)])&&B>=0)return St(B,"left"),a+=1,void(s=setTimeout(f,450));var D,O=y||"",w=S||"",N="".concat(p.id).concat(u.DEVIATION_BADGE_SEPARATOR).concat(l).concat(u.DEVIATION_BADGE_SEPARATOR).concat(O).concat(u.DEVIATION_BADGE_SEPARATOR).concat(w),j="".concat(p.id).concat(u.DEVIATION_BADGE_SEPARATOR).concat(l),P=null===(i=Zn.current[j])||void 0===i?void 0:i.current,F=null===(r=et.current[j])||void 0===r?void 0:r.current,k=I||!P&&!!F,M=k?F:P;if(D=ve?k?un.current:vn.current:rn.current,M&&D){var V=M.getBoundingClientRect();if(0===V.height)return void((a+=1)<20&&(s=setTimeout(f,d)));var L=D.getBoundingClientRect(),G=V.top-L.top+D.scrollTop-L.height/2+V.height/2,H=function(){var n,t,i,o,r;if(!c){var u=window.getComputedStyle(M).color;P&&(P.style.transition="box-shadow 300ms ease-in-out",P.style.boxShadow="0 0 10px ".concat(u)),F&&(F.style.transition="box-shadow 300ms ease-in-out",F.style.boxShadow="0 0 10px ".concat(u)),setTimeout(function(){P&&(P.style.boxShadow=""),F&&(F.style.boxShadow="")},2e3);var a=(null===(t=null===(n=p.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===t?void 0:t[l])||p,s=(null===(i=p.evaluationResult)||void 0===i?void 0:i.evaluation_outputs)||p.evaluation_outputs;if(!(!!P&&!!F)){var d=k?(null===(o=et.current[j])||void 0===o?void 0:o.current)||F:(null===(r=Zn.current[j])||void 0===r?void 0:r.current)||P;return En({open:!0,anchorEl:d,summary:e.__assign(e.__assign({},a),{evaluation_outputs:s})}),void(null==se||se())}ii(N,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var n,t=(null===(n=Zn.current[j])||void 0===n?void 0:n.current)||P;En({open:!0,anchorEl:t,summary:e.__assign(e.__assign({},a),{evaluation_outputs:s})})}})}};Math.abs(D.scrollTop-G)<=2?H():(gn.current=G,pn.current=H,D.scrollTo({top:G,behavior:"smooth"}),s&&clearTimeout(s),s=setTimeout(function(){if(pn.current){gn.current=null;var e=pn.current;pn.current=null,e()}},800))}else(a+=1)<20&&(s=setTimeout(f,d))}else(a+=1)<20&&(s=setTimeout(f,d))}else(a+=1)<20&&(s=setTimeout(f,d))}};return s=setTimeout(f,d),function(){c=!0,s&&clearTimeout(s)}}}},[ae,zn,Gn,Hn,ve,_t,St,ii,En]);var gi=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:Rt,setExpandedSubSections:yt,maintainRelativeOrder:ve||!1,proposedSections:Gn,existingSections:Hn,treeData:Q,deviationNumberRegistry:Wn,connectedSections:Ve,activeSideBySideSection:Pe,resolvedMarkdownStyles:on,getSubSectionRef:lt,getSubSectionCompareStyle:Ht,getBadgeRef:ut,openMoreFunctionsPopup:Et,openSummaryPopup:oi,showDeviationBadges:ge,resetSideBySide:pt,setConnectedSections:Le,setConnectedLines:qe,cachedConnectedPositions:Ue})};return n.jsxs(i.Box,e.__assign({ref:ln,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},ve?{}:{overflow:"visible"}),{position:"relative"})},{children:[he&&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:Ct.current,clipTopEl:wt.current,scrollContainerEl:rn.current,onClose:li,summary:An.summary}),n.jsx(d.default,{open:mn.open,anchorEl:mn.anchorEl,sectionTitle:mn.sectionTitle,referenceSectionTitle:mn.refSectionTitle,onClose:Dn,onOpenCognitiveCompare:Tt,onOpenSideBySide:ri,onConnect:It,isConnected:ui,isOrphan:mn.isOrphan}),xn.open&&n.jsx(s.default,{open:xn.open,popupRef:Bn,position:yn,popupConfig:le,onClose:function(){Sn(null),_n(function(n){return e.__assign(e.__assign({},n),{open:!1})}),In(null)},markdownStyles:te,sectionTitle:xn.sectionTitle,referenceSectionTitle:xn.refSectionTitle,cognitiveData:xn.cognitiveData,anchorEl:xn.anchorEl,sectionAnchorEl:xn.sectionAnchorEl,scrollContainerEl:rn.current,badgeStyle:xn.badgeStyle,docData:xn.docData,deviationData:xn.deviationData,isLoading:xn.isLoading}),n.jsx(i.Snackbar,e.__assign({open:!!Se,autoHideDuration:8e3,onClose:function(){return be(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(i.Alert,e.__assign({onClose:function(){return be(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Se}))})),n.jsx(m.default,{componentHeaderText:$,displayConfig:re,maintainRelativeOrder:ve,onCollapseAll:zt,showCollapseAll:Wt,onToggleView:function(e){xe(!0),setTimeout(function(){fe(!e),pt(),Tn(),Le(new Set),qe([]),Ue.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){xe(!1)},600)})})},50)}}),n.jsx(i.Box,e.__assign({ref:rn,onScroll:Qt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:ve?"hidden":"auto",borderTop:at&&st?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(i.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},ve?{flex:1,minHeight:0}:{})},{children:n.jsxs(i.Box,e.__assign({ref:Bt,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},ve?{flex:1,overflow:"visible"}:{})},{children:[n.jsxs("svg",e.__assign({ref:ze,style:{position:"absolute",top:0,left:0,width:nn.width||"100%",height:nn.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:we?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[Mt&&n.jsx("g",{children:n.jsx("line",{x1:Mt.x1,y1:Mt.y,x2:Mt.x2,y2:Mt.y,stroke:gt.badgeBorder,strokeWidth:"1.5"})}),Pt.map(function(t){var l,c,s,d,v,g,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?Ee&&Pe===t.subSectionKeyPath&&Ce:Ee&&Pe===t.sectionIdx&&Ce)return null;if(!ve){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),_=Gn[t.sectionIdx]||{title:"",content:""},m=Hn[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,b=y.split("-").map(Number),A=S.split("-").map(Number),E=null,T=null;b.length>0&&(E=Gn[b[0]]),A.length>0&&(T=Hn[A[0]]);var I=(null==E?void 0:E.title)||"",B=(null==T?void 0:T.title)||"";console.log("Root Parent Titles:",I,B);for(var C=1;C<b.length;C++)(null==E?void 0:E.subsections)&&(E=E.subsections[b[C]]);for(C=1;C<A.length;C++)(null==T?void 0:T.subsections)&&(T=T.subsections[A[C]]);E&&(_=e.__assign(e.__assign({},E),{title:I||E.title})),console.log("Base Section for Subsection Badge:",_),T&&(m=e.__assign(e.__assign({},T),{title:B||T.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===(g=null===(v=null===(d=_.evaluationResult)||void 0===d?void 0:d.cognitive_decisioning)||void 0===v?void 0:v.decisioning_factors)||void 0===g?void 0:g.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&&(xn.open&&bn===t.id?Cn():(In(t.id),At(bt(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(f.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:xn.open&&bn===t.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},t.id)}return null}),He.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){Ke.current[u]=e},d:o,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),n.jsx("path",{ref:function(e){Ke.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)"},ve?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(i.Box,e.__assign({ref:wt,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:Fn,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:Fn}))}))})),n.jsxs(i.Box,e.__assign({ref:vn,onScroll:Qt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},ve?{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:sn,style:{width:"100%",height:"0px",flexShrink:0}}),Kn&&Gn.map(function(t,r){var l,c,a=!t.title&&!t.content;if(ve&&a)return null;var s=t,d=Gt(r,"left"),v=ve?!(null===(l=s.refIndexes)||void 0===l?void 0:l.length)||s.selfIndex<0:!Hn[r],g=ve?"number"==typeof s.selfIndex&&s.selfIndex>=0?s.selfIndex+1:null:r+1,p=Ve.has(r),h=u.extractDeviationScore(s.evaluationResult,null==d?void 0:d.deviationLabel);return n.jsx(i.Box,e.__assign({ref:rt(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:$n.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:rt("left-accordion-".concat(r)),mb:0,treeData:Q,proposedSections:Gn,existingSections:Hn,deviationNumberRegistry:Wn,getSectionCompareStyle:Gt,getBadgeRef:ut,connectedSections:Ve,openMoreFunctionsPopup:Et,openSummaryPopup:oi,deviationNodeIdToView:null==ae?void 0:ae.id,deviationTargetParentId:di,parentNodeId:(null===(c=null==Q?void 0:Q.input_index_map)||void 0===c?void 0:c[0])||"",isExpanded:ve?!!_t["left-".concat(r)]:!!_t[String(r)],onToggle:function(){li(),St(r,"left")},navigation:t.id?ai[t.id]:null,showOpenNodeRef:si,resolvedMarkdownStyles:on,maintainRelativeOrder:ve,showDeviationBadges:ge,renderSubSections:gi})})),ve&&d&&n.jsxs(i.Box,e.__assign({ref:Zn.current[r],onClick:function(e){var n=ve?Hn.find(function(e){var n;return null===(n=s.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Hn[r]||{title:"",content:""};Et(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!==g&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(d.badgeBorder)}},{children:g})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!re.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(f.default,{color:d.badgeText})})),n.jsx(o.EllipsisVertical,{size:11,color:d.badgeText})]}))]}))}),"left-row-".concat(r))}),n.jsx("div",{ref:dn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(i.Box,e.__assign({ref:Ct,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(),xn.open&&bn===dt?Cn():(In(dt),At(bt(n.currentTarget,{title:"",content:"",evaluationResult:vt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,dt,!0,e.__assign(e.__assign({},gt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:gt.badgeBg,color:gt.badgeText,border:"1px solid ".concat(gt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=ft?ft:n.jsx(f.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:xn.open&&bn===dt?"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},ve?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[me&&n.jsx(l.default,{sections:11}),n.jsx(i.Box,e.__assign({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:n.jsx(i.Tooltip,e.__assign({title:kn,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:kn}))}))})),n.jsxs(i.Box,e.__assign({ref:un,onScroll:Qt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},ve?{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:cn,style:{width:"100%",height:"0px",flexShrink:0}}),Kn&&Hn.map(function(t,o){var r,l=t,u=[],c=!1,a=null,s=-1;if(ve){u=Gn.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=Gn.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0});var d=Gn.findIndex(function(e,n){var t;return Ve.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(c=-1!==d)&&(a=Gt(d))}else u=[o+1],(c=Ve.has(o))&&(a=Gt(o));var v=Gt(ve&&-1!==s?s:o);return n.jsx(i.Box,e.__assign({ref:nt.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:Qn.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:rt("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==Q?void 0:Q.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:ve?!!_t["right-".concat(o)]:!!_t[String(o)],treeData:Q,proposedSections:Gn,existingSections:Hn,deviationNumberRegistry:Wn,getBadgeRef:ut,getSectionCompareStyle:Gt,connectedSections:Ve,openMoreFunctionsPopup:Et,openSummaryPopup:oi,deviationNodeIdToView:null==ae?void 0:ae.id,deviationTargetParentId:di,onToggle:function(){li(),St(o,"right")},navigation:t.id?ai[t.id]:null,showOpenNodeRef:si,resolvedMarkdownStyles:on,maintainRelativeOrder:ve,showDeviationBadges:ge,renderSubSections:gi})})),ve&&v&&n.jsx(i.Box,e.__assign({ref:et.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:an,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 t=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./CognitiveCompareConstants.js"),n=function(t){return null==t?"":"string"==typeof t?t:Array.isArray(t)?t.map(n).join("\n\n"):"object"==typeof t?JSON.stringify(t):String(t)},e=function(t){return null!=t&&("string"==typeof t?t.trim().length>0:!Array.isArray(t)||t.length>0&&t.some(function(t){return e(t)}))};var o=["#B91C1C","#A16207","#1D4ED8","#000000"],r=function(t){var n=o.findIndex(function(n){return n.toLowerCase()===t.toLowerCase()});return-1===n?o.length:n};exports.DEVIATION_BADGE_SEPARATOR="::",exports.areMarkdownPropsEqual=function(t,n){var e,o,r,i,u,l;if(t.content!==n.content)return!1;if(t.sxStyles!==n.sxStyles)return!1;if(t.maintainRelativeOrder!==n.maintainRelativeOrder)return!1;if(t.highlightBg!==n.highlightBg)return!1;var a=t.highlights||[],v=n.highlights||[];if(a.length!==v.length)return!1;for(var s=0;s<a.length;s++)if(a[s]!==v[s])return!1;var d=t.deviationBadges||[],c=n.deviationBadges||[];if(d.length!==c.length)return!1;for(s=0;s<d.length;s++){if(d[s].id!==c[s].id)return!1;if(d[s].actionId!==c[s].actionId)return!1;if(d[s].label!==c[s].label)return!1;if(d[s].score!==c[s].score)return!1;if(d[s].isOrphan!==c[s].isOrphan)return!1;if(d[s].isConnected!==c[s].isConnected)return!1;if((null===(e=d[s].style)||void 0===e?void 0:e.badgeBg)!==(null===(o=c[s].style)||void 0===o?void 0:o.badgeBg))return!1;if((null===(r=d[s].style)||void 0===r?void 0:r.badgeBorder)!==(null===(i=c[s].style)||void 0===i?void 0:i.badgeBorder))return!1;if((null===(u=d[s].style)||void 0===u?void 0:u.badgeText)!==(null===(l=c[s].style)||void 0===l?void 0:l.badgeText))return!1}return!0},exports.debounce=function(t,n){var e;return function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];var i=this;clearTimeout(e),e=setTimeout(function(){return t.apply(i,o)},n)}},exports.escapeRegExp=function(t){var n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return n=(n=(n=(n=n.replace(/['’‘`]/g,"['’‘`]")).replace(/["”“]/g,'["”“]')).replace(/[-—–]/g,"[-—–]")).replace(/\s+/g,"\\s+")},exports.extractDeviationScore=function(t,n){var e,o,r,i,u,l,a;if(!t)return n;var v=null!==(l=null!==(i=null!==(o=null===(e=t.evaluation_output)||void 0===e?void 0:e.output_score)&&void 0!==o?o:null===(r=t.evaluation_outputs)||void 0===r?void 0:r.output_score)&&void 0!==i?i:null===(u=t.evaluation_outputs)||void 0===u?void 0:u.output_value)&&void 0!==l?l:t.output_score;return null!==(a=null!=v?v:n)&&void 0!==a?a:""},exports.generateColorPalette=function(t){var n=function(t,n){var e=function(t){var n=function(t){return 4===t.length?"#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]:t}(t).replace("#",""),e=parseInt(n,16);return{r:e>>16&255,g:e>>8&255,b:255&e}}(t),o=e.r,r=e.g,i=e.b;return function(t,n,e){return"#"+[t,n,e].map(function(t){return t.toString(16).padStart(2,"0")}).join("").toUpperCase()}(Math.round(o+(255-o)*n),Math.round(r+(255-r)*n),Math.round(i+(255-i)*n))};return{bg:n(t,.8),border:n(t,.5),badgeBg:n(t,.8),badgeBorder:n(t,.5),badgeText:t.toUpperCase(),highlightBg:n(t,.8)}},exports.getBentArrowPath=function(t,n,e,o,r){void 0===r&&(r=14);var i=t+.5*(e-t),u=o-n;if(Math.abs(u)<3)return"M ".concat(t," ").concat(n," H ").concat(e);var l=u>0?1:-1,a=Math.min(r,Math.abs(u)/2,Math.abs(i-t)/2,Math.abs(e-i)/2);return["M ".concat(t," ").concat(n),"H ".concat(i-a),"Q ".concat(i," ").concat(n," ").concat(i," ").concat(n+l*a),"V ".concat(o-l*a),"Q ".concat(i," ").concat(o," ").concat(i+a," ").concat(o),"H ".concat(e)].join(" ")},exports.getFirstDeviationColor=function(n){for(var e,o,i,u,l,a,v,s,d,c,p,g,f,h=[],b=0,_=Object.keys((null==n?void 0:n.deviations)||{}).sort(function(t,n){return Number(t)-Number(n)});b<_.length;b++){var m=_[b];(N=null===(u=null===(i=null===(o=null===(e=null==n?void 0:n.deviations)||void 0===e?void 0:e[m])||void 0===o?void 0:o.evaluation_outputs)||void 0===i?void 0:i.metadata)||void 0===u?void 0:u.label_color)&&h.push(N)}for(var y=0,x=Object.keys((null==n?void 0:n.deviation_entries)||{}).sort(function(t,n){return Number(t)-Number(n)});y<x.length;y++){m=x[y];(N=null===(s=null===(v=null===(a=null===(l=null==n?void 0:n.deviation_entries)||void 0===l?void 0:l[m])||void 0===a?void 0:a.evaluation_outputs)||void 0===v?void 0:v.metadata)||void 0===s?void 0:s.label_color)&&h.push(N)}for(var O=0,B=Object.keys(n||{}).filter(function(t){return/^\d+$/.test(t)}).sort(function(t,n){return Number(t)-Number(n)});O<B.length;O++){var N;m=B[O];(N=null===(p=null===(c=null===(d=null==n?void 0:n[m])||void 0===d?void 0:d.evaluation_outputs)||void 0===c?void 0:c.metadata)||void 0===p?void 0:p.label_color)&&h.push(N)}return 0===h.length?(null===(f=null===(g=null==n?void 0:n.evaluation_outputs)||void 0===g?void 0:g.metadata)||void 0===f?void 0:f.label_color)?n.evaluation_outputs.metadata.label_color:t.DEFAULT_DEVIAION_COLOR:h.sort(function(t,n){return r(t)-r(n)})[0]},exports.getFirstDeviationOutputValue=function(t){for(var n,e,o,r,i,u,l,a,v,s=0,d=Object.keys((null==t?void 0:t.deviations)||{}).sort(function(t,n){return Number(t)-Number(n)});s<d.length;s++){var c=d[s];if(b=null===(o=null===(e=null===(n=null==t?void 0:t.deviations)||void 0===n?void 0:n[c])||void 0===e?void 0:e.evaluation_outputs)||void 0===o?void 0:o.output_value)return b}for(var p=0,g=Object.keys((null==t?void 0:t.deviation_entries)||{}).sort(function(t,n){return Number(t)-Number(n)});p<g.length;p++){c=g[p];if(b=null===(u=null===(i=null===(r=null==t?void 0:t.deviation_entries)||void 0===r?void 0:r[c])||void 0===i?void 0:i.evaluation_outputs)||void 0===u?void 0:u.output_value)return b}for(var f=0,h=Object.keys(t||{}).filter(function(t){return/^\d+$/.test(t)}).sort(function(t,n){return Number(t)-Number(n)});f<h.length;f++){var b;c=h[f];if(b=null===(a=null===(l=null==t?void 0:t[c])||void 0===l?void 0:l.evaluation_outputs)||void 0===a?void 0:a.output_value)return b}return(null===(v=null==t?void 0:t.evaluation_outputs)||void 0===v?void 0:v.output_value)?t.evaluation_outputs.output_value:null},exports.getRationale=function(t){if(!t.mapping_rationale)return{cognitiveData:{decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0,citations:[]},score:0,relation:"N/A"};var n=t.mapping_rationale,e=parseInt(n.decision_strength||"0");return{cognitiveData:{decisioning:n.decisioning_factors||[],gap:n.gaps_in_decision||[],relevance_score:e,citations:n.citations},score:0,relation:"N/A"}},exports.getSideData=function(t,e,o){var r,i=o[e],u=null===(r=null==t?void 0:t.comparison_inputs)||void 0===r?void 0:r[i];return{title:n((null==u?void 0:u.title)||""),content:n((null==u?void 0:u.content)||""),attributes:(null==u?void 0:u.additional_attributes)||null,subsections:(null==u?void 0:u.subsections)||[]}},exports.hasValue=e,exports.isMissingStr=function(t){if(!t)return!0;var n=t.trim().toLowerCase();return n.includes("no equivalent")||"n/a"===n||"na"===n||"none"===n},exports.safeStringify=n,exports.smoothScrollTo=function(t,n,e,o,r){void 0===e&&(e=300);var i=t.style.scrollBehavior;t.style.scrollBehavior="auto";var u=t.scrollTop,l=n-u,a=null,v=function(s){null===a&&(a=s);var d,c=s-a;c<e?(t.scrollTop=(d=c,d/=e,l*(--d*d*d+1)+u),r&&r(),requestAnimationFrame(v)):(t.scrollTop=n,t.style.scrollBehavior=i,r&&r(),o&&o())};requestAnimationFrame(v)};
|
|
2
2
|
//# sourceMappingURL=CognitiveComparehelpers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("@mui/material"),r=require("react"),t=require("../CognitiveCompareConstants.js"),o=require("lucide-react"),a=require("react-markdown"),s=require("../CognitiveComparehelpers.js"),l=require("rehype-raw");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(r),u=d(a),p=d(l),g=c.default.memo(function(a){var l=a.content,d=a.sxStyles,g=a.deviationBadges,h=void 0===g?[]:g,_=a.highlights,f=void 0===_?[]:_,v=a.maintainRelativeOrder,x=void 0===v||v,m=a.highlightBg,b=r.useMemo(function(){return h.reduce(function(n,i){var r;return e.__assign(e.__assign({},n),((r={})[i.id]=i,r))},{})},[h]),y=function(n,i){return c.default.Children.map(n,function(n){var r;if(!c.default.isValidElement(n))return n;var t=(null===(r=n.props)||void 0===r?void 0:r.children)?y(n.props.children,i):n.props.children,o=c.default.cloneElement(n,e.__assign(e.__assign({},n.props),{children:t}));return i(o)})},C=r.useMemo(function(){return{mark:function(i){var r,t,o,a,s=i.children,l=e.__rest(i,["children"]),d=l["data-badge-id"],c=d?b[d]:null,u=null!==(a=null!==(t=null===(r=null==c?void 0:c.style)||void 0===r?void 0:r.highlightBg)&&void 0!==t?t:null===(o=null==c?void 0:c.style)||void 0===o?void 0:o.badgeBg)&&void 0!==a?a:m;return n.jsx("span",e.__assign({style:e.__assign(e.__assign({},l.isSuggestedDeviationFix?{}:{backgroundColor:u}),{borderRadius:"2px"})},{children:s}))},span:function(r){var a,s,l,d,c,u,p=r.children,g=e.__rest(r,["children"]),h=g["data-badge-id"];if(!h)return n.jsx("span",e.__assign({},g,{children:p}));var _=b[h];return _?n.jsxs(i.Box,e.__assign({component:"span",sx:{position:"static",display:"inline"}},{children:[n.jsxs(i.Box,e.__assign({ref:_.badgeRef,sx:e.__assign(e.__assign({fontStyle:"normal",position:"absolute",zIndex:30,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=_.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(s=_.style)||void 0===s?void 0:s.badgeText)||t.DEFAULT_DEVIAION_COLOR,border:"1px solid ".concat((null===(l=_.style)||void 0===l?void 0:l.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden"},"left"===_.side?{right:"-16px",transform:"translateY(-20%) translateX(calc(100% + 8px))"}:{left:"-16px",transform:"translateY(-20%) translateX(calc(-100% - 8px))"}),_.isConnected&&_.style&&{outline:"2px solid ".concat(_.style.badgeBorder),outlineOffset:"1px"})},{children:[n.jsxs(i.Box,e.__assign({onClick:function(e){e.stopPropagation(),_.onSummaryClick&&_.onSummaryClick(e)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:_.label})),("left"===_.side||_.isOrphan)&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=_.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=_.score&&"N/A"!==_.score&&"NA"!==_.score&&0!==_.score?"".concat(_.score):"N/A"===_.score||"NA"===_.score?"N/A":"Same"}))]})),("left"===_.side||_.isOrphan)&&n.jsx(i.Box,e.__assign({onClick:function(e){e.stopPropagation(),_.onClick&&_.onClick(e)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(c=_.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:n.jsx(o.EllipsisVertical,{size:12,color:(null===(u=_.style)||void 0===u?void 0:u.badgeText)||"#3730A3"})}))]})),p]})):n.jsx("span",e.__assign({},g,{children:p}))},updated:function(i){var r=i.children;return e.__rest(i,["children"]),n.jsx(n.Fragment,{children:r})},deleted:function(i){var r=i.children;e.__rest(i,["children"]),console.log("nitish: ",r);var t=y(r,function(e){return c.default.cloneElement(e,{isSuggestedDeviationFix:!0})});return n.jsx("span",e.__assign({style:{borderTop:"1px solid #EF4444",borderBottom:"1px solid #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:t}))},changed:function(i){var r=i.children;e.__rest(i,["children"]);var t=y(r,function(e){return c.default.cloneElement(e,{isSuggestedDeviationFix:!0})});return n.jsx("span",e.__assign({style:{borderTop:"1px solid #2F59FF",borderBottom:"1px solid #2F59FF",backgroundColor:"#D5E8FF"}},{children:t}))}}},[b,x]),E=r.useMemo(function(){var n=function(e){return e?e.replace(/\\([''])/g,"$1").replace(/\\n/g,"\n").replace(/\r\n/g,"\n").split(/(\n{2,})/).map(function(e){return e.startsWith("\n")?e:e.replace(/\n/g," ")}).join(""):""},i=function(e,n,i,r){void 0===n&&(n=""),void 0===i&&(i=""),void 0===r&&(r="");var t=e.startsWith("\n\n"),o=e.endsWith("\n\n");return i+e.split(/(\n{2,})/).map(function(e,i,r){if(/^\n{2,}$/.test(e))return e;if(!e.trim())return e;var a=0===i||1===i&&/^\n{2,}$/.test(r[0]),s=i===r.length-1||i===r.length-2&&/^\n{2,}$/.test(r[r.length-1]);return t&&a||o&&s?e:'<mark data-badge-id="'.concat(n,'">').concat(e,"</mark>")}).join("").replace(/^\n{2,}/,"").replace(/\n{2,}$/,"")+r},r=n(s.safeStringify(l||"")),t=e.__spreadArray([],h,!0).sort(function(e,n){var i,r;return((null===(i=n.highlight)||void 0===i?void 0:i.length)||0)-((null===(r=e.highlight)||void 0===r?void 0:r.length)||0)}),o={},a=0;t.forEach(function(e){if(e&&e.highlight){var t=n(e.highlight);if(t){var s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l="__DEV_TOKEN_".concat(a++,"__");o[l]=i(t,e.id,'<span data-badge-id="'.concat(e.id,'">'),"</span>"),r=r.replace(t,l);var d="__HIGHLIGHT_TOKEN_".concat(a++,"__");o[d]=i(t,e.id),r=r.replace(new RegExp(s,"g"),d)}}});var d=new Set(t.map(function(e){return n(e.highlight)}).filter(Boolean));return f.forEach(function(e){if(e){var t=n(e);if(t&&!d.has(t)){var s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l="__PLAIN_TOKEN_".concat(a++,"__");o[l]=i(t),r=r.replace(new RegExp(s,"g"),l)}}}),Object.keys(o).forEach(function(e){r=r.split(e).join(o[e])}),r},[l,h,f]);return n.jsx(i.Typography,e.__assign({component:"div",sx:e.__assign(e.__assign({},d),{position:"relative",overflow:"visible",whiteSpace:"pre-wrap","& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}})},{children:n.jsx(u.default,e.__assign({components:C,rehypePlugins:[p.default]},{children:s.safeStringify(E).replace(/\\n/g,"\n")}))}))},s.areMarkdownPropsEqual);exports.MemoizedMarkdown=g;
|
|
2
2
|
//# sourceMappingURL=memoizedMarkdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as n,__spreadArray as e}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 u,useCallback as c}from"react";import{Box as a,Snackbar as d,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 B}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as w,DEFAULT_FIELD_CONFIG as I,DEFAULT_COMPARISON_CONFIG as T}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as _,DEFAULT_COMPONENT_HEADER_TEXT as E}from"./CognitiveCompareConstants.js";import F from"./CognitivePopup.js";import D from"./MoreFunctionsPopup.js";import k from"./LoaderComponent.js";import A from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as M}from"./hooks/useCompareData.js";import{useComparePopups as N}from"./hooks/useComparePopups.js";import{useSectionRefs as H}from"./hooks/useSectionRefs.js";import{useAccordionState as j}from"./hooks/useAccordionState.js";import{useDeviationNavigation as L}from"./hooks/useDeviationNavigation.js";import O from"./components/CompareHeader.js";import P 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,nn,en,tn,on,rn,ln,un,cn,an,dn,sn,vn,pn,fn,gn,hn,xn=Y.componentHeaderText,mn=void 0===xn?E:xn,yn=Y.treeData,bn=Y.comparisonConfig,Sn=Y.leftColumnTitleText,Rn=Y.rightColumnTitleText,Cn=Y.markdownStyles,Bn=Y.displayConfig,wn=void 0===Bn?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!0}:Bn,In=Y.popupConfig,Tn=Y.deviationData,_n=void 0===Tn?{}:Tn,En=Y.deviationNodeIdToView,Fn=Y.resetDeviationNodeId,Dn=o(wn.maintainRelativeOrder),kn=Dn[0],An=Dn[1],Mn=!!kn||!!(null==wn?void 0:wn.showDeviationBadges),Nn=o(!1),Hn=Nn[0],jn=Nn[1],Ln=o(!1),On=Ln[0],Pn=Ln[1],zn=o(null),Wn=zn[0],Yn=zn[1],Kn=o(!1),qn=Kn[0],Vn=Kn[1],Xn=o(null===(q=null!==(K=null==yn?void 0:yn.newEvaluationResult)&&void 0!==K?K:null==wn?void 0:wn.enableDeviationSchemaBackwardCompatibility)||void 0===q||q)[0],Jn=o(!1),Un=Jn[0],$n=Jn[1],Gn=o(!1),Qn=Gn[0],Zn=Gn[1],ne=o(null),ee=ne[0],te=ne[1],ie=r(!1),oe=o(new Set),re=oe[0],le=oe[1],ue=o([]),ce=ue[0],ae=ue[1],de=r(null),se=r(!1),ve=r(null),pe=r({}),fe=r([]),ge=r(!1),he=r(!1),xe=r(null),me=r(function(){}),ye=l(function(){return(null==yn?void 0:yn.cognitive_decisioning)||{}},[yn]),be=o({width:0,height:0}),Se=be[0],Re=be[1],Ce=l(function(){return n(n({},w),Cn)},[Cn]),Be=r(null),we=r(null),Ie=r(null),Te=r(null),_e=r(null),Ee=r(null),Fe=r(null),De=r(null),ke=r(!1),Ae=r(null),Me=r(null),Ne=N(Be),He=Ne.cognitivePopup,je=Ne.setCognitivePopup,Le=Ne.moreFunctions,Oe=Ne.setMoreFunctions,Pe=Ne.position,ze=Ne.setPosition,We=Ne.activeBadgeId,Ye=Ne.summaryPopup,Ke=Ne.setSummaryPopup,qe=Ne.closeSummaryPopup,Ve=Ne.setActiveBadgeId,Xe=Ne.popupRef,Je=Ne.closeCognitivePopup,Ue=Ne.closeMoreFunctionsPopup,$e=l(function(){var n,e,t,i,o,r,l;return{fields:null!==(n=null==bn?void 0:bn.fields)&&void 0!==n?n:I,thresholds:{high:null!==(t=null===(e=null==bn?void 0:bn.thresholds)||void 0===e?void 0:e.high)&&void 0!==t?t:T.thresholds.high,medium:null!==(o=null===(i=null==bn?void 0:bn.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:T.thresholds.medium,exact:null!==(l=null===(r=null==bn?void 0:bn.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:T.thresholds.exact}}},[bn]),Ge=o(null),Qe=Ge[0];Ge[1];var Ze=null===(J=null===(V=null==yn?void 0:yn.documents)||void 0===V?void 0:V[null===(X=null==yn?void 0:yn.input_index_map)||void 0===X?void 0:X[0]])||void 0===J?void 0:J.title,nt=null===(G=null===(U=null==yn?void 0:yn.documents)||void 0===U?void 0:U[null===($=null==yn?void 0:yn.input_index_map)||void 0===$?void 0:$[1]])||void 0===G?void 0:G.title,et=m(Sn||Ze||"Uploaded Contract"),tt=m(Rn||nt||"Reference Template"),it=M(yn,kn,_n,$e,Xn),ot=it.activeProposed,rt=it.existingRule,lt=it.proposedSections,ut=it.existingSections,ct=it.visibleFields,at=it.parentDeviationRecord,dt=it.deviationNumberRegistry,st=it.parseError;u(function(){st&&Yn("Failed to load comparison: ".concat(st))},[st]);var vt=lt.length>0||ut.length>0,pt=H(ct.map(function(n){return n.key}),Math.max(lt.length,ut.length)),ft=pt.leftRefs,gt=pt.rightRefs,ht=pt.sectionLeftRefs,xt=pt.sectionRightRefs,mt=pt.lhsBadgeRefs,yt=pt.rhsBadgeRefs,bt=pt.sectionRightRowRefs,St=pt.subSectionLeftRefs,Rt=pt.subSectionRightRefs,Ct=pt.sectionRowRefs,Bt=pt.getSectionRowRef,wt=pt.getSubSectionRef,It=pt.getBadgeRef,Tt=rt.analysis,_t=m(null===(Z=null===(Q=null==Tt?void 0:Tt.rule_difference_comparison)||void 0===Q?void 0:Q.summary)||void 0===Z?void 0:Z.overall_summary),Et=!!_t.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Ft=null!==(nn=null==yn?void 0:yn.base_root_id)&&void 0!==nn?nn:"-1";null==yn||yn[Ft];var Dt=Xn?null!==(pn=null!==(dn=_n&&(null===(an=null==_n?void 0:_n[Ft])||void 0===an?void 0:an.evaluation_result))&&void 0!==dn?dn:null===(vn=null===(sn=null==yn?void 0:yn.nodes)||void 0===sn?void 0:sn[Ft])||void 0===vn?void 0:vn.evaluation_result)&&void 0!==pn?pn:null:null!==(cn=null!==(on=_n&&(null===(tn=null===(en=null==_n?void 0:_n[Ft])||void 0===en?void 0:en.evaluation_result)||void 0===tn?void 0:tn[0]))&&void 0!==on?on:null===(un=null===(ln=null===(rn=null==yn?void 0:yn.nodes)||void 0===rn?void 0:rn[Ft])||void 0===ln?void 0:ln.evaluation_result)||void 0===un?void 0:un[0])&&void 0!==cn?cn:null,kt=y(Dt),At=b(null!==(hn=null===(gn=null===(fn=null==Dt?void 0:Dt.evaluation_outputs)||void 0===fn?void 0:fn.metadata)||void 0===gn?void 0:gn.label_color)&&void 0!==hn?hn:""),Mt=c(function(){var n,e,t,i,o,r;Vn(!1),he.current=!1;var l=xe.current,u=Jt.current;if(null!==l)if("string"==typeof l&&l.includes(S)){var c=l.split(S);(a=(null===(n=St.current[c[2]])||void 0===n?void 0:n.current)||(null===(e=ht.current[Number(c[2])])||void 0===e?void 0:e.current))&&(a.style.paddingTop="0px")}else{var a;(a=null===(t=ht.current[l])||void 0===t?void 0:t.current)&&(a.style.paddingTop="0px")}if(null!==u)if("string"==typeof u&&u.includes(S)){c=u.split(S);(d=(null===(i=Rt.current[c[3]])||void 0===i?void 0:i.current)||(null===(o=xt.current[Number(c[3])])||void 0===o?void 0:o.current))&&(d.style.paddingTop="0px")}else{var d;(d=null===(r=xt.current[u])||void 0===r?void 0:r.current)&&(d.style.paddingTop="0px")}te(null),xe.current=null,Jt.current=null,$n(!1),Pn(!1),Te.current&&(Te.current.style.height="0px"),_e.current&&(_e.current.style.height="0px"),Ee.current&&(Ee.current.style.height="0px"),Fe.current&&(Fe.current.style.height="0px")},[]),Nt=j({maintainRelativeOrder:!!kn,proposedSections:lt,existingSections:ut,activeSideBySideSection:ee,connectedSections:re,resetSideBySide:Mt,setConnectedSections:le,setConnectedLines:ae,cachedConnectedPositions:fe,svgContainerRef:de,isAnimatingRef:se,animationTimerRef:ve,calculateLinesRef:me,sectionLeftRefs:ht,sectionRightRefs:xt,subSectionLeftRefs:St,subSectionRightRefs:Rt}),Ht=Nt.expandedSections,jt=Nt.setExpandedSections,Lt=Nt.expandedSubSections,Ot=Nt.setExpandedSubSections,Pt=Nt.toggleSection,zt=c(function(e,t,i,o,r,l,u){var c,a,d,s=m(null==t?void 0:t.id)||m(null==i?void 0:i.id)||"",v=(s?ye[s]:null)||(null==t?void 0:t.cognitiveData)||(null==i?void 0:i.cognitiveData)||{section_id:s,decisioning:[],gap:[],relevance_score:0},p=null!==(a=null===(c=Ct.current[o])||void 0===c?void 0:c.current)&&void 0!==a?a:null;return{isLoading:null!==(d=null==wn?void 0:wn.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==t?void 0:t.displayTitle)?null==t?void 0:t.title:"no title",refSectionTitle:(null==i?void 0:i.displayTitle)?null==i?void 0:i.title:"no title",cognitiveData:v,anchorEl:e,sectionAnchorEl:p,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==yn?void 0:yn.documents,input_index_map:null==yn?void 0:yn.input_index_map},deviationData:function(){var e,r,l=(null==t?void 0:t.evaluationResult)||(null==i?void 0:i.evaluationResult)||null,u=function(e){var t=function(n){if(!n||"object"!=typeof n)return null;var e=null==n?void 0:n.deviation_entries;if(e&&"object"==typeof e){var t=Object.keys(e).sort(function(n,e){return Number(n)-Number(e)})[0];if(t&&e[t])return e[t]}var i=Object.keys(n).filter(function(n){return/^\d+$/.test(n)}).sort(function(n,e){return Number(n)-Number(e)});if(i.length&&n[i[0]])return n[i[0]];var o=null==n?void 0:n.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(n,e){return Number(n)-Number(e)})[0];if(r&&o[r])return o[r]}return null}(e);return t?n(n({},e),{deviation_summary:(null==e?void 0:e.deviation_summary)||(null==t?void 0:t.deviation_summary),deviation_title:(null==e?void 0:e.deviation_title)||(null==t?void 0:t.deviation_title),deviation_impact:(null==e?void 0:e.deviation_impact)||(null==t?void 0:t.deviation_impact),deviation_explanation:(null==e?void 0:e.deviation_explanation)||(null==t?void 0:t.deviation_explanation),evaluation_outputs:(null==e?void 0:e.evaluation_outputs)||(null==t?void 0:t.evaluation_outputs),cognitive_decisioning:(null==e?void 0:e.cognitive_decisioning)||(null==t?void 0:t.cognitive_decisioning)}):e};if(!("string"==typeof o&&o.includes(S)))return u(l);var c=o.split(S)[1];if(!c)return l;var a=(null==t?void 0:t.evaluationResult)||(null==i?void 0:i.evaluationResult)||{},d=(null===(e=null==a?void 0:a.deviation_entries)||void 0===e?void 0:e[c])||(null===(r=null==a?void 0:a.deviations)||void 0===r?void 0:r[c])||null;return d?n(n(n({},a),d),{deviation_summary:(null==d?void 0:d.deviation_summary)||(null==a?void 0:a.deviation_summary),deviation_title:(null==d?void 0:d.deviation_title)||(null==a?void 0:a.deviation_title),deviation_impact:(null==d?void 0:d.deviation_impact)||(null==a?void 0:a.deviation_impact),deviation_explanation:(null==d?void 0:d.deviation_explanation)||(null==a?void 0:a.deviation_explanation),evaluation_outputs:(null==d?void 0:d.evaluation_outputs)||(null==a?void 0:a.evaluation_outputs),cognitive_decisioning:(null==d?void 0:d.cognitive_decisioning)||(null==a?void 0:a.cognitive_decisioning)}):u(l)}(),isOrphan:!!r}},[ye,yn]),Wt=c(function(n){Ue(),ze(null),je(n)},[Ue]),Yt=function(n,e,t,i,o,r){var l;if(n.stopPropagation(),Le.open&&Le.sectionIdx===o)Ue();else{var u=n.currentTarget,c="left";(null===(l=Ie.current)||void 0===l?void 0:l.contains(u))&&(c="right");he.current&&Mt(),le(new Set),ae([]),fe.current=[],Je(),Ye.open?Ci():qe(),requestAnimationFrame(function(){var n=function(){var n,e,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"===c?null===(n=yt.current[l])||void 0===n?void 0:n.current:null===(e=mt.current[l])||void 0===e?void 0:e.current}return"right"===c?null===(t=yt.current[o])||void 0===t?void 0:t.current:null===(i=mt.current[o])||void 0===i?void 0:i.current}()||u;Oe(zt(n,e,i,o,t,r))})}},Kt=c(function(){null!==Le.sectionIdx&&Le.anchorEl?Wt(n(n({},Le),{open:!0})):Ue()},[Le,Ue,Wt]),qt=c(function(){var n=Le.sectionIdx,e=Le.isOrphan;Ue(),qe(),null!==n&&(e?Yn("No counterpart exists to connect to."):(he.current&&Mt(),ae([]),fe.current=[],le(function(e){return e.has(n)?new Set:new Set([n])}),setTimeout(function(){me.current&&me.current()},50)))},[Le.sectionIdx,Le.isOrphan,Ue,qe,Mt]),Vt=r(null),Xt=r(null),Jt=r(null),Ut=r(null),$t=r(null),Gt=r(null),Qt=o([]),Zt=Qt[0],ni=Qt[1];r(null);var ei=o(null),ti=ei[0],ii=ei[1];u(function(){if(Qe){var n=$e.fields.find(function(n){return n.analysisKey===Qe||n.key===Qe});if(n){var e=ft.current[n.key]||gt.current[n.key];(null==e?void 0:e.current)&&setTimeout(function(){return e.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Qe,$e.fields]);var oi=c(function(n){var e,t,i,o,r,l,u,c,a,d=null===(e=null==Tt?void 0:Tt.rule_difference_comparison)||void 0===e?void 0:e.fields;if(!d||!d[n])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=d[n],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===(u=p.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(c=s.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=s.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Tt]),ri=c(function(e,t){var i,o,r,l,u,c,a;void 0===t&&(t="left");var d=null,s=null;if("left"===t)if(d=lt[e],kn&&d){var v=ut.filter(function(n){var e;return null===(e=d.refIndexes)||void 0===e?void 0:e.includes(n.selfIndex)});s=v.find(function(n){return n.evaluationResult})||v[0]}else s=ut[e];else if(s=ut[e],kn&&s){var p=lt.filter(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(s.selfIndex)});d=p.find(function(n){return n.evaluationResult})||p[0]}else d=lt[e];var f=(null==d?void 0:d.relation)&&"not_defined"!==d.relation,g=(null==s?void 0:s.relation)&&"not_defined"!==s.relation,h=!(!(null==d?void 0:d.cognitiveData)&&!(null==s?void 0:s.cognitiveData));if(!f&&!g&&!h)return n(n({},b(_)),{label:"Not Defined"});var x=null!==(o=null!==(i=null==d?void 0:d.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!==(c=null===(u=null===(l=null==x?void 0:x.evaluation_outputs)||void 0===l?void 0:l.metadata)||void 0===u?void 0:u.label_color)&&void 0!==c?c:_;return n(n({},b(y)),null!=x?{label:null!==(a=m)&&void 0!==a?a:""}:{label:null})},[lt,ut,ye,$e,kn]),li=c(function(e){for(var t,i,o,r,l,u,c,a,d,s=e.split("-").map(Number),v=lt[s[0]],p=ut[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 n(n({},b(_)),{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=ye[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===(u=null==S?void 0:S.evaluation_outputs)||void 0===u?void 0:u.output_value,C=null!==(d=null===(a=null===(c=null==S?void 0:S.evaluation_outputs)||void 0===c?void 0:c.metadata)||void 0===a?void 0:a.label_color)&&void 0!==d?d:_;return n(n({},b(C)),null!=S?{label:null!=R?R:""}:{label:null})},[lt,ut,ye,$e]),ui=c(function(){jt({}),Ot({}),Mt(),le(new Set),ae([]),fe.current=[],qe(),Je(),Ue(),requestAnimationFrame(function(){me.current&&me.current()})},[jt,Ot,Mt,qe,Je,Ue]),ci=l(function(){return Object.values(Ht).some(Boolean)||Object.values(Lt).some(Boolean)},[Ht,Lt]),ai=c(function(){var n,e,t,i,o,r,l,u,c,a,d,s,v,p,f,g,h,x,m,y,b,B;if(!ke.current&&!se.current){ke.current=!0;try{if(!Vt.current)return;var w=function(n){var e=n.split("-"),t=e[0];if(!Ht[t]&&!1===kn)return!1;if(kn&&!Ht["left-".concat(t)]&&!Ht["right-".concat(t)]&&!Ht[t])return!1;for(var i=t,o=1;o<e.length-1;o++)if(i+="-".concat(e[o]),!Lt[i])return!1;return!0},I=Vt.current.getBoundingClientRect();Re({width:I.width,height:I.height});var T=[];if(ct.forEach(function(n){var e,t,i=n.key,o=null===(e=ft.current[i])||void 0===e?void 0:e.current,r=null===(t=gt.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")}),!se.current){for(var _=0;_<Math.max(lt.length,ut.length);_++){var E=null===(n=ht.current[_])||void 0===n?void 0:n.current,F=null===(e=xt.current[_])||void 0===e?void 0:e.current;E&&(E.style.height="auto",E.style.minHeight="0px"),F&&(F.style.height="auto",F.style.minHeight="0px")}kn||Object.keys(St.current).forEach(function(n){var e,t;if(w(n)){var i=null===(e=St.current[n])||void 0===e?void 0:e.current,o=null===(t=Rt.current[n])||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 D={};ct.forEach(function(n){var e,t,i=n.key,o=null===(e=ft.current[i])||void 0===e?void 0:e.current,r=null===(t=gt.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),u=r.getBoundingClientRect();D[i]=Math.max(l.height,u.height)}});var k={left:{},right:{}},A={};if(!se.current)if(kn){if(qn&&null!==ee)if("number"==typeof ee){var M=ee,N=lt[M],H=null===(o=ht.current[M])||void 0===o?void 0:o.current;H&&N&&(N.refIndexes||[]).forEach(function(n){var e,t=ut.findIndex(function(e){return e.selfIndex===n}),i=null===(e=xt.current[t])||void 0===e?void 0:e.current;if(i&&(Ht["left-".concat(M)]||Ht["right-".concat(t)])){var o=Math.max(H.getBoundingClientRect().height,i.getBoundingClientRect().height);k.left[M]=Math.max(k.left[M]||0,o),k.right[t]=Math.max(k.right[t]||0,o)}})}else{var j=ee.split(S)[2];if(j){E=null===(r=St.current[j])||void 0===r?void 0:r.current,F=null===(l=Rt.current[j])||void 0===l?void 0:l.current;if(E&&F){L=Math.max(E.getBoundingClientRect().height,F.getBoundingClientRect().height);A[j]=Math.max(A[j]||0,L)}}}}else{Object.keys(St.current).forEach(function(n){var e,t;if(w(n)){var i=null===(e=St.current[n])||void 0===e?void 0:e.current,o=null===(t=Rt.current[n])||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);A[n]=u,i.style.minHeight="".concat(u,"px"),o.style.minHeight="".concat(u,"px")}}});for(_=0;_<Math.min(lt.length,ut.length);_++){var E=null===(t=ht.current[_])||void 0===t?void 0:t.current,F=null===(i=xt.current[_])||void 0===i?void 0:i.current;if(E&&F){var L=Math.max(E.getBoundingClientRect().height,F.getBoundingClientRect().height);k.left[_]=L,k.right[_]=L}}}if(ct.forEach(function(n){var e,t,i=n.key,o=null===(e=ft.current[i])||void 0===e?void 0:e.current,r=null===(t=gt.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=D[i];o.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}),se.current||(Object.entries(k.left).forEach(function(n){var e,t=n[0],i=n[1],o=null===(e=ht.current[Number(t)])||void 0===e?void 0:e.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(k.right).forEach(function(n){var e,t=n[0],i=n[1],o=null===(e=xt.current[Number(t)])||void 0===e?void 0:e.current;o&&(o.style.minHeight="".concat(i,"px"))}),kn||Object.keys(A).forEach(function(n){var e,t,i=null===(e=St.current[n])||void 0===e?void 0:e.current,o=null===(t=Rt.current[n])||void 0===t?void 0:t.current;if(i&&o&&A[n]){var r=A[n];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),kn)lt.forEach(function(n,e){var t;(null===(t=ht.current[e])||void 0===t?void 0:t.current)&&(n.refIndexes||[]).forEach(function(n){var t,i,o,r,l,u,c,a,d,s,v=ut.findIndex(function(e){return e.selfIndex===n});if(-1!==v){var p=null===(t=mt.current[e])||void 0===t?void 0:t.current,f=null===(i=yt.current[v])||void 0===i?void 0:i.current;if(p&&f){var g=p.getBoundingClientRect(),h=f.getBoundingClientRect(),x=g.right-I.left,m=h.left-I.left,y=g.top+g.height/2-I.top,b=h.top+h.height/2-I.top;if(qn&&ee===e){var S=null!==(r=null===(o=De.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,R=null!==(u=null===(l=Ie.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==u?u:0,C=S+(null!==(a=null===(c=De.current)||void 0===c?void 0:c.clientHeight)&&void 0!==a?a:1/0),B=R+(null!==(s=null===(d=Ie.current)||void 0===d?void 0:d.clientHeight)&&void 0!==s?s:1/0),w=g.top+g.height/2,_=h.top+h.height/2,E=function(n,e,t){return Math.max(e,Math.min(t,n))};y=E(w,S,C)-I.top,b=E(_,R,B)-I.top}var F=ri(e);F&&T.push({id:"line-".concat(e,"-").concat(v),x1:x,y1:y,x2:m,y2:b,style:F,sectionIdx:e,targetRightIdx:v})}}})});else{for(_=0;_<Math.min(lt.length,ut.length);_++){var O=null===(u=ht.current[_])||void 0===u?void 0:u.current,P=null===(c=xt.current[_])||void 0===c?void 0:c.current;if(O&&P){var z=O.getBoundingClientRect(),W=P.getBoundingClientRect(),Y=Math.max(z.top,W.top)+18-I.top,K=(null===(a=ut[_])||void 0===a?void 0:a.id)||"sec-".concat(_);(Q=ri(_))&&T.push({id:K,x1:z.right-I.left,y1:Y,x2:W.left-I.left,y2:Y,style:Q,sectionIdx:_,hasCognitive:!!((null===(d=lt[_])||void 0===d?void 0:d.cognitiveData)||(null===(s=ut[_])||void 0===s?void 0:s.cognitiveData)||K&&ye[K]),isSubSection:!1})}}Object.keys(St.current).forEach(function(n){var e,t,i,o,r,l;if(w(n)){var u=null===(e=St.current[n])||void 0===e?void 0:e.current,c=null===(t=Rt.current[n])||void 0===t?void 0:t.current;if(u&&c){for(var a=n.split("-").map(Number),d=lt[a[0]],s=ut[a[0]],v=1;v<a.length;v++)(null==d?void 0:d.subsections)&&(d=d.subsections[a[v]]),(null==s?void 0:s.subsections)&&(s=s.subsections[a[v]]);var p=!!d&&((null===(i=d.displayTitle)||void 0===i||i)&&R(d.title)),f=!!d&&((null===(o=d.displayContent)||void 0===o||o)&&R(d.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=u.getBoundingClientRect(),m=c.getBoundingClientRect(),y=Math.max(x.top,m.top)+16-I.top,b=li(n);b&&"Not Defined"!==b.label&&T.push({id:"subsec-".concat(n),x1:x.right-I.left,y1:y,x2:m.left-I.left,y2:y,style:b,sectionIdx:a[0],isSubSection:!0,subSectionKeyPath:n,hasCognitive:!(!(null==d?void 0:d.cognitiveData)&&!(null==s?void 0:s.cognitiveData))})}}}})}if(qn&&"string"==typeof ee&&ee.includes(S)){var q=ee.split(S),V=q[0],X=q[1],J=q[2],U=(q[3],"".concat(V).concat(S).concat(X)),$=null===(v=mt.current[U])||void 0===v?void 0:v.current,G=null===(p=yt.current[U])||void 0===p?void 0:p.current;if($&&G){var Q,Z=$.getBoundingClientRect(),nn=G.getBoundingClientRect(),en=Z.right-I.left,tn=nn.left-I.left,on=Z.top+Z.height/2-I.top,rn=nn.top+nn.height/2-I.top;if(kn){var ln=null!==(g=null===(f=De.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==g?g:0,un=null!==(x=null===(h=Ie.current)||void 0===h?void 0:h.getBoundingClientRect().top)&&void 0!==x?x:0,cn=ln+(null!==(y=null===(m=De.current)||void 0===m?void 0:m.clientHeight)&&void 0!==y?y:1/0),an=un+(null!==(B=null===(b=Ie.current)||void 0===b?void 0:b.clientHeight)&&void 0!==B?B:1/0),dn=function(n,e,t){return Math.max(e,Math.min(t,n))};on=dn(Z.top+Z.height/2,ln,cn)-I.top,rn=dn(nn.top+nn.height/2,un,an)-I.top}(Q=li(J))&&T.push({id:"line-subsec-".concat(U),x1:en,y1:on,x2:tn,y2:rn,style:Q,sectionIdx:Number(J.split("-")[0]),isSubSection:!0,subSectionKeyPath:ee})}}if(ni(T),$t.current&&Gt.current){var sn=$t.current.getBoundingClientRect(),vn=Gt.current.getBoundingClientRect(),pn=(sn.top+sn.height/2-I.top+vn.top+vn.height/2-I.top)/2;ii({x1:sn.right-I.left,x2:vn.left-I.left,y:pn})}else ii(null);if(re.size>0){var fn=[],gn=De.current,hn=Ie.current;if(gn&&hn){var xn=[],mn=gn.getBoundingClientRect().top,yn=hn.getBoundingClientRect().top,bn=mn+gn.clientHeight,Sn=yn+hn.clientHeight,Rn=gn.scrollTop,Cn=hn.scrollTop,Bn=I.top,wn=function(n,e,t){return Math.max(e,Math.min(t,n))};re.forEach(function(n){var e,t,i,o,r;if("string"==typeof n&&n.includes(S)){var l=n.split(S),u=l[0],c=l[1],a=l[2],d=(l[3],"".concat(u).concat(S).concat(c)),s=null===(e=mt.current[d])||void 0===e?void 0:e.current,v=null===(t=yt.current[d])||void 0===t?void 0:t.current;if(!s||!v)return;var p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),g=li(a),h=(N=p.right-I.left)+.5*((H=f.left-I.left-0)-N),x=p.top+p.height/2,m=f.top+f.height/2,y=x-mn+Rn,b=m-yn+Cn,R="conn-subsec-".concat(d);xn.push({lhsScrollY:y,rhsScrollY:b,x1:N,x2:H,containerTop:Bn,leftIdx:n,rhsArrayIdx:n,styleColor:(null==g?void 0:g.badgeBorder)||"#6366F1",styleId:R});var B=wn(x,mn,bn),w=wn(m,yn,Sn),T=B-Bn,_=w-Bn,E=m>=yn-4&&m<=Sn+4,F="";F=(j=x>=mn-4&&x<=bn+4)&&E?C(N,T,H,_):j&&!E?"M ".concat(N,",").concat(T," L ").concat(h,",").concat(T," L ").concat(h,",").concat(_):!j&&E?"M ".concat(h,",").concat(T," L ").concat(h,",").concat(_," L ").concat(H,",").concat(_):"M ".concat(h,",").concat(T," L ").concat(h,",").concat(_),fn.push({id:R,pathD:F,style:g,leftIdx:n,rhsArrayIdx:n})}else if(kn){var D=n,k=lt[D];if(!(null===(r=null==k?void 0:k.refIndexes)||void 0===r?void 0:r.length))return;k.refIndexes.forEach(function(n){var e,t,i=ut.findIndex(function(e){return e.selfIndex===n});if(-1!==i){var o=null===(e=mt.current[D])||void 0===e?void 0:e.current,r=null===(t=yt.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),u=r.getBoundingClientRect(),c=ri(D),a=l.right-I.left,d=u.left-I.left-0,s=a+.5*(d-a),v=l.top+l.height/2,p=u.top+u.height/2,f=v-mn+Rn,g=p-yn+Cn,h="conn-".concat(D,"-").concat(i);xn.push({lhsScrollY:f,rhsScrollY:g,x1:a,x2:d,containerTop:Bn,leftIdx:D,rhsArrayIdx:i,styleColor:(null==c?void 0:c.badgeBorder)||"#6366F1",styleId:h});var x=wn(v,mn,bn),m=wn(p,yn,Sn),y=x-Bn,b=m-Bn,S=v>=mn-4&&v<=bn+4,R=p>=yn-4&&p<=Sn+4,B="";B=S&&R?C(a,y,d,b):S&&!R?"M ".concat(a,",").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(d,",").concat(b):"M ".concat(s,",").concat(y," L ").concat(s,",").concat(b),fn.push({id:h,pathD:B,style:c,leftIdx:D,rhsArrayIdx:i})}}})}else{var A=n,M=A;s=null===(i=mt.current[A])||void 0===i?void 0:i.current,v=null===(o=yt.current[M])||void 0===o?void 0:o.current;if(!s||!v)return;var N,H;p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),g=ri(A),h=(N=p.right-I.left)+.5*((H=f.left-I.left-0)-N),x=p.top+p.height/2,m=f.top+f.height/2,y=x-mn+Rn,b=m-yn+Cn,R="conn-".concat(A,"-").concat(M);xn.push({lhsScrollY:y,rhsScrollY:b,x1:N,x2:H,containerTop:Bn,leftIdx:A,rhsArrayIdx:M,styleColor:(null==g?void 0:g.badgeBorder)||"#6366F1",styleId:R});var j;B=wn(x,mn,bn),w=wn(m,yn,Sn),T=B-Bn,_=w-Bn,E=m>=yn-4&&m<=Sn+4,F="";F=(j=x>=mn-4&&x<=bn+4)&&E?C(N,T,H,_):j&&!E?"M ".concat(N,",").concat(T," L ").concat(h,",").concat(T," L ").concat(h,",").concat(_):!j&&E?"M ".concat(h,",").concat(T," L ").concat(h,",").concat(_," L ").concat(H,",").concat(_):"M ".concat(h,",").concat(T," L ").concat(h,",").concat(_),fn.push({id:R,pathD:F,style:g,leftIdx:A,rhsArrayIdx:M})}}),fe.current=xn}ae(fn)}else ae([]),fe.current=[]}catch(n){console.error("Line render safe fail: ",n)}finally{ke.current=!1}}},[ct,lt,ut,ye,$e,oi,ri,kn,qn,ee,re,Ht,Lt]),di=c(function(){var n,e,t,i,o,r,l,u,c,a,d,s,v,p,f=fe.current;if(f.length&&!se.current){var g=null!==(e=null===(n=De.current)||void 0===n?void 0:n.scrollTop)&&void 0!==e?e:0,h=null!==(i=null===(t=Ie.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,x=null!==(r=null===(o=De.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(u=null===(l=Ie.current)||void 0===l?void 0:l.clientHeight)&&void 0!==u?u:1/0,y=null!==(a=null===(c=De.current)||void 0===c?void 0:c.getBoundingClientRect().top)&&void 0!==a?a:0,b=null!==(s=null===(d=Ie.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==s?s:0,S=y+x,R=b+m,B=null!==(p=null===(v=Vt.current)||void 0===v?void 0:v.getBoundingClientRect().top)&&void 0!==p?p:0,w=function(n,e,t){return Math.max(e,Math.min(t,n))};f.forEach(function(n){var e=n.lhsScrollY-g+y,t=n.rhsScrollY-h+b,i=pe.current[n.styleId+"-stroke"],o=pe.current[n.styleId+"-bg"];if(i||o){var r,l=w(e,y,S),u=w(t,b,R),c=l-B,a=u-B,d=e>=y-4&&e<=S+4,s=t>=b-4&&t<=R+4,v=n.x1+.5*(n.x2-n.x1);r=d&&s?C(n.x1,c,n.x2,a):d&&!s?"M ".concat(n.x1,",").concat(c," L ").concat(v,",").concat(c," L ").concat(v,",").concat(a):!d&&s?"M ".concat(v,",").concat(c," L ").concat(v,",").concat(a," L ").concat(n.x2,",").concat(a):"M ".concat(v,",").concat(c," L ").concat(v,",").concat(a),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);u(function(){me.current=ai},[ai]);var si=r(null),vi=r(null),pi=c(function(){fe.current.length>0&&!se.current||(null!==si.current&&clearTimeout(si.current),si.current=setTimeout(function(){me.current(),si.current=null},50))},[]),fi=c(function(){Zn(!0),$n(!1),null!==vi.current&&clearTimeout(vi.current),null!==si.current&&(clearTimeout(si.current),si.current=null),vi.current=setTimeout(function(){var n,e,t,i,o,r,l,u,c,a;if(fe.current=[],he.current&&null!==xe.current&&null!==Jt.current){var d=xe.current,s=Jt.current,v=null,p=null,f=null,g=null;if("string"==typeof d&&d.includes(S)){var h=d.split(S),x="".concat(h[0]).concat(S).concat(h[1]);v=(null===(n=mt.current[x])||void 0===n?void 0:n.current)||null,p=(null===(e=yt.current[x])||void 0===e?void 0:e.current)||null,f=(null===(t=St.current[h[2]])||void 0===t?void 0:t.current)||(null===(i=ht.current[Number(h[2])])||void 0===i?void 0:i.current)||null,g=(null===(o=Rt.current[h[3]])||void 0===o?void 0:o.current)||(null===(r=xt.current[Number(h[3])])||void 0===r?void 0:r.current)||null}else v=(null===(l=Ct.current[d])||void 0===l?void 0:l.current)||null,f=(null===(u=ht.current[d])||void 0===u?void 0:u.current)||null,p=(null===(c=bt.current[s])||void 0===c?void 0:c.current)||null,g=(null===(a=xt.current[s])||void 0===a?void 0:a.current)||null;if(v&&p&&f&&g){if(f.style.paddingTop="0px",g.style.paddingTop="0px",!kn){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=De.current,C=Ie.current;if(R&&C){var B=v.getBoundingClientRect().top-R.getBoundingClientRect().top+R.scrollTop,w=p.getBoundingClientRect().top-C.getBoundingClientRect().top+C.scrollTop-(B-R.scrollTop);Math.abs(C.scrollTop-w)>1&&(C.scrollTop=w)}}}me.current(),he.current&&$n(!0),Zn(!1),vi.current=null},150)},[kn,lt,ut]),gi=c(function(n){var e,t,i,o,r,l,u,c,a,d;if(null!==Ae.current&&Me.current&&Math.abs(n.currentTarget.scrollTop-Ae.current)<=2){var s=Me.current;Ae.current=null,Me.current=null,s()}if(!ie.current){if(kn||pi(),he.current){var v=xe.current,p=Jt.current,f=De.current,g=Ie.current;if(null!==v&&null!==p&&f&&g){var h="string"==typeof v&&v.includes(S)?null===(e=mt.current["".concat(v.split(S)[0]).concat(S).concat(v.split(S)[1])])||void 0===e?void 0:e.current:null===(t=Ct.current[v])||void 0===t?void 0:t.current,x="string"==typeof p&&p.includes(S)?null===(i=yt.current["".concat(p.split(S)[0]).concat(S).concat(p.split(S)[1])])||void 0===i?void 0:i.current:null===(o=bt.current[p])||void 0===o?void 0:o.current;if(h&&x&&Ut.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=mt.current[R])||void 0===r?void 0:r.current,y=null===(l=yt.current[R])||void 0===l?void 0:l.current}else m=null===(u=mt.current[v])||void 0===u?void 0:u.current,y=null===(c=yt.current[p])||void 0===c?void 0:c.current;var C=null!==(d=null===(a=Vt.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==d?d:0,B=f.getBoundingClientRect().top,w=B+f.clientHeight;g.getBoundingClientRect().top;g.clientHeight;if(m&&y){var I=m.getBoundingClientRect(),T=y.getBoundingClientRect(),_=I.top+I.height/2;T.top,T.height;var E=((D=_,k=B,A=w,Math.max(k,Math.min(A,D)))-C).toString();Ut.current.setAttribute("y1",E),Ut.current.setAttribute("y2",E);var F=_>=B-4&&_<=w+4;Ut.current.setAttribute("visibility",F?"visible":"hidden")}}}}var D,k,A;fe.current.length>0&&!ge.current&&(ge.current=!0,requestAnimationFrame(function(){di(),ge.current=!1}))}},[di,kn,pi]),hi=r(0),xi=r(0),mi=r(0),yi=r(function(){});r(null),u(function(){yi.current=fi},[fi]),u(function(){var n=setTimeout(pi,250),e=function(){return yi.current()};return window.addEventListener("resize",e),function(){clearTimeout(n),null!==si.current&&clearTimeout(si.current),null!==vi.current&&clearTimeout(vi.current),window.removeEventListener("resize",e)}},[ot,rt,Tt,ct,Ht,Lt,lt,ut,$e,pi,qn,ee,Un,re]),u(function(){var n=function(n,e,t,i,o){e.current=n.getBoundingClientRect().width;var r=new ResizeObserver(function(n){null!==t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){var r,l,u;t.current=null;var c=n[n.length-1];if(c){var a=null!==(u=null===(l=null===(r=c.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:c.contentRect.width;Math.abs(a-e.current)<1?o():(e.current=a,i())}})});return r.observe(n),r},e={current:null},t={current:null},i={current:null},o=[],r=[e,t,i];return we.current&&o.push(n(we.current,hi,e,function(){return yi.current()},function(){})),Be.current&&o.push(n(Be.current,xi,t,function(){return yi.current()},function(){return me.current()})),Vt.current&&o.push(n(Vt.current,mi,i,function(){return yi.current()},function(){return me.current()})),function(){o.forEach(function(n){return n.disconnect()}),r.forEach(function(n){null!==n.current&&(cancelAnimationFrame(n.current),n.current=null)})}},[]),u(function(){he.current=qn},[qn]),u(function(){xe.current=ee},[ee]);var bi=c(function(n,e,t){var i,o,r=null===(i=null==t?void 0:t.toggleIfSame)||void 0===i||i,l=null==t?void 0:t.onReady,u=null!==(o=null==t?void 0:t.sourceSide)&&void 0!==o?o:"left";Ue(),null!=n&&(e?Yn("No counterpart exists for this section."):qn&&ee===n?r?Mt():null==l||l():(le(new Set([n])),ae([]),fe.current=[],Pn(!0),ie.current=!0,te(n),xe.current=n,Vn(!0),he.current=!0,$n(!1),Te.current&&(Te.current.style.height="0px"),_e.current&&(_e.current.style.height="0px"),Ee.current&&(Ee.current.style.height="0px"),Fe.current&&(Fe.current.style.height="0px"),requestAnimationFrame(function(){var e,t,i,o,r,c="string"==typeof n&&n.includes(S),a=null,d=null,s=null;if(c){var v=n.split(S),p="".concat(v[0]).concat(S).concat(v[1]);a=(null===(e=mt.current[p])||void 0===e?void 0:e.current)||null,d=(null===(t=yt.current[p])||void 0===t?void 0:t.current)||null,s=d?n:null}else if(a=(null===(i=Ct.current[n])||void 0===i?void 0:i.current)||null,kn){var f=lt[n],g=(null==f?void 0:f.refIndexes)||[];if(g.length>0){var h=g[0],x=ut.findIndex(function(n){return n.selfIndex===h});-1!==x&&(d=(null===(r=bt.current[x])||void 0===r?void 0:r.current)||null,s=x)}}else d=(null===(o=bt.current[n])||void 0===o?void 0:o.current)||null,s=d?n:null;Jt.current=s;var m=De.current,y=Ie.current,b=function(){!function(){var e,t,i,o,r,l,u,a,d,v,p,f,g=null,h=null,x=null,m=null;if(c){var y=n.split(S),b="".concat(y[0]).concat(S).concat(y[1]);g=(null===(e=St.current[y[2]])||void 0===e?void 0:e.current)||(null===(t=ht.current[Number(y[2])])||void 0===t?void 0:t.current)||null,h=(null===(i=Rt.current[y[3]])||void 0===i?void 0:i.current)||(null===(o=xt.current[Number(y[3])])||void 0===o?void 0:o.current)||null,x=(null===(r=mt.current[b])||void 0===r?void 0:r.current)||g,m=(null===(l=yt.current[b])||void 0===l?void 0:l.current)||h}else{var R=Number(n),C=null!==s?Number(s):R;g=(null===(u=ht.current[R])||void 0===u?void 0:u.current)||null,h=(null===(a=xt.current[C])||void 0===a?void 0:a.current)||null,x=(null===(d=mt.current[R])||void 0===d?void 0:d.current)||(null===(v=Ct.current[R])||void 0===v?void 0:v.current)||g,m=(null===(p=yt.current[C])||void 0===p?void 0:p.current)||(null===(f=bt.current[C])||void 0===f?void 0:f.current)||h}if(x&&m&&g&&h){g.style.paddingTop="0px",h.style.paddingTop="0px";var B=x.getBoundingClientRect(),w=m.getBoundingClientRect(),I=B.top-w.top;I>0?h.style.paddingTop="".concat(I,"px"):I<0&&(g.style.paddingTop="".concat(Math.abs(I),"px"))}}(),$n(!0),me.current&&me.current(),ie.current=!1,"right"===u&&y?y.dispatchEvent(new Event("scroll")):m&&m.dispatchEvent(new Event("scroll")),Pn(!1),null==l||l()};if(!a||!m)return ie.current=!1,Pn(!1),void(null==l||l());if(d&&y){if(!kn){var R=0;R="right"===u?d?d.getBoundingClientRect().top:0:a?a.getBoundingClientRect().top:0;var C=Be.current,w=(null==C?void 0:C.getBoundingClientRect().top)||0,I=C?C.scrollTop+R-w-150:0;return C?void B(C,I,200,b):void b()}var T=a.getBoundingClientRect().top-m.getBoundingClientRect().top+m.scrollTop,_=d.getBoundingClientRect().top-y.getBoundingClientRect().top+y.scrollTop,E=200;if("left"===u){var F=_-(T-m.scrollTop);F<0&&Te.current&&(Te.current.style.height="".concat(Math.abs(F),"px")),requestAnimationFrame(function(){var n,e=y.scrollHeight-y.clientHeight;if(F<0)n=0;else{if(F>e){var t=F-e;return _e.current&&(_e.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){B(y,F,E,b)})}n=F}B(y,n,E,b)})}else{var D=T-(_-y.scrollTop);D<0&&Ee.current&&(Ee.current.style.height="".concat(Math.abs(D),"px")),requestAnimationFrame(function(){var n,e=m.scrollHeight-m.clientHeight;if(D<0)n=0;else{if(D>e){var t=D-e;return Fe.current&&(Fe.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){B(m,D,E,b)})}n=D}B(m,n,E,b)})}}else b()})))},[ee,Ue,ut,qn,kn,lt,Mt]),Si=c(function(n,e,t,i){var o,r="string"==typeof i?m(i).trim():m(null==i?void 0:i.deviation_summary).trim(),l=n.currentTarget;Je();var u="left";(null===(o=Ie.current)||void 0===o?void 0:o.contains(l))&&(u="right");var c=function(){var n,t,i,o;if("string"==typeof e&&e.includes(S)){var r=e.split(S),l="".concat(r[0]).concat(S).concat(r[1]);return"right"===u?null===(n=yt.current[l])||void 0===n?void 0:n.current:null===(t=mt.current[l])||void 0===t?void 0:t.current}return"right"===u?null===(i=yt.current[e])||void 0===i?void 0:i.current:null===(o=mt.current[e])||void 0===o?void 0:o.current};if(t)return Mt(),le(new Set),ae([]),fe.current=[],void(r&&requestAnimationFrame(function(){var n=c()||l;Ke({open:!0,anchorEl:n,summary:i})}));bi(e,t,r?{toggleIfSame:!1,sourceSide:u,onReady:function(){var n=c()||l;Ke({open:!0,anchorEl:n,summary:i})}}:{toggleIfSame:!1,sourceSide:u})},[bi,Je,Ke,Mt]),Ri=c(function(){var n,e=Le.sectionIdx,t=Le.isOrphan;if(qe(),null!=e){var i="left";Le.anchorEl&&(null===(n=Ie.current)||void 0===n?void 0:n.contains(Le.anchorEl))&&(i="right"),bi(e,t,{sourceSide:i})}},[bi,Le.isOrphan,Le.sectionIdx,Le.anchorEl,qe]),Ci=c(function(){qe(),Mt(),le(new Set),ae([]),fe.current=[]},[qe,Mt]),Bi=null!==Le.sectionIdx&&re.has(Le.sectionIdx),wi=L({proposedSections:lt,existingSections:ut,parentDeviationRecord:at,expandedSections:Ht,maintainRelativeOrder:!!kn,scrollContainerRef:Be,leftContainerRef:De,lhsBadgeRefs:mt,rhsBadgeRefs:yt}),Ii=wi.showDeviationNavigation,Ti=wi.showOpenNodeRef,_i=l(function(){if(!En)return null;var n=En.split(":")[0];for(var e in at){if((at[e]||[]).some(function(e){return e.id===n}))return e}return null},[En,at]),Ei=r(null),Fi=r(null);u(function(){if(En&&Ei.current!==En){var t=En.split(":"),i=t[0],o=t[1],r=null!=o?o:"0";Fi.current!==En&&(qe(),Je(),Mt(),le(new Set),ae([]),fe.current=[],Fi.current=En);var l=!1,u=0,c=null,a=150,d=function(n,e){for(var t=function(n,i){if(!n)return null;if(n.id===e)return i;if(!Array.isArray(n.subsections))return null;for(var o=0;o<n.subsections.length;o++){var r=t(n.subsections[o],"".concat(i,"-").concat(o));if(r)return r}return null},i=0;i<n.length;i++){var o=t(n[i],String(i));if(o)return o}return null},s=function(){var t,o,v,p;if(!l){var f=null,g=null;for(var h in at){var x=at[h].find(function(n){return n.id===i});if(x){f=h,g=x;break}}if(g&&f){var m=lt.findIndex(function(n){return n.id===f}),y=ut.findIndex(function(n){return n.id===f}),b=-1===m&&-1!==y,R=d(lt,g.id),C=d(ut,g.id);if(R&&!C&&!b){var B=R.split("-"),w=Number(B[0]);if(kn){var I=null===(o=null===(t=lt[w])||void 0===t?void 0:t.refIndexes)||void 0===o?void 0:o[0],T=ut.findIndex(function(n){return n.selfIndex===I});-1!==T&&(w=T)}C=e([w],B.slice(1),!0).join("-")}if(R||C){var _=b||!R&&!!C,E=R?Number(R.split("-")[0]):m,F=C?Number(C.split("-")[0]):y;if(_){if(!(kn?!!Ht["right-".concat(F)]:!!Ht[String(F)])&&F>=0)return Pt(F,"right"),u+=1,void(c=setTimeout(s,450))}else if(!(kn?!!Ht["left-".concat(E)]:!!Ht[String(E)])&&E>=0)return Pt(E,"left"),u+=1,void(c=setTimeout(s,450));var D,k=R||"",A=C||"",M="".concat(g.id).concat(S).concat(r).concat(S).concat(k).concat(S).concat(A),N="".concat(g.id).concat(S).concat(r),H=null===(v=mt.current[N])||void 0===v?void 0:v.current,j=null===(p=yt.current[N])||void 0===p?void 0:p.current,L=_||!H&&!!j,O=L?j:H;if(D=kn?L?Ie.current:De.current:Be.current,O&&D){var P=O.getBoundingClientRect();if(0===P.height)return void((u+=1)<20&&(c=setTimeout(s,a)));var z=D.getBoundingClientRect(),W=P.top-z.top+D.scrollTop-z.height/2+P.height/2,Y=function(){var e,t,i,o,u;if(!l){Ei.current=En;var c=window.getComputedStyle(O).color;H&&(H.style.transition="box-shadow 300ms ease-in-out",H.style.boxShadow="0 0 10px ".concat(c)),j&&(j.style.transition="box-shadow 300ms ease-in-out",j.style.boxShadow="0 0 10px ".concat(c)),setTimeout(function(){H&&(H.style.boxShadow=""),j&&(j.style.boxShadow="")},2e3);var a=(null===(t=null===(e=g.evaluationResult)||void 0===e?void 0:e.deviations)||void 0===t?void 0:t[r])||g,d=(null===(i=g.evaluationResult)||void 0===i?void 0:i.evaluation_outputs)||g.evaluation_outputs;if(!(!!H&&!!j)){var s=L?(null===(o=yt.current[N])||void 0===o?void 0:o.current)||j:(null===(u=mt.current[N])||void 0===u?void 0:u.current)||H;return Ke({open:!0,anchorEl:s,summary:n(n({},a),{evaluation_outputs:d})}),void(null==Fn||Fn())}bi(M,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var e,t=(null===(e=mt.current[N])||void 0===e?void 0:e.current)||H;Ke({open:!0,anchorEl:t,summary:n(n({},a),{evaluation_outputs:d})})}})}};Math.abs(D.scrollTop-W)<=2?Y():(Ae.current=W,Me.current=Y,D.scrollTo({top:W,behavior:"smooth"}),c&&clearTimeout(c),c=setTimeout(function(){if(Me.current){Ae.current=null;var n=Me.current;Me.current=null,n()}},800))}else(u+=1)<20&&(c=setTimeout(s,a))}else(u+=1)<20&&(c=setTimeout(s,a))}else(u+=1)<20&&(c=setTimeout(s,a))}};return c=setTimeout(s,a),function(){l=!0,c&&clearTimeout(c)}}},[En,at,lt,ut,kn,Ht,Pt,bi,Ke]);var Di=function(n){var e=n.section,t=n.keyPath,o=n.depth,r=void 0===o?0:o,l=n.columnKey,u=void 0===l?"left":l,c=n.parentNodeId;return i(z,{section:e,keyPath:t,depth:r,columnKey:u,parentNodeId:void 0===c?"":c,expandedSubSections:Lt,setExpandedSubSections:Ot,maintainRelativeOrder:kn||!1,proposedSections:lt,existingSections:ut,treeData:yn,deviationNumberRegistry:dt,connectedSections:re,activeSideBySideSection:ee,resolvedMarkdownStyles:Ce,getSubSectionRef:wt,getSubSectionCompareStyle:li,getBadgeRef:It,openMoreFunctionsPopup:Yt,openSummaryPopup:Si,showDeviationBadges:Mn,resetSideBySide:Mt,setConnectedSections:le,setConnectedLines:ae,cachedConnectedPositions:fe})};return t(a,n({ref:we,sx:n(n({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},kn?{}:{overflow:"visible"}),{position:"relative"})},{children:[Hn&&i(a,n({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,{})})),Ye.open&&i(W,{open:Ye.open,anchorEl:Ye.anchorEl,containerEl:Xt.current,clipTopEl:$t.current,scrollContainerEl:Be.current,onClose:Ci,summary:Ye.summary}),i(D,{open:Le.open,anchorEl:Le.anchorEl,sectionTitle:Le.sectionTitle,referenceSectionTitle:Le.refSectionTitle,onClose:Ue,onOpenCognitiveCompare:Kt,onOpenSideBySide:Ri,onConnect:qt,isConnected:Bi,isOrphan:Le.isOrphan}),He.open&&i(F,{open:He.open,popupRef:Xe,position:Pe,popupConfig:In,onClose:function(){ze(null),je(function(e){return n(n({},e),{open:!1})}),Ve(null)},markdownStyles:Cn,sectionTitle:He.sectionTitle,referenceSectionTitle:He.refSectionTitle,cognitiveData:He.cognitiveData,anchorEl:He.anchorEl,sectionAnchorEl:He.sectionAnchorEl,scrollContainerEl:Be.current,badgeStyle:He.badgeStyle,docData:He.docData,deviationData:He.deviationData,isLoading:He.isLoading}),i(d,n({open:!!Wn,autoHideDuration:8e3,onClose:function(){return Yn(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(s,n({onClose:function(){return Yn(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Wn}))})),i(O,{componentHeaderText:mn,displayConfig:wn,maintainRelativeOrder:kn,onCollapseAll:ui,showCollapseAll:ci,onToggleView:function(n){jn(!0),setTimeout(function(){An(!n),Mt(),qe(),le(new Set),ae([]),fe.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){jn(!1)},600)})})},50)}}),i(a,n({ref:Be,onScroll:gi,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:kn?"hidden":"auto",borderTop:_t&&Et?"none":"1.5px solid #EEF0F4"}},{children:i(a,n({sx:n({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},kn?{flex:1,minHeight:0}:{})},{children:t(a,n({ref:Vt,sx:n({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},kn?{flex:1,overflow:"visible"}:{})},{children:[t("svg",n({ref:de,style:{position:"absolute",top:0,left:0,width:Se.width||"100%",height:Se.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:Qn?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[ti&&i("g",{children:i("line",{x1:ti.x1,y1:ti.y,x2:ti.x2,y2:ti.y,stroke:At.badgeBorder,strokeWidth:"1.5"})}),Zt.map(function(e){var o,r,l,u,c,d,s=e.x1+.5*(e.x2-e.x1),v=(e.y1+e.y2)/2;if("Not Defined"===e.style.label&&!e.hasCognitive)return null;if(e.isSubSection?qn&&ee===e.subSectionKeyPath&&Un:qn&&ee===e.sectionIdx&&Un)return null;if(!kn){var p=e.isSubSection?C(e.x1,e.y1,e.x2,e.y2):"M ".concat(e.x1," ").concat(e.y1," L ").concat(e.x2," ").concat(e.y2),g=lt[e.sectionIdx]||{title:"",content:""},x=ut[e.sectionIdx]||{title:"",content:""};if(console.log("Base and Ref Sections for Badge:",g,x),e.isSubSection&&e.subSectionKeyPath){var m=e.subSectionKeyPath.includes(S)?e.subSectionKeyPath.split(S):[],y=m[2]||e.subSectionKeyPath,b=m[3]||y,R=y.split("-").map(Number),B=b.split("-").map(Number),w=null,I=null;R.length>0&&(w=lt[R[0]]),B.length>0&&(I=ut[B[0]]);var T=(null==w?void 0:w.title)||"",E=(null==I?void 0:I.title)||"";console.log("Root Parent Titles:",T,E);for(var F=1;F<R.length;F++)(null==w?void 0:w.subsections)&&(w=w.subsections[R[F]]);for(F=1;F<B.length;F++)(null==I?void 0:I.subsections)&&(I=I.subsections[B[F]]);w&&(g=n(n({},w),{title:T||w.title})),console.log("Base Section for Subsection Badge:",g),I&&(x=n(n({},I),{title:E||I.title})),console.log("Ref Section for Subsection Badge:",x)}var D=!(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===(d=null===(c=null===(u=g.evaluationResult)||void 0===u?void 0:u.cognitive_decisioning)||void 0===c?void 0:c.decisioning_factors)||void 0===d?void 0:d.length)||!1,M=D||k;return t("g",{children:[i("path",{d:p,fill:"none",stroke:e.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i("foreignObject",n({x:s-100,y:v-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(a,n({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t(a,n({onClick:function(n){n.stopPropagation(),M&&(He.open&&We===e.id?Je():(Ve(e.id),Wt(zt(n.currentTarget,g,x,e.sectionIdx,e.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:e.style.badgeBg,color:e.style.badgeText,border:"1px solid ".concat(e.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:M?"pointer":"default"}},{children:[e.style.badgeText===_&&null==e.style.label?i(A,{color:e.style.badgeText}):0===e.style.label?"Same":e.style.label,i(a,n({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(h,{})})),M&&i(f,{size:11,style:{transform:He.open&&We===e.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},e.id)}return null}),ce.map(function(e){var o,r=e.pathD,l=(null===(o=e.style)||void 0===o?void 0:o.badgeBorder)||"#6366F1",u="conn-marker-".concat(e.id),c="".concat(e.id,"-bg"),a="".concat(e.id,"-stroke");return t("g",{children:[i("defs",{children:i("clipPath",n({id:"connections-clip"},{children:i("marker",n({id:u,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(n){pe.current[c]=n},d:r,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),i("path",{ref:function(n){pe.current[a]=n},d:r,fill:"none",stroke:l,strokeWidth:"1.75",markerEnd:"url(#".concat(u,")")})]},e.id)})]})),t(a,n({sx:n({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},kn?{flex:1,overflow:"visible"}:{})},{children:[i(a,n({ref:$t,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,n({title:et,placement:"top"},{children:i(p,n({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:et}))}))})),t(a,n({ref:De,onScroll:gi,sx:n({p:"12px",display:"flex",flexDirection:"column"},kn?{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:Ee,style:{width:"100%",height:"0px",flexShrink:0}}),vt&<.map(function(e,o){var r,l,u=!e.title&&!e.content;if(kn&&u)return null;var c=e,d=ri(o,"left"),s=kn?!(null===(r=c.refIndexes)||void 0===r?void 0:r.length)||c.selfIndex<0:!ut[o],v=kn?"number"==typeof c.selfIndex&&c.selfIndex>=0?c.selfIndex+1:null:o+1,p=re.has(o),f=y(c.evaluationResult,null==d?void 0:d.deviationLabel);return i(a,n({ref:Bt(o),sx:{mb:1,width:"100%"}},{children:t(a,n({sx:{position:"relative",width:"100%"}},{children:[i(a,n({ref:ht.current[o],sx:n({width:"100%",display:"flex"},p&&{borderRadius:"6px",outline:"2px solid ".concat((null==d?void 0:d.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:i(P,{section:e,idx:o,columnKey:"left",colRef:Bt("left-accordion-".concat(o)),mb:0,treeData:yn,proposedSections:lt,existingSections:ut,deviationNumberRegistry:dt,getSectionCompareStyle:ri,getBadgeRef:It,connectedSections:re,openMoreFunctionsPopup:Yt,openSummaryPopup:Si,deviationNodeIdToView:En,deviationTargetParentId:_i,parentNodeId:(null===(l=null==yn?void 0:yn.input_index_map)||void 0===l?void 0:l[0])||"",isExpanded:kn?!!Ht["left-".concat(o)]:!!Ht[String(o)],onToggle:function(){Ci(),Pt(o,"left")},navigation:e.id?Ii[e.id]:null,showOpenNodeRef:Ti,resolvedMarkdownStyles:Ce,maintainRelativeOrder:kn,showDeviationBadges:Mn,renderSubSections:Di})})),kn&&d&&t(a,n({ref:mt.current[o],onClick:function(n){var t=kn?ut.find(function(n){var e;return null===(e=c.refIndexes)||void 0===e?void 0:e.includes(n.selfIndex)})||{title:"",content:""}:ut[o]||{title:"",content:""};Yt(n,e,s,t,o,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!==v&&i(a,n({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(d.badgeBorder)}},{children:v})),i(a,n({component:"span",sx:{fontSize:"11px",px:.25}},{children:!wn.isLoading||null!=c.evaluationResult&&null!=c.evaluationResult?s?"No Deviation Found":"N/A"===f||"NA"===f?"N/A":0==f||null==f?"Same":"".concat(f):i(A,{color:d.badgeText})})),i(g,{size:11,color:d.badgeText})]}))]}))}),"left-row-".concat(o))}),i("div",{ref:Fe,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(a,n({ref:Xt,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:i(a,n({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(a,n({onClick:function(e){e.stopPropagation(),He.open&&We===Ft?Je():(Ve(Ft),Wt(zt(e.currentTarget,{title:"",content:"",evaluationResult:Dt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Ft,!0,n(n({},At),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:At.badgeBg,color:At.badgeText,border:"1px solid ".concat(At.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=kt?kt:i(A,{}),i(a,n({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:He.open&&We===Ft?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),t(a,n({sx:n({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},kn?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[On&&i(x,{sections:11}),i(a,n({ref:Gt,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,n({title:tt,placement:"top"},{children:i(p,n({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:tt}))}))})),t(a,n({ref:Ie,onScroll:gi,sx:n({p:"12px",display:"flex",flexDirection:"column"},kn?{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:Te,style:{width:"100%",height:"0px",flexShrink:0}}),vt&&ut.map(function(e,o){var r,l=e,u=[],c=!1,d=null,s=-1;if(kn){u=lt.filter(function(n){var e;return(null===(e=n.refIndexes)||void 0===e?void 0:e.includes(l.selfIndex))&&n.selfIndex>=0}).map(function(n){return n.selfIndex+1}),s=lt.findIndex(function(n){var e;return(null===(e=n.refIndexes)||void 0===e?void 0:e.includes(l.selfIndex))&&n.selfIndex>=0});var v=lt.findIndex(function(n,e){var t;return re.has(e)&&(null===(t=n.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(c=-1!==v)&&(d=ri(v))}else u=[o+1],(c=re.has(o))&&(d=ri(o));var p=ri(kn&&-1!==s?s:o);return i(a,n({ref:bt.current[o],sx:{mb:1,width:"100%"}},{children:t(a,n({sx:{position:"relative",width:"100%"}},{children:[i(a,n({ref:xt.current[o],sx:n({width:"100%",display:"flex"},c&&d&&{borderRadius:"6px",outline:"2px solid ".concat(d.badgeBorder),outlineOffset:"1px"})},{children:i(P,{section:e,idx:o,columnKey:"right",colRef:Bt("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==yn?void 0:yn.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:kn?!!Ht["right-".concat(o)]:!!Ht[String(o)],treeData:yn,proposedSections:lt,existingSections:ut,deviationNumberRegistry:dt,getBadgeRef:It,getSectionCompareStyle:ri,connectedSections:re,openMoreFunctionsPopup:Yt,openSummaryPopup:Si,deviationNodeIdToView:En,deviationTargetParentId:_i,onToggle:function(){Ci(),Pt(o,"right")},navigation:e.id?Ii[e.id]:null,showOpenNodeRef:Ti,resolvedMarkdownStyles:Ce,maintainRelativeOrder:kn,showDeviationBadges:Mn,renderSubSections:Di})})),kn&&p&&i(a,n({ref:yt.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:u.length>0?u.join(", "):"-"}))]}))}),"right-row-".concat(o))}),i("div",{ref:_e,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{Y as default};
|
|
1
|
+
import{__assign as n,__spreadArray as e}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 u,useCallback as c}from"react";import{Box as d,Snackbar as a,Alert as s,Tooltip as v,Typography as f}from"@mui/material";import{ChevronDown as p,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,getFirstDeviationOutputValue as R,getFirstDeviationColor as C,hasValue as w,getBentArrowPath as B,smoothScrollTo as I}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as T,DEFAULT_FIELD_CONFIG as _,DEFAULT_COMPARISON_CONFIG as E}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{EMPTY_SUMMARY_POPUP_STATE as F,DEFAULT_DEVIAION_COLOR as D,DEFAULT_COMPONENT_HEADER_TEXT as M}from"./CognitiveCompareConstants.js";import k from"./CognitivePopup.js";import A from"./MoreFunctionsPopup.js";import N from"./LoaderComponent.js";import H from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as j}from"./hooks/useCompareData.js";import{useComparePopups as L}from"./hooks/useComparePopups.js";import{useSectionRefs as O}from"./hooks/useSectionRefs.js";import{useAccordionState as P}from"./hooks/useAccordionState.js";import{useDeviationNavigation as z}from"./hooks/useDeviationNavigation.js";import W from"./components/CompareHeader.js";import Y from"./components/SectionAccordion.js";import K from"./components/SubSectionAccordion.js";import q from"./components/CognitiveSummaryPopup.js";var V=function(V){var X,J,U,$,G,Q,Z,nn,en,tn,on,rn,ln,un,cn,dn,an,sn,vn,fn,pn,gn,hn,xn,mn,yn,bn=V.componentHeaderText,Sn=void 0===bn?M:bn,Rn=V.treeData,Cn=V.comparisonConfig,wn=V.leftColumnTitleText,Bn=V.rightColumnTitleText,In=V.markdownStyles,Tn=V.resetTrigger,_n=V.displayConfig,En=void 0===_n?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!0}:_n,Fn=V.popupConfig,Dn=V.deviationData,Mn=void 0===Dn?{}:Dn,kn=V.deviationNodeIdToView,An=V.resetDeviationNodeId,Nn=o(En.maintainRelativeOrder),Hn=Nn[0],jn=Nn[1],Ln=!!Hn||!!(null==En?void 0:En.showDeviationBadges),On=o(!1),Pn=On[0],zn=On[1],Wn=o(!1),Yn=Wn[0],Kn=Wn[1],qn=o(null),Vn=qn[0],Xn=qn[1],Jn=o(!1),Un=Jn[0],$n=Jn[1],Gn=o(null===(J=null!==(X=null==Rn?void 0:Rn.newEvaluationResult)&&void 0!==X?X:null==En?void 0:En.enableDeviationSchemaBackwardCompatibility)||void 0===J||J)[0],Qn=o(!1),Zn=Qn[0],ne=Qn[1],ee=o(!1),te=ee[0],ie=ee[1],oe=o(null),re=oe[0],le=oe[1],ue=r(!1),ce=o(new Set),de=ce[0],ae=ce[1],se=o([]),ve=se[0],fe=se[1],pe=r(null),ge=r(!1),he=r(null),xe=r({}),me=r([]),ye=r(!1),be=r(!1),Se=r(null),Re=r(function(){}),Ce=l(function(){return(null==Rn?void 0:Rn.cognitive_decisioning)||{}},[Rn]),we=o({width:0,height:0}),Be=we[0],Ie=we[1],Te=l(function(){return n(n({},T),In)},[In]),_e=r(null),Ee=r(null),Fe=r(null),De=r(null),Me=r(null),ke=r(null),Ae=r(null),Ne=r(null),He=r(!1),je=r(null),Le=r(null),Oe=L(_e),Pe=Oe.cognitivePopup,ze=Oe.setCognitivePopup,We=Oe.moreFunctions,Ye=Oe.setMoreFunctions,Ke=Oe.position,qe=Oe.setPosition,Ve=Oe.activeBadgeId,Xe=Oe.summaryPopup,Je=Oe.setSummaryPopup,Ue=Oe.closeSummaryPopup,$e=Oe.setActiveBadgeId,Ge=Oe.popupRef,Qe=Oe.closeCognitivePopup,Ze=Oe.closeMoreFunctionsPopup,nt=l(function(){var n,e,t,i,o,r,l;return{fields:null!==(n=null==Cn?void 0:Cn.fields)&&void 0!==n?n:_,thresholds:{high:null!==(t=null===(e=null==Cn?void 0:Cn.thresholds)||void 0===e?void 0:e.high)&&void 0!==t?t:E.thresholds.high,medium:null!==(o=null===(i=null==Cn?void 0:Cn.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:E.thresholds.medium,exact:null!==(l=null===(r=null==Cn?void 0:Cn.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:E.thresholds.exact}}},[Cn]),et=o(null),tt=et[0];et[1];var it=null===(G=null===(U=null==Rn?void 0:Rn.documents)||void 0===U?void 0:U[null===($=null==Rn?void 0:Rn.input_index_map)||void 0===$?void 0:$[0]])||void 0===G?void 0:G.title,ot=null===(nn=null===(Q=null==Rn?void 0:Rn.documents)||void 0===Q?void 0:Q[null===(Z=null==Rn?void 0:Rn.input_index_map)||void 0===Z?void 0:Z[1]])||void 0===nn?void 0:nn.title,rt=m(wn||it||"Uploaded Contract"),lt=m(Bn||ot||"Reference Template"),ut=j(Rn,Hn,Mn,nt,Gn),ct=ut.activeProposed,dt=ut.existingRule,at=ut.proposedSections,st=ut.existingSections,vt=ut.visibleFields,ft=ut.parentDeviationRecord,pt=ut.deviationNumberRegistry,gt=ut.parseError;u(function(){gt&&Xn("Failed to load comparison: ".concat(gt))},[gt]);var ht=at.length>0||st.length>0,xt=O(vt.map(function(n){return n.key}),Math.max(at.length,st.length)),mt=xt.leftRefs,yt=xt.rightRefs,bt=xt.sectionLeftRefs,St=xt.sectionRightRefs,Rt=xt.lhsBadgeRefs,Ct=xt.rhsBadgeRefs,wt=xt.sectionRightRowRefs,Bt=xt.subSectionLeftRefs,It=xt.subSectionRightRefs,Tt=xt.sectionRowRefs,_t=xt.getSectionRowRef,Et=xt.getSubSectionRef,Ft=xt.getBadgeRef,Dt=dt.analysis,Mt=m(null===(tn=null===(en=null==Dt?void 0:Dt.rule_difference_comparison)||void 0===en?void 0:en.summary)||void 0===tn?void 0:tn.overall_summary),kt=!!Mt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),At=null!==(on=null==Rn?void 0:Rn.base_root_id)&&void 0!==on?on:"-1";null==Rn||Rn[At];var Nt=Gn?null!==(hn=null!==(fn=Mn&&(null===(vn=null==Mn?void 0:Mn[At])||void 0===vn?void 0:vn.evaluation_result))&&void 0!==fn?fn:null===(gn=null===(pn=null==Rn?void 0:Rn.nodes)||void 0===pn?void 0:pn[At])||void 0===gn?void 0:gn.evaluation_result)&&void 0!==hn?hn:null:null!==(sn=null!==(un=Mn&&(null===(ln=null===(rn=null==Mn?void 0:Mn[At])||void 0===rn?void 0:rn.evaluation_result)||void 0===ln?void 0:ln[0]))&&void 0!==un?un:null===(an=null===(dn=null===(cn=null==Rn?void 0:Rn.nodes)||void 0===cn?void 0:cn[At])||void 0===dn?void 0:dn.evaluation_result)||void 0===an?void 0:an[0])&&void 0!==sn?sn:null,Ht=y(Nt),jt=b(null!==(yn=null===(mn=null===(xn=null==Nt?void 0:Nt.evaluation_outputs)||void 0===xn?void 0:xn.metadata)||void 0===mn?void 0:mn.label_color)&&void 0!==yn?yn:""),Lt=c(function(){var n,e,t,i,o,r;$n(!1),be.current=!1;var l=Se.current,u=Zt.current;if(null!==l)if("string"==typeof l&&l.includes(S)){var c=l.split(S);(d=(null===(n=Bt.current[c[2]])||void 0===n?void 0:n.current)||(null===(e=bt.current[Number(c[2])])||void 0===e?void 0:e.current))&&(d.style.paddingTop="0px")}else{var d;(d=null===(t=bt.current[l])||void 0===t?void 0:t.current)&&(d.style.paddingTop="0px")}if(null!==u)if("string"==typeof u&&u.includes(S)){c=u.split(S);(a=(null===(i=It.current[c[3]])||void 0===i?void 0:i.current)||(null===(o=St.current[Number(c[3])])||void 0===o?void 0:o.current))&&(a.style.paddingTop="0px")}else{var a;(a=null===(r=St.current[u])||void 0===r?void 0:r.current)&&(a.style.paddingTop="0px")}le(null),Se.current=null,Zt.current=null,ne(!1),Kn(!1),De.current&&(De.current.style.height="0px"),Me.current&&(Me.current.style.height="0px"),ke.current&&(ke.current.style.height="0px"),Ae.current&&(Ae.current.style.height="0px")},[]),Ot=c(function(){Lt(),ae(new Set),fe([]),me.current=[],Je(F)},[]);u(function(){Ot()},[Tn]);var Pt=P({maintainRelativeOrder:!!Hn,proposedSections:at,existingSections:st,activeSideBySideSection:re,connectedSections:de,resetSideBySide:Lt,setConnectedSections:ae,setConnectedLines:fe,cachedConnectedPositions:me,svgContainerRef:pe,isAnimatingRef:ge,animationTimerRef:he,calculateLinesRef:Re,sectionLeftRefs:bt,sectionRightRefs:St,subSectionLeftRefs:Bt,subSectionRightRefs:It}),zt=Pt.expandedSections,Wt=Pt.setExpandedSections,Yt=Pt.expandedSubSections,Kt=Pt.setExpandedSubSections,qt=Pt.toggleSection,Vt=c(function(e,t,i,o,r,l,u){var c,d,a,s=m(null==t?void 0:t.id)||m(null==i?void 0:i.id)||"",v=(s?Ce[s]:null)||(null==t?void 0:t.cognitiveData)||(null==i?void 0:i.cognitiveData)||{section_id:s,decisioning:[],gap:[],relevance_score:0},f=null!==(d=null===(c=Tt.current[o])||void 0===c?void 0:c.current)&&void 0!==d?d:null;return{isLoading:null!==(a=null==En?void 0:En.isLoading)&&void 0!==a&&a,open:!0,sectionTitle:(null==t?void 0:t.displayTitle)?null==t?void 0:t.title:"no title",refSectionTitle:(null==i?void 0:i.displayTitle)?null==i?void 0:i.title:"no title",cognitiveData:v,anchorEl:e,sectionAnchorEl:f,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==Rn?void 0:Rn.documents,input_index_map:null==Rn?void 0:Rn.input_index_map},deviationData:function(){var e,r,l=(null==t?void 0:t.evaluationResult)||(null==i?void 0:i.evaluationResult)||null,u=function(e){var t=function(n){if(!n||"object"!=typeof n)return null;var e=null==n?void 0:n.deviation_entries;if(e&&"object"==typeof e){var t=Object.keys(e).sort(function(n,e){return Number(n)-Number(e)})[0];if(t&&e[t])return e[t]}var i=Object.keys(n).filter(function(n){return/^\d+$/.test(n)}).sort(function(n,e){return Number(n)-Number(e)});if(i.length&&n[i[0]])return n[i[0]];var o=null==n?void 0:n.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(n,e){return Number(n)-Number(e)})[0];if(r&&o[r])return o[r]}return null}(e);return t?n(n({},e),{deviation_summary:(null==e?void 0:e.deviation_summary)||(null==t?void 0:t.deviation_summary),deviation_title:(null==e?void 0:e.deviation_title)||(null==t?void 0:t.deviation_title),deviation_impact:(null==e?void 0:e.deviation_impact)||(null==t?void 0:t.deviation_impact),deviation_explanation:(null==e?void 0:e.deviation_explanation)||(null==t?void 0:t.deviation_explanation),evaluation_outputs:(null==e?void 0:e.evaluation_outputs)||(null==t?void 0:t.evaluation_outputs),cognitive_decisioning:(null==e?void 0:e.cognitive_decisioning)||(null==t?void 0:t.cognitive_decisioning)}):e};if(!("string"==typeof o&&o.includes(S)))return u(l);var c=o.split(S)[1];if(!c)return l;var d=(null==t?void 0:t.evaluationResult)||(null==i?void 0:i.evaluationResult)||{},a=(null===(e=null==d?void 0:d.deviation_entries)||void 0===e?void 0:e[c])||(null===(r=null==d?void 0:d.deviations)||void 0===r?void 0:r[c])||null;return a?n(n(n({},d),a),{deviation_summary:(null==a?void 0:a.deviation_summary)||(null==d?void 0:d.deviation_summary),deviation_title:(null==a?void 0:a.deviation_title)||(null==d?void 0:d.deviation_title),deviation_impact:(null==a?void 0:a.deviation_impact)||(null==d?void 0:d.deviation_impact),deviation_explanation:(null==a?void 0:a.deviation_explanation)||(null==d?void 0:d.deviation_explanation),evaluation_outputs:(null==a?void 0:a.evaluation_outputs)||(null==d?void 0:d.evaluation_outputs),cognitive_decisioning:(null==a?void 0:a.cognitive_decisioning)||(null==d?void 0:d.cognitive_decisioning)}):u(l)}(),isOrphan:!!r}},[Ce,Rn]),Xt=c(function(n){Ze(),qe(null),ze(n)},[Ze]),Jt=function(n,e,t,i,o,r){var l;if(n.stopPropagation(),We.open&&We.sectionIdx===o)Ze();else{var u=n.currentTarget,c="left";(null===(l=Fe.current)||void 0===l?void 0:l.contains(u))&&(c="right");be.current&&Lt(),ae(new Set),fe([]),me.current=[],Qe(),Xe.open?Ei():Ue(),requestAnimationFrame(function(){var n=function(){var n,e,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"===c?null===(n=Ct.current[l])||void 0===n?void 0:n.current:null===(e=Rt.current[l])||void 0===e?void 0:e.current}return"right"===c?null===(t=Ct.current[o])||void 0===t?void 0:t.current:null===(i=Rt.current[o])||void 0===i?void 0:i.current}()||u;Ye(Vt(n,e,i,o,t,r))})}},Ut=c(function(){null!==We.sectionIdx&&We.anchorEl?Xt(n(n({},We),{open:!0})):Ze()},[We,Ze,Xt]),$t=c(function(){var n=We.sectionIdx,e=We.isOrphan;Ze(),Ue(),null!==n&&(e?Xn("No counterpart exists to connect to."):(be.current&&Lt(),fe([]),me.current=[],ae(function(e){return e.has(n)?new Set:new Set([n])}),setTimeout(function(){Re.current&&Re.current()},50)))},[We.sectionIdx,We.isOrphan,Ze,Ue,Lt]),Gt=r(null),Qt=r(null),Zt=r(null),ni=r(null),ei=r(null),ti=r(null),ii=o([]),oi=ii[0],ri=ii[1];r(null);var li=o(null),ui=li[0],ci=li[1];u(function(){if(tt){var n=nt.fields.find(function(n){return n.analysisKey===tt||n.key===tt});if(n){var e=mt.current[n.key]||yt.current[n.key];(null==e?void 0:e.current)&&setTimeout(function(){return e.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[tt,nt.fields]);var di=c(function(n){var e,t,i,o,r,l,u,c,d,a=null===(e=null==Dt?void 0:Dt.rule_difference_comparison)||void 0===e?void 0:e.fields;if(!a||!a[n])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=a[n],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 f=s.mappings[0]||{};return{score:s.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(c=s.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(d=s.highlights)||void 0===d?void 0:d.ruleB_spans)||[],hasContent:!!v}},[Dt]),ai=c(function(e,t){var i,o,r;void 0===t&&(t="left");var l=null,u=null;if("left"===t)if(l=at[e],Hn&&l){var c=st.filter(function(n){var e;return null===(e=l.refIndexes)||void 0===e?void 0:e.includes(n.selfIndex)});u=c.find(function(n){return n.evaluationResult})||c[0]}else u=st[e];else if(u=st[e],Hn&&u){var d=at.filter(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(u.selfIndex)});l=d.find(function(n){return n.evaluationResult})||d[0]}else l=at[e];var a=(null==l?void 0:l.relation)&&"not_defined"!==l.relation,s=(null==u?void 0:u.relation)&&"not_defined"!==u.relation,v=!(!(null==l?void 0:l.cognitiveData)&&!(null==u?void 0:u.cognitiveData));if(!a&&!s&&!v)return n(n({},b(D)),{label:"Not Defined"});var f=null!==(o=null!==(i=null==l?void 0:l.evaluationResult)&&void 0!==i?i:null==u?void 0:u.evaluationResult)&&void 0!==o?o:null,p=R(f),g=C(f);return n(n({},b(g)),null!=f?{label:null!==(r=p)&&void 0!==r?r:""}:{label:null})},[at,st,Ce,nt,Hn]),si=c(function(e){for(var t,i,o,r,l,u=e.split("-").map(Number),c=at[u[0]],d=st[u[0]],a=1;a<u.length;a++)(null==c?void 0:c.subsections)&&(c=c.subsections[u[a]]),(null==d?void 0:d.subsections)&&(d=d.subsections[u[a]]);if(!c&&!d)return null;var s=(null==c?void 0:c.relation)&&"not_defined"!==c.relation,v=(null==d?void 0:d.relation)&&"not_defined"!==d.relation,f=m(null==c?void 0:c.id)||m(null==d?void 0:d.id)||"",p=!(!(null==c?void 0:c.cognitiveData)&&!(null==d?void 0:d.cognitiveData));if(!s&&!v&&!p)return n(n({},b(D)),{label:"Not Defined"});null!==(i=null!==(t=null==c?void 0:c.cognitiveRelevanceScore)&&void 0!==t?t:null==d?void 0:d.cognitiveRelevanceScore)&&void 0!==i||f&&(null===(o=Ce[f])||void 0===o||o.relevance_score);var g=null!==(l=null!==(r=null==c?void 0:c.evaluationResult)&&void 0!==r?r:null==d?void 0:d.evaluationResult)&&void 0!==l?l:null,h=R(g),x=C(g);return n(n({},b(x)),null!=g?{label:null!=h?h:""}:{label:null})},[at,st,Ce,nt]),vi=c(function(e,t){var i,o,r,l,u,c,d,a,s,v,f,p,g,h,x,m,y;if(!e||null==t)return null;var S=null!==(d=null!==(u=null!==(o=null===(i=null==Mn?void 0:Mn[e])||void 0===i?void 0:i.evaluation_result)&&void 0!==o?o:null===(l=null===(r=null==Rn?void 0:Rn.nodes)||void 0===r?void 0:r[e])||void 0===l?void 0:l.evaluation_result)&&void 0!==u?u:null===(c=null==Rn?void 0:Rn[e])||void 0===c?void 0:c.evaluation_result)&&void 0!==d?d:null;if(!S||"object"!=typeof S)return null;var R=null!==(f=null!==(s=null===(a=null==S?void 0:S.deviations)||void 0===a?void 0:a[t])&&void 0!==s?s:null===(v=null==S?void 0:S.deviation_entries)||void 0===v?void 0:v[t])&&void 0!==f?f:null==S?void 0:S[t],C=null!==(y=null!==(h=null===(g=null===(p=null==R?void 0:R.evaluation_outputs)||void 0===p?void 0:p.metadata)||void 0===g?void 0:g.label_color)&&void 0!==h?h:null===(m=null===(x=null==S?void 0:S.evaluation_outputs)||void 0===x?void 0:x.metadata)||void 0===m?void 0:m.label_color)&&void 0!==y?y:D;return n(n({},b(C)),{label:null})},[Mn,Rn]),fi=c(function(){Wt({}),Kt({}),Lt(),ae(new Set),fe([]),me.current=[],Ue(),Qe(),Ze(),requestAnimationFrame(function(){Re.current&&Re.current()})},[Wt,Kt,Lt,Ue,Qe,Ze]),pi=l(function(){return Object.values(zt).some(Boolean)||Object.values(Yt).some(Boolean)},[zt,Yt]),gi=c(function(){var n,e,t,i,o,r,l,u,c,d,a,s,v,f,p,g,h,x,m,y,b,R,C;if(!He.current&&!ge.current){He.current=!0;try{if(!Gt.current)return;var I=function(n){var e=n.split("-"),t=e[0];if(!zt[t]&&!1===Hn)return!1;if(Hn&&!zt["left-".concat(t)]&&!zt["right-".concat(t)]&&!zt[t])return!1;for(var i=t,o=1;o<e.length-1;o++)if(i+="-".concat(e[o]),!Yt[i])return!1;return!0},T=Gt.current.getBoundingClientRect();Ie({width:T.width,height:T.height});var _=[];if(vt.forEach(function(n){var e,t,i=n.key,o=null===(e=mt.current[i])||void 0===e?void 0:e.current,r=null===(t=yt.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(at.length,st.length);E++){var F=null===(n=bt.current[E])||void 0===n?void 0:n.current,D=null===(e=St.current[E])||void 0===e?void 0:e.current;F&&(F.style.height="auto",F.style.minHeight="0px"),D&&(D.style.height="auto",D.style.minHeight="0px")}Hn||Object.keys(Bt.current).forEach(function(n){var e,t;if(I(n)){var i=null===(e=Bt.current[n])||void 0===e?void 0:e.current,o=null===(t=It.current[n])||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={};vt.forEach(function(n){var e,t,i=n.key,o=null===(e=mt.current[i])||void 0===e?void 0:e.current,r=null===(t=yt.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),u=r.getBoundingClientRect();M[i]=Math.max(l.height,u.height)}});var k={left:{},right:{}},A={};if(!ge.current)if(Hn){if(Un&&null!==re)if("number"==typeof re){var N=re,H=at[N],j=null===(o=bt.current[N])||void 0===o?void 0:o.current;j&&H&&(H.refIndexes||[]).forEach(function(n){var e,t=st.findIndex(function(e){return e.selfIndex===n}),i=null===(e=St.current[t])||void 0===e?void 0:e.current;if(i&&(zt["left-".concat(N)]||zt["right-".concat(t)])){var o=Math.max(j.getBoundingClientRect().height,i.getBoundingClientRect().height);k.left[N]=Math.max(k.left[N]||0,o),k.right[t]=Math.max(k.right[t]||0,o)}})}else{var L=re.split(S)[2];if(L){F=null===(r=Bt.current[L])||void 0===r?void 0:r.current,D=null===(l=It.current[L])||void 0===l?void 0:l.current;if(F&&D){O=Math.max(F.getBoundingClientRect().height,D.getBoundingClientRect().height);A[L]=Math.max(A[L]||0,O)}}}}else{Object.keys(Bt.current).forEach(function(n){var e,t;if(I(n)){var i=null===(e=Bt.current[n])||void 0===e?void 0:e.current,o=null===(t=It.current[n])||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);A[n]=u,i.style.minHeight="".concat(u,"px"),o.style.minHeight="".concat(u,"px")}}});for(E=0;E<Math.min(at.length,st.length);E++){var F=null===(t=bt.current[E])||void 0===t?void 0:t.current,D=null===(i=St.current[E])||void 0===i?void 0:i.current;if(F&&D){var O=Math.max(F.getBoundingClientRect().height,D.getBoundingClientRect().height);k.left[E]=O,k.right[E]=O}}}if(vt.forEach(function(n){var e,t,i=n.key,o=null===(e=mt.current[i])||void 0===e?void 0:e.current,r=null===(t=yt.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(n){var e,t=n[0],i=n[1],o=null===(e=bt.current[Number(t)])||void 0===e?void 0:e.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(k.right).forEach(function(n){var e,t=n[0],i=n[1],o=null===(e=St.current[Number(t)])||void 0===e?void 0:e.current;o&&(o.style.minHeight="".concat(i,"px"))}),Hn||Object.keys(A).forEach(function(n){var e,t,i=null===(e=Bt.current[n])||void 0===e?void 0:e.current,o=null===(t=It.current[n])||void 0===t?void 0:t.current;if(i&&o&&A[n]){var r=A[n];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),Hn)at.forEach(function(n,e){var t;(null===(t=bt.current[e])||void 0===t?void 0:t.current)&&(n.refIndexes||[]).forEach(function(n){var t,i,o,r,l,u,c,d,a,s,v=st.findIndex(function(e){return e.selfIndex===n});if(-1!==v){var f=null===(t=Rt.current[e])||void 0===t?void 0:t.current,p=null===(i=Ct.current[v])||void 0===i?void 0:i.current;if(f&&p){var g=f.getBoundingClientRect(),h=p.getBoundingClientRect(),x=g.right-T.left,m=h.left-T.left,y=g.top+g.height/2-T.top,b=h.top+h.height/2-T.top;if(Un&&re===e){var S=null!==(r=null===(o=Ne.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,R=null!==(u=null===(l=Fe.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==u?u:0,C=S+(null!==(d=null===(c=Ne.current)||void 0===c?void 0:c.clientHeight)&&void 0!==d?d:1/0),w=R+(null!==(s=null===(a=Fe.current)||void 0===a?void 0:a.clientHeight)&&void 0!==s?s:1/0),B=g.top+g.height/2,I=h.top+h.height/2,E=function(n,e,t){return Math.max(e,Math.min(t,n))};y=E(B,S,C)-T.top,b=E(I,R,w)-T.top}var F=ai(e);F&&_.push({id:"line-".concat(e,"-").concat(v),x1:x,y1:y,x2:m,y2:b,style:F,sectionIdx:e,targetRightIdx:v})}}})});else{for(E=0;E<Math.min(at.length,st.length);E++){var P=null===(u=bt.current[E])||void 0===u?void 0:u.current,z=null===(c=St.current[E])||void 0===c?void 0:c.current;if(P&&z){var W=P.getBoundingClientRect(),Y=z.getBoundingClientRect(),K=Math.max(W.top,Y.top)+18-T.top,q=(null===(d=st[E])||void 0===d?void 0:d.id)||"sec-".concat(E);(Z=ai(E))&&_.push({id:q,x1:W.right-T.left,y1:K,x2:Y.left-T.left,y2:K,style:Z,sectionIdx:E,hasCognitive:!!((null===(a=at[E])||void 0===a?void 0:a.cognitiveData)||(null===(s=st[E])||void 0===s?void 0:s.cognitiveData)||q&&Ce[q]),isSubSection:!1})}}Object.keys(Bt.current).forEach(function(n){var e,t,i,o,r,l;if(I(n)){var u=null===(e=Bt.current[n])||void 0===e?void 0:e.current,c=null===(t=It.current[n])||void 0===t?void 0:t.current;if(u&&c){for(var d=n.split("-").map(Number),a=at[d[0]],s=st[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 f=!!a&&((null===(i=a.displayTitle)||void 0===i||i)&&w(a.title)),p=!!a&&((null===(o=a.displayContent)||void 0===o||o)&&w(a.content)),g=!!s&&((null===(r=s.displayTitle)||void 0===r||r)&&w(s.title)),h=!!s&&((null===(l=s.displayContent)||void 0===l||l)&&w(s.content));if(f&&p||g&&h){var x=u.getBoundingClientRect(),m=c.getBoundingClientRect(),y=Math.max(x.top,m.top)+16-T.top,b=si(n);b&&"Not Defined"!==b.label&&_.push({id:"subsec-".concat(n),x1:x.right-T.left,y1:y,x2:m.left-T.left,y2:y,style:b,sectionIdx:d[0],isSubSection:!0,subSectionKeyPath:n,hasCognitive:!(!(null==a?void 0:a.cognitiveData)&&!(null==s?void 0:s.cognitiveData))})}}}})}if(Un&&"string"==typeof re&&re.includes(S)){var V=re.split(S),X=V[0],J=V[1],U=V[2],$=(V[3],"".concat(X).concat(S).concat(J)),G=null===(v=Rt.current[$])||void 0===v?void 0:v.current,Q=null===(f=Ct.current[$])||void 0===f?void 0:f.current;if(G&&Q){var Z,nn=G.getBoundingClientRect(),en=Q.getBoundingClientRect(),tn=nn.right-T.left,on=en.left-T.left,rn=nn.top+nn.height/2-T.top,ln=en.top+en.height/2-T.top;if(Hn){var un=null!==(g=null===(p=Ne.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==g?g:0,cn=null!==(x=null===(h=Fe.current)||void 0===h?void 0:h.getBoundingClientRect().top)&&void 0!==x?x:0,dn=un+(null!==(y=null===(m=Ne.current)||void 0===m?void 0:m.clientHeight)&&void 0!==y?y:1/0),an=cn+(null!==(R=null===(b=Fe.current)||void 0===b?void 0:b.clientHeight)&&void 0!==R?R:1/0),sn=function(n,e,t){return Math.max(e,Math.min(t,n))};rn=sn(nn.top+nn.height/2,un,dn)-T.top,ln=sn(en.top+en.height/2,cn,an)-T.top}(Z=null!==(C=vi(X,J))&&void 0!==C?C:si(U))&&_.push({id:"line-subsec-".concat($),x1:tn,y1:rn,x2:on,y2:ln,style:Z,sectionIdx:Number(U.split("-")[0]),isSubSection:!0,subSectionKeyPath:re})}}if(ri(_),ei.current&&ti.current){var vn=ei.current.getBoundingClientRect(),fn=ti.current.getBoundingClientRect(),pn=(vn.top+vn.height/2-T.top+fn.top+fn.height/2-T.top)/2;ci({x1:vn.right-T.left,x2:fn.left-T.left,y:pn})}else ci(null);if(de.size>0){var gn=[],hn=Ne.current,xn=Fe.current;if(hn&&xn){var mn=[],yn=hn.getBoundingClientRect().top,bn=xn.getBoundingClientRect().top,Sn=yn+hn.clientHeight,Rn=bn+xn.clientHeight,Cn=hn.scrollTop,wn=xn.scrollTop,Bn=T.top,In=function(n,e,t){return Math.max(e,Math.min(t,n))};de.forEach(function(n){var e,t,i,o,r,l;if("string"==typeof n&&n.includes(S)){var u=n.split(S),c=u[0],d=u[1],a=u[2],s=(u[3],"".concat(c).concat(S).concat(d)),v=null===(e=Rt.current[s])||void 0===e?void 0:e.current,f=null===(t=Ct.current[s])||void 0===t?void 0:t.current;if(!v||!f)return;var p=v.getBoundingClientRect(),g=f.getBoundingClientRect(),h=null!==(i=vi(c,d))&&void 0!==i?i:si(a),x=(H=p.right-T.left)+.5*((j=g.left-T.left-0)-H),m=p.top+p.height/2,y=g.top+g.height/2,b=m-yn+Cn,R=y-bn+wn,C="conn-subsec-".concat(s);mn.push({lhsScrollY:b,rhsScrollY:R,x1:H,x2:j,containerTop:Bn,leftIdx:n,rhsArrayIdx:n,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:C});var w=In(m,yn,Sn),I=In(y,bn,Rn),_=w-Bn,E=I-Bn,F=y>=bn-4&&y<=Rn+4,D="";D=(L=m>=yn-4&&m<=Sn+4)&&F?B(H,_,j,E):L&&!F?"M ".concat(H,",").concat(_," L ").concat(x,",").concat(_," L ").concat(x,",").concat(E):!L&&F?"M ".concat(x,",").concat(_," L ").concat(x,",").concat(E," L ").concat(j,",").concat(E):"M ".concat(x,",").concat(_," L ").concat(x,",").concat(E),gn.push({id:C,pathD:D,style:h,leftIdx:n,rhsArrayIdx:n})}else if(Hn){var M=n,k=at[M];if(!(null===(l=null==k?void 0:k.refIndexes)||void 0===l?void 0:l.length))return;k.refIndexes.forEach(function(n){var e,t,i=st.findIndex(function(e){return e.selfIndex===n});if(-1!==i){var o=null===(e=Rt.current[M])||void 0===e?void 0:e.current,r=null===(t=Ct.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),u=r.getBoundingClientRect(),c=ai(M),d=l.right-T.left,a=u.left-T.left-0,s=d+.5*(a-d),v=l.top+l.height/2,f=u.top+u.height/2,p=v-yn+Cn,g=f-bn+wn,h="conn-".concat(M,"-").concat(i);mn.push({lhsScrollY:p,rhsScrollY:g,x1:d,x2:a,containerTop:Bn,leftIdx:M,rhsArrayIdx:i,styleColor:(null==c?void 0:c.badgeBorder)||"#6366F1",styleId:h});var x=In(v,yn,Sn),m=In(f,bn,Rn),y=x-Bn,b=m-Bn,S=v>=yn-4&&v<=Sn+4,R=f>=bn-4&&f<=Rn+4,C="";C=S&&R?B(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),gn.push({id:h,pathD:C,style:c,leftIdx:M,rhsArrayIdx:i})}}})}else{var A=n,N=A;v=null===(o=Rt.current[A])||void 0===o?void 0:o.current,f=null===(r=Ct.current[N])||void 0===r?void 0:r.current;if(!v||!f)return;var H,j;p=v.getBoundingClientRect(),g=f.getBoundingClientRect(),h=ai(A),x=(H=p.right-T.left)+.5*((j=g.left-T.left-0)-H),m=p.top+p.height/2,y=g.top+g.height/2,b=m-yn+Cn,R=y-bn+wn,C="conn-".concat(A,"-").concat(N);mn.push({lhsScrollY:b,rhsScrollY:R,x1:H,x2:j,containerTop:Bn,leftIdx:A,rhsArrayIdx:N,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:C});var L;w=In(m,yn,Sn),I=In(y,bn,Rn),_=w-Bn,E=I-Bn,F=y>=bn-4&&y<=Rn+4,D="";D=(L=m>=yn-4&&m<=Sn+4)&&F?B(H,_,j,E):L&&!F?"M ".concat(H,",").concat(_," L ").concat(x,",").concat(_," L ").concat(x,",").concat(E):!L&&F?"M ".concat(x,",").concat(_," L ").concat(x,",").concat(E," L ").concat(j,",").concat(E):"M ".concat(x,",").concat(_," L ").concat(x,",").concat(E),gn.push({id:C,pathD:D,style:h,leftIdx:A,rhsArrayIdx:N})}}),me.current=mn}fe(gn)}else fe([]),me.current=[]}catch(n){console.error("Line render safe fail: ",n)}finally{He.current=!1}}},[vt,at,st,Ce,nt,di,ai,vi,Hn,Un,re,de,zt,Yt]),hi=c(function(){var n,e,t,i,o,r,l,u,c,d,a,s,v,f,p=me.current;if(p.length&&!ge.current){var g=null!==(e=null===(n=Ne.current)||void 0===n?void 0:n.scrollTop)&&void 0!==e?e:0,h=null!==(i=null===(t=Fe.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,x=null!==(r=null===(o=Ne.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(u=null===(l=Fe.current)||void 0===l?void 0:l.clientHeight)&&void 0!==u?u:1/0,y=null!==(d=null===(c=Ne.current)||void 0===c?void 0:c.getBoundingClientRect().top)&&void 0!==d?d:0,b=null!==(s=null===(a=Fe.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==s?s:0,S=y+x,R=b+m,C=null!==(f=null===(v=Gt.current)||void 0===v?void 0:v.getBoundingClientRect().top)&&void 0!==f?f:0,w=function(n,e,t){return Math.max(e,Math.min(t,n))};p.forEach(function(n){var e=n.lhsScrollY-g+y,t=n.rhsScrollY-h+b,i=xe.current[n.styleId+"-stroke"],o=xe.current[n.styleId+"-bg"];if(i||o){var r,l=w(e,y,S),u=w(t,b,R),c=l-C,d=u-C,a=e>=y-4&&e<=S+4,s=t>=b-4&&t<=R+4,v=n.x1+.5*(n.x2-n.x1);r=a&&s?B(n.x1,c,n.x2,d):a&&!s?"M ".concat(n.x1,",").concat(c," L ").concat(v,",").concat(c," L ").concat(v,",").concat(d):!a&&s?"M ".concat(v,",").concat(c," L ").concat(v,",").concat(d," L ").concat(n.x2,",").concat(d):"M ".concat(v,",").concat(c," L ").concat(v,",").concat(d),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);u(function(){Re.current=gi},[gi]);var xi=r(null),mi=r(null),yi=c(function(){me.current.length>0&&!ge.current||(null!==xi.current&&clearTimeout(xi.current),xi.current=setTimeout(function(){Re.current(),xi.current=null},50))},[]),bi=c(function(){ie(!0),ne(!1),null!==mi.current&&clearTimeout(mi.current),null!==xi.current&&(clearTimeout(xi.current),xi.current=null),mi.current=setTimeout(function(){var n,e,t,i,o,r,l,u,c,d;if(me.current=[],be.current&&null!==Se.current&&null!==Zt.current){var a=Se.current,s=Zt.current,v=null,f=null,p=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===(n=Rt.current[x])||void 0===n?void 0:n.current)||null,f=(null===(e=Ct.current[x])||void 0===e?void 0:e.current)||null,p=(null===(t=Bt.current[h[2]])||void 0===t?void 0:t.current)||(null===(i=bt.current[Number(h[2])])||void 0===i?void 0:i.current)||null,g=(null===(o=It.current[h[3]])||void 0===o?void 0:o.current)||(null===(r=St.current[Number(h[3])])||void 0===r?void 0:r.current)||null}else v=(null===(l=Tt.current[a])||void 0===l?void 0:l.current)||null,p=(null===(u=bt.current[a])||void 0===u?void 0:u.current)||null,f=(null===(c=wt.current[s])||void 0===c?void 0:c.current)||null,g=(null===(d=St.current[s])||void 0===d?void 0:d.current)||null;if(v&&f&&p&&g){if(p.style.paddingTop="0px",g.style.paddingTop="0px",!Hn){var m=v.getBoundingClientRect(),y=f.getBoundingClientRect(),b=m.top-y.top;b>0?g.style.paddingTop="".concat(b,"px"):b<0&&(p.style.paddingTop="".concat(Math.abs(b),"px"))}var R=Ne.current,C=Fe.current;if(R&&C){var w=v.getBoundingClientRect().top-R.getBoundingClientRect().top+R.scrollTop,B=f.getBoundingClientRect().top-C.getBoundingClientRect().top+C.scrollTop-(w-R.scrollTop);Math.abs(C.scrollTop-B)>1&&(C.scrollTop=B)}}}Re.current(),be.current&&ne(!0),ie(!1),mi.current=null},150)},[Hn,at,st]),Si=c(function(n){var e,t,i,o,r,l,u,c,d,a;if(null!==je.current&&Le.current&&Math.abs(n.currentTarget.scrollTop-je.current)<=2){var s=Le.current;je.current=null,Le.current=null,s()}if(!ue.current){if(Hn||yi(),be.current){var v=Se.current,f=Zt.current,p=Ne.current,g=Fe.current;if(null!==v&&null!==f&&p&&g){var h="string"==typeof v&&v.includes(S)?null===(e=Rt.current["".concat(v.split(S)[0]).concat(S).concat(v.split(S)[1])])||void 0===e?void 0:e.current:null===(t=Tt.current[v])||void 0===t?void 0:t.current,x="string"==typeof f&&f.includes(S)?null===(i=Ct.current["".concat(f.split(S)[0]).concat(S).concat(f.split(S)[1])])||void 0===i?void 0:i.current:null===(o=wt.current[f])||void 0===o?void 0:o.current;if(h&&x&&ni.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=Ct.current[R])||void 0===l?void 0:l.current}else m=null===(u=Rt.current[v])||void 0===u?void 0:u.current,y=null===(c=Ct.current[f])||void 0===c?void 0:c.current;var C=null!==(a=null===(d=Gt.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==a?a:0,w=p.getBoundingClientRect().top,B=w+p.clientHeight;g.getBoundingClientRect().top;g.clientHeight;if(m&&y){var I=m.getBoundingClientRect(),T=y.getBoundingClientRect(),_=I.top+I.height/2;T.top,T.height;var E=((D=_,M=w,k=B,Math.max(M,Math.min(k,D)))-C).toString();ni.current.setAttribute("y1",E),ni.current.setAttribute("y2",E);var F=_>=w-4&&_<=B+4;ni.current.setAttribute("visibility",F?"visible":"hidden")}}}}var D,M,k;me.current.length>0&&!ye.current&&(ye.current=!0,requestAnimationFrame(function(){hi(),ye.current=!1}))}},[hi,Hn,yi]),Ri=r(0),Ci=r(0),wi=r(0),Bi=r(function(){});r(null),u(function(){Bi.current=bi},[bi]),u(function(){var n=setTimeout(yi,250),e=function(){return Bi.current()};return window.addEventListener("resize",e),function(){clearTimeout(n),null!==xi.current&&clearTimeout(xi.current),null!==mi.current&&clearTimeout(mi.current),window.removeEventListener("resize",e)}},[ct,dt,Dt,vt,zt,Yt,at,st,nt,yi,Un,re,Zn,de]),u(function(){var n=function(n,e,t,i,o){e.current=n.getBoundingClientRect().width;var r=new ResizeObserver(function(n){null!==t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){var r,l,u;t.current=null;var c=n[n.length-1];if(c){var d=null!==(u=null===(l=null===(r=c.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:c.contentRect.width;Math.abs(d-e.current)<1?o():(e.current=d,i())}})});return r.observe(n),r},e={current:null},t={current:null},i={current:null},o=[],r=[e,t,i];return Ee.current&&o.push(n(Ee.current,Ri,e,function(){return Bi.current()},function(){})),_e.current&&o.push(n(_e.current,Ci,t,function(){return Bi.current()},function(){return Re.current()})),Gt.current&&o.push(n(Gt.current,wi,i,function(){return Bi.current()},function(){return Re.current()})),function(){o.forEach(function(n){return n.disconnect()}),r.forEach(function(n){null!==n.current&&(cancelAnimationFrame(n.current),n.current=null)})}},[]),u(function(){be.current=Un},[Un]),u(function(){Se.current=re},[re]);var Ii=c(function(n,e,t){var i,o,r=null===(i=null==t?void 0:t.toggleIfSame)||void 0===i||i,l=null==t?void 0:t.onReady,u=null!==(o=null==t?void 0:t.sourceSide)&&void 0!==o?o:"left";Ze(),null!=n&&(e?Xn("No counterpart exists for this section."):Un&&re===n?r?Lt():null==l||l():(ae(new Set([n])),fe([]),me.current=[],Kn(!0),ue.current=!0,le(n),Se.current=n,$n(!0),be.current=!0,ne(!1),De.current&&(De.current.style.height="0px"),Me.current&&(Me.current.style.height="0px"),ke.current&&(ke.current.style.height="0px"),Ae.current&&(Ae.current.style.height="0px"),requestAnimationFrame(function(){var e,t,i,o,r,c="string"==typeof n&&n.includes(S),d=null,a=null,s=null;if(c){var v=n.split(S),f="".concat(v[0]).concat(S).concat(v[1]);d=(null===(e=Rt.current[f])||void 0===e?void 0:e.current)||null,a=(null===(t=Ct.current[f])||void 0===t?void 0:t.current)||null,s=a?n:null}else if(d=(null===(i=Tt.current[n])||void 0===i?void 0:i.current)||null,Hn){var p=at[n],g=(null==p?void 0:p.refIndexes)||[];if(g.length>0){var h=g[0],x=st.findIndex(function(n){return n.selfIndex===h});-1!==x&&(a=(null===(r=wt.current[x])||void 0===r?void 0:r.current)||null,s=x)}}else a=(null===(o=wt.current[n])||void 0===o?void 0:o.current)||null,s=a?n:null;Zt.current=s;var m=Ne.current,y=Fe.current,b=function(){!function(){var e,t,i,o,r,l,u,d,a,v,f,p,g=null,h=null,x=null,m=null;if(c){var y=n.split(S),b="".concat(y[0]).concat(S).concat(y[1]);g=(null===(e=Bt.current[y[2]])||void 0===e?void 0:e.current)||(null===(t=bt.current[Number(y[2])])||void 0===t?void 0:t.current)||null,h=(null===(i=It.current[y[3]])||void 0===i?void 0:i.current)||(null===(o=St.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=Ct.current[b])||void 0===l?void 0:l.current)||h}else{var R=Number(n),C=null!==s?Number(s):R;g=(null===(u=bt.current[R])||void 0===u?void 0:u.current)||null,h=(null===(d=St.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=Tt.current[R])||void 0===v?void 0:v.current)||g,m=(null===(f=Ct.current[C])||void 0===f?void 0:f.current)||(null===(p=wt.current[C])||void 0===p?void 0:p.current)||h}if(x&&m&&g&&h){g.style.paddingTop="0px",h.style.paddingTop="0px";var w=x.getBoundingClientRect(),B=m.getBoundingClientRect(),I=w.top-B.top;I>0?h.style.paddingTop="".concat(I,"px"):I<0&&(g.style.paddingTop="".concat(Math.abs(I),"px"))}}(),ne(!0),Re.current&&Re.current(),ue.current=!1,"right"===u&&y?y.dispatchEvent(new Event("scroll")):m&&m.dispatchEvent(new Event("scroll")),Kn(!1),null==l||l()};if(!d||!m)return ue.current=!1,Kn(!1),void(null==l||l());if(a&&y){if(!Hn){var R=0;R="right"===u?a?a.getBoundingClientRect().top:0:d?d.getBoundingClientRect().top:0;var C=_e.current,w=(null==C?void 0:C.getBoundingClientRect().top)||0,B=C?C.scrollTop+R-w-150:0;return C?void I(C,B,200,b):void b()}var T=d.getBoundingClientRect().top-m.getBoundingClientRect().top+m.scrollTop,_=a.getBoundingClientRect().top-y.getBoundingClientRect().top+y.scrollTop,E=200;if("left"===u){var F=_-(T-m.scrollTop);F<0&&De.current&&(De.current.style.height="".concat(Math.abs(F),"px")),requestAnimationFrame(function(){var n,e=y.scrollHeight-y.clientHeight;if(F<0)n=0;else{if(F>e){var t=F-e;return Me.current&&(Me.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){I(y,F,E,b)})}n=F}I(y,n,E,b)})}else{var D=T-(_-y.scrollTop);D<0&&ke.current&&(ke.current.style.height="".concat(Math.abs(D),"px")),requestAnimationFrame(function(){var n,e=m.scrollHeight-m.clientHeight;if(D<0)n=0;else{if(D>e){var t=D-e;return Ae.current&&(Ae.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){I(m,D,E,b)})}n=D}I(m,n,E,b)})}}else b()})))},[re,Ze,st,Un,Hn,at,Lt]),Ti=c(function(n,e,t,i){var o,r="string"==typeof i?m(i).trim():m(null==i?void 0:i.deviation_summary).trim(),l=n.currentTarget;Qe();var u="left";(null===(o=Fe.current)||void 0===o?void 0:o.contains(l))&&(u="right");var c=function(){var n,t,i,o;if("string"==typeof e&&e.includes(S)){var r=e.split(S),l="".concat(r[0]).concat(S).concat(r[1]);return"right"===u?null===(n=Ct.current[l])||void 0===n?void 0:n.current:null===(t=Rt.current[l])||void 0===t?void 0:t.current}return"right"===u?null===(i=Ct.current[e])||void 0===i?void 0:i.current:null===(o=Rt.current[e])||void 0===o?void 0:o.current};if(t)return Lt(),ae(new Set),fe([]),me.current=[],void(r&&requestAnimationFrame(function(){var n=c()||l;Je({open:!0,anchorEl:n,summary:i})}));Ii(e,t,r?{toggleIfSame:!1,sourceSide:u,onReady:function(){var n=c()||l;Je({open:!0,anchorEl:n,summary:i})}}:{toggleIfSame:!1,sourceSide:u})},[Ii,Qe,Je,Lt]),_i=c(function(){var n,e=We.sectionIdx,t=We.isOrphan;if(Ue(),null!=e){var i="left";We.anchorEl&&(null===(n=Fe.current)||void 0===n?void 0:n.contains(We.anchorEl))&&(i="right"),Ii(e,t,{sourceSide:i})}},[Ii,We.isOrphan,We.sectionIdx,We.anchorEl,Ue]),Ei=c(function(){Ue(),Lt(),ae(new Set),fe([]),me.current=[]},[Ue,Lt]),Fi=null!==We.sectionIdx&&de.has(We.sectionIdx),Di=z({proposedSections:at,existingSections:st,parentDeviationRecord:ft,expandedSections:zt,maintainRelativeOrder:!!Hn,scrollContainerRef:_e,leftContainerRef:Ne,lhsBadgeRefs:Rt,rhsBadgeRefs:Ct}),Mi=Di.showDeviationNavigation,ki=Di.showOpenNodeRef,Ai=l(function(){if(!kn)return null;var n=kn.id.split(":")[0];for(var e in ft){if((ft[e]||[]).some(function(e){return e.id===n}))return e}return null},[kn,ft]),Ni=r({id:null,triggerMs:null}),Hi=r(null);u(function(){if(null==kn?void 0:kn.id){var t=Number(kn.trigger),i=Ni.current;if(!(i.id===kn.id&&null!=i.triggerMs&&t-i.triggerMs<=1e3)){Ni.current={id:kn.id,triggerMs:t};var o=kn.id.split(":"),r=o[0],l=o[1],u=null!=l?l:"0";Hi.current!==kn.id&&(Ue(),Qe(),Lt(),ae(new Set),fe([]),me.current=[],Hi.current=kn.id);var c=!1,d=0,a=null,s=150,v=function(n,e){for(var t=function(n,i){if(!n)return null;if(n.id===e)return i;if(!Array.isArray(n.subsections))return null;for(var o=0;o<n.subsections.length;o++){var r=t(n.subsections[o],"".concat(i,"-").concat(o));if(r)return r}return null},i=0;i<n.length;i++){var o=t(n[i],String(i));if(o)return o}return null},f=function(){var t,i,o,l;if(!c){var p=null,g=null;for(var h in ft){var x=ft[h].find(function(n){return n.id===r});if(x){p=h,g=x;break}}if(g&&p){var m=at.findIndex(function(n){return n.id===p}),y=st.findIndex(function(n){return n.id===p}),b=-1===m&&-1!==y,R=v(at,g.id),C=v(st,g.id);if(R&&!C&&!b){var w=R.split("-"),B=Number(w[0]);if(Hn){var I=null===(i=null===(t=at[B])||void 0===t?void 0:t.refIndexes)||void 0===i?void 0:i[0],T=st.findIndex(function(n){return n.selfIndex===I});-1!==T&&(B=T)}C=e([B],w.slice(1),!0).join("-")}if(R||C){var _=b||!R&&!!C,E=R?Number(R.split("-")[0]):m,F=C?Number(C.split("-")[0]):y;if(_){if(!(Hn?!!zt["right-".concat(F)]:!!zt[String(F)])&&F>=0)return qt(F,"right"),d+=1,void(a=setTimeout(f,450))}else if(!(Hn?!!zt["left-".concat(E)]:!!zt[String(E)])&&E>=0)return qt(E,"left"),d+=1,void(a=setTimeout(f,450));var D,M=R||"",k=C||"",A="".concat(g.id).concat(S).concat(u).concat(S).concat(M).concat(S).concat(k),N="".concat(g.id).concat(S).concat(u),H=null===(o=Rt.current[N])||void 0===o?void 0:o.current,j=null===(l=Ct.current[N])||void 0===l?void 0:l.current,L=_||!H&&!!j,O=L?j:H;if(D=Hn?L?Fe.current:Ne.current:_e.current,O&&D){var P=O.getBoundingClientRect();if(0===P.height)return void((d+=1)<20&&(a=setTimeout(f,s)));var z=D.getBoundingClientRect(),W=P.top-z.top+D.scrollTop-z.height/2+P.height/2,Y=function(){var e,t,i,o,r;if(!c){var l=window.getComputedStyle(O).color;H&&(H.style.transition="box-shadow 300ms ease-in-out",H.style.boxShadow="0 0 10px ".concat(l)),j&&(j.style.transition="box-shadow 300ms ease-in-out",j.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){H&&(H.style.boxShadow=""),j&&(j.style.boxShadow="")},2e3);var d=(null===(t=null===(e=g.evaluationResult)||void 0===e?void 0:e.deviations)||void 0===t?void 0:t[u])||g,a=(null===(i=g.evaluationResult)||void 0===i?void 0:i.evaluation_outputs)||g.evaluation_outputs;if(!(!!H&&!!j)){var s=L?(null===(o=Ct.current[N])||void 0===o?void 0:o.current)||j:(null===(r=Rt.current[N])||void 0===r?void 0:r.current)||H;return Je({open:!0,anchorEl:s,summary:n(n({},d),{evaluation_outputs:a})}),void(null==An||An())}Ii(A,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var e,t=(null===(e=Rt.current[N])||void 0===e?void 0:e.current)||H;Je({open:!0,anchorEl:t,summary:n(n({},d),{evaluation_outputs:a})})}})}};Math.abs(D.scrollTop-W)<=2?Y():(je.current=W,Le.current=Y,D.scrollTo({top:W,behavior:"smooth"}),a&&clearTimeout(a),a=setTimeout(function(){if(Le.current){je.current=null;var n=Le.current;Le.current=null,n()}},800))}else(d+=1)<20&&(a=setTimeout(f,s))}else(d+=1)<20&&(a=setTimeout(f,s))}else(d+=1)<20&&(a=setTimeout(f,s))}};return a=setTimeout(f,s),function(){c=!0,a&&clearTimeout(a)}}}},[kn,ft,at,st,Hn,zt,qt,Ii,Je]);var ji=function(n){var e=n.section,t=n.keyPath,o=n.depth,r=void 0===o?0:o,l=n.columnKey,u=void 0===l?"left":l,c=n.parentNodeId;return i(K,{section:e,keyPath:t,depth:r,columnKey:u,parentNodeId:void 0===c?"":c,expandedSubSections:Yt,setExpandedSubSections:Kt,maintainRelativeOrder:Hn||!1,proposedSections:at,existingSections:st,treeData:Rn,deviationNumberRegistry:pt,connectedSections:de,activeSideBySideSection:re,resolvedMarkdownStyles:Te,getSubSectionRef:Et,getSubSectionCompareStyle:si,getBadgeRef:Ft,openMoreFunctionsPopup:Jt,openSummaryPopup:Ti,showDeviationBadges:Ln,resetSideBySide:Lt,setConnectedSections:ae,setConnectedLines:fe,cachedConnectedPositions:me})};return t(d,n({ref:Ee,sx:n(n({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},Hn?{}:{overflow:"visible"}),{position:"relative"})},{children:[Pn&&i(d,n({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(N,{})})),Xe.open&&i(q,{open:Xe.open,anchorEl:Xe.anchorEl,containerEl:Qt.current,clipTopEl:ei.current,scrollContainerEl:_e.current,onClose:Ei,summary:Xe.summary}),i(A,{open:We.open,anchorEl:We.anchorEl,sectionTitle:We.sectionTitle,referenceSectionTitle:We.refSectionTitle,onClose:Ze,onOpenCognitiveCompare:Ut,onOpenSideBySide:_i,onConnect:$t,isConnected:Fi,isOrphan:We.isOrphan}),Pe.open&&i(k,{open:Pe.open,popupRef:Ge,position:Ke,popupConfig:Fn,onClose:function(){qe(null),ze(function(e){return n(n({},e),{open:!1})}),$e(null)},markdownStyles:In,sectionTitle:Pe.sectionTitle,referenceSectionTitle:Pe.refSectionTitle,cognitiveData:Pe.cognitiveData,anchorEl:Pe.anchorEl,sectionAnchorEl:Pe.sectionAnchorEl,scrollContainerEl:_e.current,badgeStyle:Pe.badgeStyle,docData:Pe.docData,deviationData:Pe.deviationData,isLoading:Pe.isLoading}),i(a,n({open:!!Vn,autoHideDuration:8e3,onClose:function(){return Xn(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(s,n({onClose:function(){return Xn(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Vn}))})),i(W,{componentHeaderText:Sn,displayConfig:En,maintainRelativeOrder:Hn,onCollapseAll:fi,showCollapseAll:pi,onToggleView:function(n){zn(!0),setTimeout(function(){jn(!n),Lt(),Ue(),ae(new Set),fe([]),me.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){zn(!1)},600)})})},50)}}),i(d,n({ref:_e,onScroll:Si,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:Hn?"hidden":"auto",borderTop:Mt&&kt?"none":"1.5px solid #EEF0F4"}},{children:i(d,n({sx:n({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},Hn?{flex:1,minHeight:0}:{})},{children:t(d,n({ref:Gt,sx:n({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},Hn?{flex:1,overflow:"visible"}:{})},{children:[t("svg",n({ref:pe,style:{position:"absolute",top:0,left:0,width:Be.width||"100%",height:Be.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:te?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[ui&&i("g",{children:i("line",{x1:ui.x1,y1:ui.y,x2:ui.x2,y2:ui.y,stroke:jt.badgeBorder,strokeWidth:"1.5"})}),oi.map(function(e){var o,r,l,u,c,a,s=e.x1+.5*(e.x2-e.x1),v=(e.y1+e.y2)/2;if("Not Defined"===e.style.label&&!e.hasCognitive)return null;if(e.isSubSection?Un&&re===e.subSectionKeyPath&&Zn:Un&&re===e.sectionIdx&&Zn)return null;if(!Hn){var f=e.isSubSection?B(e.x1,e.y1,e.x2,e.y2):"M ".concat(e.x1," ").concat(e.y1," L ").concat(e.x2," ").concat(e.y2),g=at[e.sectionIdx]||{title:"",content:""},x=st[e.sectionIdx]||{title:"",content:""};if(console.log("Base and Ref Sections for Badge:",g,x),e.isSubSection&&e.subSectionKeyPath){var m=e.subSectionKeyPath.includes(S)?e.subSectionKeyPath.split(S):[],y=m[2]||e.subSectionKeyPath,b=m[3]||y,R=y.split("-").map(Number),C=b.split("-").map(Number),w=null,I=null;R.length>0&&(w=at[R[0]]),C.length>0&&(I=st[C[0]]);var T=(null==w?void 0:w.title)||"",_=(null==I?void 0:I.title)||"";console.log("Root Parent Titles:",T,_);for(var E=1;E<R.length;E++)(null==w?void 0:w.subsections)&&(w=w.subsections[R[E]]);for(E=1;E<C.length;E++)(null==I?void 0:I.subsections)&&(I=I.subsections[C[E]]);w&&(g=n(n({},w),{title:T||w.title})),console.log("Base Section for Subsection Badge:",g),I&&(x=n(n({},I),{title:_||I.title})),console.log("Ref Section for Subsection Badge:",x)}var F=!(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),M=(null===(a=null===(c=null===(u=g.evaluationResult)||void 0===u?void 0:u.cognitive_decisioning)||void 0===c?void 0:c.decisioning_factors)||void 0===a?void 0:a.length)||!1,k=F||M;return t("g",{children:[i("path",{d:f,fill:"none",stroke:e.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i("foreignObject",n({x:s-100,y:v-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(d,n({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t(d,n({onClick:function(n){n.stopPropagation(),k&&(Pe.open&&Ve===e.id?Qe():($e(e.id),Xt(Vt(n.currentTarget,g,x,e.sectionIdx,e.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:e.style.badgeBg,color:e.style.badgeText,border:"1px solid ".concat(e.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:k?"pointer":"default"}},{children:[e.style.badgeText===D&&null==e.style.label?i(H,{color:e.style.badgeText}):0===e.style.label?"Same":e.style.label,i(d,n({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(h,{})})),k&&i(p,{size:11,style:{transform:Pe.open&&Ve===e.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},e.id)}return null}),ve.map(function(e){var o,r=e.pathD,l=(null===(o=e.style)||void 0===o?void 0:o.badgeBorder)||"#6366F1",u="conn-marker-".concat(e.id),c="".concat(e.id,"-bg"),d="".concat(e.id,"-stroke");return t("g",{children:[i("defs",{children:i("clipPath",n({id:"connections-clip"},{children:i("marker",n({id:u,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(n){xe.current[c]=n},d:r,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),i("path",{ref:function(n){xe.current[d]=n},d:r,fill:"none",stroke:l,strokeWidth:"1.75",markerEnd:"url(#".concat(u,")")})]},e.id)})]})),t(d,n({sx:n({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},Hn?{flex:1,overflow:"visible"}:{})},{children:[i(d,n({ref:ei,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,n({title:rt,placement:"top"},{children:i(f,n({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:rt}))}))})),t(d,n({ref:Ne,onScroll:Si,sx:n({p:"12px",display:"flex",flexDirection:"column"},Hn?{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:ke,style:{width:"100%",height:"0px",flexShrink:0}}),ht&&at.map(function(e,o){var r,l,u=!e.title&&!e.content;if(Hn&&u)return null;var c=e,a=ai(o,"left"),s=Hn?!(null===(r=c.refIndexes)||void 0===r?void 0:r.length)||c.selfIndex<0:!st[o],v=Hn?"number"==typeof c.selfIndex&&c.selfIndex>=0?c.selfIndex+1:null:o+1,f=de.has(o),p=y(c.evaluationResult,null==a?void 0:a.deviationLabel);return i(d,n({ref:_t(o),sx:{mb:1,width:"100%"}},{children:t(d,n({sx:{position:"relative",width:"100%"}},{children:[i(d,n({ref:bt.current[o],sx:n({width:"100%",display:"flex"},f&&{borderRadius:"6px",outline:"2px solid ".concat((null==a?void 0:a.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:i(Y,{section:e,idx:o,columnKey:"left",colRef:_t("left-accordion-".concat(o)),mb:0,treeData:Rn,proposedSections:at,existingSections:st,deviationNumberRegistry:pt,getSectionCompareStyle:ai,getBadgeRef:Ft,connectedSections:de,openMoreFunctionsPopup:Jt,openSummaryPopup:Ti,deviationNodeIdToView:null==kn?void 0:kn.id,deviationTargetParentId:Ai,parentNodeId:(null===(l=null==Rn?void 0:Rn.input_index_map)||void 0===l?void 0:l[0])||"",isExpanded:Hn?!!zt["left-".concat(o)]:!!zt[String(o)],onToggle:function(){Ei(),qt(o,"left")},navigation:e.id?Mi[e.id]:null,showOpenNodeRef:ki,resolvedMarkdownStyles:Te,maintainRelativeOrder:Hn,showDeviationBadges:Ln,renderSubSections:ji})})),Hn&&a&&t(d,n({ref:Rt.current[o],onClick:function(n){var t=Hn?st.find(function(n){var e;return null===(e=c.refIndexes)||void 0===e?void 0:e.includes(n.selfIndex)})||{title:"",content:""}:st[o]||{title:"",content:""};Jt(n,e,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,n({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(a.badgeBorder)}},{children:v})),i(d,n({component:"span",sx:{fontSize:"11px",px:.25}},{children:!En.isLoading||null!=c.evaluationResult&&null!=c.evaluationResult?s?"No Deviation Found":"N/A"===p||"NA"===p?"N/A":0==p||null==p?"Same":"".concat(p):i(H,{color:a.badgeText})})),i(g,{size:11,color:a.badgeText})]}))]}))}),"left-row-".concat(o))}),i("div",{ref:Ae,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(d,n({ref:Qt,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:i(d,n({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(d,n({onClick:function(e){e.stopPropagation(),Pe.open&&Ve===At?Qe():($e(At),Xt(Vt(e.currentTarget,{title:"",content:"",evaluationResult:Nt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,At,!0,n(n({},jt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:jt.badgeBg,color:jt.badgeText,border:"1px solid ".concat(jt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=Ht?Ht:i(H,{}),i(d,n({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(h,{})})),i(p,{size:11,style:{transform:Pe.open&&Ve===At?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),t(d,n({sx:n({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},Hn?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Yn&&i(x,{sections:11}),i(d,n({ref:ti,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,n({title:lt,placement:"top"},{children:i(f,n({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:lt}))}))})),t(d,n({ref:Fe,onScroll:Si,sx:n({p:"12px",display:"flex",flexDirection:"column"},Hn?{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:De,style:{width:"100%",height:"0px",flexShrink:0}}),ht&&st.map(function(e,o){var r,l=e,u=[],c=!1,a=null,s=-1;if(Hn){u=at.filter(function(n){var e;return(null===(e=n.refIndexes)||void 0===e?void 0:e.includes(l.selfIndex))&&n.selfIndex>=0}).map(function(n){return n.selfIndex+1}),s=at.findIndex(function(n){var e;return(null===(e=n.refIndexes)||void 0===e?void 0:e.includes(l.selfIndex))&&n.selfIndex>=0});var v=at.findIndex(function(n,e){var t;return de.has(e)&&(null===(t=n.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(c=-1!==v)&&(a=ai(v))}else u=[o+1],(c=de.has(o))&&(a=ai(o));var f=ai(Hn&&-1!==s?s:o);return i(d,n({ref:wt.current[o],sx:{mb:1,width:"100%"}},{children:t(d,n({sx:{position:"relative",width:"100%"}},{children:[i(d,n({ref:St.current[o],sx:n({width:"100%",display:"flex"},c&&a&&{borderRadius:"6px",outline:"2px solid ".concat(a.badgeBorder),outlineOffset:"1px"})},{children:i(Y,{section:e,idx:o,columnKey:"right",colRef:_t("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==Rn?void 0:Rn.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:Hn?!!zt["right-".concat(o)]:!!zt[String(o)],treeData:Rn,proposedSections:at,existingSections:st,deviationNumberRegistry:pt,getBadgeRef:Ft,getSectionCompareStyle:ai,connectedSections:de,openMoreFunctionsPopup:Jt,openSummaryPopup:Ti,deviationNodeIdToView:null==kn?void 0:kn.id,deviationTargetParentId:Ai,onToggle:function(){Ei(),qt(o,"right")},navigation:e.id?Mi[e.id]:null,showOpenNodeRef:ki,resolvedMarkdownStyles:Te,maintainRelativeOrder:Hn,showDeviationBadges:Ln,renderSubSections:ji})})),Hn&&f&&i(d,n({ref:Ct.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:f.badgeBg,color:f.badgeText,border:"1px solid ".concat(f.badgeBorder),borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:u.length>0?u.join(", "):"-"}))]}))}),"right-row-".concat(o))}),i("div",{ref:Me,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{V as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var n=function(t){return null==t?"":"string"==typeof t?t:Array.isArray(t)?t.map(n).join("\n\n"):"object"==typeof t?JSON.stringify(t):String(t)},
|
|
1
|
+
import{DEFAULT_DEVIAION_COLOR as t}from"./CognitiveCompareConstants.js";var n=function(t){return null==t?"":"string"==typeof t?t:Array.isArray(t)?t.map(n).join("\n\n"):"object"==typeof t?JSON.stringify(t):String(t)},o=function(t){return null!=t&&("string"==typeof t?t.trim().length>0:!Array.isArray(t)||t.length>0&&t.some(function(t){return o(t)}))},i=function(t,o,i){var e,r=i[o],u=null===(e=null==t?void 0:t.comparison_inputs)||void 0===e?void 0:e[r];return{title:n((null==u?void 0:u.title)||""),content:n((null==u?void 0:u.content)||""),attributes:(null==u?void 0:u.additional_attributes)||null,subsections:(null==u?void 0:u.subsections)||[]}},e=function(t){if(!t.mapping_rationale)return{cognitiveData:{decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0,citations:[]},score:0,relation:"N/A"};var n=t.mapping_rationale,o=parseInt(n.decision_strength||"0");return{cognitiveData:{decisioning:n.decisioning_factors||[],gap:n.gaps_in_decision||[],relevance_score:o,citations:n.citations},score:0,relation:"N/A"}};function r(t){var n=function(t,n){var o=function(t){var n=function(t){return 4===t.length?"#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]:t}(t).replace("#",""),o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}(t),i=o.r,e=o.g,r=o.b;return function(t,n,o){return"#"+[t,n,o].map(function(t){return t.toString(16).padStart(2,"0")}).join("").toUpperCase()}(Math.round(i+(255-i)*n),Math.round(e+(255-e)*n),Math.round(r+(255-r)*n))};return{bg:n(t,.8),border:n(t,.5),badgeBg:n(t,.8),badgeBorder:n(t,.5),badgeText:t.toUpperCase(),highlightBg:n(t,.8)}}function u(t,n){var o;return function(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var r=this;clearTimeout(o),o=setTimeout(function(){return t.apply(r,i)},n)}}var l=function(t,n){var o,i,e,r,u,l;if(t.content!==n.content)return!1;if(t.sxStyles!==n.sxStyles)return!1;if(t.maintainRelativeOrder!==n.maintainRelativeOrder)return!1;if(t.highlightBg!==n.highlightBg)return!1;var a=t.highlights||[],v=n.highlights||[];if(a.length!==v.length)return!1;for(var d=0;d<a.length;d++)if(a[d]!==v[d])return!1;var c=t.deviationBadges||[],s=n.deviationBadges||[];if(c.length!==s.length)return!1;for(d=0;d<c.length;d++){if(c[d].id!==s[d].id)return!1;if(c[d].actionId!==s[d].actionId)return!1;if(c[d].label!==s[d].label)return!1;if(c[d].score!==s[d].score)return!1;if(c[d].isOrphan!==s[d].isOrphan)return!1;if(c[d].isConnected!==s[d].isConnected)return!1;if((null===(o=c[d].style)||void 0===o?void 0:o.badgeBg)!==(null===(i=s[d].style)||void 0===i?void 0:i.badgeBg))return!1;if((null===(e=c[d].style)||void 0===e?void 0:e.badgeBorder)!==(null===(r=s[d].style)||void 0===r?void 0:r.badgeBorder))return!1;if((null===(u=c[d].style)||void 0===u?void 0:u.badgeText)!==(null===(l=s[d].style)||void 0===l?void 0:l.badgeText))return!1}return!0},a="::",v=function(t){if(!t)return!0;var n=t.trim().toLowerCase();return n.includes("no equivalent")||"n/a"===n||"na"===n||"none"===n},d=function(t,n){var o,i,e,r,u,l,a;if(!t)return n;var v=null!==(l=null!==(r=null!==(i=null===(o=t.evaluation_output)||void 0===o?void 0:o.output_score)&&void 0!==i?i:null===(e=t.evaluation_outputs)||void 0===e?void 0:e.output_score)&&void 0!==r?r:null===(u=t.evaluation_outputs)||void 0===u?void 0:u.output_value)&&void 0!==l?l:t.output_score;return null!==(a=null!=v?v:n)&&void 0!==a?a:""},c=function(t,n,o,i,e){void 0===e&&(e=14);var r=t+.5*(o-t),u=i-n;if(Math.abs(u)<3)return"M ".concat(t," ").concat(n," H ").concat(o);var l=u>0?1:-1,a=Math.min(e,Math.abs(u)/2,Math.abs(r-t)/2,Math.abs(o-r)/2);return["M ".concat(t," ").concat(n),"H ".concat(r-a),"Q ".concat(r," ").concat(n," ").concat(r," ").concat(n+l*a),"V ".concat(i-l*a),"Q ".concat(r," ").concat(i," ").concat(r+a," ").concat(i),"H ".concat(o)].join(" ")},s=function(t,n,o,i,e){void 0===o&&(o=300);var r=t.style.scrollBehavior;t.style.scrollBehavior="auto";var u=t.scrollTop,l=n-u,a=null,v=function(d){null===a&&(a=d);var c,s=d-a;s<o?(t.scrollTop=(c=s,c/=o,l*(--c*c*c+1)+u),e&&e(),requestAnimationFrame(v)):(t.scrollTop=n,t.style.scrollBehavior=r,e&&e(),i&&i())};requestAnimationFrame(v)},f=function(t){var n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return n=(n=(n=(n=n.replace(/['’‘`]/g,"['’‘`]")).replace(/["”“]/g,'["”“]')).replace(/[-—–]/g,"[-—–]")).replace(/\s+/g,"\\s+")},g=["#B91C1C","#A16207","#1D4ED8","#000000"],p=function(t){var n=g.findIndex(function(n){return n.toLowerCase()===t.toLowerCase()});return-1===n?g.length:n},h=function(n){for(var o,i,e,r,u,l,a,v,d,c,s,f,g,h=[],b=0,_=Object.keys((null==n?void 0:n.deviations)||{}).sort(function(t,n){return Number(t)-Number(n)});b<_.length;b++){var m=_[b];(j=null===(r=null===(e=null===(i=null===(o=null==n?void 0:n.deviations)||void 0===o?void 0:o[m])||void 0===i?void 0:i.evaluation_outputs)||void 0===e?void 0:e.metadata)||void 0===r?void 0:r.label_color)&&h.push(j)}for(var y=0,B=Object.keys((null==n?void 0:n.deviation_entries)||{}).sort(function(t,n){return Number(t)-Number(n)});y<B.length;y++){m=B[y];(j=null===(v=null===(a=null===(l=null===(u=null==n?void 0:n.deviation_entries)||void 0===u?void 0:u[m])||void 0===l?void 0:l.evaluation_outputs)||void 0===a?void 0:a.metadata)||void 0===v?void 0:v.label_color)&&h.push(j)}for(var N=0,C=Object.keys(n||{}).filter(function(t){return/^\d+$/.test(t)}).sort(function(t,n){return Number(t)-Number(n)});N<C.length;N++){var j;m=C[N];(j=null===(s=null===(c=null===(d=null==n?void 0:n[m])||void 0===d?void 0:d.evaluation_outputs)||void 0===c?void 0:c.metadata)||void 0===s?void 0:s.label_color)&&h.push(j)}return 0===h.length?(null===(g=null===(f=null==n?void 0:n.evaluation_outputs)||void 0===f?void 0:f.metadata)||void 0===g?void 0:g.label_color)?n.evaluation_outputs.metadata.label_color:t:h.sort(function(t,n){return p(t)-p(n)})[0]},b=function(t){for(var n,o,i,e,r,u,l,a,v,d=0,c=Object.keys((null==t?void 0:t.deviations)||{}).sort(function(t,n){return Number(t)-Number(n)});d<c.length;d++){var s=c[d];if(b=null===(i=null===(o=null===(n=null==t?void 0:t.deviations)||void 0===n?void 0:n[s])||void 0===o?void 0:o.evaluation_outputs)||void 0===i?void 0:i.output_value)return b}for(var f=0,g=Object.keys((null==t?void 0:t.deviation_entries)||{}).sort(function(t,n){return Number(t)-Number(n)});f<g.length;f++){s=g[f];if(b=null===(u=null===(r=null===(e=null==t?void 0:t.deviation_entries)||void 0===e?void 0:e[s])||void 0===r?void 0:r.evaluation_outputs)||void 0===u?void 0:u.output_value)return b}for(var p=0,h=Object.keys(t||{}).filter(function(t){return/^\d+$/.test(t)}).sort(function(t,n){return Number(t)-Number(n)});p<h.length;p++){var b;s=h[p];if(b=null===(a=null===(l=null==t?void 0:t[s])||void 0===l?void 0:l.evaluation_outputs)||void 0===a?void 0:a.output_value)return b}return(null===(v=null==t?void 0:t.evaluation_outputs)||void 0===v?void 0:v.output_value)?t.evaluation_outputs.output_value:null};export{a as DEVIATION_BADGE_SEPARATOR,l as areMarkdownPropsEqual,u as debounce,f as escapeRegExp,d as extractDeviationScore,r as generateColorPalette,c as getBentArrowPath,h as getFirstDeviationColor,b as getFirstDeviationOutputValue,e as getRationale,i as getSideData,o as hasValue,v as isMissingStr,n as safeStringify,s as smoothScrollTo};
|
|
2
2
|
//# sourceMappingURL=CognitiveComparehelpers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__rest as n,__spreadArray as r}from"tslib";import{jsx as i,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Box as l,Typography as a}from"@mui/material";import c,{useMemo as d}from"react";import{DEFAULT_DEVIAION_COLOR as s}from"../CognitiveCompareConstants.js";import{EllipsisVertical as p}from"lucide-react";import
|
|
1
|
+
import{__assign as e,__rest as n,__spreadArray as r}from"tslib";import{jsx as i,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Box as l,Typography as a}from"@mui/material";import c,{useMemo as d}from"react";import{DEFAULT_DEVIAION_COLOR as s}from"../CognitiveCompareConstants.js";import{EllipsisVertical as p}from"lucide-react";import u from"react-markdown";import{safeStringify as h,areMarkdownPropsEqual as g}from"../CognitiveComparehelpers.js";import v from"rehype-raw";var f=c.memo(function(g){var f=g.content,m=g.sxStyles,x=g.deviationBadges,b=void 0===x?[]:x,y=g.highlights,C=void 0===y?[]:y,E=g.maintainRelativeOrder,F=void 0===E||E,_=g.highlightBg,S=d(function(){return b.reduce(function(n,r){var i;return e(e({},n),((i={})[r.id]=r,i))},{})},[b]),w=function(n,r){return c.Children.map(n,function(n){var i;if(!c.isValidElement(n))return n;var o=(null===(i=n.props)||void 0===i?void 0:i.children)?w(n.props.children,r):n.props.children,t=c.cloneElement(n,e(e({},n.props),{children:o}));return r(t)})},k=d(function(){return{mark:function(r){var o,t,l,a,c=r.children,d=n(r,["children"]),s=d["data-badge-id"],p=s?S[s]:null,u=null!==(a=null!==(t=null===(o=null==p?void 0:p.style)||void 0===o?void 0:o.highlightBg)&&void 0!==t?t:null===(l=null==p?void 0:p.style)||void 0===l?void 0:l.badgeBg)&&void 0!==a?a:_;return i("span",e({style:e(e({},d.isSuggestedDeviationFix?{}:{backgroundColor:u}),{borderRadius:"2px"})},{children:c}))},span:function(r){var t,a,c,d,u,h,g=r.children,v=n(r,["children"]),f=v["data-badge-id"];if(!f)return i("span",e({},v,{children:g}));var m=S[f];return m?o(l,e({component:"span",sx:{position:"static",display:"inline"}},{children:[o(l,e({ref:m.badgeRef,sx:e(e({fontStyle:"normal",position:"absolute",zIndex:30,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(t=m.style)||void 0===t?void 0:t.badgeBg)||"#EEF2FF",color:(null===(a=m.style)||void 0===a?void 0:a.badgeText)||s,border:"1px solid ".concat((null===(c=m.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden"},"left"===m.side?{right:"-16px",transform:"translateY(-20%) translateX(calc(100% + 8px))"}:{left:"-16px",transform:"translateY(-20%) translateX(calc(-100% - 8px))"}),m.isConnected&&m.style&&{outline:"2px solid ".concat(m.style.badgeBorder),outlineOffset:"1px"})},{children:[o(l,e({onClick:function(e){e.stopPropagation(),m.onSummaryClick&&m.onSummaryClick(e)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[i(l,e({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:m.label})),("left"===m.side||m.isOrphan)&&i(l,e({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=m.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=m.score&&"N/A"!==m.score&&"NA"!==m.score&&0!==m.score?"".concat(m.score):"N/A"===m.score||"NA"===m.score?"N/A":"Same"}))]})),("left"===m.side||m.isOrphan)&&i(l,e({onClick:function(e){e.stopPropagation(),m.onClick&&m.onClick(e)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(u=m.style)||void 0===u?void 0:u.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:i(p,{size:12,color:(null===(h=m.style)||void 0===h?void 0:h.badgeText)||"#3730A3"})}))]})),g]})):i("span",e({},v,{children:g}))},updated:function(e){var r=e.children;return n(e,["children"]),i(t,{children:r})},deleted:function(r){var o=r.children;n(r,["children"]),console.log("nitish: ",o);var t=w(o,function(e){return c.cloneElement(e,{isSuggestedDeviationFix:!0})});return i("span",e({style:{borderTop:"1px solid #EF4444",borderBottom:"1px solid #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:t}))},changed:function(r){var o=r.children;n(r,["children"]);var t=w(o,function(e){return c.cloneElement(e,{isSuggestedDeviationFix:!0})});return i("span",e({style:{borderTop:"1px solid #2F59FF",borderBottom:"1px solid #2F59FF",backgroundColor:"#D5E8FF"}},{children:t}))}}},[S,F]),B=d(function(){var e=function(e){return e?e.replace(/\\([''])/g,"$1").replace(/\\n/g,"\n").replace(/\r\n/g,"\n").split(/(\n{2,})/).map(function(e){return e.startsWith("\n")?e:e.replace(/\n/g," ")}).join(""):""},n=function(e,n,r,i){void 0===n&&(n=""),void 0===r&&(r=""),void 0===i&&(i="");var o=e.startsWith("\n\n"),t=e.endsWith("\n\n");return r+e.split(/(\n{2,})/).map(function(e,r,i){if(/^\n{2,}$/.test(e))return e;if(!e.trim())return e;var l=0===r||1===r&&/^\n{2,}$/.test(i[0]),a=r===i.length-1||r===i.length-2&&/^\n{2,}$/.test(i[i.length-1]);return o&&l||t&&a?e:'<mark data-badge-id="'.concat(n,'">').concat(e,"</mark>")}).join("").replace(/^\n{2,}/,"").replace(/\n{2,}$/,"")+i},i=e(h(f||"")),o=r([],b,!0).sort(function(e,n){var r,i;return((null===(r=n.highlight)||void 0===r?void 0:r.length)||0)-((null===(i=e.highlight)||void 0===i?void 0:i.length)||0)}),t={},l=0;o.forEach(function(r){if(r&&r.highlight){var o=e(r.highlight);if(o){var a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c="__DEV_TOKEN_".concat(l++,"__");t[c]=n(o,r.id,'<span data-badge-id="'.concat(r.id,'">'),"</span>"),i=i.replace(o,c);var d="__HIGHLIGHT_TOKEN_".concat(l++,"__");t[d]=n(o,r.id),i=i.replace(new RegExp(a,"g"),d)}}});var a=new Set(o.map(function(n){return e(n.highlight)}).filter(Boolean));return C.forEach(function(r){if(r){var o=e(r);if(o&&!a.has(o)){var c=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d="__PLAIN_TOKEN_".concat(l++,"__");t[d]=n(o),i=i.replace(new RegExp(c,"g"),d)}}}),Object.keys(t).forEach(function(e){i=i.split(e).join(t[e])}),i},[f,b,C]);return i(a,e({component:"div",sx:e(e({},m),{position:"relative",overflow:"visible",whiteSpace:"pre-wrap","& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}})},{children:i(u,e({components:k,rehypePlugins:[v]},{children:h(B).replace(/\\n/g,"\n")}))}))},g);export{f as MemoizedMarkdown};
|
|
2
2
|
//# sourceMappingURL=memoizedMarkdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,oBAAoB,+
|
|
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, resetDeviationNodeId, }: CognitiveCompareProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const CognitiveCompare: ({ componentHeaderText, treeData, comparisonConfig, leftColumnTitleText, rightColumnTitleText, markdownStyles, resetTrigger, 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":"
|
|
1
|
+
{"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AAkCA,OAAO,EAEL,qBAAqB,EAMtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAiBlC,QAAA,MAAM,gBAAgB,0NAoBnB,qBAAqB,4CA8zGvB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,eAAe,gBAAgB,CAAC"}
|
|
@@ -103,8 +103,12 @@ export interface CognitiveCompareProps {
|
|
|
103
103
|
displayConfig: IDisplayConfig;
|
|
104
104
|
popupConfig?: CognitivePopupConfig;
|
|
105
105
|
deviationData?: Record<string, any>;
|
|
106
|
-
deviationNodeIdToView?:
|
|
106
|
+
deviationNodeIdToView?: {
|
|
107
|
+
id: string;
|
|
108
|
+
trigger: number;
|
|
109
|
+
};
|
|
107
110
|
resetDeviationNodeId?: () => void;
|
|
111
|
+
resetTrigger?: number;
|
|
108
112
|
}
|
|
109
113
|
export type StyleVariant = {
|
|
110
114
|
bg: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,0BAA0B,EAAE;QAC1B,OAAO,EAAE;YACP,aAAa,EAAE,MAAM,CAAC;YACtB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;QACF,MAAM,EAAE;YACN,CAAC,GAAG,EAAE,MAAM,GACV,uBAAuB,GACvB;gBAAE,KAAK,EAAE,MAAM,CAAC;gBAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;aAAE,CAAC;SAC1D,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,qBAAqB,CAAC,EAAE;QACtB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAClC,CAAA;IACD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE;QACT,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;QAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,aAAa,CAAC,EAAE,yBAAyB,CAAC;KAC3C,EAAE,CAAC;CACL;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACtC,CAAC;AACF,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0CAA0C,CAAC,EAAE,OAAO,CAAC;CACtD,CAAA;AACD,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrD,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE3D,aAAa,EAAE,cAAc,CAAC;IAC9B,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,qBAAqB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,0BAA0B,EAAE;QAC1B,OAAO,EAAE;YACP,aAAa,EAAE,MAAM,CAAC;YACtB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;QACF,MAAM,EAAE;YACN,CAAC,GAAG,EAAE,MAAM,GACV,uBAAuB,GACvB;gBAAE,KAAK,EAAE,MAAM,CAAC;gBAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;aAAE,CAAC;SAC1D,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,qBAAqB,CAAC,EAAE;QACtB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAClC,CAAA;IACD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE;QACT,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;QAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,aAAa,CAAC,EAAE,yBAAyB,CAAC;KAC3C,EAAE,CAAC;CACL;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACtC,CAAC;AACF,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0CAA0C,CAAC,EAAE,OAAO,CAAC;CACtD,CAAA;AACD,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrD,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE3D,aAAa,EAAE,cAAc,CAAC;IAC9B,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,qBAAqB,CAAC,EAAE;QACtB,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CAQH,CAAC;AAGF,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,iBAAiB,EAAE,WAAW,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,UAAU,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACrC,aAAa,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;IACtC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEJ,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAChD,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,UAAU,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACpC,aAAa,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG;IAChB,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB,CAAA;AAID,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE;YACV,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;SAC1B,CAAC;QACF,WAAW,CAAC,EAAE;YACZ,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE;QACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAK,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAC7C,iBAAiB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACvC,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAA;IAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAA"}
|
|
@@ -46,5 +46,7 @@ export declare const extractDeviationScore: (evaluationResult: any, fallbackLabe
|
|
|
46
46
|
export declare const getBentArrowPath: (x1: number, y1: number, x2: number, y2: number, radius?: number) => string;
|
|
47
47
|
export declare const smoothScrollTo: (element: HTMLElement, targetPosition: number, duration?: number, onComplete?: () => void, onProgress?: () => void) => void;
|
|
48
48
|
export declare const escapeRegExp: (string: string) => string;
|
|
49
|
+
export declare const getFirstDeviationColor: (evaluationResult: any) => string;
|
|
50
|
+
export declare const getFirstDeviationOutputValue: (evaluationResult: any) => string | null;
|
|
49
51
|
export {};
|
|
50
52
|
//# sourceMappingURL=CognitiveComparehelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveComparehelpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveComparehelpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CognitiveComparehelpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveComparehelpers.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,QAAS,OAAO,KAAG,MAM5C,CAAC;AAGF,eAAO,MAAM,QAAQ,QAAS,OAAO,KAAG,OAKvC,CAAC;AAGF,eAAO,MAAM,WAAW,SAChB,GAAG,aACE,GAAG,GAAG,GAAG,YACV,OAAO,MAAM,EAAE,MAAM,CAAC;;;;;CAUjC,CAAC;AAGF,eAAO,MAAM,YAAY,SAAU,GAAG;;;;;;;;;;;;;;;;;;;;CA2BrC,CAAC;AAGF,eAAO,MAAM,qBAAqB,aAAc,MAAM,KAAG,MAOxD,CAAC;AAqDF,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAuD9D;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,MAAM,GACZ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAQlC;AAED,eAAO,MAAM,mBAAmB,YAAa,MAAM,OAAO,MAAM,YAG/D,CAAA;AACD,eAAO,MAAM,qBAAqB,cAAe,GAAG,aAAa,GAAG,YAgCnE,CAAC;AAEF,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,eAAO,MAAM,YAAY,QAAS,MAAM,GAAG,SAAS,GAAG,IAAI,YAS1D,CAAC;AAEF,eAAO,MAAM,qBAAqB,qBAAsB,GAAG,kBAAkB,GAAG,QAO/E,CAAC;AAEF,eAAO,MAAM,gBAAgB,OACvB,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,WACF,MAAM,KACb,MAyBF,CAAC;AAEF,eAAO,MAAM,cAAc,YAChB,WAAW,kBACJ,MAAM,aACZ,MAAM,eACH,MAAM,IAAI,eACV,MAAM,IAAI,SAgCxB,CAAC;AAEF,eAAO,MAAM,YAAY,WAAY,MAAM,WAQ1C,CAAC;AAWF,eAAO,MAAM,sBAAsB,qBAAsB,GAAG,KAAG,MAmC9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,qBAAsB,GAAG,KAAG,MAAM,GAAG,IA4B7E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoizedMarkdown.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/memoizedMarkdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAQhE,eAAO,MAAM,gBAAgB;aAQlB,MAAM;cACL,GAAG;;;;iBAIA,MAAM;
|
|
1
|
+
{"version":3,"file":"memoizedMarkdown.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/memoizedMarkdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAQhE,eAAO,MAAM,gBAAgB;aAQlB,MAAM;cACL,GAAG;;;;iBAIA,MAAM;8CA0TI,CAAC"}
|