@e-llm-studio/citation 0.0.232 → 0.0.233

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.
Files changed (37) hide show
  1. package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
  2. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
  3. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/helper.js +1 -1
  4. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
  5. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  6. package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  7. package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  8. package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  9. package/dist/cjs/features/CognitiveCompare/utils/buildComparisonRows.js +2 -0
  10. package/dist/cjs/features/CognitiveCompare/utils/buildComparisonRows.js.map +1 -0
  11. package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
  12. package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
  13. package/dist/features/CognitiveCompare/Guidelines/utils/helper.js +1 -1
  14. package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
  15. package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  16. package/dist/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  17. package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  18. package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  19. package/dist/features/CognitiveCompare/utils/buildComparisonRows.js +2 -0
  20. package/dist/features/CognitiveCompare/utils/buildComparisonRows.js.map +1 -0
  21. package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
  22. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
  23. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
  24. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +13 -0
  25. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
  26. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +1421 -898
  27. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
  28. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/helper.d.ts.map +1 -1
  29. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -1
  30. package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
  31. package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts.map +1 -1
  32. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +2 -1
  33. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
  34. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
  35. package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.d.ts +11 -0
  36. package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.d.ts.map +1 -0
  37. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as t,jsx as i}from"react/jsx-runtime";import{ChevronDown as n}from"lucide-react";import{ButtonCognitiveIcon as o}from"../../../assests/svg/ButtonCognitiveIcon.js";import{getBentArrowPath as l,DEVIATION_BADGE_SEPARATOR as s}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as r}from"../CognitiveCompareConstants.js";import a from"./ThreeDotsLoader.js";import d from"./connectedLines.js";import{Box as c}from"@mui/material";function u(u){var g=u.svgContainerRef,p=u.svgDimensions,v=u.isResizing,h=u.overallConnector,y=u.rootDeviationStyle,f=u.lines,m=u.isSideBySide,x=u.activeSideBySideSection,b=u.isArrowVisible,S=u.maintainRelativeOrder,C=u.proposedSections,I=u.existingSections,w=u.cognitivePopup,B=u.activeBadgeId,P=u.closeCognitivePopup,R=u.setActiveBadgeId,j=u.openCognitivePopupFromState,D=u.buildSectionPopupState,k=u.connectedLines,K=u.pathRefs,L=u.isGuidelineMode;return t("svg",e({ref:g,style:{position:"absolute",top:0,left:0,width:p.width||"100%",height:p.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:v?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[h&&i("g",{children:i("line",{x1:h.x1,y1:h.y,x2:h.x2,y2:h.y,stroke:y.badgeBorder,strokeWidth:"1.5"})}),f.map(function(d){var u,g,p,v,h,y,f,k=d.x1+.5*(d.x2-d.x1),K=(d.y1+d.y2)/2;if("Not Defined"===d.style.label&&!d.hasCognitive)return null;if(d.isSubSection?m&&x===d.subSectionKeyPath&&b:m&&x===d.sectionIdx&&b)return null;if(S)return null;var L=d.isSubSection?l(d.x1,d.y1,d.x2,d.y2):"M ".concat(d.x1," ").concat(d.y1," L ").concat(d.x2," ").concat(d.y2),T=C[d.sectionIdx]||{title:"",content:""},z=I[null!==(u=d.targetRightIdx)&&void 0!==u?u:d.sectionIdx]||{title:"",content:""};if(d.isSubSection&&d.subSectionKeyPath){var E=d.subSectionKeyPath.includes(s)?d.subSectionKeyPath.split(s):[],M=E[2]||d.subSectionKeyPath,A=E[3]||M,N=M.split("-").map(Number),O=A.split("-").map(Number),W=null,F=null;N.length>0&&(W=C[N[0]]||null),O.length>0&&(F=I[O[0]]||null);for(var G=(null==W?void 0:W.title)||"",_=(null==F?void 0:F.title)||"",V=1;V<N.length;V+=1)(null==W?void 0:W.subsections)&&(W=W.subsections[N[V]]||null);for(V=1;V<O.length;V+=1)(null==F?void 0:F.subsections)&&(F=F.subsections[O[V]]||null);W&&(T=e(e({},W),{title:G||W.title})),F&&(z=e(e({},F),{title:_||F.title}))}var q=!(null===(g=T.cognitiveData)||void 0===g?void 0:g.isMissingRationale)||Boolean(null===(v=null===(p=T.cognitiveData)||void 0===p?void 0:p.decisioning)||void 0===v?void 0:v.length),H=(null===(f=null===(y=null===(h=T.evaluationResult)||void 0===h?void 0:h.cognitive_decisioning)||void 0===y?void 0:y.decisioning_factors)||void 0===f?void 0:f.length)||!1,J=q||H;return t("g",{children:[i("path",{d:L,fill:"none",stroke:d.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i("foreignObject",e({x:k-100,y:K-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(c,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t(c,e({onClick:function(e){e.stopPropagation(),J&&(w.open&&B===d.id?P():(R(d.id),j(D(e.currentTarget,T,z,d.sectionIdx,!1,d.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:d.style.badgeBg,color:d.style.badgeText,border:"1px solid ".concat(d.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:J?"pointer":"default"}},{children:[d.style.badgeText===r&&null==d.style.label?i(a,{color:d.style.badgeText}):null==d.style.label?null:"0"===String(d.style.label)?"Same":d.style.label,i(c,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(o,{})})),J&&i(n,{size:11,style:{transform:w.open&&B===d.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},d.id)}),i(d,{maintainRelativeOrder:S,connectedLines:k,pathRefs:K,isGuidelineMode:L})]}))}export{u as default};
1
+ import{__spreadArray as e,__assign as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import{ChevronDown as o}from"lucide-react";import{ButtonCognitiveIcon as l}from"../../../assests/svg/ButtonCognitiveIcon.js";import{getBentArrowPath as s,DEVIATION_BADGE_SEPARATOR as r}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as a}from"../CognitiveCompareConstants.js";import c from"./ThreeDotsLoader.js";import d from"./connectedLines.js";import{Box as u}from"@mui/material";function p(p){var g=p.svgContainerRef,v=p.svgDimensions,h=p.isResizing,y=p.overallConnector,m=p.rootDeviationStyle,f=p.lines,x=p.isSideBySide,b=p.activeSideBySideSection,S=p.isArrowVisible,C=p.maintainRelativeOrder,B=p.proposedSections,I=p.existingSections,w=p.cognitivePopup,P=p.activeBadgeId,R=p.closeCognitivePopup,M=p.setActiveBadgeId,j=p.openCognitivePopupFromState,L=p.buildSectionPopupState,D=p.connectedLines,k=p.pathRefs,K=p.isGuidelineMode,N=e([],f,!0).sort(function(e,t){return Number(Boolean(t.isMappingContinuation))-Number(Boolean(e.isMappingContinuation))});return i("svg",t({ref:g,style:{position:"absolute",top:0,left:0,width:v.width||"100%",height:v.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:h?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[y&&n("g",{children:n("line",{x1:y.x1,y1:y.y,x2:y.x2,y2:y.y,stroke:m.badgeBorder,strokeWidth:"1.5"})}),N.map(function(e){var d,p,g,v,h,y,m,f=e.x1+.5*(e.x2-e.x1),D=(e.y1+e.y2)/2,k=f;if("Not Defined"===e.style.label&&!e.hasCognitive)return null;if(e.isSubSection?x&&b===e.subSectionKeyPath&&S:x&&b===e.sectionIdx&&S)return null;if(C)return null;var K=e.isMappingContinuation?"M ".concat(k," ").concat(e.y1," L ").concat(k," ").concat(e.y2," L ").concat(e.x2," ").concat(e.y2):e.isSubSection?s(e.x1,e.y1,e.x2,e.y2):"M ".concat(e.x1," ").concat(e.y1," L ").concat(e.x2," ").concat(e.y2),N=B[e.sectionIdx]||{title:"",content:""},T=I[null!==(d=e.targetRightIdx)&&void 0!==d?d:e.sectionIdx]||{title:"",content:""};if(e.isSubSection&&e.subSectionKeyPath){var z=e.subSectionKeyPath.includes(r)?e.subSectionKeyPath.split(r):[],E=z[2]||e.subSectionKeyPath,A=z[3]||E,O=E.split("-").map(Number),W=A.split("-").map(Number),F=null,G=null;O.length>0&&(F=B[O[0]]||null),W.length>0&&(G=I[W[0]]||null);for(var _=(null==F?void 0:F.title)||"",V=(null==G?void 0:G.title)||"",q=1;q<O.length;q+=1)(null==F?void 0:F.subsections)&&(F=F.subsections[O[q]]||null);for(q=1;q<W.length;q+=1)(null==G?void 0:G.subsections)&&(G=G.subsections[W[q]]||null);F&&(N=t(t({},F),{title:_||F.title})),G&&(T=t(t({},G),{title:V||G.title}))}var H=!(null===(p=N.cognitiveData)||void 0===p?void 0:p.isMissingRationale)||Boolean(null===(v=null===(g=N.cognitiveData)||void 0===g?void 0:g.decisioning)||void 0===v?void 0:v.length),J=(null===(m=null===(y=null===(h=N.evaluationResult)||void 0===h?void 0:h.cognitive_decisioning)||void 0===y?void 0:y.decisioning_factors)||void 0===m?void 0:m.length)||!1,Q=H||J;return i("g",{children:[n("path",{d:K,fill:"none",stroke:e.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),!e.isMappingContinuation&&n("foreignObject",t({x:f-100,y:D-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:n(u,t({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:i(u,t({onClick:function(t){t.stopPropagation(),Q&&(w.open&&P===e.id?R():(M(e.id),j(L(t.currentTarget,N,T,e.sectionIdx,!1,e.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:e.style.badgeBg,color:e.style.badgeText,border:"1px solid ".concat(e.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:Q?"pointer":"default"}},{children:[e.style.badgeText===a&&null==e.style.label?n(c,{color:e.style.badgeText}):null==e.style.label?null:"0"===String(e.style.label)?"Same":e.style.label,n(u,t({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n(l,{})})),Q&&n(o,{size:11,style:{transform:w.open&&P===e.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},e.id)}),n(d,{maintainRelativeOrder:C,connectedLines:D,pathRefs:k,isGuidelineMode:K})]}))}export{p as default};
2
2
  //# sourceMappingURL=SvgConnectors.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as n,__spreadArray as e}from"tslib";import{useMemo as t}from"react";import{isMissingStr as i,safeStringify as o,getRationale as r,resolveComparisonInputItems as a,getSideData as d,hasValue as l,DEVIATION_BADGE_SEPARATOR as s}from"../CognitiveComparehelpers.js";var u={id:"",title:"",similarity:0,sections:[]},v=function(v,c,f,p,I,_){var h,g;void 0===I&&(I=!0);var m="string"==typeof f?f:JSON.stringify(f||{}),x=Boolean(_&&(null===(g=null===(h=_.data)||void 0===h?void 0:h.artifactData)||void 0===g?void 0:g.userStorySnapshot)),b=t(function(){var t;if(!v||0===Object.keys(v).length)return{activeProposed:{},activeVariants:[],parseError:"Tree data is required"};var l=JSON.parse(m);try{var s=v.nodes||v,u=[],f=[],p=v.base_root_id,h=v.input_index_map||{0:"left",1:"right"},g=v[p]||s[p];if(!g||!1===g.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[],parseError:null};var b=v.content_mapping||{},y=function(n){return v[n]||s[n]},R=function(e,t,o){if(!e||"object"!=typeof e)return e||null;if(e.deviations)return e;if(I)return e;var r=Object.keys(e).filter(function(n){return/^\d+$/.test(n)});if(!r.length)return e;var a=r.sort(function(n,e){return Number(n)-Number(e)}),d={},l={},s=null;return a.forEach(function(n){var r,a,u,v,c,f=e[n];if(f&&"object"==typeof f){s||(s=f);var p=!(null==f?void 0:f.status)||"pending"===f.status,I=function(n){var e,t=(null===(e=null==f?void 0:f.cognitive_decisioning)||void 0===e?void 0:e.citations)||(null==f?void 0:f.citations)||{};return Object.values(t).map(function(e){var t;return null===(t=null==e?void 0:e[n])||void 0===t?void 0:t.highlighted_text}).filter(function(n){return"string"==typeof n&&n.trim().length>0})},_=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=0,o=n;t<o.length;t++){var r=o[t];if(Array.isArray(r)&&r.some(function(n){return!i(n)}))return r}return[]},g=p?_((null===(a=null==f?void 0:f.deviation_highlights)||void 0===a?void 0:a[t])||(null===(u=null==f?void 0:f.deviation_highlights)||void 0===u?void 0:u[h[0]]),I(t),I(h[0])):[],m=p?_((null===(v=null==f?void 0:f.deviation_highlights)||void 0===v?void 0:v[o])||(null===(c=null==f?void 0:f.deviation_highlights)||void 0===c?void 0:c[h[1]]),I(o),I(h[1])):[];d[n]=((r={})[h[0]]=g[0]||"",r[h[1]]=m[0]||"",r.deviation_summary=(null==f?void 0:f.deviation_summary)||"",r.deviation_title=null==f?void 0:f.deviation_title,r.deviation_impact=null==f?void 0:f.deviation_impact,r.deviation_explanation=null==f?void 0:f.deviation_explanation,r.evaluation_outputs=null==f?void 0:f.evaluation_outputs,r.cognitive_decisioning=null==f?void 0:f.cognitive_decisioning,r.deviation_highlights=null==f?void 0:f.deviation_highlights,r),l[n]=f}}),n(n({},e),{deviation_title:(null==s?void 0:s.deviation_title)||(null==e?void 0:e.deviation_title),deviation_impact:(null==s?void 0:s.deviation_impact)||(null==e?void 0:e.deviation_impact),deviation_summary:(null==s?void 0:s.deviation_summary)||(null==e?void 0:e.deviation_summary),deviation_explanation:(null==s?void 0:s.deviation_explanation)||(null==e?void 0:e.deviation_explanation),evaluation_outputs:(null==s?void 0:s.evaluation_outputs)||(null==e?void 0:e.evaluation_outputs),cognitive_decisioning:(null==s?void 0:s.cognitive_decisioning)||(null==e?void 0:e.cognitive_decisioning),deviations:d,deviation_entries:l})},C=function(n){var e=new Map,t=function(n){n.forEach(function(n){var i;n.id&&e.set(n.id,n),(null===(i=n.subsections)||void 0===i?void 0:i.length)&&t(n.subsections)})};t(n);var i=function(n,t){for(var o,r=[],a=function(n){var a=n.ref_parent_section_node_id;if(a&&e.has(a)&&a!==(null==t?void 0:t.id)){var d=e.get(a);d.subsections||(d.subsections=[]),d.subsections.some(function(e){return e.id===n.id})||d.subsections.push(n)}else(null===(o=n.subsections)||void 0===o?void 0:o.length)&&(n.subsections=i(n.subsections,n)),r.push(n)},d=0,l=n;d<l.length;d++){a(l[d])}return r},o=i(n),r=function(n){n.forEach(function(n){n.subsections&&n.subsections.length>0&&(n.subsections.sort(function(n,e){return n.selfIndex<0&&e.selfIndex>=0?1:n.selfIndex>=0&&e.selfIndex<0?-1:(n.selfIndex||0)-(e.selfIndex||0)}),r(n.subsections))})};return r(o),o},E=function(n){var e=n.comparison_inputs?Object.keys(n.comparison_inputs):[],t=h[0],i=h[1];return e.length>0&&(t=e.includes(h[0])?h[0]:e[0],i=e.includes(h[1])?h[1]:e.length>1?e[1]:e[0]),{nodeLeftId:t,nodeRightId:i}},O=function(e,t,i,r){var a=t.attributes||{},d=t.data||{},l=!1!==a.display_title,s=!1!==a.display_content,u=l?o(d.title||""):"",v=s?o(d.content||""):"",c=s?o(d.change_history||""):"",f=void 0!==a.display_index&&null!==a.display_index?Number(a.display_index):-1,p=function(n){return(null==n?void 0:n.entity_id)||(null==n?void 0:n.ref_parent_section_node_id)||(null==n?void 0:n.parent_entity_id)||null}(a),I=!(!u.trim()&&!v.trim());return n(n({id:"".concat(e,"::").concat(t.contentId),nodeId:e,contentId:t.contentId,parentContentId:p,title:u,content:v,change_history:c,displayTitle:l,displayContent:s,subsections:[]},I?r:{score:void 0,relation:"not_defined"}),{evaluationResult:i,evaluationResults:i?[i]:[],selfIndex:f,refIndexes:[],refContentIds:[],ref_parent_section_node_id:p})},N=function(n,t){n.refIndexes=Array.from(new Set(e(e([],n.refIndexes||[],!0),t.refIndexes||[],!0))),n.refContentIds=Array.from(new Set(e(e([],n.refContentIds||[],!0),t.refContentIds||[],!0)));var i=new Set((n.subsections||[]).map(function(n){return n.id||n.contentId||n.nodeId}));(t.subsections||[]).forEach(function(t){var o=t.id||t.contentId||t.nodeId;i.has(o)||(n.subsections=e(e([],n.subsections||[],!0),[t],!1),i.add(o))});var o=e(e([],n.evaluationResults||(n.evaluationResult?[n.evaluationResult]:[]),!0),t.evaluationResults||(t.evaluationResult?[t.evaluationResult]:[]),!0).filter(Boolean),r=new Set;return n.evaluationResults=o.filter(function(n){var e=(null==n?void 0:n.nodeId)||JSON.stringify(Object.keys((null==n?void 0:n.deviations)||n||{}));return!r.has(e)&&(r.add(e),!0)}),!n.evaluationResult&&t.evaluationResult&&(n.evaluationResult=t.evaluationResult),!n.cognitiveData&&t.cognitiveData&&(n.cognitiveData=t.cognitiveData),n},S=function(n,e){return n.selfIndex<0&&e.selfIndex>=0?1:n.selfIndex>=0&&e.selfIndex<0?-1:n.selfIndex-e.selfIndex},j=function(e,t){var i,o=y(e);if(!o||!1===o.display_node)return[];if(x&&"1"===t)return[];var d=E(o),s=d.nodeLeftId,u=d.nodeRightId,v=r(o),c=(null===(i=null==l?void 0:l[e])||void 0===i?void 0:i.evaluation_result)||o.evaluation_result||null,f=R(c,s,u),p=f&&"object"==typeof f?n(n({},f),{nodeId:e}):f,I=a(o,t,h,b).map(function(n){return O(e,n,p,v)});if(o.next){var _=Object.values(o.next).flatMap(function(n){return j(n,t)});I.forEach(function(n){var e=_.filter(function(e){return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId});n.subsections=e.length?e:_})}return I};if(c){var D=function(e,t){var i;void 0===t&&(t=0);var o=[],d=[];if(!e)return{refSections:o,baseSections:d};var s={},u={},v=-1,c=-1,f=function(o){var d=e[o],f=y(d);if(!f||!1===f.display_node)return"continue";var p=E(f),I=p.nodeLeftId,_=p.nodeRightId,g=r(f),m=(null===(i=null==l?void 0:l[d])||void 0===i?void 0:i.evaluation_result)||f.evaluation_result||null,C=R(m,I,_),S=C&&"object"==typeof C?n(n({},C),{nodeId:d}):C,j=D(f.next,t+1),P=j.refSections,k=j.baseSections,K=a(f,"0",h,b).map(function(n){var e=O(d,n,S,g);return-1===e.selfIndex&&(e.selfIndex=c--),e}),w=[];if(!x){var V=a(f,"1",h,b);w=V.map(function(n){var e=O(d,n,S,g);return-1===e.selfIndex&&(e.selfIndex=v--),e})}K.forEach(function(n){w.forEach(function(e){var t,i,o,r,a,d,l,s;Number(e.selfIndex)>=0&&Number(n.selfIndex)>=0&&((null===(t=e.refIndexes)||void 0===t?void 0:t.includes(Number(n.selfIndex)))||null===(i=e.refIndexes)||void 0===i||i.push(Number(n.selfIndex)),(null===(o=n.refIndexes)||void 0===o?void 0:o.includes(Number(e.selfIndex)))||null===(r=n.refIndexes)||void 0===r||r.push(Number(e.selfIndex))),n.contentId&&!(null===(a=e.refContentIds)||void 0===a?void 0:a.includes(n.contentId))&&(null===(d=e.refContentIds)||void 0===d||d.push(n.contentId)),e.contentId&&!(null===(l=n.refContentIds)||void 0===l?void 0:l.includes(e.contentId))&&(null===(s=n.refContentIds)||void 0===s||s.push(e.contentId))})}),w.forEach(function(n){var e=P.filter(function(e){var t;return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId||(null===(t=n.refContentIds)||void 0===t?void 0:t.includes(e.parentContentId))});e.length>0&&(n.subsections=e);var i=0===t?String(n.selfIndex):"".concat(n.selfIndex,"_").concat(n.contentId||d);s[i]=s[i]?N(s[i],n):n}),K.forEach(function(n){var e=k.filter(function(e){var t;return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId||(null===(t=n.refContentIds)||void 0===t?void 0:t.includes(e.parentContentId))});e.length>0&&(n.subsections=e);var i=0===t?String(n.selfIndex):"".concat(n.selfIndex,"_").concat(n.contentId||d);u[i]=u[i]?N(u[i],n):n})};for(var p in e)f(p);return o=Object.values(s),d=Object.values(u),o.sort(S),d.sort(S),{refSections:o,baseSections:d}},P=D(g.next),k=P.refSections,K=P.baseSections;x||(f=C(k)),u=K}else g.next&&Object.values(g.next).forEach(function(n){var e=y(n);e&&!1!==e.display_node&&(u.push.apply(u,j(n,"0")),x||f.push.apply(f,j(n,"1")))}),x||(f=C(f));var w=d(g,"0",h,b),V=d(g,"1",h,b);return{activeProposed:{title:w.title||"Uploaded Contract",description:g.decision_scope_description||"",sections:u},activeVariants:[{id:"tree-variant-1",title:x?(null===(t=null==_?void 0:_.data)||void 0===t?void 0:t.artifactTitle)||"Rulebook Guidelines":V.title||"Reference Template",similarity:0,sections:f,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:g.decision_scope_description||""},fields:{}}}}],parseError:null}}catch(n){return console.error("Data Transformation Error: ",n),{activeProposed:{},activeVariants:[],parseError:n instanceof Error?n.message:"Unknown Parsing Error"}}},[v,c,m,I,_]),y=b.activeProposed,R=b.activeVariants,C=b.parseError,E=(null==R?void 0:R[0])||u,O=t(function(){return(null==y?void 0:y.sections)||[]},[null==y?void 0:y.sections]),N=t(function(){return E.sections||[]},[E.sections]),S=O.length>0||N.length>0,j=t(function(){return p.fields.filter(function(n){var e=n.key;return(!S||"description"!==e)&&(l(null==y?void 0:y[e])||l(E[e]))})},[y,E,S,p.fields]),D=t(function(){var n,e,t={},o={},r={},a=0,d=null===(n=null==v?void 0:v.input_index_map)||void 0===n?void 0:n[0],l=null===(e=null==v?void 0:v.input_index_map)||void 0===e?void 0:e[1],u=function(n,e){if(!c){var t="left"===e?O.indexOf(n):N.indexOf(n);return{rootKey:"".concat(e,":").concat(t),parentNum:t+1}}if("left"===e){var i=n.selfIndex,o=void 0!==i&&i>=0?i+1:O.indexOf(n)+1;return{rootKey:"left-root:".concat(n.id),parentNum:o}}var r=n.selfIndex,a=O.find(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(r)});if(a){var d=a.selfIndex,l=void 0!==d&&d>=0?d+1:O.indexOf(a)+1;return{rootKey:"left-root:".concat(a.id),parentNum:l}}var s=void 0!==r&&r>=0?r+1:N.indexOf(n)+1;return{rootKey:"right-orphan-root:".concat(n.id),parentNum:s}},f=function(n,e){if(n&&e)return n.find(function(n){return n.id===e.id||n.nodeId&&n.nodeId===e.nodeId||n.contentId&&n.contentId===e.contentId})||void 0},p=function(n,e,u,v,c,I,_){if(e&&function(n,e,t){var a;((null===(a=null==n?void 0:n.evaluationResults)||void 0===a?void 0:a.length)?n.evaluationResults:(null==n?void 0:n.evaluationResult)?[n.evaluationResult]:[]).forEach(function(a){var u=(null==a?void 0:a.deviations)||{};Object.keys(u).sort().forEach(function(v){var c=u[v];if(c){var f=!i(c[d]),p=!i(c[l]);if(f||p){var I=(null==a?void 0:a.nodeId)||n.nodeId||n.id,_="".concat(I).concat(s).concat(v);void 0===o[_]&&(void 0===r[e]&&(r[e]=1),o[_]={index:r[e]++,rootKey:e,parentNum:t})}}})})}(e,v,c),e&&!I){var h=(null==_?void 0:_.id)||"fallback_parent_".concat(a++);t[h]||(t[h]=[]),t[h].push(e)}((null==e?void 0:e.subsections)||(null==n?void 0:n.subsections)||(null==u?void 0:u.subsections)||[]).forEach(function(t){var i=f(null==n?void 0:n.subsections,t),o=f(null==u?void 0:u.subsections,t);p(t,i,o,v,c,!1,e||_)})};O.forEach(function(n){var e,t=u(n,"left"),i=t.rootKey,o=t.parentNum,r=null;if(c){var a=null===(e=n.refIndexes)||void 0===e?void 0:e[0];r=N.find(function(n){return n.selfIndex===a})}else r=N[O.indexOf(n)];p(n,n,r,i,o,!0,n)}),x||N.forEach(function(n){var e=u(n,"right"),t=e.rootKey,i=e.parentNum;t.startsWith("right-orphan-root:")&&p(n,null,n,t,i,!0,n)});var I=Object.fromEntries(Object.entries(o).map(function(n){return[n[0],n[1].index]})),_=Object.fromEntries(Object.entries(o).map(function(n){return[n[0],n[1].parentNum]}));return{parentDeviationRecord:t,registry:I,deviationParentRegistry:_}},[O,N,c,v,x]),P=D.parentDeviationRecord,k=D.registry,K=D.deviationParentRegistry;return{isGuidelineMode:x,activeProposed:y,activeVariants:R,existingRule:E,proposedSections:O,existingSections:N,visibleFields:j,parentDeviationRecord:P,deviationNumberRegistry:k,deviationParentRegistry:K,parseError:C}};export{v as useCognitiveTreeData};
1
+ import{__assign as n,__spreadArray as e}from"tslib";import{useMemo as t}from"react";import{isMissingStr as i,safeStringify as o,getRationale as r,resolveComparisonInputItems as a,getSideData as l,hasValue as d,DEVIATION_BADGE_SEPARATOR as s}from"../CognitiveComparehelpers.js";import{buildComparisonRows as u}from"../utils/buildComparisonRows.js";var v={id:"",title:"",similarity:0,sections:[]},c=function(c,f,p,I,_,h){var g,m;void 0===_&&(_=!0);var x="string"==typeof p?p:JSON.stringify(p||{}),b=Boolean(h&&(h.learnings_data||(null===(m=null===(g=h.data)||void 0===g?void 0:g.artifactData)||void 0===m?void 0:m.userStorySnapshot))),y=t(function(){if(!c||0===Object.keys(c).length)return{activeProposed:{},activeVariants:[],comparisonRows:[],parseError:"Tree data is required"};var t=JSON.parse(x);try{var d=c.nodes||c,s=[],v=[],p=[],I=c.base_root_id,g=c.input_index_map||{0:"left",1:"right"},m=c[I]||d[I];if(!m||!1===m.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[],comparisonRows:[],parseError:null};var y=c.content_mapping||{},R=function(n){return c[n]||d[n]},C=function(e,t,o){if(!e||"object"!=typeof e)return e||null;if(e.deviations)return e;if(_)return e;var r=Object.keys(e).filter(function(n){return/^\d+$/.test(n)});if(!r.length)return e;var a=r.sort(function(n,e){return Number(n)-Number(e)}),l={},d={},s=null;return a.forEach(function(n){var r,a,u,v,c,f,p=e[n];if(p&&"object"==typeof p){s||(s=p);var I=!(null==p?void 0:p.status)||"pending"===p.status,_=(null==p?void 0:p.deviation_highlight)||(null===(a=null==p?void 0:p.web_search_answer)||void 0===a?void 0:a.deviation_highlight),h=function(n){var e,t=(null===(e=null==p?void 0:p.cognitive_decisioning)||void 0===e?void 0:e.citations)||(null==p?void 0:p.citations)||{};return Object.values(t).map(function(e){var t;return null===(t=null==e?void 0:e[n])||void 0===t?void 0:t.highlighted_text}).filter(function(n){return"string"==typeof n&&n.trim().length>0})},m=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=0,o=n;t<o.length;t++){var r=o[t];if(Array.isArray(r)&&r.some(function(n){return!i(n)}))return r}return[]},x=I?m((null===(u=null==p?void 0:p.deviation_highlights)||void 0===u?void 0:u[t])||(null===(v=null==p?void 0:p.deviation_highlights)||void 0===v?void 0:v[g[0]]),"string"==typeof _?[_]:[],h(t),h(g[0])):[],b=I?m((null===(c=null==p?void 0:p.deviation_highlights)||void 0===c?void 0:c[o])||(null===(f=null==p?void 0:p.deviation_highlights)||void 0===f?void 0:f[g[1]]),h(o),h(g[1])):[];l[n]=((r={})[g[0]]=x[0]||"",r[g[1]]=b[0]||"",r.deviation_summary=(null==p?void 0:p.deviation_summary)||"",r.deviation_title=null==p?void 0:p.deviation_title,r.deviation_impact=null==p?void 0:p.deviation_impact,r.deviation_explanation=null==p?void 0:p.deviation_explanation,r.evaluation_outputs=null==p?void 0:p.evaluation_outputs,r.cognitive_decisioning=null==p?void 0:p.cognitive_decisioning,r.deviation_highlights=null==p?void 0:p.deviation_highlights,r),d[n]=p}}),n(n({},e),{deviation_title:(null==s?void 0:s.deviation_title)||(null==e?void 0:e.deviation_title),deviation_impact:(null==s?void 0:s.deviation_impact)||(null==e?void 0:e.deviation_impact),deviation_summary:(null==s?void 0:s.deviation_summary)||(null==e?void 0:e.deviation_summary),deviation_explanation:(null==s?void 0:s.deviation_explanation)||(null==e?void 0:e.deviation_explanation),evaluation_outputs:(null==s?void 0:s.evaluation_outputs)||(null==e?void 0:e.evaluation_outputs),cognitive_decisioning:(null==s?void 0:s.cognitive_decisioning)||(null==e?void 0:e.cognitive_decisioning),deviations:l,deviation_entries:d})},E=function(n){var e=new Map,t=function(n){n.forEach(function(n){var i;n.id&&e.set(n.id,n),(null===(i=n.subsections)||void 0===i?void 0:i.length)&&t(n.subsections)})};t(n);var i=function(n,t){for(var o,r=[],a=function(n){var a=n.ref_parent_section_node_id;if(a&&e.has(a)&&a!==(null==t?void 0:t.id)){var l=e.get(a);l.subsections||(l.subsections=[]),l.subsections.some(function(e){return e.id===n.id})||l.subsections.push(n)}else(null===(o=n.subsections)||void 0===o?void 0:o.length)&&(n.subsections=i(n.subsections,n)),r.push(n)},l=0,d=n;l<d.length;l++){a(d[l])}return r},o=i(n),r=function(n){n.forEach(function(n){n.subsections&&n.subsections.length>0&&(n.subsections.sort(function(n,e){return n.selfIndex<0&&e.selfIndex>=0?1:n.selfIndex>=0&&e.selfIndex<0?-1:(n.selfIndex||0)-(e.selfIndex||0)}),r(n.subsections))})};return r(o),o},O=function(n){var e=n.comparison_inputs?Object.keys(n.comparison_inputs):[],t=g[0],i=g[1];return e.length>0&&(t=e.includes(g[0])?g[0]:e[0],i=e.includes(g[1])?g[1]:e.length>1?e[1]:e[0]),{nodeLeftId:t,nodeRightId:i}},j=function(e,t,i,r){var a=t.attributes||{},l=t.data||{},d=!1!==a.display_title,s=!1!==a.display_content,u=d?o(l.title||""):"",v=s?o(l.content||""):"",c=s?o(l.change_history||""):"",f=void 0!==a.display_index&&null!==a.display_index?Number(a.display_index):-1,p=function(n){return(null==n?void 0:n.entity_id)||(null==n?void 0:n.ref_parent_section_node_id)||(null==n?void 0:n.parent_entity_id)||null}(a),I=!(!u.trim()&&!v.trim());return n(n({id:"".concat(e,"::").concat(t.contentId),nodeId:e,contentId:t.contentId,parentContentId:p,title:u,content:v,change_history:c,displayTitle:d,displayContent:s,subsections:[]},I?r:{score:void 0,relation:"not_defined"}),{evaluationResult:i,evaluationResults:i?[i]:[],selfIndex:f,refIndexes:[],refContentIds:[],ref_parent_section_node_id:p})},N=function(n,t){n.refIndexes=Array.from(new Set(e(e([],n.refIndexes||[],!0),t.refIndexes||[],!0))),n.refContentIds=Array.from(new Set(e(e([],n.refContentIds||[],!0),t.refContentIds||[],!0)));var i=new Set((n.subsections||[]).map(function(n){return n.id||n.contentId||n.nodeId}));(t.subsections||[]).forEach(function(t){var o=t.id||t.contentId||t.nodeId;i.has(o)||(n.subsections=e(e([],n.subsections||[],!0),[t],!1),i.add(o))});var o=e(e([],n.evaluationResults||(n.evaluationResult?[n.evaluationResult]:[]),!0),t.evaluationResults||(t.evaluationResult?[t.evaluationResult]:[]),!0).filter(Boolean),r=new Set;return n.evaluationResults=o.filter(function(n){var e=(null==n?void 0:n.nodeId)||JSON.stringify(Object.keys((null==n?void 0:n.deviations)||n||{}));return!r.has(e)&&(r.add(e),!0)}),!n.evaluationResult&&t.evaluationResult&&(n.evaluationResult=t.evaluationResult),!n.cognitiveData&&t.cognitiveData&&(n.cognitiveData=t.cognitiveData),n},S=function(n,e){return n.selfIndex<0&&e.selfIndex>=0?1:n.selfIndex>=0&&e.selfIndex<0?-1:n.selfIndex-e.selfIndex},w=function(e,i){var o,l=R(e);if(!l||!1===l.display_node)return[];if(b&&"1"===i)return[];var d=O(l),s=d.nodeLeftId,u=d.nodeRightId,v=r(l),c=(null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.evaluation_result)||l.evaluation_result||null,f=C(c,s,u),p=f&&"object"==typeof f?n(n({},f),{nodeId:e}):f,I=a(l,i,g,y).map(function(n){return j(e,n,p,v)});if(l.next){var _=Object.values(l.next).flatMap(function(n){return w(n,i)});I.forEach(function(n){var e=_.filter(function(e){return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId});n.subsections=e.length?e:_})}return I};if(f){var k=function(e,i){var o;void 0===i&&(i=0);var l=[],d=[];if(!e)return{refSections:l,baseSections:d};var s={},u={},v=-1,c=-1,f=function(l){var d=e[l],f=R(d);if(!f||!1===f.display_node)return"continue";var p=O(f),I=p.nodeLeftId,_=p.nodeRightId,h=r(f),m=(null===(o=null==t?void 0:t[d])||void 0===o?void 0:o.evaluation_result)||f.evaluation_result||null,x=C(m,I,_),E=x&&"object"==typeof x?n(n({},x),{nodeId:d}):x,S=k(f.next,i+1),w=S.refSections,D=S.baseSections,P=a(f,"0",g,y).map(function(n){var e=j(d,n,E,h);return-1===e.selfIndex&&(e.selfIndex=c--),e}),K=[];if(!b){var V=a(f,"1",g,y);K=V.map(function(n){var e=j(d,n,E,h);return-1===e.selfIndex&&(e.selfIndex=v--),e})}P.forEach(function(n){K.forEach(function(e){var t,i,o,r,a,l,d,s;Number(e.selfIndex)>=0&&Number(n.selfIndex)>=0&&((null===(t=e.refIndexes)||void 0===t?void 0:t.includes(Number(n.selfIndex)))||null===(i=e.refIndexes)||void 0===i||i.push(Number(n.selfIndex)),(null===(o=n.refIndexes)||void 0===o?void 0:o.includes(Number(e.selfIndex)))||null===(r=n.refIndexes)||void 0===r||r.push(Number(e.selfIndex))),n.contentId&&!(null===(a=e.refContentIds)||void 0===a?void 0:a.includes(n.contentId))&&(null===(l=e.refContentIds)||void 0===l||l.push(n.contentId)),e.contentId&&!(null===(d=n.refContentIds)||void 0===d?void 0:d.includes(e.contentId))&&(null===(s=n.refContentIds)||void 0===s||s.push(e.contentId))})}),K.forEach(function(n){var e=w.filter(function(e){var t;return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId||(null===(t=n.refContentIds)||void 0===t?void 0:t.includes(e.parentContentId))});e.length>0&&(n.subsections=e);var t=0===i?String(n.selfIndex):"".concat(n.selfIndex,"_").concat(n.contentId||d);s[t]=s[t]?N(s[t],n):n}),P.forEach(function(n){var e=D.filter(function(e){var t;return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId||(null===(t=n.refContentIds)||void 0===t?void 0:t.includes(e.parentContentId))});e.length>0&&(n.subsections=e);var t=0===i?String(n.selfIndex):"".concat(n.selfIndex,"_").concat(n.contentId||d);u[t]=u[t]?N(u[t],n):n})};for(var p in e)f(p);return l=Object.values(s),d=Object.values(u),l.sort(S),d.sort(S),{refSections:l,baseSections:d}},D=k(m.next),P=D.refSections,K=D.baseSections;b||(v=E(P)),s=K}else m.next&&Object.values(m.next).forEach(function(n){var e=R(n);if(e&&!1!==e.display_node){var t=w(n,"0");if(b)s.push.apply(s,t);else{var i=E(w(n,"1"));p.push.apply(p,u(n,t,i))}}}),b||(s=p.map(function(n){return n.left}),v=p.map(function(n){return n.right}));var V=l(m,"0",g,y),T=l(m,"1",g,y),A={title:V.title||"Uploaded Contract",description:m.decision_scope_description||"",sections:s},G={id:"tree-variant-1",title:b?function(){var n,e;if((null==h?void 0:h.learnings_data)&&Object.keys(h.learnings_data).length>0){var t=Object.keys(h.learnings_data)[0];return(null===(n=h.learnings_data[t])||void 0===n?void 0:n.title)||"Rulebook Guidelines"}return(null===(e=null==h?void 0:h.data)||void 0===e?void 0:e.artifactTitle)||"Rulebook Guidelines"}():T.title||"Reference Template",similarity:0,sections:v,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:m.decision_scope_description||""},fields:{}}}};return{activeProposed:A,activeVariants:[G],comparisonRows:p,parseError:null}}catch(n){return console.error("Data Transformation Error: ",n),{activeProposed:{},activeVariants:[],comparisonRows:[],parseError:n instanceof Error?n.message:"Unknown Parsing Error"}}},[c,f,x,_,h]),R=y.activeProposed,C=y.activeVariants,E=y.comparisonRows,O=y.parseError,j=(null==C?void 0:C[0])||v,N=t(function(){return(null==R?void 0:R.sections)||[]},[null==R?void 0:R.sections]),S=t(function(){return j.sections||[]},[j.sections]),w=N.length>0||S.length>0,k=t(function(){return I.fields.filter(function(n){var e=n.key;return(!w||"description"!==e)&&(d(null==R?void 0:R[e])||d(j[e]))})},[R,j,w,I.fields]),D=t(function(){var n,e,t={},o={},r={},a=0,l=null===(n=null==c?void 0:c.input_index_map)||void 0===n?void 0:n[0],d=null===(e=null==c?void 0:c.input_index_map)||void 0===e?void 0:e[1],u=function(n,e){if(!f){var t="left"===e?N.indexOf(n):S.indexOf(n);return{rootKey:"".concat(e,":").concat(t),parentNum:t+1}}if("left"===e){var i=n.selfIndex,o=void 0!==i&&i>=0?i+1:N.indexOf(n)+1;return{rootKey:"left-root:".concat(n.id),parentNum:o}}var r=n.selfIndex,a=N.find(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(r)});if(a){var l=a.selfIndex,d=void 0!==l&&l>=0?l+1:N.indexOf(a)+1;return{rootKey:"left-root:".concat(a.id),parentNum:d}}var s=void 0!==r&&r>=0?r+1:S.indexOf(n)+1;return{rootKey:"right-orphan-root:".concat(n.id),parentNum:s}},v=function(n,e){if(n&&e)return n.find(function(n){return n.id===e.id||n.nodeId&&n.nodeId===e.nodeId||n.contentId&&n.contentId===e.contentId})||void 0},p=function(n,e,u,c,f,I,_){if(e&&function(n,e,t){var a;((null===(a=null==n?void 0:n.evaluationResults)||void 0===a?void 0:a.length)?n.evaluationResults:(null==n?void 0:n.evaluationResult)?[n.evaluationResult]:[]).forEach(function(a){var u=(null==a?void 0:a.deviations)||{};Object.keys(u).sort().forEach(function(v){var c=u[v];if(c){var f=!i(c[l]),p=!i(c[d]);if(f||p){var I=(null==a?void 0:a.nodeId)||n.nodeId||n.id,_="".concat(I).concat(s).concat(v);void 0===o[_]&&(void 0===r[e]&&(r[e]=1),o[_]={index:r[e]++,rootKey:e,parentNum:t})}}})})}(e,c,f),e&&!I){var h=(null==_?void 0:_.id)||"fallback_parent_".concat(a++);t[h]||(t[h]=[]),t[h].push(e)}((null==e?void 0:e.subsections)||(null==n?void 0:n.subsections)||(null==u?void 0:u.subsections)||[]).forEach(function(t){var i=v(null==n?void 0:n.subsections,t),o=v(null==u?void 0:u.subsections,t);p(t,i,o,c,f,!1,e||_)})};N.forEach(function(n){var e,t=u(n,"left"),i=t.rootKey,o=t.parentNum,r=null;if(f){var a=null===(e=n.refIndexes)||void 0===e?void 0:e[0];r=S.find(function(n){return n.selfIndex===a})}else r=S[N.indexOf(n)];p(n,n,r,i,o,!0,n)}),b||S.forEach(function(n){var e=u(n,"right"),t=e.rootKey,i=e.parentNum;t.startsWith("right-orphan-root:")&&p(n,null,n,t,i,!0,n)});var I=Object.fromEntries(Object.entries(o).map(function(n){return[n[0],n[1].index]})),_=Object.fromEntries(Object.entries(o).map(function(n){return[n[0],n[1].parentNum]}));return{parentDeviationRecord:t,registry:I,deviationParentRegistry:_}},[N,S,f,c,b]),P=D.parentDeviationRecord,K=D.registry,V=D.deviationParentRegistry;return{isGuidelineMode:b,activeProposed:R,activeVariants:C,comparisonRows:E,existingRule:j,proposedSections:N,existingSections:S,visibleFields:k,parentDeviationRecord:P,deviationNumberRegistry:K,deviationParentRegistry:V,parseError:O}};export{c as useCognitiveTreeData};
2
2
  //# sourceMappingURL=useCompareData.js.map
@@ -1,2 +1,2 @@
1
- import{useState as t,useRef as e,useCallback as n,useEffect as i}from"react";import{DEVIATION_BADGE_SEPARATOR as r}from"../CognitiveComparehelpers.js";var c=function(c){var l=c.containerRef,o=c.leftContainerRef,u=c.rightContainerRef;c.svgContainerRef;var a=c.pathRefs,d=c.leftHeaderRef,s=c.rightHeaderRef,v=c.proposedSections,h=c.existingSections,g=c.visibleFields,f=c.leftRefs,p=c.rightRefs,b=c.sectionLeftRefs,y=c.sectionRightRefs,x=c.subSectionLeftRefs,m=c.subSectionRightRefs,R=c.lhsBadgeRefs,C=c.rhsBadgeRefs,A=c.sectionRowRefs,B=c.expandedSections,S=c.expandedSubSections,M=c.connectedSections,T=c.isSideBySide,I=c.activeSideBySideSection,L=c.maintainRelativeOrder,F=c.isGuidelineMode,H=c.cognitiveMap,w=c.getSectionCompareStyle,k=c.getSubSectionCompareStyle,E=c.getDeviationStyleByKey,N=c.isArrowVisible,Y=c.isAnimatingRef,D=c.isSideBySideRef,j=c.sideBySideCacheRef,O=c.sideBySideLineRef,z=c.activeSideBySideSectionRef,P=c.activeSideBySideRightSectionRef,Q=c.connectedLines,X=c.setConnectedLines,q=c.cachedConnectedPositions,G=c.calculateLinesRef,K=c.resizeTimerRef,V=c.scrollLock,J=c.scrollSyncLocked,U=c.handleResizeRef,W=c.activeProposed,Z=c.existingRule,$=c.analysisData,_=c.pendingScrollTargetRef,tt=c.pendingScrollCallbackRef,et=c.resolvedComparisonConfig,nt=c.getFieldData,it=t([]),rt=it[0],ct=it[1],lt=t(null),ot=lt[0],ut=lt[1],at=t([]),dt=at[0],st=at[1],vt=null!=Q?Q:dt,ht=null!=X?X:st,gt=t({width:0,height:0}),ft=gt[0],pt=gt[1],bt=e(!1),yt=e(!1),xt=e(!1),mt=e(null),Rt=e([]),Ct=null!=q?q:Rt,At=function(t,e,n,i,r,c,l){if(Math.abs(i-e)<=1)return c&&l?"M ".concat(t,",").concat(e," L ").concat(n,",").concat(i):c&&!l?"M ".concat(t,",").concat(e," L ").concat(r,",").concat(e):!c&&l?"M ".concat(r,",").concat(e," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i);var o=Math.min(15,Math.abs(r-t),Math.abs(i-e)/2),u=Math.min(15,Math.abs(n-r),Math.abs(i-e)/2),a=i>e?o:-o,d=i>e?u:-u,s=n>r?u:-u;return c&&l?"M ".concat(t,",").concat(e," L ").concat(r-o,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):c&&!l?"M ".concat(t,",").concat(e," L ").concat(r-o,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i):!c&&l?"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i)},Bt=n(function(){var t,e,n,i,c,a,A,N,D,j,O,z,P,Q,X,q,G,K;if(!bt.current&&!Y.current){bt.current=!0;try{if(!l.current)return;var V=function(t){var e=t.split("-"),n=e[0];if(!B[n]&&!1===L)return!1;if(L&&!B["left-".concat(n)]&&!B["right-".concat(n)]&&!B[n])return!1;for(var i=n,r=1;r<e.length-1;r++)if(i+="-".concat(e[r]),!S[i])return!1;return!0},J=l.current.getBoundingClientRect();pt({width:J.width,height:J.height});var U=[];if(g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;r&&c&&(r.style.height="auto",c.style.height="auto",r.style.minHeight="0px",c.style.minHeight="0px")}),!Y.current){for(var W=0;W<Math.max(v.length,h.length);W++){var Z=null===(t=b.current[W])||void 0===t?void 0:t.current,$=null===(e=y.current[W])||void 0===e?void 0:e.current;Z&&(Z.style.height="auto",Z.style.minHeight="0px"),$&&($.style.height="auto",$.style.minHeight="0px")}L||Object.keys(x.current).forEach(function(t){var e,n;if(V(t)){var i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||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 _={};g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;if(r&&c){var l=r.getBoundingClientRect(),o=c.getBoundingClientRect();_[i]=Math.max(l.height,o.height)}});var tt={left:{},right:{}},et={};if(!Y.current)if(L){if(T&&null!==I)if("number"==typeof I){var nt=I,it=v[nt],rt=null===(c=b.current[nt])||void 0===c?void 0:c.current;rt&&it&&(it.refIndexes||[]).forEach(function(t){var e,n=h.findIndex(function(e){return e.selfIndex===t}),i=null===(e=y.current[n])||void 0===e?void 0:e.current;if(i&&(B["left-".concat(nt)]||B["right-".concat(n)])){var r=Math.max(rt.getBoundingClientRect().height,i.getBoundingClientRect().height);tt.left[nt]=Math.max(tt.left[nt]||0,r),tt.right[n]=Math.max(tt.right[n]||0,r)}})}else{var lt=I.split(r)[2];if(lt){Z=null===(a=x.current[lt])||void 0===a?void 0:a.current,$=null===(A=m.current[lt])||void 0===A?void 0:A.current;if(Z&&$){ot=Math.max(Z.getBoundingClientRect().height,$.getBoundingClientRect().height);et[lt]=Math.max(et[lt]||0,ot)}}}}else{Object.keys(x.current).forEach(function(t){var e,n;if(V(t)){var i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;if(i&&r&&null!==i.offsetParent&&null!==r.offsetParent){var c=i.getBoundingClientRect(),l=r.getBoundingClientRect(),o=Math.max(c.height,l.height);et[t]=o,i.style.minHeight="".concat(o,"px"),r.style.minHeight="".concat(o,"px")}}});for(W=0;W<Math.min(v.length,h.length);W++){var Z=null===(n=b.current[W])||void 0===n?void 0:n.current,$=null===(i=y.current[W])||void 0===i?void 0:i.current;if(Z&&$){var ot=Math.max(Z.getBoundingClientRect().height,$.getBoundingClientRect().height);tt.left[W]=ot,tt.right[W]=ot}}}if(g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;if(r&&c){var l=_[i];r.style.minHeight="".concat(l,"px"),c.style.minHeight="".concat(l,"px")}}),Y.current||(Object.entries(tt.left).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=b.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),Object.entries(tt.right).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=y.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),L||Object.keys(et).forEach(function(t){var e,n,i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;if(i&&r&&et[t]){var c=et[t];i.style.minHeight="".concat(c,"px"),r.style.minHeight="".concat(c,"px")}})),!F){v.forEach(function(t,e){var n,i=null===(n=b.current[e])||void 0===n?void 0:n.current;if(i){var r=function(t,e){var n=(t.refIndexes||[]).map(function(t){return h.findIndex(function(e){return e.selfIndex===t})}).filter(function(t){return-1!==t});return!n.length&&h[e]?[e]:Array.from(new Set(n))}(t,e);r.forEach(function(n){var r,c,l,a,d,s,v,g,f,p,b=null===(r=y.current[n])||void 0===r?void 0:r.current;if(b){var x=i.getBoundingClientRect(),m=b.getBoundingClientRect(),R=x.right-J.left,C=m.left-J.left,A=x.top+18-J.top,B=m.top+18-J.top;if(L&&T&&I===e){var S=null!==(l=null===(c=o.current)||void 0===c?void 0:c.getBoundingClientRect().top)&&void 0!==l?l:0,M=null!==(d=null===(a=u.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==d?d:0,F=S+(null!==(v=null===(s=o.current)||void 0===s?void 0:s.clientHeight)&&void 0!==v?v:1/0),k=M+(null!==(f=null===(g=u.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0),E=function(t,e,n){return Math.max(e,Math.min(n,t))};A=E(x.top+18,S,F)-J.top,B=E(m.top+18,M,k)-J.top}var N=w(e);N&&U.push({id:"line-".concat(e,"-").concat(n),x1:R,y1:A,x2:C,y2:B,style:N,sectionIdx:e,targetRightIdx:n,isSubSection:!1,hasCognitive:!!((null==t?void 0:t.cognitiveData)||(null===(p=h[n])||void 0===p?void 0:p.cognitiveData)||(null==t?void 0:t.nodeId)&&H[t.nodeId])})}})}})}if(!F&&T&&"string"==typeof I&&I.includes(r)){var at=I.split(r),dt=at[0],st=at[1],vt=at[2],gt=(at[3],"".concat(dt).concat(r).concat(st)),ft=null===(N=R.current[gt])||void 0===N?void 0:N.current,yt=null===(D=C.current[gt])||void 0===D?void 0:D.current;if(ft&&yt){var xt=ft.getBoundingClientRect(),mt=yt.getBoundingClientRect(),Rt=xt.right-J.left,Bt=mt.left-J.left,Mt=xt.top+xt.height/2-J.top,Tt=mt.top+mt.height/2-J.top;if(L){var It=null!==(O=null===(j=o.current)||void 0===j?void 0:j.getBoundingClientRect().top)&&void 0!==O?O:0,Lt=null!==(P=null===(z=u.current)||void 0===z?void 0:z.getBoundingClientRect().top)&&void 0!==P?P:0,Ft=It+(null!==(X=null===(Q=o.current)||void 0===Q?void 0:Q.clientHeight)&&void 0!==X?X:1/0),Ht=Lt+(null!==(G=null===(q=u.current)||void 0===q?void 0:q.clientHeight)&&void 0!==G?G:1/0),wt=function(t,e,n){return Math.max(e,Math.min(n,t))};Mt=wt(xt.top+xt.height/2,It,Ft)-J.top,Tt=wt(mt.top+mt.height/2,Lt,Ht)-J.top}var kt=null!==(K=E(dt,st))&&void 0!==K?K:k(vt);kt&&U.push({id:"line-subsec-".concat(gt),x1:Rt,y1:Mt,x2:Bt,y2:Tt,style:kt,sectionIdx:Number(vt.split("-")[0]),isSubSection:!0,subSectionKeyPath:I})}}if(ct(U),d.current&&s.current){var Et=d.current.getBoundingClientRect(),Nt=s.current.getBoundingClientRect(),Yt=(Et.top+Et.height/2-J.top+Nt.top+Nt.height/2-J.top)/2;ut({x1:Et.right-J.left,x2:Nt.left-J.left,y:Yt})}else ut(null);if(M.size>0){var Dt=[],jt=o.current,Ot=u.current;if(jt&&Ot){var zt=[],Pt=jt.getBoundingClientRect().top,Qt=Ot.getBoundingClientRect().top,Xt=Pt+jt.clientHeight,qt=Qt+Ot.clientHeight,Gt=jt.scrollTop,Kt=Ot.scrollTop,Vt=J.top,Jt=function(t,e,n){return Math.max(e,Math.min(n,t))};M.forEach(function(t){var e,n,i,c,l,o,u,a,d;if(F){var s=null,g=null,f=null;if("string"==typeof t&&t.includes(r)){var p=t.split(r),b=p[0],y=p[1],x=p[2],m="".concat(b).concat(r).concat(y);s=null===(e=R.current[m])||void 0===e?void 0:e.current,f=null!==(n=E(b,y))&&void 0!==n?n:k(x),g=Number((null==x?void 0:x.split("-")[0])||0)}else g=Number(t),s=null===(i=R.current[g])||void 0===i?void 0:i.current,f=w(g);if(!s)return;var A=document.querySelectorAll('[id^="guideline-target-"]');A.forEach(function(e,n){var i=s.getBoundingClientRect(),c=e.getBoundingClientRect(),l=i.right-J.left,o=c.left-J.left-0,u=l+75,a=i.top+i.height/2,d=c.top+c.height/2,v=a-Pt+Gt,h=d-Qt+Kt,g="conn-guide-".concat(t,"-").concat(n),p="";"string"==typeof t&&t.includes(r)?p=(t.split(r)[2]||"").split("-").map(function(t){return Number(t)+1}).join("."):p=String(Number(t)+1);var b=String.fromCharCode(97+n),y=1===A.length?null:"".concat(p,"(").concat(b,")");zt.push({lhsScrollY:v,rhsScrollY:h,x1:l,x2:o,containerTop:Vt,leftIdx:t,rhsArrayIdx:n,styleColor:(null==f?void 0:f.badgeBorder)||"#6366F1",styleBg:(null==f?void 0:f.badgeBg)||"#FFFFFF",styleText:(null==f?void 0:f.badgeText)||"#A16207",styleId:g,centerX:u});var x=Jt(a,Pt,Xt),m=Jt(d,Qt,qt),R=x-Vt,C=m-Vt,B=At(l,R,o,C,u,a>=Pt-4&&a<=Xt+4,d>=Qt-4&&d<=qt+4);Dt.push({id:g,pathD:B,style:f,leftIdx:t,rhsArrayIdx:n,x1:l,x2:o,y1:R,y2:C,centerX:u,matchLabel:y,isGuideline:!0})})}else if("string"==typeof t&&t.includes(r)){var B=t.split(r),S=(b=B[0],y=B[1],x=B[2],B[3],m="".concat(b).concat(r).concat(y),null===(c=R.current[m])||void 0===c?void 0:c.current),M=null===(l=C.current[m])||void 0===l?void 0:l.current;if(!S||!M)return;var T=S.getBoundingClientRect(),I=M.getBoundingClientRect(),H=null!==(o=E(b,y))&&void 0!==o?o:k(x),N=T.right-J.left,Y=I.left-J.left-0,D=N+75,j=T.top+T.height/2,O=I.top+I.height/2,z=j-Pt+Gt,P=O-Qt+Kt,Q="conn-subsec-".concat(m),X=((x||"").split("-").map(function(t){return Number(t)+1}).join("."),null);zt.push({lhsScrollY:z,rhsScrollY:P,x1:N,x2:Y,containerTop:Vt,leftIdx:t,rhsArrayIdx:t,styleColor:(null==H?void 0:H.badgeBorder)||"#6366F1",styleBg:(null==H?void 0:H.badgeBg)||"#FFFFFF",styleText:(null==H?void 0:H.badgeText)||"#A16207",styleId:Q,centerX:D});var q=Jt(j,Pt,Xt),G=Jt(O,Qt,qt),K=At(N,$=q-Vt,Y,_=G-Vt,D,j>=Pt-4&&j<=Xt+4,O>=Qt-4&&O<=qt+4);Dt.push({id:Q,pathD:K,style:H,leftIdx:t,rhsArrayIdx:t,x1:N,x2:Y,y1:$,y2:_,matchLabel:X})}else if(L){var V=t,U=v[V];if(!(null===(d=null==U?void 0:U.refIndexes)||void 0===d?void 0:d.length))return;U.refIndexes.forEach(function(e,n){var i,r,c=h.findIndex(function(t){return t.selfIndex===e});if(-1!==c){var l=null===(i=R.current[V])||void 0===i?void 0:i.current,o=null===(r=C.current[c])||void 0===r?void 0:r.current;if(l&&o){var u=l.getBoundingClientRect(),a=o.getBoundingClientRect(),d=w(V),s=u.right-J.left,v=a.left-J.left-0,g=s+75,f=u.top+u.height/2,p=a.top+a.height/2,b=f-Pt+Gt,y=p-Qt+Kt,x="conn-".concat(V,"-").concat(c),m=String(Number(t)+1),A=String.fromCharCode(97+n),B=1===U.refIndexes.length?null:"".concat(m,"(").concat(A,")");zt.push({lhsScrollY:b,rhsScrollY:y,x1:s,x2:v,containerTop:Vt,leftIdx:V,rhsArrayIdx:c,styleColor:(null==d?void 0:d.badgeBorder)||"#6366F1",styleBg:(null==d?void 0:d.badgeBg)||"#FFFFFF",styleText:(null==d?void 0:d.badgeText)||"#A16207",styleId:x,centerX:g});var S=Jt(f,Pt,Xt),M=Jt(p,Qt,qt),T=S-Vt,I=M-Vt,L=At(s,T,v,I,g,f>=Pt-4&&f<=Xt+4,p>=Qt-4&&p<=qt+4);Dt.push({id:x,pathD:L,style:d,leftIdx:V,rhsArrayIdx:c,x1:s,x2:v,y1:T,y2:I,matchLabel:B})}}})}else{var W=t,Z=W;S=null===(u=R.current[W])||void 0===u?void 0:u.current,M=null===(a=C.current[Z])||void 0===a?void 0:a.current;if(!S||!M)return;T=S.getBoundingClientRect(),I=M.getBoundingClientRect(),H=w(W),N=T.right-J.left,Y=I.left-J.left-0,D=N+75,j=T.top+T.height/2,O=I.top+I.height/2,z=j-Pt+Gt,P=O-Qt+Kt,Q="conn-".concat(W,"-").concat(Z),String(Number(t)+1),X=null;zt.push({lhsScrollY:z,rhsScrollY:P,x1:N,x2:Y,containerTop:Vt,leftIdx:W,rhsArrayIdx:Z,styleColor:(null==H?void 0:H.badgeBorder)||"#6366F1",styleBg:(null==H?void 0:H.badgeBg)||"#FFFFFF",styleText:(null==H?void 0:H.badgeText)||"#A16207",styleId:Q,centerX:D});var $,_;q=Jt(j,Pt,Xt),G=Jt(O,Qt,qt),K=At(N,$=q-Vt,Y,_=G-Vt,D,j>=Pt-4&&j<=Xt+4,O>=Qt-4&&O<=qt+4);Dt.push({id:Q,pathD:K,style:H,leftIdx:W,rhsArrayIdx:Z,x1:N,x2:Y,y1:$,y2:_,matchLabel:X})}}),Ct.current=zt}ht(Dt),setTimeout(function(){return St()},10)}else ht([]),Ct.current=[],setTimeout(function(){return St()},10)}catch(t){console.error("Line render safe fail: ",t)}finally{bt.current=!1}}},[g,v,h,H,et,nt,w,E,L,T,I,M,B,S,F]),St=n(function(){var t,e,n,i,r,c,d,s,v,h,g,f,p,b,y,x,m,R,C,A=Ct.current;if(!A.length)return null===(t=a.current["guideline-up-stroke"])||void 0===t||t.setAttribute("visibility","hidden"),null===(e=a.current["guideline-up-badge"])||void 0===e||e.setAttribute("visibility","hidden"),null===(n=a.current["guideline-down-stroke"])||void 0===n||n.setAttribute("visibility","hidden"),void(null===(i=a.current["guideline-down-badge"])||void 0===i||i.setAttribute("visibility","hidden"));if(!Y.current){var B=null!==(c=null===(r=o.current)||void 0===r?void 0:r.scrollTop)&&void 0!==c?c:0,S=null!==(s=null===(d=u.current)||void 0===d?void 0:d.scrollTop)&&void 0!==s?s:0,M=null!==(h=null===(v=o.current)||void 0===v?void 0:v.clientHeight)&&void 0!==h?h:1/0,T=null!==(f=null===(g=u.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0,I=null!==(b=null===(p=o.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==b?b:0,L=null!==(x=null===(y=u.current)||void 0===y?void 0:y.getBoundingClientRect().top)&&void 0!==x?x:0,F=I+M,H=L+T,w=null===(m=l.current)||void 0===m?void 0:m.getBoundingClientRect(),k=null!==(R=null==w?void 0:w.top)&&void 0!==R?R:0,E=null!==(C=null==w?void 0:w.height)&&void 0!==C?C:1/0,N=function(t,e,n){return Math.max(e,Math.min(n,t))},D=0,j=0,O=0,z=0,P="#6366F1",Q="#A16207",X=!1,q=0;if(A.forEach(function(t){var e=t.lhsScrollY-B+I,n=t.rhsScrollY-S+L,i=a.current[t.styleId+"-stroke"],r=a.current[t.styleId+"-bg"],c=a.current[t.styleId+"-btn"],l=a.current[t.styleId+"-number"];if(i||r){var o=N(e,I,F),u=N(n,L,H),d=o-k,s=u-k,v=e>=I-4&&e<=F+4,h=n>=L-4&&n<=H+4,g=!0;X=!0;var f=t.centerX||t.x1+75;0===O&&(O=t.x1,z=d,q=f,P=t.styleColor,t.styleBg,Q=t.styleText||"#A16207"),n<L-4?(D++,g=!1):n>H+4&&(j++,g=!1);var p=At(t.x1,d,t.x2,s,q,v,h);i&&(g&&p?(i.setAttribute("visibility","visible"),i.setAttribute("d",p)):i.setAttribute("visibility","hidden")),r&&(g&&p?(r.setAttribute("visibility","visible"),r.setAttribute("d",p)):r.setAttribute("visibility","hidden")),c&&(v&&g?(c.setAttribute("visibility","visible"),c.setAttribute("y",String(d-12))):c.setAttribute("visibility","hidden")),l&&(v&&g?(l.setAttribute("visibility","visible"),l.setAttribute("transform","translate(".concat(t.x2-42,", ").concat(s,")"))):l.setAttribute("visibility","hidden"))}}),X&&q>0){var G=a.current["guideline-up-stroke"],K=a.current["guideline-up-badge"],V=a.current["guideline-up-arrow"],J=a.current["guideline-up-text"],U=a.current["guideline-up-badge-rect"];if(D>0){var W=Math.max(15,L-k+15),Z=Math.min(15,Math.abs(q-O),Math.max(0,z-W)),$="M ".concat(O,",").concat(z," L ").concat(q-Z,",").concat(z," Q ").concat(q,",").concat(z," ").concat(q,",").concat(z-Z," L ").concat(q,",").concat(W);null==G||G.setAttribute("visibility","visible"),null==G||G.setAttribute("d",$),null==G||G.setAttribute("stroke",P),null==K||K.setAttribute("visibility","visible"),null==K||K.setAttribute("transform","translate(".concat(q,", ").concat(W,")")),V&&V.setAttribute("fill",P),J&&(J.textContent="+".concat(D),J.setAttribute("fill",Q)),U&&U.setAttribute("stroke",P)}else null==G||G.setAttribute("visibility","hidden"),null==K||K.setAttribute("visibility","hidden");var _=a.current["guideline-down-stroke"],tt=a.current["guideline-down-badge"],et=a.current["guideline-down-arrow"],nt=a.current["guideline-down-text"],it=a.current["guideline-down-badge-rect"];if(j>0){var rt=Math.min(E-15,H-k-15);Z=Math.min(15,Math.abs(q-O),Math.max(0,rt-z)),$="M ".concat(O,",").concat(z," L ").concat(q-Z,",").concat(z," Q ").concat(q,",").concat(z," ").concat(q,",").concat(z+Z," L ").concat(q,",").concat(rt);null==_||_.setAttribute("visibility","visible"),null==_||_.setAttribute("d",$),null==_||_.setAttribute("stroke",P),null==tt||tt.setAttribute("visibility","visible"),null==tt||tt.setAttribute("transform","translate(".concat(q,", ").concat(rt,")")),et&&et.setAttribute("fill",P),nt&&(nt.textContent="+".concat(j),nt.setAttribute("fill",Q)),it&&it.setAttribute("stroke",P)}else null==_||_.setAttribute("visibility","hidden"),null==tt||tt.setAttribute("visibility","hidden")}}},[]),Mt=n(function(){Ct.current.length>0&&!Y.current||(null!==mt.current&&clearTimeout(mt.current),mt.current=setTimeout(function(){G.current(),mt.current=null},50))},[]),Tt=n(function(t){if(null!==_.current&&tt.current&&Math.abs(t.currentTarget.scrollTop-_.current)<=2){var e=tt.current;_.current=null,tt.current=null,e()}if(!xt.current&&!V.current){if(L&&J&&(D.current||M.size>0)){var n=t.currentTarget,i=o.current,c=u.current,a=n===i?c:n===c?i:null;if(n&&a){var d=function(){var t,e,n,i,c,l,o,u,a,d,s,v=z.current,h=P.current;if(null===v)return{leftAnchor:null,rightAnchor:null};if("string"==typeof v&&v.includes(r)){var g=v.split(r),f="".concat(g[0]).concat(r).concat(g[1]);return{leftAnchor:(null===(t=R.current[f])||void 0===t?void 0:t.current)||(null===(e=x.current[g[2]])||void 0===e?void 0:e.current)||(null===(n=b.current[Number(g[2])])||void 0===n?void 0:n.current)||null,rightAnchor:(null===(i=C.current[f])||void 0===i?void 0:i.current)||(null===(c=m.current[g[3]])||void 0===c?void 0:c.current)||(null===(l=y.current[Number(g[3])])||void 0===l?void 0:l.current)||null}}var p=Number(v),B=null!==h?Number(h):p;return{leftAnchor:(null===(o=R.current[p])||void 0===o?void 0:o.current)||(null===(u=A.current[p])||void 0===u?void 0:u.current)||(null===(a=b.current[p])||void 0===a?void 0:a.current)||null,rightAnchor:(null===(d=C.current[B])||void 0===d?void 0:d.current)||(null===(s=y.current[B])||void 0===s?void 0:s.current)||null}}(),s=d.leftAnchor,v=d.rightAnchor,h=n===i?s:v,g=n===i?v:s,f=null;if(h&&g){var p=h.getBoundingClientRect(),B=g.getBoundingClientRect(),S=a.getBoundingClientRect(),T=p.top+p.height/2;f=B.top-S.top+a.scrollTop+B.height/2-(T-S.top)}else{var I=Math.max(0,n.scrollHeight-n.clientHeight),F=Math.max(0,a.scrollHeight-a.clientHeight);f=I>0?n.scrollTop/I*F:n.scrollTop}var H=Math.max(0,a.scrollHeight-a.clientHeight);f=Math.max(0,Math.min(f,H)),Math.abs(a.scrollTop-f)>1&&(xt.current=!0,a.scrollTop=f,requestAnimationFrame(function(){xt.current=!1}))}}L||Mt(),yt.current||(yt.current=!0,requestAnimationFrame(function(){var t,e,n,i,c,a,d;if(D.current){var s=o.current,v=u.current;if(s&&v&&O.current){if(!j.current){var h=z.current,g=void 0;if("string"==typeof h&&h.includes(r)){var f=h.split(r),p="".concat(f[0]).concat(r).concat(f[1]);g=null===(t=R.current[p])||void 0===t?void 0:t.current}else g=null===(e=R.current[h])||void 0===e?void 0:e.current;if(g){var b=g.getBoundingClientRect();j.current={badgeScreenY:b.top+b.height/2,initialScrollTop:s.scrollTop,leftTop:s.getBoundingClientRect().top,leftBottom:s.getBoundingClientRect().top+s.clientHeight,cTop:null!==(i=null===(n=l.current)||void 0===n?void 0:n.getBoundingClientRect().top)&&void 0!==i?i:0}}}if(j.current){var y=j.current,x=s.scrollTop-y.initialScrollTop,m=y.badgeScreenY-x,C=((c=m,a=y.leftTop,d=y.leftBottom,Math.max(a,Math.min(d,c)))-y.cTop).toString(),A=m>=y.leftTop-4&&m<=y.leftBottom+4;O.current.setAttribute("y1",C),O.current.setAttribute("y2",C),O.current.setAttribute("visibility",A?"visible":"hidden")}}}St(),yt.current=!1}))}},[St,L,J,M,Mt]);return i(function(){G.current=Bt},[Bt]),i(function(){var t=setTimeout(Mt,250),e=function(){return U.current()};return window.addEventListener("resize",e),function(){clearTimeout(t),null!==mt.current&&clearTimeout(mt.current),null!==K.current&&clearTimeout(K.current),window.removeEventListener("resize",e)}},[W,Z,$,g,B,S,v,h,et,Mt,T,I,N,M]),{lines:rt,setLines:ct,overallConnector:ot,setOverallConnector:ut,connectedLines:vt,setConnectedLines:ht,svgDimensions:ft,cachedConnectedPositions:Ct,calculateLines:Bt,calculateLinesRef:G,calculateLinesDebounced:Mt,handleColumnScroll:Tt}};export{c as useLinesCalculator};
1
+ import{useState as t,useRef as e,useCallback as n,useEffect as i}from"react";import{DEVIATION_BADGE_SEPARATOR as r}from"../CognitiveComparehelpers.js";var c=function(c){var o=c.containerRef,l=c.leftContainerRef,u=c.rightContainerRef;c.svgContainerRef;var a=c.pathRefs,d=c.leftHeaderRef,s=c.rightHeaderRef,v=c.proposedSections,h=c.existingSections,g=c.visibleFields,f=c.leftRefs,p=c.rightRefs,b=c.sectionLeftRefs,y=c.sectionRightRefs,x=c.subSectionLeftRefs,m=c.subSectionRightRefs,R=c.lhsBadgeRefs,C=c.rhsBadgeRefs,A=c.sectionRowRefs,B=c.expandedSections,S=c.expandedSubSections,M=c.connectedSections,I=c.isSideBySide,T=c.activeSideBySideSection,L=c.maintainRelativeOrder,F=c.isGuidelineMode,H=c.cognitiveMap,w=c.getSectionCompareStyle,k=c.getSubSectionCompareStyle,E=c.getDeviationStyleByKey,N=c.isArrowVisible,Y=c.isAnimatingRef,D=c.isSideBySideRef,j=c.sideBySideCacheRef,O=c.sideBySideLineRef,z=c.activeSideBySideSectionRef,P=c.activeSideBySideRightSectionRef,Q=c.connectedLines,X=c.setConnectedLines,q=c.cachedConnectedPositions,G=c.calculateLinesRef,K=c.resizeTimerRef,V=c.scrollLock,J=c.scrollSyncLocked,U=c.handleResizeRef,W=c.activeProposed,Z=c.existingRule,$=c.analysisData,_=c.pendingScrollTargetRef,tt=c.pendingScrollCallbackRef,et=c.resolvedComparisonConfig,nt=c.getFieldData,it=t([]),rt=it[0],ct=it[1],ot=t(null),lt=ot[0],ut=ot[1],at=t([]),dt=at[0],st=at[1],vt=null!=Q?Q:dt,ht=null!=X?X:st,gt=t({width:0,height:0}),ft=gt[0],pt=gt[1],bt=e(!1),yt=e(!1),xt=e(!1),mt=e(null),Rt=e([]),Ct=null!=q?q:Rt,At=function(t,e,n,i,r,c,o){if(Math.abs(i-e)<=1)return c&&o?"M ".concat(t,",").concat(e," L ").concat(n,",").concat(i):c&&!o?"M ".concat(t,",").concat(e," L ").concat(r,",").concat(e):!c&&o?"M ".concat(r,",").concat(e," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i);var l=Math.min(15,Math.abs(r-t),Math.abs(i-e)/2),u=Math.min(15,Math.abs(n-r),Math.abs(i-e)/2),a=i>e?l:-l,d=i>e?u:-u,s=n>r?u:-u;return c&&o?"M ".concat(t,",").concat(e," L ").concat(r-l,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):c&&!o?"M ".concat(t,",").concat(e," L ").concat(r-l,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i):!c&&o?"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i)},Bt=n(function(){var t,e,n,i,c,a,A,N,D,j,O,z,P,Q,X,q,G,K;if(!bt.current&&!Y.current){bt.current=!0;try{if(!o.current)return;var V=function(t){var e=t.split("-"),n=e[0];if(!B[n]&&!1===L)return!1;if(L&&!B["left-".concat(n)]&&!B["right-".concat(n)]&&!B[n])return!1;for(var i=n,r=1;r<e.length-1;r++)if(i+="-".concat(e[r]),!S[i])return!1;return!0},J=o.current.getBoundingClientRect();pt({width:J.width,height:J.height});var U=[];if(g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;r&&c&&(r.style.height="auto",c.style.height="auto",r.style.minHeight="0px",c.style.minHeight="0px")}),!Y.current){for(var W=0;W<Math.max(v.length,h.length);W++){var Z=null===(t=b.current[W])||void 0===t?void 0:t.current,$=null===(e=y.current[W])||void 0===e?void 0:e.current;Z&&(Z.style.height="auto",Z.style.minHeight="0px"),$&&($.style.height="auto",$.style.minHeight="0px")}L||Object.keys(x.current).forEach(function(t){var e,n;if(V(t)){var i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||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 _={};g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;if(r&&c){var o=r.getBoundingClientRect(),l=c.getBoundingClientRect();_[i]=Math.max(o.height,l.height)}});var tt={left:{},right:{}},et={};if(!Y.current)if(L){if(I&&null!==T)if("number"==typeof T){var nt=T,it=v[nt],rt=null===(c=b.current[nt])||void 0===c?void 0:c.current;rt&&it&&(it.refIndexes||[]).forEach(function(t){var e,n=h.findIndex(function(e){return e.selfIndex===t}),i=null===(e=y.current[n])||void 0===e?void 0:e.current;if(i&&(B["left-".concat(nt)]||B["right-".concat(n)])){var r=Math.max(rt.getBoundingClientRect().height,i.getBoundingClientRect().height);tt.left[nt]=Math.max(tt.left[nt]||0,r),tt.right[n]=Math.max(tt.right[n]||0,r)}})}else{var ot=T.split(r)[2];if(ot){Z=null===(a=x.current[ot])||void 0===a?void 0:a.current,$=null===(A=m.current[ot])||void 0===A?void 0:A.current;if(Z&&$){lt=Math.max(Z.getBoundingClientRect().height,$.getBoundingClientRect().height);et[ot]=Math.max(et[ot]||0,lt)}}}}else{Object.keys(x.current).forEach(function(t){var e,n;if(V(t)){var i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;if(i&&r&&null!==i.offsetParent&&null!==r.offsetParent){var c=i.getBoundingClientRect(),o=r.getBoundingClientRect(),l=Math.max(c.height,o.height);et[t]=l,i.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}});for(W=0;W<Math.min(v.length,h.length);W++){var Z=null===(n=b.current[W])||void 0===n?void 0:n.current,$=null===(i=y.current[W])||void 0===i?void 0:i.current;if(Z&&$){var lt=Math.max(Z.getBoundingClientRect().height,$.getBoundingClientRect().height);tt.left[W]=lt,tt.right[W]=lt}}}if(g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;if(r&&c){var o=_[i];r.style.minHeight="".concat(o,"px"),c.style.minHeight="".concat(o,"px")}}),Y.current||(Object.entries(tt.left).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=b.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),Object.entries(tt.right).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=y.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),L||Object.keys(et).forEach(function(t){var e,n,i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;if(i&&r&&et[t]){var c=et[t];i.style.minHeight="".concat(c,"px"),r.style.minHeight="".concat(c,"px")}})),!F){v.forEach(function(t,e){var n,i=t.continuationSourceRowId?v.findIndex(function(e){return e.comparisonRowId===t.continuationSourceRowId}):-1,r=i>=0?i:e,c=null===(n=b.current[r])||void 0===n?void 0:n.current;if(c){var o=function(t,e){if(!L)return h[e]?[e]:[];var n=(t.refIndexes||[]).map(function(t){return h.findIndex(function(e){return e.selfIndex===t})}).filter(function(t){return-1!==t});return!n.length&&h[e]?[e]:Array.from(new Set(n))}(t,e);o.forEach(function(t){var n,o,a,d,s,g,f,p,b,x,m,R,C=null===(n=y.current[t])||void 0===n?void 0:n.current;if(C){var A=c.getBoundingClientRect(),B=C.getBoundingClientRect(),S=A.right-J.left,M=B.left-J.left,F=A.top+18-J.top,k=B.top+18-J.top;if(L&&I&&T===e){var E=null!==(a=null===(o=l.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==a?a:0,N=null!==(s=null===(d=u.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==s?s:0,Y=E+(null!==(f=null===(g=l.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0),D=N+(null!==(b=null===(p=u.current)||void 0===p?void 0:p.clientHeight)&&void 0!==b?b:1/0),j=function(t,e,n){return Math.max(e,Math.min(n,t))};F=j(A.top+18,E,Y)-J.top,k=j(B.top+18,N,D)-J.top}var O=w(r);O&&U.push({id:"line-".concat(r,"-").concat(t),x1:S,y1:F,x2:M,y2:k,style:O,sectionIdx:r,targetRightIdx:t,isSubSection:!1,isMappingContinuation:i>=0,hasCognitive:!!((null===(x=v[r])||void 0===x?void 0:x.cognitiveData)||(null===(m=h[t])||void 0===m?void 0:m.cognitiveData)||(null===(R=v[r])||void 0===R?void 0:R.nodeId)&&H[v[r].nodeId])})}})}})}if(!F&&I&&"string"==typeof T&&T.includes(r)){var at=T.split(r),dt=at[0],st=at[1],vt=at[2],gt=(at[3],"".concat(dt).concat(r).concat(st)),ft=null===(N=R.current[gt])||void 0===N?void 0:N.current,yt=null===(D=C.current[gt])||void 0===D?void 0:D.current;if(ft&&yt){var xt=ft.getBoundingClientRect(),mt=yt.getBoundingClientRect(),Rt=xt.right-J.left,Bt=mt.left-J.left,Mt=xt.top+xt.height/2-J.top,It=mt.top+mt.height/2-J.top;if(L){var Tt=null!==(O=null===(j=l.current)||void 0===j?void 0:j.getBoundingClientRect().top)&&void 0!==O?O:0,Lt=null!==(P=null===(z=u.current)||void 0===z?void 0:z.getBoundingClientRect().top)&&void 0!==P?P:0,Ft=Tt+(null!==(X=null===(Q=l.current)||void 0===Q?void 0:Q.clientHeight)&&void 0!==X?X:1/0),Ht=Lt+(null!==(G=null===(q=u.current)||void 0===q?void 0:q.clientHeight)&&void 0!==G?G:1/0),wt=function(t,e,n){return Math.max(e,Math.min(n,t))};Mt=wt(xt.top+xt.height/2,Tt,Ft)-J.top,It=wt(mt.top+mt.height/2,Lt,Ht)-J.top}var kt=null!==(K=E(dt,st))&&void 0!==K?K:k(vt);kt&&U.push({id:"line-subsec-".concat(gt),x1:Rt,y1:Mt,x2:Bt,y2:It,style:kt,sectionIdx:Number(vt.split("-")[0]),isSubSection:!0,subSectionKeyPath:T})}}if(ct(U),d.current&&s.current){var Et=d.current.getBoundingClientRect(),Nt=s.current.getBoundingClientRect(),Yt=(Et.top+Et.height/2-J.top+Nt.top+Nt.height/2-J.top)/2;ut({x1:Et.right-J.left,x2:Nt.left-J.left,y:Yt})}else ut(null);if(M.size>0){var Dt=[],jt=l.current,Ot=u.current;if(jt&&Ot){var zt=[],Pt=jt.getBoundingClientRect().top,Qt=Ot.getBoundingClientRect().top,Xt=Pt+jt.clientHeight,qt=Qt+Ot.clientHeight,Gt=jt.scrollTop,Kt=Ot.scrollTop,Vt=J.top,Jt=function(t,e,n){return Math.max(e,Math.min(n,t))};M.forEach(function(t){var e,n,i,c,o,l,u,a,d;if(F){var s=null,g=null,f=null;if("string"==typeof t&&t.includes(r)){var p=t.split(r),b=p[0],y=p[1],x=p[2],m="".concat(b).concat(r).concat(y);s=null===(e=R.current[m])||void 0===e?void 0:e.current,f=null!==(n=E(b,y))&&void 0!==n?n:k(x),g=Number((null==x?void 0:x.split("-")[0])||0)}else g=Number(t),s=null===(i=R.current[g])||void 0===i?void 0:i.current,f=w(g);if(!s)return;var A=document.querySelectorAll('[id^="guideline-target-"]');A.forEach(function(e,n){var i=s.getBoundingClientRect(),c=e.getBoundingClientRect(),o=i.right-J.left,l=c.left-J.left-0,u=o+75,a=i.top+i.height/2,d=c.top+c.height/2,v=a-Pt+Gt,h=d-Qt+Kt,g="conn-guide-".concat(t,"-").concat(n),p="";"string"==typeof t&&t.includes(r)?p=(t.split(r)[2]||"").split("-").map(function(t){return Number(t)+1}).join("."):p=String(Number(t)+1);var b=String.fromCharCode(97+n),y=1===A.length?null:"".concat(p,"(").concat(b,")");zt.push({lhsScrollY:v,rhsScrollY:h,x1:o,x2:l,containerTop:Vt,leftIdx:t,rhsArrayIdx:n,styleColor:(null==f?void 0:f.badgeBorder)||"#6366F1",styleBg:(null==f?void 0:f.badgeBg)||"#FFFFFF",styleText:(null==f?void 0:f.badgeText)||"#A16207",styleId:g,centerX:u});var x=Jt(a,Pt,Xt),m=Jt(d,Qt,qt),R=x-Vt,C=m-Vt,B=At(o,R,l,C,u,a>=Pt-4&&a<=Xt+4,d>=Qt-4&&d<=qt+4);Dt.push({id:g,pathD:B,style:f,leftIdx:t,rhsArrayIdx:n,x1:o,x2:l,y1:R,y2:C,centerX:u,matchLabel:y,isGuideline:!0})})}else if("string"==typeof t&&t.includes(r)){var B=t.split(r),S=(b=B[0],y=B[1],x=B[2],B[3],m="".concat(b).concat(r).concat(y),null===(c=R.current[m])||void 0===c?void 0:c.current),M=null===(o=C.current[m])||void 0===o?void 0:o.current;if(!S||!M)return;var I=S.getBoundingClientRect(),T=M.getBoundingClientRect(),H=null!==(l=E(b,y))&&void 0!==l?l:k(x),N=I.right-J.left,Y=T.left-J.left-0,D=N+75,j=I.top+I.height/2,O=T.top+T.height/2,z=j-Pt+Gt,P=O-Qt+Kt,Q="conn-subsec-".concat(m),X=((x||"").split("-").map(function(t){return Number(t)+1}).join("."),null);zt.push({lhsScrollY:z,rhsScrollY:P,x1:N,x2:Y,containerTop:Vt,leftIdx:t,rhsArrayIdx:t,styleColor:(null==H?void 0:H.badgeBorder)||"#6366F1",styleBg:(null==H?void 0:H.badgeBg)||"#FFFFFF",styleText:(null==H?void 0:H.badgeText)||"#A16207",styleId:Q,centerX:D});var q=Jt(j,Pt,Xt),G=Jt(O,Qt,qt),K=At(N,$=q-Vt,Y,_=G-Vt,D,j>=Pt-4&&j<=Xt+4,O>=Qt-4&&O<=qt+4);Dt.push({id:Q,pathD:K,style:H,leftIdx:t,rhsArrayIdx:t,x1:N,x2:Y,y1:$,y2:_,matchLabel:X})}else if(L){var V=t,U=v[V];if(!(null===(d=null==U?void 0:U.refIndexes)||void 0===d?void 0:d.length))return;U.refIndexes.forEach(function(e,n){var i,r,c=h.findIndex(function(t){return t.selfIndex===e});if(-1!==c){var o=null===(i=R.current[V])||void 0===i?void 0:i.current,l=null===(r=C.current[c])||void 0===r?void 0:r.current;if(o&&l){var u=o.getBoundingClientRect(),a=l.getBoundingClientRect(),d=w(V),s=u.right-J.left,v=a.left-J.left-0,g=s+75,f=u.top+u.height/2,p=a.top+a.height/2,b=f-Pt+Gt,y=p-Qt+Kt,x="conn-".concat(V,"-").concat(c),m=String(Number(t)+1),A=String.fromCharCode(97+n),B=1===U.refIndexes.length?null:"".concat(m,"(").concat(A,")");zt.push({lhsScrollY:b,rhsScrollY:y,x1:s,x2:v,containerTop:Vt,leftIdx:V,rhsArrayIdx:c,styleColor:(null==d?void 0:d.badgeBorder)||"#6366F1",styleBg:(null==d?void 0:d.badgeBg)||"#FFFFFF",styleText:(null==d?void 0:d.badgeText)||"#A16207",styleId:x,centerX:g});var S=Jt(f,Pt,Xt),M=Jt(p,Qt,qt),I=S-Vt,T=M-Vt,L=At(s,I,v,T,g,f>=Pt-4&&f<=Xt+4,p>=Qt-4&&p<=qt+4);Dt.push({id:x,pathD:L,style:d,leftIdx:V,rhsArrayIdx:c,x1:s,x2:v,y1:I,y2:T,matchLabel:B})}}})}else{var W=t,Z=W;S=null===(u=R.current[W])||void 0===u?void 0:u.current,M=null===(a=C.current[Z])||void 0===a?void 0:a.current;if(!S||!M)return;I=S.getBoundingClientRect(),T=M.getBoundingClientRect(),H=w(W),N=I.right-J.left,Y=T.left-J.left-0,D=N+75,j=I.top+I.height/2,O=T.top+T.height/2,z=j-Pt+Gt,P=O-Qt+Kt,Q="conn-".concat(W,"-").concat(Z),String(Number(t)+1),X=null;zt.push({lhsScrollY:z,rhsScrollY:P,x1:N,x2:Y,containerTop:Vt,leftIdx:W,rhsArrayIdx:Z,styleColor:(null==H?void 0:H.badgeBorder)||"#6366F1",styleBg:(null==H?void 0:H.badgeBg)||"#FFFFFF",styleText:(null==H?void 0:H.badgeText)||"#A16207",styleId:Q,centerX:D});var $,_;q=Jt(j,Pt,Xt),G=Jt(O,Qt,qt),K=At(N,$=q-Vt,Y,_=G-Vt,D,j>=Pt-4&&j<=Xt+4,O>=Qt-4&&O<=qt+4);Dt.push({id:Q,pathD:K,style:H,leftIdx:W,rhsArrayIdx:Z,x1:N,x2:Y,y1:$,y2:_,matchLabel:X})}}),Ct.current=zt}ht(Dt),setTimeout(function(){return St()},10)}else ht([]),Ct.current=[],setTimeout(function(){return St()},10)}catch(t){console.error("Line render safe fail: ",t)}finally{bt.current=!1}}},[g,v,h,H,et,nt,w,E,L,I,T,M,B,S,F]),St=n(function(){var t,e,n,i,r,c,d,s,v,h,g,f,p,b,y,x,m,R,C,A=Ct.current;if(!A.length)return null===(t=a.current["guideline-up-stroke"])||void 0===t||t.setAttribute("visibility","hidden"),null===(e=a.current["guideline-up-badge"])||void 0===e||e.setAttribute("visibility","hidden"),null===(n=a.current["guideline-down-stroke"])||void 0===n||n.setAttribute("visibility","hidden"),void(null===(i=a.current["guideline-down-badge"])||void 0===i||i.setAttribute("visibility","hidden"));if(!Y.current){var B=null!==(c=null===(r=l.current)||void 0===r?void 0:r.scrollTop)&&void 0!==c?c:0,S=null!==(s=null===(d=u.current)||void 0===d?void 0:d.scrollTop)&&void 0!==s?s:0,M=null!==(h=null===(v=l.current)||void 0===v?void 0:v.clientHeight)&&void 0!==h?h:1/0,I=null!==(f=null===(g=u.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0,T=null!==(b=null===(p=l.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==b?b:0,L=null!==(x=null===(y=u.current)||void 0===y?void 0:y.getBoundingClientRect().top)&&void 0!==x?x:0,F=T+M,H=L+I,w=null===(m=o.current)||void 0===m?void 0:m.getBoundingClientRect(),k=null!==(R=null==w?void 0:w.top)&&void 0!==R?R:0,E=null!==(C=null==w?void 0:w.height)&&void 0!==C?C:1/0,N=function(t,e,n){return Math.max(e,Math.min(n,t))},D=0,j=0,O=0,z=0,P="#6366F1",Q="#A16207",X=!1,q=0;if(A.forEach(function(t){var e=t.lhsScrollY-B+T,n=t.rhsScrollY-S+L,i=a.current[t.styleId+"-stroke"],r=a.current[t.styleId+"-bg"],c=a.current[t.styleId+"-btn"],o=a.current[t.styleId+"-number"];if(i||r){var l=N(e,T,F),u=N(n,L,H),d=l-k,s=u-k,v=e>=T-4&&e<=F+4,h=n>=L-4&&n<=H+4,g=!0;X=!0;var f=t.centerX||t.x1+75;0===O&&(O=t.x1,z=d,q=f,P=t.styleColor,t.styleBg,Q=t.styleText||"#A16207"),n<L-4?(D++,g=!1):n>H+4&&(j++,g=!1);var p=At(t.x1,d,t.x2,s,q,v,h);i&&(g&&p?(i.setAttribute("visibility","visible"),i.setAttribute("d",p)):i.setAttribute("visibility","hidden")),r&&(g&&p?(r.setAttribute("visibility","visible"),r.setAttribute("d",p)):r.setAttribute("visibility","hidden")),c&&(v&&g?(c.setAttribute("visibility","visible"),c.setAttribute("y",String(d-12))):c.setAttribute("visibility","hidden")),o&&(v&&g?(o.setAttribute("visibility","visible"),o.setAttribute("transform","translate(".concat(t.x2-42,", ").concat(s,")"))):o.setAttribute("visibility","hidden"))}}),X&&q>0){var G=a.current["guideline-up-stroke"],K=a.current["guideline-up-badge"],V=a.current["guideline-up-arrow"],J=a.current["guideline-up-text"],U=a.current["guideline-up-badge-rect"];if(D>0){var W=Math.max(15,L-k+15),Z=Math.min(15,Math.abs(q-O),Math.max(0,z-W)),$="M ".concat(O,",").concat(z," L ").concat(q-Z,",").concat(z," Q ").concat(q,",").concat(z," ").concat(q,",").concat(z-Z," L ").concat(q,",").concat(W);null==G||G.setAttribute("visibility","visible"),null==G||G.setAttribute("d",$),null==G||G.setAttribute("stroke",P),null==K||K.setAttribute("visibility","visible"),null==K||K.setAttribute("transform","translate(".concat(q,", ").concat(W,")")),V&&V.setAttribute("fill",P),J&&(J.textContent="+".concat(D),J.setAttribute("fill",Q)),U&&U.setAttribute("stroke",P)}else null==G||G.setAttribute("visibility","hidden"),null==K||K.setAttribute("visibility","hidden");var _=a.current["guideline-down-stroke"],tt=a.current["guideline-down-badge"],et=a.current["guideline-down-arrow"],nt=a.current["guideline-down-text"],it=a.current["guideline-down-badge-rect"];if(j>0){var rt=Math.min(E-15,H-k-15);Z=Math.min(15,Math.abs(q-O),Math.max(0,rt-z)),$="M ".concat(O,",").concat(z," L ").concat(q-Z,",").concat(z," Q ").concat(q,",").concat(z," ").concat(q,",").concat(z+Z," L ").concat(q,",").concat(rt);null==_||_.setAttribute("visibility","visible"),null==_||_.setAttribute("d",$),null==_||_.setAttribute("stroke",P),null==tt||tt.setAttribute("visibility","visible"),null==tt||tt.setAttribute("transform","translate(".concat(q,", ").concat(rt,")")),et&&et.setAttribute("fill",P),nt&&(nt.textContent="+".concat(j),nt.setAttribute("fill",Q)),it&&it.setAttribute("stroke",P)}else null==_||_.setAttribute("visibility","hidden"),null==tt||tt.setAttribute("visibility","hidden")}}},[]),Mt=n(function(){Ct.current.length>0&&!Y.current||(null!==mt.current&&clearTimeout(mt.current),mt.current=setTimeout(function(){G.current(),mt.current=null},50))},[]),It=n(function(t){if(null!==_.current&&tt.current&&Math.abs(t.currentTarget.scrollTop-_.current)<=2){var e=tt.current;_.current=null,tt.current=null,e()}if(!xt.current&&!V.current){if(L&&J&&(D.current||M.size>0)){var n=t.currentTarget,i=l.current,c=u.current,a=n===i?c:n===c?i:null;if(n&&a){var d=function(){var t,e,n,i,c,o,l,u,a,d,s,v=z.current,h=P.current;if(null===v)return{leftAnchor:null,rightAnchor:null};if("string"==typeof v&&v.includes(r)){var g=v.split(r),f="".concat(g[0]).concat(r).concat(g[1]);return{leftAnchor:(null===(t=R.current[f])||void 0===t?void 0:t.current)||(null===(e=x.current[g[2]])||void 0===e?void 0:e.current)||(null===(n=b.current[Number(g[2])])||void 0===n?void 0:n.current)||null,rightAnchor:(null===(i=C.current[f])||void 0===i?void 0:i.current)||(null===(c=m.current[g[3]])||void 0===c?void 0:c.current)||(null===(o=y.current[Number(g[3])])||void 0===o?void 0:o.current)||null}}var p=Number(v),B=null!==h?Number(h):p;return{leftAnchor:(null===(l=R.current[p])||void 0===l?void 0:l.current)||(null===(u=A.current[p])||void 0===u?void 0:u.current)||(null===(a=b.current[p])||void 0===a?void 0:a.current)||null,rightAnchor:(null===(d=C.current[B])||void 0===d?void 0:d.current)||(null===(s=y.current[B])||void 0===s?void 0:s.current)||null}}(),s=d.leftAnchor,v=d.rightAnchor,h=n===i?s:v,g=n===i?v:s,f=null;if(h&&g){var p=h.getBoundingClientRect(),B=g.getBoundingClientRect(),S=a.getBoundingClientRect(),I=p.top+p.height/2;f=B.top-S.top+a.scrollTop+B.height/2-(I-S.top)}else{var T=Math.max(0,n.scrollHeight-n.clientHeight),F=Math.max(0,a.scrollHeight-a.clientHeight);f=T>0?n.scrollTop/T*F:n.scrollTop}var H=Math.max(0,a.scrollHeight-a.clientHeight);f=Math.max(0,Math.min(f,H)),Math.abs(a.scrollTop-f)>1&&(xt.current=!0,a.scrollTop=f,requestAnimationFrame(function(){xt.current=!1}))}}L||Mt(),yt.current||(yt.current=!0,requestAnimationFrame(function(){var t,e,n,i,c,a,d;if(D.current){var s=l.current,v=u.current;if(s&&v&&O.current){if(!j.current){var h=z.current,g=void 0;if("string"==typeof h&&h.includes(r)){var f=h.split(r),p="".concat(f[0]).concat(r).concat(f[1]);g=null===(t=R.current[p])||void 0===t?void 0:t.current}else g=null===(e=R.current[h])||void 0===e?void 0:e.current;if(g){var b=g.getBoundingClientRect();j.current={badgeScreenY:b.top+b.height/2,initialScrollTop:s.scrollTop,leftTop:s.getBoundingClientRect().top,leftBottom:s.getBoundingClientRect().top+s.clientHeight,cTop:null!==(i=null===(n=o.current)||void 0===n?void 0:n.getBoundingClientRect().top)&&void 0!==i?i:0}}}if(j.current){var y=j.current,x=s.scrollTop-y.initialScrollTop,m=y.badgeScreenY-x,C=((c=m,a=y.leftTop,d=y.leftBottom,Math.max(a,Math.min(d,c)))-y.cTop).toString(),A=m>=y.leftTop-4&&m<=y.leftBottom+4;O.current.setAttribute("y1",C),O.current.setAttribute("y2",C),O.current.setAttribute("visibility",A?"visible":"hidden")}}}St(),yt.current=!1}))}},[St,L,J,M,Mt]);return i(function(){G.current=Bt},[Bt]),i(function(){var t=setTimeout(Mt,250),e=function(){return U.current()};return window.addEventListener("resize",e),function(){clearTimeout(t),null!==mt.current&&clearTimeout(mt.current),null!==K.current&&clearTimeout(K.current),window.removeEventListener("resize",e)}},[W,Z,$,g,B,S,v,h,et,Mt,I,T,N,M]),{lines:rt,setLines:ct,overallConnector:lt,setOverallConnector:ut,connectedLines:vt,setConnectedLines:ht,svgDimensions:ft,cachedConnectedPositions:Ct,calculateLines:Bt,calculateLinesRef:G,calculateLinesDebounced:Mt,handleColumnScroll:It}};export{c as useLinesCalculator};
2
2
  //# sourceMappingURL=useLinesCalculator.js.map
@@ -0,0 +1,2 @@
1
+ import{__assign as n}from"tslib";var t=function(n,t){return(null==n?void 0:n.contentId)||(null==n?void 0:n.id)||t},e=function(n,t,e,o){return{id:"".concat(t,":").concat(e,":empty"),nodeId:n,title:"",content:"",change_history:"",subsections:[],relation:"not_defined",selfIndex:-1,refIndexes:[],refContentIds:[],displayTitle:!1,displayContent:!1,layoutKey:"".concat(t,":").concat(e,":empty"),comparisonRowId:t,isMappingContinuation:Boolean(o),continuationSourceRowId:o}},o=function(o,i,l,r,d,c){var a,u;if(void 0===c&&(c=!1),!o)return e(l,r,d);var f=Number(null==i?void 0:i.selfIndex),p=null!=i&&Number.isFinite(f)&&f>=0;return n(n({},o),{refIndexes:p?[f]:[],refContentIds:(null==i?void 0:i.contentId)?[i.contentId]:[],layoutKey:"".concat(r,":").concat(d,":").concat(t(o,String(d))),comparisonRowId:r,isMultipleMapping:c||o.isMultipleMapping||(null!==(u=null===(a=o.refContentIds)||void 0===a?void 0:a.length)&&void 0!==u?u:0)>1})},i=function(n,i,l){if(0===i.length&&0===l.length)return[];var r=i.length>0?i:[void 0],d=l.length>0?l:[void 0],c=[];return r.forEach(function(i,r){var a=d[0],u=[n,r,t(i,"empty-left"),0,t(a,"empty-right")].join("::");d.forEach(function(d,a){var f=[n,r,t(i,"empty-left"),a,t(d,"empty-right")].join("::"),p=null!=i&&a>0;c.push({id:f,nodeId:n,left:p?e(n,f,"left",u):o(i,d,n,f,"left",l.length>1),right:o(d,i,n,f,"right"),leftOrdinal:r,rightOrdinal:a})})}),c};export{i as buildComparisonRows};
2
+ //# sourceMappingURL=buildComparisonRows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildComparisonRows.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAOA,QAAA,MAAM,oBAAoB,+CAkNzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,oBAAoB,+CAkNzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAcf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AAuaD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwNjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAcf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AAucD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwNjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AA4CA,OAAO,EAEL,qBAAqB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AA6BlC,QAAA,MAAM,gBAAgB,qWA6BnB,qBAAqB,4CAm7FvB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AA4CA,OAAO,EAEL,qBAAqB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AA6BlC,QAAA,MAAM,gBAAgB,qWA6BnB,qBAAqB,4CAy7FvB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,eAAe,gBAAgB,CAAC"}
@@ -191,6 +191,11 @@ export type SectionBlock = {
191
191
  contentId?: string;
192
192
  parentContentId?: string | null;
193
193
  refContentIds?: string[];
194
+ layoutKey?: string;
195
+ comparisonRowId?: string;
196
+ isMappingContinuation?: boolean;
197
+ continuationSourceRowId?: string;
198
+ isMultipleMapping?: boolean;
194
199
  title: string;
195
200
  content: string;
196
201
  change_history?: string;
@@ -225,6 +230,14 @@ export type Row = {
225
230
  left?: SectionBlock;
226
231
  right?: SectionBlock;
227
232
  };
233
+ export type ComparisonRow = {
234
+ id: string;
235
+ nodeId: string;
236
+ left: SectionBlock;
237
+ right: SectionBlock;
238
+ leftOrdinal: number;
239
+ rightOrdinal: number;
240
+ };
228
241
  export interface CognitivePopupConfig {
229
242
  tabs?: {
230
243
  deviation?: {
@@ -1 +1 @@
1
- {"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,WAAW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