@viswa-test/test-citation 0.0.44 → 0.0.45
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/CognitivePopup.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts +98 -0
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__rest as t,__spreadArray as n}from"tslib";import{jsx as i,jsxs as r,Fragment as o}from"react/jsx-runtime";import l,{useMemo as c,useState as u,useRef as a,useEffect as d,useCallback as s}from"react";import{Box as v,Typography as p,Snackbar as f,Alert as h,FormControlLabel as g,Switch as x,Tooltip as m,Accordion as y,AccordionSummary as b,AccordionDetails as S}from"@mui/material";import{EllipsisVertical as w,ChevronDown as I}from"lucide-react";import{ButtonCognitiveIcon as R}from"../../assests/svg/ButtonCognitiveIcon.js";import C from"./OverlayComponent.js";import F from"react-markdown";import{safeStringify as E,hasValue as B,getSideData as _,getRationale as T}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as M,DEFAULT_FIELD_CONFIG as k,DEFAULT_COMPARISON_CONFIG as A}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import D from"./CognitivePopup.js";import H from"./MoreFunctionsPopup.js";import N from"./LoaderComponent.js";import O from"rehype-raw";var W="::",z=l.memo(function(n){var l=n.content,u=n.sxStyles,a=n.deviationBadges,d=void 0===a?[]:a,s=n.highlights,f=void 0===s?[]:s,h=n.maintainRelativeOrder,g=void 0===h||h,x=c(function(){return d.reduce(function(t,n){var i;return e(e({},t),((i={})[n.id]=n,i))},{})},[d]),m=c(function(){return{mark:function(t){var n=t.children;return i("span",e({style:{backgroundColor:"#fccccc",borderRadius:"2px"}},{children:n}))},span:function(n){var l,c,u,a,d,s=n.children,p=t(n,["children"]),f=p["data-badge-id"];if(!f)return i("span",e({},p,{children:s}));var h=x[f];return h?r(v,e({component:"span",sx:{position:"static",display:"inline"}},{children:[s,i(v,e({ref:h.badgeRef,onClick:h.onClick,sx:e(e({position:"absolute",zIndex:30,display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"10px",bgcolor:(null===(l=h.style)||void 0===l?void 0:l.badgeBg)||"#EEF2FF",color:(null===(c=h.style)||void 0===c?void 0:c.badgeText)||"#3730A3",border:"1px solid ".concat((null===(u=h.style)||void 0===u?void 0:u.badgeBorder)||"#C7D2FE"),borderRadius:"12px",px:1,py:.3,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)"},"left"===h.side?{right:"-16px",transform:"translateY(-20%) translateX(calc(100% + 8px))"}:{left:"-16px",transform:"translateY(-20%) translateX(calc(-100% - 8px))"}),h.isConnected&&h.style&&{outline:"2px solid ".concat(h.style.badgeBorder),outlineOffset:"1px"})},{children:r(o,{children:[i(v,e({component:"span",sx:e({fontSize:"10px",fontWeight:700},"left"===h.side?{pr:.5,borderRight:"1px solid ".concat((null===(a=h.style)||void 0===a?void 0:a.badgeBorder)||"#C7D2FE")}:{})},{children:h.label})),"left"===h.side&&r(o,{children:[i(v,e({component:"span",sx:{fontSize:"10px",px:.25}},{children:null!=h.score&&"N/A"!==h.score&&"NA"!==h.score&&0!==h.score?"".concat(h.score):h.isOrphan?"No Deviation Found":"N/A"===h.score||"NA"===h.score?"N/A":"Same"})),i(w,{size:10,color:(null===(d=h.style)||void 0===d?void 0:d.badgeText)||"#3730A3"})]})]})}))]})):i("span",e({},p,{children:s}))}}},[x,g]),y=c(function(){var e=l||"",t=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};return d.forEach(function(n){if(n.highlight){var i=n.highlight.replace(/\\(['’])/g,"$1");e=e.replace(new RegExp(t(i),"g"),'<span data-badge-id="'.concat(n.id,'"><mark>').concat(i,"</mark></span>"))}}),f.forEach(function(n){n&&(e=e.replace(new RegExp(t(n),"g"),"<mark>".concat(n,"</mark>")))}),e},[l,d,f]);return i(p,e({component:"div",sx:e(e({},u),{position:"relative",overflow:"visible","& p, & li, & ul, & ol":{position:"static",overflow:"visible"}})},{children:i(F,e({components:m,rehypePlugins:[O]},{children:E(y).replace(/\\n/g,"\n")}))}))},function(e,t){if(e.content!==t.content)return!1;if(e.sxStyles!==t.sxStyles)return!1;if(e.maintainRelativeOrder!==t.maintainRelativeOrder)return!1;var n=e.highlights||[],i=t.highlights||[];if(n.length!==i.length)return!1;for(var r=0;r<n.length;r++)if(n[r]!==i[r])return!1;return!0}),L=function(e,t,n,i,r){void 0===r&&(r=14);var o=e+.5*(n-e),l=i-t;if(Math.abs(l)<3)return"M ".concat(e," ").concat(t," H ").concat(n);var c=l>0?1:-1,u=Math.min(r,Math.abs(l)/2,Math.abs(o-e)/2,Math.abs(n-o)/2);return["M ".concat(e," ").concat(t),"H ".concat(o-u),"Q ".concat(o," ").concat(t," ").concat(o," ").concat(t+c*u),"V ".concat(i-c*u),"Q ".concat(o," ").concat(i," ").concat(o+u," ").concat(i),"H ".concat(n)].join(" ")},j={id:"",title:""},P={open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,isOrphan:!1,docData:null,deviationData:null},Y=function(e,t,n,i,r){void 0===n&&(n=300);var o=e.style.scrollBehavior;e.style.scrollBehavior="auto";var l=e.scrollTop,c=t-l,u=null,a=function(d){null===u&&(u=d);var s,v=d-u;v<n?(e.scrollTop=(s=v,s/=n,c*(--s*s*s+1)+l),r&&r(),requestAnimationFrame(a)):(e.scrollTop=t,e.style.scrollBehavior=o,r&&r(),i&&i())};requestAnimationFrame(a)},K=function(t){var o,F,O,K,V,q,X,U,G=t.componentHeaderText,J=void 0===G?"Contract Comparison":G,$=t.treeData,Q=t.comparisonConfig,Z=t.leftColumnTitleText,ee=t.rightColumnTitleText,te=t.markdownStyles,ne=t.displayConfig,ie=void 0===ne?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1}:ne,re=t.popupConfig,oe=t.deviationData,le=void 0===oe?{}:oe,ce=u(ie.maintainRelativeOrder),ue=ce[0],ae=ce[1],de=u(!1),se=de[0],ve=de[1],pe=u(!1),fe=pe[0],he=pe[1],ge=u(null),xe=ge[0],me=ge[1],ye=u(!1),be=ye[0],Se=ye[1],we=u(!1),Ie=we[0],Re=we[1],Ce=a(!1),Fe=u(null),Ee=Fe[0],Be=Fe[1],_e=u(new Set),Te=_e[0],Me=_e[1],ke=u([]),Ae=ke[0],De=ke[1],He=a(null),Ne=a(!1),Oe=a(null),We=a({}),ze=a([]),Le=a(!1),je=a(!1),Pe=a(null),Ye=c(function(){return(null==$?void 0:$.cognitive_decisioning)||{}},[$]),Ke=u(null),Ve=Ke[0],qe=Ke[1],Xe=a(null),Ue=u({width:0,height:0}),Ge=Ue[0],Je=Ue[1],$e=c(function(){return e(e({},M),te)},[te]),Qe=u({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,isOrphan:!1,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null,deviationData:null}),Ze=Qe[0],et=Qe[1],tt=u({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,isOrphan:!1,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null,deviationData:null}),nt=tt[0],it=tt[1],rt=a(null),ot=a(null),lt=a(null),ct=a(null),ut=a(null),at=a(null),dt=a(null),st=a(null),vt=a(!1),pt=a(null);d(function(){pt.current=null},[Ze.sectionIdx,Ze.open]);var ft=s(function(){qe(null),et(P),Be(null)},[]),ht=s(function(){it(P)},[]),gt=s(function(){var e;if(Ze.anchorEl&&Ze.refSectionTitle){var t=Ze.anchorEl.getBoundingClientRect(),n=(null===(e=null==Xe?void 0:Xe.current)||void 0===e?void 0:e.offsetHeight)||0,i=Math.min(680,window.innerWidth-24),r=window.innerHeight-t.bottom-12-12,o=t.top-12-12,l=r<n&&o>r;null!==pt.current?!0===pt.current&&(l=o>=n||o>=r):l=!(r>=n||r>=o),pt.current=l;var c=l?o:r,u=Math.min(n||9999,c),a=l?t.top-12-u:t.bottom+12,d=t.left+t.width/2,s=d-i/2,v=Math.max(12,Math.min(s,window.innerWidth-i-12)),p=Math.max(14,Math.min(d-v,i-10-4));qe({top:a,left:v,arrowLeft:p,openAbove:l,maxHeight:c})}},[Ze.anchorEl,Ze.refSectionTitle]);d(function(){if(Ze.open){window.addEventListener("resize",gt);var e=requestAnimationFrame(gt),t=null;return Xe.current&&(t=new ResizeObserver(function(){cancelAnimationFrame(e),e=requestAnimationFrame(gt)})).observe(Xe.current),function(){cancelAnimationFrame(e),window.removeEventListener("resize",gt),t&&t.disconnect()}}},[Ze.open,gt]),d(function(){var e=rt.current;if(e&&Ze.open){var t=function(e){Xe.current&&Xe.current.contains(e.target)||(qe(null),ft())};return e.addEventListener("scroll",t,{capture:!0}),window.addEventListener("scroll",t,{capture:!0}),function(){e.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("scroll",t,{capture:!0})}}},[Ze.open,ft]),d(function(){var e=rt.current;if(e&&nt.open){var t=function(){ht()};return e.addEventListener("scroll",t,{capture:!0}),window.addEventListener("scroll",t,{capture:!0}),function(){e.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("scroll",t,{capture:!0})}}},[nt.open,ht]);var xt=c(function(){var t,n,i,r,o,l,c,u,a,d,s,v;return{fields:null!==(t=null==Q?void 0:Q.fields)&&void 0!==t?t:k,thresholds:{high:null!==(i=null===(n=null==Q?void 0:Q.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:A.thresholds.high,medium:null!==(o=null===(r=null==Q?void 0:Q.thresholds)||void 0===r?void 0:r.medium)&&void 0!==o?o:A.thresholds.medium,exact:null!==(c=null===(l=null==Q?void 0:Q.thresholds)||void 0===l?void 0:l.exact)&&void 0!==c?c:A.thresholds.exact},relationStyles:{noContent:e(e({},A.relationStyles.noContent),(null===(u=null==Q?void 0:Q.relationStyles)||void 0===u?void 0:u.noContent)||{}),high:e(e({},A.relationStyles.high),(null===(a=null==Q?void 0:Q.relationStyles)||void 0===a?void 0:a.high)||{}),exact:e(e({},A.relationStyles.exact),(null===(d=null==Q?void 0:Q.relationStyles)||void 0===d?void 0:d.exact)||{}),medium:e(e({},A.relationStyles.medium),(null===(s=null==Q?void 0:Q.relationStyles)||void 0===s?void 0:s.medium)||{}),low:e(e({},A.relationStyles.low),(null===(v=null==Q?void 0:Q.relationStyles)||void 0===v?void 0:v.low)||{})}}},[Q]),mt=c(function(){if($&&Object.keys($).length>0)try{var t=function(t,i,r){var o,l,c,u;void 0===i&&(i=!1),void 0===r&&(r=null);var a=t.nodes||t,d=[],s=[],v=t.base_root_id,p=t.input_index_map||{0:"left",1:"right"},f=t[v]||a[v];if(!f||!1===f.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[]};var h=function(n,i){var o,l,c,u=t[n]||a[n];if(!u||!1===u.display_node)return null;var d=_(u,i,p),s=!1!==(null===(o=d.attributes)||void 0===o?void 0:o.display_title),v=!1!==(null===(l=d.attributes)||void 0===l?void 0:l.display_content),f=!!d.title.trim(),g=!!d.content.trim(),x=T(u),m=(null===(c=null==r?void 0:r[n])||void 0===c?void 0:c.evaluation_result)||u.evaluation_result||null,y=[];u.next&&Object.values(u.next).forEach(function(e){var t=a[e];if(t&&!1!==t.display_node){var n=h(e,i);n&&y.push(n)}});var b=!(!f&&!g);return e(e({id:n,title:f?d.title:"",content:g?d.content:"",displayTitle:s,displayContent:v,subsections:y},b?x:{score:void 0,relation:"not_defined"}),{evaluationResult:m})};if(i){var g=function(i,o){var l,c,u,d,s,v,f,h,x,m,y,b,S,w,I,R,C,F,E,B,M;void 0===o&&(o=0);var k=[],A=[];if(!i)return{refSections:k,baseSections:A};var D={},H={},N=-1,O=-1;for(var W in i){var z=i[W],L=t[z]||a[z];if(L&&!1!==L.display_node){var j=T(L),P=(null===(l=null==r?void 0:r[z])||void 0===l?void 0:l.evaluation_result)||L.evaluation_result||null,Y=_(L,"1",p),K=_(L,"0",p),V=!1!==(null===(c=Y.attributes)||void 0===c?void 0:c.display_title)&&Y.title.trim()||!1!==(null===(u=Y.attributes)||void 0===u?void 0:u.display_content)&&Y.content.trim(),q=!1!==(null===(d=K.attributes)||void 0===d?void 0:d.display_title)&&K.title.trim()||!1!==(null===(s=K.attributes)||void 0===s?void 0:s.display_content)&&K.content.trim(),X=Number(null!==(f=null===(v=Y.attributes)||void 0===v?void 0:v.display_index)&&void 0!==f?f:N--),U=Number(null!==(x=null===(h=K.attributes)||void 0===h?void 0:h.display_index)&&void 0!==x?x:O--),G=D[X]||e(e({id:z,title:!1!==(null===(m=Y.attributes)||void 0===m?void 0:m.display_title)?Y.title:"",content:!1!==(null===(y=Y.attributes)||void 0===y?void 0:y.display_content)?Y.content:"",subsections:[]},V?j:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:X,evaluationResult:P,displayContent:null===(b=Y.attributes)||void 0===b?void 0:b.display_content,displayTitle:null===(S=Y.attributes)||void 0===S?void 0:S.display_title}),J=H[U]||e(e({id:z,title:!1!==(null===(w=K.attributes)||void 0===w?void 0:w.display_title)?K.title:"",content:!1!==(null===(I=K.attributes)||void 0===I?void 0:I.display_content)?K.content:"",subsections:[]},q?j:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:U,evaluationResult:P,displayContent:null===(R=K.attributes)||void 0===R?void 0:R.display_content,displayTitle:null===(C=K.attributes)||void 0===C?void 0:C.display_title});Number(X)>=0&&Number(U)>=0&&((null===(F=G.refIndexes)||void 0===F?void 0:F.includes(Number(U)))||null===(E=G.refIndexes)||void 0===E||E.push(Number(U)),(null===(B=J.refIndexes)||void 0===B?void 0:B.includes(Number(X)))||null===(M=J.refIndexes)||void 0===M||M.push(Number(X))),D[X]=G,H[U]=J;var $=g(L.next,o+1),Q=$.refSections,Z=$.baseSections;Q.length>0&&(G.subsections=n(n([],G.subsections||[],!0),Q,!0)),Z.length>0&&(J.subsections=n(n([],J.subsections||[],!0),Z,!0))}}return k=Object.values(D).map(function(e){return e}),A=Object.values(H).map(function(e){return e}),k.sort(function(e,t){return e.selfIndex<0&&t.selfIndex>=0?1:e.selfIndex>=0&&t.selfIndex<0?-1:e.selfIndex-t.selfIndex}),A.sort(function(e,t){return e.selfIndex<0&&t.selfIndex>=0?1:e.selfIndex>=0&&t.selfIndex<0?-1:e.selfIndex-t.selfIndex}),{refSections:k,baseSections:A}},x=g(f.next),m=x.refSections,y=x.baseSections;s=m,d=y}else f.next&&Object.values(f.next).forEach(function(e){var n=t[e]||a[e];n&&!1!==n.display_node&&(d.push(h(e,"0")||{id:e,title:"",content:"",subsections:[]}),s.push(h(e,"1")||{id:e,title:"",content:"",subsections:[]}))});return{activeProposed:{title:(null===(l=null===(o=f.comparison_inputs)||void 0===o?void 0:o[p[0]])||void 0===l?void 0:l.title)||"Uploaded Contract",description:f.decision_scope_description||"",sections:d},activeVariants:[{id:"tree-variant-1",title:(null===(u=null===(c=f.comparison_inputs)||void 0===c?void 0:c[p[1]])||void 0===u?void 0:u.title)||"Reference Template",similarity:0,sections:s,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:f.decision_scope_description||""},fields:{}}}}]}}($,ue,le);return e(e({},t),{parseError:null})}catch(e){return console.error("Data Transformation Error: ",e),{activeProposed:{},activeVariants:[],parseError:e instanceof Error?e.message:"Unknown Parsing Error"}}return{activeProposed:{},activeVariants:[],parseError:"Tree data is required"}},[JSON.stringify($),ue,JSON.stringify(le)]),yt=mt.activeProposed,bt=mt.activeVariants,St=mt.parseError;d(function(){St&&me("Failed to load comparison: ".concat(St))},[St]);var wt=u(null),It=wt[0];wt[1];var Rt=u({}),Ct=Rt[0],Ft=Rt[1],Et=u({}),Bt=Et[0],_t=Et[1],Tt=(null==bt?void 0:bt[0])||j,Mt=null===(O=null===(o=null==$?void 0:$.documents)||void 0===o?void 0:o[null===(F=null==$?void 0:$.input_index_map)||void 0===F?void 0:F[0]])||void 0===O?void 0:O.title,kt=null===(q=null===(K=null==$?void 0:$.documents)||void 0===K?void 0:K[null===(V=null==$?void 0:$.input_index_map)||void 0===V?void 0:V[1]])||void 0===q?void 0:q.title,At=E(Z||Mt||"Uploaded Contract"),Dt=E(ee||kt||"Reference Template"),Ht=c(function(){return(null==yt?void 0:yt.sections)||[]},[null==yt?void 0:yt.sections]),Nt=c(function(){return Tt.sections||[]},[Tt.sections]),Ot=Ht.length>0||Nt.length>0,Wt=Tt.analysis,zt=E(null===(U=null===(X=null==Wt?void 0:Wt.rule_difference_comparison)||void 0===X?void 0:X.summary)||void 0===U?void 0:U.overall_summary),Lt=!!zt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),jt=a({}),Pt=function(e){return jt.current[e]||(jt.current[e]=l.createRef()),jt.current[e]},Yt=s(function(){var e,t,n,i;Se(!1),je.current=!1;var r=Pe.current,o=Jt.current;if(null!==r){var l="string"==typeof r?null===(e=mn.current[r.split(W)[0]])||void 0===e?void 0:e.current:null===(t=pn.current[r])||void 0===t?void 0:t.current;l&&(l.style.paddingTop="0px")}if(null!==o){var c="string"==typeof o?null===(n=yn.current[o.split(W)[0]])||void 0===n?void 0:n.current:null===(i=fn.current[o])||void 0===i?void 0:i.current;c&&(c.style.paddingTop="0px")}ln(null),Pe.current=null,Jt.current=null,Re(!1),he(!1),ct.current&&(ct.current.style.height="0px"),ut.current&&(ut.current.style.height="0px"),at.current&&(at.current.style.height="0px"),dt.current&&(dt.current.style.height="0px")},[]),Kt=s(function(e,t,n,i,r,o){var l,c,u=E(t.id)||E(n.id)||"",a=(u?Ye[u]:null)||t.cognitiveData||n.cognitiveData||{section_id:u,decisioning:[],gap:[],relevance_score:0},d=null!==(c=null===(l=jt.current[i])||void 0===l?void 0:l.current)&&void 0!==c?c:null;return{open:!0,sectionTitle:t.title||"N/A",refSectionTitle:n.title||"NA",cognitiveData:a,anchorEl:e,sectionAnchorEl:d,badgeStyle:o||null,sectionIdx:i,docData:{documents:null==$?void 0:$.documents,input_index_map:null==$?void 0:$.input_index_map},deviationData:t.evaluationResult||n.evaluationResult||null,isOrphan:!!r}},[Ye,$]),Vt=s(function(e){ht(),qe(null),et(e)},[ht]),qt=function(e,t,n,i,r,o){e.stopPropagation(),nt.open&&nt.sectionIdx===r?ht():(ft(),it(Kt(e.currentTarget,t,i,r,n,o)))},Xt=s(function(){null!==nt.sectionIdx&&nt.anchorEl?Vt(e(e({},nt),{open:!0})):ht()},[nt,ht,Vt]),Ut=s(function(){var e=nt.sectionIdx,t=nt.isOrphan;ht(),null!==e&&(t?me("No counterpart exists to connect to."):(je.current&&Yt(),Me(function(t){return t.has(e)?new Set:new Set([e])})))},[nt.sectionIdx,ht,Yt]),Gt=a(null),Jt=a(null),$t=a(null),Qt=a(null),Zt=a(null),en=u([]),tn=en[0],nn=en[1],rn=u(null),on=rn[0],ln=rn[1];a(null);var cn=u(null),un=cn[0],an=cn[1],dn=c(function(){return xt.fields.filter(function(e){var t=e.key;return(!Ot||"description"!==t)&&(B(null==yt?void 0:yt[t])||B(Tt[t]))})},[yt,Tt,Ot,xt.fields]),sn=a({}),vn=a({}),pn=a({}),fn=a({}),hn=a({}),gn=a({}),xn=a({}),mn=a({}),yn=a({});dn.forEach(function(e){for(var t=e.key,n=0;n<Math.max(Ht.length,Nt.length);n+=1)pn.current[n]||(pn.current[n]=l.createRef()),fn.current[n]||(fn.current[n]=l.createRef()),hn.current[n]||(hn.current[n]=l.createRef()),gn.current[n]||(gn.current[n]=l.createRef()),xn.current[n]||(xn.current[n]=l.createRef());sn.current[t]||(sn.current[t]=l.createRef()),vn.current[t]||(vn.current[t]=l.createRef())});for(var bn=0;bn<Math.max(Ht.length,Nt.length);bn+=1)pn.current[bn]||(pn.current[bn]=l.createRef()),fn.current[bn]||(fn.current[bn]=l.createRef()),hn.current[bn]||(hn.current[bn]=l.createRef()),gn.current[bn]||(gn.current[bn]=l.createRef()),xn.current[bn]||(xn.current[bn]=l.createRef());d(function(){if(It){var e=xt.fields.find(function(e){return e.analysisKey===It||e.key===It});if(e){var t=sn.current[e.key]||vn.current[e.key];(null==t?void 0:t.current)&&setTimeout(function(){return t.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[It,xt.fields]);var Sn=s(function(e){var t,n,i,r,o,l,c,u,a,d=null===(t=null==Wt?void 0:Wt.rule_difference_comparison)||void 0===t?void 0:t.fields;if(!d||!d[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=d[e],v=(null==s?void 0:s.relation)||(null===(i=null===(n=null==s?void 0:s.highlights)||void 0===n?void 0:n.ruleA_spans)||void 0===i?void 0:i.length)||(null===(o=null===(r=null==s?void 0:s.highlights)||void 0===r?void 0:r.ruleB_spans)||void 0===o?void 0:o.length)||(null==s?void 0:s.mappings)&&s.mappings.length>0;if(s.mappings){var p=s.mappings[0]||{};return{score:s.score,relation:p.relation||"",highlightsA:(null===(l=p.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(c=p.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!v}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(u=s.highlights)||void 0===u?void 0:u.ruleA_spans)||[],highlightsB:(null===(a=s.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Wt]),wn=s(function(t){var n,i,r,o=Ht[t],l=Nt[t],c=(null==o?void 0:o.relation)&&"not_defined"!==o.relation,u=(null==l?void 0:l.relation)&&"not_defined"!==l.relation;E(null==o?void 0:o.id)||E(null==l?void 0:l.id);var a=!(!(null==o?void 0:o.cognitiveData)&&!(null==l?void 0:l.cognitiveData));if(!c&&!u&&!a)return e(e({},xt.relationStyles.noContent),{label:"Not Defined"});var d=null!==(i=null!==(n=null==o?void 0:o.evaluationResult)&&void 0!==n?n:null==l?void 0:l.evaluationResult)&&void 0!==i?i:null,s=null===(r=null==d?void 0:d.evaluation_outputs)||void 0===r?void 0:r.output_value;return e(e({},xt.relationStyles.low),null!=d?{label:null!=s?s:""}:{label:"N/A"})},[Ht,Nt,Ye,xt,Sn]),In=s(function(t){for(var n,i,r,o,l,c,u=t.split("-").map(Number),a=Ht[u[0]],d=Nt[u[0]],s=1;s<u.length;s++)(null==a?void 0:a.subsections)&&(a=a.subsections[u[s]]),(null==d?void 0:d.subsections)&&(d=d.subsections[u[s]]);if(!a&&!d)return null;var v=(null==a?void 0:a.relation)&&"not_defined"!==a.relation,p=(null==d?void 0:d.relation)&&"not_defined"!==d.relation,f=E(null==a?void 0:a.id)||E(null==d?void 0:d.id)||"",h=!(!(null==a?void 0:a.cognitiveData)&&!(null==d?void 0:d.cognitiveData));if(!v&&!p&&!h)return e(e({},xt.relationStyles.noContent),{label:"Not Defined"});null!==(i=null!==(n=null==a?void 0:a.cognitiveRelevanceScore)&&void 0!==n?n:null==d?void 0:d.cognitiveRelevanceScore)&&void 0!==i||f&&(null===(r=Ye[f])||void 0===r||r.relevance_score);var g=null!==(l=null!==(o=null==a?void 0:a.evaluationResult)&&void 0!==o?o:null==d?void 0:d.evaluationResult)&&void 0!==l?l:null,x=null===(c=null==g?void 0:g.evaluation_outputs)||void 0===c?void 0:c.output_value;return e(e({},xt.relationStyles.low),null!=g?{label:null!=x?x:""}:{label:"N/A"})},[Ht,Nt,Ye,xt]),Rn=s(function(){var e,t,n,i,r,o,l,c,u,a,d,s,v,p,f,h,g,x,m,y,b,S;if(!vt.current&&!Ne.current){vt.current=!0;try{if(!Gt.current)return;var w=function(e){var t=e.split("-"),n=t[0];if(!Ct[n]&&!1===ue)return!1;if(ue&&!Ct["left-".concat(n)]&&!Ct["right-".concat(n)]&&!Ct[n])return!1;for(var i=n,r=1;r<t.length-1;r++)if(i+="-".concat(t[r]),!Bt[i])return!1;return!0},I=Gt.current.getBoundingClientRect();Je({width:I.width,height:I.height});var R=[];if(dn.forEach(function(e){var t,n,i=e.key,r=null===(t=sn.current[i])||void 0===t?void 0:t.current,o=null===(n=vn.current[i])||void 0===n?void 0:n.current;r&&o&&(r.style.height="auto",o.style.height="auto",r.style.minHeight="0px",o.style.minHeight="0px")}),!Ne.current){for(var C=0;C<Math.max(Ht.length,Nt.length);C++){var F=null===(e=pn.current[C])||void 0===e?void 0:e.current,E=null===(t=fn.current[C])||void 0===t?void 0:t.current;F&&(F.style.height="auto",F.style.minHeight="0px"),E&&(E.style.height="auto",E.style.minHeight="0px")}ue||Object.keys(mn.current).forEach(function(e){var t,n;if(w(e)){var i=null===(t=mn.current[e])||void 0===t?void 0:t.current,r=null===(n=yn.current[e])||void 0===n?void 0:n.current;i&&r&&(i.style.height="auto",r.style.height="auto",i.style.minHeight="0px",r.style.minHeight="0px")}})}var B={};dn.forEach(function(e){var t,n,i=e.key,r=null===(t=sn.current[i])||void 0===t?void 0:t.current,o=null===(n=vn.current[i])||void 0===n?void 0:n.current;if(r&&o){var l=r.getBoundingClientRect(),c=o.getBoundingClientRect();B[i]=Math.max(l.height,c.height)}});var _={left:{},right:{}},T={};if(!Ne.current)if(ue){if(be&&null!==on)if("number"==typeof on){var M=on,k=Ht[M],A=null===(r=pn.current[M])||void 0===r?void 0:r.current;A&&k&&(k.refIndexes||[]).forEach(function(e){var t,n=Nt.findIndex(function(t){return t.selfIndex===e}),i=null===(t=fn.current[n])||void 0===t?void 0:t.current;if(i&&(Ct["left-".concat(M)]||Ct["right-".concat(n)])){var r=Math.max(A.getBoundingClientRect().height,i.getBoundingClientRect().height);_.left[M]=Math.max(_.left[M]||0,r),_.right[n]=Math.max(_.right[n]||0,r)}})}else{var D=on.split(W)[0];F=null===(o=mn.current[D])||void 0===o?void 0:o.current,E=null===(l=yn.current[D])||void 0===l?void 0:l.current;if(F&&E){H=Math.max(F.getBoundingClientRect().height,E.getBoundingClientRect().height);T[D]=Math.max(T[D]||0,H)}}}else{Object.keys(mn.current).forEach(function(e){var t,n;if(w(e)){var i=null===(t=mn.current[e])||void 0===t?void 0:t.current,r=null===(n=yn.current[e])||void 0===n?void 0:n.current;if(i&&r&&null!==i.offsetParent&&null!==r.offsetParent){var o=i.getBoundingClientRect(),l=r.getBoundingClientRect(),c=Math.max(o.height,l.height);T[e]=c,i.style.minHeight="".concat(c,"px"),r.style.minHeight="".concat(c,"px")}}});for(C=0;C<Math.min(Ht.length,Nt.length);C++){var F=null===(n=pn.current[C])||void 0===n?void 0:n.current,E=null===(i=fn.current[C])||void 0===i?void 0:i.current;if(F&&E){var H=Math.max(F.getBoundingClientRect().height,E.getBoundingClientRect().height);_.left[C]=H,_.right[C]=H}}}if(dn.forEach(function(e){var t,n,i=e.key,r=null===(t=sn.current[i])||void 0===t?void 0:t.current,o=null===(n=vn.current[i])||void 0===n?void 0:n.current;if(r&&o){var l=B[i];r.style.minHeight="".concat(l,"px"),o.style.minHeight="".concat(l,"px")}}),Ne.current||(Object.entries(_.left).forEach(function(e){var t,n=e[0],i=e[1],r=null===(t=pn.current[Number(n)])||void 0===t?void 0:t.current;r&&(r.style.minHeight="".concat(i,"px"))}),Object.entries(_.right).forEach(function(e){var t,n=e[0],i=e[1],r=null===(t=fn.current[Number(n)])||void 0===t?void 0:t.current;r&&(r.style.minHeight="".concat(i,"px"))}),ue||Object.keys(T).forEach(function(e){var t,n,i=null===(t=mn.current[e])||void 0===t?void 0:t.current,r=null===(n=yn.current[e])||void 0===n?void 0:n.current;if(i&&r&&T[e]){var o=T[e];i.style.minHeight="".concat(o,"px"),r.style.minHeight="".concat(o,"px")}})),ue)Ht.forEach(function(e,t){var n;(null===(n=pn.current[t])||void 0===n?void 0:n.current)&&(e.refIndexes||[]).forEach(function(e){var n,i,r,o,l,c,u,a,d,s,v=Nt.findIndex(function(t){return t.selfIndex===e});if(-1!==v){var p=null===(n=hn.current[t])||void 0===n?void 0:n.current,f=null===(i=gn.current[v])||void 0===i?void 0:i.current;if(p&&f){var h=p.getBoundingClientRect(),g=f.getBoundingClientRect(),x=h.right-I.left,m=g.left-I.left,y=h.top+h.height/2-I.top,b=g.top+g.height/2-I.top;if(be&&on===t){var S=null!==(o=null===(r=st.current)||void 0===r?void 0:r.getBoundingClientRect().top)&&void 0!==o?o:0,w=null!==(c=null===(l=lt.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==c?c:0,C=S+(null!==(a=null===(u=st.current)||void 0===u?void 0:u.clientHeight)&&void 0!==a?a:1/0),F=w+(null!==(s=null===(d=lt.current)||void 0===d?void 0:d.clientHeight)&&void 0!==s?s:1/0),E=h.top+h.height/2,B=function(e,t,n){return Math.max(t,Math.min(n,e))};y=B(E,S,C)-I.top,b=B(E,w,F)-I.top}var _=wn(t);_&&R.push({id:"line-".concat(t,"-").concat(v),x1:x,y1:y,x2:m,y2:b,style:_,sectionIdx:t,targetRightIdx:v})}}})});else for(C=0;C<Math.min(Ht.length,Nt.length);C++){var N=null===(c=pn.current[C])||void 0===c?void 0:c.current,O=null===(u=fn.current[C])||void 0===u?void 0:u.current;if(N&&O){var z=N.getBoundingClientRect(),j=O.getBoundingClientRect(),P=Math.max(z.top,j.top)+18-I.top,Y=(null===(a=Nt[C])||void 0===a?void 0:a.id)||"sec-".concat(C);(X=wn(C))&&R.push({id:Y,x1:z.right-I.left,y1:P,x2:j.left-I.left,y2:P,style:X,sectionIdx:C,hasCognitive:!!((null===(d=Ht[C])||void 0===d?void 0:d.cognitiveData)||(null===(s=Nt[C])||void 0===s?void 0:s.cognitiveData)||Y&&Ye[Y]),isSubSection:!1})}}if(be&&"string"==typeof on){var K=on,V=(D=K.split(W)[0],null===(v=hn.current[K])||void 0===v?void 0:v.current),q=null===(p=gn.current[K])||void 0===p?void 0:p.current;if(V&&q){var X,U=V.getBoundingClientRect(),G=q.getBoundingClientRect(),J=U.right-I.left,$=G.left-I.left,Q=U.top+U.height/2-I.top,Z=G.top+G.height/2-I.top;if(ue){var ee=null!==(h=null===(f=st.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==h?h:0,te=null!==(x=null===(g=lt.current)||void 0===g?void 0:g.getBoundingClientRect().top)&&void 0!==x?x:0,ne=ee+(null!==(y=null===(m=st.current)||void 0===m?void 0:m.clientHeight)&&void 0!==y?y:1/0),ie=te+(null!==(S=null===(b=lt.current)||void 0===b?void 0:b.clientHeight)&&void 0!==S?S:1/0),re=function(e,t,n){return Math.max(t,Math.min(n,e))};Q=re(U.top+U.height/2,ee,ne)-I.top,Z=re(G.top+G.height/2,te,ie)-I.top}(X=In(D))&&R.push({id:"line-subsec-".concat(K),x1:J,y1:Q,x2:$,y2:Z,style:X,sectionIdx:Number(D.split("-")[0]),isSubSection:!0,subSectionKeyPath:K})}}if(nn(R),Qt.current&&Zt.current){var oe=Qt.current.getBoundingClientRect(),le=Zt.current.getBoundingClientRect(),ce=(oe.top+oe.height/2-I.top+le.top+le.height/2-I.top)/2;an({x1:oe.right-I.left,x2:le.left-I.left,y:ce})}else an(null);if(Te.size>0){var ae=[],de=st.current,se=lt.current;if(de&&se){var ve=[],pe=de.getBoundingClientRect().top,fe=se.getBoundingClientRect().top,he=pe+de.clientHeight,ge=fe+se.clientHeight,xe=de.scrollTop,me=se.scrollTop,ye=I.top,Se=function(e,t,n){return Math.max(t,Math.min(n,e))};Te.forEach(function(e){var t,n,i,r,o;if("string"==typeof e){var l=e,c=l.split(W)[0],u=null===(t=hn.current[l])||void 0===t?void 0:t.current,a=null===(n=gn.current[l])||void 0===n?void 0:n.current;if(!u||!a)return;var d=u.getBoundingClientRect(),s=a.getBoundingClientRect(),v=In(c),p=(B=d.right-I.left)+.5*((_=s.left-I.left-0)-B),f=d.top+d.height/2,h=s.top+s.height/2,g=f-pe+xe,x=h-fe+me,m="conn-subsec-".concat(l);ve.push({lhsScrollY:g,rhsScrollY:x,x1:B,x2:_,containerTop:ye,leftIdx:l,rhsArrayIdx:l,styleColor:(null==v?void 0:v.badgeBorder)||"#6366F1",styleId:m});var y=Se(f,pe,he),b=Se(h,fe,ge),S=y-ye,w=b-ye,R=h>=fe-4&&h<=ge+4,C="";C=(T=f>=pe-4&&f<=he+4)&&R?L(B,S,_,w):T&&!R?"M ".concat(B,",").concat(S," L ").concat(p,",").concat(S," L ").concat(p,",").concat(w):!T&&R?"M ".concat(p,",").concat(S," L ").concat(p,",").concat(w," L ").concat(_,",").concat(w):"M ".concat(p,",").concat(S," L ").concat(p,",").concat(w),ae.push({id:m,pathD:C,style:v,leftIdx:l,rhsArrayIdx:l})}else if(ue){var F=Ht[e];if(!(null===(o=null==F?void 0:F.refIndexes)||void 0===o?void 0:o.length))return;F.refIndexes.forEach(function(t){var n,i,r=Nt.findIndex(function(e){return e.selfIndex===t});if(-1!==r){var o=null===(n=hn.current[e])||void 0===n?void 0:n.current,l=null===(i=gn.current[r])||void 0===i?void 0:i.current;if(o&&l){var c=o.getBoundingClientRect(),u=l.getBoundingClientRect(),a=wn(e),d=c.right-I.left,s=u.left-I.left-0,v=d+.5*(s-d),p=c.top+c.height/2,f=u.top+u.height/2,h=p-pe+xe,g=f-fe+me,x="conn-".concat(e,"-").concat(r);ve.push({lhsScrollY:h,rhsScrollY:g,x1:d,x2:s,containerTop:ye,leftIdx:e,rhsArrayIdx:r,styleColor:(null==a?void 0:a.badgeBorder)||"#6366F1",styleId:x});var m=Se(p,pe,he),y=Se(f,fe,ge),b=m-ye,S=y-ye,w=p>=pe-4&&p<=he+4,R=f>=fe-4&&f<=ge+4,C="";C=w&&R?L(d,b,s,S):w&&!R?"M ".concat(d,",").concat(b," L ").concat(v,",").concat(b," L ").concat(v,",").concat(S):!w&&R?"M ".concat(v,",").concat(b," L ").concat(v,",").concat(S," L ").concat(s,",").concat(S):"M ".concat(v,",").concat(b," L ").concat(v,",").concat(S),ae.push({id:x,pathD:C,style:a,leftIdx:e,rhsArrayIdx:r})}}})}else{var E=e;u=null===(i=hn.current[e])||void 0===i?void 0:i.current,a=null===(r=gn.current[E])||void 0===r?void 0:r.current;if(!u||!a)return;var B,_;d=u.getBoundingClientRect(),s=a.getBoundingClientRect(),v=wn(e),p=(B=d.right-I.left)+.5*((_=s.left-I.left-0)-B),f=d.top+d.height/2,h=s.top+s.height/2,g=f-pe+xe,x=h-fe+me,m="conn-".concat(e,"-").concat(E);ve.push({lhsScrollY:g,rhsScrollY:x,x1:B,x2:_,containerTop:ye,leftIdx:e,rhsArrayIdx:E,styleColor:(null==v?void 0:v.badgeBorder)||"#6366F1",styleId:m});var T;y=Se(f,pe,he),b=Se(h,fe,ge),S=y-ye,w=b-ye,R=h>=fe-4&&h<=ge+4,C="";C=(T=f>=pe-4&&f<=he+4)&&R?L(B,S,_,w):T&&!R?"M ".concat(B,",").concat(S," L ").concat(p,",").concat(S," L ").concat(p,",").concat(w):!T&&R?"M ".concat(p,",").concat(S," L ").concat(p,",").concat(w," L ").concat(_,",").concat(w):"M ".concat(p,",").concat(S," L ").concat(p,",").concat(w),ae.push({id:m,pathD:C,style:v,leftIdx:e,rhsArrayIdx:E})}}),ze.current=ve}De(ae)}else De([]),ze.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{vt.current=!1}}},[dn,Ht,Nt,Ye,xt,Sn,wn,ue,be,on,Te,Ct,Bt]),Cn=s(function(){var e,t,n,i,r,o,l,c,u,a,d,s,v,p,f=ze.current;if(f.length&&!Ne.current){var h=null!==(t=null===(e=st.current)||void 0===e?void 0:e.scrollTop)&&void 0!==t?t:0,g=null!==(i=null===(n=lt.current)||void 0===n?void 0:n.scrollTop)&&void 0!==i?i:0,x=null!==(o=null===(r=st.current)||void 0===r?void 0:r.clientHeight)&&void 0!==o?o:1/0,m=null!==(c=null===(l=lt.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,y=null!==(a=null===(u=st.current)||void 0===u?void 0:u.getBoundingClientRect().top)&&void 0!==a?a:0,b=null!==(s=null===(d=lt.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==s?s:0,S=y+x,w=b+m,I=null!==(p=null===(v=Gt.current)||void 0===v?void 0:v.getBoundingClientRect().top)&&void 0!==p?p:0,R=function(e,t,n){return Math.max(t,Math.min(n,e))};f.forEach(function(e){var t=e.lhsScrollY-h+y,n=e.rhsScrollY-g+b,i=We.current[e.styleId+"-stroke"],r=We.current[e.styleId+"-bg"];if(i||r){var o,l=R(t,y,S),c=R(n,b,w),u=l-I,a=c-I,d=t>=y-4&&t<=S+4,s=n>=b-4&&n<=w+4,v=e.x1+.5*(e.x2-e.x1);o=d&&s?L(e.x1,u,e.x2,a):d&&!s?"M ".concat(e.x1,",").concat(u," L ").concat(v,",").concat(u," L ").concat(v,",").concat(a):!d&&s?"M ".concat(v,",").concat(u," L ").concat(v,",").concat(a," L ").concat(e.x2,",").concat(a):"M ".concat(v,",").concat(u," L ").concat(v,",").concat(a),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",o)),r&&(r.setAttribute("visibility","visible"),r.setAttribute("d",o))}})}},[]),Fn=a(Rn);d(function(){Fn.current=Rn},[Rn]);var En=a(null),Bn=s(function(){null!==En.current&&clearTimeout(En.current),En.current=setTimeout(function(){Fn.current(),En.current=null},50)},[]),_n=s(function(e){var t,n,i,r,o,l,c,u;if(!Ce.current){if(ue||Bn(),je.current){var a=Pe.current,d=Jt.current,s=st.current,v=lt.current;if(null!==a&&null!==d&&s&&v){var p="string"==typeof a?null===(t=hn.current[a])||void 0===t?void 0:t.current:null===(n=jt.current[a])||void 0===n?void 0:n.current,f="string"==typeof d?null===(i=gn.current[d])||void 0===i?void 0:i.current:null===(r=xn.current[d])||void 0===r?void 0:r.current;if(p&&f){var h=p.getBoundingClientRect().top-s.getBoundingClientRect().top+s.scrollTop,g=f.getBoundingClientRect().top-v.getBoundingClientRect().top+v.scrollTop;if(e.currentTarget===s){var x=g-(h-s.scrollTop),m=v.scrollHeight-v.clientHeight,y=Math.max(0,Math.min(x,m));Math.abs(v.scrollTop-y)>1&&(v.scrollTop=y)}else if(e.currentTarget===v){var b=h-(g-v.scrollTop),S=s.scrollHeight-s.clientHeight,w=Math.max(0,Math.min(b,S));Math.abs(s.scrollTop-w)>1&&(s.scrollTop=w)}if($t.current){var I=null===(o=hn.current[a])||void 0===o?void 0:o.current,R=null===(l=gn.current[d])||void 0===l?void 0:l.current,C=null!==(u=null===(c=Gt.current)||void 0===c?void 0:c.getBoundingClientRect().top)&&void 0!==u?u:0,F=s.getBoundingClientRect().top,E=F+s.clientHeight,B=v.getBoundingClientRect().top,_=B+v.clientHeight,T=function(e,t,n){return Math.max(t,Math.min(n,e))};if(I&&R){var M=I.getBoundingClientRect(),k=R.getBoundingClientRect(),A=M.top+M.height/2,D=k.top+k.height/2,H=T(A,F,E),N=T(D,B,_);$t.current.setAttribute("y1",(H-C).toString()),$t.current.setAttribute("y2",(N-C).toString());var O=A>=F-4&&A<=E+4;$t.current.setAttribute("visibility",O?"visible":"hidden")}}}}}ze.current.length>0&&!Le.current&&(Le.current=!0,requestAnimationFrame(function(){Cn(),Le.current=!1}))}},[Cn,ue,Bn]);d(function(){var e=setTimeout(Bn,250);window.addEventListener("resize",Bn);var t=null,n=null;return rt.current&&(t=new ResizeObserver(Bn)).observe(rt.current),Gt.current&&(n=new ResizeObserver(Bn)).observe(Gt.current),function(){clearTimeout(e),window.removeEventListener("resize",Bn),null==t||t.disconnect(),null==n||n.disconnect()}},[yt,Tt,Wt,dn,Ct,Bt,Ht,Nt,xt,Bn,be,on,Ie,Te]),d(function(){je.current=be},[be]),d(function(){Pe.current=on},[on]);var Tn=s(function(){var e,t,n,i,r=nt.sectionIdx,o=nt.isOrphan;if(ht(),null!=r)if(o)me("No counterpart exists for this section.");else if(be&&on===r)Yt();else{if(!ue){var l=Pe.current,c=Jt.current;if(null!==l){var u="string"==typeof l?null===(e=mn.current[l.split(W)[0]])||void 0===e?void 0:e.current:null===(t=pn.current[l])||void 0===t?void 0:t.current;u&&(u.style.paddingTop="0px")}if(null!==c){var a="string"==typeof c?null===(n=yn.current[c.split(W)[0]])||void 0===n?void 0:n.current:null===(i=fn.current[c])||void 0===i?void 0:i.current;a&&(a.style.paddingTop="0px")}}Me(new Set),De([]),ze.current=[],he(!0),Ce.current=!0,ln(r),Pe.current=r,Se(!0),je.current=!0,Re(!1),ct.current&&(ct.current.style.height="0px"),ut.current&&(ut.current.style.height="0px"),at.current&&(at.current.style.height="0px"),dt.current&&(dt.current.style.height="0px"),requestAnimationFrame(function(){var e,t,n,i,o,l,c,u,a,d,s,v=null,p=null,f=null,h=null,g=null;if("string"==typeof r){v=(null===(e=hn.current[r])||void 0===e?void 0:e.current)||null,g=(p=(null===(t=gn.current[r])||void 0===t?void 0:t.current)||null)?r:null;var x=r.split(W)[0];f=(null===(n=mn.current[x])||void 0===n?void 0:n.current)||null,h=(null===(i=yn.current[x])||void 0===i?void 0:i.current)||null}else if(v=(null===(o=jt.current[r])||void 0===o?void 0:o.current)||null,f=(null===(l=pn.current[r])||void 0===l?void 0:l.current)||null,ue){var m=Ht[r],y=(null==m?void 0:m.refIndexes)||[];if(y.length>0){var b=y[0],S=Nt.findIndex(function(e){return e.selfIndex===b});-1!==S&&(p=(null===(a=xn.current[S])||void 0===a?void 0:a.current)||null,h=(null===(d=fn.current[S])||void 0===d?void 0:d.current)||null,g=S)}}else p=(null===(c=xn.current[r])||void 0===c?void 0:c.current)||null,h=(null===(u=fn.current[r])||void 0===u?void 0:u.current)||null,g=p?r:null;Jt.current=g;var w=st.current,I=lt.current;if(!v||!w)return Ce.current=!1,void he(!1);if(!p||!I)return Re(!0),Fn.current(),Ce.current=!1,void he(!1);if(!ue){var R=v.getBoundingClientRect(),C=p.getBoundingClientRect(),F=R.top-C.top;f&&h&&(f.style.paddingTop="0px",h.style.paddingTop="0px",F>0?h.style.paddingTop="".concat(F,"px"):F<0&&(f.style.paddingTop="".concat(Math.abs(F),"px")));var E=v?v.getBoundingClientRect().top:(null==f?void 0:f.getBoundingClientRect().top)||0;return null===(s=rt.current)||void 0===s||s.scrollTo({top:rt.current.scrollTop+E-150,behavior:"smooth"}),Re(!0),Fn.current(),Ce.current=!1,void he(!1)}var B=v.getBoundingClientRect().top-w.getBoundingClientRect().top+w.scrollTop,_=p.getBoundingClientRect().top-I.getBoundingClientRect().top+I.scrollTop-(B-w.scrollTop);_<0&&ct.current&&(ct.current.style.height="".concat(Math.abs(_),"px"));requestAnimationFrame(function(){var e,t=I.scrollHeight-I.clientHeight;if(_<0)e=0;else{if(_>t){var n=_-t;return ut.current&&(ut.current.style.height="".concat(n+150,"px")),void requestAnimationFrame(function(){Y(I,_,200,function(){Re(!0),Fn.current(),Ce.current=!1,he(!1)})})}e=_}Y(I,e,200,function(){Re(!0),Fn.current(),Ce.current=!1,he(!1)})})})}},[ht,nt.sectionIdx,be,on,Ht,Nt,Bn,Yt]),Mn=null!==nt.sectionIdx&&Te.has(nt.sectionIdx),kn=function(t){var n,o,c,u=t.section,a=t.idx,d=t.columnKey,s=t.colRef,f=t.mb,h=void 0===f?1:f,g=t.parentNodeId,x=void 0===g?"":g,w=ue?!!Ct["".concat(d,"-").concat(a)]:!!Ct[String(a)],R=(null===(n=u.displayTitle)||void 0===n||n)&&B(u.title),C=(null===(o=u.displayContent)||void 0===o||o)&&B(u.content),F=!R&&!C,_={current:1},T=u.title;R||(T=C?"No Title Found":"No Matching Section Found");var M,k=[];if(null===(c=u.evaluationResult)||void 0===c?void 0:c.deviations){var A=u.evaluationResult.deviations;for(var D in A){var H=A[D][x];H&&k.push(H)}}return i(v,e({ref:s,sx:{mb:h,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:r(y,e({disableGutters:!0,expanded:!F&&w,onChange:function(){return!F&&function(t,n){var i,r;Ne.current=!0,Oe.current&&clearTimeout(Oe.current),He.current&&(He.current.style.opacity="0");var o=null===(i=pn.current[t])||void 0===i?void 0:i.current,l=null===(r=fn.current[t])||void 0===r?void 0:r.current;o&&(o.style.minHeight="0px"),l&&(l.style.minHeight="0px"),Oe.current=setTimeout(function(){Ne.current=!1,Fn.current(),He.current&&(He.current.style.opacity="1")},650),Ft(function(i){var r=e({},i),o=ue?"".concat(n,"-").concat(t):String(t),l=!i[o];if(!l){var c=String(on||""),u=on===t||c.startsWith("".concat(t,"-")),a=!1;Te.forEach(function(e){(e===t||String(e).startsWith("".concat(t,"-")))&&(a=!0)}),(u||a)&&(Yt(),Me(new Set),De([]),ze.current=[])}if(!ue)return r[String(t)]=l,r;if(r[o]=l,"left"===n)((null==(d=Ht[t])?void 0:d.refIndexes)||[]).forEach(function(e){var t=Nt.findIndex(function(t){return t.selfIndex===e});-1!==t&&(r["right-".concat(t)]=l)});else{var d,s=null==(d=Nt[t])?void 0:d.selfIndex;Ht.forEach(function(e,t){var n;(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(s))&&(r["left-".concat(t)]=l)})}return r})}(a,d)},sx:{boxShadow:"none",border:F?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:F?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flexGrow:1,width:"100%",display:"flex",flexDirection:"column",minWidth:0,"&:before":{display:"none"}}},{children:[i(b,e({expandIcon:F?null:i(I,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:F?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:R&&i(m,e({title:T,placement:"top"},{children:i(p,e({component:"div",sx:{fontSize:"12px",color:F?"#94A3B8":"#19213D",fontWeight:F?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:(M=T,M?E(M).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,t){return e.startsWith("**")&&e.endsWith("**")?i("strong",{children:e.slice(2,-2)},t):i(l.Fragment,{children:e},t)}):null)}))}))})),!F&&r(S,e({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[C&&i(z,{content:u.content,sxStyles:$e,highlights:k,maintainRelativeOrder:ue}),(u.subsections||[]).map(function(e,t){return An({section:e,keyPath:"".concat(a,"-").concat(t),depth:0,columnKey:d,parentNodeId:x,devCounter:_})})]}))]}))}),"".concat(d,"-sec-").concat(a))},An=function(t){var n,o,c,u,a,d,s,f,h,g=t.section,x=t.keyPath,m=t.depth,w=void 0===m?0:m,R=t.columnKey,C=void 0===R?"left":R,F=t.parentNodeId,E=void 0===F?"":F,_=t.devCounter,T=void 0===_?{current:1}:_,M=(null===(n=g.displayTitle)||void 0===n||n)&&B(g.title),k=(null===(o=g.displayContent)||void 0===o||o)&&B(g.content),A=!M&&!k,D=M?g.title:k?"No Title Found":"No Matching Section Found",H=!!Bt[x];"left"!==C||mn.current[x]||(mn.current[x]=l.createRef()),"right"!==C||yn.current[x]||(yn.current[x]=l.createRef());var N,O="left"===C?mn.current[x]:yn.current[x],L=In(x),j=x.split("-").map(Number),P=Ht[j[0]];N=ue&&void 0!==(null==P?void 0:P.selfIndex)&&P.selfIndex>=0?P.selfIndex+1:j[0]+1;for(var Y=Ht[j[0]],K=Nt[j[0]],V=1;V<j.length;V++)(null==Y?void 0:Y.subsections)&&(Y=Y.subsections[j[V]]),(null==K?void 0:K.subsections)&&(K=K.subsections[j[V]]);var q=null===(c=null==$?void 0:$.input_index_map)||void 0===c?void 0:c[0],X=null===(u=null==$?void 0:$.input_index_map)||void 0===u?void 0:u[1],U="left"===C?X:q,G=ue?!(null===(a=g.refIndexes)||void 0===a?void 0:a.length)||void 0!==g.selfIndex&&g.selfIndex<0:"left"===C?!K:!Y,J=null!==(f=null===(s=null===(d=g.evaluationResult)||void 0===d?void 0:d.evaluation_outputs)||void 0===s?void 0:s.output_value)&&void 0!==f?f:null,Q=Object.entries((null===(h=g.evaluationResult)||void 0===h?void 0:h.deviations)||{}).map(function(e){var t=e[0],n=e[1],i=T.current++,r=n[E],o="No equivalent clause present."===r;if(o)r="";else if(!r)return null;var c=function(e,t){return"".concat(e).concat(W).concat(t)}(x,t),u=n[U],a=G||!u||"No equivalent clause present."===u,d="".concat(N,".").concat(i);return"left"!==C||hn.current[c]||(hn.current[c]=l.createRef()),"right"!==C||gn.current[c]||(gn.current[c]=l.createRef()),{id:c,label:d,highlight:r,side:C,style:L,score:J,isConnected:Te.has(c),isOrphan:a,isMissingClause:o,badgeRef:"left"===C?hn.current[c]:gn.current[c],onClick:function(e){e.stopPropagation(),qt(e,Y||{title:"",content:""},a,K||{title:"",content:""},c,L)}}}).filter(Boolean),Z=Q.some(function(e){return Te.has(e.id)});return M||k||g.subsections&&0!==g.subsections.length?i(v,M?e({ref:O,sx:{mt:1,width:"100%",minWidth:0,position:"relative"}},{children:i(v,e({sx:e({width:"100%"},Z&&L&&{borderRadius:"4px",outline:"2px solid ".concat(L.badgeBorder),outlineOffset:"1px"})},{children:r(y,e({disableGutters:!0,expanded:!A&&H,onChange:function(){if(!A){if(H){var t=String(on||"").startsWith(x);t||Te.forEach(function(e){String(e).startsWith(x)&&(t=!0)}),t&&(Yt(),Me(new Set),De([]),ze.current=[])}_t(function(t){var n;return e(e({},t),((n={})[x]=!t[x],n))})}},sx:{mt:0,boxShadow:"none",border:A?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF",minWidth:0,"&:before":{display:"none"}}},{children:[i(b,e({expandIcon:A?null:i(I,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"}}},{children:i(p,e({component:"div",sx:{fontSize:"11px",fontWeight:600,color:A?"#94A3B8":"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:D||"Untitled Subsection"}))})),!A&&r(S,e({sx:{pt:0,pb:1,minWidth:0}},{children:[k&&i(z,{content:g.content,sxStyles:$e,deviationBadges:Q,maintainRelativeOrder:ue}),(g.subsections||[]).map(function(e,t){return An({section:e,keyPath:"".concat(x,"-").concat(t),depth:w+1,columnKey:C,parentNodeId:E,devCounter:T})})]}))]}))}))}):e({ref:O,sx:{mt:0===w?1:.75,width:"100%",minWidth:0,position:"relative"}},{children:!A&&r(v,e({sx:e({width:"100%"},Z&&L&&{borderRadius:"4px",outline:"2px solid ".concat(L.badgeBorder),outlineOffset:"1px"})},{children:[k&&i(z,{content:g.content,sxStyles:$e,deviationBadges:Q,maintainRelativeOrder:ue}),(g.subsections||[]).map(function(e,t){return An({section:e,keyPath:"".concat(x,"-").concat(t),depth:w+1,columnKey:C,parentNodeId:E,devCounter:T})})]}))}),x):null};return r(v,e({ref:ot,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},ue?{}:{overflow:"visible"}),{position:"relative"})},{children:[se&&i(v,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:i(N,{})})),i(H,{open:nt.open,anchorEl:nt.anchorEl,sectionTitle:nt.sectionTitle,referenceSectionTitle:nt.refSectionTitle,onClose:ht,onOpenCognitiveCompare:Xt,onOpenSideBySide:Tn,onConnect:Ut,isConnected:Mn,isOrphan:nt.isOrphan}),Ze.open&&i(D,{open:Ze.open,popupRef:Xe,position:Ve,popupConfig:re,onClose:function(){qe(null),et(function(t){return e(e({},t),{open:!1})}),Be(null)},markdownStyles:te,sectionTitle:Ze.sectionTitle,referenceSectionTitle:Ze.refSectionTitle,cognitiveData:Ze.cognitiveData,anchorEl:Ze.anchorEl,sectionAnchorEl:Ze.sectionAnchorEl,scrollContainerEl:rt.current,badgeStyle:Ze.badgeStyle,docData:Ze.docData,deviationData:Ze.deviationData}),i(f,e({open:!!xe,autoHideDuration:8e3,onClose:function(){return me(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(h,e({onClose:function(){return me(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:xe}))})),(ie.isHeaderVisible||ie.isToggleVisible)&&r(v,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[i(v,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:ie.isHeaderVisible&&i(p,e({sx:{fontSize:"16px",fontWeight:600,color:"#0F172A"}},{children:J}))})),ie.isToggleVisible&&i(v,e({sx:{display:"flex",alignItems:"center"}},{children:i(g,{control:i(x,{checked:!ue,onChange:function(e){var t=e.target.checked;ve(!0),setTimeout(function(){ae(!t),Yt(),Me(new Set),De([]),ze.current=[],setTimeout(function(){ve(!1)},400)},50)},color:"primary",size:"small",sx:{width:100,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"3px",transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(75px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:"#5928ED",opacity:1,border:0,"&::before":{content:'"Side by Side"',position:"absolute",left:"13px",top:"50%",transform:"translateY(-50%)",fontSize:"9px",fontWeight:700,color:"#fff",letterSpacing:"0.3px"}}}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:20,height:20},"& .MuiSwitch-track":{borderRadius:13,backgroundColor:"#9e9e9e",opacity:1,position:"relative","&::after":{content:'"Side by Side"',position:"absolute",right:"13px",top:"50%",transform:"translateY(-50%)",fontSize:"9px",fontWeight:700,color:"#fff",letterSpacing:"0.3px",opacity:1,transition:"opacity 0.2s"}},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{"&::after":{opacity:0}}}}),label:"",labelPlacement:"start",sx:{m:0,gap:1}})}))]})),i(v,e({ref:rt,onScroll:_n,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:ue?"hidden":"auto",borderTop:zt&&Lt?"none":"1.5px solid #EEF0F4"}},{children:i(v,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},ue?{flex:1,minHeight:0}:{})},{children:r(v,e({ref:Gt,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"10px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},ue?{flex:1,overflow:"visible"}:{})},{children:[r("svg",e({ref:He,style:{position:"absolute",top:0,left:0,width:Ge.width||"100%",height:Ge.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",transition:"opacity 0.15s ease-in-out"}},{children:[un&&!be&&r("g",{children:[i("line",{x1:un.x1,y1:un.y,x2:Math.max(un.x1,(un.x1+un.x2)/2-70),y2:un.y,stroke:"#BBF7D0",strokeWidth:"1.5"}),i("line",{x1:Math.min(un.x2,(un.x1+un.x2)/2+70),y1:un.y,x2:un.x2,y2:un.y,stroke:"#BBF7D0",strokeWidth:"1.5"})]}),tn.map(function(t){var n,o=t.x1+.5*(t.x2-t.x1),l=(t.y1+t.y2)/2;if("Not Defined"===t.style.label&&!t.hasCognitive)return null;var c=!1;if(t.isSubSection)c=be&&on===t.subSectionKeyPath&&Ie;else{var u=Ht[t.sectionIdx];(ue?!(null===(n=null==u?void 0:u.refIndexes)||void 0===n?void 0:n.length)||(null==u?void 0:u.selfIndex)<0:!Nt[t.sectionIdx])||(c=be&&on===t.sectionIdx&&Ie)}if(c)return r("g",e({style:{transition:"opacity 0.2s"}},{children:[i("defs",{children:i("marker",e({id:"arr-".concat(t.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:i("polygon",{points:"0 0, 7 2.5, 0 5",fill:t.style.badgeBorder||"#6366F1"})}))}),i("line",{ref:$t,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(t.id,")")})]}),t.id);if(!ue){var a=t.isSubSection?L(t.x1,t.y1,t.x2,t.y2):"M ".concat(t.x1," ").concat(t.y1," L ").concat(t.x2," ").concat(t.y2);return r("g",{children:[i("path",{d:a,fill:"none",stroke:t.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i("foreignObject",e({x:o-100,y:l-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(v,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:r(v,e({onClick:function(e){if(e.stopPropagation(),Ze.open&&Ee===t.id)ft();else{var n=Ht[t.sectionIdx]||{title:"",content:""},i=Nt[t.sectionIdx]||{title:"",content:""};if(t.isSubSection&&t.subSectionKeyPath){for(var r=t.subSectionKeyPath.split("-").map(Number),o=Ht[r[0]],l=Nt[r[0]],c=1;c<r.length;c++)(null==o?void 0:o.subsections)&&(o=o.subsections[r[c]]),(null==l?void 0:l.subsections)&&(l=l.subsections[r[c]]);o&&(n=o),l&&(i=l)}Be(t.id),Vt(Kt(e.currentTarget,n,i,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:"pointer"}},{children:[0===t.style.label?"Same":t.style.label,i(v,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(R,{})})),i(I,{size:11,style:{transform:Ze.open&&Ee===t.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},t.id)}return null}),Ae.map(function(t){var n,o=t.pathD,l=(null===(n=t.style)||void 0===n?void 0:n.badgeBorder)||"#6366F1",c="conn-marker-".concat(t.id),u="".concat(t.id,"-bg"),a="".concat(t.id,"-stroke");return r("g",{children:[i("defs",{children:i("clipPath",e({id:"connections-clip"},{children:i("marker",e({id:c,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:i("polygon",{points:"0 0, 8 3, 0 6",fill:l})}))}))}),i("path",{ref:function(e){We.current[u]=e},d:o,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),i("path",{ref:function(e){We.current[a]=e},d:o,fill:"none",stroke:l,strokeWidth:"1.75",markerEnd:"url(#".concat(c,")")})]},t.id)})]})),r(v,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},ue?{flex:1,overflow:"visible"}:{})},{children:[i(v,e({ref:Qt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"40px",alignItems:"center",overflowX:"hidden"}},{children:i(m,e({title:At,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",textOverflow:"ellipsis",whiteSpace:"normal",width:"100%",height:"40px"}},{children:At}))}))})),r(v,e({ref:st,onScroll:_n,sx:e({p:"12px",display:"flex",flexDirection:"column"},ue?{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:at,style:{width:"100%",height:"0px",flexShrink:0}}),Ot&&Ht.map(function(t,n){var o,c,u=!t.title&&!t.content;if(ue&&u)return null;var a=t,d=wn(n),s=ue?!(null===(o=a.refIndexes)||void 0===o?void 0:o.length)||a.selfIndex<0:!Nt[n],p=ue?"number"==typeof a.selfIndex&&a.selfIndex>=0?a.selfIndex+1:null:n+1,f=Te.has(n),h=function(e,t){var n,i,r,o,l,c;if(!e)return t;var u=null!==(c=null!==(o=null!==(i=null===(n=e.evaluation_output)||void 0===n?void 0:n.output_score)&&void 0!==i?i:null===(r=e.evaluation_outputs)||void 0===r?void 0:r.output_score)&&void 0!==o?o:null===(l=e.evaluation_outputs)||void 0===l?void 0:l.output_value)&&void 0!==c?c:e.output_score;return null!=u?u:t}(a.evaluationResult,null==d?void 0:d.deviationLabel);return i(v,e({ref:Pt(n),sx:{mb:1,width:"100%"}},{children:r(v,e({sx:{position:"relative",width:"100%"}},{children:[i(v,e({ref:pn.current[n],sx:e({width:"100%",display:"flex"},f&&{borderRadius:"6px",outline:"2px solid ".concat((null==d?void 0:d.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:kn({section:t,idx:n,columnKey:"left",colRef:l.createRef(),mb:0,parentNodeId:(null===(c=null==$?void 0:$.input_index_map)||void 0===c?void 0:c[0])||""})})),ue&&d&&r(v,e({ref:hn.current[n],onClick:function(e){var i=ue?Nt.find(function(e){var t;return null===(t=a.refIndexes)||void 0===t?void 0:t.includes(e.selfIndex)})||{title:"",content:""}:Nt[n]||{title:"",content:""};qt(e,t,s,i,n,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!==p&&i(v,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(d.badgeBorder)}},{children:p})),i(v,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:s?"No Deviation Found":"N/A"===h||"NA"===h?"N/A":0==h||null==h?"Same":"".concat(h)})),i(w,{size:11,color:d.badgeText})]}))]}))}),"left-row-".concat(n))}),i("div",{ref:dt,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(v,e({sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0}},{children:i(v,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:r(v,e({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",borderRadius:"20px",bgcolor:"#ECFDF3",border:"1px solid #A7F3D0",color:"#15803D",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1}},{children:[i(v,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(R,{})})),0,"% Similarity",i(I,{size:11})]}))}))})),r(v,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},ue?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[fe&&i(C,{sections:11}),i(v,e({ref:Zt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:i(m,e({title:Dt,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",display:"flex",justifyContent:"center",alignItems:"center",textOverflow:"ellipsis",whiteSpace:"normal",width:"100%",height:"40px"}},{children:Dt}))}))})),r(v,e({ref:lt,onScroll:_n,sx:e({p:"12px",display:"flex",flexDirection:"column"},ue?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-25px",pl:"45px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:ct,style:{width:"100%",height:"0px",flexShrink:0}}),Ot&&Nt.map(function(t,n){var o,c=t,u=[],a=!1,d=null;if(ue){u=Ht.filter(function(e){var t;return(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(c.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1});var s=Ht.findIndex(function(e,t){var n;return Te.has(t)&&(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(c.selfIndex))});(a=-1!==s)&&(d=wn(s))}else u=[n+1],(a=Te.has(n))&&(d=wn(n));return i(v,e({ref:xn.current[n],sx:{mb:1,width:"100%"}},{children:r(v,e({sx:{position:"relative",width:"100%"}},{children:[i(v,e({ref:fn.current[n],sx:e({width:"100%",display:"flex"},a&&d&&{borderRadius:"6px",outline:"2px solid ".concat(d.badgeBorder),outlineOffset:"1px"})},{children:kn({section:t,idx:n,columnKey:"right",colRef:l.createRef(),mb:0,parentNodeId:(null===(o=null==$?void 0:$.input_index_map)||void 0===o?void 0:o[1])||""})})),ue&&!fe&&i(v,e({ref:gn.current[n],sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:"#EEF2FF",color:"#3730A3",border:"1px solid #C7D2FE",borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:u.length>0?u.join(", "):"-"}))]}))}),"right-row-".concat(n))}),i("div",{ref:ut,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{K as default};
|
|
1
|
+
import{__assign as e,__rest as t,__spreadArray as n}from"tslib";import{jsx as i,jsxs as r,Fragment as o}from"react/jsx-runtime";import l,{useMemo as c,useState as u,useRef as a,useEffect as d,useCallback as s}from"react";import{Box as v,Typography as p,Snackbar as f,Alert as h,FormControlLabel as g,Switch as x,Tooltip as m,Accordion as y,AccordionSummary as b,AccordionDetails as S}from"@mui/material";import{EllipsisVertical as w,ChevronDown as I}from"lucide-react";import{ButtonCognitiveIcon as R}from"../../assests/svg/ButtonCognitiveIcon.js";import C from"./OverlayComponent.js";import F from"react-markdown";import{safeStringify as E,hasValue as B,getSideData as _,getRationale as T}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as M,DEFAULT_FIELD_CONFIG as k,DEFAULT_COMPARISON_CONFIG as A}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import D from"./CognitivePopup.js";import H from"./MoreFunctionsPopup.js";import O from"./LoaderComponent.js";import W from"rehype-raw";var N="::",z=l.memo(function(n){var l=n.content,u=n.sxStyles,a=n.deviationBadges,d=void 0===a?[]:a,s=n.highlights,f=void 0===s?[]:s,h=n.maintainRelativeOrder,g=void 0===h||h,x=c(function(){return d.reduce(function(t,n){var i;return e(e({},t),((i={})[n.id]=n,i))},{})},[d]),m=c(function(){return{mark:function(t){var n=t.children;return i("span",e({style:{backgroundColor:"#fccccc",borderRadius:"2px"}},{children:n}))},span:function(n){var l,c,u,a,d,s=n.children,p=t(n,["children"]),f=p["data-badge-id"];if(!f)return i("span",e({},p,{children:s}));var h=x[f];return h?r(v,e({component:"span",sx:{position:"static",display:"inline"}},{children:[s,i(v,e({ref:h.badgeRef,onClick:h.onClick,sx:e(e({position:"absolute",zIndex:30,display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"10px",bgcolor:(null===(l=h.style)||void 0===l?void 0:l.badgeBg)||"#EEF2FF",color:(null===(c=h.style)||void 0===c?void 0:c.badgeText)||"#3730A3",border:"1px solid ".concat((null===(u=h.style)||void 0===u?void 0:u.badgeBorder)||"#C7D2FE"),borderRadius:"12px",px:1,py:.3,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)"},"left"===h.side?{right:"-16px",transform:"translateY(-20%) translateX(calc(100% + 8px))"}:{left:"-16px",transform:"translateY(-20%) translateX(calc(-100% - 8px))"}),h.isConnected&&h.style&&{outline:"2px solid ".concat(h.style.badgeBorder),outlineOffset:"1px"})},{children:r(o,{children:[i(v,e({component:"span",sx:e({fontSize:"10px",fontWeight:700},"left"===h.side?{pr:.5,borderRight:"1px solid ".concat((null===(a=h.style)||void 0===a?void 0:a.badgeBorder)||"#C7D2FE")}:{})},{children:h.label})),"left"===h.side&&r(o,{children:[i(v,e({component:"span",sx:{fontSize:"10px",px:.25}},{children:null!=h.score&&"N/A"!==h.score&&"NA"!==h.score&&0!==h.score?"".concat(h.score):h.isOrphan?"No Deviation Found":"N/A"===h.score||"NA"===h.score?"N/A":"Same"})),i(w,{size:10,color:(null===(d=h.style)||void 0===d?void 0:d.badgeText)||"#3730A3"})]})]})}))]})):i("span",e({},p,{children:s}))}}},[x,g]),y=c(function(){var e=l||"",t=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};return d.forEach(function(n){if(n.highlight){var i=n.highlight.replace(/\\(['’])/g,"$1");e=e.replace(new RegExp(t(i),"g"),'<span data-badge-id="'.concat(n.id,'"><mark>').concat(i,"</mark></span>"))}}),f.forEach(function(n){n&&(e=e.replace(new RegExp(t(n),"g"),"<mark>".concat(n,"</mark>")))}),e},[l,d,f]);return i(p,e({component:"div",sx:e(e({},u),{position:"relative",overflow:"visible","& p, & li, & ul, & ol":{position:"static",overflow:"visible"}})},{children:i(F,e({components:m,rehypePlugins:[W]},{children:E(y).replace(/\\n/g,"\n")}))}))},function(e,t){if(e.content!==t.content)return!1;if(e.sxStyles!==t.sxStyles)return!1;if(e.maintainRelativeOrder!==t.maintainRelativeOrder)return!1;var n=e.highlights||[],i=t.highlights||[];if(n.length!==i.length)return!1;for(var r=0;r<n.length;r++)if(n[r]!==i[r])return!1;return!0}),L=function(e,t,n,i,r){void 0===r&&(r=14);var o=e+.5*(n-e),l=i-t;if(Math.abs(l)<3)return"M ".concat(e," ").concat(t," H ").concat(n);var c=l>0?1:-1,u=Math.min(r,Math.abs(l)/2,Math.abs(o-e)/2,Math.abs(n-o)/2);return["M ".concat(e," ").concat(t),"H ".concat(o-u),"Q ".concat(o," ").concat(t," ").concat(o," ").concat(t+c*u),"V ".concat(i-c*u),"Q ".concat(o," ").concat(i," ").concat(o+u," ").concat(i),"H ".concat(n)].join(" ")},j={id:"",title:""},P={open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,isOrphan:!1,docData:null,deviationData:null},Y=function(e,t,n,i,r){void 0===n&&(n=300);var o=e.style.scrollBehavior;e.style.scrollBehavior="auto";var l=e.scrollTop,c=t-l,u=null,a=function(d){null===u&&(u=d);var s,v=d-u;v<n?(e.scrollTop=(s=v,s/=n,c*(--s*s*s+1)+l),r&&r(),requestAnimationFrame(a)):(e.scrollTop=t,e.style.scrollBehavior=o,r&&r(),i&&i())};requestAnimationFrame(a)},K=function(t){var o,F,W,K,V,q,X,U,G=t.componentHeaderText,J=void 0===G?"Contract Comparison":G,$=t.treeData,Q=t.comparisonConfig,Z=t.leftColumnTitleText,ee=t.rightColumnTitleText,te=t.markdownStyles,ne=t.displayConfig,ie=void 0===ne?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1}:ne,re=t.popupConfig,oe=t.deviationData,le=void 0===oe?{}:oe,ce=u(ie.maintainRelativeOrder),ue=ce[0],ae=ce[1],de=u(!1),se=de[0],ve=de[1],pe=u(!1),fe=pe[0],he=pe[1],ge=u(null),xe=ge[0],me=ge[1],ye=u(!1),be=ye[0],Se=ye[1],we=u(!1),Ie=we[0],Re=we[1],Ce=a(!1),Fe=u(null),Ee=Fe[0],Be=Fe[1],_e=u(new Set),Te=_e[0],Me=_e[1],ke=u([]),Ae=ke[0],De=ke[1],He=a(null),Oe=a(!1),We=a(null),Ne=a({}),ze=a([]),Le=a(!1),je=a(!1),Pe=a(null),Ye=c(function(){return(null==$?void 0:$.cognitive_decisioning)||{}},[$]),Ke=u(null),Ve=Ke[0],qe=Ke[1],Xe=a(null),Ue=u({width:0,height:0}),Ge=Ue[0],Je=Ue[1],$e=c(function(){return e(e({},M),te)},[te]),Qe=u({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,isOrphan:!1,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null,deviationData:null}),Ze=Qe[0],et=Qe[1],tt=u({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,isOrphan:!1,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null,deviationData:null}),nt=tt[0],it=tt[1],rt=a(null),ot=a(null),lt=a(null),ct=a(null),ut=a(null),at=a(null),dt=a(null),st=a(null),vt=a(!1),pt=a(null);d(function(){pt.current=null},[Ze.sectionIdx,Ze.open]);var ft=s(function(){qe(null),et(P),Be(null)},[]),ht=s(function(){it(P)},[]),gt=s(function(){var e;if(Ze.anchorEl&&Ze.refSectionTitle){var t=Ze.anchorEl.getBoundingClientRect(),n=(null===(e=null==Xe?void 0:Xe.current)||void 0===e?void 0:e.offsetHeight)||0,i=Math.min(680,window.innerWidth-24),r=window.innerHeight-t.bottom-12-12,o=t.top-12-12,l=r<n&&o>r;null!==pt.current?!0===pt.current&&(l=o>=n||o>=r):l=!(r>=n||r>=o),pt.current=l;var c=l?o:r,u=Math.min(n||9999,c),a=l?t.top-12-u:t.bottom+12,d=t.left+t.width/2,s=d-i/2,v=Math.max(12,Math.min(s,window.innerWidth-i-12)),p=Math.max(14,Math.min(d-v,i-10-4));qe({top:a,left:v,arrowLeft:p,openAbove:l,maxHeight:c})}},[Ze.anchorEl,Ze.refSectionTitle]);d(function(){if(Ze.open){window.addEventListener("resize",gt);var e=requestAnimationFrame(gt),t=null;return Xe.current&&(t=new ResizeObserver(function(){cancelAnimationFrame(e),e=requestAnimationFrame(gt)})).observe(Xe.current),function(){cancelAnimationFrame(e),window.removeEventListener("resize",gt),t&&t.disconnect()}}},[Ze.open,gt]),d(function(){var e=rt.current;if(e&&Ze.open){var t=function(e){Xe.current&&Xe.current.contains(e.target)||(qe(null),ft())};return e.addEventListener("scroll",t,{capture:!0}),window.addEventListener("scroll",t,{capture:!0}),function(){e.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("scroll",t,{capture:!0})}}},[Ze.open,ft]),d(function(){var e=rt.current;if(e&&nt.open){var t=function(){ht()};return e.addEventListener("scroll",t,{capture:!0}),window.addEventListener("scroll",t,{capture:!0}),function(){e.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("scroll",t,{capture:!0})}}},[nt.open,ht]);var xt=c(function(){var t,n,i,r,o,l,c,u,a,d,s,v;return{fields:null!==(t=null==Q?void 0:Q.fields)&&void 0!==t?t:k,thresholds:{high:null!==(i=null===(n=null==Q?void 0:Q.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:A.thresholds.high,medium:null!==(o=null===(r=null==Q?void 0:Q.thresholds)||void 0===r?void 0:r.medium)&&void 0!==o?o:A.thresholds.medium,exact:null!==(c=null===(l=null==Q?void 0:Q.thresholds)||void 0===l?void 0:l.exact)&&void 0!==c?c:A.thresholds.exact},relationStyles:{noContent:e(e({},A.relationStyles.noContent),(null===(u=null==Q?void 0:Q.relationStyles)||void 0===u?void 0:u.noContent)||{}),high:e(e({},A.relationStyles.high),(null===(a=null==Q?void 0:Q.relationStyles)||void 0===a?void 0:a.high)||{}),exact:e(e({},A.relationStyles.exact),(null===(d=null==Q?void 0:Q.relationStyles)||void 0===d?void 0:d.exact)||{}),medium:e(e({},A.relationStyles.medium),(null===(s=null==Q?void 0:Q.relationStyles)||void 0===s?void 0:s.medium)||{}),low:e(e({},A.relationStyles.low),(null===(v=null==Q?void 0:Q.relationStyles)||void 0===v?void 0:v.low)||{})}}},[Q]),mt=c(function(){if($&&Object.keys($).length>0)try{var t=function(t,i,r){var o,l,c,u;void 0===i&&(i=!1),void 0===r&&(r=null);var a=t.nodes||t,d=[],s=[],v=t.base_root_id,p=t.input_index_map||{0:"left",1:"right"},f=t[v]||a[v];if(!f||!1===f.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[]};var h=function(n,i){var o,l,c,u=t[n]||a[n];if(!u||!1===u.display_node)return null;var d=_(u,i,p),s=!1!==(null===(o=d.attributes)||void 0===o?void 0:o.display_title),v=!1!==(null===(l=d.attributes)||void 0===l?void 0:l.display_content),f=!!d.title.trim(),g=!!d.content.trim(),x=T(u),m=(null===(c=null==r?void 0:r[n])||void 0===c?void 0:c.evaluation_result)||u.evaluation_result||null,y=[];u.next&&Object.values(u.next).forEach(function(e){var t=a[e];if(t&&!1!==t.display_node){var n=h(e,i);n&&y.push(n)}});var b=!(!f&&!g);return e(e({id:n,title:f?d.title:"",content:g?d.content:"",displayTitle:s,displayContent:v,subsections:y},b?x:{score:void 0,relation:"not_defined"}),{evaluationResult:m})};if(i){var g=function(i,o){var l,c,u,d,s,v,f,h,x,m,y,b,S,w,I,R,C,F,E,B,M;void 0===o&&(o=0);var k=[],A=[];if(!i)return{refSections:k,baseSections:A};var D={},H={},O=-1,W=-1;for(var N in i){var z=i[N],L=t[z]||a[z];if(L&&!1!==L.display_node){var j=T(L),P=(null===(l=null==r?void 0:r[z])||void 0===l?void 0:l.evaluation_result)||L.evaluation_result||null,Y=_(L,"1",p),K=_(L,"0",p),V=!1!==(null===(c=Y.attributes)||void 0===c?void 0:c.display_title)&&Y.title.trim()||!1!==(null===(u=Y.attributes)||void 0===u?void 0:u.display_content)&&Y.content.trim(),q=!1!==(null===(d=K.attributes)||void 0===d?void 0:d.display_title)&&K.title.trim()||!1!==(null===(s=K.attributes)||void 0===s?void 0:s.display_content)&&K.content.trim(),X=Number(null!==(f=null===(v=Y.attributes)||void 0===v?void 0:v.display_index)&&void 0!==f?f:O--),U=Number(null!==(x=null===(h=K.attributes)||void 0===h?void 0:h.display_index)&&void 0!==x?x:W--),G=D[X]||e(e({id:z,title:!1!==(null===(m=Y.attributes)||void 0===m?void 0:m.display_title)?Y.title:"",content:!1!==(null===(y=Y.attributes)||void 0===y?void 0:y.display_content)?Y.content:"",subsections:[]},V?j:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:X,evaluationResult:P,displayContent:null===(b=Y.attributes)||void 0===b?void 0:b.display_content,displayTitle:null===(S=Y.attributes)||void 0===S?void 0:S.display_title}),J=H[U]||e(e({id:z,title:!1!==(null===(w=K.attributes)||void 0===w?void 0:w.display_title)?K.title:"",content:!1!==(null===(I=K.attributes)||void 0===I?void 0:I.display_content)?K.content:"",subsections:[]},q?j:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:U,evaluationResult:P,displayContent:null===(R=K.attributes)||void 0===R?void 0:R.display_content,displayTitle:null===(C=K.attributes)||void 0===C?void 0:C.display_title});Number(X)>=0&&Number(U)>=0&&((null===(F=G.refIndexes)||void 0===F?void 0:F.includes(Number(U)))||null===(E=G.refIndexes)||void 0===E||E.push(Number(U)),(null===(B=J.refIndexes)||void 0===B?void 0:B.includes(Number(X)))||null===(M=J.refIndexes)||void 0===M||M.push(Number(X))),D[X]=G,H[U]=J;var $=g(L.next,o+1),Q=$.refSections,Z=$.baseSections;Q.length>0&&(G.subsections=n(n([],G.subsections||[],!0),Q,!0)),Z.length>0&&(J.subsections=n(n([],J.subsections||[],!0),Z,!0))}}return k=Object.values(D).map(function(e){return e}),A=Object.values(H).map(function(e){return e}),k.sort(function(e,t){return e.selfIndex<0&&t.selfIndex>=0?1:e.selfIndex>=0&&t.selfIndex<0?-1:e.selfIndex-t.selfIndex}),A.sort(function(e,t){return e.selfIndex<0&&t.selfIndex>=0?1:e.selfIndex>=0&&t.selfIndex<0?-1:e.selfIndex-t.selfIndex}),{refSections:k,baseSections:A}},x=g(f.next),m=x.refSections,y=x.baseSections;s=m,d=y}else f.next&&Object.values(f.next).forEach(function(e){var n=t[e]||a[e];n&&!1!==n.display_node&&(d.push(h(e,"0")||{id:e,title:"",content:"",subsections:[]}),s.push(h(e,"1")||{id:e,title:"",content:"",subsections:[]}))});return{activeProposed:{title:(null===(l=null===(o=f.comparison_inputs)||void 0===o?void 0:o[p[0]])||void 0===l?void 0:l.title)||"Uploaded Contract",description:f.decision_scope_description||"",sections:d},activeVariants:[{id:"tree-variant-1",title:(null===(u=null===(c=f.comparison_inputs)||void 0===c?void 0:c[p[1]])||void 0===u?void 0:u.title)||"Reference Template",similarity:0,sections:s,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:f.decision_scope_description||""},fields:{}}}}]}}($,ue,le);return e(e({},t),{parseError:null})}catch(e){return console.error("Data Transformation Error: ",e),{activeProposed:{},activeVariants:[],parseError:e instanceof Error?e.message:"Unknown Parsing Error"}}return{activeProposed:{},activeVariants:[],parseError:"Tree data is required"}},[JSON.stringify($),ue,JSON.stringify(le)]),yt=mt.activeProposed,bt=mt.activeVariants,St=mt.parseError;d(function(){St&&me("Failed to load comparison: ".concat(St))},[St]);var wt=u(null),It=wt[0];wt[1];var Rt=u({}),Ct=Rt[0],Ft=Rt[1],Et=u({}),Bt=Et[0],_t=Et[1],Tt=(null==bt?void 0:bt[0])||j,Mt=null===(W=null===(o=null==$?void 0:$.documents)||void 0===o?void 0:o[null===(F=null==$?void 0:$.input_index_map)||void 0===F?void 0:F[0]])||void 0===W?void 0:W.title,kt=null===(q=null===(K=null==$?void 0:$.documents)||void 0===K?void 0:K[null===(V=null==$?void 0:$.input_index_map)||void 0===V?void 0:V[1]])||void 0===q?void 0:q.title,At=E(Z||Mt||"Uploaded Contract"),Dt=E(ee||kt||"Reference Template"),Ht=c(function(){return(null==yt?void 0:yt.sections)||[]},[null==yt?void 0:yt.sections]),Ot=c(function(){return Tt.sections||[]},[Tt.sections]),Wt=Ht.length>0||Ot.length>0,Nt=Tt.analysis,zt=E(null===(U=null===(X=null==Nt?void 0:Nt.rule_difference_comparison)||void 0===X?void 0:X.summary)||void 0===U?void 0:U.overall_summary),Lt=!!zt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),jt=a({}),Pt=function(e){return jt.current[e]||(jt.current[e]=l.createRef()),jt.current[e]},Yt=s(function(){var e,t,n,i;Se(!1),je.current=!1;var r=Pe.current,o=Jt.current;if(null!==r){var l="string"==typeof r?null===(e=mn.current[r.split(N)[0]])||void 0===e?void 0:e.current:null===(t=pn.current[r])||void 0===t?void 0:t.current;l&&(l.style.paddingTop="0px")}if(null!==o){var c="string"==typeof o?null===(n=yn.current[o.split(N)[0]])||void 0===n?void 0:n.current:null===(i=fn.current[o])||void 0===i?void 0:i.current;c&&(c.style.paddingTop="0px")}ln(null),Pe.current=null,Jt.current=null,Re(!1),he(!1),ct.current&&(ct.current.style.height="0px"),ut.current&&(ut.current.style.height="0px"),at.current&&(at.current.style.height="0px"),dt.current&&(dt.current.style.height="0px")},[]),Kt=s(function(e,t,n,i,r,o){var l,c,u=E(t.id)||E(n.id)||"",a=(u?Ye[u]:null)||t.cognitiveData||n.cognitiveData||{section_id:u,decisioning:[],gap:[],relevance_score:0},d=null!==(c=null===(l=jt.current[i])||void 0===l?void 0:l.current)&&void 0!==c?c:null;return{open:!0,sectionTitle:t.displayTitle?t.title:"no title",refSectionTitle:t.displayTitle?t.title:"no title",cognitiveData:a,anchorEl:e,sectionAnchorEl:d,badgeStyle:o||null,sectionIdx:i,docData:{documents:null==$?void 0:$.documents,input_index_map:null==$?void 0:$.input_index_map},deviationData:t.evaluationResult||n.evaluationResult||null,isOrphan:!!r}},[Ye,$]),Vt=s(function(e){ht(),qe(null),et(e)},[ht]),qt=function(e,t,n,i,r,o){e.stopPropagation(),nt.open&&nt.sectionIdx===r?ht():(ft(),it(Kt(e.currentTarget,t,i,r,n,o)))},Xt=s(function(){null!==nt.sectionIdx&&nt.anchorEl?Vt(e(e({},nt),{open:!0})):ht()},[nt,ht,Vt]),Ut=s(function(){var e=nt.sectionIdx,t=nt.isOrphan;ht(),null!==e&&(t?me("No counterpart exists to connect to."):(je.current&&Yt(),Me(function(t){return t.has(e)?new Set:new Set([e])})))},[nt.sectionIdx,ht,Yt]),Gt=a(null),Jt=a(null),$t=a(null),Qt=a(null),Zt=a(null),en=u([]),tn=en[0],nn=en[1],rn=u(null),on=rn[0],ln=rn[1];a(null);var cn=u(null),un=cn[0],an=cn[1],dn=c(function(){return xt.fields.filter(function(e){var t=e.key;return(!Wt||"description"!==t)&&(B(null==yt?void 0:yt[t])||B(Tt[t]))})},[yt,Tt,Wt,xt.fields]),sn=a({}),vn=a({}),pn=a({}),fn=a({}),hn=a({}),gn=a({}),xn=a({}),mn=a({}),yn=a({});dn.forEach(function(e){for(var t=e.key,n=0;n<Math.max(Ht.length,Ot.length);n+=1)pn.current[n]||(pn.current[n]=l.createRef()),fn.current[n]||(fn.current[n]=l.createRef()),hn.current[n]||(hn.current[n]=l.createRef()),gn.current[n]||(gn.current[n]=l.createRef()),xn.current[n]||(xn.current[n]=l.createRef());sn.current[t]||(sn.current[t]=l.createRef()),vn.current[t]||(vn.current[t]=l.createRef())});for(var bn=0;bn<Math.max(Ht.length,Ot.length);bn+=1)pn.current[bn]||(pn.current[bn]=l.createRef()),fn.current[bn]||(fn.current[bn]=l.createRef()),hn.current[bn]||(hn.current[bn]=l.createRef()),gn.current[bn]||(gn.current[bn]=l.createRef()),xn.current[bn]||(xn.current[bn]=l.createRef());d(function(){if(It){var e=xt.fields.find(function(e){return e.analysisKey===It||e.key===It});if(e){var t=sn.current[e.key]||vn.current[e.key];(null==t?void 0:t.current)&&setTimeout(function(){return t.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[It,xt.fields]);var Sn=s(function(e){var t,n,i,r,o,l,c,u,a,d=null===(t=null==Nt?void 0:Nt.rule_difference_comparison)||void 0===t?void 0:t.fields;if(!d||!d[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=d[e],v=(null==s?void 0:s.relation)||(null===(i=null===(n=null==s?void 0:s.highlights)||void 0===n?void 0:n.ruleA_spans)||void 0===i?void 0:i.length)||(null===(o=null===(r=null==s?void 0:s.highlights)||void 0===r?void 0:r.ruleB_spans)||void 0===o?void 0:o.length)||(null==s?void 0:s.mappings)&&s.mappings.length>0;if(s.mappings){var p=s.mappings[0]||{};return{score:s.score,relation:p.relation||"",highlightsA:(null===(l=p.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(c=p.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!v}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(u=s.highlights)||void 0===u?void 0:u.ruleA_spans)||[],highlightsB:(null===(a=s.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Nt]),wn=s(function(t){var n,i,r,o=Ht[t],l=Ot[t],c=(null==o?void 0:o.relation)&&"not_defined"!==o.relation,u=(null==l?void 0:l.relation)&&"not_defined"!==l.relation;E(null==o?void 0:o.id)||E(null==l?void 0:l.id);var a=!(!(null==o?void 0:o.cognitiveData)&&!(null==l?void 0:l.cognitiveData));if(!c&&!u&&!a)return e(e({},xt.relationStyles.noContent),{label:"Not Defined"});var d=null!==(i=null!==(n=null==o?void 0:o.evaluationResult)&&void 0!==n?n:null==l?void 0:l.evaluationResult)&&void 0!==i?i:null,s=null===(r=null==d?void 0:d.evaluation_outputs)||void 0===r?void 0:r.output_value;return e(e({},xt.relationStyles.low),null!=d?{label:null!=s?s:""}:{label:"N/A"})},[Ht,Ot,Ye,xt,Sn]),In=s(function(t){for(var n,i,r,o,l,c,u=t.split("-").map(Number),a=Ht[u[0]],d=Ot[u[0]],s=1;s<u.length;s++)(null==a?void 0:a.subsections)&&(a=a.subsections[u[s]]),(null==d?void 0:d.subsections)&&(d=d.subsections[u[s]]);if(!a&&!d)return null;var v=(null==a?void 0:a.relation)&&"not_defined"!==a.relation,p=(null==d?void 0:d.relation)&&"not_defined"!==d.relation,f=E(null==a?void 0:a.id)||E(null==d?void 0:d.id)||"",h=!(!(null==a?void 0:a.cognitiveData)&&!(null==d?void 0:d.cognitiveData));if(!v&&!p&&!h)return e(e({},xt.relationStyles.noContent),{label:"Not Defined"});null!==(i=null!==(n=null==a?void 0:a.cognitiveRelevanceScore)&&void 0!==n?n:null==d?void 0:d.cognitiveRelevanceScore)&&void 0!==i||f&&(null===(r=Ye[f])||void 0===r||r.relevance_score);var g=null!==(l=null!==(o=null==a?void 0:a.evaluationResult)&&void 0!==o?o:null==d?void 0:d.evaluationResult)&&void 0!==l?l:null,x=null===(c=null==g?void 0:g.evaluation_outputs)||void 0===c?void 0:c.output_value;return e(e({},xt.relationStyles.low),null!=g?{label:null!=x?x:""}:{label:"N/A"})},[Ht,Ot,Ye,xt]),Rn=s(function(){var e,t,n,i,r,o,l,c,u,a,d,s,v,p,f,h,g,x,m,y,b,S;if(!vt.current&&!Oe.current){vt.current=!0;try{if(!Gt.current)return;var w=function(e){var t=e.split("-"),n=t[0];if(!Ct[n]&&!1===ue)return!1;if(ue&&!Ct["left-".concat(n)]&&!Ct["right-".concat(n)]&&!Ct[n])return!1;for(var i=n,r=1;r<t.length-1;r++)if(i+="-".concat(t[r]),!Bt[i])return!1;return!0},I=Gt.current.getBoundingClientRect();Je({width:I.width,height:I.height});var R=[];if(dn.forEach(function(e){var t,n,i=e.key,r=null===(t=sn.current[i])||void 0===t?void 0:t.current,o=null===(n=vn.current[i])||void 0===n?void 0:n.current;r&&o&&(r.style.height="auto",o.style.height="auto",r.style.minHeight="0px",o.style.minHeight="0px")}),!Oe.current){for(var C=0;C<Math.max(Ht.length,Ot.length);C++){var F=null===(e=pn.current[C])||void 0===e?void 0:e.current,E=null===(t=fn.current[C])||void 0===t?void 0:t.current;F&&(F.style.height="auto",F.style.minHeight="0px"),E&&(E.style.height="auto",E.style.minHeight="0px")}ue||Object.keys(mn.current).forEach(function(e){var t,n;if(w(e)){var i=null===(t=mn.current[e])||void 0===t?void 0:t.current,r=null===(n=yn.current[e])||void 0===n?void 0:n.current;i&&r&&(i.style.height="auto",r.style.height="auto",i.style.minHeight="0px",r.style.minHeight="0px")}})}var B={};dn.forEach(function(e){var t,n,i=e.key,r=null===(t=sn.current[i])||void 0===t?void 0:t.current,o=null===(n=vn.current[i])||void 0===n?void 0:n.current;if(r&&o){var l=r.getBoundingClientRect(),c=o.getBoundingClientRect();B[i]=Math.max(l.height,c.height)}});var _={left:{},right:{}},T={};if(!Oe.current)if(ue){if(be&&null!==on)if("number"==typeof on){var M=on,k=Ht[M],A=null===(r=pn.current[M])||void 0===r?void 0:r.current;A&&k&&(k.refIndexes||[]).forEach(function(e){var t,n=Ot.findIndex(function(t){return t.selfIndex===e}),i=null===(t=fn.current[n])||void 0===t?void 0:t.current;if(i&&(Ct["left-".concat(M)]||Ct["right-".concat(n)])){var r=Math.max(A.getBoundingClientRect().height,i.getBoundingClientRect().height);_.left[M]=Math.max(_.left[M]||0,r),_.right[n]=Math.max(_.right[n]||0,r)}})}else{var D=on.split(N)[0];F=null===(o=mn.current[D])||void 0===o?void 0:o.current,E=null===(l=yn.current[D])||void 0===l?void 0:l.current;if(F&&E){H=Math.max(F.getBoundingClientRect().height,E.getBoundingClientRect().height);T[D]=Math.max(T[D]||0,H)}}}else{Object.keys(mn.current).forEach(function(e){var t,n;if(w(e)){var i=null===(t=mn.current[e])||void 0===t?void 0:t.current,r=null===(n=yn.current[e])||void 0===n?void 0:n.current;if(i&&r&&null!==i.offsetParent&&null!==r.offsetParent){var o=i.getBoundingClientRect(),l=r.getBoundingClientRect(),c=Math.max(o.height,l.height);T[e]=c,i.style.minHeight="".concat(c,"px"),r.style.minHeight="".concat(c,"px")}}});for(C=0;C<Math.min(Ht.length,Ot.length);C++){var F=null===(n=pn.current[C])||void 0===n?void 0:n.current,E=null===(i=fn.current[C])||void 0===i?void 0:i.current;if(F&&E){var H=Math.max(F.getBoundingClientRect().height,E.getBoundingClientRect().height);_.left[C]=H,_.right[C]=H}}}if(dn.forEach(function(e){var t,n,i=e.key,r=null===(t=sn.current[i])||void 0===t?void 0:t.current,o=null===(n=vn.current[i])||void 0===n?void 0:n.current;if(r&&o){var l=B[i];r.style.minHeight="".concat(l,"px"),o.style.minHeight="".concat(l,"px")}}),Oe.current||(Object.entries(_.left).forEach(function(e){var t,n=e[0],i=e[1],r=null===(t=pn.current[Number(n)])||void 0===t?void 0:t.current;r&&(r.style.minHeight="".concat(i,"px"))}),Object.entries(_.right).forEach(function(e){var t,n=e[0],i=e[1],r=null===(t=fn.current[Number(n)])||void 0===t?void 0:t.current;r&&(r.style.minHeight="".concat(i,"px"))}),ue||Object.keys(T).forEach(function(e){var t,n,i=null===(t=mn.current[e])||void 0===t?void 0:t.current,r=null===(n=yn.current[e])||void 0===n?void 0:n.current;if(i&&r&&T[e]){var o=T[e];i.style.minHeight="".concat(o,"px"),r.style.minHeight="".concat(o,"px")}})),ue)Ht.forEach(function(e,t){var n;(null===(n=pn.current[t])||void 0===n?void 0:n.current)&&(e.refIndexes||[]).forEach(function(e){var n,i,r,o,l,c,u,a,d,s,v=Ot.findIndex(function(t){return t.selfIndex===e});if(-1!==v){var p=null===(n=hn.current[t])||void 0===n?void 0:n.current,f=null===(i=gn.current[v])||void 0===i?void 0:i.current;if(p&&f){var h=p.getBoundingClientRect(),g=f.getBoundingClientRect(),x=h.right-I.left,m=g.left-I.left,y=h.top+h.height/2-I.top,b=g.top+g.height/2-I.top;if(be&&on===t){var S=null!==(o=null===(r=st.current)||void 0===r?void 0:r.getBoundingClientRect().top)&&void 0!==o?o:0,w=null!==(c=null===(l=lt.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==c?c:0,C=S+(null!==(a=null===(u=st.current)||void 0===u?void 0:u.clientHeight)&&void 0!==a?a:1/0),F=w+(null!==(s=null===(d=lt.current)||void 0===d?void 0:d.clientHeight)&&void 0!==s?s:1/0),E=h.top+h.height/2,B=function(e,t,n){return Math.max(t,Math.min(n,e))};y=B(E,S,C)-I.top,b=B(E,w,F)-I.top}var _=wn(t);_&&R.push({id:"line-".concat(t,"-").concat(v),x1:x,y1:y,x2:m,y2:b,style:_,sectionIdx:t,targetRightIdx:v})}}})});else for(C=0;C<Math.min(Ht.length,Ot.length);C++){var O=null===(c=pn.current[C])||void 0===c?void 0:c.current,W=null===(u=fn.current[C])||void 0===u?void 0:u.current;if(O&&W){var z=O.getBoundingClientRect(),j=W.getBoundingClientRect(),P=Math.max(z.top,j.top)+18-I.top,Y=(null===(a=Ot[C])||void 0===a?void 0:a.id)||"sec-".concat(C);(X=wn(C))&&R.push({id:Y,x1:z.right-I.left,y1:P,x2:j.left-I.left,y2:P,style:X,sectionIdx:C,hasCognitive:!!((null===(d=Ht[C])||void 0===d?void 0:d.cognitiveData)||(null===(s=Ot[C])||void 0===s?void 0:s.cognitiveData)||Y&&Ye[Y]),isSubSection:!1})}}if(be&&"string"==typeof on){var K=on,V=(D=K.split(N)[0],null===(v=hn.current[K])||void 0===v?void 0:v.current),q=null===(p=gn.current[K])||void 0===p?void 0:p.current;if(V&&q){var X,U=V.getBoundingClientRect(),G=q.getBoundingClientRect(),J=U.right-I.left,$=G.left-I.left,Q=U.top+U.height/2-I.top,Z=G.top+G.height/2-I.top;if(ue){var ee=null!==(h=null===(f=st.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==h?h:0,te=null!==(x=null===(g=lt.current)||void 0===g?void 0:g.getBoundingClientRect().top)&&void 0!==x?x:0,ne=ee+(null!==(y=null===(m=st.current)||void 0===m?void 0:m.clientHeight)&&void 0!==y?y:1/0),ie=te+(null!==(S=null===(b=lt.current)||void 0===b?void 0:b.clientHeight)&&void 0!==S?S:1/0),re=function(e,t,n){return Math.max(t,Math.min(n,e))};Q=re(U.top+U.height/2,ee,ne)-I.top,Z=re(G.top+G.height/2,te,ie)-I.top}(X=In(D))&&R.push({id:"line-subsec-".concat(K),x1:J,y1:Q,x2:$,y2:Z,style:X,sectionIdx:Number(D.split("-")[0]),isSubSection:!0,subSectionKeyPath:K})}}if(nn(R),Qt.current&&Zt.current){var oe=Qt.current.getBoundingClientRect(),le=Zt.current.getBoundingClientRect(),ce=(oe.top+oe.height/2-I.top+le.top+le.height/2-I.top)/2;an({x1:oe.right-I.left,x2:le.left-I.left,y:ce})}else an(null);if(Te.size>0){var ae=[],de=st.current,se=lt.current;if(de&&se){var ve=[],pe=de.getBoundingClientRect().top,fe=se.getBoundingClientRect().top,he=pe+de.clientHeight,ge=fe+se.clientHeight,xe=de.scrollTop,me=se.scrollTop,ye=I.top,Se=function(e,t,n){return Math.max(t,Math.min(n,e))};Te.forEach(function(e){var t,n,i,r,o;if("string"==typeof e){var l=e,c=l.split(N)[0],u=null===(t=hn.current[l])||void 0===t?void 0:t.current,a=null===(n=gn.current[l])||void 0===n?void 0:n.current;if(!u||!a)return;var d=u.getBoundingClientRect(),s=a.getBoundingClientRect(),v=In(c),p=(B=d.right-I.left)+.5*((_=s.left-I.left-0)-B),f=d.top+d.height/2,h=s.top+s.height/2,g=f-pe+xe,x=h-fe+me,m="conn-subsec-".concat(l);ve.push({lhsScrollY:g,rhsScrollY:x,x1:B,x2:_,containerTop:ye,leftIdx:l,rhsArrayIdx:l,styleColor:(null==v?void 0:v.badgeBorder)||"#6366F1",styleId:m});var y=Se(f,pe,he),b=Se(h,fe,ge),S=y-ye,w=b-ye,R=h>=fe-4&&h<=ge+4,C="";C=(T=f>=pe-4&&f<=he+4)&&R?L(B,S,_,w):T&&!R?"M ".concat(B,",").concat(S," L ").concat(p,",").concat(S," L ").concat(p,",").concat(w):!T&&R?"M ".concat(p,",").concat(S," L ").concat(p,",").concat(w," L ").concat(_,",").concat(w):"M ".concat(p,",").concat(S," L ").concat(p,",").concat(w),ae.push({id:m,pathD:C,style:v,leftIdx:l,rhsArrayIdx:l})}else if(ue){var F=Ht[e];if(!(null===(o=null==F?void 0:F.refIndexes)||void 0===o?void 0:o.length))return;F.refIndexes.forEach(function(t){var n,i,r=Ot.findIndex(function(e){return e.selfIndex===t});if(-1!==r){var o=null===(n=hn.current[e])||void 0===n?void 0:n.current,l=null===(i=gn.current[r])||void 0===i?void 0:i.current;if(o&&l){var c=o.getBoundingClientRect(),u=l.getBoundingClientRect(),a=wn(e),d=c.right-I.left,s=u.left-I.left-0,v=d+.5*(s-d),p=c.top+c.height/2,f=u.top+u.height/2,h=p-pe+xe,g=f-fe+me,x="conn-".concat(e,"-").concat(r);ve.push({lhsScrollY:h,rhsScrollY:g,x1:d,x2:s,containerTop:ye,leftIdx:e,rhsArrayIdx:r,styleColor:(null==a?void 0:a.badgeBorder)||"#6366F1",styleId:x});var m=Se(p,pe,he),y=Se(f,fe,ge),b=m-ye,S=y-ye,w=p>=pe-4&&p<=he+4,R=f>=fe-4&&f<=ge+4,C="";C=w&&R?L(d,b,s,S):w&&!R?"M ".concat(d,",").concat(b," L ").concat(v,",").concat(b," L ").concat(v,",").concat(S):!w&&R?"M ".concat(v,",").concat(b," L ").concat(v,",").concat(S," L ").concat(s,",").concat(S):"M ".concat(v,",").concat(b," L ").concat(v,",").concat(S),ae.push({id:x,pathD:C,style:a,leftIdx:e,rhsArrayIdx:r})}}})}else{var E=e;u=null===(i=hn.current[e])||void 0===i?void 0:i.current,a=null===(r=gn.current[E])||void 0===r?void 0:r.current;if(!u||!a)return;var B,_;d=u.getBoundingClientRect(),s=a.getBoundingClientRect(),v=wn(e),p=(B=d.right-I.left)+.5*((_=s.left-I.left-0)-B),f=d.top+d.height/2,h=s.top+s.height/2,g=f-pe+xe,x=h-fe+me,m="conn-".concat(e,"-").concat(E);ve.push({lhsScrollY:g,rhsScrollY:x,x1:B,x2:_,containerTop:ye,leftIdx:e,rhsArrayIdx:E,styleColor:(null==v?void 0:v.badgeBorder)||"#6366F1",styleId:m});var T;y=Se(f,pe,he),b=Se(h,fe,ge),S=y-ye,w=b-ye,R=h>=fe-4&&h<=ge+4,C="";C=(T=f>=pe-4&&f<=he+4)&&R?L(B,S,_,w):T&&!R?"M ".concat(B,",").concat(S," L ").concat(p,",").concat(S," L ").concat(p,",").concat(w):!T&&R?"M ".concat(p,",").concat(S," L ").concat(p,",").concat(w," L ").concat(_,",").concat(w):"M ".concat(p,",").concat(S," L ").concat(p,",").concat(w),ae.push({id:m,pathD:C,style:v,leftIdx:e,rhsArrayIdx:E})}}),ze.current=ve}De(ae)}else De([]),ze.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{vt.current=!1}}},[dn,Ht,Ot,Ye,xt,Sn,wn,ue,be,on,Te,Ct,Bt]),Cn=s(function(){var e,t,n,i,r,o,l,c,u,a,d,s,v,p,f=ze.current;if(f.length&&!Oe.current){var h=null!==(t=null===(e=st.current)||void 0===e?void 0:e.scrollTop)&&void 0!==t?t:0,g=null!==(i=null===(n=lt.current)||void 0===n?void 0:n.scrollTop)&&void 0!==i?i:0,x=null!==(o=null===(r=st.current)||void 0===r?void 0:r.clientHeight)&&void 0!==o?o:1/0,m=null!==(c=null===(l=lt.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,y=null!==(a=null===(u=st.current)||void 0===u?void 0:u.getBoundingClientRect().top)&&void 0!==a?a:0,b=null!==(s=null===(d=lt.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==s?s:0,S=y+x,w=b+m,I=null!==(p=null===(v=Gt.current)||void 0===v?void 0:v.getBoundingClientRect().top)&&void 0!==p?p:0,R=function(e,t,n){return Math.max(t,Math.min(n,e))};f.forEach(function(e){var t=e.lhsScrollY-h+y,n=e.rhsScrollY-g+b,i=Ne.current[e.styleId+"-stroke"],r=Ne.current[e.styleId+"-bg"];if(i||r){var o,l=R(t,y,S),c=R(n,b,w),u=l-I,a=c-I,d=t>=y-4&&t<=S+4,s=n>=b-4&&n<=w+4,v=e.x1+.5*(e.x2-e.x1);o=d&&s?L(e.x1,u,e.x2,a):d&&!s?"M ".concat(e.x1,",").concat(u," L ").concat(v,",").concat(u," L ").concat(v,",").concat(a):!d&&s?"M ".concat(v,",").concat(u," L ").concat(v,",").concat(a," L ").concat(e.x2,",").concat(a):"M ".concat(v,",").concat(u," L ").concat(v,",").concat(a),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",o)),r&&(r.setAttribute("visibility","visible"),r.setAttribute("d",o))}})}},[]),Fn=a(Rn);d(function(){Fn.current=Rn},[Rn]);var En=a(null),Bn=s(function(){null!==En.current&&clearTimeout(En.current),En.current=setTimeout(function(){Fn.current(),En.current=null},50)},[]),_n=s(function(e){var t,n,i,r,o,l,c,u;if(!Ce.current){if(ue||Bn(),je.current){var a=Pe.current,d=Jt.current,s=st.current,v=lt.current;if(null!==a&&null!==d&&s&&v){var p="string"==typeof a?null===(t=hn.current[a])||void 0===t?void 0:t.current:null===(n=jt.current[a])||void 0===n?void 0:n.current,f="string"==typeof d?null===(i=gn.current[d])||void 0===i?void 0:i.current:null===(r=xn.current[d])||void 0===r?void 0:r.current;if(p&&f){var h=p.getBoundingClientRect().top-s.getBoundingClientRect().top+s.scrollTop,g=f.getBoundingClientRect().top-v.getBoundingClientRect().top+v.scrollTop;if(e.currentTarget===s){var x=g-(h-s.scrollTop),m=v.scrollHeight-v.clientHeight,y=Math.max(0,Math.min(x,m));Math.abs(v.scrollTop-y)>1&&(v.scrollTop=y)}else if(e.currentTarget===v){var b=h-(g-v.scrollTop),S=s.scrollHeight-s.clientHeight,w=Math.max(0,Math.min(b,S));Math.abs(s.scrollTop-w)>1&&(s.scrollTop=w)}if($t.current){var I=null===(o=hn.current[a])||void 0===o?void 0:o.current,R=null===(l=gn.current[d])||void 0===l?void 0:l.current,C=null!==(u=null===(c=Gt.current)||void 0===c?void 0:c.getBoundingClientRect().top)&&void 0!==u?u:0,F=s.getBoundingClientRect().top,E=F+s.clientHeight,B=v.getBoundingClientRect().top,_=B+v.clientHeight,T=function(e,t,n){return Math.max(t,Math.min(n,e))};if(I&&R){var M=I.getBoundingClientRect(),k=R.getBoundingClientRect(),A=M.top+M.height/2,D=k.top+k.height/2,H=T(A,F,E),O=T(D,B,_);$t.current.setAttribute("y1",(H-C).toString()),$t.current.setAttribute("y2",(O-C).toString());var W=A>=F-4&&A<=E+4;$t.current.setAttribute("visibility",W?"visible":"hidden")}}}}}ze.current.length>0&&!Le.current&&(Le.current=!0,requestAnimationFrame(function(){Cn(),Le.current=!1}))}},[Cn,ue,Bn]);d(function(){var e=setTimeout(Bn,250);window.addEventListener("resize",Bn);var t=null,n=null;return rt.current&&(t=new ResizeObserver(Bn)).observe(rt.current),Gt.current&&(n=new ResizeObserver(Bn)).observe(Gt.current),function(){clearTimeout(e),window.removeEventListener("resize",Bn),null==t||t.disconnect(),null==n||n.disconnect()}},[yt,Tt,Nt,dn,Ct,Bt,Ht,Ot,xt,Bn,be,on,Ie,Te]),d(function(){je.current=be},[be]),d(function(){Pe.current=on},[on]);var Tn=s(function(){var e,t,n,i,r=nt.sectionIdx,o=nt.isOrphan;if(ht(),null!=r)if(o)me("No counterpart exists for this section.");else if(be&&on===r)Yt();else{if(!ue){var l=Pe.current,c=Jt.current;if(null!==l){var u="string"==typeof l?null===(e=mn.current[l.split(N)[0]])||void 0===e?void 0:e.current:null===(t=pn.current[l])||void 0===t?void 0:t.current;u&&(u.style.paddingTop="0px")}if(null!==c){var a="string"==typeof c?null===(n=yn.current[c.split(N)[0]])||void 0===n?void 0:n.current:null===(i=fn.current[c])||void 0===i?void 0:i.current;a&&(a.style.paddingTop="0px")}}Me(new Set),De([]),ze.current=[],he(!0),Ce.current=!0,ln(r),Pe.current=r,Se(!0),je.current=!0,Re(!1),ct.current&&(ct.current.style.height="0px"),ut.current&&(ut.current.style.height="0px"),at.current&&(at.current.style.height="0px"),dt.current&&(dt.current.style.height="0px"),requestAnimationFrame(function(){var e,t,n,i,o,l,c,u,a,d,s,v=null,p=null,f=null,h=null,g=null;if("string"==typeof r){v=(null===(e=hn.current[r])||void 0===e?void 0:e.current)||null,g=(p=(null===(t=gn.current[r])||void 0===t?void 0:t.current)||null)?r:null;var x=r.split(N)[0];f=(null===(n=mn.current[x])||void 0===n?void 0:n.current)||null,h=(null===(i=yn.current[x])||void 0===i?void 0:i.current)||null}else if(v=(null===(o=jt.current[r])||void 0===o?void 0:o.current)||null,f=(null===(l=pn.current[r])||void 0===l?void 0:l.current)||null,ue){var m=Ht[r],y=(null==m?void 0:m.refIndexes)||[];if(y.length>0){var b=y[0],S=Ot.findIndex(function(e){return e.selfIndex===b});-1!==S&&(p=(null===(a=xn.current[S])||void 0===a?void 0:a.current)||null,h=(null===(d=fn.current[S])||void 0===d?void 0:d.current)||null,g=S)}}else p=(null===(c=xn.current[r])||void 0===c?void 0:c.current)||null,h=(null===(u=fn.current[r])||void 0===u?void 0:u.current)||null,g=p?r:null;Jt.current=g;var w=st.current,I=lt.current;if(!v||!w)return Ce.current=!1,void he(!1);if(!p||!I)return Re(!0),Fn.current(),Ce.current=!1,void he(!1);if(!ue){var R=v.getBoundingClientRect(),C=p.getBoundingClientRect(),F=R.top-C.top;f&&h&&(f.style.paddingTop="0px",h.style.paddingTop="0px",F>0?h.style.paddingTop="".concat(F,"px"):F<0&&(f.style.paddingTop="".concat(Math.abs(F),"px")));var E=v?v.getBoundingClientRect().top:(null==f?void 0:f.getBoundingClientRect().top)||0;return null===(s=rt.current)||void 0===s||s.scrollTo({top:rt.current.scrollTop+E-150,behavior:"smooth"}),Re(!0),Fn.current(),Ce.current=!1,void he(!1)}var B=v.getBoundingClientRect().top-w.getBoundingClientRect().top+w.scrollTop,_=p.getBoundingClientRect().top-I.getBoundingClientRect().top+I.scrollTop-(B-w.scrollTop);_<0&&ct.current&&(ct.current.style.height="".concat(Math.abs(_),"px"));requestAnimationFrame(function(){var e,t=I.scrollHeight-I.clientHeight;if(_<0)e=0;else{if(_>t){var n=_-t;return ut.current&&(ut.current.style.height="".concat(n+150,"px")),void requestAnimationFrame(function(){Y(I,_,200,function(){Re(!0),Fn.current(),Ce.current=!1,he(!1)})})}e=_}Y(I,e,200,function(){Re(!0),Fn.current(),Ce.current=!1,he(!1)})})})}},[ht,nt.sectionIdx,be,on,Ht,Ot,Bn,Yt]),Mn=null!==nt.sectionIdx&&Te.has(nt.sectionIdx),kn=function(t){var n,o,c,u=t.section,a=t.idx,d=t.columnKey,s=t.colRef,f=t.mb,h=void 0===f?1:f,g=t.parentNodeId,x=void 0===g?"":g,w=ue?!!Ct["".concat(d,"-").concat(a)]:!!Ct[String(a)],R=(null===(n=u.displayTitle)||void 0===n||n)&&B(u.title),C=(null===(o=u.displayContent)||void 0===o||o)&&B(u.content),F=!R&&!C,_={current:1},T=u.title;R||(T=C?"No Title Found":"No Matching Section Found");var M,k=[];if(null===(c=u.evaluationResult)||void 0===c?void 0:c.deviations){var A=u.evaluationResult.deviations;for(var D in A){var H=A[D][x];H&&k.push(H)}}return i(v,e({ref:s,sx:{mb:h,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:r(y,e({disableGutters:!0,expanded:!F&&w,onChange:function(){return!F&&function(t,n){var i,r;Oe.current=!0,We.current&&clearTimeout(We.current),He.current&&(He.current.style.opacity="0");var o=null===(i=pn.current[t])||void 0===i?void 0:i.current,l=null===(r=fn.current[t])||void 0===r?void 0:r.current;o&&(o.style.minHeight="0px"),l&&(l.style.minHeight="0px"),We.current=setTimeout(function(){Oe.current=!1,Fn.current(),He.current&&(He.current.style.opacity="1")},650),Ft(function(i){var r=e({},i),o=ue?"".concat(n,"-").concat(t):String(t),l=!i[o];if(!l){var c=String(on||""),u=on===t||c.startsWith("".concat(t,"-")),a=!1;Te.forEach(function(e){(e===t||String(e).startsWith("".concat(t,"-")))&&(a=!0)}),(u||a)&&(Yt(),Me(new Set),De([]),ze.current=[])}if(!ue)return r[String(t)]=l,r;if(r[o]=l,"left"===n)((null==(d=Ht[t])?void 0:d.refIndexes)||[]).forEach(function(e){var t=Ot.findIndex(function(t){return t.selfIndex===e});-1!==t&&(r["right-".concat(t)]=l)});else{var d,s=null==(d=Ot[t])?void 0:d.selfIndex;Ht.forEach(function(e,t){var n;(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(s))&&(r["left-".concat(t)]=l)})}return r})}(a,d)},sx:{boxShadow:"none",border:F?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:F?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flexGrow:1,width:"100%",display:"flex",flexDirection:"column",minWidth:0,"&:before":{display:"none"}}},{children:[i(b,e({expandIcon:F?null:i(I,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:F?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:R&&i(m,e({title:T,placement:"top"},{children:i(p,e({component:"div",sx:{fontSize:"12px",color:F?"#94A3B8":"#19213D",fontWeight:F?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:(M=T,M?E(M).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,t){return e.startsWith("**")&&e.endsWith("**")?i("strong",{children:e.slice(2,-2)},t):i(l.Fragment,{children:e},t)}):null)}))}))})),!F&&r(S,e({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[C&&i(z,{content:u.content,sxStyles:$e,highlights:k,maintainRelativeOrder:ue}),(u.subsections||[]).map(function(e,t){return An({section:e,keyPath:"".concat(a,"-").concat(t),depth:0,columnKey:d,parentNodeId:x,devCounter:_})})]}))]}))}),"".concat(d,"-sec-").concat(a))},An=function(t){var n,o,c,u,a,d,s,f,h,g=t.section,x=t.keyPath,m=t.depth,w=void 0===m?0:m,R=t.columnKey,C=void 0===R?"left":R,F=t.parentNodeId,E=void 0===F?"":F,_=t.devCounter,T=void 0===_?{current:1}:_,M=(null===(n=g.displayTitle)||void 0===n||n)&&B(g.title),k=(null===(o=g.displayContent)||void 0===o||o)&&B(g.content),A=!M&&!k,D=M?g.title:k?"No Title Found":"No Matching Section Found",H=!!Bt[x];"left"!==C||mn.current[x]||(mn.current[x]=l.createRef()),"right"!==C||yn.current[x]||(yn.current[x]=l.createRef());var O,W="left"===C?mn.current[x]:yn.current[x],L=In(x),j=x.split("-").map(Number),P=Ht[j[0]];O=ue&&void 0!==(null==P?void 0:P.selfIndex)&&P.selfIndex>=0?P.selfIndex+1:j[0]+1;for(var Y=Ht[j[0]],K=Ot[j[0]],V=1;V<j.length;V++)(null==Y?void 0:Y.subsections)&&(Y=Y.subsections[j[V]]),(null==K?void 0:K.subsections)&&(K=K.subsections[j[V]]);var q=null===(c=null==$?void 0:$.input_index_map)||void 0===c?void 0:c[0],X=null===(u=null==$?void 0:$.input_index_map)||void 0===u?void 0:u[1],U="left"===C?X:q,G=ue?!(null===(a=g.refIndexes)||void 0===a?void 0:a.length)||void 0!==g.selfIndex&&g.selfIndex<0:"left"===C?!K:!Y,J=null!==(f=null===(s=null===(d=g.evaluationResult)||void 0===d?void 0:d.evaluation_outputs)||void 0===s?void 0:s.output_value)&&void 0!==f?f:null,Q=Object.entries((null===(h=g.evaluationResult)||void 0===h?void 0:h.deviations)||{}).map(function(e){var t=e[0],n=e[1],i=T.current++,r=n[E],o="No equivalent clause present."===r;if(o)r="";else if(!r)return null;var c=function(e,t){return"".concat(e).concat(N).concat(t)}(x,t),u=n[U],a=G||!u||"No equivalent clause present."===u,d="".concat(O,".").concat(i);return"left"!==C||hn.current[c]||(hn.current[c]=l.createRef()),"right"!==C||gn.current[c]||(gn.current[c]=l.createRef()),{id:c,label:d,highlight:r,side:C,style:L,score:J,isConnected:Te.has(c),isOrphan:a,isMissingClause:o,badgeRef:"left"===C?hn.current[c]:gn.current[c],onClick:function(e){e.stopPropagation(),qt(e,Y||{title:"",content:""},a,K||{title:"",content:""},c,L)}}}).filter(Boolean),Z=Q.some(function(e){return Te.has(e.id)});return M||k||g.subsections&&0!==g.subsections.length?i(v,M?e({ref:W,sx:{mt:1,width:"100%",minWidth:0,position:"relative"}},{children:i(v,e({sx:e({width:"100%"},Z&&L&&{borderRadius:"4px",outline:"2px solid ".concat(L.badgeBorder),outlineOffset:"1px"})},{children:r(y,e({disableGutters:!0,expanded:!A&&H,onChange:function(){if(!A){if(H){var t=String(on||"").startsWith(x);t||Te.forEach(function(e){String(e).startsWith(x)&&(t=!0)}),t&&(Yt(),Me(new Set),De([]),ze.current=[])}_t(function(t){var n;return e(e({},t),((n={})[x]=!t[x],n))})}},sx:{mt:0,boxShadow:"none",border:A?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF",minWidth:0,"&:before":{display:"none"}}},{children:[i(b,e({expandIcon:A?null:i(I,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"}}},{children:i(p,e({component:"div",sx:{fontSize:"11px",fontWeight:600,color:A?"#94A3B8":"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:D||"Untitled Subsection"}))})),!A&&r(S,e({sx:{pt:0,pb:1,minWidth:0}},{children:[k&&i(z,{content:g.content,sxStyles:$e,deviationBadges:Q,maintainRelativeOrder:ue}),(g.subsections||[]).map(function(e,t){return An({section:e,keyPath:"".concat(x,"-").concat(t),depth:w+1,columnKey:C,parentNodeId:E,devCounter:T})})]}))]}))}))}):e({ref:W,sx:{mt:0===w?1:.75,width:"100%",minWidth:0,position:"relative"}},{children:!A&&r(v,e({sx:e({width:"100%"},Z&&L&&{borderRadius:"4px",outline:"2px solid ".concat(L.badgeBorder),outlineOffset:"1px"})},{children:[k&&i(z,{content:g.content,sxStyles:$e,deviationBadges:Q,maintainRelativeOrder:ue}),(g.subsections||[]).map(function(e,t){return An({section:e,keyPath:"".concat(x,"-").concat(t),depth:w+1,columnKey:C,parentNodeId:E,devCounter:T})})]}))}),x):null};return r(v,e({ref:ot,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},ue?{}:{overflow:"visible"}),{position:"relative"})},{children:[se&&i(v,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:i(O,{})})),i(H,{open:nt.open,anchorEl:nt.anchorEl,sectionTitle:nt.sectionTitle,referenceSectionTitle:nt.refSectionTitle,onClose:ht,onOpenCognitiveCompare:Xt,onOpenSideBySide:Tn,onConnect:Ut,isConnected:Mn,isOrphan:nt.isOrphan}),Ze.open&&i(D,{open:Ze.open,popupRef:Xe,position:Ve,popupConfig:re,onClose:function(){qe(null),et(function(t){return e(e({},t),{open:!1})}),Be(null)},markdownStyles:te,sectionTitle:Ze.sectionTitle,referenceSectionTitle:Ze.refSectionTitle,cognitiveData:Ze.cognitiveData,anchorEl:Ze.anchorEl,sectionAnchorEl:Ze.sectionAnchorEl,scrollContainerEl:rt.current,badgeStyle:Ze.badgeStyle,docData:Ze.docData,deviationData:Ze.deviationData}),i(f,e({open:!!xe,autoHideDuration:8e3,onClose:function(){return me(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(h,e({onClose:function(){return me(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:xe}))})),(ie.isHeaderVisible||ie.isToggleVisible)&&r(v,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[i(v,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:ie.isHeaderVisible&&i(p,e({sx:{fontSize:"16px",fontWeight:600,color:"#0F172A"}},{children:J}))})),ie.isToggleVisible&&i(v,e({sx:{display:"flex",alignItems:"center"}},{children:i(g,{control:i(x,{checked:!ue,onChange:function(e){var t=e.target.checked;ve(!0),setTimeout(function(){ae(!t),Yt(),Me(new Set),De([]),ze.current=[],setTimeout(function(){ve(!1)},400)},50)},color:"primary",size:"small",sx:{width:100,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"3px",transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(75px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:"#5928ED",opacity:1,border:0,"&::before":{content:'"Side by Side"',position:"absolute",left:"13px",top:"50%",transform:"translateY(-50%)",fontSize:"9px",fontWeight:700,color:"#fff",letterSpacing:"0.3px"}}}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:20,height:20},"& .MuiSwitch-track":{borderRadius:13,backgroundColor:"#9e9e9e",opacity:1,position:"relative","&::after":{content:'"Side by Side"',position:"absolute",right:"13px",top:"50%",transform:"translateY(-50%)",fontSize:"9px",fontWeight:700,color:"#fff",letterSpacing:"0.3px",opacity:1,transition:"opacity 0.2s"}},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{"&::after":{opacity:0}}}}),label:"",labelPlacement:"start",sx:{m:0,gap:1}})}))]})),i(v,e({ref:rt,onScroll:_n,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:ue?"hidden":"auto",borderTop:zt&&Lt?"none":"1.5px solid #EEF0F4"}},{children:i(v,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},ue?{flex:1,minHeight:0}:{})},{children:r(v,e({ref:Gt,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"10px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},ue?{flex:1,overflow:"visible"}:{})},{children:[r("svg",e({ref:He,style:{position:"absolute",top:0,left:0,width:Ge.width||"100%",height:Ge.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",transition:"opacity 0.15s ease-in-out"}},{children:[un&&!be&&r("g",{children:[i("line",{x1:un.x1,y1:un.y,x2:Math.max(un.x1,(un.x1+un.x2)/2-70),y2:un.y,stroke:"#BBF7D0",strokeWidth:"1.5"}),i("line",{x1:Math.min(un.x2,(un.x1+un.x2)/2+70),y1:un.y,x2:un.x2,y2:un.y,stroke:"#BBF7D0",strokeWidth:"1.5"})]}),tn.map(function(t){var n,o=t.x1+.5*(t.x2-t.x1),l=(t.y1+t.y2)/2;if("Not Defined"===t.style.label&&!t.hasCognitive)return null;var c=!1;if(t.isSubSection)c=be&&on===t.subSectionKeyPath&&Ie;else{var u=Ht[t.sectionIdx];(ue?!(null===(n=null==u?void 0:u.refIndexes)||void 0===n?void 0:n.length)||(null==u?void 0:u.selfIndex)<0:!Ot[t.sectionIdx])||(c=be&&on===t.sectionIdx&&Ie)}if(c)return r("g",e({style:{transition:"opacity 0.2s"}},{children:[i("defs",{children:i("marker",e({id:"arr-".concat(t.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:i("polygon",{points:"0 0, 7 2.5, 0 5",fill:t.style.badgeBorder||"#6366F1"})}))}),i("line",{ref:$t,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(t.id,")")})]}),t.id);if(!ue){var a=t.isSubSection?L(t.x1,t.y1,t.x2,t.y2):"M ".concat(t.x1," ").concat(t.y1," L ").concat(t.x2," ").concat(t.y2);return r("g",{children:[i("path",{d:a,fill:"none",stroke:t.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i("foreignObject",e({x:o-100,y:l-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(v,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:r(v,e({onClick:function(e){if(e.stopPropagation(),Ze.open&&Ee===t.id)ft();else{var n=Ht[t.sectionIdx]||{title:"",content:""},i=Ot[t.sectionIdx]||{title:"",content:""};if(t.isSubSection&&t.subSectionKeyPath){for(var r=t.subSectionKeyPath.split("-").map(Number),o=Ht[r[0]],l=Ot[r[0]],c=1;c<r.length;c++)(null==o?void 0:o.subsections)&&(o=o.subsections[r[c]]),(null==l?void 0:l.subsections)&&(l=l.subsections[r[c]]);o&&(n=o),l&&(i=l)}Be(t.id),Vt(Kt(e.currentTarget,n,i,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:"pointer"}},{children:[0===t.style.label?"Same":t.style.label,i(v,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(R,{})})),i(I,{size:11,style:{transform:Ze.open&&Ee===t.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},t.id)}return null}),Ae.map(function(t){var n,o=t.pathD,l=(null===(n=t.style)||void 0===n?void 0:n.badgeBorder)||"#6366F1",c="conn-marker-".concat(t.id),u="".concat(t.id,"-bg"),a="".concat(t.id,"-stroke");return r("g",{children:[i("defs",{children:i("clipPath",e({id:"connections-clip"},{children:i("marker",e({id:c,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:i("polygon",{points:"0 0, 8 3, 0 6",fill:l})}))}))}),i("path",{ref:function(e){Ne.current[u]=e},d:o,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),i("path",{ref:function(e){Ne.current[a]=e},d:o,fill:"none",stroke:l,strokeWidth:"1.75",markerEnd:"url(#".concat(c,")")})]},t.id)})]})),r(v,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},ue?{flex:1,overflow:"visible"}:{})},{children:[i(v,e({ref:Qt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"40px",alignItems:"center",overflowX:"hidden"}},{children:i(m,e({title:At,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",textOverflow:"ellipsis",whiteSpace:"normal",width:"100%",height:"40px"}},{children:At}))}))})),r(v,e({ref:st,onScroll:_n,sx:e({p:"12px",display:"flex",flexDirection:"column"},ue?{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:at,style:{width:"100%",height:"0px",flexShrink:0}}),Wt&&Ht.map(function(t,n){var o,c,u=!t.title&&!t.content;if(ue&&u)return null;var a=t,d=wn(n),s=ue?!(null===(o=a.refIndexes)||void 0===o?void 0:o.length)||a.selfIndex<0:!Ot[n],p=ue?"number"==typeof a.selfIndex&&a.selfIndex>=0?a.selfIndex+1:null:n+1,f=Te.has(n),h=function(e,t){var n,i,r,o,l,c;if(!e)return t;var u=null!==(c=null!==(o=null!==(i=null===(n=e.evaluation_output)||void 0===n?void 0:n.output_score)&&void 0!==i?i:null===(r=e.evaluation_outputs)||void 0===r?void 0:r.output_score)&&void 0!==o?o:null===(l=e.evaluation_outputs)||void 0===l?void 0:l.output_value)&&void 0!==c?c:e.output_score;return null!=u?u:t}(a.evaluationResult,null==d?void 0:d.deviationLabel);return i(v,e({ref:Pt(n),sx:{mb:1,width:"100%"}},{children:r(v,e({sx:{position:"relative",width:"100%"}},{children:[i(v,e({ref:pn.current[n],sx:e({width:"100%",display:"flex"},f&&{borderRadius:"6px",outline:"2px solid ".concat((null==d?void 0:d.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:kn({section:t,idx:n,columnKey:"left",colRef:l.createRef(),mb:0,parentNodeId:(null===(c=null==$?void 0:$.input_index_map)||void 0===c?void 0:c[0])||""})})),ue&&d&&r(v,e({ref:hn.current[n],onClick:function(e){var i=ue?Ot.find(function(e){var t;return null===(t=a.refIndexes)||void 0===t?void 0:t.includes(e.selfIndex)})||{title:"",content:""}:Ot[n]||{title:"",content:""};qt(e,t,s,i,n,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!==p&&i(v,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(d.badgeBorder)}},{children:p})),i(v,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:s?"No Deviation Found":"N/A"===h||"NA"===h?"N/A":0==h||null==h?"Same":"".concat(h)})),i(w,{size:11,color:d.badgeText})]}))]}))}),"left-row-".concat(n))}),i("div",{ref:dt,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(v,e({sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0}},{children:i(v,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:r(v,e({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",borderRadius:"20px",bgcolor:"#ECFDF3",border:"1px solid #A7F3D0",color:"#15803D",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1}},{children:[i(v,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(R,{})})),0,"% Similarity",i(I,{size:11})]}))}))})),r(v,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},ue?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[fe&&i(C,{sections:11}),i(v,e({ref:Zt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:i(m,e({title:Dt,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",display:"flex",justifyContent:"center",alignItems:"center",textOverflow:"ellipsis",whiteSpace:"normal",width:"100%",height:"40px"}},{children:Dt}))}))})),r(v,e({ref:lt,onScroll:_n,sx:e({p:"12px",display:"flex",flexDirection:"column"},ue?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-25px",pl:"45px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:ct,style:{width:"100%",height:"0px",flexShrink:0}}),Wt&&Ot.map(function(t,n){var o,c=t,u=[],a=!1,d=null;if(ue){u=Ht.filter(function(e){var t;return(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(c.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1});var s=Ht.findIndex(function(e,t){var n;return Te.has(t)&&(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(c.selfIndex))});(a=-1!==s)&&(d=wn(s))}else u=[n+1],(a=Te.has(n))&&(d=wn(n));return i(v,e({ref:xn.current[n],sx:{mb:1,width:"100%"}},{children:r(v,e({sx:{position:"relative",width:"100%"}},{children:[i(v,e({ref:fn.current[n],sx:e({width:"100%",display:"flex"},a&&d&&{borderRadius:"6px",outline:"2px solid ".concat(d.badgeBorder),outlineOffset:"1px"})},{children:kn({section:t,idx:n,columnKey:"right",colRef:l.createRef(),mb:0,parentNodeId:(null===(o=null==$?void 0:$.input_index_map)||void 0===o?void 0:o[1])||""})})),ue&&!fe&&i(v,e({ref:gn.current[n],sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:"#EEF2FF",color:"#3730A3",border:"1px solid #C7D2FE",borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:u.length>0?u.join(", "):"-"}))]}))}),"right-row-".concat(n))}),i("div",{ref:ut,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{K as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsxs as i,Fragment as n,jsx as t}from"react/jsx-runtime";import{useMemo as e,useState as r,useEffect as l}from"react";import{Box as a,Typography as s,IconButton as c}from"@mui/material";import{X as d}from"lucide-react";import p from"react-dom";import v from"../../assests/svg/SparkleIcon.js";import{SHARED_MARKDOWN_STYLES as x,DEFAULT_POPUP_CONFIG as h}from"./CognitiveCompareConfig.js";import u from"./CitationRenderer.js";var b=10,g=function(g){var f,m,w,y,F,k,S,C,D,E,
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as i,Fragment as n,jsx as t}from"react/jsx-runtime";import{useMemo as e,useState as r,useEffect as l}from"react";import{Box as a,Typography as s,IconButton as c}from"@mui/material";import{X as d}from"lucide-react";import p from"react-dom";import v from"../../assests/svg/SparkleIcon.js";import{SHARED_MARKDOWN_STYLES as x,DEFAULT_POPUP_CONFIG as h}from"./CognitiveCompareConfig.js";import u from"./CitationRenderer.js";var b=10,g=function(g){var f,m,w,y,F,k,S,C,D,_,E,R,z,W,I,T,j,A,B,L,H,M,O=g.open,G=g.onClose,N=g.sectionTitle,P=g.referenceSectionTitle,Y=g.cognitiveData,q=g.relevanceScore,J=g.anchorEl,K=g.badgeStyle,Q=g.popupRef,U=g.position,V=g.markdownStyles,X=g.docData,Z=g.popupConfig,$=g.deviationData,oo=o(o({},x),V),io=e(function(){var i,n;return o(o(o({},h),Z),{tabs:{deviation:o(o({},h.tabs.deviation),null===(i=null==Z?void 0:Z.tabs)||void 0===i?void 0:i.deviation),association:o(o({},h.tabs.association),null===(n=null==Z?void 0:Z.tabs)||void 0===n?void 0:n.association)},sectionTitles:o(o({},h.sectionTitles),null==Z?void 0:Z.sectionTitles)})},[Z]),no=null==Y?void 0:Y.isMissingRationale,to=r(no?io.tabs.deviation.key:io.tabs.association.key),eo=to[0],ro=to[1];l(function(){O&&ro(no?io.tabs.deviation.key:io.tabs.association.key)},[O,no,io.tabs.deviation.key,io.tabs.association.key]);var lo=e(function(){if(!K)return{border:io.accentColor,shadow:"".concat(io.accentColor,"2E")};var o=K.badgeText;return"#9F1239"===o||"#B42318"===o?{border:"#E11D48",shadow:"rgba(225,29,72,0.15)"}:"#1D4ED8"===o?{border:"#3B82F6",shadow:"rgba(59,130,246,0.15)"}:"#A16207"===o?{border:"#F59E0B",shadow:"rgba(245,158,11,0.15)"}:{border:io.accentColor,shadow:"".concat(io.accentColor,"2E")}},[K,io.accentColor]);if(l(function(){if(O){var o=function(o){var i;(null===(i=Q.current)||void 0===i?void 0:i.contains(o.target))||(null==J?void 0:J.contains(o.target))||G()};return document.addEventListener("mousedown",o),function(){return document.removeEventListener("mousedown",o)}}},[O,G,J,Q]),!O||!Y)return null;var ao=null!==(w=null!==(m=eo===io.tabs.deviation.key?null===(f=null==$?void 0:$.cognitive_decisioning)||void 0===f?void 0:f.decision_strength:Y.relevance_score)&&void 0!==m?m:q)&&void 0!==w?w:0,so=Y.decisioning,co=Array.isArray(so)?so:"string"==typeof so&&so.trim()?[so]:[],po=Y.gap,vo=Array.isArray(po)?po:"string"==typeof po&&po.trim()?[po]:[],xo=null!==(y=null==U?void 0:U.arrowLeft)&&void 0!==y?y:60,ho=i(a,o({ref:Q,sx:{position:"fixed",top:null!==(F=null==U?void 0:U.top)&&void 0!==F?F:-9999,left:null!==(k=null==U?void 0:U.left)&&void 0!==k?k:-9999,zIndex:9999,width:"100%",maxWidth:"min(".concat(880,"px, calc(100vw - ").concat(null!==(S=null==U?void 0:U.left)&&void 0!==S?S:0,"px - ").concat(12,"px))"),bgcolor:"#FFFFFF",borderRadius:"14px",border:"1.5px solid ".concat(lo.border),boxShadow:"0px 8px 32px ".concat(lo.shadow,", 0px 0px 0px 3px ").concat(lo.shadow),overflow:"visible",display:"flex",flexDirection:"column",maxHeight:(null==U?void 0:U.maxHeight)?"min(60vh, ".concat(U.maxHeight,"px)"):"60vh",visibility:U?"visible":"hidden"}},{children:[U&&(U.openAbove?i(n,{children:[t(a,{sx:{position:"absolute",bottom:-11,left:xo-b,width:0,height:0,borderLeft:"".concat(b,"px solid transparent"),borderRight:"".concat(b,"px solid transparent"),borderTop:"".concat(11,"px solid ").concat(lo.border),zIndex:1}}),t(a,{sx:{position:"absolute",bottom:-9,left:xo-b+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderTop:"".concat(b,"px solid #FFFFFF"),zIndex:2}})]}):i(n,{children:[t(a,{sx:{position:"absolute",top:-11,left:xo-b,width:0,height:0,borderLeft:"".concat(b,"px solid transparent"),borderRight:"".concat(b,"px solid transparent"),borderBottom:"".concat(11,"px solid ").concat(lo.border),zIndex:1}}),t(a,{sx:{position:"absolute",top:-9,left:xo-b+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderBottom:"".concat(b,"px solid #FFFFFF"),zIndex:2}})]})),i(a,o({sx:{px:2.5,pt:2,pb:1.5,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:2,flexShrink:0}},{children:[i(a,o({sx:{flex:1,minWidth:0}},{children:[("no title"!==N||"no title"!==P)&&i(s,o({sx:{fontSize:"16px",fontWeight:600,color:"#101828",lineHeight:1.3,display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap",overflow:"hidden",width:"100%"}},{children:[t(a,o({component:"span",title:N,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"0 1 auto",maxWidth:"calc(50% - 16px)",minWidth:0}},{children:N})),t(a,o({component:"span",sx:{color:"#667085",fontWeight:400,flexShrink:0,mx:.5}},{children:"↔"})),t(a,o({component:"span",title:P||"Reference Section",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0}},{children:P||"Reference Section"}))]})),t(a,o({sx:{mt:.75,display:"inline-flex",alignItems:"center",gap:.75}},{children:t(s,o({sx:{fontSize:"13px",fontWeight:400,color:"#5928ED",lineHeight:1}},{children:null===(C=Object.values(io.tabs).find(function(o){return o.key===eo}))||void 0===C?void 0:C.subtitle}))}))]})),i(a,o({sx:{display:"flex",alignItems:"center",gap:1.5,flexShrink:0}},{children:[i(a,o({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:.5,borderRadius:"20px",bgcolor:"#FFFFFF",border:"1px solid #5928ED",fontSize:"12px",fontWeight:600,color:"#5928ED"}},{children:[t(v,{}),io.decisionStrengthLabel," ",ao,"%"]})),t(c,o({onClick:G,size:"small",sx:{color:"#667085",width:24,height:24,"&:hover":{bgcolor:"transparent",color:"#101828"}}},{children:t(d,{size:22})}))]}))]})),t(a,o({sx:{display:"flex",borderBottom:"1px solid #E4E7EC",px:2.5,flexShrink:0}},{children:(no?[io.tabs.deviation]:[io.tabs.deviation,io.tabs.association]).map(function(i){var n=eo===i.key;return t(a,o({onClick:function(){return ro(i.key)},sx:{pb:"10px",pt:"4px",mr:3,px:2,cursor:"pointer",fontSize:"14px",fontWeight:n?600:400,color:n?io.accentColor:"#667085",backgroundColor:n?"".concat(io.accentColor,"14"):"transparent",borderBottom:n?"2px solid ".concat(io.accentColor):"2px solid transparent",transition:"all 0.15s",userSelect:"none"}},{children:i.label}),i.key)})})),t(a,o({sx:{flex:1,minHeight:0,overflowY:"auto",px:2.5,py:2,display:"flex",flexDirection:"column",gap:1.5,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"".concat(lo.border,"55"),borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:lo.border},scrollbarWidth:"thin",scrollbarColor:"".concat(lo.border,"55 transparent")}},{children:eo===io.tabs.deviation.key?$?i(n,{children:[(null===(_=(null===(D=null==$?void 0:$.cognitive_decisioning)||void 0===D?void 0:D.decisioning_factors)||[])||void 0===_?void 0:_.length)>0&&t(u,{title:"Decision Making Factors",content:null===(R=null===(E=null==$?void 0:$.cognitive_decisioning)||void 0===E?void 0:E.decisioning_factors)||void 0===R?void 0:R.join("\n\n"),citations:null===(z=null==$?void 0:$.cognitive_decisioning)||void 0===z?void 0:z.citations,styles:oo,docData:X,open:O}),(null===(I=(null===(W=null==$?void 0:$.cognitive_decisioning)||void 0===W?void 0:W.gaps_in_decision)||[])||void 0===I?void 0:I.length)>0&&t(u,{title:"Gaps in Decision",content:null===(j=null===(T=null==$?void 0:$.cognitive_decisioning)||void 0===T?void 0:T.gaps_in_decision)||void 0===j?void 0:j.join("\n\n"),citations:null===(A=null==$?void 0:$.cognitive_decisioning)||void 0===A?void 0:A.citations,styles:oo,docData:X,open:O}),0===(null===(L=(null===(B=null==$?void 0:$.cognitive_decisioning)||void 0===B?void 0:B.decisioning_factors)||[])||void 0===L?void 0:L.length)&&0===(null===(M=(null===(H=null==$?void 0:$.cognitive_decisioning)||void 0===H?void 0:H.gaps_in_decision)||[])||void 0===M?void 0:M.length)&&t(a,o({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:t(s,o({sx:{fontSize:"13px",color:"#64748B"}},{children:"No cognitive decisioning data available for this section."}))}))]}):t(u,{title:"Deviation Analysis",content:"Deviation analysis content will appear here. This tab shows\n structural and semantic deviations identified between the two\n sections being compared.",citations:{},styles:oo,docData:X,open:O}):i(n,{children:[co.length>0&&t(u,{title:io.sectionTitles.decisioningFactors,content:co.join("\n\n"),citations:Y.citations,styles:oo,open:O,docData:X}),vo.length>0&&t(u,{title:io.sectionTitles.gaps,content:vo.join("\n\n"),citations:Y.citations,styles:oo,open:O,docData:X}),0===co.length&&0===vo.length&&t(a,o({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:t(s,o({sx:{fontSize:"13px",color:"#64748B"}},{children:io.emptyStateMessage}))}))]})}))]}));return p.createPortal(ho,document.body)};export{g as default};
|
|
2
2
|
//# sourceMappingURL=CognitivePopup.js.map
|