@viswa-test/test-citation 0.0.195 → 0.0.197
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/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +2 -0
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/segment.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/cjs/features/UserStoryImport/UserStoryPicker.js +1 -1
- package/dist/cjs/features/UserStoryImport/components/TypeDropdown.js +1 -1
- package/dist/cjs/features/UserStoryImport/components/UserStoryCard.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +2 -0
- package/dist/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js.map +1 -0
- package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/features/RequirementAI/components/segment/segment.module.css.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/features/UserStoryImport/UserStoryPicker.js +1 -1
- package/dist/features/UserStoryImport/components/TypeDropdown.js +1 -1
- package/dist/features/UserStoryImport/components/UserStoryCard.js +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts +2670 -1126
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +13 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +18 -4
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts +6 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +5 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.d.ts +4 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts +11 -0
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +0 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/interfaces/citation.interface.d.ts +37 -0
- package/dist/types/src/features/RequirementAI/interfaces/citation.interface.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +3 -0
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.context.d.ts +1 -0
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.context.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.d.ts +1 -1
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.types.d.ts +1 -0
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.types.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/components/TypeDropdown.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/components/UserStoryCard.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),r=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("./OverlayComponent.js"),u=require("./CognitiveComparehelpers.js"),s=require("./CognitiveCompareConfig.js"),a=require("./CognitiveCompareConstants.js"),c=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),f=require("./LoaderComponent.js"),v=require("./components/ThreeDotsLoader.js"),p=require("./hooks/useCompareData.js"),g=require("./hooks/useComparePopups.js"),h=require("./hooks/useSectionRefs.js"),m=require("./hooks/useAccordionState.js"),S=require("./hooks/useDeviationNavigation.js"),R=require("./components/CompareHeader.js"),x=require("./components/SubSectionAccordion.js"),_=require("./components/LHSSectionRow.js"),y=require("./components/RHSSectionRow.js"),b=require("./components/CognitiveSummaryPopup.js"),C=require("./CompareContext.js"),E=require("./hooks/useStyles.js"),A=require("./hooks/useResizeHandler.js"),B=require("./hooks/useLinesCalculator.js"),T=require("./hooks/useSideBySide.js"),w=require("./components/SvgConnectors.js");exports.SHARED_MARKDOWN_STYLES=s.SHARED_MARKDOWN_STYLES,exports.default=function(I){var D,O,F,j,N,P,k,L,M,q,H,V,z,G,W,K,U,Y,J,X,$,Q,Z,ee,ne,ie,te,oe,re,le,ue,se,ae,ce,de,fe=I.componentHeaderText,ve=void 0===fe?a.DEFAULT_COMPONENT_HEADER_TEXT:fe,pe=I.treeData,ge=I.comparisonConfig,he=I.leftColumnTitleText,me=I.rightColumnTitleText,Se=I.markdownStyles,Re=I.resetTrigger,xe=I.displayConfig,_e=void 0===xe?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0}:xe,ye=I.onMaintainRelativeOrderChange,be=I.popupConfig,Ce=I.deviationData,Ee=void 0===Ce?{}:Ce,Ae=I.deviationNodeIdToView,Be=I.resetDeviationNodeId,Te=I.isProposingFix,we=void 0!==Te&&Te,Ie=I.proposingFixNodeId,De=I.isRedlineFlow,Oe=i.useState(_e.maintainRelativeOrder),Fe=Oe[0],je=Oe[1],Ne=null!==(D=null==_e?void 0:_e.expandLevels)&&void 0!==D?D:0,Pe=!!(null==_e?void 0:_e.expandAllSections),ke=!!Fe||!!(null==_e?void 0:_e.showDeviationBadges),Le=i.useState(!1),Me=Le[0],qe=Le[1],He=i.useState(null),Ve=He[0],ze=He[1],Ge=i.useState(null===(F=null!==(O=null==pe?void 0:pe.newEvaluationResult)&&void 0!==O?O:null==_e?void 0:_e.enableDeviationSchemaBackwardCompatibility)||void 0===F||F)[0],We=i.useState(new Set),Ke=We[0],Ue=We[1],Ye=i.useState([]),Je=Ye[0],Xe=Ye[1],$e=i.useState(!1),Qe=$e[0],Ze=$e[1],en=i.useRef(null),nn=i.useRef(null),tn=i.useRef(null),on=i.useRef(null),rn=i.useRef(null),ln=i.useRef(!1),un=i.useRef(null),sn=i.useRef({}),an=i.useRef([]),cn=i.useRef(function(){}),dn=i.useRef(null),fn=i.useRef(function(){}),vn=i.useMemo(function(){return JSON.stringify(Ee||{})},[JSON.stringify(Ee)]),pn=i.useMemo(function(){return Ee||{}},[vn]),gn=i.useMemo(function(){return(null==pe?void 0:pe.cognitive_decisioning)||{}},[pe]),hn=i.useMemo(function(){return e.__assign(e.__assign({},s.SHARED_MARKDOWN_STYLES),Se)},[Se]),mn=i.useRef(null),Sn=i.useRef(null),Rn=i.useRef(null),xn=i.useRef(null),_n=i.useRef(null),yn=i.useRef(null),bn=i.useRef(null),Cn=i.useRef(null),En=i.useRef(null),An=i.useRef(null),Bn=g.useComparePopups(mn),Tn=Bn.cognitivePopup,wn=Bn.setCognitivePopup,In=Bn.moreFunctions,Dn=Bn.setMoreFunctions,On=Bn.position,Fn=Bn.setPosition,jn=Bn.activeBadgeId,Nn=Bn.summaryPopup,Pn=Bn.setSummaryPopup,kn=Bn.closeSummaryPopup,Ln=Bn.setActiveBadgeId,Mn=Bn.popupRef,qn=Bn.handleOpenCognitiveCompare,Hn=Bn.openCognitivePopupFromState,Vn=Bn.closeCognitivePopup,zn=Bn.closeMoreFunctionsPopup,Gn=i.useMemo(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==ge?void 0:ge.fields)&&void 0!==e?e:s.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(i=null===(n=null==ge?void 0:ge.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:s.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(t=null==ge?void 0:ge.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:s.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==ge?void 0:ge.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:s.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[ge]),Wn=i.useState(null),Kn=Wn[0];Wn[1];var Un=null===(P=null===(j=null==pe?void 0:pe.documents)||void 0===j?void 0:j[null===(N=null==pe?void 0:pe.input_index_map)||void 0===N?void 0:N[0]])||void 0===P?void 0:P.title,Yn=null===(M=null===(k=null==pe?void 0:pe.documents)||void 0===k?void 0:k[null===(L=null==pe?void 0:pe.input_index_map)||void 0===L?void 0:L[1]])||void 0===M?void 0:M.title,Jn=u.safeStringify(he||Un||"Uploaded Contract"),Xn=null===(z=null===(V=null===(q=null==pe?void 0:pe.documents)||void 0===q?void 0:q[null===(H=null==pe?void 0:pe.input_index_map)||void 0===H?void 0:H[0]])||void 0===V?void 0:V.metadata)||void 0===z?void 0:z.file_name,$n=u.safeStringify(Xn),Qn=null===(U=null===(K=null===(G=null==pe?void 0:pe.documents)||void 0===G?void 0:G[null===(W=null==pe?void 0:pe.input_index_map)||void 0===W?void 0:W[1]])||void 0===K?void 0:K.metadata)||void 0===U?void 0:U.file_name,Zn=u.safeStringify(Qn),ei=u.safeStringify(me||Yn||"Reference Template"),ni=p.useCognitiveTreeData(pe,Fe,pn,Gn,Ge),ii=ni.activeProposed,ti=ni.existingRule,oi=ni.proposedSections,ri=ni.existingSections,li=ni.visibleFields,ui=ni.parentDeviationRecord,si=ni.deviationNumberRegistry,ai=ni.parseError;i.useEffect(function(){ai&&ze("Failed to load comparison: ".concat(ai))},[ai]);var ci=oi.length>0||ri.length>0,di=i.useMemo(function(){if(!De)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";u.hasMeaningfulRedlineTags(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(oi),i(ri),"".concat(e,":").concat(n)},[De,oi,ri]);i.useEffect(function(){if(oi.length||ri.length)if(Pe){var e={},n={},i=function(i,t){i.forEach(function(i,o){var r,l=Fe?"".concat(t,"-").concat(o):String(o);e[l]=!0;var u=function(e,i){null==e||e.forEach(function(e,t){var o,r="".concat(i,"-").concat(t);n[r]=!0,(null===(o=e.subsections)||void 0===o?void 0:o.length)&&u(e.subsections,r)})};(null===(r=i.subsections)||void 0===r?void 0:r.length)&&u(i.subsections,String(o))})};i(oi,"left"),i(ri,"right"),Ki(e),Yi(n)}else if(Ne>0){var t={},o={},r=function(e,n,i){e.forEach(function(e,r){var l;if(i>=1){var u=Fe?"".concat(n,"-").concat(r):String(r);t[u]=!0}var s=function(e,n,t){t>i||null==e||e.forEach(function(e,i){var r,l="".concat(n,"-").concat(i);o[l]=!0,(null===(r=e.subsections)||void 0===r?void 0:r.length)&&s(e.subsections,l,t+1)})};(null===(l=e.subsections)||void 0===l?void 0:l.length)&&i>=2&&s(e.subsections,String(r),2)})};r(oi,"left",Ne),r(ri,"right",Ne),Ki(t),Yi(o)}},[Pe,Ne,oi,ri,Fe]);var fi=h.useSectionRefs(li.map(function(e){return e.key}),Math.max(oi.length,ri.length)),vi=fi.leftRefs,pi=fi.rightRefs,gi=fi.sectionLeftRefs,hi=fi.sectionRightRefs,mi=fi.lhsBadgeRefs,Si=fi.rhsBadgeRefs,Ri=fi.sectionRightRowRefs,xi=fi.subSectionLeftRefs,_i=fi.subSectionRightRefs,yi=fi.sectionRowRefs,bi=fi.getSectionRowRef,Ci=fi.getSubSectionRef,Ei=fi.getBadgeRef,Ai=T.useSideBySide({maintainRelativeOrder:Fe,proposedSections:oi,existingSections:ri,leftContainerRef:Cn,rightContainerRef:Rn,scrollContainerRef:mn,sectionLeftRefs:gi,sectionRightRefs:hi,subSectionLeftRefs:xi,subSectionRightRefs:_i,lhsBadgeRefs:mi,rhsBadgeRefs:Si,sectionRowRefs:yi,sectionRightRowRefs:Ri,rhsTopSpacerRef:xn,rhsBottomSpacerRef:_n,lhsTopSpacerRef:yn,lhsBottomSpacerRef:bn,calculateLinesRef:cn,setConnectedSections:Ue,setConnectedLines:Xe,cachedConnectedPositions:an,closeMoreFunctionsPopup:zn,setErrorToast:ze,moreFunctions:In,closeSummaryPopup:kn}),Bi=Ai.isSideBySide,Ti=Ai.isArrowVisible,wi=Ai.setIsArrowVisible,Ii=Ai.isResizing,Di=Ai.setIsResizing,Oi=Ai.isSideBySideLoading,Fi=Ai.activeSideBySideSection,ji=Ai.scrollLock,Ni=Ai.sideBySideCacheRef,Pi=Ai.isSideBySideRef,ki=Ai.activeSideBySideRightSectionRef,Li=Ai.activeSideBySideSectionRef,Mi=Ai.sideBySideLineRef,qi=Ai.highlightedClauseRefs,Hi=Ai.clearClauseHighlight,Vi=Ai.resetSideBySide,zi=Ai.activateSideBySide,Gi=m.useAccordionState({maintainRelativeOrder:!!Fe,proposedSections:oi,existingSections:ri,activeSideBySideSection:Fi,connectedSections:Ke,resetSideBySide:Vi,setConnectedSections:Ue,setConnectedLines:Xe,cachedConnectedPositions:an,svgContainerRef:en,isAnimatingRef:ln,animationTimerRef:un,calculateLinesRef:cn,sectionLeftRefs:gi,sectionRightRefs:hi,subSectionLeftRefs:xi,subSectionRightRefs:_i}),Wi=Gi.expandedSections,Ki=Gi.setExpandedSections,Ui=Gi.expandedSubSections,Yi=Gi.setExpandedSubSections,Ji=Gi.handleSubSectionToggle,Xi=Gi.toggleSection,$i=Gi.forceExpandCrossWiredSections,Qi=function(){var e,n;if(null!=Fi){var i=null===(e=gi.current[Fi])||void 0===e?void 0:e.current,t=null===(n=hi.current[Fi])||void 0===n?void 0:n.current,o=Rn.current;if(i&&t&&o){var r=i.getBoundingClientRect(),l=t.getBoundingClientRect(),u=o.getBoundingClientRect(),s=r.top-u.top,a=l.top-u.top-s;o.scrollBy({top:a,behavior:"smooth"})}}},Zi=i.useCallback(function(e){null==e||e.stopPropagation(),Ze(function(e){var n=!e;return n&&requestAnimationFrame(function(){Qi()}),n})},[Qi]);i.useEffect(function(){De&&"off"!==di&&"0:0"!==di&&(Ni.current=null,an.current=[],requestAnimationFrame(function(){var e;null===(e=cn.current)||void 0===e||e.call(cn)}))},[De,di]);var et=i.useMemo(function(){var e=new Map,n=new Map,i=1;if(Fe)oi.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),ri.forEach(function(t){if(t.id&&!(!t.title&&!t.content)){var o=oi.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(oi.length,ri.length),o=0;o<t;o++){var r=oi[o],l=ri[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[oi,ri,Fe]),nt=ti.analysis,it=u.safeStringify(null===(J=null===(Y=null==nt?void 0:nt.rule_difference_comparison)||void 0===Y?void 0:Y.summary)||void 0===J?void 0:J.overall_summary),tt=!!it.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),ot=null!==(X=null==pe?void 0:pe.base_root_id)&&void 0!==X?X:"-1";null==pe||pe[ot];var rt=Ge?null!==(se=null!==(re=Ee&&(null===(oe=null==Ee?void 0:Ee[ot])||void 0===oe?void 0:oe.evaluation_result))&&void 0!==re?re:null===(ue=null===(le=null==pe?void 0:pe.nodes)||void 0===le?void 0:le[ot])||void 0===ue?void 0:ue.evaluation_result)&&void 0!==se?se:null:null!==(te=null!==(Z=Ee&&(null===(Q=null===($=null==Ee?void 0:Ee[ot])||void 0===$?void 0:$.evaluation_result)||void 0===Q?void 0:Q[0]))&&void 0!==Z?Z:null===(ie=null===(ne=null===(ee=null==pe?void 0:pe.nodes)||void 0===ee?void 0:ee[ot])||void 0===ne?void 0:ne.evaluation_result)||void 0===ie?void 0:ie[0])&&void 0!==te?te:null,lt=u.extractDeviationScore(rt),ut=u.generateColorPalette(null!==(de=null===(ce=null===(ae=null==rt?void 0:rt.evaluation_outputs)||void 0===ae?void 0:ae.metadata)||void 0===ce?void 0:ce.label_color)&&void 0!==de?de:a.DEFAULT_DEVIAION_COLOR),st=i.useRef(Vi);i.useEffect(function(){st.current=Vi},[Vi]);var at=i.useRef(Vn);i.useEffect(function(){at.current=Vn},[Vn]);var ct=i.useCallback(function(e,n,i,t,o,r){return ho.current(e,n,i,t,o,r)},[]),dt=i.useCallback(function(e,n,i,t,o){return mo.current(e,n,i,t,o)},[]),ft=i.useCallback(function(){return So.current()},[]),vt=i.useCallback(function(e,n){return Ro.current(e,n)},[]),pt=i.useCallback(function(e){return xo.current(e)},[]),gt=i.useCallback(function(e){return _o.current(e)},[]),ht=i.useCallback(function(){return yo.current()},[]),mt=i.useCallback(function(){var e,n;Hi(),null===(e=st.current)||void 0===e||e.call(st),Ze(!1),Ue(new Set),Xe([]),an.current=[],Pt([]),Lt(null),Pn(a.EMPTY_SUMMARY_POPUP_STATE),null===(n=at.current)||void 0===n||n.call(at),requestAnimationFrame(function(){var e;null===(e=cn.current)||void 0===e||e.call(cn)})},[]),St=i.useRef(mt);i.useEffect(function(){St.current=mt},[mt]),i.useEffect(function(){Re&&St.current()},[Re]);var Rt=i.useMemo(function(){return{documents:null==pe?void 0:pe.documents,input_index_map:null==pe?void 0:pe.input_index_map}},[JSON.stringify(null==pe?void 0:pe.documents),JSON.stringify(null==pe?void 0:pe.input_index_map)]),xt=i.useRef(pe);i.useEffect(function(){xt.current=pe},[pe]);var _t=i.useRef(gn);i.useEffect(function(){_t.current=gn},[gn]);var yt=i.useCallback(function(n,i,t,o,r,l,s){var a,c,d,f,v=u.safeStringify(null==i?void 0:i.id)||u.safeStringify(null==t?void 0:t.id)||"",p=(v?null===(a=_t.current)||void 0===a?void 0:a[v]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:v,decisioning:[],gap:[],relevance_score:0},g=null!==(d=null===(c=yi.current[o])||void 0===c?void 0:c.current)&&void 0!==d?d:null;return{isLoading:null!==(f=null==_e?void 0:_e.isLoading)&&void 0!==f&&f,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:p,anchorEl:n,sectionAnchorEl:g,badgeStyle:l||null,sectionIdx:o,docData:Rt,deviationData:function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,s=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e.__assign(e.__assign({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(u.DEVIATION_BADGE_SEPARATOR)))return s(l);var a=o.split(u.DEVIATION_BADGE_SEPARATOR)[1];if(!a)return l;var c=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},d=(null===(n=null==c?void 0:c.deviation_entries)||void 0===n?void 0:n[a])||(null===(r=null==c?void 0:c.deviations)||void 0===r?void 0:r[a])||null;return d?e.__assign(e.__assign(e.__assign({},c),d),{deviation_summary:(null==d?void 0:d.deviation_summary)||(null==c?void 0:c.deviation_summary),deviation_title:(null==d?void 0:d.deviation_title)||(null==c?void 0:c.deviation_title),deviation_impact:(null==d?void 0:d.deviation_impact)||(null==c?void 0:c.deviation_impact),deviation_explanation:(null==d?void 0:d.deviation_explanation)||(null==c?void 0:c.deviation_explanation),evaluation_outputs:(null==d?void 0:d.evaluation_outputs)||(null==c?void 0:c.evaluation_outputs),cognitive_decisioning:(null==d?void 0:d.cognitive_decisioning)||(null==c?void 0:c.cognitive_decisioning)}):s(l)}(),isOrphan:!!r}},[Rt]),bt=i.useCallback(function(e,n,i,t,o,r){var l;if(e.stopPropagation(),In.open&&In.sectionIdx===o)zn();else{var s=e.currentTarget,a="left";(null===(l=Rn.current)||void 0===l?void 0:l.contains(s))&&(a="right");Hi(),Pi.current&&Vi(),Ue(new Set),Xe([]),an.current=[],Vn(),Nn.open?Jt():kn(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(u.DEVIATION_BADGE_SEPARATOR)){var r=o.split(u.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Si.current[l])||void 0===e?void 0:e.current:null===(n=mi.current[l])||void 0===n?void 0:n.current}return"right"===a?null===(i=Si.current[o])||void 0===i?void 0:i.current:null===(t=mi.current[o])||void 0===t?void 0:t.current}()||s;Dn(yt(e,n,t,o,i,r))})}},[In.open,In.sectionIdx,zn,kn,yt]),Ct=i.useCallback(function(){var e=In.sectionIdx;In.isOrphan,zn(),kn(),null!==e&&($i(e),Hi(),Pi.current&&Vi(),Xe([]),an.current=[],Ue(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){cn.current&&cn.current()},50))},[In.sectionIdx,In.isOrphan,zn,kn,Vi]),Et=i.useCallback(function(){var e=rn.current;if(e){rn.current=null;var n=oi.findIndex(function(n){return n.id===e}),i=ri.findIndex(function(n){return n.id===e}),t=-1===n?u.findKeyPathByNodeId(oi,e):null,o=-1===i?u.findKeyPathByNodeId(ri,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,s=function(e,n,i,t){var o,r,l,u;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(u=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==u?u:null},a=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(qi.current.add(r),u.scrollAndHighlightClause(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(Fe)-1!==r&&Cn.current&&a(function(){return s(n,t,gi,xi)},Cn.current),-1!==l&&Rn.current&&a(function(){return s(i,o,hi,_i)},Rn.current);else{var c=mn.current;if(!c)return;a(function(){return-1!==r?s(n,t,gi,xi):s(i,o,hi,_i)},c)}}},[oi,ri,Fe,gi,hi,xi,_i,Cn,Rn,mn]),At=i.useCallback(function(n){if(n){Hi(),Vi(),Ue(new Set),Xe([]),an.current=[],kn(),Vn();var i=oi.findIndex(function(e){return e.id===n}),t=ri.findIndex(function(e){return e.id===n}),o=-1===i?u.findKeyPathByNodeId(oi,n):null,r=-1===t?u.findKeyPathByNodeId(ri,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,s=-1!==t?t:r?Number(r.split("-")[0]):-1;rn.current=n,Ki(function(n){var i,t=e.__assign({},n),o=!1;-1!==l&&(t[i=Fe?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==s&&(t[i=Fe?"right-".concat(s):String(s)]||(t[i]=!0,o=!0));return o?t:n}),Yi(function(n){var i=e.__assign({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){rn.current===n&&Bt.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[oi,ri,Fe,Ki,Yi,Vi,kn,Vn]),Bt=i.useRef(Et);i.useEffect(function(){Bt.current=Et},[Et]);var Tt=i.useRef(null);i.useEffect(function(){if(Kn){var e=Gn.fields.find(function(e){return e.analysisKey===Kn||e.key===Kn});if(e){var n=vi.current[e.key]||pi.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Kn,Gn.fields]);var wt=i.useCallback(function(e){var n,i,t,o,r,l,u,s,a,c=null===(n=null==nt?void 0:nt.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!c||!c[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=c[e],f=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var v=d.mappings[0]||{};return{score:d.score,relation:v.relation||"",highlightsA:(null===(l=v.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=v.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!f}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(s=d.highlights)||void 0===s?void 0:s.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!f}},[nt]),It=E.useStyleHelpers({proposedSections:oi,existingSections:ri,maintainRelativeOrder:Fe,cognitiveMap:gn,deviationData:pn,treeData:pe,resolvedComparisonConfig:Gn}),Dt=It.getSectionCompareStyle,Ot=It.getSubSectionCompareStyle,Ft=It.getDeviationStyleByKey,jt=B.useLinesCalculator({containerRef:nn,leftContainerRef:Cn,rightContainerRef:Rn,svgContainerRef:en,pathRefs:sn,leftHeaderRef:tn,rightHeaderRef:on,proposedSections:oi,existingSections:ri,visibleFields:li,leftRefs:vi,rightRefs:pi,sectionLeftRefs:gi,sectionRightRefs:hi,subSectionLeftRefs:xi,subSectionRightRefs:_i,lhsBadgeRefs:mi,rhsBadgeRefs:Si,sectionRowRefs:yi,expandedSections:Wi,expandedSubSections:Ui,connectedSections:Ke,isSideBySide:Bi,activeSideBySideSection:Fi,maintainRelativeOrder:Fe,cognitiveMap:gn,getSectionCompareStyle:Dt,getSubSectionCompareStyle:Ot,getDeviationStyleByKey:Ft,isArrowVisible:Ti,isAnimatingRef:ln,isSideBySideRef:Pi,sideBySideCacheRef:Ni,sideBySideLineRef:Mi,activeSideBySideSectionRef:Li,activeSideBySideRightSectionRef:ki,connectedLines:Je,setConnectedLines:Xe,cachedConnectedPositions:an,calculateLinesRef:cn,resizeTimerRef:dn,scrollLock:ji,scrollSyncLocked:Qe,handleResizeRef:fn,activeProposed:ii,existingRule:ti,analysisData:nt,pendingScrollTargetRef:En,pendingScrollCallbackRef:An,resolvedComparisonConfig:Gn,getFieldData:wt}),Nt=jt.lines,Pt=jt.setLines,kt=jt.overallConnector,Lt=jt.setOverallConnector,Mt=jt.svgDimensions,qt=jt.handleColumnScroll;i.useEffect(function(){Nn.anchorEl&&requestAnimationFrame(function(){requestAnimationFrame(function(){var e;null===(e=cn.current)||void 0===e||e.call(cn)})})},[Nn.anchorEl,Qe]);var Ht=i.useCallback(function(){Hi(),Ze(!1),Ki({}),Yi({}),Vi(),Ue(new Set),Xe([]),an.current=[],kn(),Vn(),zn(),requestAnimationFrame(function(){cn.current&&cn.current()})},[Ki,Yi,Vi,kn,Vn,zn]);i.useEffect(function(){Bi||0!==Ke.size||Ze(!1)},[Bi,Ke]);var Vt=i.useMemo(function(){return Object.values(Wi).some(Boolean)||Object.values(Ui).some(Boolean)},[Wi,Ui]),zt=i.useRef(null),Gt=i.useRef(0),Wt=i.useRef(0),Kt=i.useRef(0),Ut=A.useResizeHandler({timerRef:zt,ruleComponentRef:Sn,scrollContainerRef:mn,containerRef:nn,maintainRelativeOrder:Fe,proposedSections:oi,existingSections:ri,isSideBySideRef:Pi,activeSideBySideSectionRef:Li,activeSideBySideRightSectionRef:ki,sectionRowRefs:yi,sectionRightRowRefs:Ri,sectionLeftRefs:gi,sectionRightRefs:hi,subSectionLeftRefs:xi,subSectionRightRefs:_i,lhsBadgeRefs:mi,rhsBadgeRefs:Si,leftContainerRef:Cn,rightContainerRef:Rn,calculateLinesRef:cn,handleResizeRef:fn,setIsResizing:Di,setIsArrowVisible:wi,sideBySideCacheRef:Ni,cachedConnectedPositions:an}).handleResize;i.useEffect(function(){fn.current=Ut},[Ut,fn]),i.useEffect(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,u;i.current=null;var s=e[e.length-1];if(s){var a=null!==(u=null===(l=null===(r=s.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:s.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return Sn.current&&o.push(e(Sn.current,Gt,n,function(){return fn.current()},function(){})),mn.current&&o.push(e(mn.current,Wt,i,function(){return fn.current()},function(){return cn.current()})),nn.current&&o.push(e(nn.current,Kt,t,function(){return fn.current()},function(){return cn.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),i.useEffect(function(){Pi.current=Bi},[Bi]),i.useEffect(function(){Li.current=Fi},[Fi]);var Yt=i.useCallback(function(){var e,n=In.sectionIdx,i=In.isOrphan;if(kn(),null!=n){var t="left";In.anchorEl&&(null===(e=Rn.current)||void 0===e?void 0:e.contains(In.anchorEl))&&(t="right"),$i(n),zi(n,i,{sourceSide:t})}},[zi,In.isOrphan,In.sectionIdx,In.anchorEl,kn]),Jt=i.useCallback(function(){kn(),Vi(),Ue(new Set),Xe([]),an.current=[]},[kn,Vi]),Xt=null!==In.sectionIdx&&Ke.has(In.sectionIdx),$t=S.useDeviationNavigation({proposedSections:oi,existingSections:ri,parentDeviationRecord:ui,expandedSections:Wi,maintainRelativeOrder:!!Fe,scrollContainerRef:mn,leftContainerRef:Cn,rightContainerRef:Rn,lhsBadgeRefs:mi,rhsBadgeRefs:Si}),Qt=$t.showDeviationNavigation,Zt=$t.showOpenNodeRef,eo=$t.adjustScrollForPopup,no=i.useCallback(function(e,n,i,t,o){var r,l="string"==typeof t?u.safeStringify(t).trim():u.safeStringify(null==t?void 0:t.deviation_summary).trim(),s=e.currentTarget;Vn();var a="left";(null===(r=Rn.current)||void 0===r?void 0:r.contains(s))&&(a="right");var c=function(){var e,i,t,o;if("string"==typeof n&&n.includes(u.DEVIATION_BADGE_SEPARATOR)){var r=n.split(u.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Si.current[l])||void 0===e?void 0:e.current:null===(i=mi.current[l])||void 0===i?void 0:i.current}return"right"===a?null===(t=Si.current[n])||void 0===t?void 0:t.current:null===(o=mi.current[n])||void 0===o?void 0:o.current};if(i)return Vi(),Ue(new Set),Xe([]),an.current=[],void(l&&($i(n),requestAnimationFrame(function(){var e=c()||s;e&&(e.getBoundingClientRect().top>.8*window.innerHeight&&e.scrollIntoView({behavior:"smooth",block:"center"}));Pn({open:!0,anchorEl:e,summary:t,displayImpact:o})})));$i(n),l?setTimeout(function(){zi(n,i,{toggleIfSame:!1,sourceSide:a,onReady:function(){var e,n,i,r=c()||s;if(r){var l=r.getBoundingClientRect();if(l.top>.8*window.innerHeight||l.top<100){var u=l.top-window.innerHeight/2;Fe?(null===(e=Cn.current)||void 0===e||e.scrollBy({top:u,behavior:"smooth"}),null===(n=Rn.current)||void 0===n||n.scrollBy({top:u,behavior:"smooth"})):null===(i=mn.current)||void 0===i||i.scrollBy({top:u,behavior:"smooth"})}}Pn({open:!0,anchorEl:r,summary:t,displayImpact:o})}})},350):setTimeout(function(){zi(n,i,{toggleIfSame:!1,sourceSide:a})},350)},[zi,Vn,Pn,Vi,$i]),io=i.useMemo(function(){var e;if(!Ae)return null;var n=null===(e=null==Ae?void 0:Ae.id)||void 0===e?void 0:e.split(":")[0];for(var i in ui){if((ui[i]||[]).some(function(e){return e.id===n}))return i}return null},[Ae,ui]),to=i.useRef({id:null,triggerMs:null}),oo=i.useRef(null),ro=i.useRef(Wi);i.useEffect(function(){ro.current=Wi},[Wi]),i.useEffect(function(){var n;if(null==Ae?void 0:Ae.id){var i=Number(Ae.trigger),t=to.current;if((null==t?void 0:t.triggerMs)!==i){if(!(Ae.id.includes(":")&&/:\d+$/.test(Ae.id)))return to.current={id:Ae.id,triggerMs:i},void At(Ae.id);var o=null===(n=null==Ae?void 0:Ae.id)||void 0===n?void 0:n.split(":"),r=o[0],l=o[1],s=null!=l?l:"0";oo.current!==Ae.id&&(kn(),Vn(),Vi(),Ue(new Set),Xe([]),an.current=[],oo.current=Ae.id);var a=!1,c=0,d=null,f=200,v=!1,p=function(e,n){for(var i=function(e,t){if(!e)return null;if(e.id===n)return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},g=function(){var n,t,o,l;if(!a){var h=function(){to.current={id:Ae.id,triggerMs:i}},m=null,S=null;for(var R in ui){var x=ui[R].find(function(e){return e.id===r});if(x){m=R,S=x;break}}if(S&&m){var _=oi.findIndex(function(e){return e.id===m}),y=ri.findIndex(function(e){return e.id===m}),b=-1===_&&-1!==y,C=p(oi,S.id),E=p(ri,S.id);if(C&&!E&&!b){var A=C.split("-"),B=Number(A[0]);if(Fe){var T=null===(t=null===(n=oi[B])||void 0===n?void 0:n.refIndexes)||void 0===t?void 0:t[0],w=ri.findIndex(function(e){return e.selfIndex===T});-1!==w&&(B=w)}E=e.__spreadArray([B],A.slice(1),!0).join("-")}if(C||E){var I=C?Number(C.split("-")[0]):_,D=E?Number(E.split("-")[0]):y,O=D>=0?D:E?Number(E.split("-")[0]):-1,F=oi[I],j=ri[O],N=F&&!F.title&&!F.content,P=j&&!j.title&&!j.content,k=b||(!C&&!!E||N&&!P);if(!v){var L=!1;if(I>=0&&!b)(Fe?!!ro.current["left-".concat(I)]:!!ro.current[String(I)])||(Xi(I,"left"),L=!0);if(D>=0)(Fe?!!ro.current["right-".concat(O)]:!!ro.current[String(O)])||(Xi(O,"right"),L=!0);if((C&&C.includes("-")||E&&E.includes("-"))&&(Yi(function(n){var i=e.__assign({},n),t=!1,o=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return C&&o(C),E&&o(E),t?i:n}),L||(L=!0)),L)return v=!0,void(d=setTimeout(g,800))}var M,q=C||"",H=E||"",V="".concat(S.id).concat(u.DEVIATION_BADGE_SEPARATOR).concat(s).concat(u.DEVIATION_BADGE_SEPARATOR).concat(q).concat(u.DEVIATION_BADGE_SEPARATOR).concat(H),z="".concat(S.id).concat(u.DEVIATION_BADGE_SEPARATOR).concat(s),G=null===(o=mi.current[z])||void 0===o?void 0:o.current,W=null===(l=Si.current[z])||void 0===l?void 0:l.current,K=k||!G&&!!W,U=K?W:G;if(M=Fe?K?Rn.current:Cn.current:mn.current,U&&M){var Y=U.getBoundingClientRect();if(0===Y.height)return void((c+=1)<6?d=setTimeout(g,f):h());var J=M.getBoundingClientRect(),X=Y.top-J.top+M.scrollTop-J.height/2+Y.height/2,$=C&&C.includes("-")||E&&E.includes("-"),Q=function(){var n,i,t,o,r,l;if(!a){h();var c=U instanceof Element?window.getComputedStyle(U).color:"";G&&(G.style.transition="box-shadow 300ms ease-in-out",G.style.boxShadow="0 0 10px ".concat(c)),W&&(W.style.transition="box-shadow 300ms ease-in-out",W.style.boxShadow="0 0 10px ".concat(c)),setTimeout(function(){G&&(G.style.boxShadow=""),W&&(W.style.boxShadow="")},2e3);var d=(null===(i=null===(n=S.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===i?void 0:i[s])||S,f=(null===(t=S.evaluationResult)||void 0===t?void 0:t.evaluation_outputs)||S.evaluation_outputs,v=!!G&&!!W,p=!!("string"==typeof(null==d?void 0:d.deviation_summary)?d.deviation_summary.trim():u.safeStringify(null!==(o=null==d?void 0:d.deviation_summary)&&void 0!==o?o:"").trim()),g=K?(null===(r=Si.current[$?z:O])||void 0===r?void 0:r.current)||W:(null===(l=mi.current[$?z:I])||void 0===l?void 0:l.current)||G;if(!v||!p)return eo(g,function(){Pn({open:!0,anchorEl:g,displayImpact:Ae.displayImpact,summary:e.__assign(e.__assign({},d),{evaluation_outputs:f})})},{skipScroll:!0}),void(null==Be||Be());zi(V,!1,{toggleIfSame:!1,sourceSide:b?"right":"left",onReady:function(){var n,i;h();var t=K?(null===(n=Si.current[z])||void 0===n?void 0:n.current)||W:(null===(i=mi.current[z])||void 0===i?void 0:i.current)||G;Pn({open:!0,anchorEl:t,displayImpact:Ae.displayImpact,summary:e.__assign({},d)}),null==Be||Be()}})}},Z=function(){if(!Fe)return null;var e=K?G:W,n=K?Cn.current:Rn.current;if(!e||!n)return null;var i=e.getBoundingClientRect();if(0===i.height)return null;var t=n.getBoundingClientRect();return{container:n,top:i.top-t.top+n.scrollTop-t.height/2+i.height/2}}(),ee=Math.abs(M.scrollTop-X)<=2,ne=!Z||Math.abs(Z.container.scrollTop-Z.top)<=2;ee&&ne?Q():(ee||(En.current=X,An.current=Q,M.scrollTo({top:X,behavior:"smooth"})),Z&&!ne&&Z.container.scrollTo({top:Z.top,behavior:"smooth"}),d&&clearTimeout(d),d=setTimeout(function(){if(An.current){En.current=null;var e=An.current;An.current=null,e()}else ee&&Q()},1500))}else(c+=1)<6?d=setTimeout(g,f):h()}else(c+=1)<6?d=setTimeout(g,f):h()}else(c+=1)<6?d=setTimeout(g,f):h()}};return d=setTimeout(g,f),function(){a=!0,d&&clearTimeout(d)}}}},[Ae,ui,oi,ri,Fe,Xi,zi,Pn,At]),i.useEffect(function(){var n,i,t;if(Nn.open){var o=Nn.anchorEl;if(o&&!o.isConnected){var r=function(e){for(var n,i=0,t=Object.entries(e);i<t.length;i++){var r=t[i],l=r[0];if((null===(n=r[1].current)||void 0===n?void 0:n.textContent)===o.textContent)return l}return null},l=(null===(n=o.dataset)||void 0===n?void 0:n.deviationRefId)||r(mi.current)||r(Si.current);if(l){var u=(null===(i=Si.current[l])||void 0===i?void 0:i.current)||(null===(t=mi.current[l])||void 0===t?void 0:t.current);u&&u.isConnected&&Pn(function(n){return e.__assign(e.__assign({},n),{anchorEl:u})})}}}},[Nn.open,Nn.anchorEl,Qe,Ke,Wi]);var lo=Tn.open,uo=Tn.sectionIdx,so=Tn.isOrphan,ao=Tn.badgeStyle,co=Tn.anchorEl,fo=Tn.sectionAnchorEl;i.useEffect(function(){var n;if(lo&&null!=uo&&uo!==ot){var i="string"==typeof uo?uo.split(u.DEVIATION_BADGE_SEPARATOR)[0]:null,t=function(e,n){var i;if(!e||!Array.isArray(e))return null;for(var o=0,r=e;o<r.length;o++){var l=r[o];if(l.id===n)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var u=t(l.subsections,n);if(u)return u}}return null},o=i&&"string"==typeof i?t(oi,i):null,r=i&&"string"==typeof i?t(ri,i):null,l="number"==typeof uo?oi[uo]||null:o||i&&((null===(n=null==pe?void 0:pe.nodes)||void 0===n?void 0:n[i])||(null==pe?void 0:pe[i]))||null,s="number"==typeof uo?ri[uo]||null:r,a=yt(co,l,s,uo,so,ao);wn(function(n){return n.open?u.safeStringify(n.cognitiveData)===u.safeStringify(a.cognitiveData)&&u.safeStringify(n.deviationData)===u.safeStringify(a.deviationData)&&n.sectionTitle===a.sectionTitle&&n.refSectionTitle===a.refSectionTitle?n:e.__assign(e.__assign(e.__assign({},n),a),{open:!0,anchorEl:n.anchorEl,sectionAnchorEl:n.sectionAnchorEl}):n})}},[lo,uo,so,ao,co,fo,oi,ri,yt]);var vo=i.useCallback(function(e){var i=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,u=void 0===l?"left":l,s=e.parentNodeId,a=void 0===s?"":s,c=e.sectionOffset;return n.jsx(x.default,{section:i,keyPath:t,depth:r,columnKey:u,parentNodeId:a,sectionOffset:c})},[]),po=i.useMemo(function(){return oi.map(function(e,i){var t,o=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return o&&r&&Fe?null:n.jsx(_.default,{section:e,idx:i},null!==(t=null==e?void 0:e.id)&&void 0!==t?t:"left-row-".concat(i))})},[oi]),go=i.useMemo(function(){return ri.map(function(e,i){var t,o=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return o&&r&&Fe?null:n.jsx(y.default,{section:e,idx:i},null!==(t=null==e?void 0:e.id)&&void 0!==t?t:"right-row-".concat(i))})},[ri]),ho=i.useRef(bt);i.useEffect(function(){ho.current=bt},[bt]);var mo=i.useRef(no);i.useEffect(function(){mo.current=no},[no]);var So=i.useRef(Jt);i.useEffect(function(){So.current=Jt},[Jt]);var Ro=i.useRef(Xi);i.useEffect(function(){Ro.current=Xi},[Xi]);var xo=i.useRef(Ji);i.useEffect(function(){xo.current=Ji},[Ji]);var _o=i.useRef(vo);i.useEffect(function(){_o.current=vo},[vo]);var yo=i.useRef(Vi);i.useEffect(function(){yo.current=Vi},[Vi]);var bo=i.useMemo(function(){return{maintainRelativeOrder:!!Fe,showDeviationBadges:ke,isProposingFix:we,proposingFixNodeId:Ie,isRedlineFlow:De,isSideBySide:Bi,activeSideBySideSection:Fi,scrollSyncLocked:Qe,toggleScrollSyncLocked:Zi,summaryPopupAnchorEl:Nn.anchorEl,connectedSections:Ke,proposedSections:oi,existingSections:ri,deviationNumberRegistry:si,treeData:pe,displayConfig:_e,resolvedMarkdownStyles:hn,unifiedNumbering:et,expandedSections:Wi,expandedSubSections:Ui,setExpandedSubSections:Yi,getSectionCompareStyle:Dt,getSubSectionCompareStyle:Ot,getBadgeRef:Ei,getSectionRowRef:bi,getSubSectionRef:Ci,sectionLeftRefs:gi,sectionRightRefs:hi,sectionRowRefs:yi,sectionRightRowRefs:Ri,subSectionLeftRefs:xi,subSectionRightRefs:_i,lhsBadgeRefs:mi,rhsBadgeRefs:Si,openMoreFunctionsPopup:ct,handleOpenSummaryPopup:dt,openSummaryPopup:dt,handleCloseSummaryPopup:ft,toggleSection:vt,handleSubSectionToggle:pt,renderSubSectionAccordion:gt,resetSideBySide:ht,setConnectedSections:Ue,setConnectedLines:Xe,cachedConnectedPositions:an,showDeviationNavigation:Qt,showOpenNodeRef:Zt,deviationNodeIdToView:null==Ae?void 0:Ae.id,deviationTargetParentId:io}},[Fe,ke,we,Ie,De,Bi,Fi,Qe,Zi,Nn.anchorEl,Ke,oi,ri,si,_e,hn,et,Wi,Ui,Yi,Dt,Ot,Ei,bi,Ci,Qt,Zt,Ae,io]);return n.jsx(C.CompareContextProvider,e.__assign({value:bo},{children:n.jsxs(t.Box,e.__assign({ref:Sn,sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"visible",position:"relative"}},{children:[Me&&n.jsx(t.Box,e.__assign({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:n.jsx(f.default,{})})),Nn.open&&n.jsx(b.default,{open:Nn.open,anchorEl:Nn.anchorEl,containerEl:Tt.current,clipTopEl:tn.current,scrollContainerEl:mn.current,onClose:Jt,summary:Nn.summary,displayImpact:Nn.displayImpact,isScrollLocked:Qe}),n.jsx(d.default,{open:In.open,anchorEl:In.anchorEl,maintainRelativeOrder:!!Fe,sectionTitle:In.sectionTitle,referenceSectionTitle:In.refSectionTitle,onClose:zn,onOpenCognitiveCompare:qn,onOpenSideBySide:Yt,onConnect:Ct,isConnected:Xt,isOrphan:In.isOrphan}),Tn.open&&n.jsx(c.default,{open:Tn.open,popupRef:Mn,position:On,popupConfig:be,onClose:function(){Fn(null),wn(function(n){return e.__assign(e.__assign({},n),{open:!1})}),Ln(null)},markdownStyles:Se,sectionTitle:$n,referenceSectionTitle:Zn,cognitiveData:Tn.cognitiveData,anchorEl:Tn.anchorEl,sectionAnchorEl:Tn.sectionAnchorEl,scrollContainerEl:mn.current,badgeStyle:Tn.badgeStyle,docData:Tn.docData,deviationData:Tn.deviationData,isLoading:Tn.isLoading}),n.jsx(t.Snackbar,e.__assign({open:!!Ve,autoHideDuration:8e3,onClose:function(){return ze(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(t.Alert,e.__assign({onClose:function(){return ze(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ve}))})),n.jsx(R.default,{componentHeaderText:ve,displayConfig:_e,maintainRelativeOrder:Fe,onCollapseAll:Ht,showCollapseAll:Vt,onToggleView:function(e){qe(!0),setTimeout(function(){je(!e),null==ye||ye(!e),Ze(!1),Vi(),kn(),Ue(new Set),Xe([]),an.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){qe(!1)},600)})})},50)}}),n.jsx(t.Box,e.__assign({ref:mn,onScroll:qt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:Fe?"visible":"auto",borderTop:it&&tt?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(t.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},Fe?{flex:1}:{})},{children:n.jsxs(t.Box,e.__assign({ref:nn,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},Fe?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(w.default,{svgContainerRef:en,svgDimensions:Mt,isResizing:Ii,overallConnector:kt,rootDeviationStyle:ut,lines:Nt,isSideBySide:Bi,activeSideBySideSection:Fi,isArrowVisible:Ti,maintainRelativeOrder:Fe,proposedSections:oi,existingSections:ri,cognitivePopup:Tn,activeBadgeId:jn,closeCognitivePopup:Vn,setActiveBadgeId:Ln,openCognitivePopupFromState:Hn,buildSectionPopupState:yt,connectedLines:Je,pathRefs:sn}),n.jsxs(t.Box,e.__assign({sx:e.__assign({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},Fe?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(t.Box,e.__assign({ref:tn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:n.jsx(t.Tooltip,e.__assign({title:Jn,placement:"top"},{children:n.jsx(t.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Jn}))}))})),n.jsxs(t.Box,e.__assign({ref:Cn,onScroll:qt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},Fe?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-180px",pr:"192px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:yn,style:{width:"100%",height:"0px",flexShrink:0}}),ci&&po,n.jsx("div",{ref:bn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(t.Box,e.__assign({ref:Tt,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:n.jsx(t.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(t.Box,e.__assign({onClick:function(n){n.stopPropagation(),Tn.open&&jn===ot?Vn():(Ln(ot),Hn(yt(n.currentTarget,{title:"",content:"",evaluationResult:rt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,ot,!0,e.__assign(e.__assign({},ut),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:ut.badgeBg,color:ut.badgeText,border:"1px solid ".concat(ut.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=lt?lt:n.jsx(v.default,{}),n.jsx(t.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(r.ButtonCognitiveIcon,{})})),n.jsx(o.ChevronDown,{size:11,style:{transform:Tn.open&&jn===ot?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),n.jsxs(t.Box,e.__assign({sx:e.__assign({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},Fe?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Oi&&n.jsx(l.default,{sections:11}),n.jsx(t.Box,e.__assign({ref:on,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(t.Tooltip,e.__assign({title:ei,placement:"top"},{children:n.jsx(t.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:ei}))}))})),n.jsxs(t.Box,e.__assign({ref:Rn,onScroll:qt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},Fe?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:xn,style:{width:"100%",height:"0px",flexShrink:0}}),ci&&go,n.jsx("div",{ref:_n,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),r=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("./OverlayComponent.js"),s=require("./CognitiveComparehelpers.js"),u=require("./CognitiveCompareConfig.js"),a=require("./CognitiveCompareConstants.js"),c=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),f=require("./LoaderComponent.js"),v=require("./components/ThreeDotsLoader.js"),p=require("./hooks/useCompareData.js"),g=require("./hooks/useComparePopups.js"),h=require("./hooks/useSectionRefs.js"),m=require("./hooks/useAccordionState.js"),S=require("./hooks/useDeviationNavigation.js"),R=require("./components/CompareHeader.js"),x=require("./components/SubSectionAccordion.js"),_=require("./components/LHSSectionRow.js"),y=require("./components/RHSSectionRow.js"),b=require("./components/CognitiveSummaryPopup.js"),C=require("./CompareContext.js"),E=require("./hooks/useStyles.js"),A=require("./hooks/useResizeHandler.js"),B=require("./hooks/useLinesCalculator.js"),T=require("./hooks/useSideBySide.js"),w=require("./components/SvgConnectors.js");exports.SHARED_MARKDOWN_STYLES=u.SHARED_MARKDOWN_STYLES,exports.default=function(I){var D,O,F,j,N,P,k,L,M,q,H,V,z,G,W,K,U,Y,J,X,$,Q,Z,ee,ne,ie,te,oe,re,le,se,ue,ae,ce,de,fe=I.componentHeaderText,ve=void 0===fe?a.DEFAULT_COMPONENT_HEADER_TEXT:fe,pe=I.treeData,ge=I.comparisonConfig,he=I.leftColumnTitleText,me=I.rightColumnTitleText,Se=I.markdownStyles,Re=I.resetTrigger,xe=I.displayConfig,_e=void 0===xe?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0}:xe,ye=I.onMaintainRelativeOrderChange,be=I.popupConfig,Ce=I.deviationData,Ee=void 0===Ce?{}:Ce,Ae=I.deviationNodeIdToView,Be=I.resetDeviationNodeId,Te=I.isProposingFix,we=void 0!==Te&&Te,Ie=I.proposingFixNodeId,De=I.isRedlineFlow,Oe=i.useState(_e.maintainRelativeOrder),Fe=Oe[0],je=Oe[1],Ne=null!==(D=null==_e?void 0:_e.expandLevels)&&void 0!==D?D:0,Pe=!!(null==_e?void 0:_e.expandAllSections),ke=!!Fe||!!(null==_e?void 0:_e.showDeviationBadges),Le=i.useState(!1),Me=Le[0],qe=Le[1],He=i.useState(null),Ve=He[0],ze=He[1],Ge=i.useState(null===(F=null!==(O=null==pe?void 0:pe.newEvaluationResult)&&void 0!==O?O:null==_e?void 0:_e.enableDeviationSchemaBackwardCompatibility)||void 0===F||F)[0],We=i.useState(new Set),Ke=We[0],Ue=We[1],Ye=i.useState([]),Je=Ye[0],Xe=Ye[1],$e=i.useState(!1),Qe=$e[0],Ze=$e[1],en=i.useRef(null),nn=i.useRef(null),tn=i.useRef(null),on=i.useRef(null),rn=i.useRef(null),ln=i.useRef(!1),sn=i.useRef(null),un=i.useRef({}),an=i.useRef([]),cn=i.useRef(function(){}),dn=i.useRef(null),fn=i.useRef(function(){}),vn=i.useMemo(function(){return JSON.stringify(Ee||{})},[JSON.stringify(Ee)]),pn=i.useMemo(function(){return Ee||{}},[vn]),gn=i.useMemo(function(){return(null==pe?void 0:pe.cognitive_decisioning)||{}},[pe]),hn=i.useMemo(function(){return e.__assign(e.__assign({},u.SHARED_MARKDOWN_STYLES),Se)},[Se]),mn=i.useRef(null),Sn=i.useRef(null),Rn=i.useRef(null),xn=i.useRef(null),_n=i.useRef(null),yn=i.useRef(null),bn=i.useRef(null),Cn=i.useRef(null),En=i.useRef(null),An=i.useRef(null),Bn=g.useComparePopups(mn),Tn=Bn.cognitivePopup,wn=Bn.setCognitivePopup,In=Bn.moreFunctions,Dn=Bn.setMoreFunctions,On=Bn.position,Fn=Bn.setPosition,jn=Bn.activeBadgeId,Nn=Bn.summaryPopup,Pn=Bn.setSummaryPopup,kn=Bn.closeSummaryPopup,Ln=Bn.setActiveBadgeId,Mn=Bn.popupRef,qn=Bn.handleOpenCognitiveCompare,Hn=Bn.openCognitivePopupFromState,Vn=Bn.closeCognitivePopup,zn=Bn.closeMoreFunctionsPopup,Gn=i.useMemo(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==ge?void 0:ge.fields)&&void 0!==e?e:u.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(i=null===(n=null==ge?void 0:ge.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:u.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(t=null==ge?void 0:ge.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:u.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==ge?void 0:ge.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:u.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[ge]),Wn=i.useState(null),Kn=Wn[0];Wn[1];var Un=null===(P=null===(j=null==pe?void 0:pe.documents)||void 0===j?void 0:j[null===(N=null==pe?void 0:pe.input_index_map)||void 0===N?void 0:N[0]])||void 0===P?void 0:P.title,Yn=null===(M=null===(k=null==pe?void 0:pe.documents)||void 0===k?void 0:k[null===(L=null==pe?void 0:pe.input_index_map)||void 0===L?void 0:L[1]])||void 0===M?void 0:M.title,Jn=s.safeStringify(he||Un||"Uploaded Contract"),Xn=null===(z=null===(V=null===(q=null==pe?void 0:pe.documents)||void 0===q?void 0:q[null===(H=null==pe?void 0:pe.input_index_map)||void 0===H?void 0:H[0]])||void 0===V?void 0:V.metadata)||void 0===z?void 0:z.file_name,$n=s.safeStringify(Xn),Qn=null===(U=null===(K=null===(G=null==pe?void 0:pe.documents)||void 0===G?void 0:G[null===(W=null==pe?void 0:pe.input_index_map)||void 0===W?void 0:W[1]])||void 0===K?void 0:K.metadata)||void 0===U?void 0:U.file_name,Zn=s.safeStringify(Qn),ei=s.safeStringify(me||Yn||"Reference Template"),ni=p.useCognitiveTreeData(pe,Fe,pn,Gn,Ge),ii=ni.activeProposed,ti=ni.existingRule,oi=ni.proposedSections,ri=ni.existingSections,li=ni.visibleFields,si=ni.parentDeviationRecord,ui=ni.deviationNumberRegistry,ai=ni.parseError;i.useEffect(function(){ai&&ze("Failed to load comparison: ".concat(ai))},[ai]);var ci=oi.length>0||ri.length>0,di=i.useMemo(function(){if(!De)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";s.hasMeaningfulRedlineTags(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(oi),i(ri),"".concat(e,":").concat(n)},[De,oi,ri]);i.useEffect(function(){if(oi.length||ri.length)if(Pe){var e={},n={},i=function(i,t){i.forEach(function(i,o){var r,l=Fe?"".concat(t,"-").concat(o):String(o);e[l]=!0;var s=function(e,i){null==e||e.forEach(function(e,t){var o,r="".concat(i,"-").concat(t);n[r]=!0,(null===(o=e.subsections)||void 0===o?void 0:o.length)&&s(e.subsections,r)})};(null===(r=i.subsections)||void 0===r?void 0:r.length)&&s(i.subsections,String(o))})};i(oi,"left"),i(ri,"right"),Ki(e),Yi(n)}else if(Ne>0){var t={},o={},r=function(e,n,i){e.forEach(function(e,r){var l;if(i>=1){var s=Fe?"".concat(n,"-").concat(r):String(r);t[s]=!0}var u=function(e,n,t){t>i||null==e||e.forEach(function(e,i){var r,l="".concat(n,"-").concat(i);o[l]=!0,(null===(r=e.subsections)||void 0===r?void 0:r.length)&&u(e.subsections,l,t+1)})};(null===(l=e.subsections)||void 0===l?void 0:l.length)&&i>=2&&u(e.subsections,String(r),2)})};r(oi,"left",Ne),r(ri,"right",Ne),Ki(t),Yi(o)}},[Pe,Ne,oi,ri,Fe]);var fi=h.useSectionRefs(li.map(function(e){return e.key}),Math.max(oi.length,ri.length)),vi=fi.leftRefs,pi=fi.rightRefs,gi=fi.sectionLeftRefs,hi=fi.sectionRightRefs,mi=fi.lhsBadgeRefs,Si=fi.rhsBadgeRefs,Ri=fi.sectionRightRowRefs,xi=fi.subSectionLeftRefs,_i=fi.subSectionRightRefs,yi=fi.sectionRowRefs,bi=fi.getSectionRowRef,Ci=fi.getSubSectionRef,Ei=fi.getBadgeRef,Ai=T.useSideBySide({maintainRelativeOrder:Fe,proposedSections:oi,existingSections:ri,leftContainerRef:Cn,rightContainerRef:Rn,scrollContainerRef:mn,sectionLeftRefs:gi,sectionRightRefs:hi,subSectionLeftRefs:xi,subSectionRightRefs:_i,lhsBadgeRefs:mi,rhsBadgeRefs:Si,sectionRowRefs:yi,sectionRightRowRefs:Ri,rhsTopSpacerRef:xn,rhsBottomSpacerRef:_n,lhsTopSpacerRef:yn,lhsBottomSpacerRef:bn,calculateLinesRef:cn,setConnectedSections:Ue,setConnectedLines:Xe,cachedConnectedPositions:an,closeMoreFunctionsPopup:zn,setErrorToast:ze,moreFunctions:In,closeSummaryPopup:kn}),Bi=Ai.isSideBySide,Ti=Ai.isArrowVisible,wi=Ai.setIsArrowVisible,Ii=Ai.isResizing,Di=Ai.setIsResizing,Oi=Ai.isSideBySideLoading,Fi=Ai.activeSideBySideSection,ji=Ai.scrollLock,Ni=Ai.sideBySideCacheRef,Pi=Ai.isSideBySideRef,ki=Ai.activeSideBySideRightSectionRef,Li=Ai.activeSideBySideSectionRef,Mi=Ai.sideBySideLineRef,qi=Ai.highlightedClauseRefs,Hi=Ai.clearClauseHighlight,Vi=Ai.resetSideBySide,zi=Ai.activateSideBySide,Gi=m.useAccordionState({maintainRelativeOrder:!!Fe,proposedSections:oi,existingSections:ri,activeSideBySideSection:Fi,connectedSections:Ke,resetSideBySide:Vi,setConnectedSections:Ue,setConnectedLines:Xe,cachedConnectedPositions:an,svgContainerRef:en,isAnimatingRef:ln,animationTimerRef:sn,calculateLinesRef:cn,sectionLeftRefs:gi,sectionRightRefs:hi,subSectionLeftRefs:xi,subSectionRightRefs:_i}),Wi=Gi.expandedSections,Ki=Gi.setExpandedSections,Ui=Gi.expandedSubSections,Yi=Gi.setExpandedSubSections,Ji=Gi.handleSubSectionToggle,Xi=Gi.toggleSection,$i=Gi.forceExpandCrossWiredSections,Qi=function(){var e,n;if(null!=Fi){var i=null===(e=gi.current[Fi])||void 0===e?void 0:e.current,t=null===(n=hi.current[Fi])||void 0===n?void 0:n.current,o=Rn.current;if(i&&t&&o){var r=i.getBoundingClientRect(),l=t.getBoundingClientRect(),s=o.getBoundingClientRect(),u=r.top-s.top,a=l.top-s.top-u;o.scrollBy({top:a,behavior:"smooth"})}}},Zi=i.useCallback(function(e){null==e||e.stopPropagation(),Ze(function(e){var n=!e;return n&&requestAnimationFrame(function(){Qi()}),n})},[Qi]);i.useEffect(function(){De&&"off"!==di&&"0:0"!==di&&(Ni.current=null,an.current=[],requestAnimationFrame(function(){var e;null===(e=cn.current)||void 0===e||e.call(cn)}))},[De,di]);var et=i.useMemo(function(){var e=new Map,n=new Map,i=1;if(Fe)oi.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),ri.forEach(function(t){if(t.id&&!(!t.title&&!t.content)){var o=oi.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(oi.length,ri.length),o=0;o<t;o++){var r=oi[o],l=ri[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[oi,ri,Fe]),nt=ti.analysis,it=s.safeStringify(null===(J=null===(Y=null==nt?void 0:nt.rule_difference_comparison)||void 0===Y?void 0:Y.summary)||void 0===J?void 0:J.overall_summary),tt=!!it.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),ot=null!==(X=null==pe?void 0:pe.base_root_id)&&void 0!==X?X:"-1";null==pe||pe[ot];var rt=Ge?null!==(ue=null!==(re=Ee&&(null===(oe=null==Ee?void 0:Ee[ot])||void 0===oe?void 0:oe.evaluation_result))&&void 0!==re?re:null===(se=null===(le=null==pe?void 0:pe.nodes)||void 0===le?void 0:le[ot])||void 0===se?void 0:se.evaluation_result)&&void 0!==ue?ue:null:null!==(te=null!==(Z=Ee&&(null===(Q=null===($=null==Ee?void 0:Ee[ot])||void 0===$?void 0:$.evaluation_result)||void 0===Q?void 0:Q[0]))&&void 0!==Z?Z:null===(ie=null===(ne=null===(ee=null==pe?void 0:pe.nodes)||void 0===ee?void 0:ee[ot])||void 0===ne?void 0:ne.evaluation_result)||void 0===ie?void 0:ie[0])&&void 0!==te?te:null,lt=s.extractDeviationScore(rt),st=s.generateColorPalette(null!==(de=null===(ce=null===(ae=null==rt?void 0:rt.evaluation_outputs)||void 0===ae?void 0:ae.metadata)||void 0===ce?void 0:ce.label_color)&&void 0!==de?de:a.DEFAULT_DEVIAION_COLOR),ut=i.useRef(Vi);i.useEffect(function(){ut.current=Vi},[Vi]);var at=i.useRef(Vn);i.useEffect(function(){at.current=Vn},[Vn]);var ct=i.useCallback(function(e,n,i,t,o,r){return ho.current(e,n,i,t,o,r)},[]),dt=i.useCallback(function(e,n,i,t,o){return mo.current(e,n,i,t,o)},[]),ft=i.useCallback(function(){return So.current()},[]),vt=i.useCallback(function(e,n){return Ro.current(e,n)},[]),pt=i.useCallback(function(e){return xo.current(e)},[]),gt=i.useCallback(function(e){return _o.current(e)},[]),ht=i.useCallback(function(){return yo.current()},[]),mt=i.useCallback(function(){var e,n;Hi(),null===(e=ut.current)||void 0===e||e.call(ut),Ze(!1),Ue(new Set),Xe([]),an.current=[],Pt([]),Lt(null),Pn(a.EMPTY_SUMMARY_POPUP_STATE),null===(n=at.current)||void 0===n||n.call(at),requestAnimationFrame(function(){var e;null===(e=cn.current)||void 0===e||e.call(cn)})},[]),St=i.useRef(mt);i.useEffect(function(){St.current=mt},[mt]),i.useEffect(function(){Re&&St.current()},[Re]);var Rt=i.useMemo(function(){return{documents:null==pe?void 0:pe.documents,input_index_map:null==pe?void 0:pe.input_index_map}},[JSON.stringify(null==pe?void 0:pe.documents),JSON.stringify(null==pe?void 0:pe.input_index_map)]),xt=i.useRef(pe);i.useEffect(function(){xt.current=pe},[pe]);var _t=i.useRef(gn);i.useEffect(function(){_t.current=gn},[gn]);var yt=i.useCallback(function(n,i,t,o,r,l,u){var a,c,d,f,v=s.safeStringify(null==i?void 0:i.id)||s.safeStringify(null==t?void 0:t.id)||"",p=(v?null===(a=_t.current)||void 0===a?void 0:a[v]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:v,decisioning:[],gap:[],relevance_score:0},g=null!==(d=null===(c=yi.current[o])||void 0===c?void 0:c.current)&&void 0!==d?d:null;return{isLoading:null!==(f=null==_e?void 0:_e.isLoading)&&void 0!==f&&f,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:p,anchorEl:n,sectionAnchorEl:g,badgeStyle:l||null,sectionIdx:o,docData:Rt,deviationData:function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e.__assign(e.__assign({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(s.DEVIATION_BADGE_SEPARATOR)))return u(l);var a=o.split(s.DEVIATION_BADGE_SEPARATOR)[1];if(!a)return l;var c=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},d=(null===(n=null==c?void 0:c.deviation_entries)||void 0===n?void 0:n[a])||(null===(r=null==c?void 0:c.deviations)||void 0===r?void 0:r[a])||null;return d?e.__assign(e.__assign(e.__assign({},c),d),{deviation_summary:(null==d?void 0:d.deviation_summary)||(null==c?void 0:c.deviation_summary),deviation_title:(null==d?void 0:d.deviation_title)||(null==c?void 0:c.deviation_title),deviation_impact:(null==d?void 0:d.deviation_impact)||(null==c?void 0:c.deviation_impact),deviation_explanation:(null==d?void 0:d.deviation_explanation)||(null==c?void 0:c.deviation_explanation),evaluation_outputs:(null==d?void 0:d.evaluation_outputs)||(null==c?void 0:c.evaluation_outputs),cognitive_decisioning:(null==d?void 0:d.cognitive_decisioning)||(null==c?void 0:c.cognitive_decisioning)}):u(l)}(),isOrphan:!!r}},[Rt]),bt=i.useCallback(function(e,n,i,t,o,r){var l;if(e.stopPropagation(),In.open&&In.sectionIdx===o)zn();else{var u=e.currentTarget,a="left";(null===(l=Rn.current)||void 0===l?void 0:l.contains(u))&&(a="right");Hi(),Pi.current&&Vi(),Ue(new Set),Xe([]),an.current=[],Vn(),Nn.open?Jt():kn(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(s.DEVIATION_BADGE_SEPARATOR)){var r=o.split(s.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(s.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Si.current[l])||void 0===e?void 0:e.current:null===(n=mi.current[l])||void 0===n?void 0:n.current}return"right"===a?null===(i=Si.current[o])||void 0===i?void 0:i.current:null===(t=mi.current[o])||void 0===t?void 0:t.current}()||u;Dn(yt(e,n,t,o,i,r))})}},[In.open,In.sectionIdx,zn,kn,yt]),Ct=i.useCallback(function(){var e=In.sectionIdx;In.isOrphan,zn(),kn(),null!==e&&($i(e),Hi(),Pi.current&&Vi(),Xe([]),an.current=[],Ue(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){cn.current&&cn.current()},50))},[In.sectionIdx,In.isOrphan,zn,kn,Vi]),Et=i.useCallback(function(){var e=rn.current;if(e){rn.current=null;var n=oi.findIndex(function(n){return n.id===e}),i=ri.findIndex(function(n){return n.id===e}),t=-1===n?s.findKeyPathByNodeId(oi,e):null,o=-1===i?s.findKeyPathByNodeId(ri,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,s;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(s=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==s?s:null},a=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(qi.current.add(r),s.scrollAndHighlightClause(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(Fe)-1!==r&&Cn.current&&a(function(){return u(n,t,gi,xi)},Cn.current),-1!==l&&Rn.current&&a(function(){return u(i,o,hi,_i)},Rn.current);else{var c=mn.current;if(!c)return;a(function(){return-1!==r?u(n,t,gi,xi):u(i,o,hi,_i)},c)}}},[oi,ri,Fe,gi,hi,xi,_i,Cn,Rn,mn]),At=i.useCallback(function(n){if(n){Hi(),Vi(),Ue(new Set),Xe([]),an.current=[],kn(),Vn();var i=oi.findIndex(function(e){return e.id===n}),t=ri.findIndex(function(e){return e.id===n}),o=-1===i?s.findKeyPathByNodeId(oi,n):null,r=-1===t?s.findKeyPathByNodeId(ri,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;rn.current=n,Ki(function(n){var i,t=e.__assign({},n),o=!1;-1!==l&&(t[i=Fe?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=Fe?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),Yi(function(n){var i=e.__assign({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){rn.current===n&&Bt.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[oi,ri,Fe,Ki,Yi,Vi,kn,Vn]),Bt=i.useRef(Et);i.useEffect(function(){Bt.current=Et},[Et]);var Tt=i.useRef(null);i.useEffect(function(){if(Kn){var e=Gn.fields.find(function(e){return e.analysisKey===Kn||e.key===Kn});if(e){var n=vi.current[e.key]||pi.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Kn,Gn.fields]);var wt=i.useCallback(function(e){var n,i,t,o,r,l,s,u,a,c=null===(n=null==nt?void 0:nt.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!c||!c[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=c[e],f=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var v=d.mappings[0]||{};return{score:d.score,relation:v.relation||"",highlightsA:(null===(l=v.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(s=v.highlights)||void 0===s?void 0:s.ruleB_spans)||[],hasContent:!!f}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(u=d.highlights)||void 0===u?void 0:u.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!f}},[nt]),It=E.useStyleHelpers({proposedSections:oi,existingSections:ri,maintainRelativeOrder:Fe,cognitiveMap:gn,deviationData:pn,treeData:pe,resolvedComparisonConfig:Gn}),Dt=It.getSectionCompareStyle,Ot=It.getSubSectionCompareStyle,Ft=It.getDeviationStyleByKey,jt=B.useLinesCalculator({containerRef:nn,leftContainerRef:Cn,rightContainerRef:Rn,svgContainerRef:en,pathRefs:un,leftHeaderRef:tn,rightHeaderRef:on,proposedSections:oi,existingSections:ri,visibleFields:li,leftRefs:vi,rightRefs:pi,sectionLeftRefs:gi,sectionRightRefs:hi,subSectionLeftRefs:xi,subSectionRightRefs:_i,lhsBadgeRefs:mi,rhsBadgeRefs:Si,sectionRowRefs:yi,expandedSections:Wi,expandedSubSections:Ui,connectedSections:Ke,isSideBySide:Bi,activeSideBySideSection:Fi,maintainRelativeOrder:Fe,cognitiveMap:gn,getSectionCompareStyle:Dt,getSubSectionCompareStyle:Ot,getDeviationStyleByKey:Ft,isArrowVisible:Ti,isAnimatingRef:ln,isSideBySideRef:Pi,sideBySideCacheRef:Ni,sideBySideLineRef:Mi,activeSideBySideSectionRef:Li,activeSideBySideRightSectionRef:ki,connectedLines:Je,setConnectedLines:Xe,cachedConnectedPositions:an,calculateLinesRef:cn,resizeTimerRef:dn,scrollLock:ji,scrollSyncLocked:Qe,handleResizeRef:fn,activeProposed:ii,existingRule:ti,analysisData:nt,pendingScrollTargetRef:En,pendingScrollCallbackRef:An,resolvedComparisonConfig:Gn,getFieldData:wt}),Nt=jt.lines,Pt=jt.setLines,kt=jt.overallConnector,Lt=jt.setOverallConnector,Mt=jt.svgDimensions,qt=jt.handleColumnScroll;i.useEffect(function(){Nn.anchorEl&&requestAnimationFrame(function(){requestAnimationFrame(function(){var e;null===(e=cn.current)||void 0===e||e.call(cn)})})},[Nn.anchorEl,Qe]);var Ht=i.useCallback(function(){Hi(),Ze(!1),Ki({}),Yi({}),Vi(),Ue(new Set),Xe([]),an.current=[],kn(),Vn(),zn(),requestAnimationFrame(function(){cn.current&&cn.current()})},[Ki,Yi,Vi,kn,Vn,zn]);i.useEffect(function(){Bi||0!==Ke.size||Ze(!1)},[Bi,Ke]);var Vt=i.useMemo(function(){return Object.values(Wi).some(Boolean)||Object.values(Ui).some(Boolean)},[Wi,Ui]),zt=i.useRef(null),Gt=i.useRef(0),Wt=i.useRef(0),Kt=i.useRef(0),Ut=A.useResizeHandler({timerRef:zt,ruleComponentRef:Sn,scrollContainerRef:mn,containerRef:nn,maintainRelativeOrder:Fe,proposedSections:oi,existingSections:ri,isSideBySideRef:Pi,activeSideBySideSectionRef:Li,activeSideBySideRightSectionRef:ki,sectionRowRefs:yi,sectionRightRowRefs:Ri,sectionLeftRefs:gi,sectionRightRefs:hi,subSectionLeftRefs:xi,subSectionRightRefs:_i,lhsBadgeRefs:mi,rhsBadgeRefs:Si,leftContainerRef:Cn,rightContainerRef:Rn,calculateLinesRef:cn,handleResizeRef:fn,setIsResizing:Di,setIsArrowVisible:wi,sideBySideCacheRef:Ni,cachedConnectedPositions:an}).handleResize;i.useEffect(function(){fn.current=Ut},[Ut,fn]),i.useEffect(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,s;i.current=null;var u=e[e.length-1];if(u){var a=null!==(s=null===(l=null===(r=u.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==s?s:u.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return Sn.current&&o.push(e(Sn.current,Gt,n,function(){return fn.current()},function(){})),mn.current&&o.push(e(mn.current,Wt,i,function(){return fn.current()},function(){return cn.current()})),nn.current&&o.push(e(nn.current,Kt,t,function(){return fn.current()},function(){return cn.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),i.useEffect(function(){Pi.current=Bi},[Bi]),i.useEffect(function(){Li.current=Fi},[Fi]);var Yt=i.useCallback(function(){var e,n=In.sectionIdx,i=In.isOrphan;if(kn(),null!=n){var t="left";In.anchorEl&&(null===(e=Rn.current)||void 0===e?void 0:e.contains(In.anchorEl))&&(t="right"),$i(n),zi(n,i,{sourceSide:t})}},[zi,In.isOrphan,In.sectionIdx,In.anchorEl,kn]),Jt=i.useCallback(function(){kn(),Vi(),Ue(new Set),Xe([]),an.current=[]},[kn,Vi]),Xt=null!==In.sectionIdx&&Ke.has(In.sectionIdx),$t=S.useDeviationNavigation({proposedSections:oi,existingSections:ri,parentDeviationRecord:si,expandedSections:Wi,maintainRelativeOrder:!!Fe,scrollContainerRef:mn,leftContainerRef:Cn,rightContainerRef:Rn,lhsBadgeRefs:mi,rhsBadgeRefs:Si}),Qt=$t.showDeviationNavigation,Zt=$t.showOpenNodeRef,eo=$t.adjustScrollForPopup,no=i.useCallback(function(e,n,i,t,o){var r,l="string"==typeof t?s.safeStringify(t).trim():s.safeStringify(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;Vn();var a="left";(null===(r=Rn.current)||void 0===r?void 0:r.contains(u))&&(a="right");var c=function(){var e,i,t,o;if("string"==typeof n&&n.includes(s.DEVIATION_BADGE_SEPARATOR)){var r=n.split(s.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(s.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Si.current[l])||void 0===e?void 0:e.current:null===(i=mi.current[l])||void 0===i?void 0:i.current}return"right"===a?null===(t=Si.current[n])||void 0===t?void 0:t.current:null===(o=mi.current[n])||void 0===o?void 0:o.current};if(i)return Vi(),Ue(new Set),Xe([]),an.current=[],void(l&&($i(n),requestAnimationFrame(function(){var e=c()||u;e&&(e.getBoundingClientRect().top>.8*window.innerHeight&&e.scrollIntoView({behavior:"smooth",block:"center"}));Pn({open:!0,anchorEl:e,summary:t,displayImpact:o})})));$i(n),l?setTimeout(function(){zi(n,i,{toggleIfSame:!1,sourceSide:a,onReady:function(){var e,n,i,r=c()||u;if(r){var l=r.getBoundingClientRect();if(l.top>.8*window.innerHeight||l.top<100){var s=l.top-window.innerHeight/2;Fe?(null===(e=Cn.current)||void 0===e||e.scrollBy({top:s,behavior:"smooth"}),null===(n=Rn.current)||void 0===n||n.scrollBy({top:s,behavior:"smooth"})):null===(i=mn.current)||void 0===i||i.scrollBy({top:s,behavior:"smooth"})}}Pn({open:!0,anchorEl:r,summary:t,displayImpact:o})}})},350):setTimeout(function(){zi(n,i,{toggleIfSame:!1,sourceSide:a})},350)},[zi,Vn,Pn,Vi,$i]),io=i.useMemo(function(){var e;if(!Ae)return null;var n=null===(e=null==Ae?void 0:Ae.id)||void 0===e?void 0:e.split(":")[0];for(var i in si){if((si[i]||[]).some(function(e){return e.id===n}))return i}return null},[Ae,si]),to=i.useRef({id:null,triggerMs:null}),oo=i.useRef(null),ro=i.useRef(Wi);i.useEffect(function(){ro.current=Wi},[Wi]),i.useEffect(function(){var n;if(null==Ae?void 0:Ae.id){var i=Number(Ae.trigger),t=to.current;if((null==t?void 0:t.triggerMs)!==i||!(null==t?void 0:t.processed)){if(!(Ae.id.includes(":")&&/:\d+$/.test(Ae.id)))return to.current={id:Ae.id,triggerMs:i,processed:!0},void At(Ae.id);(null==t?void 0:t.triggerMs)!==i&&(to.current={id:Ae.id,triggerMs:i,processed:!1,expansionDone:!1,attempts:0});var o=to.current,r=null===(n=null==Ae?void 0:Ae.id)||void 0===n?void 0:n.split(":"),l=r[0],u=r[1],a=null!=u?u:"0";oo.current!==Ae.id&&(kn(),Vn(),Vi(),Ue(new Set),Xe([]),an.current=[],oo.current=Ae.id);var c=!1,d=null,f=200,v=function(e,n){for(var i=function(e,t){if(!e)return null;if(e.id===n)return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},p=function(){var n,i,t,r;if(!c){var u=function(){o.processed=!0},g=null,h=null;for(var m in si){var S=si[m].find(function(e){return e.id===l});if(S){g=m,h=S;break}}if(!h||!g)return o.attempts+=1,void(o.attempts<1?d=setTimeout(p,f):u());var R=oi.findIndex(function(e){return e.id===g}),x=ri.findIndex(function(e){return e.id===g}),_=-1===R&&-1!==x,y=v(oi,h.id),b=v(ri,h.id);if(y&&!b&&!_){var C=y.split("-"),E=Number(C[0]);if(Fe){var A=null===(i=null===(n=oi[E])||void 0===n?void 0:n.refIndexes)||void 0===i?void 0:i[0],B=ri.findIndex(function(e){return e.selfIndex===A});-1!==B&&(E=B)}b=e.__spreadArray([E],C.slice(1),!0).join("-")}if(!y&&!b)return o.attempts+=1,void(o.attempts<1?d=setTimeout(p,f):u());var T=y?Number(y.split("-")[0]):R,w=b?Number(b.split("-")[0]):x,I=w>=0?w:b?Number(b.split("-")[0]):-1,D=oi[T],O=ri[I],F=D&&!D.title&&!D.content,j=O&&!O.title&&!O.content,N=_||(!y&&!!b||F&&!j);if(!o.expansionDone){var P=!1;if(T>=0&&!_)(Fe?!!ro.current["left-".concat(T)]:!!ro.current[String(T)])||(Xi(T,"left"),P=!0);if(w>=0)(Fe?!!ro.current["right-".concat(I)]:!!ro.current[String(I)])||(Xi(I,"right"),P=!0);if((y&&y.includes("-")||b&&b.includes("-"))&&(Yi(function(n){var i=e.__assign({},n),t=!1,o=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return y&&o(y),b&&o(b),t?i:n}),P||(P=!0)),o.expansionDone=!0,P)return void(d=setTimeout(p,800))}var k,L=y||"",M=b||"",q="".concat(h.id).concat(s.DEVIATION_BADGE_SEPARATOR).concat(a).concat(s.DEVIATION_BADGE_SEPARATOR).concat(L).concat(s.DEVIATION_BADGE_SEPARATOR).concat(M),H="".concat(h.id).concat(s.DEVIATION_BADGE_SEPARATOR).concat(a),V=null===(t=mi.current[H])||void 0===t?void 0:t.current,z=null===(r=Si.current[H])||void 0===r?void 0:r.current,G=N||!V&&!!z,W=G?z:V;if(k=Fe?G?Rn.current:Cn.current:mn.current,W&&k){var K=W.getBoundingClientRect();if(0===K.height)return o.attempts+=1,void(o.attempts<1?d=setTimeout(p,f):u());var U=k.getBoundingClientRect(),Y=K.top-U.top+k.scrollTop-U.height/2+K.height/2,J=y&&y.includes("-")||b&&b.includes("-"),X=function(){var n,i,t,o,r,l;if(!c){u();var d=W instanceof Element?window.getComputedStyle(W).color:"";V&&(V.style.transition="box-shadow 300ms ease-in-out",V.style.boxShadow="0 0 10px ".concat(d)),z&&(z.style.transition="box-shadow 300ms ease-in-out",z.style.boxShadow="0 0 10px ".concat(d)),setTimeout(function(){V&&(V.style.boxShadow=""),z&&(z.style.boxShadow="")},2e3);var f=(null===(i=null===(n=h.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===i?void 0:i[a])||h,v=(null===(t=h.evaluationResult)||void 0===t?void 0:t.evaluation_outputs)||h.evaluation_outputs,p=!!V&&!!z,g=!!("string"==typeof(null==f?void 0:f.deviation_summary)?f.deviation_summary.trim():s.safeStringify(null!==(o=null==f?void 0:f.deviation_summary)&&void 0!==o?o:"").trim()),m=G?(null===(r=Si.current[J?H:I])||void 0===r?void 0:r.current)||z:(null===(l=mi.current[J?H:T])||void 0===l?void 0:l.current)||V;if(!p||!g)return eo(m,function(){Pn({open:!0,anchorEl:m,displayImpact:Ae.displayImpact,summary:e.__assign(e.__assign({},f),{evaluation_outputs:v})})},{skipScroll:!0}),void(null==Be||Be());zi(q,!1,{toggleIfSame:!1,sourceSide:_?"right":"left",onReady:function(){var n,i;u();var t=G?(null===(n=Si.current[H])||void 0===n?void 0:n.current)||z:(null===(i=mi.current[H])||void 0===i?void 0:i.current)||V;Pn({open:!0,anchorEl:t,displayImpact:Ae.displayImpact,summary:e.__assign({},f)}),null==Be||Be()}})}},$=function(){if(!Fe)return null;var e=G?V:z,n=G?Cn.current:Rn.current;if(!e||!n)return null;var i=e.getBoundingClientRect();if(0===i.height)return null;var t=n.getBoundingClientRect();return{container:n,top:i.top-t.top+n.scrollTop-t.height/2+i.height/2}}(),Q=Math.abs(k.scrollTop-Y)<=2,Z=!$||Math.abs($.container.scrollTop-$.top)<=2;Q&&Z?X():(Q||(En.current=Y,An.current=X,k.scrollTo({top:Y,behavior:"smooth"})),$&&!Z&&$.container.scrollTo({top:$.top,behavior:"smooth"}),d&&clearTimeout(d),d=setTimeout(function(){if(An.current){En.current=null;var e=An.current;An.current=null,e()}else Q&&X()},1500))}else o.attempts+=1,o.attempts<1?d=setTimeout(p,f):u()}};return d=setTimeout(p,f),function(){c=!0,d&&clearTimeout(d)}}}},[Ae,si,oi,ri,Fe,Xi,zi,Pn,At]),i.useEffect(function(){var n,i,t;if(Nn.open){var o=Nn.anchorEl;if(o&&!o.isConnected){var r=function(e){for(var n,i=0,t=Object.entries(e);i<t.length;i++){var r=t[i],l=r[0];if((null===(n=r[1].current)||void 0===n?void 0:n.textContent)===o.textContent)return l}return null},l=(null===(n=o.dataset)||void 0===n?void 0:n.deviationRefId)||r(mi.current)||r(Si.current);if(l){var s=(null===(i=Si.current[l])||void 0===i?void 0:i.current)||(null===(t=mi.current[l])||void 0===t?void 0:t.current);s&&s.isConnected&&Pn(function(n){return e.__assign(e.__assign({},n),{anchorEl:s})})}}}},[Nn.open,Nn.anchorEl,Qe,Ke,Wi]);var lo=Tn.open,so=Tn.sectionIdx,uo=Tn.isOrphan,ao=Tn.badgeStyle,co=Tn.anchorEl,fo=Tn.sectionAnchorEl;i.useEffect(function(){var n;if(lo&&null!=so&&so!==ot){var i="string"==typeof so?so.split(s.DEVIATION_BADGE_SEPARATOR)[0]:null,t=function(e,n){var i;if(!e||!Array.isArray(e))return null;for(var o=0,r=e;o<r.length;o++){var l=r[o];if(l.id===n)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var s=t(l.subsections,n);if(s)return s}}return null},o=i&&"string"==typeof i?t(oi,i):null,r=i&&"string"==typeof i?t(ri,i):null,l="number"==typeof so?oi[so]||null:o||i&&((null===(n=null==pe?void 0:pe.nodes)||void 0===n?void 0:n[i])||(null==pe?void 0:pe[i]))||null,u="number"==typeof so?ri[so]||null:r,a=yt(co,l,u,so,uo,ao);wn(function(n){return n.open?s.safeStringify(n.cognitiveData)===s.safeStringify(a.cognitiveData)&&s.safeStringify(n.deviationData)===s.safeStringify(a.deviationData)&&n.sectionTitle===a.sectionTitle&&n.refSectionTitle===a.refSectionTitle?n:e.__assign(e.__assign(e.__assign({},n),a),{open:!0,anchorEl:n.anchorEl,sectionAnchorEl:n.sectionAnchorEl}):n})}},[lo,so,uo,ao,co,fo,oi,ri,yt]);var vo=i.useCallback(function(e){var i=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,s=void 0===l?"left":l,u=e.parentNodeId,a=void 0===u?"":u,c=e.sectionOffset;return n.jsx(x.default,{section:i,keyPath:t,depth:r,columnKey:s,parentNodeId:a,sectionOffset:c})},[]),po=i.useMemo(function(){return oi.map(function(e,i){var t,o=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return o&&r&&Fe?null:n.jsx(_.default,{section:e,idx:i},null!==(t=null==e?void 0:e.id)&&void 0!==t?t:"left-row-".concat(i))})},[oi]),go=i.useMemo(function(){return ri.map(function(e,i){var t,o=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return o&&r&&Fe?null:n.jsx(y.default,{section:e,idx:i},null!==(t=null==e?void 0:e.id)&&void 0!==t?t:"right-row-".concat(i))})},[ri]),ho=i.useRef(bt);i.useEffect(function(){ho.current=bt},[bt]);var mo=i.useRef(no);i.useEffect(function(){mo.current=no},[no]);var So=i.useRef(Jt);i.useEffect(function(){So.current=Jt},[Jt]);var Ro=i.useRef(Xi);i.useEffect(function(){Ro.current=Xi},[Xi]);var xo=i.useRef(Ji);i.useEffect(function(){xo.current=Ji},[Ji]);var _o=i.useRef(vo);i.useEffect(function(){_o.current=vo},[vo]);var yo=i.useRef(Vi);i.useEffect(function(){yo.current=Vi},[Vi]);var bo=i.useMemo(function(){return{maintainRelativeOrder:!!Fe,showDeviationBadges:ke,isProposingFix:we,proposingFixNodeId:Ie,isRedlineFlow:De,isSideBySide:Bi,activeSideBySideSection:Fi,scrollSyncLocked:Qe,toggleScrollSyncLocked:Zi,summaryPopupAnchorEl:Nn.anchorEl,connectedSections:Ke,proposedSections:oi,existingSections:ri,deviationNumberRegistry:ui,treeData:pe,displayConfig:_e,resolvedMarkdownStyles:hn,unifiedNumbering:et,expandedSections:Wi,expandedSubSections:Ui,setExpandedSubSections:Yi,getSectionCompareStyle:Dt,getSubSectionCompareStyle:Ot,getBadgeRef:Ei,getSectionRowRef:bi,getSubSectionRef:Ci,sectionLeftRefs:gi,sectionRightRefs:hi,sectionRowRefs:yi,sectionRightRowRefs:Ri,subSectionLeftRefs:xi,subSectionRightRefs:_i,lhsBadgeRefs:mi,rhsBadgeRefs:Si,openMoreFunctionsPopup:ct,handleOpenSummaryPopup:dt,openSummaryPopup:dt,handleCloseSummaryPopup:ft,toggleSection:vt,handleSubSectionToggle:pt,renderSubSectionAccordion:gt,resetSideBySide:ht,setConnectedSections:Ue,setConnectedLines:Xe,cachedConnectedPositions:an,showDeviationNavigation:Qt,showOpenNodeRef:Zt,deviationNodeIdToView:null==Ae?void 0:Ae.id,deviationTargetParentId:io}},[Fe,ke,we,Ie,De,Bi,Fi,Qe,Zi,Nn.anchorEl,Ke,oi,ri,ui,_e,hn,et,Wi,Ui,Yi,Dt,Ot,Ei,bi,Ci,Qt,Zt,Ae,io]);return n.jsx(C.CompareContextProvider,e.__assign({value:bo},{children:n.jsxs(t.Box,e.__assign({ref:Sn,sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"visible",position:"relative"}},{children:[Me&&n.jsx(t.Box,e.__assign({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:n.jsx(f.default,{})})),Nn.open&&n.jsx(b.default,{open:Nn.open,anchorEl:Nn.anchorEl,containerEl:Tt.current,clipTopEl:tn.current,scrollContainerEl:mn.current,onClose:Jt,summary:Nn.summary,displayImpact:Nn.displayImpact,isScrollLocked:Qe}),n.jsx(d.default,{open:In.open,anchorEl:In.anchorEl,maintainRelativeOrder:!!Fe,sectionTitle:In.sectionTitle,referenceSectionTitle:In.refSectionTitle,onClose:zn,onOpenCognitiveCompare:qn,onOpenSideBySide:Yt,onConnect:Ct,isConnected:Xt,isOrphan:In.isOrphan}),Tn.open&&n.jsx(c.default,{open:Tn.open,popupRef:Mn,position:On,popupConfig:be,onClose:function(){Fn(null),wn(function(n){return e.__assign(e.__assign({},n),{open:!1})}),Ln(null)},markdownStyles:Se,sectionTitle:$n,referenceSectionTitle:Zn,cognitiveData:Tn.cognitiveData,anchorEl:Tn.anchorEl,sectionAnchorEl:Tn.sectionAnchorEl,scrollContainerEl:mn.current,badgeStyle:Tn.badgeStyle,docData:Tn.docData,deviationData:Tn.deviationData,isLoading:Tn.isLoading}),n.jsx(t.Snackbar,e.__assign({open:!!Ve,autoHideDuration:8e3,onClose:function(){return ze(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(t.Alert,e.__assign({onClose:function(){return ze(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ve}))})),n.jsx(R.default,{componentHeaderText:ve,displayConfig:_e,maintainRelativeOrder:Fe,onCollapseAll:Ht,showCollapseAll:Vt,onToggleView:function(e){qe(!0),setTimeout(function(){je(!e),null==ye||ye(!e),Ze(!1),Vi(),kn(),Ue(new Set),Xe([]),an.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){qe(!1)},600)})})},50)}}),n.jsx(t.Box,e.__assign({ref:mn,onScroll:qt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:Fe?"visible":"auto",borderTop:it&&tt?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(t.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},Fe?{flex:1}:{})},{children:n.jsxs(t.Box,e.__assign({ref:nn,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},Fe?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(w.default,{svgContainerRef:en,svgDimensions:Mt,isResizing:Ii,overallConnector:kt,rootDeviationStyle:st,lines:Nt,isSideBySide:Bi,activeSideBySideSection:Fi,isArrowVisible:Ti,maintainRelativeOrder:Fe,proposedSections:oi,existingSections:ri,cognitivePopup:Tn,activeBadgeId:jn,closeCognitivePopup:Vn,setActiveBadgeId:Ln,openCognitivePopupFromState:Hn,buildSectionPopupState:yt,connectedLines:Je,pathRefs:un}),n.jsxs(t.Box,e.__assign({sx:e.__assign({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},Fe?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(t.Box,e.__assign({ref:tn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:n.jsx(t.Tooltip,e.__assign({title:Jn,placement:"top"},{children:n.jsx(t.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Jn}))}))})),n.jsxs(t.Box,e.__assign({ref:Cn,onScroll:qt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},Fe?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-180px",pr:"192px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:yn,style:{width:"100%",height:"0px",flexShrink:0}}),ci&&po,n.jsx("div",{ref:bn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(t.Box,e.__assign({ref:Tt,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:n.jsx(t.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(t.Box,e.__assign({onClick:function(n){n.stopPropagation(),Tn.open&&jn===ot?Vn():(Ln(ot),Hn(yt(n.currentTarget,{title:"",content:"",evaluationResult:rt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,ot,!0,e.__assign(e.__assign({},st),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:st.badgeBg,color:st.badgeText,border:"1px solid ".concat(st.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=lt?lt:n.jsx(v.default,{}),n.jsx(t.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(r.ButtonCognitiveIcon,{})})),n.jsx(o.ChevronDown,{size:11,style:{transform:Tn.open&&jn===ot?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),n.jsxs(t.Box,e.__assign({sx:e.__assign({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},Fe?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Oi&&n.jsx(l.default,{sections:11}),n.jsx(t.Box,e.__assign({ref:on,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(t.Tooltip,e.__assign({title:ei,placement:"top"},{children:n.jsx(t.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:ei}))}))})),n.jsxs(t.Box,e.__assign({ref:Rn,onScroll:qt,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},Fe?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:xn,style:{width:"100%",height:"0px",flexShrink:0}}),ci&&go,n.jsx("div",{ref:_n,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),i=require("react"),s=require("../Popups/PopupDefaults.js"),n=require("react-markdown"),c=require("rehype-raw"),t=require("./CitationComponent.module.css.js"),l=require("lucide-react"),d=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),o=require("./CitationAnchor.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=_(i),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),i=require("react"),s=require("../Popups/PopupDefaults.js"),n=require("react-markdown"),c=require("rehype-raw"),t=require("./CitationComponent.module.css.js"),l=require("lucide-react"),d=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),o=require("./CitationAnchor.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=_(i),f=_(n),x=_(c),m=function(i){var s=i.text,n=i.item;return a.jsx(f.default,e.__assign({rehypePlugins:[x.default],components:{ol:function(i){var s=i.children;return a.jsx("ol",e.__assign({className:t.default["md-ol"]},{children:s}))},ul:function(i){var s=i.children;return a.jsx("ul",e.__assign({className:t.default["md-ul"]},{children:s}))},li:function(i){var s=i.children;return a.jsx("li",e.__assign({className:t.default["md-li"]},{children:s}))},a:function(e){e.node;var i=e.href,s=e.children;return a.jsx(o.default,{href:i,children:s,metaData:{citations:n.citations,docData:n.docData}})}}},{children:s.replace(/<br\s*\/?>/gi,"\n")}))};exports.default=function(n){var c=n.item,o=n.title,_=void 0===o?"Cognitive Decisioning AI":o,f=n.relevanceScore,x=void 0===f?0:f,g=n.showRelevanceScore,v=void 0===g||g,h=n.reason,j=void 0===h?"No reasoning provided.":h,p=n.impact,N=void 0===p?"No Impact provided.":p,b=n.explaination,y=void 0===b?"No explaination provided.":b,C=n.gap,k=void 0===C?"None":C,B=n.onClose,H=void 0===B?function(){}:B,q=n.onAccept,D=n.onReject,A=n.showResolveBtns,T=void 0!==A&&A,I=n.sections,L=n.leftIcon,M=n.scoreIcon,w=n.className,P=n.customStyles,R=void 0===P?{}:P,S=n.actions,E=n.disableAllActions,F=void 0!==E&&E,G=n.actionBtnDisabledStyle,U=void 0===G?{}:G,O=n.onBackClick,z=n.isImpactNeeded,J=void 0===z||z,K=n.cognitiveTitle,Q=void 0===K?"Cognitive Integrity":K,V=n.labels,W=void 0===V?{}:V,X=i.useMemo(function(){var e=Number(x);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[x]),Y=i.useMemo(function(){var e=W&&W.noGapsText||"1. No gaps identified.";return function(e){if(!e)return!0;var a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a}(k)?e:k},[k]),Z=W&&W.impact||"Impact",$=W&&W.explanation||"Explaination",ee=W&&W.decisionFactors||"Decision Making Factors",ae=W&&W.gaps||"Gaps in Decision",ie=W&&W.accept||"Accept",se=W&&W.reject||"Reject",ne=W&&W.backAriaLabel||"Go back",ce=S||[{id:"reject",label:se,onClick:D,className:t.default["btn-reject"]},{id:"accept",label:ie,onClick:q,className:t.default["btn-accept"]}];return a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc"]," ").concat(w||""),style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.container),null==R?void 0:R.container)},{children:[O&&a.jsxs("div",e.__assign({className:t.default["cite-acc__backHeader"]},{children:[a.jsx("button",e.__assign({type:"button",className:t.default["cite-acc__backBtn"],onClick:function(e){e.stopPropagation(),O&&O()},"aria-label":ne},{children:"‹"})),a.jsx("span",e.__assign({className:t.default["cite-acc__backTitle"]},{children:Q}))]})),I&&I.length>0?I.map(function(i){return!1===i.show?null:a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc__explain-body"]," ").concat(i.bodyClassName||"")},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__innerHeader"],style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.innerHeader),null==R?void 0:R.innerHeader)},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:i.title}))})})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),H&&H()}},{children:a.jsx(l.ChevronUp,{})}))]})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600"),style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.innerBody),null==R?void 0:R.innerBody)},{children:"string"==typeof i.content?a.jsx(m,{text:i.content,item:i.item||c||{}}):i.content}))]}),i.id||i.title)}):a.jsxs(a.Fragment,{children:[J&&a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:Z}))})})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),H&&H()}},{children:a.jsx(l.ChevronUp,{})}))]})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:N||"",item:c||{}})}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:$}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:y||"",item:{}})}))]})),T&&a.jsx("div",e.__assign({className:t.default["cite-acc__btn-container"]},{children:ce.map(function(i){var s=F||i.disabled;return a.jsx("button",e.__assign({className:i.className,onClick:s?void 0:i.onClick,disabled:s,style:e.__assign(e.__assign({},i.style),s?e.__assign(e.__assign({opacity:.5,cursor:"not-allowed"},U),i.disabledStyle):{})},{children:i.label}),i.id)})})),a.jsxs("div",e.__assign({className:t.default["cite-acc__header"]},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__headerLeft"]},{children:[a.jsx("span",e.__assign({className:t.default["cite-acc__titleIcon"]},{children:L?"function"==typeof L?u.default.createElement(L):L:a.jsx(d.ReactComponent,{})})),a.jsx("div",e.__assign({className:t.default["cite-acc__title"]},{children:_}))]})),a.jsx("div",e.__assign({className:t.default["cite-acc__headerRight"]},{children:v&&a.jsxs("span",e.__assign({className:t.default["cite-acc__scoreBadge"]},{children:[M?"function"==typeof M?u.default.createElement(M):M:a.jsx(r.ReactComponent,{}),a.jsxs("span",e.__assign({className:t.default["cite-acc__scoreText"]},{children:[X,"%"]}))]}))}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:ee}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:j||"",item:c||{}})}))]})),a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc__explain-body"]," ").concat(t.default["cite-acc__explain-body_border"])},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:ae}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:Y||"",item:c||{}})}))]}))]})]}))};
|
|
2
2
|
//# sourceMappingURL=CognitiveComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("lucide-react"),s=require("react"),o=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var t=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),a=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],r=function(n){var s=n.toneIndex,o=n.configs,t=void 0===o?a:o,l=t[Math.min(s,t.length-1)]||t[1]||t[0],r=l.color,d=l.angle,c=l.arcD,g=(d-90)*Math.PI/180,_=11+9*Math.cos(g),v=13+9*Math.sin(g);return i.jsxs("svg",e.__assign({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("path",{d:c,stroke:r,strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("line",{x1:"11",y1:"13",x2:_,y2:v,stroke:r,strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(n){var s=n.type,o=n.customStyles,t=void 0===o?{}:o,l=e.__assign(e.__assign({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),t),a=l[s]||l.Medium;return i.jsx("div",e.__assign({style:a},{children:s}))},c=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},_={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},v={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},u={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},p={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},x={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},m={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},y={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},h={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},f={display:"flex",gap:8,marginBottom:18},j={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},S={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},b={borderTop:"0.5px solid #eee",paddingTop:14},C={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},I={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},B={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},k={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},D={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},T={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},A={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},w={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};exports.default=function(z){var R,W,E,L,M,F,H,N,q,P,O,G,X,J,K,Q,U,V,Y,Z=z.onClose,$=z.aiReason,ee=z.onAccept,ie=z.onReject,ne=z.onIterate,se=z.initialTone,oe=z.onRegenerate,te=z.labels,le=void 0===te?{}:te,ae=z.toneLevelsConfig,re=void 0===ae?c:ae,de=z.toneColorsConfig,ce=void 0===de?g:de,ge=z.dialConfigs,_e=void 0===ge?a:ge,ve=z.customStyles,ue=void 0===ve?{}:ve,pe=z.severityChipStyles,xe=void 0===pe?{}:pe,me=z.customIcons,ye=void 0===me?{}:me,he=z.onOpenCognitive,fe=z.showTone,je=void 0===fe||fe,Se=z.cognitiveSectionStyle,be=void 0===Se?{}:Se,Ce=z.cognitiveScoreBadgeStyle,Ie=void 0===Ce?{}:Ce,Be=z.cognitiveScoreTextStyle,ke=void 0===Be?{}:Be,De=z.cognitiveStyles,Te=void 0===De?{}:De,Ae=z.cognitiveClassNames,we=void 0===Ae?{}:Ae,ze=z.cognitiveTitle,Re=void 0===ze?"Cognitive Integrity":ze,We=z.cognitiveLeftIcon,Ee=z.showCognitiveRightArrow,Le=void 0===Ee||Ee,Me=re.findIndex(function(e){return e===se});-1===Me&&(Me=1);var Fe=s.useState(!0),He=Fe[0],Ne=Fe[1],qe=s.useState(!1),Pe=qe[0],Oe=qe[1],Ge=s.useState(Me),Xe=Ge[0],Je=Ge[1],Ke=s.useState(Me)[0],Qe=re[Xe],Ue=ce[Qe]||"#BA7517",Ve=Xe!==Ke;return i.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign({},_),null===(R=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===R?void 0:R.root)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},v),null===(W=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===W?void 0:W.header)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[i.jsx("span",{children:ye.summaryIcon||i.jsx(n.Info,{size:16,color:"#E24B4A"})}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},u),null===(E=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===E?void 0:E.title)},{children:le.summaryHeader||"Summary"}))]})),i.jsx("button",e.__assign({onClick:Z,style:e.__assign(e.__assign({},S),null===(L=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===L?void 0:L.closeBtn)},{children:"✕"}))]})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},p),null===(M=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===M?void 0:M.bodyText)},{children:null===(F=null==$?void 0:$.deviation_details)||void 0===F?void 0:F.deviation_title})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},x),null===(H=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===H?void 0:H.summary)},{children:null===(N=null==$?void 0:$.deviation_details)||void 0===N?void 0:N.deviation_summary})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},m),null===(q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===q?void 0:q.impactContainer)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return Ne(!He)},style:e.__assign(e.__assign({},y),null===(P=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===P?void 0:P.impactToggle)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},h),null===(O=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===O?void 0:O.impactToggleLabel)},{children:le.impactHeader||"Impact"})),i.jsx("span",e.__assign({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:He?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#E24B4A"})}))]})),i.jsx(d,{type:(null==$?void 0:$.severity)||"Medium",customStyles:xe})]})),He&&i.jsx("p",e.__assign({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(X=null===(G=null==$?void 0:$.deviation_details)||void 0===G?void 0:G.deviation_impact)&&void 0!==X?X:le.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},f),null===(J=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===J?void 0:J.actionContainer)},{children:[i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},j),null===(K=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===K?void 0:K.actionBtn),{color:"#64748B"}),onClick:ne},{children:[ye.iterateIcon||i.jsx(n.PenLine,{size:16,color:"#64748B"}),le.btnIterate||"Iterate"]}),"Iterate"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},j),null===(Q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Q?void 0:Q.actionBtn),{color:"#10B981"}),onClick:ee},{children:[ye.acceptIcon||i.jsx(n.CheckCircle,{size:16,color:"#10B981"}),le.btnAccept||"Approve"]}),"Accept"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},j),null===(U=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===U?void 0:U.actionBtn),{color:"#DC2626"}),onClick:ie},{children:[ye.rejectIcon||i.jsx(n.XCircle,{size:16,color:"#DC2626"}),le.btnReject||"Reject"]}),"reject")]})),je&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},b),null===(V=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===V?void 0:V.toneContainer)},{children:[i.jsxs("button",e.__assign({onClick:function(){return Oe(!Pe)},style:e.__assign(e.__assign({},C),null===(Y=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Y?void 0:Y.toneToggleBtn)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[i.jsx(r,{toneIndex:Xe,configs:_e}),i.jsx("span",e.__assign({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:le.toneHeader||"Redline Tone"}))]})),i.jsx("span",e.__assign({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Pe?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#111"})}))]})),Pe&&i.jsxs(i.Fragment,{children:[i.jsx("p",e.__assign({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:le.toneDescription||"Controls how assertively AI is redlining"})),i.jsx(o.ToneToggle,{isDirty:Ve,onToneChange:function(e){Je(e)},toneColor:Ue,toneIndex:Xe,onClickRegenerate:function(){return null==oe?void 0:oe(Qe)},toneLabels:re})]})]})),he&&i.jsxs("div",e.__assign({className:null==we?void 0:we.section,onClick:function(e){e.stopPropagation(),he&&he(e)},style:e.__assign(e.__assign(e.__assign({},I),null==Te?void 0:Te.section),be)},{children:[i.jsxs("div",e.__assign({className:null==we?void 0:we.headerLeft,style:e.__assign(e.__assign({},B),null==Te?void 0:Te.headerLeft)},{children:[i.jsx("span",e.__assign({className:null==we?void 0:we.titleIcon,style:e.__assign(e.__assign({},k),null==Te?void 0:Te.titleIcon)},{children:null!=We?We:i.jsx(t.ReactComponent,{})})),i.jsx("div",e.__assign({className:null==we?void 0:we.cognitiveTitle,style:e.__assign(e.__assign({},D),null==Te?void 0:Te.cognitiveTitle)},{children:Re}))]})),i.jsxs("div",e.__assign({className:null==we?void 0:we.headerRight,style:e.__assign(e.__assign({},T),null==Te?void 0:Te.headerRight)},{children:[void 0!==(null==$?void 0:$.relevance_score)&&null!==(null==$?void 0:$.relevance_score)?i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreBadge,style:e.__assign(e.__assign(e.__assign({},A),null==Te?void 0:Te.scoreBadge),Ie)},{children:[i.jsx(l.ReactComponent,{}),i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreText,style:e.__assign(e.__assign(e.__assign({},w),null==Te?void 0:Te.scoreText),ke)},{children:[Math.round(Number($.relevance_score)),"%"]}))]})):null,Le&&i.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:i.jsx(n.ChevronRight,{size:16,color:"#64748B"})}))]}))]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("lucide-react"),s=require("react"),o=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var t=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),a=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],r=function(n){var s=n.toneIndex,o=n.configs,t=void 0===o?a:o,l=t[Math.min(s,t.length-1)]||t[1]||t[0],r=l.color,d=l.angle,c=l.arcD,g=(d-90)*Math.PI/180,_=11+9*Math.cos(g),v=13+9*Math.sin(g);return i.jsxs("svg",e.__assign({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("path",{d:c,stroke:r,strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("line",{x1:"11",y1:"13",x2:_,y2:v,stroke:r,strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(n){var s=n.type,o=n.customStyles,t=void 0===o?{}:o,l=e.__assign(e.__assign({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),t),a=l[s]||l.Medium;return i.jsx("div",e.__assign({style:a},{children:s}))},c=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},_={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},v={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},u={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},p={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},x={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},m={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},y={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},h={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},f={display:"flex",gap:8,marginBottom:18},S={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},j={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},b={borderTop:"0.5px solid #eee",paddingTop:14},C={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},I={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},B={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},k={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},D={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},A={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},T={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},w={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};exports.default=function(z){var R,W,E,L,M,F,H,N,q,P,O,G,X,J,K,Q,U=z.onClose,V=z.aiReason,Y=z.onAccept,Z=z.onReject,$=z.onIterate,ee=z.initialTone,ie=z.onRegenerate,ne=z.labels,se=void 0===ne?{}:ne,oe=z.toneLevelsConfig,te=void 0===oe?c:oe,le=z.toneColorsConfig,ae=void 0===le?g:le,re=z.dialConfigs,de=void 0===re?a:re,ce=z.actions,ge=z.disableAllActions,_e=void 0!==ge&&ge,ve=z.customStyles,ue=void 0===ve?{}:ve,pe=z.severityChipStyles,xe=void 0===pe?{}:pe,me=z.customIcons,ye=void 0===me?{}:me,he=z.onOpenCognitive,fe=z.showTone,Se=void 0===fe||fe,je=z.cognitiveSectionStyle,be=void 0===je?{}:je,Ce=z.cognitiveScoreBadgeStyle,Ie=void 0===Ce?{}:Ce,Be=z.cognitiveScoreTextStyle,ke=void 0===Be?{}:Be,De=z.cognitiveStyles,Ae=void 0===De?{}:De,Te=z.cognitiveClassNames,we=void 0===Te?{}:Te,ze=z.cognitiveTitle,Re=void 0===ze?"Cognitive Integrity":ze,We=z.cognitiveLeftIcon,Ee=z.showCognitiveRightArrow,Le=void 0===Ee||Ee,Me=z.isStreaming,Fe=te.findIndex(function(e){return e===ee});-1===Fe&&(Fe=1);var He=s.useState(!0),Ne=He[0],qe=He[1],Pe=s.useState(!1),Oe=Pe[0],Ge=Pe[1],Xe=s.useState(Fe),Je=Xe[0],Ke=Xe[1],Qe=s.useState(Fe)[0],Ue=te[Je],Ve=ae[Ue]||"#BA7517",Ye=Je!==Qe,Ze=[{id:"iterate",icon:ye.iterateIcon||i.jsx(n.PenLine,{size:16,color:"#64748B"}),label:se.btnIterate||"Iterate",color:"#64748B",onClick:$},{id:"accept",icon:ye.acceptIcon||i.jsx(n.CheckCircle,{size:16,color:"#10B981"}),label:se.btnAccept||"Approve",color:"#10B981",onClick:Y},{id:"reject",icon:ye.rejectIcon||i.jsx(n.XCircle,{size:16,color:"#DC2626"}),label:se.btnReject||"Reject",color:"#DC2626",onClick:Z}],$e=ce||Ze;return i.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign({},_),null===(R=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===R?void 0:R.root)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},v),null===(W=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===W?void 0:W.header)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[i.jsx("span",{children:ye.summaryIcon||i.jsx(n.Info,{size:16,color:"#E24B4A"})}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},u),null===(E=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===E?void 0:E.title)},{children:se.summaryHeader||"Summary"}))]})),i.jsx("button",e.__assign({onClick:U,style:e.__assign(e.__assign({},j),null===(L=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===L?void 0:L.closeBtn)},{children:"✕"}))]})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},p),null===(M=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===M?void 0:M.bodyText)},{children:null===(F=null==V?void 0:V.deviation_details)||void 0===F?void 0:F.deviation_title})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},x),null===(H=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===H?void 0:H.summary)},{children:null===(N=null==V?void 0:V.deviation_details)||void 0===N?void 0:N.deviation_summary})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},m),null===(q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===q?void 0:q.impactContainer)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return qe(!Ne)},style:e.__assign(e.__assign({},y),null===(P=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===P?void 0:P.impactToggle)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},h),null===(O=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===O?void 0:O.impactToggleLabel)},{children:se.impactHeader||"Impact"})),i.jsx("span",e.__assign({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ne?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#E24B4A"})}))]})),i.jsx(d,{type:(null==V?void 0:V.severity)||"Medium",customStyles:xe})]})),Ne&&i.jsx("p",e.__assign({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(X=null===(G=null==V?void 0:V.deviation_details)||void 0===G?void 0:G.deviation_impact)&&void 0!==X?X:se.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},f),null===(J=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===J?void 0:J.actionContainer)},{children:$e.map(function(n){var s,o,t=_e||n.disabled,l=t?e.__assign(e.__assign({cursor:"not-allowed",opacity:.5},null===(s=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===s?void 0:s.actionBtnDisabled),n.disabledStyle):{};return i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign(e.__assign(e.__assign({},S),null===(o=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===o?void 0:o.actionBtn),{color:n.color}),n.style),l),onClick:t?void 0:n.onClick,disabled:t},{children:[n.icon,n.label]}),n.id)})})),Se&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},b),null===(K=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===K?void 0:K.toneContainer)},{children:[i.jsxs("button",e.__assign({onClick:function(){return Ge(!Oe)},style:e.__assign(e.__assign({},C),null===(Q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Q?void 0:Q.toneToggleBtn)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[i.jsx(r,{toneIndex:Je,configs:de}),i.jsx("span",e.__assign({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:se.toneHeader||"Redline Tone"}))]})),i.jsx("span",e.__assign({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Oe?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#111"})}))]})),Oe&&i.jsxs(i.Fragment,{children:[i.jsx("p",e.__assign({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:se.toneDescription||"Controls how assertively AI is redlining"})),i.jsx(o.ToneToggle,{isDirty:Ye,onToneChange:function(e){Ke(e)},toneColor:Ve,toneIndex:Je,onClickRegenerate:function(){return null==ie?void 0:ie(Ue)},toneLabels:te,isStreaming:Me,aiReason:V})]})]})),he&&i.jsxs("div",e.__assign({className:null==we?void 0:we.section,onClick:function(e){e.stopPropagation(),he&&he(e)},style:e.__assign(e.__assign(e.__assign({},I),null==Ae?void 0:Ae.section),be)},{children:[i.jsxs("div",e.__assign({className:null==we?void 0:we.headerLeft,style:e.__assign(e.__assign({},B),null==Ae?void 0:Ae.headerLeft)},{children:[i.jsx("span",e.__assign({className:null==we?void 0:we.titleIcon,style:e.__assign(e.__assign({},k),null==Ae?void 0:Ae.titleIcon)},{children:null!=We?We:i.jsx(t.ReactComponent,{})})),i.jsx("div",e.__assign({className:null==we?void 0:we.cognitiveTitle,style:e.__assign(e.__assign({},D),null==Ae?void 0:Ae.cognitiveTitle)},{children:Re}))]})),i.jsxs("div",e.__assign({className:null==we?void 0:we.headerRight,style:e.__assign(e.__assign({},A),null==Ae?void 0:Ae.headerRight)},{children:[void 0!==(null==V?void 0:V.relevance_score)&&null!==(null==V?void 0:V.relevance_score)?i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreBadge,style:e.__assign(e.__assign(e.__assign({},T),null==Ae?void 0:Ae.scoreBadge),Ie)},{children:[i.jsx(l.ReactComponent,{}),i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreText,style:e.__assign(e.__assign(e.__assign({},w),null==Ae?void 0:Ae.scoreText),ke)},{children:[Math.round(Number(V.relevance_score)),"%"]}))]})):null,Le&&i.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:i.jsx(n.ChevronRight,{size:16,color:"#64748B"})}))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=DeviationSummary.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("./PopupDefaults.js"),o=require("../icons/History.svg.js"),s=require("../icons/message-chat-square.svg.js"),a=require("./ToneToggle.js"),r=[{id:"chat",icon:n.jsx(s.ReactComponent,{}),label:"Chat",description:"Type on what basis you want to iterate"},{id:"risk",icon:n.jsx(s.ReactComponent,{}),label:"Shift the risk",description:"Adjust how aggressive or lenient the language is"},{id:"history",icon:n.jsx(o.ReactComponent,{}),label:"Historical Recommendations",description:"Pull from past recommended clauses"}],l=[{id:"1",filename:"Mutual_DA2.pdf",excerpt:'"...shall protect Confidential Information using at least the same degree of care as it uses to protect its own confidential information, but no less than reasonable c..."',tab:"Balanced"},{id:"2",filename:"Tech NDA.pdf",excerpt:'"...protect confidential information using reasonable care and appropriate safeguards..."',tab:"Balanced"},{id:"3",filename:"Corp NDA.pdf",excerpt:'"...shall use best efforts to protect any disclosed confidential materials from unauthorised access or disclosure..."',tab:"Aggressive"},{id:"4",filename:"Vendor Agreement.pdf",excerpt:'"...may use disclosed information solely for the stated purpose with no special handling required..."',tab:"Lenient"}],d=["Lenient","Balanced","Aggressive"],c={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},g=["Grounded","Innovative"];function f(i){var t=i.chatTitle,o=i.chatBody,s=i.mergedStyles,a=void 0===s?x:s;return n.jsx("div",e.__assign({style:a.body},{children:n.jsxs("div",e.__assign({style:a.chatBanner},{children:[n.jsx("p",e.__assign({style:a.chatBannerTitle},{children:t})),n.jsx("p",e.__assign({style:a.chatBannerBody},{children:o}))]}))}))}function p(t){var o=t.initialTone,s=t.onRiskRegenerate,r=t.riskMode,l=t.toneLevelsConfig,f=void 0===l?d:l,p=t.toneColorsConfig,u=void 0===p?c:p,h=t.riskModesConfig,y=void 0===h?g:h,m=t.mergedStyles,b=void 0===m?x:m,_=f.findIndex(function(e){return e===o});-1===
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("./PopupDefaults.js"),o=require("../icons/History.svg.js"),s=require("../icons/message-chat-square.svg.js"),a=require("./ToneToggle.js"),r=[{id:"chat",icon:n.jsx(s.ReactComponent,{}),label:"Chat",description:"Type on what basis you want to iterate"},{id:"risk",icon:n.jsx(s.ReactComponent,{}),label:"Shift the risk",description:"Adjust how aggressive or lenient the language is"},{id:"history",icon:n.jsx(o.ReactComponent,{}),label:"Historical Recommendations",description:"Pull from past recommended clauses"}],l=[{id:"1",filename:"Mutual_DA2.pdf",excerpt:'"...shall protect Confidential Information using at least the same degree of care as it uses to protect its own confidential information, but no less than reasonable c..."',tab:"Balanced"},{id:"2",filename:"Tech NDA.pdf",excerpt:'"...protect confidential information using reasonable care and appropriate safeguards..."',tab:"Balanced"},{id:"3",filename:"Corp NDA.pdf",excerpt:'"...shall use best efforts to protect any disclosed confidential materials from unauthorised access or disclosure..."',tab:"Aggressive"},{id:"4",filename:"Vendor Agreement.pdf",excerpt:'"...may use disclosed information solely for the stated purpose with no special handling required..."',tab:"Lenient"}],d=["Lenient","Balanced","Aggressive"],c={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},g=["Grounded","Innovative"];function f(i){var t=i.chatTitle,o=i.chatBody,s=i.mergedStyles,a=void 0===s?x:s;return n.jsx("div",e.__assign({style:a.body},{children:n.jsxs("div",e.__assign({style:a.chatBanner},{children:[n.jsx("p",e.__assign({style:a.chatBannerTitle},{children:t})),n.jsx("p",e.__assign({style:a.chatBannerBody},{children:o}))]}))}))}function p(t){var o=t.initialTone,s=t.onRiskRegenerate,r=t.riskMode,l=t.toneLevelsConfig,f=void 0===l?d:l,p=t.toneColorsConfig,u=void 0===p?c:p,h=t.riskModesConfig,y=void 0===h?g:h,m=t.mergedStyles,b=void 0===m?x:m,_=t.isStreaming,v=t.aiReason,C=f.findIndex(function(e){return e===o});-1===C&&(C=1);var j=i.useState(r||y[0]||"Grounded"),k=j[0],S=j[1],B=i.useState(C),R=B[0],T=B[1],A=i.useState(C)[0],w=f[R],z=u[w]||"#BA7517",L=R!==A||r!==k;return n.jsxs("div",e.__assign({style:b.body},{children:[n.jsx("div",e.__assign({style:{display:"flex",gap:8,marginBottom:16}},{children:y.map(function(i){return n.jsxs("button",e.__assign({onClick:function(){return S(i)},style:{flex:1,display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid ".concat(k===i?"#7c5cbf":"#e0ddd8"),background:"#fff",cursor:"pointer",fontSize:13,fontWeight:500,color:"#1a1a1a"}},{children:[n.jsx("span",e.__assign({style:{width:16,height:16,borderRadius:"50%",border:"2px solid ".concat(k===i?"#7c5cbf":"#ccc"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:k===i&&n.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#7c5cbf"}})})),i.charAt(0).toUpperCase()+i.slice(1)]}),i)})})),n.jsx(a.ToneToggle,{onToneChange:function(e){return T(e)},toneColor:z,isDirty:L,toneIndex:R,onClickRegenerate:function(){return null==s?void 0:s({tone:w,mode:k})},isStreaming:_,aiReason:v})]}))}function u(t){var o=t.onApply,s=t.historicalClausesData,a=void 0===s?l:s,r=t.toneLevelsConfig,c=void 0===r?d:r,g=t.mergedStyles,f=void 0===g?x:g,p=c.length>1?c[1]:c[0]||"Balanced",u=i.useState(p),h=u[0],y=u[1],m=a.filter(function(e){return e.tab===h});return n.jsxs("div",e.__assign({style:f.body},{children:[n.jsx("div",e.__assign({style:f.segmentedControl},{children:c.map(function(i){return n.jsx("button",e.__assign({onClick:function(){return y(i)},style:e.__assign(e.__assign({},f.segmentedBtn),h===i?f.segmentedBtnActive:{})},{children:i.charAt(0).toUpperCase()+i.slice(1)}),i)})})),n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:10,marginTop:12}},{children:[m.map(function(i){return n.jsxs("button",e.__assign({onClick:function(){return null==o?void 0:o({type:"history",value:i.excerpt})},style:f.clauseCard},{children:[n.jsx("p",e.__assign({style:f.clauseFilename},{children:i.filename})),n.jsx("p",e.__assign({style:f.clauseExcerpt},{children:i.excerpt}))]}),i.id)}),0===m.length&&n.jsx("p",e.__assign({style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"}},{children:"No clauses for this tone"}))]}))]}))}function h(e){var i=e.type,t=e.onRiskRegenerate,o=e.initialTone,s=e.riskMode,a=e.onApply,r=e.chatTitle,l=e.chatBody,d=e.historicalClausesData,c=e.toneLevelsConfig,g=e.toneColorsConfig,h=e.riskModesConfig,y=e.mergedStyles,m=void 0===y?x:y,b=e.isStreaming,_=e.aiReason;return"chat"===i?n.jsx(f,{chatTitle:r,chatBody:l,mergedStyles:m}):"risk"===i?n.jsx(p,{onRiskRegenerate:t,initialTone:o,riskMode:s,toneLevelsConfig:c,toneColorsConfig:g,riskModesConfig:h,mergedStyles:m,isStreaming:b,aiReason:_}):"history"===i?n.jsx(u,{onApply:a,historicalClausesData:d,toneLevelsConfig:c,mergedStyles:m}):null}var x={card:{background:"#fff",border:"0.5px solid #e8e7e3",borderRadius:14,width:300,maxHeight:"350px",overflow:"auto",fontFamily:"system-ui, sans-serif"},header:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"0.5px solid #e8e7e3"},backBtn:{background:"none",border:"none",cursor:"pointer",fontSize:20,color:"#888",padding:0,lineHeight:1},headerTitle:{fontSize:14,fontWeight:500,color:"#1a1a1a"},row:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",cursor:"pointer",border:"none",textAlign:"left",gap:10,boxSizing:"border-box",backgroundColor:"transparent"},rowLeft:{display:"flex",alignItems:"flex-start",gap:10,flex:1},icon:{fontSize:16,color:"#666",marginTop:1,flexShrink:0},label:{margin:0,fontSize:14,fontWeight:500,color:"#1a1a1a"},desc:{margin:"2px 0 0",fontSize:12,color:"#888",lineHeight:1.4},chevron:{fontSize:18,color:"#aaa",flexShrink:0,display:"inline-block",transition:"transform 0.2s"},body:{padding:"0 16px 14px 16px"},chatBanner:{background:"#eef4fd",border:"1px solid #c5d8f7",borderRadius:10,padding:"12px 14px",marginBottom:10},chatBannerTitle:{margin:"0 0 6px",fontSize:14,fontWeight:600,color:"#3a5a8a"},chatBannerBody:{margin:0,fontSize:13,color:"#4a6080",lineHeight:1.5},applyBtn:{display:"flex",padding:"7px 10.5px",justifyContent:"center",alignItems:"center",gap:"7px",marginTop:8,fontSize:13,borderRadius:6,border:"1px solid #2563EB",background:"#2563EB",color:"#fff"},rangeLabel:{fontSize:12,color:"#888"},segmentedControl:{border:"1px solid #F2F4F7",display:"flex",background:"#F9FAFB",borderRadius:4,padding:6,gap:8},segmentedBtn:{flex:1,padding:"7px 0",fontSize:13,fontWeight:500,color:"#888",background:"transparent",border:"none",borderRadius:8,cursor:"pointer",transition:"background 0.15s, color 0.15s"},segmentedBtnActive:{background:"#dce8fa",color:"#2a4a7a",fontWeight:700},clauseCard:{background:"#fff",border:"1px solid #dde5f0",borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",width:"100%"},clauseFilename:{margin:"0 0 6px",fontSize:13,fontWeight:600,color:"#2a4a7a"},clauseExcerpt:{margin:0,fontSize:13,color:"#4a5a70",fontStyle:"italic",lineHeight:1.5}};exports.default=function(o){var s=o.onBack,a=o.onChatClick,f=o.onRiskRegenerate,p=o.initialTone,u=o.riskMode,y=o.onApply,m=o.onTabToggle,b=o.menuItemsConfig,_=void 0===b?r:b,v=o.historicalClausesConfig,C=void 0===v?l:v,j=o.chatTitle,k=void 0===j?"Chat mode active":j,S=o.chatBody,B=void 0===S?"You are now chatting about this redline, continue the conversation in the left panel to refine or update it":S,R=o.headerTitle,T=void 0===R?"How would you like to iterate?":R,A=o.customStyles,w=void 0===A?{}:A,z=o.toneLevelsConfig,L=void 0===z?d:z,M=o.toneColorsConfig,D=void 0===M?c:M,I=o.riskModesConfig,q=void 0===I?g:I,F=o.isStreaming,H=o.aiReason,W=i.useState(null),E=W[0],G=W[1],N=e.__assign(e.__assign(e.__assign({},t.default.IterateMenuDefaults.styles),x),w);return n.jsxs("div",e.__assign({style:N.card},{children:[n.jsxs("div",e.__assign({style:N.header},{children:[n.jsx("button",e.__assign({onClick:s,style:N.backBtn,"aria-label":"Go back"},{children:"‹"})),n.jsx("span",e.__assign({style:N.headerTitle},{children:T}))]})),_.map(function(i,t){var o=E===i.id;return n.jsxs("div",e.__assign({style:{borderBottom:t<_.length-1?"0.5px solid #e8e7e3":"none"}},{children:[n.jsxs("button",e.__assign({onClick:function(){return e=i.id,G(function(n){return n===e?null:("chat"===e&&(null==a||a()),m&&m(e),e)});var e},style:N.row},{children:[n.jsx("div",e.__assign({style:N.rowLeft},{children:n.jsxs("div",{children:[n.jsx("p",e.__assign({style:N.label},{children:i.label})),n.jsx("p",e.__assign({style:N.desc},{children:i.description}))]})})),n.jsx("span",e.__assign({style:e.__assign(e.__assign({},N.chevron),{transform:o?"rotate(90deg)":"rotate(0deg)"})},{children:"›"}))]})),n.jsx("div",e.__assign({style:{maxHeight:o?400:0,overflow:"hidden",transition:"max-height 0.25s ease"}},{children:n.jsx(h,{type:i.id,onRiskRegenerate:f,initialTone:p,riskMode:u,onApply:y,chatTitle:k,chatBody:B,historicalClausesData:C,toneLevelsConfig:L,toneColorsConfig:D,riskModesConfig:q,mergedStyles:N,aiReason:H,isStreaming:F})}))]}),i.id)})]}))};
|
|
2
2
|
//# sourceMappingURL=IterateComponent.js.map
|
package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("lucide-react"),n=require("react"),i=require("./PopupDefaults.js");function o(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var r=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},a=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(){return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},l=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(s){var n=s.open;return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},g=function(s){var n=s.color,i=void 0===n?"#3b82f6":n;return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},x=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function f(s){var n=s.title,i=s.open,o=s.onToggle,r=s.children;return t.jsxs("div",e.__assign({style:{maxHeight:"170px",overflow:"auto"}},{children:[t.jsxs("div",e.__assign({onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:n})),t.jsx(u,{open:i})]})),t.jsx("div",e.__assign({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:r}))]}))}function _(s){var n=s.icon,i=s.label,o=s.onClick,r=s.customStyle,a=void 0===r?{}:r,d=e.__assign({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},a);return t.jsxs("button",e.__assign({onClick:o,style:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("lucide-react"),n=require("react"),i=require("./PopupDefaults.js");function o(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var r=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},a=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(){return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},l=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(s){var n=s.open;return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},g=function(s){var n=s.color,i=void 0===n?"#3b82f6":n;return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},x=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function f(s){var n=s.title,i=s.open,o=s.onToggle,r=s.children;return t.jsxs("div",e.__assign({style:{maxHeight:"170px",overflow:"auto"}},{children:[t.jsxs("div",e.__assign({onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:n})),t.jsx(u,{open:i})]})),t.jsx("div",e.__assign({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:r}))]}))}function _(s){var n=s.icon,i=s.label,o=s.onClick,r=s.customStyle,a=void 0===r?{}:r,d=s.disabled,l=void 0!==d&&d,c=s.disabledStyle,u=void 0===c?{}:c,g=e.__assign(e.__assign({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:l?.5:1},a),l?u:{});return t.jsxs("button",e.__assign({onClick:l?void 0:o,disabled:l,style:g,onMouseEnter:function(e){l||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:function(e){l||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")}},{children:[n,i]}))}exports.ApprovedIcon=r,exports.ChevronIcon=u,exports.CloseIcon=d,exports.HistoryIcon=g,exports.IterateIcon=x,exports.RedlineCard=function(u){var p,j=u.status,k=u.onClose,b=u.impactText,v=u.secondText,y=u.actionTakenByName,m=u.actionTakenAtTime,B=void 0===m?"NA":m,C=u.onHistory,L=u.onIterate,w=u.onReinstate,R=u.onRevert,I=u.disableAllActions,S=void 0!==I&&I,M=u.impactTitle,W=void 0===M?"Impact":M,T=u.customConfigs,D=void 0===T?{}:T,A=u.customStyles,z=void 0===A?{}:A,U=n.useState(!0),H=U[0],q=U[1],F=n.useState(!0),E=F[0],N=F[1],P=n.useState(!1),O=P[0],Y=P[1],G={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(r,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(s.Undo2,{size:17}),label:"Revert",onClick:R},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]},J={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t.jsx(c,{}),StatusIcon:t.jsx(a,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t.jsx(g,{color:"#3b82f6"}),label:"History",onClick:C},{icon:t.jsx(h,{}),label:"Reinstate",onClick:w},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]},K={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(s.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]};p="accepted"===j?G:"rejected"===j?J:K;var Q=e.__assign(e.__assign({},p),D[j]||{});return t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.root),{animation:O?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":i.default.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),z.root)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.header),{background:Q.headerBg,borderBottom:"1.5px solid ".concat(Q.headerBorder)}),z.header)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[Q.StatusIcon,t.jsx("span",e.__assign({style:{fontSize:15,fontWeight:700,color:Q.titleColor,letterSpacing:"-0.01em"}},{children:Q.label}))]})),t.jsx("button",e.__assign({onClick:function(){Y(!0),k()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t.jsx(d,{})}))]})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.body),z.body)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.meta),z.meta)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[Q.UserIcon,t.jsx("span",e.__assign({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:Q.metaLabel}))]})),t.jsxs("div",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[y,", ",o(B)]}))]})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),z.divider)}),t.jsx(f,e.__assign({title:W,open:H,onToggle:function(){return q(function(e){return!e})}},{children:t.jsx("p",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.impactText),z.impactText)},{children:b||""}))})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),z.divider)}),t.jsx(f,e.__assign({title:Q.secondTitle,open:E,onToggle:function(){return N(function(e){return!e})}},{children:t.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.secondSection),{background:Q.secondBg,border:"1.5px solid ".concat(Q.secondBorder)}),z.secondSection)},{children:v||""}))})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.actionsContainer),z.actionsContainer)},{children:Q.actions.map(function(s){return t.jsx(_,{icon:s.icon,label:s.label,onClick:s.onClick,customStyle:e.__assign(e.__assign({},s.style),z.actionBtn),disabled:S||s.disabled,disabledStyle:z.actionBtnDisabled},s.label)})}))]}))]}))},exports.ReinstateIcon=h,exports.RejectedIcon=a,exports.UserApprovedIcon=l,exports.UserRejectedIcon=c,exports.formatDate=o;
|
|
2
2
|
//# sourceMappingURL=RedlineStatusCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("lucide-react");exports.ToneToggle=function(i){var o=i.toneColor,r=i.toneIndex,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("lucide-react");exports.ToneToggle=function(i){var o=i.toneColor,r=i.toneIndex,a=i.isDirty,s=i.onToneChange,l=i.onClickRegenerate,d=i.toneLabels,g=void 0===d?["Lenient","Balanced","Aggressive"]:d,c=i.gradientColors,u=void 0===c?["#1D9E75","#BA7517","#E24B4A"]:c,p=i.buttonText,h=void 0===p?"Regenerate":p,f=i.customStyles,x=void 0===f?{}:f,b=i.isStreaming,m=i.aiReason,_="linear-gradient(to right, ".concat(u.join(", "),")"),v=Math.max(g.length-1,1),y=r/v*100,j=Boolean(b||(null==m?void 0:m.resolving));return t.jsxs(t.Fragment,{children:[t.jsx("div",e.__assign({style:e.__assign({width:"100%",height:8,borderRadius:"999px",background:_,marginBottom:8,position:"relative"},x.track)},{children:t.jsx("div",{style:e.__assign({position:"absolute",top:"50%",transform:"translate(-50%, -50%)",left:"".concat(y,"%"),width:12,height:12,borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 0 1.5px "+o,transition:"left 0.2s, background 0.2s",cursor:j?"not-allowed":"pointer",opacity:j?.7:1,background:j?"#9CA3AF":o},x.thumb)})})),t.jsx("input",{type:"range",min:0,max:v,step:1,value:r,onChange:function(e){return s(Number(e.target.value))},style:{width:"100%",cursor:"pointer",marginBottom:4,accentColor:o,opacity:0,marginTop:-20,display:"block",position:"relative",zIndex:1}}),t.jsx("div",e.__assign({style:e.__assign({display:"flex",justifyContent:"space-between",marginBottom:10,marginTop:-4},x.labelsContainer)},{children:g.map(function(n){return t.jsx("span",e.__assign({style:{fontSize:11,color:"#aaa"}},{children:n}),n)})})),t.jsx("div",e.__assign({style:e.__assign({maxHeight:a?60:0,overflow:"hidden",transition:"max-height 0.25s ease"},x.buttonContainer)},{children:t.jsxs("button",e.__assign({disabled:j,style:e.__assign({display:"flex",float:"right",alignItems:"center",justifyContent:"center",gap:6,fontSize:13,fontWeight:500,padding:9,borderRadius:8,border:"none",color:"#fff",cursor:j?"not-allowed":"pointer",opacity:j?.7:1,background:j?"#9CA3AF":o},x.button),onClick:l},{children:[t.jsx(n.RefreshCw,{size:16,color:"#fff"}),h]}))}))]})};
|
|
2
2
|
//# sourceMappingURL=ToneToggle.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),t=require("react/jsx-runtime"),e=require("react"),n=require("react-markdown"),o=require("rehype-raw"),a=require("lucide-react"),l=require("@mui/material"),s=require("./AiReasonMarkdownWrapper.module.css.js"),d=require("../../shared/ExpandableOl.js"),c=require("../citations/web-citation/WebCitationWithImageRenderer.js"),r=require("../citations/web-citation/WebCitationRenderer.js"),u=require("../citations/image-citation/ImageCitationRenderer.js"),_=require("../citations/file-citation/FileCitationRender.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),m=require("../citations/stormee-citation/StormeeCitationRenderer.js"),p=require("../citations/audio-citation/WaveformCitationRenderer.js"),g=require("../citations/appmod-citation/AppmodCitationRenderer.js"),f=require("../citations/rca-citation/RCACitationRenderer.js"),h=require("../citations/readfile-citation/ReadFileCitationRenderer.js"),j=require("../citations/chat-citation/ChatCitationRenderer.js"),C=require("@e-llm-studio/citation"),x=require("../citations/big-enough/BigEnoughCitationRenderer.js");function b(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var y=b(n),S=b(o),I=["appmode_citation","appmode_citations","appmod_citation","appmod_citations","image_citation","image_citations","audio_citation","audio_citations","document_citation","document_citations","rca_citation","rca_citations","web_citation","web_citations","code_generated","chat_citation","readfile_citation","readfile_citations","gpt_citation","gpt_citations","big_enough_block"],q=function(t,e,n){return i.__spreadArray([],t.map(function(t,o){var a=o>=e&&o<=n;return i.__assign(i.__assign({},t),{highlighted_text:a?t.message:""})}),!0)};exports.AiReasonMarkdownWrapper=function(n){var o=n.label,b=n.message,k=n.isExpandableOrderedListEnabled,M=n.customStyles,R=n.citationStyles,w=n.customIcons,N=n.onSelectProceed,F=n.isDisableProceedButton,W=n.big_enough_block,P=e.useRef(null),A=v.useRequirementAI(),L=A.citations,T=A.citationConfig,D=A.chatHistory,E=A.chatCitationConfigs,O=A.gptCitationConfigs,z=e.useMemo(function(){return{h1:function(e){e.node;var n=i.__rest(e,["node"]);return t.jsx("h1",i.__assign({className:s.default.h1,style:null==M?void 0:M.h1},{children:null==n?void 0:n.children}))},h2:function(e){e.node;var n=i.__rest(e,["node"]);return t.jsx("h2",i.__assign({className:s.default.h2,style:null==M?void 0:M.h2},{children:null==n?void 0:n.children}))},h3:function(e){e.node;var n=i.__rest(e,["node"]);return t.jsx("h2",i.__assign({className:s.default.h3,style:null==M?void 0:M.h3},{children:null==n?void 0:n.children}))},b:function(e){return e.node,i.__rest(e,["node"]),t.jsx("b",{className:s.default.bold,style:null==M?void 0:M.b})},p:function(e){e.node;var n=i.__rest(e,["node"]);return t.jsx("p",i.__assign({},n,{className:s.default.paragraph,style:null==M?void 0:M.p},{children:null==n?void 0:n.children}))},ol:function(e){e.node;var n=i.__rest(e,["node"]);return k?t.jsx(d.default,i.__assign({label:o,customStyles:null==M?void 0:M.expandOlStyle,onProceed:N,isProceedDisabled:F,aiReasoningCitation:L,citationStyles:R,customIcons:w},{children:null==n?void 0:n.children})):t.jsx("ol",i.__assign({className:s.default.orderedList,style:null==M?void 0:M.ol},{children:null==n?void 0:n.children}))},ul:function(e){e.node;var n=i.__rest(e,["node"]);return t.jsx("ul",i.__assign({className:s.default.unorderedList},{children:null==n?void 0:n.children}))},a:function(n){var o,d,v,b,y,S,k,N,F,P,A,z,U,B,G,H,$,X,J,K,Q,V,Y,Z,ii,ti;n.inline;var ei=n.children;n.node;var ni=i.__rest(n,["inline","children","node"]),oi="true"===(null==ni?void 0:ni.table),ai="".concat(null==ni?void 0:ni.href),li=null===(o=ai.split("$"))||void 0===o?void 0:o[0],si=null===(d=ai.split("$"))||void 0===d?void 0:d[1],di=("appmode_citation"===li||"appmode_citations"===li?(null==L?void 0:L.appmod_citations)||[]:"image_citation"===li||"image_citations"===li?(null==L?void 0:L.image_citations)||[]:"audio_citation"===li||"audio_citations"===li?(null==L?void 0:L.audio_citations)||[]:"document_citation"===li||"document_citations"===li?(null==L?void 0:L.file_citations)||[]:"rca_citation"===li||"rca_citations"===li?(null==L?void 0:L.rca_citations)||[]:"web_citation"===li||"web_citations"===li?(null==L?void 0:L.web_citations)||[]:"code_generated"===li?(null==L?void 0:L.code_generated)||[]:"readfile_citation"===li||"readfile_citations"===li?(null==L?void 0:L.readfile_citations)||[]:"gpt_citation"===li||"gpt_citations"===li?L.gpt_citations||[]:"big_enough_block"===li&&W||[]).find(function(i){return i.citation_number===decodeURIComponent(si)}),ci=I.includes(li);if("big_enough_block"===li&&di)return console.log("Rendering big enough block with citation:",R),t.jsx(x.default,{title:ei,citation:di,customStyles:null==R?void 0:R.bigEnoughCitation,customIcons:w});if("chat_citation"===li){if(!D||0===D.length)return null;var ri=si.split("-").map(Number),ui=ri[0],_i=ri[1];return ui=ui>0?ui-1:ui,_i=_i<D.length-1?_i+1:_i,t.jsx(j.default,{customIcon:null==w?void 0:w.chatCitationIcon,title:ei,chatHistory:q(D,ui,_i),isTable:oi,chatCitationProps:null==E?void 0:E.chatCitationProps,onCitationClick:null==E?void 0:E.handleCitationClicked,customStyles:null==R?void 0:R.chatCitation})}if("gpt_citation"===li&&di)return t.jsx(C.NonWebReasoningComponent,i.__assign({item:{text:"",dataSource:null===(b=null===(v=di.customMetadata)||void 0===v?void 0:v.data_sources)||void 0===b?void 0:b[0],trainingDataTitle:null===(S=null===(y=di.customMetadata)||void 0===y?void 0:y.training_data_title)||void 0===S?void 0:S[0],paraphrase:null===(N=null===(k=di.customMetadata)||void 0===k?void 0:k.paraphrase)||void 0===N?void 0:N[0]},headerTitle:(null==O?void 0:O.title)||"GPT - Gemini 2.5 Flash",iconsConfig:{ChevronDownIcon:a.ChevronDown,ChevronUpIcon:a.ChevronUp,MaximizeIcon:a.Maximize2,CloseIcon:a.X}},null==O?void 0:O.gptCitationProps));if("image_citation"===li&&!di)return null;if("web_citation"===(null===(F=null==di?void 0:di.customMetadata)||void 0===F?void 0:F.type))return(null===(P=di.customMetadata)||void 0===P?void 0:P.screenshot_url)?t.jsx(c.default,{title:ei,citation:di,customStyles:null==R?void 0:R.webCitation,customIcons:w}):t.jsx(r.default,{label:ei,url:null===(A=di.customMetadata)||void 0===A?void 0:A.link,customStyles:null==R?void 0:R.webCitation,customIcons:w});if("audio_transcript"===(null===(z=null==di?void 0:di.customMetadata)||void 0===z?void 0:z.type))return"stormee"===(null==di?void 0:di.customMetadata.audio_citation_mode)?t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(m.default,{title:"".concat(ei),citation:di,customStyles:null==R?void 0:R.stormeeCitation,customIcons:w})})):t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(p.default,{title:"".concat(ei),citation:di,customStyles:null==R?void 0:R.waveformCitation,customIcons:w})}));if("image_citation"===(null==di?void 0:di.customMetadata.type))return t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(u.default,{title:"".concat(ei),citation:di,customIcons:w,customStyles:null==R?void 0:R.imageCitation})}));if("book_citation_doc"===(null===(U=null==di?void 0:di.customMetadata)||void 0===U?void 0:U.type)||"book_citation_pdf"===(null==di?void 0:di.customMetadata.type))return t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(_.default,{title:"".concat(ei),citation:di,customIcons:w,customStyles:null==R?void 0:R.fileCitation})}));if("app_mod_rag_question"===(null===(B=null==di?void 0:di.customMetadata)||void 0===B?void 0:B.type))return t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(g.default,{title:"".concat(ei),citation:di,customIcons:w,customStyles:null==R?void 0:R.appModCitation,codeLinkConfig:null===(G=null==T?void 0:T.appMod)||void 0===G?void 0:G.codeLinkConfig,isLoading:null===(H=null==T?void 0:T.appMod)||void 0===H?void 0:H.isLoading})}));if("rca_citation"===(null===($=null==di?void 0:di.customMetadata)||void 0===$?void 0:$.type))return t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(f.default,{title:"".concat(ei),citation:di,customIcons:w,customStyles:null==R?void 0:R.rcaCitation})}));if("readfile_citation"===(null===(X=null==di?void 0:di.customMetadata)||void 0===X?void 0:X.type))return t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(h.default,{title:"".concat(ei),citation:di,customIcons:w,customStyles:null==R?void 0:R.readFileCitation,fileCallback:null===(J=null==T?void 0:T.readFile)||void 0===J?void 0:J.fileCallback,editorConfig:null===(K=null==T?void 0:T.readFile)||void 0===K?void 0:K.editorConfig,customColors:null===(Q=null==T?void 0:T.readFile)||void 0===Q?void 0:Q.customColors})}));if(ci&&!di){var vi=null!==(V=null==w?void 0:w.citationLoadingIcon)&&void 0!==V?V:t.jsx("span",{className:s.default.citationSpinner,style:null===(Y=null==R?void 0:R.loadingCitations)||void 0===Y?void 0:Y.citationSpinner});return t.jsx(l.Tooltip,i.__assign({title:null!==(ii=null===(Z=null==R?void 0:R.loadingCitations)||void 0===Z?void 0:Z.tooltipTitle)&&void 0!==ii?ii:"source ".concat(li.split("_")[0]," citations"),arrow:!0},{children:t.jsxs("span",i.__assign({className:s.default.citationSpinnerWrapper,style:null===(ti=null==R?void 0:R.loadingCitations)||void 0===ti?void 0:ti.citationSpinnerWrapper},{children:[ei,vi]}))}))}return t.jsx("span",i.__assign({},ni,{className:s.default.paragraph,style:null==M?void 0:M.p},{children:null==ni?void 0:ni.children}))},code:function(e){e.inline;var n=e.children,o=e.className;return e.node,i.__rest(e,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?t.jsx("div",{children:t.jsx("code",i.__assign({className:s.default.blockCode},{children:n}))}):t.jsx("code",i.__assign({className:s.default.inlineCode,style:null==M?void 0:M.code},{children:n}))},learned:function(e){var n=e.children;return t.jsx(t.Fragment,{children:t.jsx(l.Tooltip,i.__assign({title:n,placement:"top"},{children:t.jsx(a.Info,{size:16,className:s.default.learnedIcon})}))})}}},[L,k,T,D,W]);return t.jsx("div",i.__assign({ref:P,className:"w-full"},{children:t.jsx(y.default,i.__assign({components:z,rehypePlugins:[S.default]},{children:b}))}))},exports.formatChatData=q;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),e=require("react-markdown"),o=require("rehype-raw"),a=require("lucide-react"),l=require("@mui/material"),s=require("./AiReasonMarkdownWrapper.module.css.js"),d=require("../../shared/ExpandableOl.js"),c=require("../citations/web-citation/WebCitationWithImageRenderer.js"),r=require("../citations/web-citation/WebCitationRenderer.js"),u=require("../citations/image-citation/ImageCitationRenderer.js"),_=require("../citations/file-citation/FileCitationRender.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),m=require("../citations/stormee-citation/StormeeCitationRenderer.js"),p=require("../citations/audio-citation/WaveformCitationRenderer.js"),g=require("../citations/appmod-citation/AppmodCitationRenderer.js"),f=require("../citations/rca-citation/RCACitationRenderer.js"),h=require("../citations/readfile-citation/ReadFileCitationRenderer.js"),j=require("../citations/chat-citation/ChatCitationRenderer.js"),C=require("@e-llm-studio/citation"),x=require("../citations/big-enough/BigEnoughCitationRenderer.js"),b=require("./ScannedCitationRenderer.js");function y(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var S=y(e),I=y(o),q=["appmode_citation","appmode_citations","appmod_citation","appmod_citations","image_citation","image_citations","audio_citation","audio_citations","document_citation","document_citations","rca_citation","rca_citations","web_citation","web_citations","code_generated","chat_citation","readfile_citation","readfile_citations","gpt_citation","gpt_citations","big_enough_block","scanned_doc_citation","scanned_doc_citations"],k=function(t,n,e){return i.__spreadArray([],t.map(function(t,o){var a=o>=n&&o<=e;return i.__assign(i.__assign({},t),{highlighted_text:a?t.message:""})}),!0)};exports.AiReasonMarkdownWrapper=function(e){var o=e.label,y=e.message,M=e.isExpandableOrderedListEnabled,R=e.customStyles,w=e.citationStyles,N=e.customIcons,F=e.onSelectProceed,W=e.isDisableProceedButton,P=e.big_enough_block,A=n.useRef(null),L=v.useRequirementAI(),D=L.citations,T=L.citationConfig,E=L.chatHistory,O=L.chatCitationConfigs,z=L.gptCitationConfigs,U=n.useMemo(function(){return{h1:function(n){n.node;var e=i.__rest(n,["node"]);return t.jsx("h1",i.__assign({className:s.default.h1,style:null==R?void 0:R.h1},{children:null==e?void 0:e.children}))},h2:function(n){n.node;var e=i.__rest(n,["node"]);return t.jsx("h2",i.__assign({className:s.default.h2,style:null==R?void 0:R.h2},{children:null==e?void 0:e.children}))},h3:function(n){n.node;var e=i.__rest(n,["node"]);return t.jsx("h2",i.__assign({className:s.default.h3,style:null==R?void 0:R.h3},{children:null==e?void 0:e.children}))},b:function(n){return n.node,i.__rest(n,["node"]),t.jsx("b",{className:s.default.bold,style:null==R?void 0:R.b})},p:function(n){n.node;var e=i.__rest(n,["node"]);return t.jsx("p",i.__assign({},e,{className:s.default.paragraph,style:null==R?void 0:R.p},{children:null==e?void 0:e.children}))},ol:function(n){n.node;var e=i.__rest(n,["node"]);return M?t.jsx(d.default,i.__assign({label:o,customStyles:null==R?void 0:R.expandOlStyle,onProceed:F,isProceedDisabled:W,aiReasoningCitation:D,citationStyles:w,customIcons:N},{children:null==e?void 0:e.children})):t.jsx("ol",i.__assign({className:s.default.orderedList,style:null==R?void 0:R.ol},{children:null==e?void 0:e.children}))},ul:function(n){n.node;var e=i.__rest(n,["node"]);return t.jsx("ul",i.__assign({className:s.default.unorderedList},{children:null==e?void 0:e.children}))},a:function(e){var o,d,v,y,S,I,M,F,W,A,L,U,B,G,H,$,X,J,K,Q,V,Y,Z,ii,ti,ni,ei,oi;e.inline;var ai=e.children;e.node;var li=i.__rest(e,["inline","children","node"]),si="true"===(null==li?void 0:li.table),di="".concat(null==li?void 0:li.href),ci=null===(o=di.split("$"))||void 0===o?void 0:o[0],ri=null===(d=di.split("$"))||void 0===d?void 0:d[1],ui=("appmode_citation"===ci||"appmode_citations"===ci?(null==D?void 0:D.appmod_citations)||[]:"image_citation"===ci||"image_citations"===ci?(null==D?void 0:D.image_citations)||[]:"audio_citation"===ci||"audio_citations"===ci?(null==D?void 0:D.audio_citations)||[]:"document_citation"===ci||"document_citations"===ci?(null==D?void 0:D.file_citations)||[]:"rca_citation"===ci||"rca_citations"===ci?(null==D?void 0:D.rca_citations)||[]:"web_citation"===ci||"web_citations"===ci?(null==D?void 0:D.web_citations)||[]:"code_generated"===ci?(null==D?void 0:D.code_generated)||[]:"readfile_citation"===ci||"readfile_citations"===ci?(null==D?void 0:D.readfile_citations)||[]:"gpt_citation"===ci||"gpt_citations"===ci?(null==D?void 0:D.gpt_citations)||[]:"scanned_doc_citation"===ci||"scanned_doc_citations"===ci?(null==D?void 0:D.scanned_doc_citations)||[]:"big_enough_block"===ci&&P||[]).find(function(i){return i.citation_number===decodeURIComponent(ri)}),_i=q.includes(ci);if("big_enough_block"===ci&&ui)return console.log("Rendering big enough block with citation:",w),t.jsx(x.default,{title:ai,citation:ui,customStyles:null==w?void 0:w.bigEnoughCitation,customIcons:N});if("chat_citation"===ci){if(!E||0===E.length)return null;var vi=ri.split("-").map(Number),mi=vi[0],pi=vi[1];return mi=mi>0?mi-1:mi,pi=pi<E.length-1?pi+1:pi,t.jsx(j.default,{customIcon:null==N?void 0:N.chatCitationIcon,title:ai,chatHistory:k(E,mi,pi),isTable:si,chatCitationProps:null==O?void 0:O.chatCitationProps,onCitationClick:null==O?void 0:O.handleCitationClicked,customStyles:null==w?void 0:w.chatCitation})}if("gpt_citation"===ci&&ui)return t.jsx(C.NonWebReasoningComponent,i.__assign({item:{text:"",dataSource:null===(y=null===(v=ui.customMetadata)||void 0===v?void 0:v.data_sources)||void 0===y?void 0:y[0],trainingDataTitle:null===(I=null===(S=ui.customMetadata)||void 0===S?void 0:S.training_data_title)||void 0===I?void 0:I[0],paraphrase:null===(F=null===(M=ui.customMetadata)||void 0===M?void 0:M.paraphrase)||void 0===F?void 0:F[0]},headerTitle:(null==z?void 0:z.title)||"GPT - Gemini 2.5 Flash",iconsConfig:{ChevronDownIcon:a.ChevronDown,ChevronUpIcon:a.ChevronUp,MaximizeIcon:a.Maximize2,CloseIcon:a.X}},null==z?void 0:z.gptCitationProps));if("image_citation"===ci&&!ui)return null;if("web_citation"===(null===(W=null==ui?void 0:ui.customMetadata)||void 0===W?void 0:W.type))return(null===(A=ui.customMetadata)||void 0===A?void 0:A.screenshot_url)?t.jsx(c.default,{title:ai,citation:ui,customStyles:null==w?void 0:w.webCitation,customIcons:N}):t.jsx(r.default,{label:ai,url:null===(L=ui.customMetadata)||void 0===L?void 0:L.link,customStyles:null==w?void 0:w.webCitation,customIcons:N});if("audio_transcript"===(null===(U=null==ui?void 0:ui.customMetadata)||void 0===U?void 0:U.type))return"stormee"===(null==ui?void 0:ui.customMetadata.audio_citation_mode)?t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(m.default,{title:"".concat(ai),citation:ui,customStyles:null==w?void 0:w.stormeeCitation,customIcons:N})})):t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(p.default,{title:"".concat(ai),citation:ui,customStyles:null==w?void 0:w.waveformCitation,customIcons:N})}));if("scanned_doc_citations"===(null===(B=null==ui?void 0:ui.customMetadata)||void 0===B?void 0:B.type)||"scanned_doc_citation"===(null===(G=null==ui?void 0:ui.customMetadata)||void 0===G?void 0:G.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(b.default,{title:ai,citation:ui,customIcons:N,customStyles:null==w?void 0:w.scannedDocumentCitation})}));if("image_citation"===(null==ui?void 0:ui.customMetadata.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(u.default,{title:"".concat(ai),citation:ui,customIcons:N,customStyles:null==w?void 0:w.imageCitation})}));if("book_citation_doc"===(null===(H=null==ui?void 0:ui.customMetadata)||void 0===H?void 0:H.type)||"book_citation_pdf"===(null==ui?void 0:ui.customMetadata.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(_.default,{title:"".concat(ai),citation:ui,customIcons:N,customStyles:null==w?void 0:w.fileCitation})}));if("app_mod_rag_question"===(null===($=null==ui?void 0:ui.customMetadata)||void 0===$?void 0:$.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(g.default,{title:"".concat(ai),citation:ui,customIcons:N,customStyles:null==w?void 0:w.appModCitation,codeLinkConfig:null===(X=null==T?void 0:T.appMod)||void 0===X?void 0:X.codeLinkConfig,isLoading:null===(J=null==T?void 0:T.appMod)||void 0===J?void 0:J.isLoading})}));if("rca_citation"===(null===(K=null==ui?void 0:ui.customMetadata)||void 0===K?void 0:K.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(f.default,{title:"".concat(ai),citation:ui,customIcons:N,customStyles:null==w?void 0:w.rcaCitation})}));if("readfile_citation"===(null===(Q=null==ui?void 0:ui.customMetadata)||void 0===Q?void 0:Q.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(h.default,{title:"".concat(ai),citation:ui,customIcons:N,customStyles:null==w?void 0:w.readFileCitation,fileCallback:null===(V=null==T?void 0:T.readFile)||void 0===V?void 0:V.fileCallback,editorConfig:null===(Y=null==T?void 0:T.readFile)||void 0===Y?void 0:Y.editorConfig,customColors:null===(Z=null==T?void 0:T.readFile)||void 0===Z?void 0:Z.customColors})}));if(_i&&!ui){var gi=null!==(ii=null==N?void 0:N.citationLoadingIcon)&&void 0!==ii?ii:t.jsx("span",{className:s.default.citationSpinner,style:null===(ti=null==w?void 0:w.loadingCitations)||void 0===ti?void 0:ti.citationSpinner});return t.jsx(l.Tooltip,i.__assign({title:null!==(ei=null===(ni=null==w?void 0:w.loadingCitations)||void 0===ni?void 0:ni.tooltipTitle)&&void 0!==ei?ei:"source ".concat(ci.split("_")[0]," citations"),arrow:!0},{children:t.jsxs("span",i.__assign({className:s.default.citationSpinnerWrapper,style:null===(oi=null==w?void 0:w.loadingCitations)||void 0===oi?void 0:oi.citationSpinnerWrapper},{children:[ai,gi]}))}))}return t.jsx("span",i.__assign({},li,{className:s.default.paragraph,style:null==R?void 0:R.p},{children:null==li?void 0:li.children}))},code:function(n){n.inline;var e=n.children,o=n.className;return n.node,i.__rest(n,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?t.jsx("div",{children:t.jsx("code",i.__assign({className:s.default.blockCode},{children:e}))}):t.jsx("code",i.__assign({className:s.default.inlineCode,style:null==R?void 0:R.code},{children:e}))},learned:function(n){var e=n.children;return t.jsx(t.Fragment,{children:t.jsx(l.Tooltip,i.__assign({title:e,placement:"top"},{children:t.jsx(a.Info,{size:16,className:s.default.learnedIcon})}))})}}},[D,M,T,E,P]);return t.jsx("div",i.__assign({ref:A,className:"w-full"},{children:t.jsx(S.default,i.__assign({components:U,rehypePlugins:[I.default]},{children:y}))}))},exports.formatChatData=k;
|
|
2
2
|
//# sourceMappingURL=AiReasonMarkdownWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("./AiReasoningCitationContent.js"),t=require("../../icons/CognitiveDecision.js"),o=require("../../../CitationRenderer/CitationRenderer.js"),s=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"18 15 12 9 6 15"})}))},r=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"6 9 12 15 18 9"})}))};exports.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING=75,exports.default=function(l){var a=l.isSourceHasHighlight,c=l.aiReason,d=l.citationTitle,u=void 0===d?"":d,p=l.customStyles,f=l.customIcons,g=l.onSelectProceed,x=l.isDisableProceedButton,h=(c.relevance_score>=75?null==f?void 0:f.highConfidence:null==f?void 0:f.lowConfidence)||i.jsx(t.default,{});return i.jsx("span",{children:i.jsx(o.default,{inLineCitation:!0,citationId:"ai-reasoning-".concat(c.id),citationTitle:u,citationIcon:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("./AiReasoningCitationContent.js"),t=require("../../icons/CognitiveDecision.js"),o=require("../../../CitationRenderer/CitationRenderer.js"),s=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"18 15 12 9 6 15"})}))},r=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"6 9 12 15 18 9"})}))};exports.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING=75,exports.default=function(l){var a=l.isSourceHasHighlight,c=l.aiReason,d=l.citationTitle,u=void 0===d?"":d,p=l.customStyles,f=l.customIcons,g=l.onSelectProceed,x=l.isDisableProceedButton,h=l.inlineLabel,v=l.isInlineCitation,m=(c.relevance_score>=75?null==f?void 0:f.highConfidence:null==f?void 0:f.lowConfidence)||i.jsx(t.default,{});return i.jsx("span",{children:i.jsx(o.default,{inLineCitation:!0,citationId:"ai-reasoning-".concat(c.id),citationTitle:v?h||"":u||"",citationIcon:v?null:m,defaultExpanded:(null==c?void 0:c.isOpen)||a||!1,citationComponent:i.jsx(n.default,{aiReason:c,customStyles:p,customIcons:f,onSelectProceed:g,isDisableProceedButton:x}),chevronDownComponent:i.jsx(r,{}),chevronUpComponent:i.jsx(s,{}),styles:{pillButton:e.__assign({margin:"0px",padding:"4px 8px",fontSize:"15px",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:v?"center":"flex-end",background:"#ffffffff",fontWeight:"700",gap:"1.5px",border:"none"},null==p?void 0:p.aiReasoningPill),citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}}})})};
|
|
2
2
|
//# sourceMappingURL=AiReasoningCitation.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),n=require("react/jsx-runtime"),e=require("@e-llm-studio/citation"),i=require("../../../RequirementAiCitations/AiReasoning/components/icons/DocumentCitationIcon.js"),o=require("../../../CitationRenderer/CitationRenderer.js");exports.default=function(a){var r,c=a.title,l=a.citation,s=a.customIcons,u=a.customStyles,d=l.customMetadata,p=null!==(r=null==s?void 0:s.ScannedDocumentIcon)&&void 0!==r?r:n.jsx(i.default,{});return n.jsx(o.default,{inLineCitation:!0,citationTitle:c,citationId:"scanned-doc-".concat(l.citation_number),citationComponent:n.jsx(e.ScannedDocCitation,{pages:null==d?void 0:d.value,subHeadingText:null==d?void 0:d.artifact_title,height:"400px"}),chevronDownComponent:p,chevronUpComponent:p,styles:{pillButton:t.__assign({fontSize:"14px",margin:"0px",background:"#ffffff",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",border:"none"},null==u?void 0:u.pill),citationContent:t.__assign({width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"},null==u?void 0:u.content)}})};
|
|
2
|
+
//# sourceMappingURL=ScannedCitationRenderer.js.map
|
package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScannedCitationRenderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|