@e-llm-studio/requirement-ai 0.0.255 → 0.0.257
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/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/cjs/features/ManageRemainders/ManageRemainder.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationRender.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/UserStoryWithCitation.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
- package/dist/cjs/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/features/ManageRemainders/ManageRemainder.module.css.js +1 -1
- package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
- package/dist/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +5 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.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/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts +1 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts +2 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/types.d.ts +4 -0
- package/dist/types/src/features/GptWebCitation/types.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +5 -1
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts +2509 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts +3 -2
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts +12 -0
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/utils/proccess-stream.utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),l=require("../hooks/memoizedMarkdown.js"),d=require("../CompareContext.js"),r=require("../CognitiveComparehelpers.js"),a=require("../CognitiveCompareConstants.js");function s(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=s(i).default.memo(function(s){var c,v,f,g,p,h,_,m,x,S,I=s.section,y=s.keyPath,b=s.depth,O=void 0===b?0:b,A=s.columnKey,E=void 0===A?"left":A,M=s.parentNodeId,R=void 0===M?"":M,P=s.sectionOffset,k=s.rhsOrphanVisualIndexes,B=d.useCompareContext(),C=B.expandedSubSections,N=B.setExpandedSubSections,j=B.maintainRelativeOrder,w=B.showDeviationBadges,F=void 0!==w&&w,D=B.proposedSections,T=B.existingSections,V=B.treeData,L=B.deviationNumberRegistry,q=B.deviationParentRegistry,G=B.connectedSections,K=B.activeSideBySideSection,W=B.isSideBySide,z=B.scrollSyncLocked,H=B.toggleScrollSyncLocked,U=B.summaryPopupAnchorEl,X=B.resolvedMarkdownStyles,J=B.getSubSectionRef,Q=B.getSubSectionCompareStyle,Y=B.getBadgeRef,Z=B.openMoreFunctionsPopup,$=B.openSummaryPopup,nn=B.resetSideBySide,en=B.setConnectedSections,tn=B.setConnectedLines,on=B.cachedConnectedPositions,ln=B.isProposingFix,dn=B.proposingFixNodeId,rn=B.isRedlineFlow,an=B.unifiedNumbering,sn=null!=K?K:"",un=(null===(c=I.displayTitle)||void 0===c||c)&&r.hasValue(I.title),cn=!(!ln||!dn||"left"!==E||I.id!==dn&&I.nodeId!==dn),vn=r.hasMeaningfulRedlineTags(I.content),fn="boolean"==typeof rn?rn:vn,gn=vn,pn=fn&&vn,hn=pn?r.stripRedlineTags(I.content):I.content,_n=pn?I.content:void 0,mn=(null===(v=I.displayContent)||void 0===v||v||vn)&&r.hasValue(I.content),xn=!un&&!mn,Sn=un?I.title:mn?"No Title Found":"No Matching Section Found",In=!!C[y],yn=J(E,y),bn=y.split("-").map(Number)[0],On=D[bn],An=T[bn],En=bn,Mn=bn,Rn=!1,Pn=function(n,e,i){if(!n||!e)return null;if(n.id===e||n.nodeId===e||n.contentId===e)return{section:n,keyPath:i};for(var t=(n.subsections||[]).map(function(n,e){return{section:n,keyPath:"".concat(i,"-").concat(e)}}),o=function(){var n=t.shift();return(null==n?void 0:n.section)?n.section.id===e||n.section.nodeId===e||n.section.contentId===e?{value:n}:void(n.section.subsections||[]).forEach(function(e,i){t.push({section:e,keyPath:"".concat(n.keyPath,"-").concat(i)})}):"continue"};t.length>0;){var l=o();if("object"==typeof l)return l.value}return null};if(j)if("left"===E){var kn=null===(f=null==On?void 0:On.refIndexes)||void 0===f?void 0:f[0],Bn=T.findIndex(function(n){return n.selfIndex===kn});-1!==Bn?(An=T[Bn],Mn=Bn):Rn=!0}else{var Cn=null===(g=null==An?void 0:An.refIndexes)||void 0===g?void 0:g[0],Nn=D.findIndex(function(n){return n.selfIndex===Cn});-1!==Nn?(On=D[Nn],En=Nn):Rn=!0}var jn=function(n,e){if(!e||!n)return null;for(var i=0;i<n.length;i++){var t=Pn(n[i],e,String(i));if(t)return t}return null},wn=null,Fn=null,Dn="",Tn="";if(j)"left"===E?(wn=I,Dn=y,(Vn=Pn(An,I.nodeId||I.id,String(Mn)))||(Vn=jn(T,I.nodeId||I.id)),Fn=(null==Vn?void 0:Vn.section)||null,Tn=(null==Vn?void 0:Vn.keyPath)||""):(Fn=I,Tn=y,(Ln=Pn(On,I.nodeId||I.id,String(En)))||(Ln=jn(D,I.nodeId||I.id)),wn=(null==Ln?void 0:Ln.section)||null,Dn=(null==Ln?void 0:Ln.keyPath)||"");else if("left"===E){wn=I,Dn=y;var Vn=jn(T,I.nodeId||I.id);Fn=(null==Vn?void 0:Vn.section)||null,Tn=(null==Vn?void 0:Vn.keyPath)||""}else{Fn=I,Tn=y;var Ln=jn(D,I.nodeId||I.id);wn=(null==Ln?void 0:Ln.section)||null,Dn=(null==Ln?void 0:Ln.keyPath)||""}var qn=(Dn?Q(Dn):null)||Q(y),Gn=null===(p=null==V?void 0:V.input_index_map)||void 0===p?void 0:p[0],Kn=null===(h=null==V?void 0:V.input_index_map)||void 0===h?void 0:h[1],Wn="left"===E?Kn:Gn,zn="left"===E?!Fn:!wn,Hn=j&&"right"===E&&r.hasSingleMappedLhsSection(An,D),Un=I.evaluationResult||(null==wn?void 0:wn.evaluationResult)||(null==Fn?void 0:Fn.evaluationResult),Xn=(null==Un?void 0:Un.deviations)||{},Jn=i.useMemo(function(){return j&&"right"===E?r.getLhsDeviationDisplayIndexes(D,Gn,L):new Map},[j,E,D,Gn,L]),Qn=I.nodeId||I.id||(null==wn?void 0:wn.nodeId)||(null==wn?void 0:wn.id)||(null==Fn?void 0:Fn.nodeId)||(null==Fn?void 0:Fn.id);j&&"left"!==E&&(null==wn?void 0:wn.id)&&(Qn=wn.nodeId||wn.id);var Yn=Object.keys(Xn)[0],Zn=Yn?"".concat(Qn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(Yn):null,$n=Zn?null==q?void 0:q[Zn]:null,ne=bn+1;if(j&&an){var ee="left"===E?an.leftNums.get(null==On?void 0:On.id):an.rightNums.get(null==An?void 0:An.id);Rn&&void 0!==ee?ne=ee:null!=$n&&$n>=0?ne=$n:void 0!==ee&&(ne=ee)}else null!=$n&&$n>=0&&(ne=$n);var ie=null!==(x=null===(m=null===(_=null==Un?void 0:Un.evaluation_outputs)||void 0===_?void 0:_.metadata)||void 0===m?void 0:m.label_color)&&void 0!==x?x:a.DEFAULT_DEVIAION_COLOR,te=r.generateColorPalette(ie).highlightBg,oe=Object.entries(Xn).map(function(n){var e=n[0],i=n[1],t="".concat(Qn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(e);return{deviationKey:e,deviationMap:i,refId:t,currentIndex:L[t]}}).filter(function(n){return void 0!==n.currentIndex&&null!==n.currentIndex});oe.sort(function(n,e){return n.currentIndex-e.currentIndex});var le=new Map;if(!k&&j&&"right"===E){var de=r.safeStringify(hn||"").replace(/\\n/g,"\n");oe.filter(function(n){var e=n.deviationMap,i=e[R];return(zn||r.isMissingStr(e[Wn]))&&!!i&&!r.isMissingStr(i)}).map(function(e){var i=r.safeStringify(e.deviationMap[R]||"").replace(/\\n/g,"\n"),t=i?de.indexOf(i):-1;return n.__assign(n.__assign({},e),{position:t})}).sort(function(n,e){return(-1===n.position?Number.MAX_SAFE_INTEGER:n.position)-(-1===e.position?Number.MAX_SAFE_INTEGER:e.position)||n.currentIndex-e.currentIndex}).forEach(function(n,e){le.set(n.refId,e+1)})}var re=oe.map(function(e){var i,t,o,l,d=e.deviationKey,a=e.deviationMap,s=e.refId,u=e.currentIndex,c=a[R],v=r.isMissingStr(c);if(v)c="";else if(!c)return null;var f=a[Wn],g=zn||r.isMissingStr(f),p=null!==(i=null==k?void 0:k.get(s))&&void 0!==i?i:le.get(s),h=Jn.get(s);j&&"right"===E&&g&&void 0!==p?u=p:j&&"right"===E&&!g&&void 0!==h?u=h:j&&void 0!==P&&("right"!==E||g||Hn)&&(u-=P),u=Math.max(1,u);var _=j&&"right"===E&&g&&an?r.getRhsMappedSectionNumber({section:An,proposedSections:D,leftNums:an.leftNums,fallbackNumber:String(ne),firstOnly:!0}):ne,m="".concat(_,".").concat(u),x="".concat(Qn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(d).concat(r.DEVIATION_BADGE_SEPARATOR).concat(Dn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(Tn),S=(null==a?void 0:a.evaluation_outputs)||(null==Un?void 0:Un.evaluation_outputs),I=null!==(t=null==S?void 0:S.output_value)&&void 0!==t?t:null,y=null!==(l=null===(o=null==S?void 0:S.metadata)||void 0===o?void 0:o.label_color)&&void 0!==l?l:ie,b=r.generateColorPalette(y),O=n.__assign({},b),A=(null==a?void 0:a.deviation_summary)?{deviation_summary:a.deviation_summary||(null==Un?void 0:Un.deviation_summary),deviation_title:(null==a?void 0:a.deviation_title)||(null==Un?void 0:Un.deviation_title),deviation_impact:(null==a?void 0:a.deviation_impact)||(null==Un?void 0:Un.deviation_impact),deviation_explanation:(null==a?void 0:a.deviation_explanation)||(null==Un?void 0:Un.deviation_explanation),evaluation_outputs:S,cognitive_decisioning:(null==a?void 0:a.cognitive_decisioning)||(null==Un?void 0:Un.cognitive_decisioning)}:null,M=0,B=hn||"";if(c&&B){var C=B.split(/\n{2,}/),N=C.findIndex(function(n){return n.includes(c)});if(-1!==N){var w=Object.entries(Xn).filter(function(n){n[0];var e=n[1][R];return e&&C[N].includes(e)}).sort(function(n,e){return C[N].indexOf(n[1][R])-C[N].indexOf(e[1][R])}),F=w.filter(function(n){n[0];var e=n[1][R];return e&&(e.includes(c)||c.includes(e))});F.length>1&&(M=Math.max(0,F.findIndex(function(n){return n[0]===d})))}}var T=Y(E,s);return{id:s,actionId:x,label:m,highlight:c,side:E,style:O,stackIndex:M,score:I,isConnected:G.has(x),showScrollLockToggle:G.has(x)||W&&K===x||!!U&&U===T.current,scrollSyncLocked:z,toggleScrollSyncLocked:H,isOrphan:g,isMissingClause:v,badgeRef:T,onClick:function(e){e.stopPropagation();var i=wn?n.__assign(n.__assign({},wn),{title:(null==On?void 0:On.title)||(null==wn?void 0:wn.title)||""}):{id:"orphan-left",title:"",content:""},t=Fn?n.__assign(n.__assign({},Fn),{title:(null==An?void 0:An.title)||(null==Fn?void 0:Fn.title)||""}):{id:"orphan-right",title:"",content:""};Z(e,i,g,t,x,O)},onSummaryClick:function(n){n.stopPropagation(),$(n,x,g,A)}}}).filter(Boolean).sort(function(n,e){return parseFloat(n.label)-parseFloat(e.label)}),ae=i.useMemo(function(){var n=new Set;return re.filter(function(e){return!n.has(e.id)&&(n.add(e.id),!0)})},[re]),se=F||!fn&&cn?ae:[],ue=ae.map(function(n){return n.highlight}).filter(Boolean),ce=re.find(function(n){return G.has(n.actionId)}),ve=!!ce;if(!(un||mn||I.subsections&&0!==I.subsections.length))return null;var fe=(null===(S=null==ce?void 0:ce.style)||void 0===S?void 0:S.badgeBorder)||(null==qn?void 0:qn.badgeBorder),ge=ve&&fe?{borderRadius:"4px",outline:"2px solid ".concat(fe),outlineOffset:"1px"}:{};return un?e.jsx(t.Box,n.__assign({ref:yn,sx:{mt:1,width:"100%",minWidth:0,position:"relative"}},{children:e.jsx(t.Box,n.__assign({sx:n.__assign({width:"100%"},ge)},{children:e.jsxs(t.Accordion,n.__assign({disableGutters:!0,expanded:!xn&&In,onChange:function(){if(!xn){if(In){var e=String(K||""),i=e.includes(Dn)||e.includes(Tn);i||G.forEach(function(n){(String(n).includes(Dn)||String(n).includes(Tn))&&(i=!0)}),i&&(nn(),en(new Set),tn([]),on.current=[])}N(function(e){var i;return n.__assign(n.__assign({},e),((i={})[y]=!e[y],i))})}},sx:{mt:0,boxShadow:"none",border:xn?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF",minWidth:0,"&:before":{display:"none"}}},{children:[e.jsx(t.AccordionSummary,n.__assign({expandIcon:xn?null:e.jsx(o.ChevronDown,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"}}},{children:e.jsx(t.Typography,n.__assign({component:"div",sx:{fontSize:"11px",fontWeight:600,color:xn?"#94A3B8":"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:Sn||"Untitled Subsection"}))})),!xn&&e.jsxs(t.AccordionDetails,n.__assign({sx:{pt:0,pb:1,minWidth:0}},{children:[mn&&e.jsx(l.MemoizedMarkdown,{content:hn,overlayContent:_n,sxStyles:X,deviationBadges:se,maintainRelativeOrder:j,highlightBg:te,suppressHighlightBg:gn,highlights:ue,collisionKey:sn}),(I.subsections||[]).map(function(n,i){return e.jsx(u,{section:n,keyPath:"".concat(y,"-").concat(i),depth:O+1,columnKey:E,parentNodeId:R,sectionOffset:P,rhsOrphanVisualIndexes:k},"".concat(y,"-").concat(i))})]}))]}))}))})):e.jsx(t.Box,n.__assign({ref:yn,sx:{mt:0===O?1:.75,width:"100%",minWidth:0,position:"relative"}},{children:!xn&&e.jsxs(t.Box,n.__assign({sx:n.__assign({width:"100%"},ge)},{children:[mn&&e.jsx(l.MemoizedMarkdown,{content:hn,overlayContent:_n,sxStyles:X,deviationBadges:se,maintainRelativeOrder:j,highlightBg:te,suppressHighlightBg:gn,highlights:ue,collisionKey:sn}),(I.subsections||[]).map(function(n,i){return e.jsx(u,{section:n,keyPath:"".concat(y,"-").concat(i),depth:O+1,columnKey:E,parentNodeId:R,sectionOffset:P,rhsOrphanVisualIndexes:k},"".concat(y,"-").concat(i))})]}))}))});exports.default=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),l=require("../hooks/memoizedMarkdown.js"),d=require("../CompareContext.js"),r=require("../CognitiveComparehelpers.js"),a=require("../CognitiveCompareConstants.js");function s(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=s(i).default.memo(function(s){var c,v,f,g,h,p,_,m,x,S,y=s.section,I=s.keyPath,b=s.depth,A=void 0===b?0:b,E=s.columnKey,O=void 0===E?"left":E,M=s.parentNodeId,R=void 0===M?"":M,P=s.sectionOffset,k=s.rhsOrphanVisualIndexes,B=d.useCompareContext(),C=B.expandedSubSections,N=B.setExpandedSubSections,j=B.maintainRelativeOrder,w=B.showDeviationBadges,F=void 0!==w&&w,T=B.proposedSections,D=B.existingSections,V=B.treeData,L=B.deviationNumberRegistry,q=B.deviationParentRegistry,G=B.connectedSections,K=B.activeSideBySideSection,W=B.isSideBySide,z=B.scrollSyncLocked,H=B.toggleScrollSyncLocked,U=B.summaryPopupAnchorEl,X=B.resolvedMarkdownStyles,J=B.getSubSectionRef,Q=B.getSubSectionCompareStyle,Y=B.getBadgeRef,Z=B.openMoreFunctionsPopup,$=B.openSummaryPopup,nn=B.resetSideBySide,en=B.setConnectedSections,tn=B.setConnectedLines,on=B.cachedConnectedPositions,ln=B.isProposingFix,dn=B.proposingFixNodeId,rn=B.isRedlineFlow,an=B.unifiedNumbering,sn=null!=K?K:"",un=(null===(c=y.displayTitle)||void 0===c||c)&&r.hasValue(y.title),cn=!(!ln||!dn||"left"!==O||y.id!==dn&&y.nodeId!==dn),vn=r.hasMeaningfulRedlineTags(y.content),fn="boolean"==typeof rn?rn:vn,gn=vn,hn=fn&&vn,pn=hn?r.hasValue(y.change_history)?r.safeStringify(y.change_history):r.stripRedlineTags(y.content):y.content,_n=hn?y.content:void 0,mn=(null===(v=y.displayContent)||void 0===v||v||vn)&&r.hasValue(y.content),xn=!un&&!mn,Sn=un?y.title:mn?"No Title Found":"No Matching Section Found",yn=!!C[I],In=J(O,I),bn=I.split("-").map(Number)[0],An=T[bn],En=D[bn],On=bn,Mn=bn,Rn=!1,Pn=function(n,e,i){if(!n||!e)return null;if(n.id===e||n.nodeId===e||n.contentId===e)return{section:n,keyPath:i};for(var t=(n.subsections||[]).map(function(n,e){return{section:n,keyPath:"".concat(i,"-").concat(e)}}),o=function(){var n=t.shift();return(null==n?void 0:n.section)?n.section.id===e||n.section.nodeId===e||n.section.contentId===e?{value:n}:void(n.section.subsections||[]).forEach(function(e,i){t.push({section:e,keyPath:"".concat(n.keyPath,"-").concat(i)})}):"continue"};t.length>0;){var l=o();if("object"==typeof l)return l.value}return null};if(j)if("left"===O){var kn=null===(f=null==An?void 0:An.refIndexes)||void 0===f?void 0:f[0],Bn=D.findIndex(function(n){return n.selfIndex===kn});-1!==Bn?(En=D[Bn],Mn=Bn):Rn=!0}else{var Cn=null===(g=null==En?void 0:En.refIndexes)||void 0===g?void 0:g[0],Nn=T.findIndex(function(n){return n.selfIndex===Cn});-1!==Nn?(An=T[Nn],On=Nn):Rn=!0}var jn=function(n,e){if(!e||!n)return null;for(var i=0;i<n.length;i++){var t=Pn(n[i],e,String(i));if(t)return t}return null},wn=null,Fn=null,Tn="",Dn="";if(j)"left"===O?(wn=y,Tn=I,(Vn=Pn(En,y.nodeId||y.id,String(Mn)))||(Vn=jn(D,y.nodeId||y.id)),Fn=(null==Vn?void 0:Vn.section)||null,Dn=(null==Vn?void 0:Vn.keyPath)||""):(Fn=y,Dn=I,(Ln=Pn(An,y.nodeId||y.id,String(On)))||(Ln=jn(T,y.nodeId||y.id)),wn=(null==Ln?void 0:Ln.section)||null,Tn=(null==Ln?void 0:Ln.keyPath)||"");else if("left"===O){wn=y,Tn=I;var Vn=jn(D,y.nodeId||y.id);Fn=(null==Vn?void 0:Vn.section)||null,Dn=(null==Vn?void 0:Vn.keyPath)||""}else{Fn=y,Dn=I;var Ln=jn(T,y.nodeId||y.id);wn=(null==Ln?void 0:Ln.section)||null,Tn=(null==Ln?void 0:Ln.keyPath)||""}var qn=(Tn?Q(Tn):null)||Q(I),Gn=null===(h=null==V?void 0:V.input_index_map)||void 0===h?void 0:h[0],Kn=null===(p=null==V?void 0:V.input_index_map)||void 0===p?void 0:p[1],Wn="left"===O?Kn:Gn,zn="left"===O?!Fn:!wn,Hn=j&&"right"===O&&r.hasSingleMappedLhsSection(En,T),Un=y.evaluationResult||(null==wn?void 0:wn.evaluationResult)||(null==Fn?void 0:Fn.evaluationResult),Xn=(null==Un?void 0:Un.deviations)||{},Jn=i.useMemo(function(){return j&&"right"===O?r.getLhsDeviationDisplayIndexes(T,Gn,L):new Map},[j,O,T,Gn,L]),Qn=y.nodeId||y.id||(null==wn?void 0:wn.nodeId)||(null==wn?void 0:wn.id)||(null==Fn?void 0:Fn.nodeId)||(null==Fn?void 0:Fn.id);j&&"left"!==O&&(null==wn?void 0:wn.id)&&(Qn=wn.nodeId||wn.id);var Yn=Object.keys(Xn)[0],Zn=Yn?"".concat(Qn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(Yn):null,$n=Zn?null==q?void 0:q[Zn]:null,ne=bn+1;if(j&&an){var ee="left"===O?an.leftNums.get(null==An?void 0:An.id):an.rightNums.get(null==En?void 0:En.id);Rn&&void 0!==ee?ne=ee:null!=$n&&$n>=0?ne=$n:void 0!==ee&&(ne=ee)}else null!=$n&&$n>=0&&(ne=$n);var ie=null!==(x=null===(m=null===(_=null==Un?void 0:Un.evaluation_outputs)||void 0===_?void 0:_.metadata)||void 0===m?void 0:m.label_color)&&void 0!==x?x:a.DEFAULT_DEVIAION_COLOR,te=r.generateColorPalette(ie).highlightBg,oe=Object.entries(Xn).map(function(n){var e=n[0],i=n[1],t="".concat(Qn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(e);return{deviationKey:e,deviationMap:i,refId:t,currentIndex:L[t]}}).filter(function(n){return void 0!==n.currentIndex&&null!==n.currentIndex});oe.sort(function(n,e){return n.currentIndex-e.currentIndex});var le=new Map;if(!k&&j&&"right"===O){var de=r.safeStringify(pn||"").replace(/\\n/g,"\n");oe.filter(function(n){var e=n.deviationMap,i=e[R];return(zn||r.isMissingStr(e[Wn]))&&!!i&&!r.isMissingStr(i)}).map(function(e){var i,t,o=r.safeStringify(e.deviationMap[R]||"").replace(/\\n/g,"\n"),l=o&&null!==(t=null===(i=r.findTextMatchRange(de,o))||void 0===i?void 0:i.start)&&void 0!==t?t:-1;return n.__assign(n.__assign({},e),{position:l})}).sort(function(n,e){return(-1===n.position?Number.MAX_SAFE_INTEGER:n.position)-(-1===e.position?Number.MAX_SAFE_INTEGER:e.position)||n.currentIndex-e.currentIndex}).forEach(function(n,e){le.set(n.refId,e+1)})}var re=oe.map(function(e){var i,t,o,l,d=e.deviationKey,a=e.deviationMap,s=e.refId,u=e.currentIndex,c=a[R],v=r.isMissingStr(c);if(v)c="";else if(!c)return null;var f=a[Wn],g=zn||r.isMissingStr(f),h=null!==(i=null==k?void 0:k.get(s))&&void 0!==i?i:le.get(s),p=Jn.get(s);j&&"right"===O&&g&&void 0!==h?u=h:j&&"right"===O&&!g&&void 0!==p?u=p:j&&void 0!==P&&("right"!==O||g||Hn)&&(u-=P),u=Math.max(1,u);var _=j&&"right"===O&&g&&an?r.getRhsMappedSectionNumber({section:En,proposedSections:T,leftNums:an.leftNums,fallbackNumber:String(ne),firstOnly:!0}):ne,m="".concat(_,".").concat(u),x="".concat(Qn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(d).concat(r.DEVIATION_BADGE_SEPARATOR).concat(Tn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(Dn),S=(null==a?void 0:a.evaluation_outputs)||(null==Un?void 0:Un.evaluation_outputs),y=null!==(t=null==S?void 0:S.output_value)&&void 0!==t?t:null,I=null!==(l=null===(o=null==S?void 0:S.metadata)||void 0===o?void 0:o.label_color)&&void 0!==l?l:ie,b=r.generateColorPalette(I),A=n.__assign({},b),E=(null==a?void 0:a.deviation_summary)?{deviation_summary:a.deviation_summary||(null==Un?void 0:Un.deviation_summary),deviation_title:(null==a?void 0:a.deviation_title)||(null==Un?void 0:Un.deviation_title),deviation_impact:(null==a?void 0:a.deviation_impact)||(null==Un?void 0:Un.deviation_impact),deviation_explanation:(null==a?void 0:a.deviation_explanation)||(null==Un?void 0:Un.deviation_explanation),evaluation_outputs:S,cognitive_decisioning:(null==a?void 0:a.cognitive_decisioning)||(null==Un?void 0:Un.cognitive_decisioning)}:null,M=0,B=pn||"";if(c&&B){var C=B.split(/\n{2,}/),N=C.findIndex(function(n){return n.includes(c)});if(-1!==N){var w=Object.entries(Xn).filter(function(n){n[0];var e=n[1][R];return e&&C[N].includes(e)}).sort(function(n,e){return C[N].indexOf(n[1][R])-C[N].indexOf(e[1][R])}),F=w.filter(function(n){n[0];var e=n[1][R];return e&&(e.includes(c)||c.includes(e))});F.length>1&&(M=Math.max(0,F.findIndex(function(n){return n[0]===d})))}}var D=Y(O,s);return{id:s,actionId:x,label:m,highlight:c,side:O,style:A,stackIndex:M,score:y,isConnected:G.has(x),showScrollLockToggle:G.has(x)||W&&K===x||!!U&&U===D.current,scrollSyncLocked:z,toggleScrollSyncLocked:H,isOrphan:g,isMissingClause:v,badgeRef:D,onClick:function(e){e.stopPropagation();var i=wn?n.__assign(n.__assign({},wn),{title:(null==An?void 0:An.title)||(null==wn?void 0:wn.title)||""}):{id:"orphan-left",title:"",content:""},t=Fn?n.__assign(n.__assign({},Fn),{title:(null==En?void 0:En.title)||(null==Fn?void 0:Fn.title)||""}):{id:"orphan-right",title:"",content:""};Z(e,i,g,t,x,A)},onSummaryClick:function(n){n.stopPropagation(),$(n,x,g,E)}}}).filter(Boolean).sort(function(n,e){return parseFloat(n.label)-parseFloat(e.label)}),ae=i.useMemo(function(){var n=new Set;return re.filter(function(e){return!n.has(e.id)&&(n.add(e.id),!0)})},[re]),se=F||!fn&&cn?ae:[],ue=ae.map(function(n){return n.highlight}).filter(Boolean),ce=re.find(function(n){return G.has(n.actionId)}),ve=!!ce;if(!(un||mn||y.subsections&&0!==y.subsections.length))return null;var fe=(null===(S=null==ce?void 0:ce.style)||void 0===S?void 0:S.badgeBorder)||(null==qn?void 0:qn.badgeBorder),ge=ve&&fe?{borderRadius:"4px",outline:"2px solid ".concat(fe),outlineOffset:"1px"}:{};return un?e.jsx(t.Box,n.__assign({ref:In,sx:{mt:1,width:"100%",minWidth:0,position:"relative"}},{children:e.jsx(t.Box,n.__assign({sx:n.__assign({width:"100%"},ge)},{children:e.jsxs(t.Accordion,n.__assign({disableGutters:!0,expanded:!xn&&yn,onChange:function(){if(!xn){if(yn){var e=String(K||""),i=e.includes(Tn)||e.includes(Dn);i||G.forEach(function(n){(String(n).includes(Tn)||String(n).includes(Dn))&&(i=!0)}),i&&(nn(),en(new Set),tn([]),on.current=[])}N(function(e){var i;return n.__assign(n.__assign({},e),((i={})[I]=!e[I],i))})}},sx:{mt:0,boxShadow:"none",border:xn?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF",minWidth:0,"&:before":{display:"none"}}},{children:[e.jsx(t.AccordionSummary,n.__assign({expandIcon:xn?null:e.jsx(o.ChevronDown,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"}}},{children:e.jsx(t.Typography,n.__assign({component:"div",sx:{fontSize:"11px",fontWeight:600,color:xn?"#94A3B8":"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:Sn||"Untitled Subsection"}))})),!xn&&e.jsxs(t.AccordionDetails,n.__assign({sx:{pt:0,pb:1,minWidth:0}},{children:[mn&&e.jsx(l.MemoizedMarkdown,{content:pn,overlayContent:_n,sxStyles:X,deviationBadges:se,maintainRelativeOrder:j,highlightBg:te,suppressHighlightBg:gn,highlights:ue,collisionKey:sn}),(y.subsections||[]).map(function(n,i){return e.jsx(u,{section:n,keyPath:"".concat(I,"-").concat(i),depth:A+1,columnKey:O,parentNodeId:R,sectionOffset:P,rhsOrphanVisualIndexes:k},"".concat(I,"-").concat(i))})]}))]}))}))})):e.jsx(t.Box,n.__assign({ref:In,sx:{mt:0===A?1:.75,width:"100%",minWidth:0,position:"relative"}},{children:!xn&&e.jsxs(t.Box,n.__assign({sx:n.__assign({width:"100%"},ge)},{children:[mn&&e.jsx(l.MemoizedMarkdown,{content:pn,overlayContent:_n,sxStyles:X,deviationBadges:se,maintainRelativeOrder:j,highlightBg:te,suppressHighlightBg:gn,highlights:ue,collisionKey:sn}),(y.subsections||[]).map(function(n,i){return e.jsx(u,{section:n,keyPath:"".concat(I,"-").concat(i),depth:A+1,columnKey:O,parentNodeId:R,sectionOffset:P,rhsOrphanVisualIndexes:k},"".concat(I,"-").concat(i))})]}))}))});exports.default=u;
|
|
2
2
|
//# sourceMappingURL=SubSectionAccordion.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),t=require("@mui/material"),i=require("react"),r=require("../CognitiveCompareConstants.js"),o=require("lucide-react"),a=require("react-markdown"),s=require("../CognitiveComparehelpers.js"),l=require("rehype-raw"),d=require("remark-gfm");function c(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=c(i),h=c(a),g=c(l),p=function(n){return"function"==typeof n?n:(null==n?void 0:n.default)||n},f=[p(c(d).default)],v=[p(g.default)],x=u.default.memo(function(a){var l=a.content,d=a.overlayContent,c=a.sxStyles,g=a.deviationBadges,p=void 0===g?[]:g,x=a.highlights,m=void 0===x?[]:x;a.maintainRelativeOrder;var _=a.highlightBg,b=a.suppressHighlightBg,y=void 0!==b&&b,B=a.collisionKey,E=i.useRef(null),j=!!d,w=i.useMemo(function(){return p.reduce(function(e,t){var i;return n.__assign(n.__assign({},e),((i={})[t.id]=t,i))},{})},[p]),k=i.useRef({badgeMap:w,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y});k.current={badgeMap:w,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y};var C=function(e,t){return u.default.Children.map(e,function(e){var i;if(!u.default.isValidElement(e))return e;var r=(null===(i=e.props)||void 0===i?void 0:i.children)?C(e.props.children,t):e.props.children,o=u.default.cloneElement(e,n.__assign(n.__assign({},e.props),{children:r}));return t(o)})},S=i.useMemo(function(){return{mark:function(t){var i,r,o,a,s=t.children,l=n.__rest(t,["children"]),d=k.current,c=d.badgeMap,u=d.highlightBg,h=d.hideHighlightBg,g=d.suppressHighlightBg,p=l["data-badge-id"],f=p?c[p]:null,v=l["data-highlight-color"],x=null!==(a=null!==(r=null!=v?v:null===(i=null==f?void 0:f.style)||void 0===i?void 0:i.highlightBg)&&void 0!==r?r:null===(o=null==f?void 0:f.style)||void 0===o?void 0:o.badgeBg)&&void 0!==a?a:u,m="true"===l["data-is-suggested-deviation-fix"]||g;return e.jsx("span",n.__assign({style:n.__assign(n.__assign(n.__assign({},m?{}:{backgroundColor:x}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),h?{color:"transparent"}:{})},{children:s}))},span:function(i){var a,s,l,d,c,u,h=i.children,g=n.__rest(i,["children"]),p=k.current.badgeMap,f=g["data-badge-id"];if(!f)return e.jsx("span",n.__assign({},g,{children:h}));var v=p[f];if(!v)return e.jsx("span",n.__assign({},g,{children:h}));var x="number"==typeof v.stackIndex?v.stackIndex:0,m="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return e.jsxs(t.Box,n.__assign({component:"span",sx:{position:"static",display:"inline"}},{children:[e.jsxs(t.Box,n.__assign({ref:v.badgeRef,className:"deviation-badge","data-side":v.side||"right",sx:n.__assign(n.__assign({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=v.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(s=v.style)||void 0===s?void 0:s.badgeText)||r.DEFAULT_DEVIAION_COLOR,border:"1px solid ".concat((null===(l=v.style)||void 0===l?void 0:l.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===v.side?{right:"-16px",transform:"".concat(m," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(m," translateX(calc(-100% - 8px))")}),v.isConnected&&v.style&&{outline:"2px solid ".concat(v.style.badgeBorder),outlineOffset:"1px"})},{children:[e.jsxs(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onSummaryClick&&v.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:v.label})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=v.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=v.score&&"N/A"!==v.score&&"NA"!==v.score&&0!==v.score?"".concat(v.score):"N/A"===v.score||"NA"===v.score?"N/A":"Same"}))]})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onClick&&v.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(c=v.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:e.jsx(o.EllipsisVertical,{size:12,color:(null===(u=v.style)||void 0===u?void 0:u.badgeText)||"#3730A3"})}))]})),h]}))},table:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({sx:{display:"block",width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box",contain:"inline-size",overflowX:"auto",overflowY:"hidden",overscrollBehaviorX:"contain",WebkitOverflowScrolling:"touch",my:1}},{children:e.jsx(t.Box,n.__assign({component:"table",sx:{width:"600px",minWidth:"600px",tableLayout:"fixed",borderCollapse:"collapse",fontSize:"inherit"}},{children:r}))}))},thead:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({component:"thead"},{children:r}))},tbody:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({component:"tbody"},{children:r}))},tr:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:r}))},th:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",verticalAlign:"top",fontWeight:600,backgroundColor:"#F9FAFB",whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere"}},{children:r}))},td:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top",whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere"}},{children:r}))},code:function(t){var i=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:i}))},pre:function(t){var i=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:i}))},updated:function(n){var t=n.children;return e.jsx(e.Fragment,{children:t})},deleted:function(t){var i=t.children,r=C(i,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:r}))},changed:function(t){var i=t.children,r=C(i,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:r}))},ul:function(i){var r=i.children,o=n.__rest(i,["children"]);return e.jsx(t.Box,n.__assign({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},o,{children:r}))},ol:function(i){var r=i.children,o=n.__rest(i,["children"]);return e.jsx(t.Box,n.__assign({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},o,{children:r}))},li:function(i){var r=i.children,o=n.__rest(i,["children"]);return e.jsx(t.Box,n.__assign({component:"li",sx:{mb:.5,display:"list-item"}},o,{children:r}))}}},[]),F=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,i){return"".concat(e," ").concat(i)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g," ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var i=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(i)?"\n":" "})}).join("")).trim()},z=function(n){return n.replace(/[\.,;:]/g," ")},A=i.useMemo(function(){return p.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[p]),M=i.useMemo(function(){var e=F(l||""),t=y?z(e):e,i=(p||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:F((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||_}}).filter(function(n){return n.id&&n.highlight}),r={};i.forEach(function(n){r[n.highlight]||(r[n.highlight]=[]),r[n.highlight].push(n)});var o=function(n,e,t,i){void 0===e&&(e=""),void 0===i&&(i=[]);var r=!1,o=function(n){var o=function(n,e,t){var i,r,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var s=null!==(i=a[1])&&void 0!==i?i:"",l=null!==(r=a[2])&&void 0!==r?r:"",d=null!==(o=a[3])&&void 0!==o?o:"";return l?s+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",i=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(i).concat(t,">")}(e,t)+l+"</mark>"+d:n}(n,e,t),a=o;if(!r&&i.length>0){r=!0;var s="",l="";i.forEach(function(n){s+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),l="</span>"+l}),a=s+o+l}return""+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(r).forEach(function(n){var i=n[0],r=n[1],o=e.indexOf(i),l=!1;if(-1===o&&y){var d=z(i);-1!==(o=t.indexOf(d))&&(l=!0)}if(-1!==o){for(var c=r[0].highlightColor,u=1;u<r.length;u++)c=s.mixHexColors(c,r[u].highlightColor||"");a.push({highlight:i,start:o,end:o+i.length,badges:r,color:c,usedLooseMatch:l})}});var d=new Set(Object.keys(r));(m||[]).forEach(function(n){if(n){var i=F(n);if(i&&!d.has(i)){var r=e.indexOf(i),o=!1;if(-1===r&&y){var s=z(i);-1!==(r=t.indexOf(s))&&(o=!0)}if(-1!==r){var l=e.slice(0,r);(l.match(/</g)||[]).length===(l.match(/>/g)||[]).length&&a.push({highlight:i,start:r,end:r+i.length,badges:[],color:_||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var c=[],u={};a.forEach(function(n,e){for(var t=n.start,i=n.end,r=0,o=c;r<o.length;r++){var a=o[r],s=a.start,l=a.end,d=t<l&&i>l&&t>=s,h=t<s&&i>s&&i<=l;if(t>=s&&i<=l){n.orphaned=!0,u[e]=a.matchIdx;break}d&&(t=l),h&&(i=s)}n.trimmedStart=t,n.trimmedEnd=i,!n.orphaned&&t<i&&c.push({start:t,end:i,matchIdx:e})});var h={};Object.entries(u).forEach(function(n){var e=n[0],t=n[1],i=Number(e);h[t]||(h[t]=[]),h[t].push(i)});var g=a.map(function(e,t){return n.__assign(n.__assign({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,i;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(i=n.trimmedStart)&&void 0!==i?i:n.start)});return g.forEach(function(n){var t,i,r,l,d=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,c=null!==(i=n.trimmedEnd)&&void 0!==i?i:n.end;if(!(d>=c)){var u=e.slice(d,c),g=function(n,e,t,i){if(!t.length)return n;var r=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",d=0;return r.forEach(function(t){var r,a,c=Math.max(d,t.start-e),u=Math.max(c,t.end-e);if(!(c>=u)){var h=s.mixHexColors(i,t.color||"");l+=n.slice(d,c),l+=o(n.slice(c,u),(null===(a=null===(r=t.badges)||void 0===r?void 0:r[0])||void 0===a?void 0:a.id)||"",h,t.badges||[]),d=u}}),l+=n.slice(d)}(n.usedLooseMatch||d!==n.start||c!==n.end?u:n.highlight,n.start,h[n.idx]||[],n.color),p=o(g,(null===(l=null===(r=n.badges)||void 0===r?void 0:r[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,d)+p+e.slice(c)}}),e},[l,p,m,_,y]),T=i.useMemo(function(){return d?F(d||""):""},[d]),O=!!d,W={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},q=n.__assign(n.__assign(n.__assign(n.__assign({},c),W),{position:"relative",width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),O?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),I=n.__assign(n.__assign(n.__assign({},c),W),{position:"relative",width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return i.useLayoutEffect(function(){if(E.current){var n=function(){var n=Array.from(E.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),i=E.current.getBoundingClientRect(),r=i.bottom-4,o=i.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],i=[];e.forEach(function(n){if(0===i.length)i.push(n);else{var e=i[i.length-1],r=e.currentTop+e.height;n.naturalTop<r+8?(n.currentTop=r+8,i.push(n)):(t.push(i),i=[n])}}),i.length>0&&t.push(i),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>r){var i=t-r,a=n[0].currentTop-o,s=Math.max(0,Math.min(i,a));n.forEach(function(n){n.currentTop-=s})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(E.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[M,B,A]),e.jsxs(t.Box,n.__assign({ref:E,sx:{position:"relative",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",width:"100%",maxWidth:"100%",minWidth:0}},{children:[e.jsx(t.Typography,n.__assign({component:"div",sx:n.__assign(n.__assign({},q),{padding:"3px"})},{children:e.jsx(h.default,n.__assign({components:S,remarkPlugins:f,rehypePlugins:v},{children:M.replace(/#{3}/g,"")}))})),O&&e.jsx(t.Typography,n.__assign({component:"div",sx:I},{children:e.jsx(h.default,n.__assign({components:S,remarkPlugins:f,rehypePlugins:v},{children:T}))}))]}))},s.areMarkdownPropsEqual);exports.MemoizedMarkdown=x;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),t=require("@mui/material"),i=require("react"),r=require("../CognitiveCompareConstants.js"),o=require("lucide-react"),a=require("react-markdown"),s=require("../CognitiveComparehelpers.js"),l=require("rehype-raw"),d=require("remark-gfm");function c(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=c(i),h=c(a),g=c(l),p=function(n){return"function"==typeof n?n:(null==n?void 0:n.default)||n},f=[p(c(d).default)],v=[p(g.default)],x=u.default.memo(function(a){var l=a.content,d=a.overlayContent,c=a.sxStyles,g=a.deviationBadges,p=void 0===g?[]:g,x=a.highlights,m=void 0===x?[]:x;a.maintainRelativeOrder;var _=a.highlightBg,b=a.suppressHighlightBg,y=void 0!==b&&b,B=a.collisionKey,E=i.useRef(null),j=!!d,w=i.useMemo(function(){return p.reduce(function(e,t){var i;return n.__assign(n.__assign({},e),((i={})[t.id]=t,i))},{})},[p]),k=i.useRef({badgeMap:w,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y});k.current={badgeMap:w,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y};var C=function(e,t){return u.default.Children.map(e,function(e){var i;if(!u.default.isValidElement(e))return e;var r=(null===(i=e.props)||void 0===i?void 0:i.children)?C(e.props.children,t):e.props.children,o=u.default.cloneElement(e,n.__assign(n.__assign({},e.props),{children:r}));return t(o)})},S=i.useMemo(function(){return{mark:function(t){var i,r,o,a,s=t.children,l=n.__rest(t,["children"]),d=k.current,c=d.badgeMap,u=d.highlightBg,h=d.hideHighlightBg,g=d.suppressHighlightBg,p=l["data-badge-id"],f=p?c[p]:null,v=l["data-highlight-color"],x=null!==(a=null!==(r=null!=v?v:null===(i=null==f?void 0:f.style)||void 0===i?void 0:i.highlightBg)&&void 0!==r?r:null===(o=null==f?void 0:f.style)||void 0===o?void 0:o.badgeBg)&&void 0!==a?a:u,m="true"===l["data-is-suggested-deviation-fix"]||g;return e.jsx("span",n.__assign({style:n.__assign(n.__assign(n.__assign({},m?{}:{backgroundColor:x}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),h?{color:"transparent"}:{})},{children:s}))},span:function(i){var a,s,l,d,c,u,h=i.children,g=n.__rest(i,["children"]),p=k.current.badgeMap,f=g["data-badge-id"];if(!f)return e.jsx("span",n.__assign({},g,{children:h}));var v=p[f];if(!v)return e.jsx("span",n.__assign({},g,{children:h}));var x="number"==typeof v.stackIndex?v.stackIndex:0,m="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return e.jsxs(t.Box,n.__assign({component:"span",sx:{position:"static",display:"inline"}},{children:[e.jsxs(t.Box,n.__assign({ref:v.badgeRef,className:"deviation-badge","data-side":v.side||"right",sx:n.__assign(n.__assign({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=v.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(s=v.style)||void 0===s?void 0:s.badgeText)||r.DEFAULT_DEVIAION_COLOR,border:"1px solid ".concat((null===(l=v.style)||void 0===l?void 0:l.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===v.side?{right:"-16px",transform:"".concat(m," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(m," translateX(calc(-100% - 8px))")}),v.isConnected&&v.style&&{outline:"2px solid ".concat(v.style.badgeBorder),outlineOffset:"1px"})},{children:[e.jsxs(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onSummaryClick&&v.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:v.label})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=v.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=v.score&&"N/A"!==v.score&&"NA"!==v.score&&0!==v.score?"".concat(v.score):"N/A"===v.score||"NA"===v.score?"N/A":"Same"}))]})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onClick&&v.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(c=v.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:e.jsx(o.EllipsisVertical,{size:12,color:(null===(u=v.style)||void 0===u?void 0:u.badgeText)||"#3730A3"})}))]})),h]}))},table:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({sx:{display:"block",width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box",contain:"inline-size",overflowX:"auto",overflowY:"hidden",overscrollBehaviorX:"contain",WebkitOverflowScrolling:"touch",my:1}},{children:e.jsx(t.Box,n.__assign({component:"table",sx:{width:"600px",minWidth:"600px",tableLayout:"fixed",borderCollapse:"collapse",fontSize:"inherit"}},{children:r}))}))},thead:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({component:"thead"},{children:r}))},tbody:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({component:"tbody"},{children:r}))},tr:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:r}))},th:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",verticalAlign:"top",fontWeight:600,backgroundColor:"#F9FAFB",whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere"}},{children:r}))},td:function(i){var r=i.children;return e.jsx(t.Box,n.__assign({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top",whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere"}},{children:r}))},code:function(t){var i=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:i}))},pre:function(t){var i=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:i}))},updated:function(n){var t=n.children;return e.jsx(e.Fragment,{children:t})},deleted:function(t){var i=t.children,r=C(i,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:r}))},changed:function(t){var i=t.children,r=C(i,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:r}))},ul:function(i){var r=i.children,o=n.__rest(i,["children"]);return e.jsx(t.Box,n.__assign({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},o,{children:r}))},ol:function(i){var r=i.children,o=n.__rest(i,["children"]);return e.jsx(t.Box,n.__assign({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},o,{children:r}))},li:function(i){var r=i.children,o=n.__rest(i,["children"]);return e.jsx(t.Box,n.__assign({component:"li",sx:{mb:.5,display:"list-item"}},o,{children:r}))}}},[]),F=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,i){return"".concat(e," ").concat(i)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g," ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var i=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(i)?"\n":" "})}).join("")).trim()},M=i.useMemo(function(){return p.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[p]),T=i.useMemo(function(){var e=F(l||""),t=(p||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:F((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||_}}).filter(function(n){return n.id&&n.highlight}),i={};t.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var r=function(n,e,t,i){void 0===e&&(e=""),void 0===i&&(i=[]);var r=!1,o=function(n){var o=function(n,e,t){var i,r,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var s=null!==(i=a[1])&&void 0!==i?i:"",l=null!==(r=a[2])&&void 0!==r?r:"",d=null!==(o=a[3])&&void 0!==o?o:"";return l?s+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",i=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(i).concat(t,">")}(e,t)+l+"</mark>"+d:n}(n,e,t),a=o;if(!r&&i.length>0){r=!0;var s="",l="";i.forEach(function(n){s+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),l="</span>"+l}),a=s+o+l}return""+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},o=[];Object.entries(i).forEach(function(n){var t=n[0],i=n[1],r=s.findTextMatchRange(e,t,y);if(r){for(var a=e.slice(r.start,r.end)!==t,l=i[0].highlightColor,d=1;d<i.length;d++)l=s.mixHexColors(l,i[d].highlightColor||"");o.push({highlight:t,start:r.start,end:r.end,badges:i,color:l,usedLooseMatch:a})}});var a=new Set(Object.keys(i));(m||[]).forEach(function(n){if(n){var t=F(n);if(t&&!a.has(t)){var i=s.findTextMatchRange(e,t,y);if(i){var r=e.slice(i.start,i.end)!==t,l=e.slice(0,i.start);(l.match(/</g)||[]).length===(l.match(/>/g)||[]).length&&o.push({highlight:t,start:i.start,end:i.end,badges:[],color:_||"",usedLooseMatch:r})}}}}),o.sort(function(n,e){return n.start-e.start||e.end-n.end});var d=[],c={};o.forEach(function(n,e){for(var t=n.start,i=n.end,r=0,o=d;r<o.length;r++){var a=o[r],s=a.start,l=a.end,u=t<l&&i>l&&t>=s,h=t<s&&i>s&&i<=l;if(t>=s&&i<=l){n.orphaned=!0,c[e]=a.matchIdx;break}u&&(t=l),h&&(i=s)}n.trimmedStart=t,n.trimmedEnd=i,!n.orphaned&&t<i&&d.push({start:t,end:i,matchIdx:e})});var u={};Object.entries(c).forEach(function(n){var e=n[0],t=n[1],i=Number(e);u[t]||(u[t]=[]),u[t].push(i)});var h=o.map(function(e,t){return n.__assign(n.__assign({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,i;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(i=n.trimmedStart)&&void 0!==i?i:n.start)});return h.forEach(function(n){var t,i,a,l,d=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,c=null!==(i=n.trimmedEnd)&&void 0!==i?i:n.end;if(!(d>=c)){var h=e.slice(d,c),g=function(n,e,t,i){if(!t.length)return n;var a=t.map(function(n){return o[n]}).sort(function(n,e){return n.start-e.start}),l="",d=0;return a.forEach(function(t){var o,a,c=Math.max(d,t.start-e),u=Math.max(c,t.end-e);if(!(c>=u)){var h=s.mixHexColors(i,t.color||"");l+=n.slice(d,c),l+=r(n.slice(c,u),(null===(a=null===(o=t.badges)||void 0===o?void 0:o[0])||void 0===a?void 0:a.id)||"",h,t.badges||[]),d=u}}),l+=n.slice(d)}(n.usedLooseMatch||d!==n.start||c!==n.end?h:n.highlight,n.start,u[n.idx]||[],n.color),p=r(g,(null===(l=null===(a=n.badges)||void 0===a?void 0:a[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,d)+p+e.slice(c)}}),e},[l,p,m,_,y]),z=i.useMemo(function(){return d?F(d||""):""},[d]),A=!!d,W={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},q=n.__assign(n.__assign(n.__assign(n.__assign({},c),W),{position:"relative",width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),A?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),I=n.__assign(n.__assign(n.__assign({},c),W),{position:"relative",width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return i.useLayoutEffect(function(){if(E.current){var n=function(){var n=Array.from(E.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),i=E.current.getBoundingClientRect(),r=i.bottom-4,o=i.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],i=[];e.forEach(function(n){if(0===i.length)i.push(n);else{var e=i[i.length-1],r=e.currentTop+e.height;n.naturalTop<r+8?(n.currentTop=r+8,i.push(n)):(t.push(i),i=[n])}}),i.length>0&&t.push(i),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>r){var i=t-r,a=n[0].currentTop-o,s=Math.max(0,Math.min(i,a));n.forEach(function(n){n.currentTop-=s})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(E.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[T,B,M]),e.jsxs(t.Box,n.__assign({ref:E,sx:{position:"relative",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",width:"100%",maxWidth:"100%",minWidth:0}},{children:[e.jsx(t.Typography,n.__assign({component:"div",sx:n.__assign(n.__assign({},q),{padding:"3px"})},{children:e.jsx(h.default,n.__assign({components:S,remarkPlugins:f,rehypePlugins:v},{children:T.replace(/#{3}/g,"")}))})),A&&e.jsx(t.Typography,n.__assign({component:"div",sx:I},{children:e.jsx(h.default,n.__assign({components:S,remarkPlugins:f,rehypePlugins:v},{children:z}))}))]}))},s.areMarkdownPropsEqual);exports.MemoizedMarkdown=x;
|
|
2
2
|
//# sourceMappingURL=memoizedMarkdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react"),t=require("../CognitiveComparehelpers.js"),i=require("../utils/buildComparisonRows.js"),o={id:"",title:"",similarity:0,sections:[]};exports.useCognitiveTreeData=function(r,a,s,d,l,u){var v,c;void 0===l&&(l=!0);var f="string"==typeof s?s:JSON.stringify(s||{}),p=Boolean(u&&(u.learnings_data||(null===(c=null===(v=u.data)||void 0===v?void 0:v.artifactData)||void 0===c?void 0:c.userStorySnapshot))),_=e.useMemo(function(){if(!r||0===Object.keys(r).length)return{activeProposed:{},activeVariants:[],comparisonRows:[],parseError:"Tree data is required"};var e=JSON.parse(f);try{var o=r.nodes||r,s=[],d=[],v=[],c=r.base_root_id,_=r.input_index_map||{0:"left",1:"right"},I=r[c]||o[c];if(!I||!1===I.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[],comparisonRows:[],parseError:null};var g=r.content_mapping||{},h=function(n){return r[n]||o[n]},m=function(e,i,o){if(!e||"object"!=typeof e)return e||null;if(e.deviations)return e;if(l)return e;var r=Object.keys(e).filter(function(n){return/^\d+$/.test(n)});if(!r.length)return e;var a=r.sort(function(n,e){return Number(n)-Number(e)}),s={},d={},u=null;return a.forEach(function(n){var r,a,l,v,c,f,p=e[n];if(p&&"object"==typeof p){u||(u=p);var I=!(null==p?void 0:p.status)||"pending"===p.status,g=(null==p?void 0:p.deviation_highlight)||(null===(a=null==p?void 0:p.web_search_answer)||void 0===a?void 0:a.deviation_highlight),h=function(n){var e,t=(null===(e=null==p?void 0:p.cognitive_decisioning)||void 0===e?void 0:e.citations)||(null==p?void 0:p.citations)||{};return Object.values(t).map(function(e){var t;return null===(t=null==e?void 0:e[n])||void 0===t?void 0:t.highlighted_text}).filter(function(n){return"string"==typeof n&&n.trim().length>0})},m=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var i=0,o=n;i<o.length;i++){var r=o[i];if(Array.isArray(r)&&r.some(function(n){return!t.isMissingStr(n)}))return r}return[]},y=I?m((null===(l=null==p?void 0:p.deviation_highlights)||void 0===l?void 0:l[i])||(null===(v=null==p?void 0:p.deviation_highlights)||void 0===v?void 0:v[_[0]]),"string"==typeof g?[g]:[],h(i),h(_[0])):[],b=I?m((null===(c=null==p?void 0:p.deviation_highlights)||void 0===c?void 0:c[o])||(null===(f=null==p?void 0:p.deviation_highlights)||void 0===f?void 0:f[_[1]]),h(o),h(_[1])):[];s[n]=((r={})[_[0]]=y[0]||"",r[_[1]]=b[0]||"",r.deviation_summary=(null==p?void 0:p.deviation_summary)||"",r.deviation_title=null==p?void 0:p.deviation_title,r.deviation_impact=null==p?void 0:p.deviation_impact,r.deviation_explanation=null==p?void 0:p.deviation_explanation,r.evaluation_outputs=null==p?void 0:p.evaluation_outputs,r.cognitive_decisioning=null==p?void 0:p.cognitive_decisioning,r.deviation_highlights=null==p?void 0:p.deviation_highlights,r),d[n]=p}}),n.__assign(n.__assign({},e),{deviation_title:(null==u?void 0:u.deviation_title)||(null==e?void 0:e.deviation_title),deviation_impact:(null==u?void 0:u.deviation_impact)||(null==e?void 0:e.deviation_impact),deviation_summary:(null==u?void 0:u.deviation_summary)||(null==e?void 0:e.deviation_summary),deviation_explanation:(null==u?void 0:u.deviation_explanation)||(null==e?void 0:e.deviation_explanation),evaluation_outputs:(null==u?void 0:u.evaluation_outputs)||(null==e?void 0:e.evaluation_outputs),cognitive_decisioning:(null==u?void 0:u.cognitive_decisioning)||(null==e?void 0:e.cognitive_decisioning),deviations:s,deviation_entries:d})},y=function(n){var e=new Map,t=function(n){n.forEach(function(n){var i;n.id&&e.set(n.id,n),(null===(i=n.subsections)||void 0===i?void 0:i.length)&&t(n.subsections)})};t(n);var i=function(n,t){for(var o,r=[],a=function(n){var a=n.ref_parent_section_node_id;if(a&&e.has(a)&&a!==(null==t?void 0:t.id)){var s=e.get(a);s.subsections||(s.subsections=[]),s.subsections.some(function(e){return e.id===n.id})||s.subsections.push(n)}else(null===(o=n.subsections)||void 0===o?void 0:o.length)&&(n.subsections=i(n.subsections,n)),r.push(n)},s=0,d=n;s<d.length;s++){a(d[s])}return r},o=i(n),r=function(n){n.forEach(function(n){n.subsections&&n.subsections.length>0&&(n.subsections.sort(function(n,e){return n.selfIndex<0&&e.selfIndex>=0?1:n.selfIndex>=0&&e.selfIndex<0?-1:(n.selfIndex||0)-(e.selfIndex||0)}),r(n.subsections))})};return r(o),o},b=function(n){var e=n.comparison_inputs?Object.keys(n.comparison_inputs):[],t=_[0],i=_[1];return e.length>0&&(t=e.includes(_[0])?_[0]:e[0],i=e.includes(_[1])?_[1]:e.length>1?e[1]:e[0]),{nodeLeftId:t,nodeRightId:i}},x=function(e,i,o,r){var a=i.attributes||{},s=i.data||{},d=!1!==a.display_title,l=!1!==a.display_content,u=d?t.safeStringify(s.title||""):"",v=l?t.safeStringify(s.content||""):"",c=l?t.safeStringify(s.change_history||""):"",f=void 0!==a.display_index&&null!==a.display_index?Number(a.display_index):-1,p=function(n){return(null==n?void 0:n.entity_id)||(null==n?void 0:n.ref_parent_section_node_id)||(null==n?void 0:n.parent_entity_id)||null}(a),_=!(!u.trim()&&!v.trim());return n.__assign(n.__assign({id:"".concat(e,"::").concat(i.contentId),nodeId:e,contentId:i.contentId,parentContentId:p,title:u,content:v,change_history:c,displayTitle:d,displayContent:l,subsections:[]},_?r:{score:void 0,relation:"not_defined"}),{evaluationResult:o,evaluationResults:o?[o]:[],selfIndex:f,refIndexes:[],refContentIds:[],ref_parent_section_node_id:p})},R=function(e,t){e.refIndexes=Array.from(new Set(n.__spreadArray(n.__spreadArray([],e.refIndexes||[],!0),t.refIndexes||[],!0))),e.refContentIds=Array.from(new Set(n.__spreadArray(n.__spreadArray([],e.refContentIds||[],!0),t.refContentIds||[],!0)));var i=new Set((e.subsections||[]).map(function(n){return n.id||n.contentId||n.nodeId}));(t.subsections||[]).forEach(function(t){var o=t.id||t.contentId||t.nodeId;i.has(o)||(e.subsections=n.__spreadArray(n.__spreadArray([],e.subsections||[],!0),[t],!1),i.add(o))});var o=n.__spreadArray(n.__spreadArray([],e.evaluationResults||(e.evaluationResult?[e.evaluationResult]:[]),!0),t.evaluationResults||(t.evaluationResult?[t.evaluationResult]:[]),!0).filter(Boolean),r=new Set;return e.evaluationResults=o.filter(function(n){var e=(null==n?void 0:n.nodeId)||JSON.stringify(Object.keys((null==n?void 0:n.deviations)||n||{}));return!r.has(e)&&(r.add(e),!0)}),!e.evaluationResult&&t.evaluationResult&&(e.evaluationResult=t.evaluationResult),!e.cognitiveData&&t.cognitiveData&&(e.cognitiveData=t.cognitiveData),e},C=function(n,e){return n.selfIndex<0&&e.selfIndex>=0?1:n.selfIndex>=0&&e.selfIndex<0?-1:n.selfIndex-e.selfIndex},S=function(i,o){var r,a=h(i);if(!a||!1===a.display_node)return[];if(p&&"1"===o)return[];var s=b(a),d=s.nodeLeftId,l=s.nodeRightId,u=t.getRationale(a),v=(null===(r=null==e?void 0:e[i])||void 0===r?void 0:r.evaluation_result)||a.evaluation_result||null,c=m(v,d,l),f=c&&"object"==typeof c?n.__assign(n.__assign({},c),{nodeId:i}):c,I=t.resolveComparisonInputItems(a,o,_,g).map(function(n){return x(i,n,f,u)});if(a.next){var y=Object.values(a.next).flatMap(function(n){return S(n,o)});I.forEach(function(n){var e=y.filter(function(e){return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId});n.subsections=e.length?e:y})}return I};if(a){var E=function(i,o){var r;void 0===o&&(o=0);var a=[],s=[];if(!i)return{refSections:a,baseSections:s};var d={},l={},u=-1,v=-1,c=function(a){var s=i[a],c=h(s);if(!c||!1===c.display_node)return"continue";var f=b(c),I=f.nodeLeftId,y=f.nodeRightId,C=t.getRationale(c),S=(null===(r=null==e?void 0:e[s])||void 0===r?void 0:r.evaluation_result)||c.evaluation_result||null,O=m(S,I,y),j=O&&"object"==typeof O?n.__assign(n.__assign({},O),{nodeId:s}):O,N=E(c.next,o+1),w=N.refSections,A=N.baseSections,D=t.resolveComparisonInputItems(c,"0",_,g).map(function(n){var e=x(s,n,j,C);return-1===e.selfIndex&&(e.selfIndex=v--),e}),k=[];if(!p){var M=t.resolveComparisonInputItems(c,"1",_,g);k=M.map(function(n){var e=x(s,n,j,C);return-1===e.selfIndex&&(e.selfIndex=u--),e})}D.forEach(function(n){k.forEach(function(e){var t,i,o,r,a,s,d,l;Number(e.selfIndex)>=0&&Number(n.selfIndex)>=0&&((null===(t=e.refIndexes)||void 0===t?void 0:t.includes(Number(n.selfIndex)))||null===(i=e.refIndexes)||void 0===i||i.push(Number(n.selfIndex)),(null===(o=n.refIndexes)||void 0===o?void 0:o.includes(Number(e.selfIndex)))||null===(r=n.refIndexes)||void 0===r||r.push(Number(e.selfIndex))),n.contentId&&!(null===(a=e.refContentIds)||void 0===a?void 0:a.includes(n.contentId))&&(null===(s=e.refContentIds)||void 0===s||s.push(n.contentId)),e.contentId&&!(null===(d=n.refContentIds)||void 0===d?void 0:d.includes(e.contentId))&&(null===(l=n.refContentIds)||void 0===l||l.push(e.contentId))})}),k.forEach(function(n){var e=w.filter(function(e){var t;return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId||(null===(t=n.refContentIds)||void 0===t?void 0:t.includes(e.parentContentId))});e.length>0&&(n.subsections=e);var t=0===o?String(n.selfIndex):"".concat(n.selfIndex,"_").concat(n.contentId||s);d[t]=d[t]?R(d[t],n):n}),D.forEach(function(n){var e=A.filter(function(e){var t;return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId||(null===(t=n.refContentIds)||void 0===t?void 0:t.includes(e.parentContentId))});e.length>0&&(n.subsections=e);var t=0===o?String(n.selfIndex):"".concat(n.selfIndex,"_").concat(n.contentId||s);l[t]=l[t]?R(l[t],n):n})};for(var f in i)c(f);return a=Object.values(d),s=Object.values(l),a.sort(C),s.sort(C),{refSections:a,baseSections:s}},O=E(I.next),j=O.refSections,N=O.baseSections;p||(d=y(j)),s=N}else I.next&&Object.values(I.next).forEach(function(n){var e=h(n);if(e&&!1!==e.display_node){var t=S(n,"0");if(p)s.push.apply(s,t);else{var o=y(S(n,"1"));v.push.apply(v,i.buildComparisonRows(n,t,o))}}}),p||(s=v.map(function(n){return n.left}),d=v.map(function(n){return n.right}));var w=t.getSideData(I,"0",_,g),A=t.getSideData(I,"1",_,g),D={title:w.title||"Uploaded Contract",description:I.decision_scope_description||"",sections:s},k={id:"tree-variant-1",title:p?function(){var n,e;if((null==u?void 0:u.learnings_data)&&Object.keys(u.learnings_data).length>0){var t=Object.keys(u.learnings_data)[0];return(null===(n=u.learnings_data[t])||void 0===n?void 0:n.title)||"Rulebook Guidelines"}return(null===(e=null==u?void 0:u.data)||void 0===e?void 0:e.artifactTitle)||"Rulebook Guidelines"}():A.title||"Reference Template",similarity:0,sections:d,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:I.decision_scope_description||""},fields:{}}}};return{activeProposed:D,activeVariants:[k],comparisonRows:v,parseError:null}}catch(n){return console.error("Data Transformation Error: ",n),{activeProposed:{},activeVariants:[],comparisonRows:[],parseError:n instanceof Error?n.message:"Unknown Parsing Error"}}},[r,a,f,l,u]),I=_.activeProposed,g=_.activeVariants,h=_.comparisonRows,m=_.parseError,y=(null==g?void 0:g[0])||o,b=e.useMemo(function(){return(null==I?void 0:I.sections)||[]},[null==I?void 0:I.sections]),x=e.useMemo(function(){return y.sections||[]},[y.sections]),R=b.length>0||x.length>0,C=e.useMemo(function(){return d.fields.filter(function(n){var e=n.key;return(!R||"description"!==e)&&(t.hasValue(null==I?void 0:I[e])||t.hasValue(y[e]))})},[I,y,R,d.fields]),S=e.useMemo(function(){var n,e,i={},o={},s={},d=0,l=null===(n=null==r?void 0:r.input_index_map)||void 0===n?void 0:n[0],u=null===(e=null==r?void 0:r.input_index_map)||void 0===e?void 0:e[1],v=function(n,e){if(!a){var t="left"===e?b.indexOf(n):x.indexOf(n);return{rootKey:"".concat(e,":").concat(t),parentNum:t+1}}if("left"===e){var i=n.selfIndex,o=void 0!==i&&i>=0?i+1:b.indexOf(n)+1;return{rootKey:"left-root:".concat(n.id),parentNum:o}}var r=n.selfIndex,s=b.find(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(r)});if(s){var d=s.selfIndex,l=void 0!==d&&d>=0?d+1:b.indexOf(s)+1;return{rootKey:"left-root:".concat(s.id),parentNum:l}}var u=void 0!==r&&r>=0?r+1:x.indexOf(n)+1;return{rootKey:"right-orphan-root:".concat(n.id),parentNum:u}},c=function(n,e){if(n&&e)return n.find(function(n){return n.id===e.id||n.nodeId&&n.nodeId===e.nodeId||n.contentId&&n.contentId===e.contentId})||void 0},f=function(n,e,r,a,v,p,_){if(e&&function(n,e,i){var r;((null===(r=null==n?void 0:n.evaluationResults)||void 0===r?void 0:r.length)?n.evaluationResults:(null==n?void 0:n.evaluationResult)?[n.evaluationResult]:[]).forEach(function(r){var a=(null==r?void 0:r.deviations)||{};Object.keys(a).sort().forEach(function(d){var v=a[d];if(v){var c=!t.isMissingStr(v[l]),f=!t.isMissingStr(v[u]);if(c||f){var p=(null==r?void 0:r.nodeId)||n.nodeId||n.id,_="".concat(p).concat(t.DEVIATION_BADGE_SEPARATOR).concat(d);void 0===o[_]&&(void 0===s[e]&&(s[e]=1),o[_]={index:s[e]++,rootKey:e,parentNum:i})}}})})}(e,a,v),e&&!p){var I=(null==_?void 0:_.id)||"fallback_parent_".concat(d++);i[I]||(i[I]=[]),i[I].push(e)}((null==e?void 0:e.subsections)||(null==n?void 0:n.subsections)||(null==r?void 0:r.subsections)||[]).forEach(function(t){var i=c(null==n?void 0:n.subsections,t),o=c(null==r?void 0:r.subsections,t);f(t,i,o,a,v,!1,e||_)})};b.forEach(function(n){var e,t=v(n,"left"),i=t.rootKey,o=t.parentNum,r=null;if(a){var s=null===(e=n.refIndexes)||void 0===e?void 0:e[0];r=x.find(function(n){return n.selfIndex===s})}else r=x[b.indexOf(n)];f(n,n,r,i,o,!0,n)}),p||x.forEach(function(n){var e=v(n,"right"),t=e.rootKey,i=e.parentNum;t.startsWith("right-orphan-root:")&&f(n,null,n,t,i,!0,n)});var _=Object.fromEntries(Object.entries(o).map(function(n){return[n[0],n[1].index]})),I=Object.fromEntries(Object.entries(o).map(function(n){return[n[0],n[1].parentNum]}));return{parentDeviationRecord:i,registry:_,deviationParentRegistry:I}},[b,x,a,r,p]),E=S.parentDeviationRecord,O=S.registry,j=S.deviationParentRegistry;return{isGuidelineMode:p,activeProposed:I,activeVariants:g,comparisonRows:h,existingRule:y,proposedSections:b,existingSections:x,visibleFields:C,parentDeviationRecord:E,deviationNumberRegistry:O,deviationParentRegistry:j,parseError:m}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react"),t=require("../CognitiveComparehelpers.js"),i=require("../utils/buildComparisonRows.js"),o={id:"",title:"",similarity:0,sections:[]};exports.useCognitiveTreeData=function(r,a,s,l,d,u){var v,c;void 0===d&&(d=!0);var f="string"==typeof s?s:JSON.stringify(s||{}),p=Boolean(u&&(u.learnings_data||(null===(c=null===(v=u.data)||void 0===v?void 0:v.artifactData)||void 0===c?void 0:c.userStorySnapshot))),_=e.useMemo(function(){if(!r||0===Object.keys(r).length)return{activeProposed:{},activeVariants:[],comparisonRows:[],parseError:"Tree data is required"};var e=JSON.parse(f);try{var o=r.nodes||r,s=[],l=[],v=[],c=r.base_root_id,_=r.input_index_map||{0:"left",1:"right"},I=r[c]||o[c];if(!I||!1===I.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[],comparisonRows:[],parseError:null};var g=r.content_mapping||{},h=function(n){return r[n]||o[n]},m=function(e,i,o){if(!e||"object"!=typeof e)return e||null;if(e.deviations)return e;if(d)return e;var r=Object.keys(e).filter(function(n){return/^\d+$/.test(n)});if(!r.length)return e;var a=r.sort(function(n,e){return Number(n)-Number(e)}),s={},l={},u=null;return a.forEach(function(n){var r,a,d,v,c,f,p,I=e[n];if(I&&"object"==typeof I){u||(u=I);var g="same"===t.safeStringify(null===(a=null==I?void 0:I.evaluation_outputs)||void 0===a?void 0:a.output_value).trim().toLowerCase(),h=!((null==I?void 0:I.status)&&"pending"!==I.status||g),m=(null==I?void 0:I.deviation_highlight)||(null===(d=null==I?void 0:I.web_search_answer)||void 0===d?void 0:d.deviation_highlight),y=function(n){var e,t=(null===(e=null==I?void 0:I.cognitive_decisioning)||void 0===e?void 0:e.citations)||(null==I?void 0:I.citations)||{};return Object.values(t).map(function(e){var t;return null===(t=null==e?void 0:e[n])||void 0===t?void 0:t.highlighted_text}).filter(function(n){return"string"==typeof n&&n.trim().length>0})},b=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var i=0,o=n;i<o.length;i++){var r=o[i];if(Array.isArray(r)&&r.some(function(n){return!t.isMissingStr(n)}))return r}return[]},x=h?b((null===(v=null==I?void 0:I.deviation_highlights)||void 0===v?void 0:v[i])||(null===(c=null==I?void 0:I.deviation_highlights)||void 0===c?void 0:c[_[0]]),"string"==typeof m?[m]:[],y(i),y(_[0])):[],R=h?b((null===(f=null==I?void 0:I.deviation_highlights)||void 0===f?void 0:f[o])||(null===(p=null==I?void 0:I.deviation_highlights)||void 0===p?void 0:p[_[1]]),y(o),y(_[1])):[];s[n]=((r={})[_[0]]=x[0]||"",r[_[1]]=R[0]||"",r.deviation_summary=(null==I?void 0:I.deviation_summary)||"",r.deviation_title=null==I?void 0:I.deviation_title,r.deviation_impact=null==I?void 0:I.deviation_impact,r.deviation_explanation=null==I?void 0:I.deviation_explanation,r.evaluation_outputs=null==I?void 0:I.evaluation_outputs,r.cognitive_decisioning=null==I?void 0:I.cognitive_decisioning,r.deviation_highlights=null==I?void 0:I.deviation_highlights,r),l[n]=I}}),n.__assign(n.__assign({},e),{deviation_title:(null==u?void 0:u.deviation_title)||(null==e?void 0:e.deviation_title),deviation_impact:(null==u?void 0:u.deviation_impact)||(null==e?void 0:e.deviation_impact),deviation_summary:(null==u?void 0:u.deviation_summary)||(null==e?void 0:e.deviation_summary),deviation_explanation:(null==u?void 0:u.deviation_explanation)||(null==e?void 0:e.deviation_explanation),evaluation_outputs:(null==u?void 0:u.evaluation_outputs)||(null==e?void 0:e.evaluation_outputs),cognitive_decisioning:(null==u?void 0:u.cognitive_decisioning)||(null==e?void 0:e.cognitive_decisioning),deviations:s,deviation_entries:l})},y=function(n){var e=new Map,t=function(n){n.forEach(function(n){var i;n.id&&e.set(n.id,n),(null===(i=n.subsections)||void 0===i?void 0:i.length)&&t(n.subsections)})};t(n);var i=function(n,t){for(var o,r=[],a=function(n){var a=n.ref_parent_section_node_id;if(a&&e.has(a)&&a!==(null==t?void 0:t.id)){var s=e.get(a);s.subsections||(s.subsections=[]),s.subsections.some(function(e){return e.id===n.id})||s.subsections.push(n)}else(null===(o=n.subsections)||void 0===o?void 0:o.length)&&(n.subsections=i(n.subsections,n)),r.push(n)},s=0,l=n;s<l.length;s++){a(l[s])}return r},o=i(n),r=function(n){n.forEach(function(n){n.subsections&&n.subsections.length>0&&(n.subsections.sort(function(n,e){return n.selfIndex<0&&e.selfIndex>=0?1:n.selfIndex>=0&&e.selfIndex<0?-1:(n.selfIndex||0)-(e.selfIndex||0)}),r(n.subsections))})};return r(o),o},b=function(n){var e=n.comparison_inputs?Object.keys(n.comparison_inputs):[],t=_[0],i=_[1];return e.length>0&&(t=e.includes(_[0])?_[0]:e[0],i=e.includes(_[1])?_[1]:e.length>1?e[1]:e[0]),{nodeLeftId:t,nodeRightId:i}},x=function(e,i,o,r){var a=i.attributes||{},s=i.data||{},l=!1!==a.display_title,d=!1!==a.display_content,u=l?t.safeStringify(s.title||""):"",v=d?t.safeStringify(s.content||""):"",c=d?t.safeStringify(s.change_history||""):"",f=void 0!==a.display_index&&null!==a.display_index?Number(a.display_index):-1,p=function(n){return(null==n?void 0:n.entity_id)||(null==n?void 0:n.ref_parent_section_node_id)||(null==n?void 0:n.parent_entity_id)||null}(a),_=!(!u.trim()&&!v.trim());return n.__assign(n.__assign({id:"".concat(e,"::").concat(i.contentId),nodeId:e,contentId:i.contentId,parentContentId:p,title:u,content:v,change_history:c,displayTitle:l,displayContent:d,subsections:[]},_?r:{score:void 0,relation:"not_defined"}),{evaluationResult:o,evaluationResults:o?[o]:[],selfIndex:f,refIndexes:[],refContentIds:[],ref_parent_section_node_id:p})},R=function(e,t){e.refIndexes=Array.from(new Set(n.__spreadArray(n.__spreadArray([],e.refIndexes||[],!0),t.refIndexes||[],!0))),e.refContentIds=Array.from(new Set(n.__spreadArray(n.__spreadArray([],e.refContentIds||[],!0),t.refContentIds||[],!0)));var i=new Set((e.subsections||[]).map(function(n){return n.id||n.contentId||n.nodeId}));(t.subsections||[]).forEach(function(t){var o=t.id||t.contentId||t.nodeId;i.has(o)||(e.subsections=n.__spreadArray(n.__spreadArray([],e.subsections||[],!0),[t],!1),i.add(o))});var o=n.__spreadArray(n.__spreadArray([],e.evaluationResults||(e.evaluationResult?[e.evaluationResult]:[]),!0),t.evaluationResults||(t.evaluationResult?[t.evaluationResult]:[]),!0).filter(Boolean),r=new Set;return e.evaluationResults=o.filter(function(n){var e=(null==n?void 0:n.nodeId)||JSON.stringify(Object.keys((null==n?void 0:n.deviations)||n||{}));return!r.has(e)&&(r.add(e),!0)}),!e.evaluationResult&&t.evaluationResult&&(e.evaluationResult=t.evaluationResult),!e.cognitiveData&&t.cognitiveData&&(e.cognitiveData=t.cognitiveData),e},C=function(n,e){return n.selfIndex<0&&e.selfIndex>=0?1:n.selfIndex>=0&&e.selfIndex<0?-1:n.selfIndex-e.selfIndex},S=function(i,o){var r,a=h(i);if(!a||!1===a.display_node)return[];if(p&&"1"===o)return[];var s=b(a),l=s.nodeLeftId,d=s.nodeRightId,u=t.getRationale(a),v=(null===(r=null==e?void 0:e[i])||void 0===r?void 0:r.evaluation_result)||a.evaluation_result||null,c=m(v,l,d),f=c&&"object"==typeof c?n.__assign(n.__assign({},c),{nodeId:i}):c,I=t.resolveComparisonInputItems(a,o,_,g).map(function(n){return x(i,n,f,u)});if(a.next){var y=Object.values(a.next).flatMap(function(n){return S(n,o)});I.forEach(function(n){var e=y.filter(function(e){return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId});n.subsections=e.length?e:y})}return I};if(a){var E=function(i,o){var r;void 0===o&&(o=0);var a=[],s=[];if(!i)return{refSections:a,baseSections:s};var l={},d={},u=-1,v=-1,c=function(a){var s=i[a],c=h(s);if(!c||!1===c.display_node)return"continue";var f=b(c),I=f.nodeLeftId,y=f.nodeRightId,C=t.getRationale(c),S=(null===(r=null==e?void 0:e[s])||void 0===r?void 0:r.evaluation_result)||c.evaluation_result||null,O=m(S,I,y),j=O&&"object"==typeof O?n.__assign(n.__assign({},O),{nodeId:s}):O,N=E(c.next,o+1),w=N.refSections,A=N.baseSections,D=t.resolveComparisonInputItems(c,"0",_,g).map(function(n){var e=x(s,n,j,C);return-1===e.selfIndex&&(e.selfIndex=v--),e}),k=[];if(!p){var M=t.resolveComparisonInputItems(c,"1",_,g);k=M.map(function(n){var e=x(s,n,j,C);return-1===e.selfIndex&&(e.selfIndex=u--),e})}D.forEach(function(n){k.forEach(function(e){var t,i,o,r,a,s,l,d;Number(e.selfIndex)>=0&&Number(n.selfIndex)>=0&&((null===(t=e.refIndexes)||void 0===t?void 0:t.includes(Number(n.selfIndex)))||null===(i=e.refIndexes)||void 0===i||i.push(Number(n.selfIndex)),(null===(o=n.refIndexes)||void 0===o?void 0:o.includes(Number(e.selfIndex)))||null===(r=n.refIndexes)||void 0===r||r.push(Number(e.selfIndex))),n.contentId&&!(null===(a=e.refContentIds)||void 0===a?void 0:a.includes(n.contentId))&&(null===(s=e.refContentIds)||void 0===s||s.push(n.contentId)),e.contentId&&!(null===(l=n.refContentIds)||void 0===l?void 0:l.includes(e.contentId))&&(null===(d=n.refContentIds)||void 0===d||d.push(e.contentId))})}),k.forEach(function(n){var e=w.filter(function(e){var t;return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId||(null===(t=n.refContentIds)||void 0===t?void 0:t.includes(e.parentContentId))});e.length>0&&(n.subsections=e);var t=0===o?String(n.selfIndex):"".concat(n.selfIndex,"_").concat(n.contentId||s);l[t]=l[t]?R(l[t],n):n}),D.forEach(function(n){var e=A.filter(function(e){var t;return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId||(null===(t=n.refContentIds)||void 0===t?void 0:t.includes(e.parentContentId))});e.length>0&&(n.subsections=e);var t=0===o?String(n.selfIndex):"".concat(n.selfIndex,"_").concat(n.contentId||s);d[t]=d[t]?R(d[t],n):n})};for(var f in i)c(f);return a=Object.values(l),s=Object.values(d),a.sort(C),s.sort(C),{refSections:a,baseSections:s}},O=E(I.next),j=O.refSections,N=O.baseSections;p||(l=y(j)),s=N}else I.next&&Object.values(I.next).forEach(function(n){var e=h(n);if(e&&!1!==e.display_node){var t=S(n,"0");if(p)s.push.apply(s,t);else{var o=y(S(n,"1"));v.push.apply(v,i.buildComparisonRows(n,t,o))}}}),p||(s=v.map(function(n){return n.left}),l=v.map(function(n){return n.right}));var w=t.getSideData(I,"0",_,g),A=t.getSideData(I,"1",_,g),D={title:w.title||"Uploaded Contract",description:I.decision_scope_description||"",sections:s},k={id:"tree-variant-1",title:p?function(){var n,e;if((null==u?void 0:u.learnings_data)&&Object.keys(u.learnings_data).length>0){var t=Object.keys(u.learnings_data)[0];return(null===(n=u.learnings_data[t])||void 0===n?void 0:n.title)||"Rulebook Guidelines"}return(null===(e=null==u?void 0:u.data)||void 0===e?void 0:e.artifactTitle)||"Rulebook Guidelines"}():A.title||"Reference Template",similarity:0,sections:l,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:I.decision_scope_description||""},fields:{}}}};return{activeProposed:D,activeVariants:[k],comparisonRows:v,parseError:null}}catch(n){return console.error("Data Transformation Error: ",n),{activeProposed:{},activeVariants:[],comparisonRows:[],parseError:n instanceof Error?n.message:"Unknown Parsing Error"}}},[r,a,f,d,u]),I=_.activeProposed,g=_.activeVariants,h=_.comparisonRows,m=_.parseError,y=(null==g?void 0:g[0])||o,b=e.useMemo(function(){return(null==I?void 0:I.sections)||[]},[null==I?void 0:I.sections]),x=e.useMemo(function(){return y.sections||[]},[y.sections]),R=b.length>0||x.length>0,C=e.useMemo(function(){return l.fields.filter(function(n){var e=n.key;return(!R||"description"!==e)&&(t.hasValue(null==I?void 0:I[e])||t.hasValue(y[e]))})},[I,y,R,l.fields]),S=e.useMemo(function(){var n,e,i={},o={},s={},l=0,d=null===(n=null==r?void 0:r.input_index_map)||void 0===n?void 0:n[0],u=null===(e=null==r?void 0:r.input_index_map)||void 0===e?void 0:e[1],v=function(n,e){if(!a){var t="left"===e?b.indexOf(n):x.indexOf(n);return{rootKey:"".concat(e,":").concat(t),parentNum:t+1}}if("left"===e){var i=n.selfIndex,o=void 0!==i&&i>=0?i+1:b.indexOf(n)+1;return{rootKey:"left-root:".concat(n.id),parentNum:o}}var r=n.selfIndex,s=b.find(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(r)});if(s){var l=s.selfIndex,d=void 0!==l&&l>=0?l+1:b.indexOf(s)+1;return{rootKey:"left-root:".concat(s.id),parentNum:d}}var u=void 0!==r&&r>=0?r+1:x.indexOf(n)+1;return{rootKey:"right-orphan-root:".concat(n.id),parentNum:u}},c=function(n,e){if(n&&e)return n.find(function(n){return n.id===e.id||n.nodeId&&n.nodeId===e.nodeId||n.contentId&&n.contentId===e.contentId})||void 0},f=function(n,e,r,a,v,p,_){if(e&&function(n,e,i){var r;((null===(r=null==n?void 0:n.evaluationResults)||void 0===r?void 0:r.length)?n.evaluationResults:(null==n?void 0:n.evaluationResult)?[n.evaluationResult]:[]).forEach(function(r){var a=(null==r?void 0:r.deviations)||{};Object.keys(a).sort().forEach(function(l){var v=a[l];if(v){var c=!t.isMissingStr(v[d]),f=!t.isMissingStr(v[u]);if(c||f){var p=(null==r?void 0:r.nodeId)||n.nodeId||n.id,_="".concat(p).concat(t.DEVIATION_BADGE_SEPARATOR).concat(l);void 0===o[_]&&(void 0===s[e]&&(s[e]=1),o[_]={index:s[e]++,rootKey:e,parentNum:i})}}})})}(e,a,v),e&&!p){var I=(null==_?void 0:_.id)||"fallback_parent_".concat(l++);i[I]||(i[I]=[]),i[I].push(e)}((null==e?void 0:e.subsections)||(null==n?void 0:n.subsections)||(null==r?void 0:r.subsections)||[]).forEach(function(t){var i=c(null==n?void 0:n.subsections,t),o=c(null==r?void 0:r.subsections,t);f(t,i,o,a,v,!1,e||_)})};b.forEach(function(n){var e,t=v(n,"left"),i=t.rootKey,o=t.parentNum,r=null;if(a){var s=null===(e=n.refIndexes)||void 0===e?void 0:e[0];r=x.find(function(n){return n.selfIndex===s})}else r=x[b.indexOf(n)];f(n,n,r,i,o,!0,n)}),p||x.forEach(function(n){var e=v(n,"right"),t=e.rootKey,i=e.parentNum;t.startsWith("right-orphan-root:")&&f(n,null,n,t,i,!0,n)});var _=Object.fromEntries(Object.entries(o).map(function(n){return[n[0],n[1].index]})),I=Object.fromEntries(Object.entries(o).map(function(n){return[n[0],n[1].parentNum]}));return{parentDeviationRecord:i,registry:_,deviationParentRegistry:I}},[b,x,a,r,p]),E=S.parentDeviationRecord,O=S.registry,j=S.deviationParentRegistry;return{isGuidelineMode:p,activeProposed:I,activeVariants:g,comparisonRows:h,existingRule:y,proposedSections:b,existingSections:x,visibleFields:C,parentDeviationRecord:E,deviationNumberRegistry:O,deviationParentRegistry:j,parseError:m}};
|
|
2
2
|
//# sourceMappingURL=useCompareData.js.map
|
package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),i=require("react"),l=require("lucide-react"),t=require("./CognitiveNonWebSearchReasoning.module.css.js"),s=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},a=function(i){return i.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(i,l){return i.startsWith("**")&&i.endsWith("**")||i.startsWith("__")&&i.endsWith("__")?e.jsx("strong",n.__assign({className:t.default.boldText},{children:i.slice(2,-2)}),l):i})};exports.default=function(o){var d=o.item,r=o.headerTitle;o.index;var u=o.iconsConfig,c=o.DocumentTitle,v=o.previewCallback,g=o.bodyHeight,h=o.disableMaximize,m=void 0!==h&&h,_=o.splitterCustomStyle,f=void 0!==_&&_,x=o.themeTokens,p=o.classNames,j=o.styles,y=d.dataSource,b=d.confidence_score,C=d.trainingDataTitle,N=null==u?void 0:u.ChevronDownIcon,I=null==u?void 0:u.ChevronUpIcon,k=null==u?void 0:u.MaximizeIcon,T=null==u?void 0:u.CloseIcon,H=i.useMemo(function(){var e=(y?y.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):"").split(/(<highlight>[\s\S]*?<\/highlight>)/g),i=0,l=e.map(function(n){var e=n.startsWith("<highlight>"),l={text:e?n.replace(/<\/?highlight>/g,""):n,isHighlight:e,highlightIndex:e?i:-1};return e&&i++,l}),t=l.filter(function(n){return n.isHighlight}).length,s=[],a=[];return l.forEach(function(e){var i=e.text,l=e.isHighlight,t=e.highlightIndex;i.split("\n").forEach(function(e,i){i>0&&((a.length>0||s.length>0)&&s.push(n.__spreadArray([],a,!0)),a=[]),e&&a.push({text:e,isHighlight:l,highlightIndex:t})})}),a.length>0&&s.push(n.__spreadArray([],a,!0)),{processedLines:s.map(function(n){var e=n.map(function(n){return n.text}).join(""),i=e.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/);return{segments:n,isListItem:!!i,isHeader:!!e.match(/^(Title|Description|Training-basis):\s*(.*)$/i),indent:(null==i?void 0:i[1])||"",content:(null==i?void 0:i[3])||e}}),totalHighlights:t}},[y]),L=H.processedLines,w=H.totalHighlights,B=i.useState(0),S=B[0],z=B[1],A=i.useRef(null),F=i.useRef(null),R=i.useRef(null),D=i.useRef([]),E=i.useRef([]);i.useEffect(function(){D.current=D.current.slice(0,w),E.current=E.current.slice(0,w)},[w]),i.useEffect(function(){if(w>0){z(0);var n=setTimeout(function(){var n;null===(n=D.current[0])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50);return function(){return clearTimeout(n)}}},[w]);var W=function(n,e){setTimeout(function(){var i=e?E.current[n]:D.current[n];null==i||i.scrollIntoView({behavior:"smooth",block:"center"})},50)},q=function(n){if(void 0===n&&(n=!1),w){var e=S>0?S-1:w-1;z(e),W(e,n)}},M=function(n){if(void 0===n&&(n=!1),w){var e=S<w-1?S+1:0;z(e),W(e,n)}},U=function(i){var l=i?E:D,o=0;return L.map(function(i,d){i.isHeader&&(o=0),i.isListItem&&(o+=1);var r=function(){return i.segments.map(function(o,d){var r=o.isHighlight&&o.highlightIndex===S,u=o.text;return i.isListItem&&0===d&&(u=o.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),o.isHighlight?e.jsx("span",n.__assign({ref:function(n){n&&(l.current[o.highlightIndex]=n)},className:s(t.default.highlight,r?t.default.highlightActive:void 0,null==p?void 0:p.highlight,r?null==p?void 0:p.highlightActive:void 0),style:r?n.__assign(n.__assign({},null==j?void 0:j.highlight),null==j?void 0:j.highlightActive):null==j?void 0:j.highlight},{children:a(u)}),d):e.jsx("span",{children:a(u)},d)})};return i.isHeader?e.jsx("span",n.__assign({className:s(t.default.headerLine,null==p?void 0:p.headerLine),style:null==j?void 0:j.headerLine},{children:r()}),d):i.isListItem?e.jsxs("span",n.__assign({className:s(t.default.listItemLine,null==p?void 0:p.listItemLine),style:n.__assign({paddingLeft:i.indent?"1rem":"0"},null==j?void 0:j.listItemLine)},{children:[e.jsxs("span",n.__assign({className:s(t.default.listCounter,null==p?void 0:p.listCounter),style:null==j?void 0:j.listCounter},{children:[o,"."]})),e.jsx("span",{children:r()})]}),d):e.jsx("span",n.__assign({className:s(t.default.blockLine,null==p?void 0:p.blockLine),style:null==j?void 0:j.blockLine},{children:r()}),d)})},V=function(i){return w>1?e.jsxs("div",n.__assign({className:s(i?t.default.modalNavContainer:t.default.navigationContainer,i?null==p?void 0:p.modalNavContainer:null==p?void 0:p.navigationContainer),style:i?null==j?void 0:j.modalNavContainer:null==j?void 0:j.navigationContainer},{children:[I&&e.jsx("button",n.__assign({onClick:function(){return q(i)},className:s(i?t.default.modalNavButton:t.default.navButton,null==p?void 0:p.navButton),style:null==j?void 0:j.navButton},{children:e.jsx(I,{className:s(t.default.navIcon,null==p?void 0:p.navIcon),style:null==j?void 0:j.navIcon})})),e.jsxs("span",n.__assign({className:s(t.default.navCounter,null==p?void 0:p.navCounter),style:null==j?void 0:j.navCounter},{children:[S+1,"/",w]})),N&&e.jsx("button",n.__assign({onClick:function(){return M(i)},className:s(i?t.default.modalNavButton:t.default.navButton,null==p?void 0:p.navButton),style:null==j?void 0:j.navButton},{children:e.jsx(N,{className:s(t.default.navIcon,null==p?void 0:p.navIcon),style:null==j?void 0:j.navIcon})}))]})):null},$=null!=b?e.jsxs("span",n.__assign({className:s(t.default.confidenceBadge,null==p?void 0:p.confidenceBadge),style:null==j?void 0:j.confidenceBadge},{children:[e.jsx("span",n.__assign({className:t.default.confidenceStar},{children:"✦"})),e.jsxs("span",n.__assign({className:t.default.confidenceScore},{children:[b,"%"]}))]})):null,O=f?{backgroundColor:"white",padding:"1rem 1.5rem"}:void 0,P=e.jsxs(e.Fragment,{children:[C&&e.jsx("div",n.__assign({className:s(t.default.footer,null==p?void 0:p.footer),style:n.__assign(n.__assign({},O),null==j?void 0:j.footer)},{children:e.jsx("span",n.__assign({className:s(t.default.trainingTitle,null==p?void 0:p.trainingTitle),style:null==j?void 0:j.trainingTitle},{children:C}))})),c&&e.jsx("div",n.__assign({className:s(t.default.modalFooterSource,null==p?void 0:p.modalFooterSource),style:n.__assign(n.__assign({},O),null==j?void 0:j.modalFooterSource)},{children:e.jsxs("button",n.__assign({type:"button",onClick:function(){return null==v?void 0:v()},className:s(t.default.trainingTitleLink,null==p?void 0:p.trainingTitleLink),style:null==j?void 0:j.trainingTitleLink},{children:[c,e.jsx(l.ExternalLink,{size:16,color:"#2563eb"})]}))}))]});return e.jsxs(e.Fragment,{children:[e.jsxs("div",n.__assign({className:s(t.default.expandedContainer,null==p?void 0:p.expandedContainer),style:n.__assign(n.__assign(n.__assign(n.__assign({},x),g?{height:"".concat(g),display:"flex",flexDirection:"column"}:void 0),f?{border:"none",borderRadius:0,marginLeft:"0px",marginTop:"0px"}:void 0),null==j?void 0:j.expandedContainer)},{children:[e.jsxs("div",n.__assign({className:s(t.default.expandedHeader,null==p?void 0:p.expandedHeader),style:n.__assign(n.__assign({},f?{backgroundColor:"white",padding:"0.5rem 1.5rem"}:void 0),null==j?void 0:j.expandedHeader)},{children:[e.jsx("span",n.__assign({className:s(t.default.headerTitle,null==p?void 0:p.headerTitle),style:null==j?void 0:j.headerTitle},{children:r})),e.jsxs("div",n.__assign({className:s(t.default.headerActions,null==p?void 0:p.headerActions),style:null==j?void 0:j.headerActions},{children:[f?w>1&&e.jsxs(e.Fragment,{children:[e.jsxs("span",n.__assign({style:{fontSize:"12px",color:"#888"}},{children:[S+1," / ",w]})),e.jsx("button",n.__assign({onClick:function(){return q(!0)},disabled:S<=0,style:{padding:"2px 4px",cursor:S<=0?"not-allowed":"pointer",opacity:S<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(l.ChevronUp,{size:14,color:"#64748b"})})),e.jsx("button",n.__assign({onClick:function(){return M(!0)},disabled:S>=w-1,style:{padding:"2px 4px",cursor:S>=w-1?"not-allowed":"pointer",opacity:S>=w-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(l.ChevronDown,{size:14,color:"#64748b"})}))]}):V(!1),$,!m&&k&&e.jsx("button",n.__assign({onClick:function(){var n;return null===(n=R.current)||void 0===n?void 0:n.showModal()},className:s(t.default.maximizeButton,null==p?void 0:p.maximizeButton),style:null==j?void 0:j.maximizeButton,title:"View fullscreen"},{children:e.jsx(k,{className:t.default.maximizeIcon})}))]}))]})),e.jsx("div",n.__assign({ref:A,className:s(t.default.contentArea,null==p?void 0:p.contentArea),style:n.__assign(n.__assign(n.__assign({},g?{flex:1,maxHeight:"300px",overflowY:"scroll",minHeight:0}:void 0),f?{padding:"1rem 1.5rem"}:void 0),null==j?void 0:j.contentArea)},{children:e.jsx("div",n.__assign({className:s(t.default.contentInner,null==p?void 0:p.contentInner),style:null==j?void 0:j.contentInner},{children:U(!1)}))})),P]})),!m&&e.jsx("dialog",n.__assign({ref:R,className:t.default.modalDialog,onClick:function(n){var e;n.target===R.current&&(null===(e=R.current)||void 0===e||e.close())}},{children:e.jsxs("div",n.__assign({className:s(t.default.modalContainer,null==p?void 0:p.modalContainer),style:null==j?void 0:j.modalContainer},{children:[e.jsxs("div",n.__assign({className:s(t.default.modalHeader,null==p?void 0:p.modalHeader),style:null==j?void 0:j.modalHeader},{children:[e.jsx("span",n.__assign({className:s(t.default.modalHeaderTitle,null==p?void 0:p.modalHeaderTitle),style:null==j?void 0:j.modalHeaderTitle},{children:r})),e.jsxs("div",n.__assign({className:s(t.default.modalHeaderActions,null==p?void 0:p.modalHeaderActions),style:null==j?void 0:j.modalHeaderActions},{children:[f?w>1&&e.jsxs(e.Fragment,{children:[e.jsxs("span",n.__assign({style:{fontSize:"12px",color:"#888"}},{children:[S+1," / ",w]})),e.jsx("button",n.__assign({onClick:function(){return q(!0)},disabled:S<=0,style:{padding:"2px 4px",cursor:S<=0?"not-allowed":"pointer",opacity:S<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(l.ChevronUp,{size:14,color:"#64748b"})})),e.jsx("button",n.__assign({onClick:function(){return M(!0)},disabled:S>=w-1,style:{padding:"2px 4px",cursor:S>=w-1?"not-allowed":"pointer",opacity:S>=w-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(l.ChevronDown,{size:14,color:"#64748b"})}))]}):V(!0),$,T&&e.jsx("button",n.__assign({onClick:function(){var n;return null===(n=R.current)||void 0===n?void 0:n.close()},className:s(t.default.closeButton,null==p?void 0:p.closeButton),style:null==j?void 0:j.closeButton,title:"Close"},{children:e.jsx(T,{className:s(t.default.closeIcon,null==p?void 0:p.closeIcon),style:null==j?void 0:j.closeIcon})}))]}))]})),e.jsx("div",n.__assign({ref:F,className:s(t.default.modalContent,null==p?void 0:p.modalContent),style:null==j?void 0:j.modalContent},{children:e.jsx("div",n.__assign({className:s(t.default.modalContentInner,null==p?void 0:p.modalContentInner),style:null==j?void 0:j.modalContentInner},{children:U(!0)}))})),C&&e.jsx("div",n.__assign({className:s(t.default.modalFooter,null==p?void 0:p.modalFooter),style:null==j?void 0:j.modalFooter},{children:e.jsx("span",n.__assign({className:s(t.default.trainingTitle,null==p?void 0:p.trainingTitle),style:null==j?void 0:j.trainingTitle},{children:C}))})),c&&e.jsx("div",n.__assign({className:s(t.default.modalFooterSource,null==p?void 0:p.modalFooterSource),style:null==j?void 0:j.modalFooterSource},{children:e.jsxs("button",n.__assign({type:"button",onClick:function(){var n;null==v||v(),null===(n=R.current)||void 0===n||n.close()},className:s(t.default.trainingTitleLink,null==p?void 0:p.trainingTitleLink),style:null==j?void 0:j.trainingTitleLink},{children:[c,e.jsx(l.ExternalLink,{size:16,color:"#2563eb"})]}))}))]}))}))]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),l=require("react"),i=require("lucide-react"),t=require("./CognitiveNonWebSearchReasoning.module.css.js"),s=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},a=function(l){return l.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(l,i){return l.startsWith("**")&&l.endsWith("**")||l.startsWith("__")&&l.endsWith("__")?e.jsx("strong",n.__assign({className:t.default.boldText},{children:l.slice(2,-2)}),i):l})};exports.default=function(o){var d=o.item,r=o.headerTitle;o.index;var u=o.iconsConfig,c=o.DocumentTitle,v=o.previewCallback,g=o.bodyHeight,h=o.disableMaximize,m=void 0!==h&&h,f=o.onFullscreenChange,_=o.splitterCustomStyle,x=void 0!==_&&_,p=o.themeTokens,j=o.classNames,y=o.styles,b=d.dataSource,C=d.confidence_score,N=d.trainingDataTitle,I=null==u?void 0:u.ChevronDownIcon,k=null==u?void 0:u.ChevronUpIcon,T=null==u?void 0:u.MaximizeIcon,H=null==u?void 0:u.CloseIcon,L=l.useMemo(function(){var e=(b?b.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):"").split(/(<highlight>[\s\S]*?<\/highlight>)/g),l=0,i=e.map(function(n){var e=n.startsWith("<highlight>"),i={text:e?n.replace(/<\/?highlight>/g,""):n,isHighlight:e,highlightIndex:e?l:-1};return e&&l++,i}),t=i.filter(function(n){return n.isHighlight}).length,s=[],a=[];return i.forEach(function(e){var l=e.text,i=e.isHighlight,t=e.highlightIndex;l.split("\n").forEach(function(e,l){l>0&&((a.length>0||s.length>0)&&s.push(n.__spreadArray([],a,!0)),a=[]),e&&a.push({text:e,isHighlight:i,highlightIndex:t})})}),a.length>0&&s.push(n.__spreadArray([],a,!0)),{processedLines:s.map(function(n){var e=n.map(function(n){return n.text}).join(""),l=e.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/);return{segments:n,isListItem:!!l,isHeader:!!e.match(/^(Title|Description|Training-basis):\s*(.*)$/i),indent:(null==l?void 0:l[1])||"",content:(null==l?void 0:l[3])||e}}),totalHighlights:t}},[b]),w=L.processedLines,B=L.totalHighlights,S=l.useState(0),z=S[0],A=S[1],F=l.useRef(null),R=l.useRef(null),D=l.useRef(null),E=l.useRef([]),W=l.useRef([]);l.useEffect(function(){E.current=E.current.slice(0,B),W.current=W.current.slice(0,B)},[B]),l.useEffect(function(){if(B>0){A(0);var n=setTimeout(function(){var n;null===(n=E.current[0])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50);return function(){return clearTimeout(n)}}},[B]),l.useEffect(function(){return function(){var n;(null===(n=D.current)||void 0===n?void 0:n.open)&&(null==f||f(!1))}},[f]);var q=function(n,e){setTimeout(function(){var l=e?W.current[n]:E.current[n];null==l||l.scrollIntoView({behavior:"smooth",block:"center"})},50)},M=function(n){if(void 0===n&&(n=!1),B){var e=z>0?z-1:B-1;A(e),q(e,n)}},U=function(n){if(void 0===n&&(n=!1),B){var e=z<B-1?z+1:0;A(e),q(e,n)}},V=function(l){var i=l?W:E,o=0;return w.map(function(l,d){l.isHeader&&(o=0),l.isListItem&&(o+=1);var r=function(){return l.segments.map(function(o,d){var r=o.isHighlight&&o.highlightIndex===z,u=o.text;return l.isListItem&&0===d&&(u=o.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),o.isHighlight?e.jsx("span",n.__assign({ref:function(n){n&&(i.current[o.highlightIndex]=n)},className:s(t.default.highlight,r?t.default.highlightActive:void 0,null==j?void 0:j.highlight,r?null==j?void 0:j.highlightActive:void 0),style:r?n.__assign(n.__assign({},null==y?void 0:y.highlight),null==y?void 0:y.highlightActive):null==y?void 0:y.highlight},{children:a(u)}),d):e.jsx("span",{children:a(u)},d)})};return l.isHeader?e.jsx("span",n.__assign({className:s(t.default.headerLine,null==j?void 0:j.headerLine),style:null==y?void 0:y.headerLine},{children:r()}),d):l.isListItem?e.jsxs("span",n.__assign({className:s(t.default.listItemLine,null==j?void 0:j.listItemLine),style:n.__assign({paddingLeft:l.indent?"1rem":"0"},null==y?void 0:y.listItemLine)},{children:[e.jsxs("span",n.__assign({className:s(t.default.listCounter,null==j?void 0:j.listCounter),style:null==y?void 0:y.listCounter},{children:[o,"."]})),e.jsx("span",{children:r()})]}),d):e.jsx("span",n.__assign({className:s(t.default.blockLine,null==j?void 0:j.blockLine),style:null==y?void 0:y.blockLine},{children:r()}),d)})},$=function(l){return B>1?e.jsxs("div",n.__assign({className:s(l?t.default.modalNavContainer:t.default.navigationContainer,l?null==j?void 0:j.modalNavContainer:null==j?void 0:j.navigationContainer),style:l?null==y?void 0:y.modalNavContainer:null==y?void 0:y.navigationContainer},{children:[k&&e.jsx("button",n.__assign({onClick:function(){return M(l)},className:s(l?t.default.modalNavButton:t.default.navButton,null==j?void 0:j.navButton),style:null==y?void 0:y.navButton},{children:e.jsx(k,{className:s(t.default.navIcon,null==j?void 0:j.navIcon),style:null==y?void 0:y.navIcon})})),e.jsxs("span",n.__assign({className:s(t.default.navCounter,null==j?void 0:j.navCounter),style:null==y?void 0:y.navCounter},{children:[z+1,"/",B]})),I&&e.jsx("button",n.__assign({onClick:function(){return U(l)},className:s(l?t.default.modalNavButton:t.default.navButton,null==j?void 0:j.navButton),style:null==y?void 0:y.navButton},{children:e.jsx(I,{className:s(t.default.navIcon,null==j?void 0:j.navIcon),style:null==y?void 0:y.navIcon})}))]})):null},O=null!=C?e.jsxs("span",n.__assign({className:s(t.default.confidenceBadge,null==j?void 0:j.confidenceBadge),style:null==y?void 0:y.confidenceBadge},{children:[e.jsx("span",n.__assign({className:t.default.confidenceStar},{children:"✦"})),e.jsxs("span",n.__assign({className:t.default.confidenceScore},{children:[C,"%"]}))]})):null,P=x?{backgroundColor:"white",padding:"1rem 1.5rem"}:void 0,Y=e.jsxs(e.Fragment,{children:[N&&e.jsx("div",n.__assign({className:s(t.default.footer,null==j?void 0:j.footer),style:n.__assign(n.__assign({},P),null==y?void 0:y.footer)},{children:e.jsx("span",n.__assign({className:s(t.default.trainingTitle,null==j?void 0:j.trainingTitle),style:null==y?void 0:y.trainingTitle},{children:N}))})),c&&e.jsx("div",n.__assign({className:s(t.default.modalFooterSource,null==j?void 0:j.modalFooterSource),style:n.__assign(n.__assign({},P),null==y?void 0:y.modalFooterSource)},{children:e.jsxs("button",n.__assign({type:"button",onClick:function(){return null==v?void 0:v()},className:s(t.default.trainingTitleLink,null==j?void 0:j.trainingTitleLink),style:null==y?void 0:y.trainingTitleLink},{children:[c,e.jsx(i.ExternalLink,{size:16,color:"#2563eb"})]}))}))]});return e.jsxs(e.Fragment,{children:[e.jsxs("div",n.__assign({className:s(t.default.expandedContainer,null==j?void 0:j.expandedContainer),style:n.__assign(n.__assign(n.__assign(n.__assign({},p),g?{height:"".concat(g),display:"flex",flexDirection:"column"}:void 0),x?{border:"none",borderRadius:0,marginLeft:"0px",marginTop:"0px"}:void 0),null==y?void 0:y.expandedContainer)},{children:[e.jsxs("div",n.__assign({className:s(t.default.expandedHeader,null==j?void 0:j.expandedHeader),style:n.__assign(n.__assign({},x?{backgroundColor:"white",padding:"0.5rem 1.5rem"}:void 0),null==y?void 0:y.expandedHeader)},{children:[e.jsx("span",n.__assign({className:s(t.default.headerTitle,null==j?void 0:j.headerTitle),style:null==y?void 0:y.headerTitle},{children:r})),e.jsxs("div",n.__assign({className:s(t.default.headerActions,null==j?void 0:j.headerActions),style:null==y?void 0:y.headerActions},{children:[x?B>1&&e.jsxs(e.Fragment,{children:[e.jsxs("span",n.__assign({style:{fontSize:"12px",color:"#888"}},{children:[z+1," / ",B]})),e.jsx("button",n.__assign({onClick:function(){return M(!0)},disabled:z<=0,style:{padding:"2px 4px",cursor:z<=0?"not-allowed":"pointer",opacity:z<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(i.ChevronUp,{size:14,color:"#64748b"})})),e.jsx("button",n.__assign({onClick:function(){return U(!0)},disabled:z>=B-1,style:{padding:"2px 4px",cursor:z>=B-1?"not-allowed":"pointer",opacity:z>=B-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(i.ChevronDown,{size:14,color:"#64748b"})}))]}):$(!1),O,!m&&T&&e.jsx("button",n.__assign({onClick:function(){var n;null==f||f(!0),null===(n=D.current)||void 0===n||n.showModal()},className:s(t.default.maximizeButton,null==j?void 0:j.maximizeButton),style:null==y?void 0:y.maximizeButton,title:"View fullscreen"},{children:e.jsx(T,{className:t.default.maximizeIcon})}))]}))]})),e.jsx("div",n.__assign({ref:F,className:s(t.default.contentArea,null==j?void 0:j.contentArea),style:n.__assign(n.__assign(n.__assign({},g?{flex:1,maxHeight:"300px",overflowY:"scroll",minHeight:0}:void 0),x?{padding:"1rem 1.5rem"}:void 0),null==y?void 0:y.contentArea)},{children:e.jsx("div",n.__assign({className:s(t.default.contentInner,null==j?void 0:j.contentInner),style:null==y?void 0:y.contentInner},{children:V(!1)}))})),Y]})),!m&&e.jsx("dialog",n.__assign({ref:D,className:t.default.modalDialog,onClose:function(){return null==f?void 0:f(!1)},onClick:function(n){var e;n.target===D.current&&(null===(e=D.current)||void 0===e||e.close())}},{children:e.jsxs("div",n.__assign({className:s(t.default.modalContainer,null==j?void 0:j.modalContainer),style:null==y?void 0:y.modalContainer},{children:[e.jsxs("div",n.__assign({className:s(t.default.modalHeader,null==j?void 0:j.modalHeader),style:null==y?void 0:y.modalHeader},{children:[e.jsx("span",n.__assign({className:s(t.default.modalHeaderTitle,null==j?void 0:j.modalHeaderTitle),style:null==y?void 0:y.modalHeaderTitle},{children:r})),e.jsxs("div",n.__assign({className:s(t.default.modalHeaderActions,null==j?void 0:j.modalHeaderActions),style:null==y?void 0:y.modalHeaderActions},{children:[x?B>1&&e.jsxs(e.Fragment,{children:[e.jsxs("span",n.__assign({style:{fontSize:"12px",color:"#888"}},{children:[z+1," / ",B]})),e.jsx("button",n.__assign({onClick:function(){return M(!0)},disabled:z<=0,style:{padding:"2px 4px",cursor:z<=0?"not-allowed":"pointer",opacity:z<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(i.ChevronUp,{size:14,color:"#64748b"})})),e.jsx("button",n.__assign({onClick:function(){return U(!0)},disabled:z>=B-1,style:{padding:"2px 4px",cursor:z>=B-1?"not-allowed":"pointer",opacity:z>=B-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(i.ChevronDown,{size:14,color:"#64748b"})}))]}):$(!0),O,H&&e.jsx("button",n.__assign({onClick:function(){var n;return null===(n=D.current)||void 0===n?void 0:n.close()},className:s(t.default.closeButton,null==j?void 0:j.closeButton),style:null==y?void 0:y.closeButton,title:"Close"},{children:e.jsx(H,{className:s(t.default.closeIcon,null==j?void 0:j.closeIcon),style:null==y?void 0:y.closeIcon})}))]}))]})),e.jsx("div",n.__assign({ref:R,className:s(t.default.modalContent,null==j?void 0:j.modalContent),style:null==y?void 0:y.modalContent},{children:e.jsx("div",n.__assign({className:s(t.default.modalContentInner,null==j?void 0:j.modalContentInner),style:null==y?void 0:y.modalContentInner},{children:V(!0)}))})),N&&e.jsx("div",n.__assign({className:s(t.default.modalFooter,null==j?void 0:j.modalFooter),style:null==y?void 0:y.modalFooter},{children:e.jsx("span",n.__assign({className:s(t.default.trainingTitle,null==j?void 0:j.trainingTitle),style:null==y?void 0:y.trainingTitle},{children:N}))})),c&&e.jsx("div",n.__assign({className:s(t.default.modalFooterSource,null==j?void 0:j.modalFooterSource),style:null==y?void 0:y.modalFooterSource},{children:e.jsxs("button",n.__assign({type:"button",onClick:function(){var n;null==v||v(),null===(n=D.current)||void 0===n||n.close()},className:s(t.default.trainingTitleLink,null==j?void 0:j.trainingTitleLink),style:null==y?void 0:y.trainingTitleLink},{children:[c,e.jsx(i.ExternalLink,{size:16,color:"#2563eb"})]}))}))]}))}))]})};
|
|
2
2
|
//# sourceMappingURL=CognitiveInternalgptCoreComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),o=require("../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),l=require("./GptWebCitationImageCitation.js"),a=require("./GptWebCitationSkeleton.js"),s=require("./types.js"),r=require("./utils/citationData.utils.js"),u=require("./utils/styleOverrides.utils.js"),d=require("./utils/fixedHeight.utils.js"),g=require("./GptWebCitation.module.css.js"),c=require("../../assests/svg/NeuralNetworkIcon.js"),v=function(t){var o=t.variant,l=t.disabled,a=t.onClick,s=t.title,r=t.style;return i.jsx("button",e.__assign({type:"button",className:g.default.webCitationButton,onClick:a,disabled:l,title:s,style:r},{children:"gpt"===o?i.jsxs(i.Fragment,{children:[i.jsx(c.default,{className:g.default.webCitationButtonIcon}),"View GPT Citation"]}):i.jsxs(i.Fragment,{children:[i.jsx(n.Globe,{size:24,className:g.default.webCitationButtonIcon}),"View Web Citation"]})}))};exports.default=function(c){var p,C,b,_,w=c.gptCitation,f=c.defaultCitationUrl,m=c.citationType,x=c.webCitationData,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),o=require("../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),l=require("./GptWebCitationImageCitation.js"),a=require("./GptWebCitationSkeleton.js"),s=require("./types.js"),r=require("./utils/citationData.utils.js"),u=require("./utils/styleOverrides.utils.js"),d=require("./utils/fixedHeight.utils.js"),g=require("./GptWebCitation.module.css.js"),c=require("../../assests/svg/NeuralNetworkIcon.js"),v=function(t){var o=t.variant,l=t.disabled,a=t.onClick,s=t.title,r=t.style;return i.jsx("button",e.__assign({type:"button",className:g.default.webCitationButton,onClick:a,disabled:l,title:s,style:r},{children:"gpt"===o?i.jsxs(i.Fragment,{children:[i.jsx(c.default,{className:g.default.webCitationButtonIcon}),"View GPT Citation"]}):i.jsxs(i.Fragment,{children:[i.jsx(n.Globe,{size:24,className:g.default.webCitationButtonIcon}),"View Web Citation"]})}))};exports.default=function(c){var p,C,b,_,w=c.gptCitation,f=c.defaultCitationUrl,m=c.citationType,x=c.webCitationData,h=c.topic,y=c.sourceLabel,k=c.relevanceScore,j=c.learnedFrom,F=c.webCitationStatus,S=c.onGenerateWebCitation,I=c.showWebCitation,L=c.onToggleCitationView,W=c.showExpandImageButton,B=void 0===W||W,H=c.onFullscreenChange,T=c.showGptMaximizeButton,N=c.iconsConfig,V=c.isFixedHeight,M=void 0!==V&&V,q=c.styles,E=t.useMemo(function(){return function(i){var t,n,o,l,a,s,r,d,g,c,v;return{container:null==i?void 0:i.container,gptWrapper:e.__assign(e.__assign({},null===(t=null==i?void 0:i.gptCitation)||void 0===t?void 0:t.wrapper),null==i?void 0:i.gptCitationWrapper),gptFooterAction:e.__assign(e.__assign({},null===(n=null==i?void 0:i.gptCitation)||void 0===n?void 0:n.footerAction),null==i?void 0:i.footerAction),gptToggleButton:e.__assign(e.__assign({},null===(o=null==i?void 0:i.gptCitation)||void 0===o?void 0:o.toggleButton),null==i?void 0:i.webCitationButton),webPanel:e.__assign(e.__assign({},null==i?void 0:i.container),null===(l=null==i?void 0:i.webCitation)||void 0===l?void 0:l.panel),webHeader:null===(a=null==i?void 0:i.webCitation)||void 0===a?void 0:a.header,webContent:null===(s=null==i?void 0:i.webCitation)||void 0===s?void 0:s.content,webFooter:null===(r=null==i?void 0:i.webCitation)||void 0===r?void 0:r.footer,webToggleButton:e.__assign(e.__assign({},null===(d=null==i?void 0:i.webCitation)||void 0===d?void 0:d.toggleButton),null==i?void 0:i.webCitationButton),webLearnedFrom:null===(g=null==i?void 0:i.webCitation)||void 0===g?void 0:g.learnedFrom,webImage:null===(c=null==i?void 0:i.webCitation)||void 0===c?void 0:c.image,webSkeleton:null===(v=null==i?void 0:i.webCitation)||void 0===v?void 0:v.skeleton,webImageVisitLink:u.resolveWebCitationVisitLinkStyles(null==i?void 0:i.webCitation,"image"),webSkeletonVisitLink:u.resolveWebCitationVisitLinkStyles(null==i?void 0:i.webCitation,"skeleton")}}(q)},[q]),G=s.allowsGptCitationView(m),z=s.allowsWebCitationView(m),U=s.showsCitationViewToggle(m),A=t.useMemo(function(){return M?d.resolveFixedHeightLayout(w.bodyHeight,U):null},[M,w.bodyHeight,U]),D=t.useMemo(function(){return A?d.getFixedPanelStyle(A.panelHeight):void 0},[A]),P=t.useMemo(function(){var e,i;return{MaximizeIcon:null!==(e=null==N?void 0:N.MaximizeIcon)&&void 0!==e?e:null===(i=w.iconsConfig)||void 0===i?void 0:i.MaximizeIcon,ExternalLinkIcon:null==N?void 0:N.ExternalLinkIcon}},[N,null===(p=w.iconsConfig)||void 0===p?void 0:p.MaximizeIcon]),O=t.useMemo(function(){return e.__assign(e.__assign(e.__assign(e.__assign({},w),M&&A?{bodyHeight:A.gptBodyHeight}:{}),{disableMaximize:void 0!==T?!T:w.disableMaximize}),U||m===s.CitationType.WEB?{DocumentTitle:void 0,previewCallback:void 0}:{})},[w,T,U,m,M,A]),R=t.useState(m!==s.CitationType.GPT),J=R[0],K=R[1],Q=m!==s.CitationType.GPT&&(m===s.CitationType.WEB||(null!=I?I:J)),X=void 0!==I,Y=t.useMemo(function(){return x?r.mapCitationDataToDisplay(x):null},[x]),Z=null!==(C=null!=h?h:null==Y?void 0:Y.topic)&&void 0!==C?C:"Web Citation",$=null!==(b=null!=k?k:null==Y?void 0:Y.relevanceScore)&&void 0!==b?b:0,ee=null!=j?j:null==Y?void 0:Y.learnedFrom,ie=r.resolveSkeletonVisitUrl(null==Y?void 0:Y.highlightedUrl,null!==(_=null==Y?void 0:Y.citationUrl)&&void 0!==_?_:f),te=r.getWebCitationImageUrl(x),ne=t.useMemo(function(){return function(e,i,t){return t?"success":e||(i?"error":"pending")}(F,x,te)},[F,x,te]),oe=t.useCallback(function(){L?L():X||K(!1)},[L,X]),le=t.useCallback(function(){L?L():X||K(!0),te||"success"===ne||null==S||S()},[L,X,te,ne,S]),ae=null!=y?y:"Source: Web Citation > ".concat(Z),se=function(t){var n=!!O.DocumentTitle,l=[g.default.gptCitationWrapper,n?g.default.gptCitationWrapperWithSource:"",M?g.default.gptCitationWrapperFixedHeight:""].filter(Boolean).join(" ");return i.jsxs("div",e.__assign({className:l,style:e.__assign(e.__assign({},E.gptWrapper),D)},{children:[i.jsx(o.default,e.__assign({},O,{splitterCustomStyle:!0,onFullscreenChange:H})),t&&(n?i.jsx("div",e.__assign({className:g.default.gptCitationFooterAction,style:E.gptFooterAction},{children:t})):i.jsx("div",e.__assign({className:[g.default.gptCitationToggleFooter,M?g.default.gptCitationToggleFooterFixedHeight:""].filter(Boolean).join(" "),style:E.gptFooterAction},{children:t})))]}))};return G&&!Q?i.jsx("div",e.__assign({className:g.default.overlay,style:E.container},{children:se(U?i.jsx(v,{variant:"web",onClick:le,title:"View web-based citation for this source.",style:E.gptToggleButton}):void 0)})):z?i.jsxs("div",e.__assign({className:[g.default.panel,M?g.default.gptCitationWrapperFixedHeight:""].filter(Boolean).join(" "),style:e.__assign(e.__assign({},E.webPanel),D)},{children:[i.jsxs("div",e.__assign({className:g.default.panelHeader,style:E.webHeader},{children:[i.jsx("span",e.__assign({className:g.default.panelSource},{children:ae})),i.jsx("div",e.__assign({className:g.default.panelHeaderActions},{children:$>0&&i.jsxs("div",e.__assign({className:g.default.confidenceBadge,title:"Decision strength"},{children:[i.jsx(n.Sparkles,{size:14}),$,"%"]}))}))]})),i.jsx("div",e.__assign({className:[g.default.panelContent,g.default.panelContentExpanded,M?g.default.panelContentFixedHeight:""].filter(Boolean).join(" "),style:e.__assign(e.__assign({},E.webContent),M?d.getFixedWebContentStyle():void 0)},{children:"pending"===ne?i.jsx(a.default,{status:"pending",citationUrl:ie,ExternalLinkIcon:P.ExternalLinkIcon,styles:E.webSkeleton,visitLinkStyles:E.webSkeletonVisitLink,isFixedHeight:M}):"success"===ne&&te?i.jsx(l.default,{citationImage:te,citationUrl:ie,showExpandImageButton:B,iconsConfig:P,styles:E.webImage,visitLinkStyles:E.webImageVisitLink,skeletonStyles:E.webSkeleton,skeletonVisitLinkStyles:E.webSkeletonVisitLink,isFixedHeight:M,onFullscreenChange:H}):i.jsx(a.default,{status:"error",citationUrl:ie,ExternalLinkIcon:P.ExternalLinkIcon,styles:E.webSkeleton,visitLinkStyles:E.webSkeletonVisitLink,isFixedHeight:M})})),i.jsxs("div",e.__assign({className:g.default.panelFooter,style:E.webFooter},{children:[U?i.jsx(v,{variant:"gpt",onClick:oe,style:E.webToggleButton}):null,ee&&i.jsxs("span",e.__assign({className:g.default.learnedFrom,style:E.webLearnedFrom},{children:["Learned From ",ee]}))]}))]})):i.jsx("div",e.__assign({className:g.default.overlay,style:E.container},{children:se()}))};
|
|
2
2
|
//# sourceMappingURL=GptWebCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),l=require("./GptWebCitationImageFullScreenView.js"),a=require("./GptWebCitationSkeleton.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),l=require("./GptWebCitationImageFullScreenView.js"),a=require("./GptWebCitationSkeleton.js"),r=require("./utils/citationData.utils.js"),s=require("./GptWebCitation.module.css.js");exports.default=function(o){var u,d,c=o.citationImage,f=o.citationUrl,g=o.skeletonVisitUrl,v=o.showExpandImageButton,x=void 0===v||v,m=o.iconsConfig,p=o.styles,j=o.visitLinkStyles,C=o.skeletonStyles,h=o.skeletonVisitLinkStyles,k=o.isFixedHeight,_=void 0!==k&&k,y=o.onFullscreenChange,b=null!==(u=null==m?void 0:m.MaximizeIcon)&&void 0!==u?u:n.Maximize2,w=null!==(d=null==m?void 0:m.ExternalLinkIcon)&&void 0!==d?d:n.ExternalLink,I=t.useState(!1),L=I[0],S=I[1],E=t.useState("loading"),N=E[0],q=E[1],B=t.useRef(!1);t.useEffect(function(){var e=!0;B.current&&(B.current=!1,null==y||y(!1)),q("loading"),S(!1);var i=new Image;return i.onload=function(){e&&q("loaded")},i.onerror=function(){e&&q("error")},i.src=c,function(){e=!1,i.onload=null,i.onerror=null}},[c,y]),t.useEffect(function(){return function(){B.current&&(B.current=!1,null==y||y(!1))}},[y]);var F="loaded"===N,H=r.sanitizeExternalUrl(f);return i.jsxs("div",e.__assign({className:[s.default.imageCitationWrapper,_?s.default.imageCitationWrapperFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.wrapper},{children:[i.jsx("div",e.__assign({className:[s.default.imageCitationCenter,_?s.default.imageCitationCenterFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.center},{children:F?i.jsxs("div",e.__assign({className:[s.default.imageCitationViewport,_?s.default.imageCitationViewportFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.viewport},{children:[i.jsx("div",e.__assign({className:[s.default.imageCitationScrollContainer,_?s.default.imageCitationScrollContainerFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.scrollContainer},{children:i.jsx("img",{src:c,alt:"Web citation snapshot",className:[s.default.citationImage,_?s.default.citationImageContained:""].filter(Boolean).join(" "),style:null==p?void 0:p.image})})),x&&i.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),B.current=!0,null==y||y(!0),S(!0)},className:s.default.expandImageButton,style:null==p?void 0:p.expandButton,"aria-label":"View citation image in full screen",title:"Expand image"},{children:i.jsx(b,{size:16,strokeWidth:2})}))]})):i.jsx(a.default,{status:"error"===N?"error":"pending",citationUrl:null!=g?g:f,ExternalLinkIcon:null==m?void 0:m.ExternalLinkIcon,styles:C,visitLinkStyles:h,isFixedHeight:_})})),H&&F&&i.jsxs("div",e.__assign({className:s.default.visitLinkRow,style:null==j?void 0:j.row},{children:[i.jsx("span",e.__assign({className:s.default.visitLinkHint,style:null==j?void 0:j.hint},{children:"Open link in new tab to read in detail"})),i.jsxs("a",e.__assign({href:H,target:"_blank",rel:"noreferrer",className:s.default.visitLink,style:null==j?void 0:j.link},{children:["Visit Link",i.jsx(w,{size:16})]}))]})),L&&F&&i.jsx(l.default,{src:c,onClose:function(){B.current=!1,null==y||y(!1),S(!1)},styles:null==p?void 0:p.fullScreen})]}))};
|
|
2
2
|
//# sourceMappingURL=GptWebCitationImageCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const a=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;a&&e.setAttribute("nonce",a),e.appendChild(document.createTextNode(".ManageRemainder-module_mrContainer__kVgxT{align-items:center;display:flex;flex-direction:column;gap:1rem;justify-content:center;margin-top:1rem}.ManageRemainder-module_mrSectionBox__bEDtY{border:1px solid #b6c1ca;border-radius:10px;cursor:pointer;display:flex;flex-direction:column;gap:.75rem;padding:.75rem;width:100%}.ManageRemainder-module_mrSectionHeader__5k1HQ{display:flex;flex-direction:column;gap:.25rem}.ManageRemainder-module_mrSectionHeaderContent__eKJWh{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between;width:100%}.ManageRemainder-module_mrSectionHeaderLeft__I-hzD{display:flex;flex-direction:column;gap:.25rem}.ManageRemainder-module_mrSectionHeaderRight__W-BY3{align-items:center;display:flex;gap:.25rem;justify-content:flex-start}.ManageRemainder-module_mrSectionTitleWrapper__NA6i-{align-items:center;display:flex;gap:.5rem}.ManageRemainder-module_mrSectionTitleIcon__6pWZz{align-items:center;display:flex;height:.75rem;justify-content:center;width:.75rem}.ManageRemainder-module_mrSectionTitle__BPAU2{color:#334155;font-size:.875rem;font-weight:600}.ManageRemainder-module_mrSectionDescription__HdkjC{color:#334155;font-size:.75rem;font-weight:400}.ManageRemainder-module_mrIconSmall__kbiWd{color:#334155;height:.75rem;width:.75rem}.ManageRemainder-module_mrIconInfo__U8Ylz{color:#64748b;height:1rem;width:1rem}.ManageRemainder-module_mrIconArrow__wMp9q{stroke:#334155;height:.75rem;width:.75rem}.ManageRemainder-module_mrIconAction__l9uVi{height:1rem;width:1rem}.ManageRemainder-module_mrIconPreview__oYo84{stroke:#64748b;height:1rem;width:1rem}.ManageRemainder-module_mrIconCalendar__2gaaf{color:#1e293b;height:1.25rem;width:1.25rem}.ManageRemainder-module_mrIconChevronToggle__LjUy1{color:#4f46e5;height:1rem;position:fixed;width:1rem}.ManageRemainder-module_mrIconDropdown__-heGj{height:.75rem;width:.75rem}.ManageRemainder-module_mrIconSuccess__EMJrR{color:#16a34a;height:1.5rem;width:1.5rem}.ManageRemainder-module_mrChevronButton__QKLsI{align-items:center;display:flex;justify-content:center}.ManageRemainder-module_mrChevronIcon__CxLkq{height:1.25rem;transition:transform .2s ease;width:1.25rem}.ManageRemainder-module_mrChevronIcon__CxLkq.ManageRemainder-module_mrChevronRotated__NL7Ho{transform:rotate(180deg)}.ManageRemainder-module_mrSuccessMessage__4N0gO{align-items:center;display:inline-flex;flex-direction:column;gap:.75rem;width:100%}.ManageRemainder-module_mrSuccessIcon__PsybU{align-items:center;background-color:#dcfce7;border-radius:9999px;box-shadow:0 0 0 4px #fff;display:flex;height:3rem;justify-content:center;width:3rem}.ManageRemainder-module_mrSuccessIconInner__yEl8-{height:1.5rem;position:relative;width:1.5rem}.ManageRemainder-module_mrSuccessText__-hXJh{align-items:center;display:flex;flex-direction:column;gap:.25rem;text-align:center}.ManageRemainder-module_mrSuccessTitle__Zakof{color:#166534;font-size:1rem;font-weight:500;line-height:1.5}.ManageRemainder-module_mrSuccessDescription__-r7A8{color:#22c55e;font-size:.875rem;font-weight:400;line-height:1.25}.ManageRemainder-module_mrRecipientsSection__L0f1k{display:flex;flex-direction:column;gap:.5rem}.ManageRemainder-module_mrRecipientsLabel__Escta{color:#3f3f46;font-size:.75rem;font-weight:500}.ManageRemainder-module_mrRecipientsGrid__-7giX{display:flex;flex-wrap:wrap;gap:.75rem;margin-bottom:.75rem}.ManageRemainder-module_mrRecipientItem__C0uw5{align-items:center;background-color:#fff;border:1px solid #cbd5e1;border-radius:.375rem;display:flex;gap:.5rem;padding:.25rem .5rem}.ManageRemainder-module_mrRecipientInfo__djuEp{align-items:center;display:flex;gap:.5rem}.ManageRemainder-module_mrRecipientAvatar__g6YDo{align-items:center;border-radius:9999px;display:flex;font-size:.6875rem;font-weight:500;height:1.5rem;justify-content:center;width:1.5rem}.ManageRemainder-module_mrRecipientName__gFCJU{color:#3f3f46;font-size:.875rem}.ManageRemainder-module_mrCheckboxUnchecked__j0wYE{background-color:#fff;border:1px solid #d0d5dd;border-radius:.25rem;height:1rem;width:1rem}.ManageRemainder-module_mrCheckboxChecked__TowNb{align-items:center;background-color:#fff;border:1px solid #6938ef;border-radius:.25rem;display:flex;height:1rem;justify-content:center;width:1rem}.ManageRemainder-module_mrCheckboxIcon__RVL-V{height:.625rem;width:.625rem}.ManageRemainder-module_mrActionsSection__in30u{display:flex;gap:.75rem}.ManageRemainder-module_mrActionButton__x9IEC{align-items:center;border:none;border-radius:.375rem;cursor:pointer;display:flex;flex:1;font-size:.875rem;font-weight:500;gap:.5rem;height:2.25rem;justify-content:center}.ManageRemainder-module_mrActionButtonSecondary__GBvpQ{background-color:#fff;border:1px solid #a5b4fc;color:#4f46e5}.ManageRemainder-module_mrActionButtonSecondary__GBvpQ:hover{background-color:#f3f4f6}.ManageRemainder-module_mrActionButtonPrimary__vRNbF{background-color:#4f46e5;color:#fff}.ManageRemainder-module_mrActionButtonPrimary__vRNbF:hover{background-color:#4338ca}.ManageRemainder-module_mrMainContent__2gAUU{display:flex;flex-direction:row;gap:1.75rem;width:100%}.ManageRemainder-module_mrEscalationContainer__V4PfB{background-color:#ffffffb3;border-radius:10px;display:flex;flex:1;flex-direction:column;gap:.75rem;min-width:0;outline:1px solid #b6c1ca;outline-offset:-1px;padding:.75rem}.ManageRemainder-module_mrEscalationHeaderWrapper__vOg2K{cursor:pointer;display:flex;flex-direction:column;gap:.25rem;justify-content:space-between}.ManageRemainder-module_mrEscalationHeader__sV-tw{align-items:center;display:flex;gap:.5rem;justify-content:space-between}.ManageRemainder-module_mrEscalationTitleWrapper__G90xv{align-items:center;display:flex;gap:.5rem}.ManageRemainder-module_mrEscalationTitleText__X233z{color:#3f3f46;font-size:.875rem;font-weight:600;line-height:1.25}.ManageRemainder-module_mrTooltipIcon__QpPGO{height:1rem;overflow:hidden;position:relative;width:1rem}.ManageRemainder-module_mrEscalationActions__RoHhx{align-items:center;display:flex;gap:.5rem}.ManageRemainder-module_mrEscalationPreviewButton__68J90{align-items:center;background-color:#fff;border:none;border-radius:1.29rem;box-shadow:0 1px 2px 0 #0000000d;cursor:pointer;display:flex;gap:.375rem;height:1.75rem;outline:.54px solid #d1d5db;outline-offset:-.54px;padding:.375rem .875rem}.ManageRemainder-module_mrEscalationPreviewIcon__KNa9K{height:1rem;overflow:hidden;position:relative;width:1rem}.ManageRemainder-module_mrEscalationPreviewText__FM5S5{color:#6b7280;font-size:.75rem;font-weight:400;line-height:1rem}.ManageRemainder-module_mrEscalationDescription__z-3q8{color:#334155;font-size:.75rem;font-weight:400}.ManageRemainder-module_mrReorderGroup__sLaAn{display:flex;flex-direction:column;gap:1.5rem}.ManageRemainder-module_mrReminderItem__kwd0b{display:flex;gap:1rem;justify-content:space-between;width:100%}.ManageRemainder-module_mrReminderLabelBox__KRi5V{display:flex;flex-shrink:0;justify-content:center;width:90px}.ManageRemainder-module_mrReminderLabelInner__GuTh-{align-items:center;display:flex}.ManageRemainder-module_mrReminderContent__yKbGS{align-items:center;display:flex;gap:1rem;width:100%}.ManageRemainder-module_mrDragHandle__4Lz8t{align-items:center;cursor:grab;display:flex;gap:.75rem}.ManageRemainder-module_mrReminderBox__ur54z{border-radius:.75rem;padding:.5rem;width:100%}.ManageRemainder-module_mrReminderFields__yQROF{display:flex;flex-direction:column;flex-wrap:wrap;gap:1rem;width:100%}.ManageRemainder-module_mrReminderHeader__wMUF6{align-items:flex-start;display:flex;gap:1rem;justify-content:space-between;width:100%}.ManageRemainder-module_mrReminderAssignee__0p1Gb{align-items:center;display:flex;gap:.75rem}.ManageRemainder-module_mrReminderAvatar__6KM5V{align-items:center;background-color:#dbeafe;border-radius:9999px;display:flex;height:1.75rem;justify-content:center;width:1.75rem}.ManageRemainder-module_mrReminderInitials__bUFkd{color:#1e40af;font-size:.625rem;font-weight:500}.ManageRemainder-module_mrReminderName__zjceM{color:#1f2937;font-size:.75rem;font-weight:500}.ManageRemainder-module_mrReminderStatement__7Y0B-{border-radius:9999px;display:flex;padding:.5rem .75rem}.ManageRemainder-module_mrReminderStatementText__LodbK{font-size:.625rem;font-weight:500;letter-spacing:-.01em}.ManageRemainder-module_mrReminderDateFields__GT4N9{align-items:flex-start;display:flex;gap:1.5rem;width:100%}.ManageRemainder-module_mrReminderField__XBiO4{width:100%}.ManageRemainder-module_mrReminderFieldLabel__S9dXV{color:#3f3f46;font-size:.75rem;font-weight:500;margin-bottom:.25rem}.ManageRemainder-module_mrReminderDatePicker__Vgbui{align-items:center;box-shadow:0 1px 2px 0 #0000000d;color:#3f3f46;display:flex;font-size:.75rem;gap:.75rem;height:1.75rem;justify-content:space-between}.ManageRemainder-module_mrReminderDueDate__7nawQ{align-items:center;background-color:#f1f5f9;border:.5px solid #cbd5e1;border-radius:0;color:#64748b;display:flex;font-size:.75rem;height:1.75rem;padding:0 .75rem}.ManageRemainder-module_mrReminderFrequency__Qq1qa{align-items:center;display:flex;gap:.5rem}.ManageRemainder-module_mrReminderFrequencyText__lGfl0{color:#374151;font-size:.75rem}.ManageRemainder-module_mrEscalationCheckbox__xZrG3{align-items:flex-start;border:1px solid #e5e7eb;border-radius:.25rem;color:#3f3f46;display:flex;flex-direction:column;font-size:.75rem;font-weight:500;gap:.5rem;padding:.5rem;width:100%}.ManageRemainder-module_mrEscalationCheckboxHeader__1GgFB{align-items:flex-start;display:flex;gap:.5rem;justify-content:flex-start;width:100%}.ManageRemainder-module_mrEscalationContent__ItAyr{display:flex;flex-direction:column;gap:.5rem;overflow:hidden;width:100%}.ManageRemainder-module_mrEscalationCondition__4GCeD{color:#3f3f46;font-family:Inter,sans-serif;font-size:.75rem;font-weight:500;line-height:1;margin-top:.75rem;width:100%}.ManageRemainder-module_mrEscalationFields__oFHp-{align-items:flex-end;display:flex;flex-wrap:wrap;gap:1.5rem;gap:.625rem;width:100%}.ManageRemainder-module_mrEscalationFieldGroup__uES3-{display:flex;flex:1;gap:.75rem;min-width:130px}.ManageRemainder-module_mrEscalationFieldGroupLarge__MpVYP{flex:1;min-width:265px}.ManageRemainder-module_mrEscalationFieldGroupSmall__FFbRJ{display:flex;flex:1;min-width:88px}.ManageRemainder-module_mrEscalationFieldText__n7EfI{color:#3f3f46;font-family:Inter,sans-serif;font-size:.75rem;font-weight:500;line-height:1.5;min-width:152px}.ManageRemainder-module_mrDropdownButton__9wvGh{align-items:center;cursor:pointer;display:flex;justify-content:center}.ManageRemainder-module_mrCalendarPanel__PnMpt{flex-shrink:0;position:relative}.ManageRemainder-module_mrCalendarCollapsed__mb-bI{background-color:#fff;border:1px solid #b6c1ca;border-radius:10px;display:flex;height:100%;justify-content:center;padding-top:281px;width:43px}.ManageRemainder-module_mrCalendarToggle__9HIet{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:3rem;justify-content:center;left:-26px;position:absolute;top:50%;transform:translateY(-50%);width:2.25rem;z-index:10}@media (max-width:1024px){.ManageRemainder-module_mrMainContent__2gAUU{flex-direction:column;gap:1rem}.ManageRemainder-module_mrCalendarPanel__PnMpt{width:100%}.ManageRemainder-module_mrCalendarToggle__9HIet{display:none}}@media (max-width:768px){.ManageRemainder-module_mrContainer__kVgxT{gap:.5rem;margin-top:.5rem}.ManageRemainder-module_mrSectionBox__bEDtY{gap:.5rem;padding:.5rem}.ManageRemainder-module_mrActionsSection__in30u,.ManageRemainder-module_mrSectionHeaderContent__eKJWh{flex-direction:column}.ManageRemainder-module_mrActionButton__x9IEC{height:2rem}.ManageRemainder-module_mrReminderDateFields__GT4N9{flex-direction:column;gap:1rem}.ManageRemainder-module_mrReminderContent__yKbGS,.ManageRemainder-module_mrReminderItem__kwd0b{gap:.5rem}.ManageRemainder-module_mrEscalationFields__oFHp-{flex-direction:column}.ManageRemainder-module_mrEscalationFieldGroupLarge__MpVYP,.ManageRemainder-module_mrEscalationFieldGroupSmall__FFbRJ,.ManageRemainder-module_mrEscalationFieldGroup__uES3-{min-width:100%;width:100%}.ManageRemainder-module_mrEscalationFieldText__n7EfI{min-width:auto}.ManageRemainder-module_mrReminderLabelBox__KRi5V{width:100%}}button:focus{outline:2px solid #4f46e5;outline-offset:2px}button:active{opacity:.9}.ManageRemainder-module_mrHiddenSection__c67oj{overflow:hidden}.ManageRemainder-module_mrNoPointerEvents__OQbav{pointer-events:none}.ManageRemainder-module_mrPointerEventsAuto__0avRT{pointer-events:auto}.ManageRemainder-module_calendarContainer__N804t{background-color:#fff;border:1px solid #b6c1ca;border-radius:8px;height:100%;min-width:345px;padding:16px}.ManageRemainder-module_calendarHeader__BjE9o{align-items:center;display:flex;gap:6px;margin-bottom:24px}.ManageRemainder-module_calendarHeaderTitle__U8NmV{align-items:center;color:#334155;display:flex;font-size:14px;font-weight:600;gap:6px;line-height:20px}.ManageRemainder-module_calendarHeaderInfo__s05VQ{height:16px;width:16px}.ManageRemainder-module_monthNav__FBbyi{align-items:center;display:flex;justify-content:space-between;margin-bottom:24px}.ManageRemainder-module_monthNavBtn__oor7V{align-items:center;background:none;border:1px solid #dce0e5;border-radius:8px;cursor:pointer;display:flex;justify-content:center;padding:8px}.ManageRemainder-module_monthNavTitle__zgDDq{color:#14181f;font-size:15px;font-weight:600;margin:0}.ManageRemainder-module_weekdayHeader__XciP8{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:8px}.ManageRemainder-module_weekdayLabel__dDWJo{color:#6f7c8e;font-size:15px;font-weight:400;text-align:center}.ManageRemainder-module_dayGrid__dT0og{display:grid;gap:8px 11px;grid-template-columns:repeat(7,1fr);margin-top:16px}.ManageRemainder-module_dayCell__AGx-w{align-items:center;border-radius:8px;cursor:pointer;display:flex;flex-direction:column;height:35px;justify-content:center}.ManageRemainder-module_dayCellPast__91hbu{background-color:#daf7d2}.ManageRemainder-module_dayCellToday__q8Wvi{border:2px solid #4f46e5}.ManageRemainder-module_dayNumber__6yOVW{font-size:14px}.ManageRemainder-module_dayNumberCurrent__6ML9j{color:#0f172a}.ManageRemainder-module_dayNumberOutside__JQ-t7{color:#94a3b8}.ManageRemainder-module_indicatorWrapper__5FOym{align-items:center;display:flex}.ManageRemainder-module_indicatorDot__ElweF{border-radius:50%;height:6px;width:6px}.ManageRemainder-module_indicatorDotOverlap__QPBRy{margin-left:-1px}.ManageRemainder-module_tooltipContent__ErzOu{background-color:#f8fafc;border-radius:8px;min-width:120px;padding:8px}.ManageRemainder-module_tooltipHeader__Q4qHO{border-bottom:1px solid #cbd5e1;margin-bottom:4px;padding-bottom:4px}.ManageRemainder-module_tooltipTitle__iZtI4{color:#0f172a;font-size:10px;font-weight:500;line-height:16px}.ManageRemainder-module_tooltipDate__ulMaQ{color:#334155;font-size:8px;font-weight:400;line-height:16px}.ManageRemainder-module_tooltipAssignees__jGc-Y{display:flex;flex-direction:column;gap:2px}.ManageRemainder-module_tooltipAssigneeRow__nzr3m{align-items:center;display:flex;gap:12px;justify-content:space-between}.ManageRemainder-module_tooltipAssigneeInfo__vIXTP{align-items:center;display:flex;gap:4px}.ManageRemainder-module_tooltipAssigneeDot__yz6E6{border-radius:50%;height:8px;width:8px}.ManageRemainder-module_tooltipAssigneeName__JJbid{color:#0f172a;font-size:9px;font-weight:400;line-height:16px}.ManageRemainder-module_tooltipAssigneeCount__49OVk{color:#0f172a;font-size:9px;font-weight:500;line-height:16px}.ManageRemainder-module_legendWrapper__OfxhE{align-items:flex-start;display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:38px}.ManageRemainder-module_legendInner__iwIe7{align-items:flex-start;display:flex;gap:6px}.ManageRemainder-module_legendItem__zbxBG{align-items:center;border-radius:4px;cursor:pointer;display:flex;gap:4px;padding:4px 8px;width:100%}.ManageRemainder-module_legendItemAssignee1__I6F-D{background-color:#fdf2f8;border:1px solid #be185d}.ManageRemainder-module_legendItemAssignee2__YObVW{background-color:#eef2ff;border:1px solid #4338ca}.ManageRemainder-module_legendItemAssignee3__uCkBW{background-color:#fff7ed;border:1px solid #f87171;justify-content:center}.ManageRemainder-module_legendLabel__Va4Sw{font-size:12px;font-weight:500}.ManageRemainder-module_legendLabelAssignee1__vG-F4{color:#be185d}.ManageRemainder-module_legendLabelAssignee2__CbGVb{color:#4338ca}.ManageRemainder-module_legendLabelAssignee3__cz-57{color:#f87171}.ManageRemainder-module_checkboxIconUnchecked__xoI0S{background-color:#fff;border:1px solid #d0d5dd;border-radius:4px;height:16px;width:16px}.ManageRemainder-module_checkboxIconChecked__Y3mN2{align-items:center;background-color:#fff;border-radius:4px;display:flex;height:16px;justify-content:center;width:16px}.ManageRemainder-module_checkboxIconCheckedAssignee1__817aZ{border:1px solid #c11574}.ManageRemainder-module_checkboxIconCheckedAssignee2__hTAKp{border:1px solid #3538cd}.ManageRemainder-module_checkboxIconCheckedAssignee3__hQwwN{border:1px solid #ff6058}.ManageRemainder-module_checkboxCheckSvg__R87mg{height:10px;width:10px}.ManageRemainder-module_bottomLegend__rRzkt{align-items:center;display:inline-flex;gap:24px;margin-left:4px;margin-top:16px}.ManageRemainder-module_bottomLegendItem__u90vA{align-items:center;display:flex;gap:4px}.ManageRemainder-module_bottomLegendSwatch__9uu1M{border-radius:2px;height:12px;width:12px}.ManageRemainder-module_bottomLegendSwatchPast__-DcRZ{background-color:#daf7d2}.ManageRemainder-module_bottomLegendSwatchFailed__9lK2I{background-color:#fecaca}.ManageRemainder-module_bottomLegendLabel__9eDD-{color:#334155;font-size:12px;font-weight:500}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={mrContainer:"ManageRemainder-module_mrContainer__kVgxT",mrSectionBox:"ManageRemainder-module_mrSectionBox__bEDtY",mrSectionHeader:"ManageRemainder-module_mrSectionHeader__5k1HQ",mrSectionHeaderContent:"ManageRemainder-module_mrSectionHeaderContent__eKJWh",mrSectionHeaderLeft:"ManageRemainder-module_mrSectionHeaderLeft__I-hzD",mrSectionHeaderRight:"ManageRemainder-module_mrSectionHeaderRight__W-BY3",mrSectionTitleWrapper:"ManageRemainder-module_mrSectionTitleWrapper__NA6i-",mrSectionTitleIcon:"ManageRemainder-module_mrSectionTitleIcon__6pWZz",mrSectionTitle:"ManageRemainder-module_mrSectionTitle__BPAU2",mrSectionDescription:"ManageRemainder-module_mrSectionDescription__HdkjC",mrIconSmall:"ManageRemainder-module_mrIconSmall__kbiWd",mrIconInfo:"ManageRemainder-module_mrIconInfo__U8Ylz",mrIconArrow:"ManageRemainder-module_mrIconArrow__wMp9q",mrIconAction:"ManageRemainder-module_mrIconAction__l9uVi",mrIconPreview:"ManageRemainder-module_mrIconPreview__oYo84",mrIconCalendar:"ManageRemainder-module_mrIconCalendar__2gaaf",mrIconChevronToggle:"ManageRemainder-module_mrIconChevronToggle__LjUy1",mrIconDropdown:"ManageRemainder-module_mrIconDropdown__-heGj",mrIconSuccess:"ManageRemainder-module_mrIconSuccess__EMJrR",mrChevronButton:"ManageRemainder-module_mrChevronButton__QKLsI",mrChevronIcon:"ManageRemainder-module_mrChevronIcon__CxLkq",mrChevronRotated:"ManageRemainder-module_mrChevronRotated__NL7Ho",mrSuccessMessage:"ManageRemainder-module_mrSuccessMessage__4N0gO",mrSuccessIcon:"ManageRemainder-module_mrSuccessIcon__PsybU",mrSuccessIconInner:"ManageRemainder-module_mrSuccessIconInner__yEl8-",mrSuccessText:"ManageRemainder-module_mrSuccessText__-hXJh",mrSuccessTitle:"ManageRemainder-module_mrSuccessTitle__Zakof",mrSuccessDescription:"ManageRemainder-module_mrSuccessDescription__-r7A8",mrHiddenSection:"ManageRemainder-module_mrHiddenSection__c67oj",mrRecipientsSection:"ManageRemainder-module_mrRecipientsSection__L0f1k",mrRecipientsLabel:"ManageRemainder-module_mrRecipientsLabel__Escta",mrRecipientsGrid:"ManageRemainder-module_mrRecipientsGrid__-7giX",mrRecipientItem:"ManageRemainder-module_mrRecipientItem__C0uw5",mrRecipientInfo:"ManageRemainder-module_mrRecipientInfo__djuEp",mrRecipientAvatar:"ManageRemainder-module_mrRecipientAvatar__g6YDo",mrRecipientName:"ManageRemainder-module_mrRecipientName__gFCJU",mrCheckboxUnchecked:"ManageRemainder-module_mrCheckboxUnchecked__j0wYE",mrCheckboxChecked:"ManageRemainder-module_mrCheckboxChecked__TowNb",mrCheckboxIcon:"ManageRemainder-module_mrCheckboxIcon__RVL-V",mrActionsSection:"ManageRemainder-module_mrActionsSection__in30u",mrActionButton:"ManageRemainder-module_mrActionButton__x9IEC",mrActionButtonSecondary:"ManageRemainder-module_mrActionButtonSecondary__GBvpQ",mrActionButtonPrimary:"ManageRemainder-module_mrActionButtonPrimary__vRNbF",mrMainContent:"ManageRemainder-module_mrMainContent__2gAUU",mrEscalationContainer:"ManageRemainder-module_mrEscalationContainer__V4PfB",mrEscalationHeaderWrapper:"ManageRemainder-module_mrEscalationHeaderWrapper__vOg2K",mrEscalationHeader:"ManageRemainder-module_mrEscalationHeader__sV-tw",mrEscalationTitleWrapper:"ManageRemainder-module_mrEscalationTitleWrapper__G90xv",mrEscalationTitleText:"ManageRemainder-module_mrEscalationTitleText__X233z",mrTooltipIcon:"ManageRemainder-module_mrTooltipIcon__QpPGO",mrEscalationActions:"ManageRemainder-module_mrEscalationActions__RoHhx",mrEscalationPreviewButton:"ManageRemainder-module_mrEscalationPreviewButton__68J90",mrEscalationPreviewIcon:"ManageRemainder-module_mrEscalationPreviewIcon__KNa9K",mrEscalationPreviewText:"ManageRemainder-module_mrEscalationPreviewText__FM5S5",mrEscalationDescription:"ManageRemainder-module_mrEscalationDescription__z-3q8",mrReorderGroup:"ManageRemainder-module_mrReorderGroup__sLaAn",mrReminderItem:"ManageRemainder-module_mrReminderItem__kwd0b",mrReminderLabelBox:"ManageRemainder-module_mrReminderLabelBox__KRi5V",mrReminderLabelInner:"ManageRemainder-module_mrReminderLabelInner__GuTh-",mrReminderContent:"ManageRemainder-module_mrReminderContent__yKbGS",mrDragHandle:"ManageRemainder-module_mrDragHandle__4Lz8t",mrReminderBox:"ManageRemainder-module_mrReminderBox__ur54z",mrReminderFields:"ManageRemainder-module_mrReminderFields__yQROF",mrReminderHeader:"ManageRemainder-module_mrReminderHeader__wMUF6",mrReminderAssignee:"ManageRemainder-module_mrReminderAssignee__0p1Gb",mrReminderAvatar:"ManageRemainder-module_mrReminderAvatar__6KM5V",mrReminderInitials:"ManageRemainder-module_mrReminderInitials__bUFkd",mrReminderName:"ManageRemainder-module_mrReminderName__zjceM",mrReminderStatement:"ManageRemainder-module_mrReminderStatement__7Y0B-",mrReminderStatementText:"ManageRemainder-module_mrReminderStatementText__LodbK",mrReminderDateFields:"ManageRemainder-module_mrReminderDateFields__GT4N9",mrReminderField:"ManageRemainder-module_mrReminderField__XBiO4",mrReminderFieldLabel:"ManageRemainder-module_mrReminderFieldLabel__S9dXV",mrReminderDatePicker:"ManageRemainder-module_mrReminderDatePicker__Vgbui",mrReminderDueDate:"ManageRemainder-module_mrReminderDueDate__7nawQ",mrReminderFrequency:"ManageRemainder-module_mrReminderFrequency__Qq1qa",mrReminderFrequencyText:"ManageRemainder-module_mrReminderFrequencyText__lGfl0",mrEscalationCheckbox:"ManageRemainder-module_mrEscalationCheckbox__xZrG3",mrEscalationCheckboxHeader:"ManageRemainder-module_mrEscalationCheckboxHeader__1GgFB",mrEscalationContent:"ManageRemainder-module_mrEscalationContent__ItAyr",mrEscalationCondition:"ManageRemainder-module_mrEscalationCondition__4GCeD",mrEscalationFields:"ManageRemainder-module_mrEscalationFields__oFHp-",mrEscalationFieldGroup:"ManageRemainder-module_mrEscalationFieldGroup__uES3-",mrEscalationFieldGroupLarge:"ManageRemainder-module_mrEscalationFieldGroupLarge__MpVYP",mrEscalationFieldGroupSmall:"ManageRemainder-module_mrEscalationFieldGroupSmall__FFbRJ",mrEscalationFieldText:"ManageRemainder-module_mrEscalationFieldText__n7EfI",mrDropdownButton:"ManageRemainder-module_mrDropdownButton__9wvGh",mrCalendarPanel:"ManageRemainder-module_mrCalendarPanel__PnMpt",mrCalendarCollapsed:"ManageRemainder-module_mrCalendarCollapsed__mb-bI",mrCalendarToggle:"ManageRemainder-module_mrCalendarToggle__9HIet",mrNoPointerEvents:"ManageRemainder-module_mrNoPointerEvents__OQbav",mrPointerEventsAuto:"ManageRemainder-module_mrPointerEventsAuto__0avRT",calendarContainer:"ManageRemainder-module_calendarContainer__N804t",calendarHeader:"ManageRemainder-module_calendarHeader__BjE9o",calendarHeaderTitle:"ManageRemainder-module_calendarHeaderTitle__U8NmV",calendarHeaderInfo:"ManageRemainder-module_calendarHeaderInfo__s05VQ",monthNav:"ManageRemainder-module_monthNav__FBbyi",monthNavBtn:"ManageRemainder-module_monthNavBtn__oor7V",monthNavTitle:"ManageRemainder-module_monthNavTitle__zgDDq",weekdayHeader:"ManageRemainder-module_weekdayHeader__XciP8",weekdayLabel:"ManageRemainder-module_weekdayLabel__dDWJo",dayGrid:"ManageRemainder-module_dayGrid__dT0og",dayCell:"ManageRemainder-module_dayCell__AGx-w",dayCellPast:"ManageRemainder-module_dayCellPast__91hbu",dayCellToday:"ManageRemainder-module_dayCellToday__q8Wvi",dayNumber:"ManageRemainder-module_dayNumber__6yOVW",dayNumberCurrent:"ManageRemainder-module_dayNumberCurrent__6ML9j",dayNumberOutside:"ManageRemainder-module_dayNumberOutside__JQ-t7",indicatorWrapper:"ManageRemainder-module_indicatorWrapper__5FOym",indicatorDot:"ManageRemainder-module_indicatorDot__ElweF",indicatorDotOverlap:"ManageRemainder-module_indicatorDotOverlap__QPBRy",tooltipContent:"ManageRemainder-module_tooltipContent__ErzOu",tooltipHeader:"ManageRemainder-module_tooltipHeader__Q4qHO",tooltipTitle:"ManageRemainder-module_tooltipTitle__iZtI4",tooltipDate:"ManageRemainder-module_tooltipDate__ulMaQ",tooltipAssignees:"ManageRemainder-module_tooltipAssignees__jGc-Y",tooltipAssigneeRow:"ManageRemainder-module_tooltipAssigneeRow__nzr3m",tooltipAssigneeInfo:"ManageRemainder-module_tooltipAssigneeInfo__vIXTP",tooltipAssigneeDot:"ManageRemainder-module_tooltipAssigneeDot__yz6E6",tooltipAssigneeName:"ManageRemainder-module_tooltipAssigneeName__JJbid",tooltipAssigneeCount:"ManageRemainder-module_tooltipAssigneeCount__49OVk",legendWrapper:"ManageRemainder-module_legendWrapper__OfxhE",legendInner:"ManageRemainder-module_legendInner__iwIe7",legendItem:"ManageRemainder-module_legendItem__zbxBG",legendItemAssignee1:"ManageRemainder-module_legendItemAssignee1__I6F-D",legendItemAssignee2:"ManageRemainder-module_legendItemAssignee2__YObVW",legendItemAssignee3:"ManageRemainder-module_legendItemAssignee3__uCkBW",legendLabel:"ManageRemainder-module_legendLabel__Va4Sw",legendLabelAssignee1:"ManageRemainder-module_legendLabelAssignee1__vG-F4",legendLabelAssignee2:"ManageRemainder-module_legendLabelAssignee2__CbGVb",legendLabelAssignee3:"ManageRemainder-module_legendLabelAssignee3__cz-57",checkboxIconUnchecked:"ManageRemainder-module_checkboxIconUnchecked__xoI0S",checkboxIconChecked:"ManageRemainder-module_checkboxIconChecked__Y3mN2",checkboxIconCheckedAssignee1:"ManageRemainder-module_checkboxIconCheckedAssignee1__817aZ",checkboxIconCheckedAssignee2:"ManageRemainder-module_checkboxIconCheckedAssignee2__hTAKp",checkboxIconCheckedAssignee3:"ManageRemainder-module_checkboxIconCheckedAssignee3__hQwwN",checkboxCheckSvg:"ManageRemainder-module_checkboxCheckSvg__R87mg",bottomLegend:"ManageRemainder-module_bottomLegend__rRzkt",bottomLegendItem:"ManageRemainder-module_bottomLegendItem__u90vA",bottomLegendSwatch:"ManageRemainder-module_bottomLegendSwatch__9uu1M",bottomLegendSwatchPast:"ManageRemainder-module_bottomLegendSwatchPast__-DcRZ",bottomLegendSwatchFailed:"ManageRemainder-module_bottomLegendSwatchFailed__9lK2I",bottomLegendLabel:"ManageRemainder-module_bottomLegendLabel__9eDD-"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const a=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;a&&e.setAttribute("nonce",a),e.appendChild(document.createTextNode(".ManageRemainder-module_mrContainer__kVgxT{align-items:center;display:flex;flex-direction:column;gap:1rem;justify-content:center;margin-top:1rem}.ManageRemainder-module_mrSectionBox__bEDtY{border:1px solid #b6c1ca;border-radius:10px;cursor:pointer;display:flex;flex-direction:column;gap:.75rem;padding:.75rem;width:100%}.ManageRemainder-module_mrSectionHeader__5k1HQ{display:flex;flex-direction:column;gap:.25rem}.ManageRemainder-module_mrSectionHeaderContent__eKJWh{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between;width:100%}.ManageRemainder-module_mrSectionHeaderLeft__I-hzD{display:flex;flex-direction:column;gap:.25rem}.ManageRemainder-module_mrSectionHeaderRight__W-BY3{align-items:center;display:flex;gap:.25rem;justify-content:flex-start}.ManageRemainder-module_mrSectionTitleWrapper__NA6i-{align-items:center;display:flex;gap:.5rem}.ManageRemainder-module_mrSectionTitleIcon__6pWZz{align-items:center;display:flex;height:.75rem;justify-content:center;width:.75rem}.ManageRemainder-module_mrSectionTitle__BPAU2{color:#334155;font-size:.875rem;font-weight:600}.ManageRemainder-module_mrSectionDescription__HdkjC{color:#334155;font-size:.75rem;font-weight:400}.ManageRemainder-module_mrIconSmall__kbiWd{color:#334155;height:.75rem;width:.75rem}.ManageRemainder-module_mrIconInfo__U8Ylz{color:#64748b;height:1rem;width:1rem}.ManageRemainder-module_mrIconArrow__wMp9q{stroke:#334155;height:.75rem;width:.75rem}.ManageRemainder-module_mrIconAction__l9uVi{height:1rem;width:1rem}.ManageRemainder-module_mrIconPreview__oYo84{stroke:#64748b;height:1rem;width:1rem}.ManageRemainder-module_mrIconCalendar__2gaaf{color:#1e293b;height:1.25rem;width:1.25rem}.ManageRemainder-module_mrIconChevronToggle__LjUy1{color:#4f46e5;height:1rem;position:fixed;width:1rem}.ManageRemainder-module_mrIconDropdown__-heGj{height:.75rem;width:.75rem}.ManageRemainder-module_mrIconSuccess__EMJrR{color:#16a34a;height:1.5rem;width:1.5rem}.ManageRemainder-module_mrChevronButton__QKLsI{align-items:center;display:flex;justify-content:center}.ManageRemainder-module_mrChevronIcon__CxLkq{height:1.25rem;transition:transform .2s ease;width:1.25rem}.ManageRemainder-module_mrChevronIcon__CxLkq.ManageRemainder-module_mrChevronRotated__NL7Ho{transform:rotate(180deg)}.ManageRemainder-module_mrSuccessMessage__4N0gO{align-items:center;display:inline-flex;flex-direction:column;gap:.75rem;width:100%}.ManageRemainder-module_mrSuccessIcon__PsybU{align-items:center;background-color:#dcfce7;border-radius:9999px;box-shadow:0 0 0 4px #fff;display:flex;height:3rem;justify-content:center;width:3rem}.ManageRemainder-module_mrSuccessIconInner__yEl8-{height:1.5rem;position:relative;width:1.5rem}.ManageRemainder-module_mrSuccessText__-hXJh{align-items:center;display:flex;flex-direction:column;gap:.25rem;text-align:center}.ManageRemainder-module_mrSuccessTitle__Zakof{color:#166534;font-size:1rem;font-weight:500;line-height:1.5}.ManageRemainder-module_mrSuccessDescription__-r7A8{color:#22c55e;font-size:.875rem;font-weight:400;line-height:1.25}.ManageRemainder-module_mrRecipientsSection__L0f1k{display:flex;flex-direction:column;gap:.5rem}.ManageRemainder-module_mrRecipientsLabel__Escta{color:#3f3f46;font-size:.75rem;font-weight:500}.ManageRemainder-module_mrRecipientsGrid__-7giX{display:flex;flex-wrap:wrap;gap:.75rem;margin-bottom:.75rem}.ManageRemainder-module_mrRecipientItem__C0uw5{align-items:center;background-color:#fff;border:1px solid #cbd5e1;border-radius:.375rem;display:flex;gap:.5rem;padding:.25rem .5rem}.ManageRemainder-module_mrRecipientInfo__djuEp{align-items:center;display:flex;gap:.5rem}.ManageRemainder-module_mrRecipientAvatar__g6YDo{align-items:center;border-radius:9999px;display:flex;font-size:.6875rem;font-weight:500;height:1.5rem;justify-content:center;width:1.5rem}.ManageRemainder-module_mrRecipientName__gFCJU{color:#3f3f46;font-size:.875rem}.ManageRemainder-module_mrCheckboxUnchecked__j0wYE{background-color:#fff;border:1px solid #d0d5dd;border-radius:.25rem;height:1rem;width:1rem}.ManageRemainder-module_mrCheckboxChecked__TowNb{align-items:center;background-color:#fff;border:1px solid #6938ef;border-radius:.25rem;display:flex;height:1rem;justify-content:center;width:1rem}.ManageRemainder-module_mrCheckboxIcon__RVL-V{height:.625rem;width:.625rem}.ManageRemainder-module_mrActionsSection__in30u{display:flex;gap:.75rem}.ManageRemainder-module_mrActionButton__x9IEC{align-items:center;border:none;border-radius:.375rem;cursor:pointer;display:flex;flex:1;font-size:.875rem;font-weight:500;gap:.5rem;height:2.25rem;justify-content:center}.ManageRemainder-module_mrActionButtonSecondary__GBvpQ{background-color:#fff;border:1px solid #a5b4fc;color:#4f46e5}.ManageRemainder-module_mrActionButtonSecondary__GBvpQ:hover{background-color:#f3f4f6}.ManageRemainder-module_mrActionButtonPrimary__vRNbF{background-color:#4f46e5;color:#fff}.ManageRemainder-module_mrActionButtonPrimary__vRNbF:hover{background-color:#4338ca}.ManageRemainder-module_mrMainContent__2gAUU{display:flex;flex-direction:row;gap:1.75rem;width:100%}.ManageRemainder-module_mrEscalationContainer__V4PfB{background-color:#ffffffb3;border-radius:10px;display:flex;flex:1;flex-direction:column;gap:.75rem;min-width:0;outline:1px solid #b6c1ca;outline-offset:-1px;padding:.75rem}.ManageRemainder-module_mrEscalationHeaderWrapper__vOg2K{cursor:pointer;display:flex;flex-direction:column;gap:.25rem;justify-content:space-between}.ManageRemainder-module_mrEscalationHeader__sV-tw{align-items:center;display:flex;gap:.5rem;justify-content:space-between}.ManageRemainder-module_mrEscalationTitleWrapper__G90xv{align-items:center;display:flex;gap:.5rem}.ManageRemainder-module_mrEscalationTitleText__X233z{color:#3f3f46;font-size:.875rem;font-weight:600;line-height:1.25}.ManageRemainder-module_mrTooltipIcon__QpPGO{height:1rem;overflow:hidden;position:relative;width:1rem}.ManageRemainder-module_mrEscalationActions__RoHhx{align-items:center;display:flex;gap:.5rem}.ManageRemainder-module_mrEscalationPreviewButton__68J90{align-items:center;background-color:#fff;border:none;border-radius:1.29rem;box-shadow:0 1px 2px 0 #0000000d;cursor:pointer;display:flex;gap:.375rem;height:1.75rem;outline:.54px solid #d1d5db;outline-offset:-.54px;padding:.375rem .875rem}.ManageRemainder-module_mrEscalationPreviewIcon__KNa9K{height:1rem;overflow:hidden;position:relative;width:1rem}.ManageRemainder-module_mrEscalationPreviewText__FM5S5{color:#6b7280;font-size:.75rem;font-weight:400;line-height:1rem}.ManageRemainder-module_mrEscalationDescription__z-3q8{color:#334155;font-size:.75rem;font-weight:400}.ManageRemainder-module_mrReorderGroup__sLaAn{display:flex;flex-direction:column;gap:1.5rem}.ManageRemainder-module_mrReminderItem__kwd0b{display:flex;gap:1rem;justify-content:space-between;width:100%}.ManageRemainder-module_mrReminderLabelBox__KRi5V{display:flex;flex-shrink:0;justify-content:center;width:90px}.ManageRemainder-module_mrReminderLabelInner__GuTh-{align-items:center;display:flex}.ManageRemainder-module_mrReminderContent__yKbGS{align-items:center;display:flex;gap:1rem;width:100%}.ManageRemainder-module_mrDragHandle__4Lz8t{align-items:center;cursor:grab;display:flex;gap:.75rem}.ManageRemainder-module_mrReminderBox__ur54z{border-radius:.75rem;padding:.5rem;width:100%}.ManageRemainder-module_mrReminderFields__yQROF{display:flex;flex-direction:column;flex-wrap:wrap;gap:1rem;width:100%}.ManageRemainder-module_mrReminderHeader__wMUF6{align-items:flex-start;display:flex;gap:1rem;justify-content:space-between;width:100%}.ManageRemainder-module_mrReminderAssignee__0p1Gb{align-items:center;display:flex;gap:.75rem}.ManageRemainder-module_mrReminderAvatar__6KM5V{align-items:center;background-color:#dbeafe;border-radius:9999px;display:flex;height:1.75rem;justify-content:center;width:1.75rem}.ManageRemainder-module_mrReminderInitials__bUFkd{color:#1e40af;font-size:.625rem;font-weight:500}.ManageRemainder-module_mrReminderName__zjceM{color:#1f2937;font-size:.75rem;font-weight:500}.ManageRemainder-module_mrReminderStatement__7Y0B-{border-radius:9999px;display:flex;padding:.5rem .75rem}.ManageRemainder-module_mrReminderStatementText__LodbK{font-size:.625rem;font-weight:500;letter-spacing:-.01em}.ManageRemainder-module_mrReminderDateFields__GT4N9{align-items:flex-start;display:flex;gap:1.5rem;width:100%}.ManageRemainder-module_mrReminderField__XBiO4{width:100%}.ManageRemainder-module_mrReminderFieldLabel__S9dXV{color:#3f3f46;font-size:.75rem;font-weight:500;margin-bottom:.25rem}.ManageRemainder-module_mrReminderDatePicker__Vgbui{align-items:center;box-shadow:0 1px 2px 0 #0000000d;color:#3f3f46;display:flex;font-size:.75rem;gap:.75rem;height:1.75rem;justify-content:space-between}.ManageRemainder-module_mrReminderDueDate__7nawQ{align-items:center;background-color:#f1f5f9;border:.5px solid #cbd5e1;border-radius:0;color:#64748b;display:flex;font-size:.75rem;height:1.75rem;padding:0 .75rem}.ManageRemainder-module_mrReminderFrequency__Qq1qa{align-items:center;display:flex;gap:.5rem}.ManageRemainder-module_mrReminderFrequencyText__lGfl0{color:#374151;font-size:.75rem}.ManageRemainder-module_mrEscalationCheckbox__xZrG3{align-items:flex-start;border:1px solid #e5e7eb;border-radius:.25rem;color:#3f3f46;display:flex;flex-direction:column;font-size:.75rem;font-weight:500;gap:.5rem;padding:.5rem;width:100%}.ManageRemainder-module_mrEscalationCheckboxHeader__1GgFB{align-items:flex-start;display:flex;gap:.5rem;justify-content:flex-start;width:100%}.ManageRemainder-module_mrEscalationContent__ItAyr{display:flex;flex-direction:column;gap:.5rem;overflow:hidden;width:100%}.ManageRemainder-module_mrEscalationCondition__4GCeD{color:#3f3f46;font-family:Inter,sans-serif;font-size:.75rem;font-weight:500;line-height:1;margin-top:.75rem;width:100%}.ManageRemainder-module_mrEscalationFields__oFHp-{align-items:flex-end;display:flex;flex-wrap:wrap;gap:1.5rem;gap:.625rem;width:100%}.ManageRemainder-module_mrEscalationFieldGroup__uES3-{display:flex;flex:1;gap:.75rem;min-width:130px}.ManageRemainder-module_mrEscalationFieldGroupLarge__MpVYP{flex:1;min-width:265px}.ManageRemainder-module_mrEscalationFieldGroupSmall__FFbRJ{display:flex;flex:1;min-width:88px}.ManageRemainder-module_mrEscalationFieldText__n7EfI{color:#3f3f46;font-family:Inter,sans-serif;font-size:.75rem;font-weight:500;line-height:1.5;min-width:152px}.ManageRemainder-module_mrDropdownButton__9wvGh{align-items:center;cursor:pointer;display:flex;justify-content:center}.ManageRemainder-module_mrCalendarPanel__PnMpt{flex-shrink:0;position:relative}.ManageRemainder-module_mrCalendarCollapsed__mb-bI{background-color:#fff;border:1px solid #b6c1ca;border-radius:10px;display:flex;height:100%;justify-content:center;padding-top:281px;width:43px}.ManageRemainder-module_mrCalendarToggle__9HIet{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:3rem;justify-content:center;left:-26px;position:absolute;top:50%;transform:translateY(-50%);width:2.25rem;z-index:10}@media (max-width:1024px){.ManageRemainder-module_mrMainContent__2gAUU{flex-direction:column;gap:1rem}.ManageRemainder-module_mrCalendarPanel__PnMpt{width:100%}.ManageRemainder-module_mrCalendarToggle__9HIet{display:none}}@media (max-width:768px){.ManageRemainder-module_mrContainer__kVgxT{gap:.5rem;margin-top:.5rem}.ManageRemainder-module_mrSectionBox__bEDtY{gap:.5rem;padding:.5rem}.ManageRemainder-module_mrActionsSection__in30u,.ManageRemainder-module_mrSectionHeaderContent__eKJWh{flex-direction:column}.ManageRemainder-module_mrActionButton__x9IEC{height:2rem}.ManageRemainder-module_mrReminderDateFields__GT4N9{flex-direction:column;gap:1rem}.ManageRemainder-module_mrReminderContent__yKbGS,.ManageRemainder-module_mrReminderItem__kwd0b{gap:.5rem}.ManageRemainder-module_mrEscalationFields__oFHp-{flex-direction:column}.ManageRemainder-module_mrEscalationFieldGroupLarge__MpVYP,.ManageRemainder-module_mrEscalationFieldGroupSmall__FFbRJ,.ManageRemainder-module_mrEscalationFieldGroup__uES3-{min-width:100%;width:100%}.ManageRemainder-module_mrEscalationFieldText__n7EfI{min-width:auto}.ManageRemainder-module_mrReminderLabelBox__KRi5V{width:100%}}button:focus{outline:2px solid #4f46e5;outline-offset:2px}button:active{opacity:.9}.ManageRemainder-module_mrHiddenSection__c67oj{overflow:hidden}.ManageRemainder-module_mrNoPointerEvents__OQbav{pointer-events:none}.ManageRemainder-module_mrPointerEventsAuto__0avRT{pointer-events:auto}.ManageRemainder-module_calendarContainer__N804t{background-color:#fff;border:1px solid #b6c1ca;border-radius:8px;height:100%;min-width:345px;padding:16px}.ManageRemainder-module_calendarHeader__BjE9o{align-items:center;display:flex;gap:6px;margin-bottom:24px}.ManageRemainder-module_calendarHeaderTitle__U8NmV{align-items:center;color:#334155;display:flex;font-size:14px;font-weight:600;gap:6px;line-height:20px}.ManageRemainder-module_calendarHeaderInfo__s05VQ{height:16px;width:16px}.ManageRemainder-module_monthNav__FBbyi{align-items:center;display:flex;justify-content:space-between;margin-bottom:24px}.ManageRemainder-module_monthNavBtn__oor7V{align-items:center;background:none;border:1px solid #dce0e5;border-radius:8px;cursor:pointer;display:flex;justify-content:center;padding:8px}.ManageRemainder-module_monthNavTitle__zgDDq{color:#14181f;font-size:15px;font-weight:600;margin:0}.ManageRemainder-module_weekdayHeader__XciP8{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:8px}.ManageRemainder-module_weekdayLabel__dDWJo{color:#6f7c8e;font-size:15px;font-weight:400;text-align:center}.ManageRemainder-module_dayGrid__dT0og{display:grid;gap:8px 11px;grid-template-columns:repeat(7,1fr);margin-top:16px}.ManageRemainder-module_dayCell__AGx-w{align-items:center;border-radius:8px;cursor:pointer;display:flex;flex-direction:column;height:35px;justify-content:center}.ManageRemainder-module_dayCellPast__91hbu{background-color:#daf7d2}.ManageRemainder-module_dayCellToday__q8Wvi{border:2px solid #4f46e5}.ManageRemainder-module_dayNumber__6yOVW{font-size:14px}.ManageRemainder-module_dayNumberCurrent__6ML9j{color:#0f172a}.ManageRemainder-module_dayNumberOutside__JQ-t7{color:#94a3b8}.ManageRemainder-module_indicatorWrapper__5FOym{align-items:center;display:flex}.ManageRemainder-module_indicatorDot__ElweF{border-radius:50%;height:6px;width:6px}.ManageRemainder-module_indicatorDotOverlap__QPBRy{margin-left:-1px}.ManageRemainder-module_tooltipContent__ErzOu{background-color:#f8fafc;border-radius:8px;min-width:120px;padding:8px}.ManageRemainder-module_tooltipHeader__Q4qHO{border-bottom:1px solid #cbd5e1;margin-bottom:4px;padding-bottom:4px}.ManageRemainder-module_tooltipTitle__iZtI4{color:#0f172a;font-size:10px;font-weight:500;line-height:16px}.ManageRemainder-module_tooltipDate__ulMaQ{color:#334155;font-size:8px;font-weight:400;line-height:16px}.ManageRemainder-module_tooltipAssignees__jGc-Y{display:flex;flex-direction:column;gap:2px}.ManageRemainder-module_tooltipAssigneeRow__nzr3m{align-items:center;display:flex;gap:12px;justify-content:space-between}.ManageRemainder-module_tooltipAssigneeInfo__vIXTP{align-items:center;display:flex;gap:4px}.ManageRemainder-module_tooltipAssigneeDot__yz6E6{border-radius:50%;height:8px;width:8px}.ManageRemainder-module_tooltipAssigneeName__JJbid{color:#0f172a;font-size:9px;font-weight:400;line-height:16px}.ManageRemainder-module_tooltipAssigneeCount__49OVk{color:#0f172a;font-size:9px;font-weight:500;line-height:16px}.ManageRemainder-module_legendWrapper__OfxhE{align-items:flex-start;display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:38px}.ManageRemainder-module_legendInner__iwIe7{align-items:flex-start;display:flex;flex-wrap:wrap;gap:5px;justify-content:space-evenly}.ManageRemainder-module_legendItem__zbxBG{align-items:center;border-radius:4px;cursor:pointer;display:flex;gap:4px;padding:4px 8px}.ManageRemainder-module_legendItemAssignee1__I6F-D{background-color:#fdf2f8;border:1px solid #be185d}.ManageRemainder-module_legendItemAssignee2__YObVW{background-color:#eef2ff;border:1px solid #4338ca}.ManageRemainder-module_legendItemAssignee3__uCkBW{background-color:#fff7ed;border:1px solid #f87171;justify-content:center}.ManageRemainder-module_legendLabel__Va4Sw{font-size:12px;font-weight:500}.ManageRemainder-module_legendLabelAssignee1__vG-F4{color:#be185d}.ManageRemainder-module_legendLabelAssignee2__CbGVb{color:#4338ca}.ManageRemainder-module_legendLabelAssignee3__cz-57{color:#f87171}.ManageRemainder-module_checkboxIconUnchecked__xoI0S{background-color:#fff;border:1px solid #d0d5dd;border-radius:4px;height:16px;width:16px}.ManageRemainder-module_checkboxIconChecked__Y3mN2{align-items:center;background-color:#fff;border-radius:4px;display:flex;height:16px;justify-content:center;width:16px}.ManageRemainder-module_checkboxIconCheckedAssignee1__817aZ{border:1px solid #c11574}.ManageRemainder-module_checkboxIconCheckedAssignee2__hTAKp{border:1px solid #3538cd}.ManageRemainder-module_checkboxIconCheckedAssignee3__hQwwN{border:1px solid #ff6058}.ManageRemainder-module_checkboxCheckSvg__R87mg{height:10px;width:10px}.ManageRemainder-module_bottomLegend__rRzkt{align-items:center;display:inline-flex;gap:24px;margin-left:4px;margin-top:16px}.ManageRemainder-module_bottomLegendItem__u90vA{align-items:center;display:flex;gap:4px}.ManageRemainder-module_bottomLegendSwatch__9uu1M{border-radius:2px;height:12px;width:12px}.ManageRemainder-module_bottomLegendSwatchPast__-DcRZ{background-color:#daf7d2}.ManageRemainder-module_bottomLegendSwatchFailed__9lK2I{background-color:#fecaca}.ManageRemainder-module_bottomLegendLabel__9eDD-{color:#334155;font-size:12px;font-weight:500}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={mrContainer:"ManageRemainder-module_mrContainer__kVgxT",mrSectionBox:"ManageRemainder-module_mrSectionBox__bEDtY",mrSectionHeader:"ManageRemainder-module_mrSectionHeader__5k1HQ",mrSectionHeaderContent:"ManageRemainder-module_mrSectionHeaderContent__eKJWh",mrSectionHeaderLeft:"ManageRemainder-module_mrSectionHeaderLeft__I-hzD",mrSectionHeaderRight:"ManageRemainder-module_mrSectionHeaderRight__W-BY3",mrSectionTitleWrapper:"ManageRemainder-module_mrSectionTitleWrapper__NA6i-",mrSectionTitleIcon:"ManageRemainder-module_mrSectionTitleIcon__6pWZz",mrSectionTitle:"ManageRemainder-module_mrSectionTitle__BPAU2",mrSectionDescription:"ManageRemainder-module_mrSectionDescription__HdkjC",mrIconSmall:"ManageRemainder-module_mrIconSmall__kbiWd",mrIconInfo:"ManageRemainder-module_mrIconInfo__U8Ylz",mrIconArrow:"ManageRemainder-module_mrIconArrow__wMp9q",mrIconAction:"ManageRemainder-module_mrIconAction__l9uVi",mrIconPreview:"ManageRemainder-module_mrIconPreview__oYo84",mrIconCalendar:"ManageRemainder-module_mrIconCalendar__2gaaf",mrIconChevronToggle:"ManageRemainder-module_mrIconChevronToggle__LjUy1",mrIconDropdown:"ManageRemainder-module_mrIconDropdown__-heGj",mrIconSuccess:"ManageRemainder-module_mrIconSuccess__EMJrR",mrChevronButton:"ManageRemainder-module_mrChevronButton__QKLsI",mrChevronIcon:"ManageRemainder-module_mrChevronIcon__CxLkq",mrChevronRotated:"ManageRemainder-module_mrChevronRotated__NL7Ho",mrSuccessMessage:"ManageRemainder-module_mrSuccessMessage__4N0gO",mrSuccessIcon:"ManageRemainder-module_mrSuccessIcon__PsybU",mrSuccessIconInner:"ManageRemainder-module_mrSuccessIconInner__yEl8-",mrSuccessText:"ManageRemainder-module_mrSuccessText__-hXJh",mrSuccessTitle:"ManageRemainder-module_mrSuccessTitle__Zakof",mrSuccessDescription:"ManageRemainder-module_mrSuccessDescription__-r7A8",mrHiddenSection:"ManageRemainder-module_mrHiddenSection__c67oj",mrRecipientsSection:"ManageRemainder-module_mrRecipientsSection__L0f1k",mrRecipientsLabel:"ManageRemainder-module_mrRecipientsLabel__Escta",mrRecipientsGrid:"ManageRemainder-module_mrRecipientsGrid__-7giX",mrRecipientItem:"ManageRemainder-module_mrRecipientItem__C0uw5",mrRecipientInfo:"ManageRemainder-module_mrRecipientInfo__djuEp",mrRecipientAvatar:"ManageRemainder-module_mrRecipientAvatar__g6YDo",mrRecipientName:"ManageRemainder-module_mrRecipientName__gFCJU",mrCheckboxUnchecked:"ManageRemainder-module_mrCheckboxUnchecked__j0wYE",mrCheckboxChecked:"ManageRemainder-module_mrCheckboxChecked__TowNb",mrCheckboxIcon:"ManageRemainder-module_mrCheckboxIcon__RVL-V",mrActionsSection:"ManageRemainder-module_mrActionsSection__in30u",mrActionButton:"ManageRemainder-module_mrActionButton__x9IEC",mrActionButtonSecondary:"ManageRemainder-module_mrActionButtonSecondary__GBvpQ",mrActionButtonPrimary:"ManageRemainder-module_mrActionButtonPrimary__vRNbF",mrMainContent:"ManageRemainder-module_mrMainContent__2gAUU",mrEscalationContainer:"ManageRemainder-module_mrEscalationContainer__V4PfB",mrEscalationHeaderWrapper:"ManageRemainder-module_mrEscalationHeaderWrapper__vOg2K",mrEscalationHeader:"ManageRemainder-module_mrEscalationHeader__sV-tw",mrEscalationTitleWrapper:"ManageRemainder-module_mrEscalationTitleWrapper__G90xv",mrEscalationTitleText:"ManageRemainder-module_mrEscalationTitleText__X233z",mrTooltipIcon:"ManageRemainder-module_mrTooltipIcon__QpPGO",mrEscalationActions:"ManageRemainder-module_mrEscalationActions__RoHhx",mrEscalationPreviewButton:"ManageRemainder-module_mrEscalationPreviewButton__68J90",mrEscalationPreviewIcon:"ManageRemainder-module_mrEscalationPreviewIcon__KNa9K",mrEscalationPreviewText:"ManageRemainder-module_mrEscalationPreviewText__FM5S5",mrEscalationDescription:"ManageRemainder-module_mrEscalationDescription__z-3q8",mrReorderGroup:"ManageRemainder-module_mrReorderGroup__sLaAn",mrReminderItem:"ManageRemainder-module_mrReminderItem__kwd0b",mrReminderLabelBox:"ManageRemainder-module_mrReminderLabelBox__KRi5V",mrReminderLabelInner:"ManageRemainder-module_mrReminderLabelInner__GuTh-",mrReminderContent:"ManageRemainder-module_mrReminderContent__yKbGS",mrDragHandle:"ManageRemainder-module_mrDragHandle__4Lz8t",mrReminderBox:"ManageRemainder-module_mrReminderBox__ur54z",mrReminderFields:"ManageRemainder-module_mrReminderFields__yQROF",mrReminderHeader:"ManageRemainder-module_mrReminderHeader__wMUF6",mrReminderAssignee:"ManageRemainder-module_mrReminderAssignee__0p1Gb",mrReminderAvatar:"ManageRemainder-module_mrReminderAvatar__6KM5V",mrReminderInitials:"ManageRemainder-module_mrReminderInitials__bUFkd",mrReminderName:"ManageRemainder-module_mrReminderName__zjceM",mrReminderStatement:"ManageRemainder-module_mrReminderStatement__7Y0B-",mrReminderStatementText:"ManageRemainder-module_mrReminderStatementText__LodbK",mrReminderDateFields:"ManageRemainder-module_mrReminderDateFields__GT4N9",mrReminderField:"ManageRemainder-module_mrReminderField__XBiO4",mrReminderFieldLabel:"ManageRemainder-module_mrReminderFieldLabel__S9dXV",mrReminderDatePicker:"ManageRemainder-module_mrReminderDatePicker__Vgbui",mrReminderDueDate:"ManageRemainder-module_mrReminderDueDate__7nawQ",mrReminderFrequency:"ManageRemainder-module_mrReminderFrequency__Qq1qa",mrReminderFrequencyText:"ManageRemainder-module_mrReminderFrequencyText__lGfl0",mrEscalationCheckbox:"ManageRemainder-module_mrEscalationCheckbox__xZrG3",mrEscalationCheckboxHeader:"ManageRemainder-module_mrEscalationCheckboxHeader__1GgFB",mrEscalationContent:"ManageRemainder-module_mrEscalationContent__ItAyr",mrEscalationCondition:"ManageRemainder-module_mrEscalationCondition__4GCeD",mrEscalationFields:"ManageRemainder-module_mrEscalationFields__oFHp-",mrEscalationFieldGroup:"ManageRemainder-module_mrEscalationFieldGroup__uES3-",mrEscalationFieldGroupLarge:"ManageRemainder-module_mrEscalationFieldGroupLarge__MpVYP",mrEscalationFieldGroupSmall:"ManageRemainder-module_mrEscalationFieldGroupSmall__FFbRJ",mrEscalationFieldText:"ManageRemainder-module_mrEscalationFieldText__n7EfI",mrDropdownButton:"ManageRemainder-module_mrDropdownButton__9wvGh",mrCalendarPanel:"ManageRemainder-module_mrCalendarPanel__PnMpt",mrCalendarCollapsed:"ManageRemainder-module_mrCalendarCollapsed__mb-bI",mrCalendarToggle:"ManageRemainder-module_mrCalendarToggle__9HIet",mrNoPointerEvents:"ManageRemainder-module_mrNoPointerEvents__OQbav",mrPointerEventsAuto:"ManageRemainder-module_mrPointerEventsAuto__0avRT",calendarContainer:"ManageRemainder-module_calendarContainer__N804t",calendarHeader:"ManageRemainder-module_calendarHeader__BjE9o",calendarHeaderTitle:"ManageRemainder-module_calendarHeaderTitle__U8NmV",calendarHeaderInfo:"ManageRemainder-module_calendarHeaderInfo__s05VQ",monthNav:"ManageRemainder-module_monthNav__FBbyi",monthNavBtn:"ManageRemainder-module_monthNavBtn__oor7V",monthNavTitle:"ManageRemainder-module_monthNavTitle__zgDDq",weekdayHeader:"ManageRemainder-module_weekdayHeader__XciP8",weekdayLabel:"ManageRemainder-module_weekdayLabel__dDWJo",dayGrid:"ManageRemainder-module_dayGrid__dT0og",dayCell:"ManageRemainder-module_dayCell__AGx-w",dayCellPast:"ManageRemainder-module_dayCellPast__91hbu",dayCellToday:"ManageRemainder-module_dayCellToday__q8Wvi",dayNumber:"ManageRemainder-module_dayNumber__6yOVW",dayNumberCurrent:"ManageRemainder-module_dayNumberCurrent__6ML9j",dayNumberOutside:"ManageRemainder-module_dayNumberOutside__JQ-t7",indicatorWrapper:"ManageRemainder-module_indicatorWrapper__5FOym",indicatorDot:"ManageRemainder-module_indicatorDot__ElweF",indicatorDotOverlap:"ManageRemainder-module_indicatorDotOverlap__QPBRy",tooltipContent:"ManageRemainder-module_tooltipContent__ErzOu",tooltipHeader:"ManageRemainder-module_tooltipHeader__Q4qHO",tooltipTitle:"ManageRemainder-module_tooltipTitle__iZtI4",tooltipDate:"ManageRemainder-module_tooltipDate__ulMaQ",tooltipAssignees:"ManageRemainder-module_tooltipAssignees__jGc-Y",tooltipAssigneeRow:"ManageRemainder-module_tooltipAssigneeRow__nzr3m",tooltipAssigneeInfo:"ManageRemainder-module_tooltipAssigneeInfo__vIXTP",tooltipAssigneeDot:"ManageRemainder-module_tooltipAssigneeDot__yz6E6",tooltipAssigneeName:"ManageRemainder-module_tooltipAssigneeName__JJbid",tooltipAssigneeCount:"ManageRemainder-module_tooltipAssigneeCount__49OVk",legendWrapper:"ManageRemainder-module_legendWrapper__OfxhE",legendInner:"ManageRemainder-module_legendInner__iwIe7",legendItem:"ManageRemainder-module_legendItem__zbxBG",legendItemAssignee1:"ManageRemainder-module_legendItemAssignee1__I6F-D",legendItemAssignee2:"ManageRemainder-module_legendItemAssignee2__YObVW",legendItemAssignee3:"ManageRemainder-module_legendItemAssignee3__uCkBW",legendLabel:"ManageRemainder-module_legendLabel__Va4Sw",legendLabelAssignee1:"ManageRemainder-module_legendLabelAssignee1__vG-F4",legendLabelAssignee2:"ManageRemainder-module_legendLabelAssignee2__CbGVb",legendLabelAssignee3:"ManageRemainder-module_legendLabelAssignee3__cz-57",checkboxIconUnchecked:"ManageRemainder-module_checkboxIconUnchecked__xoI0S",checkboxIconChecked:"ManageRemainder-module_checkboxIconChecked__Y3mN2",checkboxIconCheckedAssignee1:"ManageRemainder-module_checkboxIconCheckedAssignee1__817aZ",checkboxIconCheckedAssignee2:"ManageRemainder-module_checkboxIconCheckedAssignee2__hTAKp",checkboxIconCheckedAssignee3:"ManageRemainder-module_checkboxIconCheckedAssignee3__hQwwN",checkboxCheckSvg:"ManageRemainder-module_checkboxCheckSvg__R87mg",bottomLegend:"ManageRemainder-module_bottomLegend__rRzkt",bottomLegendItem:"ManageRemainder-module_bottomLegendItem__u90vA",bottomLegendSwatch:"ManageRemainder-module_bottomLegendSwatch__9uu1M",bottomLegendSwatchPast:"ManageRemainder-module_bottomLegendSwatchPast__-DcRZ",bottomLegendSwatchFailed:"ManageRemainder-module_bottomLegendSwatchFailed__9lK2I",bottomLegendLabel:"ManageRemainder-module_bottomLegendLabel__9eDD-"};
|
|
2
2
|
//# sourceMappingURL=ManageRemainder.module.css.js.map
|
package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../store/ref.context.js");require("../UserStoryCard/cws/CwsEvent.js");var i,o=require("../UserStoryCard/cws/CwsEventProvider.js"),r=require("react-hot-toast");exports.SectionStatus=void 0,(i=exports.SectionStatus||(exports.SectionStatus={})).WAITING="waiting",i.IN_PROGRESS="in_progress",i.GENERATED="generated",i.FAILED="failed",i.GENERATE="generate",i.APPROVED="approved";const s=t.createContext(null),a="user-story-lib";exports.ToasterId=a,exports.default=({children:i,userStory:u,setUserStory:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../store/ref.context.js");require("../UserStoryCard/cws/CwsEvent.js");var i,o=require("../UserStoryCard/cws/CwsEventProvider.js"),r=require("react-hot-toast");exports.SectionStatus=void 0,(i=exports.SectionStatus||(exports.SectionStatus={})).WAITING="waiting",i.IN_PROGRESS="in_progress",i.GENERATED="generated",i.FAILED="failed",i.GENERATE="generate",i.APPROVED="approved";const s=t.createContext(null),a="user-story-lib";exports.ToasterId=a,exports.default=({children:i,userStory:u,setUserStory:d,aiReasoning:l,setAiReasoning:c,citations:g,setCitations:C,apiCachingConfig:f,customStyles:h,customIcons:p,searchQueryList:S,searchQueryReasoningIdList:m,citationConfig:v,chatHistory:I,chatCitationConfigs:R,gptCitationConfigs:x,diffEditConfig:y,aiReasoningAccordionOpenStates:E,persistedDataFiles:A,inlineUpdateComponentConfig:D,segmentComponentConfig:b,onEditBlocked:j,inlineManualComponentConfig:w,redlineConfig:P,sectionStatusConfig:q,customSectionConfig:T,updateRedlineDataParent:U,redlineCollaborativeConfig:F,onFetchOnDemandCitation:N})=>{const[O,_]=t.useState(0),[k,L]=t.useState(""),M=t.useMemo(()=>{if(0===u.length||0===l.length)return Array(u.length).fill(0);const e=Array.from({length:u.length},()=>[]);return l.forEach(t=>{const n=Number(t.relevance_score);if(isNaN(n)||n<=0)return;const i=`ai_reasoning$${t.id}`,o=u.findIndex(e=>{var t;return e.value.includes(i)||(null===(t=e.sub_features)||void 0===t?void 0:t.some(e=>e.value.includes(i)))});-1!==o&&e[o].push(n)}),e.map(e=>0===e.length?0:Math.round(e.reduce((e,t)=>e+t,0)/e.length))},[u,l]),G=t.useCallback(e=>{var t;const n=u.findIndex(t=>t.artifactId===e);return-1===n?0:null!==(t=M[n])&&void 0!==t?t:0},[u,M]),[H,Q]=t.useState(null);return e.jsxs(s.Provider,{value:{chatHistory:I,userStory:u,setUserStory:d,aiReasoning:l,setAiReasoning:c,citations:g,setCitations:C,apiCachingConfig:f,customStyles:h,customIcons:p,searchQueryList:S,searchQueryReasoningIdList:m,citationConfig:v,getAvgScoreForStory:G,chatCitationConfigs:R,gptCitationConfigs:x,diffEditConfig:y,aiReasoningAccordionOpenStates:E,persistedDataFiles:A,currentHighlightIndex:O,setCurrentHighlightIndex:_,inlineUpdateComponentConfig:D,segmentComponentConfig:b,onEditBlocked:j,inlineManualComponentConfig:w,redlineConfig:P,redlineDcoumentId:k,setRedlineDocumentId:L,sectionStatusConfig:q,customSectionConfig:T,updateRedlineDataParent:U,redlineCollaborativeConfig:F,selectedSectionToEdit:H,setSelectedSectionToEdit:Q,onFetchOnDemandCitation:N},children:[e.jsx(r.Toaster,{position:"top-right",toasterId:a}),(null==F?void 0:F.initiateCollaborativeFlow)?e.jsx(o.default,{applicationId:null==F?void 0:F.modeId,baseUrl:null==F?void 0:F.cwsBaseUrl,authToken:null==F?void 0:F.authToken,children:e.jsx(n.RefProvider,{children:i})}):e.jsx(n.RefProvider,{children:i})]})},exports.useRequirementAI=()=>{const e=t.useContext(s);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};
|
|
2
2
|
//# sourceMappingURL=RequirementAIWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("react/jsx-runtime"),t=require("react"),e=require("react-markdown"),o=require("rehype-raw"),n=require("lucide-react"),a=require("@mui/material"),l=require("./AiReasonMarkdownWrapper.module.css.js"),d=require("../../shared/ExpandableOl.js"),s=require("../citations/web-citation/WebCitationWithImageRenderer.js"),c=require("../citations/web-citation/WebCitationRenderer.js"),u=require("../citations/image-citation/ImageCitationRenderer.js"),r=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"),_=require("../citations/appmod-citation/AppmodCitationRenderer.js"),h=require("../citations/rca-citation/RCACitationRenderer.js"),f=require("../citations/readfile-citation/ReadFileCitationRenderer.js"),g=require("../citations/chat-citation/ChatCitationRenderer.js"),j=require("@e-llm-studio/citation"),C=require("../citations/big-enough/BigEnoughCitationRenderer.js"),b=require("./ScannedCitationRenderer.js"),x=require("../citations/gpt-web-citation/GptWebCitationRenderer.js");function y(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var S=y(e),I=y(o);const k=["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"],q=(i,t,e)=>{const o=Number.isFinite(t)&&Number.isFinite(e);return[...i.map((i,n)=>{const a=n>=t&&n<=e;return{...i,highlighted_text:o?a?i.message:"":i.highlighted_text}})]};exports.AiReasonMarkdownWrapper=({label:e,message:o,isExpandableOrderedListEnabled:y,customStyles:M,citationStyles:w,customIcons:R,onSelectProceed:F,isDisableProceedButton:N,big_enough_block:W})=>{const $=t.useRef(null),{citations:P,citationConfig:T,chatHistory:A,chatCitationConfigs:L,gptCitationConfigs:D}=v.useRequirementAI();console.log("Testing::Citations in Lib",P);const E=t.useMemo(()=>({h1:({node:t,...e})=>i.jsx("h1",{className:l.default.h1,style:null==M?void 0:M.h1,children:null==e?void 0:e.children}),h2:({node:t,...e})=>i.jsx("h2",{className:l.default.h2,style:null==M?void 0:M.h2,children:null==e?void 0:e.children}),h3:({node:t,...e})=>i.jsx("h2",{className:l.default.h3,style:null==M?void 0:M.h3,children:null==e?void 0:e.children}),b:({node:t,...e})=>i.jsx("b",{className:l.default.bold,style:null==M?void 0:M.b}),p:({node:t,...e})=>i.jsx("p",{...e,className:l.default.paragraph,style:null==M?void 0:M.p,children:null==e?void 0:e.children}),ol:({node:t,...o})=>y?i.jsx(d.default,{label:e,customStyles:null==M?void 0:M.expandOlStyle,onProceed:F,isProceedDisabled:N,aiReasoningCitation:P,citationStyles:w,customIcons:R,children:null==o?void 0:o.children}):i.jsx("ol",{className:l.default.orderedList,style:null==M?void 0:M.ol,children:null==o?void 0:o.children}),ul:({node:t,...e})=>i.jsx("ul",{className:l.default.unorderedList,children:null==e?void 0:e.children}),a:({inline:e,children:d,node:v,...y})=>{var S,I,F,N,$,E,O,G,H,z,U,B,V,X,J,K,Q,Y,Z,ii,ti,ei,oi,ni,ai,li,di,si,ci;const ui="true"===(null==y?void 0:y.table),ri=`${null==y?void 0:y.href}`,vi=null===(S=ri.split("$"))||void 0===S?void 0:S[0],mi=null===(I=ri.split("$"))||void 0===I?void 0:I[1],pi=("appmode_citation"===vi||"appmode_citations"===vi?(null==P?void 0:P.appmod_citations)||[]:"image_citation"===vi||"image_citations"===vi?(null==P?void 0:P.image_citations)||[]:"audio_citation"===vi||"audio_citations"===vi?(null==P?void 0:P.audio_citations)||[]:"document_citation"===vi||"document_citations"===vi?(null==P?void 0:P.file_citations)||[]:"rca_citation"===vi||"rca_citations"===vi?(null==P?void 0:P.rca_citations)||[]:"web_citation"===vi||"web_citations"===vi?(null==P?void 0:P.web_citations)||[]:"code_generated"===vi?(null==P?void 0:P.code_generated)||[]:"readfile_citation"===vi||"readfile_citations"===vi?(null==P?void 0:P.readfile_citations)||[]:"gpt_citation"===vi||"gpt_citations"===vi?(null==P?void 0:P.gpt_citations)||[]:"scanned_doc_citation"===vi||"scanned_doc_citations"===vi?(null==P?void 0:P.scanned_doc_citations)||[]:"big_enough_block"===vi&&W||[]).find(i=>i.citation_number===decodeURIComponent(mi));console.log("TESTING::citation",pi);const _i=k.includes(vi);if("big_enough_block"===vi&&pi)return console.log("Rendering big enough block with citation:",w),i.jsx(C.default,{title:d,citation:pi,customStyles:null==w?void 0:w.bigEnoughCitation,customIcons:R});if("chat_citation"===vi){if(!A||0===A.length)return null;let t=0,e=A.length-1;if("all"!==mi){const[i,o]=mi.split("-").map(Number);t=Number.isFinite(i)?i:0,e=Number.isFinite(o)?o:t,t=t>0?t-1:t,e=e<A.length-1?e+1:e}return i.jsx(g.default,{customIcon:null==R?void 0:R.chatCitationIcon,title:d,chatHistory:q(A,t,e),isTable:ui,chatCitationProps:null==L?void 0:L.chatCitationProps,onCitationClick:null==L?void 0:L.handleCitationClicked,customStyles:null==w?void 0:w.chatCitation,openInFullscreenOnClick:null==L?void 0:L.openInFullscreenOnClick})}if(("gpt_citation"===vi||"gpt_citations"===vi)&&pi)return(null===(F=null==pi?void 0:pi.customMetadata)||void 0===F?void 0:F.value)?i.jsx(x.default,{title:d,citation:pi,customStyles:null==w?void 0:w.webCitation,customIcons:R,content:o}):i.jsx(j.NonWebReasoningComponent,{item:{text:"",dataSource:null===($=null===(N=pi.customMetadata)||void 0===N?void 0:N.data_sources)||void 0===$?void 0:$[0],trainingDataTitle:null===(O=null===(E=pi.customMetadata)||void 0===E?void 0:E.training_data_title)||void 0===O?void 0:O[0],paraphrase:null===(H=null===(G=pi.customMetadata)||void 0===G?void 0:G.paraphrase)||void 0===H?void 0:H[0]},headerTitle:(null==D?void 0:D.title)||"GPT - Gemini 2.5 Flash",iconsConfig:{ChevronDownIcon:n.ChevronDown,ChevronUpIcon:n.ChevronUp,MaximizeIcon:n.Maximize2,CloseIcon:n.X},...null==D?void 0:D.gptCitationProps});if("image_citation"===vi&&!pi)return null;if("web_citation"===(null===(z=null==pi?void 0:pi.customMetadata)||void 0===z?void 0:z.type))return(null===(U=pi.customMetadata)||void 0===U?void 0:U.screenshot_url)?i.jsx(s.default,{title:d,citation:pi,customStyles:null==w?void 0:w.webCitation,customIcons:R}):i.jsx(c.default,{label:d,url:null===(B=pi.customMetadata)||void 0===B?void 0:B.link,customStyles:null==w?void 0:w.webCitation,customIcons:R});if("audio_transcript"===(null===(V=null==pi?void 0:pi.customMetadata)||void 0===V?void 0:V.type))return"stormee"===(null==pi?void 0:pi.customMetadata.audio_citation_mode)?i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(m.default,{title:`${d}`,citation:pi,customStyles:null==w?void 0:w.stormeeCitation,customIcons:R})}):i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(p.default,{title:`${d}`,citation:pi,customStyles:null==w?void 0:w.waveformCitation,customIcons:R})});if("scanned_doc_citations"===(null===(X=null==pi?void 0:pi.customMetadata)||void 0===X?void 0:X.type)||"scanned_doc_citation"===(null===(J=null==pi?void 0:pi.customMetadata)||void 0===J?void 0:J.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(b.default,{title:d,citation:pi,customIcons:R,customStyles:null==w?void 0:w.scannedDocumentCitation,pdfViewHeaderAction:null==T?void 0:T.pdfViewHeaderAction})});if("image_citation"===(null==pi?void 0:pi.customMetadata.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(u.default,{title:`${d}`,citation:pi,customIcons:R,customStyles:null==w?void 0:w.imageCitation})});if("book_citation_doc"===(null===(K=null==pi?void 0:pi.customMetadata)||void 0===K?void 0:K.type)||"book_citation_pdf"===(null==pi?void 0:pi.customMetadata.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(r.default,{title:`${d}`,citation:pi,customIcons:R,customStyles:null==w?void 0:w.fileCitation})});if("app_mod_rag_question"===(null===(Q=null==pi?void 0:pi.customMetadata)||void 0===Q?void 0:Q.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(_.default,{title:`${d}`,citation:pi,customIcons:R,customStyles:null==w?void 0:w.appModCitation,codeLinkConfig:null===(Y=null==T?void 0:T.appMod)||void 0===Y?void 0:Y.codeLinkConfig,isLoading:null===(Z=null==T?void 0:T.appMod)||void 0===Z?void 0:Z.isLoading})});if("rca_citation"===(null===(ii=null==pi?void 0:pi.customMetadata)||void 0===ii?void 0:ii.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(h.default,{title:`${d}`,citation:pi,customIcons:R,customStyles:null==w?void 0:w.rcaCitation})});if("readfile_citation"===(null===(ti=null==pi?void 0:pi.customMetadata)||void 0===ti?void 0:ti.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(f.default,{title:`${d}`,citation:pi,customIcons:R,customStyles:null==w?void 0:w.readFileCitation,fileCallback:null===(ei=null==T?void 0:T.readFile)||void 0===ei?void 0:ei.fileCallback,editorConfig:null===(oi=null==T?void 0:T.readFile)||void 0===oi?void 0:oi.editorConfig,customColors:null===(ni=null==T?void 0:T.readFile)||void 0===ni?void 0:ni.customColors})});if(_i&&!pi){const t=null!==(ai=null==R?void 0:R.citationLoadingIcon)&&void 0!==ai?ai:i.jsx("span",{className:l.default.citationSpinner,style:null===(li=null==w?void 0:w.loadingCitations)||void 0===li?void 0:li.citationSpinner});return i.jsx(a.Tooltip,{title:null!==(si=null===(di=null==w?void 0:w.loadingCitations)||void 0===di?void 0:di.tooltipTitle)&&void 0!==si?si:`source ${vi.split("_")[0]} citations`,arrow:!0,children:i.jsxs("span",{className:l.default.citationSpinnerWrapper,style:null===(ci=null==w?void 0:w.loadingCitations)||void 0===ci?void 0:ci.citationSpinnerWrapper,children:[d,t]})})}return i.jsx("span",{...y,className:l.default.paragraph,style:null==M?void 0:M.p,children:null==y?void 0:y.children})},code:({inline:t,children:e,className:o,node:n,...a})=>/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?i.jsx("div",{children:i.jsx("code",{className:l.default.blockCode,children:e})}):i.jsx("code",{className:l.default.inlineCode,style:null==M?void 0:M.code,children:e}),learned:({children:t})=>i.jsx(i.Fragment,{children:i.jsx(a.Tooltip,{title:t,placement:"top",children:i.jsx(n.Info,{size:16,className:l.default.learnedIcon})})})}),[P,y,T,A,W]);return i.jsx("div",{ref:$,className:"w-full",children:i.jsx(S.default,{components:E,rehypePlugins:[I.default],children:o})})},exports.formatChatData=q;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("react/jsx-runtime"),t=require("react"),e=require("react-markdown"),o=require("rehype-raw"),n=require("lucide-react"),a=require("@mui/material"),l=require("./AiReasonMarkdownWrapper.module.css.js"),d=require("../../shared/ExpandableOl.js"),c=require("../citations/web-citation/WebCitationWithImageRenderer.js"),s=require("../citations/web-citation/WebCitationRenderer.js"),u=require("../citations/image-citation/ImageCitationRenderer.js"),r=require("../citations/file-citation/FileCitationRender.js"),m=require("../RequirementAIWrapper/RequirementAIWrapper.js"),v=require("../citations/stormee-citation/StormeeCitationRenderer.js"),p=require("../citations/audio-citation/WaveformCitationRenderer.js"),h=require("../citations/appmod-citation/AppmodCitationRenderer.js"),_=require("../citations/rca-citation/RCACitationRenderer.js"),f=require("../citations/readfile-citation/ReadFileCitationRenderer.js"),g=require("../citations/chat-citation/ChatCitationRenderer.js"),j=require("@e-llm-studio/citation"),C=require("../citations/big-enough/BigEnoughCitationRenderer.js"),b=require("./ScannedCitationRenderer.js"),x=require("../citations/gpt-web-citation/GptWebCitationRenderer.js");function y(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var S=y(e),I=y(o);const k=["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"],q=(i,t,e)=>{const o=Number.isFinite(t)&&Number.isFinite(e);return[...i.map((i,n)=>{const a=n>=t&&n<=e;return{...i,highlighted_text:o?a?i.message:"":i.highlighted_text}})]};exports.AiReasonMarkdownWrapper=({label:e,message:o,isExpandableOrderedListEnabled:y,customStyles:w,citationStyles:M,customIcons:R,onSelectProceed:F,isDisableProceedButton:N,big_enough_block:W,aiReason:$})=>{const D=t.useRef(null),{citations:P,citationConfig:T,chatHistory:A,onFetchOnDemandCitation:L,chatCitationConfigs:O,gptCitationConfigs:E}=m.useRequirementAI();console.log("Testing::Citations in Lib",P);const G=t.useMemo(()=>({h1:({node:t,...e})=>i.jsx("h1",{className:l.default.h1,style:null==w?void 0:w.h1,children:null==e?void 0:e.children}),h2:({node:t,...e})=>i.jsx("h2",{className:l.default.h2,style:null==w?void 0:w.h2,children:null==e?void 0:e.children}),h3:({node:t,...e})=>i.jsx("h2",{className:l.default.h3,style:null==w?void 0:w.h3,children:null==e?void 0:e.children}),b:({node:t,...e})=>i.jsx("b",{className:l.default.bold,style:null==w?void 0:w.b}),p:({node:t,...e})=>i.jsx("p",{...e,className:l.default.paragraph,style:null==w?void 0:w.p,children:null==e?void 0:e.children}),ol:({node:t,...o})=>y?i.jsx(d.default,{label:e,customStyles:null==w?void 0:w.expandOlStyle,onProceed:F,isProceedDisabled:N,aiReasoningCitation:P,citationStyles:M,customIcons:R,children:null==o?void 0:o.children}):i.jsx("ol",{className:l.default.orderedList,style:null==w?void 0:w.ol,children:null==o?void 0:o.children}),ul:({node:t,...e})=>i.jsx("ul",{className:l.default.unorderedList,children:null==e?void 0:e.children}),a:({inline:e,children:d,node:m,...y})=>{var S,I,F,N,D,G,H,z,U,B,V,X,J,K,Q,Y,Z,ii,ti,ei,oi,ni,ai,li,di,ci,si;const ui="true"===(null==y?void 0:y.table),ri=`${null==y?void 0:y.href}`,[mi,vi=""]=ri.split("$"),[pi,hi=""]=vi.split("?"),_i="appmode_citation"===mi||"appmode_citations"===mi?(null==P?void 0:P.appmod_citations)||[]:"image_citation"===mi||"image_citations"===mi?(null==P?void 0:P.image_citations)||[]:"audio_citation"===mi||"audio_citations"===mi?(null==P?void 0:P.audio_citations)||[]:"document_citation"===mi||"document_citations"===mi?(null==P?void 0:P.file_citations)||[]:"rca_citation"===mi||"rca_citations"===mi?(null==P?void 0:P.rca_citations)||[]:"web_citation"===mi||"web_citations"===mi?(null==P?void 0:P.web_citations)||[]:"code_generated"===mi?(null==P?void 0:P.code_generated)||[]:"readfile_citation"===mi||"readfile_citations"===mi?(null==P?void 0:P.readfile_citations)||[]:"gpt_citation"===mi||"gpt_citations"===mi?(null==P?void 0:P.gpt_citations)||[]:"scanned_doc_citation"===mi||"scanned_doc_citations"===mi?(null==P?void 0:P.scanned_doc_citations)||[]:"big_enough_block"===mi&&W||[],fi=_i.find(i=>i.citation_number===decodeURIComponent(pi));console.log("TESTING::citation",fi,_i);const gi=k.includes(mi);if("big_enough_block"===mi&&fi)return console.log("Rendering big enough block with citation:",M),i.jsx(C.default,{title:d,citation:fi,customStyles:null==M?void 0:M.bigEnoughCitation,customIcons:R});if("chat_citation"===mi){if(!A||0===A.length)return null;let t=0,e=A.length-1;if("all"!==pi){const[i,o]=pi.split("-").map(Number);t=Number.isFinite(i)?i:0,e=Number.isFinite(o)?o:t,t=t>0?t-1:t,e=e<A.length-1?e+1:e}return i.jsx(g.default,{customIcon:null==R?void 0:R.chatCitationIcon,title:d,chatHistory:q(A,t,e),isTable:ui,chatCitationProps:null==O?void 0:O.chatCitationProps,onCitationClick:null==O?void 0:O.handleCitationClicked,customStyles:null==M?void 0:M.chatCitation,openInFullscreenOnClick:null==O?void 0:O.openInFullscreenOnClick})}if(("gpt_citation"===mi||"gpt_citations"===mi)&&fi)return(null===(S=null==fi?void 0:fi.customMetadata)||void 0===S?void 0:S.value)?i.jsx(x.default,{title:d,citation:fi,customStyles:null==M?void 0:M.webCitation,customIcons:R,content:o}):i.jsx(j.NonWebReasoningComponent,{item:{text:"",dataSource:null===(F=null===(I=fi.customMetadata)||void 0===I?void 0:I.data_sources)||void 0===F?void 0:F[0],trainingDataTitle:null===(D=null===(N=fi.customMetadata)||void 0===N?void 0:N.training_data_title)||void 0===D?void 0:D[0],paraphrase:null===(H=null===(G=fi.customMetadata)||void 0===G?void 0:G.paraphrase)||void 0===H?void 0:H[0]},headerTitle:(null==E?void 0:E.title)||"GPT - Gemini 2.5 Flash",iconsConfig:{ChevronDownIcon:n.ChevronDown,ChevronUpIcon:n.ChevronUp,MaximizeIcon:n.Maximize2,CloseIcon:n.X},...null==E?void 0:E.gptCitationProps});if("image_citation"===mi&&!fi)return null;if("web_citation"===(null===(z=null==fi?void 0:fi.customMetadata)||void 0===z?void 0:z.type))return(null===(U=fi.customMetadata)||void 0===U?void 0:U.screenshot_url)?i.jsx(c.default,{title:d,citation:fi,customStyles:null==M?void 0:M.webCitation,customIcons:R}):i.jsx(s.default,{label:d,url:null===(B=fi.customMetadata)||void 0===B?void 0:B.link,customStyles:null==M?void 0:M.webCitation,customIcons:R});if("audio_transcript"===(null===(V=null==fi?void 0:fi.customMetadata)||void 0===V?void 0:V.type))return"stormee"===(null==fi?void 0:fi.customMetadata.audio_citation_mode)?i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(v.default,{title:`${d}`,citation:fi,customStyles:null==M?void 0:M.stormeeCitation,customIcons:R})}):i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(p.default,{title:`${d}`,citation:fi,customStyles:null==M?void 0:M.waveformCitation,customIcons:R})});if("scanned_doc_citations"===(null===(X=null==fi?void 0:fi.customMetadata)||void 0===X?void 0:X.type)||"scanned_doc_citation"===(null===(J=null==fi?void 0:fi.customMetadata)||void 0===J?void 0:J.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(b.default,{title:d,citation:fi,customIcons:R,customStyles:null==M?void 0:M.scannedDocumentCitation,pdfViewHeaderAction:null==T?void 0:T.pdfViewHeaderAction})});if("image_citation"===(null==fi?void 0:fi.customMetadata.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(u.default,{title:`${d}`,citation:fi,customIcons:R,customStyles:null==M?void 0:M.imageCitation})});if("book_citation_doc"===(null===(K=null==fi?void 0:fi.customMetadata)||void 0===K?void 0:K.type)||"book_citation_pdf"===(null==fi?void 0:fi.customMetadata.type)||"document_citations"===mi||"document_citation"===mi)return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(r.default,{title:`${d}`,citation:fi,customIcons:R,customStyles:null==M?void 0:M.fileCitation,fetchOnDemandCitation:()=>{(async(i,t,e)=>{if(L)try{await L(i,t,e)}catch(t){console.error(`[On-Demand Fetch Error] Failed to load citation ${i}:`,t)}})(pi,$,mi)}})});if("app_mod_rag_question"===(null===(Q=null==fi?void 0:fi.customMetadata)||void 0===Q?void 0:Q.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(h.default,{title:`${d}`,citation:fi,customIcons:R,customStyles:null==M?void 0:M.appModCitation,codeLinkConfig:null===(Y=null==T?void 0:T.appMod)||void 0===Y?void 0:Y.codeLinkConfig,isLoading:null===(Z=null==T?void 0:T.appMod)||void 0===Z?void 0:Z.isLoading})});if("rca_citation"===(null===(ii=null==fi?void 0:fi.customMetadata)||void 0===ii?void 0:ii.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(_.default,{title:`${d}`,citation:fi,customIcons:R,customStyles:null==M?void 0:M.rcaCitation})});if("readfile_citation"===(null===(ti=null==fi?void 0:fi.customMetadata)||void 0===ti?void 0:ti.type))return i.jsx(t.Suspense,{fallback:i.jsx(i.Fragment,{}),children:i.jsx(f.default,{title:`${d}`,citation:fi,customIcons:R,customStyles:null==M?void 0:M.readFileCitation,fileCallback:null===(ei=null==T?void 0:T.readFile)||void 0===ei?void 0:ei.fileCallback,editorConfig:null===(oi=null==T?void 0:T.readFile)||void 0===oi?void 0:oi.editorConfig,customColors:null===(ni=null==T?void 0:T.readFile)||void 0===ni?void 0:ni.customColors})});if(gi&&!fi){const t=null!==(ai=null==R?void 0:R.citationLoadingIcon)&&void 0!==ai?ai:i.jsx("span",{className:l.default.citationSpinner,style:null===(li=null==M?void 0:M.loadingCitations)||void 0===li?void 0:li.citationSpinner});return i.jsx(a.Tooltip,{title:null!==(ci=null===(di=null==M?void 0:M.loadingCitations)||void 0===di?void 0:di.tooltipTitle)&&void 0!==ci?ci:`source ${mi.split("_")[0]} citations`,arrow:!0,children:i.jsxs("span",{className:l.default.citationSpinnerWrapper,style:null===(si=null==M?void 0:M.loadingCitations)||void 0===si?void 0:si.citationSpinnerWrapper,children:[d,t]})})}return i.jsx("span",{...y,className:l.default.paragraph,style:null==w?void 0:w.p,children:null==y?void 0:y.children})},code:({inline:t,children:e,className:o,node:n,...a})=>/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?i.jsx("div",{children:i.jsx("code",{className:l.default.blockCode,children:e})}):i.jsx("code",{className:l.default.inlineCode,style:null==w?void 0:w.code,children:e}),learned:({children:t})=>i.jsx(i.Fragment,{children:i.jsx(a.Tooltip,{title:t,placement:"top",children:i.jsx(n.Info,{size:16,className:l.default.learnedIcon})})})}),[P,y,T,A,W]);return i.jsx("div",{ref:D,className:"w-full",children:i.jsx(S.default,{components:G,rehypePlugins:[I.default],children:o})})},exports.formatChatData=q;
|
|
2
2
|
//# sourceMappingURL=AiReasonMarkdownWrapper.js.map
|