@viswa-test/test-citation 0.0.168 → 0.0.170

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +28 -157
  2. package/dist/assests/svg/PdfViewerIcons.js +1 -1
  3. package/dist/cjs/assests/svg/PdfViewerIcons.js +1 -1
  4. package/dist/cjs/features/IngestionStatus/IngestionStatusComponent.js +1 -1
  5. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  6. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  7. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  8. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js +2 -0
  9. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js.map +1 -0
  10. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  11. package/dist/cjs/index.js +1 -1
  12. package/dist/features/IngestionStatus/IngestionStatusComponent.js +1 -1
  13. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  14. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  15. package/dist/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  16. package/dist/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js +2 -0
  17. package/dist/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.js.map +1 -0
  18. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/types/src/CommonConstants/CommonConstants.d.ts +0 -1296
  21. package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
  22. package/dist/types/src/assests/svg/PdfViewerIcons.d.ts +0 -1
  23. package/dist/types/src/assests/svg/PdfViewerIcons.d.ts.map +1 -1
  24. package/dist/types/src/constants/DefaultTreeData.d.ts +1297 -0
  25. package/dist/types/src/constants/DefaultTreeData.d.ts.map +1 -0
  26. package/dist/types/src/constants/deviationData.d.ts +313 -313
  27. package/dist/types/src/constants/deviationData.d.ts.map +1 -1
  28. package/dist/types/src/features/IngestionStatus/IngestionStatusComponent.d.ts.map +1 -1
  29. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +2 -1
  30. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  31. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +15 -6
  32. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  33. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
  34. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.d.ts +29 -0
  35. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/PopupDefaults.d.ts.map +1 -0
  36. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  37. package/dist/types/src/index.d.ts +0 -1
  38. package/dist/types/src/index.d.ts.map +1 -1
  39. package/package.json +9 -17
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as c,jsxs as i,Fragment as n}from"react/jsx-runtime";import t,{useMemo as a}from"react";import r from"react-markdown";import o from"rehype-raw";import"./CitationComponent.css.js";import{ChevronUp as d}from"lucide-react";import{ReactComponent as l}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as s}from"../icons/aiMagic.svg.js";import m from"./CitationAnchor.js";var h=function(i){var n=i.text,t=i.item;return c(r,e({rehypePlugins:[o],components:{ol:function(i){var n=i.children;return c("ol",e({className:"md-ol"},{children:n}))},ul:function(i){var n=i.children;return c("ul",e({className:"md-ul"},{children:n}))},li:function(i){var n=i.children;return c("li",e({className:"md-li"},{children:n}))},a:function(e){e.node;var i=e.href,n=e.children;return c(m,{href:i,children:n,metaData:{citations:t.citations,docData:t.docData}})}}},{children:n.replace(/<br\s*\/?>/gi,"\n")}))};function _(r){var o=r.item,m=r.title,_=void 0===m?"Cognitive Decisioning AI":m,v=r.relevanceScore,p=void 0===v?0:v,N=r.showRelevanceScore,u=void 0===N||N,f=r.reason,x=void 0===f?"No reasoning provided.":f,g=r.impact,y=void 0===g?"No Impact provided.":g,b=r.explaination,C=void 0===b?"No explaination provided.":b,H=r.gap,j=void 0===H?"None":H,B=r.onClose,L=void 0===B?function(){}:B,R=r.onAccept,k=r.onReject,w=r.showResolveBtns,D=void 0!==w&&w,I=r.sections,T=r.leftIcon,M=r.scoreIcon,A=r.className,E=a(function(){var e=Number(p);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[p]),P=a(function(){return function(e){if(!e)return!0;var c=e.trim().toLowerCase();return"none"===c||"no gap"===c||"no gaps"===c||"n/a"===c}(j)?"1. No gaps identified.":j},[j]);return c("div",e({className:"cite-acc ".concat(A||"")},{children:I&&I.length>0?I.map(function(n){return!1===n.show?null:i("div",e({className:"cite-acc__explain-body ".concat(n.bodyClassName||"")},{children:[i("div",e({className:"cite-acc__innerHeader"},{children:[c("div",e({className:"cite-acc__innerHeaderLeft"},{children:c("div",{children:c("div",e({className:"cite-acc__innerTitle"},{children:n.title}))})})),c("button",e({type:"button",onClick:function(e){e.stopPropagation(),L&&L()}},{children:c(d,{})}))]})),c("div",e({className:"cite-acc__innerBody text-sm text-gray-600"},{children:"string"==typeof n.content?c(h,{text:n.content,item:n.item||o||{}}):n.content}))]}),n.id||n.title)}):i(n,{children:[i("div",e({className:"cite-acc__explain-body"},{children:[i("div",e({className:"cite-acc__innerHeader"},{children:[c("div",e({className:"cite-acc__innerHeaderLeft"},{children:c("div",{children:c("div",e({className:"cite-acc__innerTitle"},{children:"Impact"}))})})),c("button",e({type:"button",onClick:function(e){e.stopPropagation(),L&&L()}},{children:c(d,{})}))]})),c("div",e({className:"cite-acc__innerBody text-sm text-gray-600"},{children:c(h,{text:y||"",item:o||{}})}))]})),i("div",e({className:"cite-acc__explain-body"},{children:[c("div",e({className:"cite-acc__innerHeader"},{children:c("div",e({className:"cite-acc__innerHeaderLeft"},{children:c("div",{children:c("div",e({className:"cite-acc__innerTitle"},{children:"Explaination"}))})}))})),c("div",e({className:"cite-acc__innerBody text-sm text-gray-600"},{children:c(h,{text:C||"",item:{}})}))]})),D&&i("div",e({className:"cite-acc__btn-container"},{children:[c("button",e({className:"btn-reject",onClick:k},{children:"Reject"})),c("button",e({className:"btn-accept",onClick:R},{children:"Accept"}))]})),i("div",e({className:"cite-acc__header"},{children:[i("div",e({className:"cite-acc__headerLeft"},{children:[c("span",e({className:"cite-acc__titleIcon"},{children:T?"function"==typeof T?t.createElement(T):T:c(l,{})})),c("div",e({className:"cite-acc__title"},{children:_}))]})),c("div",e({className:"cite-acc__headerRight"},{children:u&&i("span",e({className:"cite-acc__scoreBadge"},{children:[M?"function"==typeof M?t.createElement(M):M:c(s,{}),i("span",e({className:"cite-acc__scoreText"},{children:[E,"%"]}))]}))}))]})),i("div",e({className:"cite-acc__explain-body"},{children:[c("div",e({className:"cite-acc__innerHeader"},{children:c("div",e({className:"cite-acc__innerHeaderLeft"},{children:c("div",{children:c("div",e({className:"cite-acc__innerTitle"},{children:"Decision Making Factors"}))})}))})),c("div",e({className:"cite-acc__innerBody text-sm text-gray-600"},{children:c(h,{text:x||"",item:o||{}})}))]})),i("div",e({className:"cite-acc__explain-body cite-acc__explain-body_border"},{children:[c("div",e({className:"cite-acc__innerHeader"},{children:c("div",e({className:"cite-acc__innerHeaderLeft"},{children:c("div",{children:c("div",e({className:"cite-acc__innerTitle"},{children:"Gaps in Decision"}))})}))})),c("div",e({className:"cite-acc__innerBody text-sm text-gray-600"},{children:c(h,{text:P||"",item:o||{}})}))]}))]})}))}export{_ as default};
1
+ import{__assign as e}from"tslib";import{jsx as i,jsxs as c,Fragment as n}from"react/jsx-runtime";import t,{useMemo as a}from"react";import r from"../Popups/PopupDefaults.js";import o from"react-markdown";import d from"rehype-raw";import"./CitationComponent.css.js";import{ChevronUp as l}from"lucide-react";import{ReactComponent as s}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as m}from"../icons/aiMagic.svg.js";import h from"./CitationAnchor.js";var _=function(c){var n=c.text,t=c.item;return i(o,e({rehypePlugins:[d],components:{ol:function(c){var n=c.children;return i("ol",e({className:"md-ol"},{children:n}))},ul:function(c){var n=c.children;return i("ul",e({className:"md-ul"},{children:n}))},li:function(c){var n=c.children;return i("li",e({className:"md-li"},{children:n}))},a:function(e){e.node;var c=e.href,n=e.children;return i(h,{href:c,children:n,metaData:{citations:t.citations,docData:t.docData}})}}},{children:n.replace(/<br\s*\/?>/gi,"\n")}))};function v(o){var d=o.item,h=o.title,v=void 0===h?"Cognitive Decisioning AI":h,p=o.relevanceScore,u=void 0===p?0:p,N=o.showRelevanceScore,f=void 0===N||N,y=o.reason,x=void 0===y?"No reasoning provided.":y,g=o.impact,b=void 0===g?"No Impact provided.":g,C=o.explaination,H=void 0===C?"No explaination provided.":C,B=o.gap,D=void 0===B?"None":B,j=o.onClose,A=void 0===j?function(){}:j,L=o.onAccept,R=o.onReject,k=o.showResolveBtns,w=void 0!==k&&k,I=o.sections,T=o.leftIcon,M=o.scoreIcon,P=o.className,E=o.customStyles,S=void 0===E?{}:E,F=a(function(){var e=Number(u);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[u]),G=a(function(){return function(e){if(!e)return!0;var i=e.trim().toLowerCase();return"none"===i||"no gap"===i||"no gaps"===i||"n/a"===i}(D)?"1. No gaps identified.":D},[D]);return i("div",e({className:"cite-acc ".concat(P||""),style:e(e({},r.CitationAccordionDefaults.container),null==S?void 0:S.container)},{children:I&&I.length>0?I.map(function(n){return!1===n.show?null:c("div",e({className:"cite-acc__explain-body ".concat(n.bodyClassName||"")},{children:[c("div",e({className:"cite-acc__innerHeader",style:e(e({},r.CitationAccordionDefaults.innerHeader),null==S?void 0:S.innerHeader)},{children:[i("div",e({className:"cite-acc__innerHeaderLeft"},{children:i("div",{children:i("div",e({className:"cite-acc__innerTitle"},{children:n.title}))})})),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),A&&A()}},{children:i(l,{})}))]})),i("div",e({className:"cite-acc__innerBody text-sm text-gray-600",style:e(e({},r.CitationAccordionDefaults.innerBody),null==S?void 0:S.innerBody)},{children:"string"==typeof n.content?i(_,{text:n.content,item:n.item||d||{}}):n.content}))]}),n.id||n.title)}):c(n,{children:[c("div",e({className:"cite-acc__explain-body"},{children:[c("div",e({className:"cite-acc__innerHeader"},{children:[i("div",e({className:"cite-acc__innerHeaderLeft"},{children:i("div",{children:i("div",e({className:"cite-acc__innerTitle"},{children:"Impact"}))})})),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),A&&A()}},{children:i(l,{})}))]})),i("div",e({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i(_,{text:b||"",item:d||{}})}))]})),c("div",e({className:"cite-acc__explain-body"},{children:[i("div",e({className:"cite-acc__innerHeader"},{children:i("div",e({className:"cite-acc__innerHeaderLeft"},{children:i("div",{children:i("div",e({className:"cite-acc__innerTitle"},{children:"Explaination"}))})}))})),i("div",e({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i(_,{text:H||"",item:{}})}))]})),w&&c("div",e({className:"cite-acc__btn-container"},{children:[i("button",e({className:"btn-reject",onClick:R},{children:"Reject"})),i("button",e({className:"btn-accept",onClick:L},{children:"Accept"}))]})),c("div",e({className:"cite-acc__header"},{children:[c("div",e({className:"cite-acc__headerLeft"},{children:[i("span",e({className:"cite-acc__titleIcon"},{children:T?"function"==typeof T?t.createElement(T):T:i(s,{})})),i("div",e({className:"cite-acc__title"},{children:v}))]})),i("div",e({className:"cite-acc__headerRight"},{children:f&&c("span",e({className:"cite-acc__scoreBadge"},{children:[M?"function"==typeof M?t.createElement(M):M:i(m,{}),c("span",e({className:"cite-acc__scoreText"},{children:[F,"%"]}))]}))}))]})),c("div",e({className:"cite-acc__explain-body"},{children:[i("div",e({className:"cite-acc__innerHeader"},{children:i("div",e({className:"cite-acc__innerHeaderLeft"},{children:i("div",{children:i("div",e({className:"cite-acc__innerTitle"},{children:"Decision Making Factors"}))})}))})),i("div",e({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i(_,{text:x||"",item:d||{}})}))]})),c("div",e({className:"cite-acc__explain-body cite-acc__explain-body_border"},{children:[i("div",e({className:"cite-acc__innerHeader"},{children:i("div",e({className:"cite-acc__innerHeaderLeft"},{children:i("div",{children:i("div",e({className:"cite-acc__innerTitle"},{children:"Gaps in Decision"}))})}))})),i("div",e({className:"cite-acc__innerBody text-sm text-gray-600"},{children:i(_,{text:G||"",item:d||{}})}))]}))]})}))}export{v as default};
2
2
  //# sourceMappingURL=CognitiveComponent.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as o,jsx as n,Fragment as t}from"react/jsx-runtime";import{Info as i,ChevronDown as r,PenLine as l,CheckCircle as d,XCircle as a}from"lucide-react";import{useState as c}from"react";import{ToneToggle as s}from"./ToneToggle.js";var p=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],g=function(t){var i=t.toneIndex,r=t.configs,l=void 0===r?p:r,d=l[Math.min(i,l.length-1)]||l[1]||l[0],a=d.color,c=d.angle,s=d.arcD,g=(c-90)*Math.PI/180,f=11+9*Math.cos(g),u=13+9*Math.sin(g);return o("svg",e({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[n("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),n("path",{d:s,stroke:a,strokeWidth:"2.5",strokeLinecap:"round"}),n("line",{x1:"11",y1:"13",x2:f,y2:u,stroke:a,strokeWidth:"2",strokeLinecap:"round"})]}))},f=function(o){var t=o.type,i=o.customStyles,r=void 0===i?{}:i,l=e(e({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),r),d=l[t]||l.Medium;return n("div",e({style:d},{children:t}))},u=["Lenient","Balanced","Aggressive"],h={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"};function m(m){var x,y,v,b,C=m.onClose,k=m.aiReason,I=m.onAccept,B=m.onReject,A=m.onIterate,S=m.initialTone,z=m.onRegenerate,E=m.labels,R=void 0===E?{}:E,T=m.toneLevelsConfig,W=void 0===T?u:T,j=m.toneColorsConfig,w=void 0===j?h:j,D=m.dialConfigs,M=void 0===D?p:D,F=m.customStyles,H=void 0===F?{}:F,L=m.severityChipStyles,_=void 0===L?{}:L,P=m.customIcons,q=void 0===P?{}:P,G=W.findIndex(function(e){return e===S});-1===G&&(G=1);var J=c(!0),K=J[0],N=J[1],O=c(!1),Q=O[0],U=O[1],V=c(G),X=V[0],Y=V[1],Z=c(G)[0],$=W[X],ee=w[$]||"#BA7517",oe=X!==Z;return o("div",e({onClick:function(e){return e.stopPropagation()},style:e({width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},H.root)},{children:[o("div",e({style:e({display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},H.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[n("span",{children:q.summaryIcon||n(i,{size:16,color:"#E24B4A"})}),n("span",e({style:{fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"}},{children:R.summaryHeader||"Summary"}))]})),n("button",e({onClick:C,style:{background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0}},{children:"✕"}))]})),n("p",e({style:e({fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},H.bodyText)},{children:null===(x=null==k?void 0:k.deviation_details)||void 0===x?void 0:x.deviation_title})),n("p",e({style:e({fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},H.bodyText)},{children:null===(y=null==k?void 0:k.deviation_details)||void 0===y?void 0:y.deviation_summary})),o("div",e({style:e({marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},H.impactContainer)},{children:[o("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[o("button",e({onClick:function(){return N(!K)},style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"}},{children:[n("span",e({style:{fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"}},{children:R.impactHeader||"Impact"})),n("span",e({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:K?"rotate(180deg)":"rotate(0deg)"}},{children:n(r,{size:16,color:"#E24B4A"})}))]})),n(f,{type:(null==k?void 0:k.severity)||"Medium",customStyles:_})]})),K&&n("p",e({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(b=null===(v=null==k?void 0:k.deviation_details)||void 0===v?void 0:v.deviation_impact)&&void 0!==b?b:R.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),o("div",e({style:e({display:"flex",gap:8,marginBottom:18},H.actionContainer)},{children:[o("button",e({style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",color:"#64748B",cursor:"pointer"},onClick:A},{children:[q.iterateIcon||n(l,{size:16,color:"#64748B"}),R.btnIterate||"Iterate"]}),"Iterate"),o("button",e({style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",color:"#10B981",cursor:"pointer"},onClick:I},{children:[q.acceptIcon||n(d,{size:16,color:"#10B981"}),R.btnAccept||"Approve"]}),"Accept"),o("button",e({style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",color:"#DC2626",cursor:"pointer"},onClick:B},{children:[q.rejectIcon||n(a,{size:16,color:"#DC2626"}),R.btnReject||"Reject"]}),"reject")]})),o("div",e({style:e({borderTop:"0.5px solid #eee",paddingTop:14},H.toneContainer)},{children:[o("button",e({onClick:function(){return U(!Q)},style:{display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4}},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:8}},{children:[n(g,{toneIndex:X,configs:M}),n("span",e({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:R.toneHeader||"Redline Tone"}))]})),n("span",e({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Q?"rotate(180deg)":"rotate(0deg)"}},{children:n(r,{size:16,color:"#111"})}))]})),Q&&o(t,{children:[n("p",e({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:R.toneDescription||"Controls how assertively AI is redlining"})),n(s,{isDirty:oe,onToneChange:function(e){Y(e)},toneColor:ee,toneIndex:X,onClickRegenerate:function(){return null==z?void 0:z($)},toneLabels:W})]})]}))]}))}export{m as default};
1
+ import{__assign as e}from"tslib";import{jsxs as o,jsx as i,Fragment as n}from"react/jsx-runtime";import{Info as t,ChevronDown as l,PenLine as r,CheckCircle as d,XCircle as a}from"lucide-react";import{useState as s}from"react";import{ToneToggle as c}from"./ToneToggle.js";var u=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],p=function(n){var t=n.toneIndex,l=n.configs,r=void 0===l?u:l,d=r[Math.min(t,r.length-1)]||r[1]||r[0],a=d.color,s=d.angle,c=d.arcD,p=(s-90)*Math.PI/180,v=11+9*Math.cos(p),m=13+9*Math.sin(p);return o("svg",e({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i("path",{d:c,stroke:a,strokeWidth:"2.5",strokeLinecap:"round"}),i("line",{x1:"11",y1:"13",x2:v,y2:m,stroke:a,strokeWidth:"2",strokeLinecap:"round"})]}))},v=function(o){var n=o.type,t=o.customStyles,l=void 0===t?{}:t,r=e(e({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),l),d=r[n]||r.Medium;return i("div",e({style:d},{children:n}))},m=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},y={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},f={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},h={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},x={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},S={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},b={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},B={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},C={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},k={display:"flex",gap:8,marginBottom:18},D={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},I={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},A={borderTop:"0.5px solid #eee",paddingTop:14},z={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4};function E(E){var T,R,w,M,W,j,F,L,H,_,P,q,G,J,K,N,O,Q,U,V=E.onClose,X=E.aiReason,Y=E.onAccept,Z=E.onReject,$=E.onIterate,ee=E.initialTone,oe=E.onRegenerate,ie=E.labels,ne=void 0===ie?{}:ie,te=E.toneLevelsConfig,le=void 0===te?m:te,re=E.toneColorsConfig,de=void 0===re?g:re,ae=E.dialConfigs,se=void 0===ae?u:ae,ce=E.customStyles,ue=void 0===ce?{}:ce,pe=E.severityChipStyles,ve=void 0===pe?{}:pe,me=E.customIcons,ge=void 0===me?{}:me,ye=le.findIndex(function(e){return e===ee});-1===ye&&(ye=1);var fe=s(!0),he=fe[0],xe=fe[1],Se=s(!1),be=Se[0],Be=Se[1],Ce=s(ye),ke=Ce[0],De=Ce[1],Ie=s(ye)[0],Ae=le[ke],ze=de[Ae]||"#BA7517",Ee=ke!==Ie;return o("div",e({onClick:function(e){return e.stopPropagation()},style:e(e({},y),null===(T=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===T?void 0:T.root)},{children:[o("div",e({style:e(e({},f),null===(R=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===R?void 0:R.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[i("span",{children:ge.summaryIcon||i(t,{size:16,color:"#E24B4A"})}),i("span",e({style:e(e({},h),null===(w=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===w?void 0:w.title)},{children:ne.summaryHeader||"Summary"}))]})),i("button",e({onClick:V,style:e(e({},I),null===(M=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===M?void 0:M.closeBtn)},{children:"✕"}))]})),i("p",e({style:e(e({},x),null===(W=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===W?void 0:W.bodyText)},{children:null===(j=null==X?void 0:X.deviation_details)||void 0===j?void 0:j.deviation_title})),i("p",e({style:e(e({},S),null===(F=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===F?void 0:F.summary)},{children:null===(L=null==X?void 0:X.deviation_details)||void 0===L?void 0:L.deviation_summary})),o("div",e({style:e(e({},b),null===(H=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===H?void 0:H.impactContainer)},{children:[o("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[o("button",e({onClick:function(){return xe(!he)},style:e(e({},B),null===(_=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===_?void 0:_.impactToggle)},{children:[i("span",e({style:e(e({},C),null===(P=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===P?void 0:P.impactToggleLabel)},{children:ne.impactHeader||"Impact"})),i("span",e({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:he?"rotate(180deg)":"rotate(0deg)"}},{children:i(l,{size:16,color:"#E24B4A"})}))]})),i(v,{type:(null==X?void 0:X.severity)||"Medium",customStyles:ve})]})),he&&i("p",e({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(G=null===(q=null==X?void 0:X.deviation_details)||void 0===q?void 0:q.deviation_impact)&&void 0!==G?G:ne.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),o("div",e({style:e(e({},k),null===(J=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===J?void 0:J.actionContainer)},{children:[o("button",e({style:e(e(e({},D),null===(K=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===K?void 0:K.actionBtn),{color:"#64748B"}),onClick:$},{children:[ge.iterateIcon||i(r,{size:16,color:"#64748B"}),ne.btnIterate||"Iterate"]}),"Iterate"),o("button",e({style:e(e(e({},D),null===(N=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===N?void 0:N.actionBtn),{color:"#10B981"}),onClick:Y},{children:[ge.acceptIcon||i(d,{size:16,color:"#10B981"}),ne.btnAccept||"Approve"]}),"Accept"),o("button",e({style:e(e(e({},D),null===(O=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===O?void 0:O.actionBtn),{color:"#DC2626"}),onClick:Z},{children:[ge.rejectIcon||i(a,{size:16,color:"#DC2626"}),ne.btnReject||"Reject"]}),"reject")]})),o("div",e({style:e(e({},A),null===(Q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Q?void 0:Q.toneContainer)},{children:[o("button",e({onClick:function(){return Be(!be)},style:e(e({},z),null===(U=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===U?void 0:U.toneToggleBtn)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:8}},{children:[i(p,{toneIndex:ke,configs:se}),i("span",e({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:ne.toneHeader||"Redline Tone"}))]})),i("span",e({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:be?"rotate(180deg)":"rotate(0deg)"}},{children:i(l,{size:16,color:"#111"})}))]})),be&&o(n,{children:[i("p",e({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:ne.toneDescription||"Controls how assertively AI is redlining"})),i(c,{isDirty:Ee,onToneChange:function(e){De(e)},toneColor:ze,toneIndex:ke,onClickRegenerate:function(){return null==oe?void 0:oe(Ae)},toneLabels:le})]})]}))]}))}export{E as default};
2
2
  //# sourceMappingURL=DeviationSummary.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as n,jsxs as o}from"react/jsx-runtime";import{useState as t}from"react";import{ReactComponent as i}from"../icons/History.svg.js";import{ReactComponent as r}from"../icons/message-chat-square.svg.js";import{ToneToggle as a}from"./ToneToggle.js";var l=[{id:"chat",icon:n(r,{}),label:"Chat",description:"Type on what basis you want to iterate"},{id:"risk",icon:n(r,{}),label:"Shift the risk",description:"Adjust how aggressive or lenient the language is"},{id:"history",icon:n(i,{}),label:"Historical Recommendations",description:"Pull from past recommended clauses"}],d=[{id:"1",filename:"Mutual_DA2.pdf",excerpt:'"...shall protect Confidential Information using at least the same degree of care as it uses to protect its own confidential information, but no less than reasonable c..."',tab:"Balanced"},{id:"2",filename:"Tech NDA.pdf",excerpt:'"...protect confidential information using reasonable care and appropriate safeguards..."',tab:"Balanced"},{id:"3",filename:"Corp NDA.pdf",excerpt:'"...shall use best efforts to protect any disclosed confidential materials from unauthorised access or disclosure..."',tab:"Aggressive"},{id:"4",filename:"Vendor Agreement.pdf",excerpt:'"...may use disclosed information solely for the stated purpose with no special handling required..."',tab:"Lenient"}],s=["Lenient","Balanced","Aggressive"],c={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},f=["Grounded","Innovative"];function p(t){var i=t.chatTitle,r=t.chatBody,a=t.mergedStyles,l=void 0===a?y:a;return n("div",e({style:l.body},{children:o("div",e({style:l.chatBanner},{children:[n("p",e({style:l.chatBannerTitle},{children:i})),n("p",e({style:l.chatBannerBody},{children:r}))]}))}))}function g(i){var r=i.initialTone,l=i.onRiskRegenerate,d=i.riskMode,p=i.toneLevelsConfig,g=void 0===p?s:p,u=i.toneColorsConfig,h=void 0===u?c:u,m=i.riskModesConfig,b=void 0===m?f:m,x=i.mergedStyles,v=void 0===x?y:x,C=g.findIndex(function(e){return e===r});-1===C&&(C=1);var k=t(d||b[0]||"Grounded"),B=k[0],S=k[1],T=t(C),A=T[0],R=T[1],w=t(C)[0],z=g[A],L=h[z]||"#BA7517",I=A!==w||d!==B;return o("div",e({style:v.body},{children:[n("div",e({style:{display:"flex",gap:8,marginBottom:16}},{children:b.map(function(t){return o("button",e({onClick:function(){return S(t)},style:{flex:1,display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid ".concat(B===t?"#7c5cbf":"#e0ddd8"),background:"#fff",cursor:"pointer",fontSize:13,fontWeight:500,color:"#1a1a1a"}},{children:[n("span",e({style:{width:16,height:16,borderRadius:"50%",border:"2px solid ".concat(B===t?"#7c5cbf":"#ccc"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:B===t&&n("span",{style:{width:8,height:8,borderRadius:"50%",background:"#7c5cbf"}})})),t.charAt(0).toUpperCase()+t.slice(1)]}),t)})})),n(a,{onToneChange:function(e){return R(e)},toneColor:L,isDirty:I,toneIndex:A,onClickRegenerate:function(){return null==l?void 0:l({tone:z,mode:B})}})]}))}function u(i){var r=i.onApply,a=i.historicalClausesData,l=void 0===a?d:a,c=i.toneLevelsConfig,f=void 0===c?s:c,p=i.mergedStyles,g=void 0===p?y:p,u=f.length>1?f[1]:f[0]||"Balanced",h=t(u),m=h[0],b=h[1],x=l.filter(function(e){return e.tab===m});return o("div",e({style:g.body},{children:[n("div",e({style:g.segmentedControl},{children:f.map(function(o){return n("button",e({onClick:function(){return b(o)},style:e(e({},g.segmentedBtn),m===o?g.segmentedBtnActive:{})},{children:o.charAt(0).toUpperCase()+o.slice(1)}),o)})})),o("div",e({style:{display:"flex",flexDirection:"column",gap:10,marginTop:12}},{children:[x.map(function(t){return o("button",e({onClick:function(){return null==r?void 0:r({type:"history",value:t.excerpt})},style:g.clauseCard},{children:[n("p",e({style:g.clauseFilename},{children:t.filename})),n("p",e({style:g.clauseExcerpt},{children:t.excerpt}))]}),t.id)}),0===x.length&&n("p",e({style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"}},{children:"No clauses for this tone"}))]}))]}))}function h(e){var o=e.type,t=e.onRiskRegenerate,i=e.initialTone,r=e.riskMode,a=e.onApply,l=e.chatTitle,d=e.chatBody,s=e.historicalClausesData,c=e.toneLevelsConfig,f=e.toneColorsConfig,h=e.riskModesConfig,m=e.mergedStyles,b=void 0===m?y:m;return"chat"===o?n(p,{chatTitle:l,chatBody:d,mergedStyles:b}):"risk"===o?n(g,{onRiskRegenerate:t,initialTone:i,riskMode:r,toneLevelsConfig:c,toneColorsConfig:f,riskModesConfig:h,mergedStyles:b}):"history"===o?n(u,{onApply:a,historicalClausesData:s,toneLevelsConfig:c,mergedStyles:b}):null}function m(i){var r=i.onBack,a=i.onChatClick,p=i.onRiskRegenerate,g=i.initialTone,u=i.riskMode,m=i.onApply,b=i.onTabToggle,x=i.menuItemsConfig,v=void 0===x?l:x,C=i.historicalClausesConfig,k=void 0===C?d:C,B=i.chatTitle,S=void 0===B?"Chat mode active":B,T=i.chatBody,A=void 0===T?"You are now chatting about this redline, continue the conversation in the left panel to refine or update it":T,R=i.headerTitle,w=void 0===R?"How would you like to iterate?":R,z=i.customStyles,L=void 0===z?{}:z,I=i.toneLevelsConfig,M=void 0===I?s:I,D=i.toneColorsConfig,F=void 0===D?c:D,H=i.riskModesConfig,j=void 0===H?f:H,W=t(null),E=W[0],G=W[1],N=e(e({},y),L);return o("div",e({style:N.card},{children:[o("div",e({style:N.header},{children:[n("button",e({onClick:r,style:N.backBtn,"aria-label":"Go back"},{children:"‹"})),n("span",e({style:N.headerTitle},{children:w}))]})),v.map(function(t,i){var r=E===t.id;return o("div",e({style:{borderBottom:i<v.length-1?"0.5px solid #e8e7e3":"none"}},{children:[o("button",e({onClick:function(){return e=t.id,G(function(n){return n===e?null:("chat"===e&&(null==a||a()),b&&b(e),e)});var e},style:N.row},{children:[n("div",e({style:N.rowLeft},{children:o("div",{children:[n("p",e({style:N.label},{children:t.label})),n("p",e({style:N.desc},{children:t.description}))]})})),n("span",e({style:e(e({},N.chevron),{transform:r?"rotate(90deg)":"rotate(0deg)"})},{children:"›"}))]})),n("div",e({style:{maxHeight:r?400:0,overflow:"hidden",transition:"max-height 0.25s ease"}},{children:n(h,{type:t.id,onRiskRegenerate:p,initialTone:g,riskMode:u,onApply:m,chatTitle:S,chatBody:A,historicalClausesData:k,toneLevelsConfig:M,toneColorsConfig:F,riskModesConfig:j,mergedStyles:N})}))]}),t.id)})]}))}var y={card:{background:"#fff",border:"0.5px solid #e8e7e3",borderRadius:14,width:300,maxHeight:"350px",overflow:"auto",fontFamily:"system-ui, sans-serif"},header:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"0.5px solid #e8e7e3"},backBtn:{background:"none",border:"none",cursor:"pointer",fontSize:20,color:"#888",padding:0,lineHeight:1},headerTitle:{fontSize:14,fontWeight:500,color:"#1a1a1a"},row:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",cursor:"pointer",border:"none",textAlign:"left",gap:10,boxSizing:"border-box",backgroundColor:"transparent"},rowLeft:{display:"flex",alignItems:"flex-start",gap:10,flex:1},icon:{fontSize:16,color:"#666",marginTop:1,flexShrink:0},label:{margin:0,fontSize:14,fontWeight:500,color:"#1a1a1a"},desc:{margin:"2px 0 0",fontSize:12,color:"#888",lineHeight:1.4},chevron:{fontSize:18,color:"#aaa",flexShrink:0,display:"inline-block",transition:"transform 0.2s"},body:{padding:"0 16px 14px 16px"},chatBanner:{background:"#eef4fd",border:"1px solid #c5d8f7",borderRadius:10,padding:"12px 14px",marginBottom:10},chatBannerTitle:{margin:"0 0 6px",fontSize:14,fontWeight:600,color:"#3a5a8a"},chatBannerBody:{margin:0,fontSize:13,color:"#4a6080",lineHeight:1.5},applyBtn:{display:"flex",padding:"7px 10.5px",justifyContent:"center",alignItems:"center",gap:"7px",marginTop:8,fontSize:13,borderRadius:6,border:"1px solid #2563EB",background:"#2563EB",color:"#fff"},rangeLabel:{fontSize:12,color:"#888"},segmentedControl:{border:"1px solid #F2F4F7",display:"flex",background:"#F9FAFB",borderRadius:4,padding:6,gap:8},segmentedBtn:{flex:1,padding:"7px 0",fontSize:13,fontWeight:500,color:"#888",background:"transparent",border:"none",borderRadius:8,cursor:"pointer",transition:"background 0.15s, color 0.15s"},segmentedBtnActive:{background:"#dce8fa",color:"#2a4a7a",fontWeight:700},clauseCard:{background:"#fff",border:"1px solid #dde5f0",borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",width:"100%"},clauseFilename:{margin:"0 0 6px",fontSize:13,fontWeight:600,color:"#2a4a7a"},clauseExcerpt:{margin:0,fontSize:13,color:"#4a5a70",fontStyle:"italic",lineHeight:1.5}};export{m as default};
1
+ import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import{useState as o}from"react";import i from"./PopupDefaults.js";import{ReactComponent as r}from"../icons/History.svg.js";import{ReactComponent as a}from"../icons/message-chat-square.svg.js";import{ToneToggle as l}from"./ToneToggle.js";var d=[{id:"chat",icon:n(a,{}),label:"Chat",description:"Type on what basis you want to iterate"},{id:"risk",icon:n(a,{}),label:"Shift the risk",description:"Adjust how aggressive or lenient the language is"},{id:"history",icon:n(r,{}),label:"Historical Recommendations",description:"Pull from past recommended clauses"}],s=[{id:"1",filename:"Mutual_DA2.pdf",excerpt:'"...shall protect Confidential Information using at least the same degree of care as it uses to protect its own confidential information, but no less than reasonable c..."',tab:"Balanced"},{id:"2",filename:"Tech NDA.pdf",excerpt:'"...protect confidential information using reasonable care and appropriate safeguards..."',tab:"Balanced"},{id:"3",filename:"Corp NDA.pdf",excerpt:'"...shall use best efforts to protect any disclosed confidential materials from unauthorised access or disclosure..."',tab:"Aggressive"},{id:"4",filename:"Vendor Agreement.pdf",excerpt:'"...may use disclosed information solely for the stated purpose with no special handling required..."',tab:"Lenient"}],c=["Lenient","Balanced","Aggressive"],f={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},p=["Grounded","Innovative"];function g(o){var i=o.chatTitle,r=o.chatBody,a=o.mergedStyles,l=void 0===a?b:a;return n("div",e({style:l.body},{children:t("div",e({style:l.chatBanner},{children:[n("p",e({style:l.chatBannerTitle},{children:i})),n("p",e({style:l.chatBannerBody},{children:r}))]}))}))}function u(i){var r=i.initialTone,a=i.onRiskRegenerate,d=i.riskMode,s=i.toneLevelsConfig,g=void 0===s?c:s,u=i.toneColorsConfig,h=void 0===u?f:u,m=i.riskModesConfig,y=void 0===m?p:m,x=i.mergedStyles,v=void 0===x?b:x,C=g.findIndex(function(e){return e===r});-1===C&&(C=1);var k=o(d||y[0]||"Grounded"),B=k[0],S=k[1],T=o(C),A=T[0],R=T[1],w=o(C)[0],z=g[A],L=h[z]||"#BA7517",D=A!==w||d!==B;return t("div",e({style:v.body},{children:[n("div",e({style:{display:"flex",gap:8,marginBottom:16}},{children:y.map(function(o){return t("button",e({onClick:function(){return S(o)},style:{flex:1,display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid ".concat(B===o?"#7c5cbf":"#e0ddd8"),background:"#fff",cursor:"pointer",fontSize:13,fontWeight:500,color:"#1a1a1a"}},{children:[n("span",e({style:{width:16,height:16,borderRadius:"50%",border:"2px solid ".concat(B===o?"#7c5cbf":"#ccc"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:B===o&&n("span",{style:{width:8,height:8,borderRadius:"50%",background:"#7c5cbf"}})})),o.charAt(0).toUpperCase()+o.slice(1)]}),o)})})),n(l,{onToneChange:function(e){return R(e)},toneColor:L,isDirty:D,toneIndex:A,onClickRegenerate:function(){return null==a?void 0:a({tone:z,mode:B})}})]}))}function h(i){var r=i.onApply,a=i.historicalClausesData,l=void 0===a?s:a,d=i.toneLevelsConfig,f=void 0===d?c:d,p=i.mergedStyles,g=void 0===p?b:p,u=f.length>1?f[1]:f[0]||"Balanced",h=o(u),m=h[0],y=h[1],x=l.filter(function(e){return e.tab===m});return t("div",e({style:g.body},{children:[n("div",e({style:g.segmentedControl},{children:f.map(function(t){return n("button",e({onClick:function(){return y(t)},style:e(e({},g.segmentedBtn),m===t?g.segmentedBtnActive:{})},{children:t.charAt(0).toUpperCase()+t.slice(1)}),t)})})),t("div",e({style:{display:"flex",flexDirection:"column",gap:10,marginTop:12}},{children:[x.map(function(o){return t("button",e({onClick:function(){return null==r?void 0:r({type:"history",value:o.excerpt})},style:g.clauseCard},{children:[n("p",e({style:g.clauseFilename},{children:o.filename})),n("p",e({style:g.clauseExcerpt},{children:o.excerpt}))]}),o.id)}),0===x.length&&n("p",e({style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"}},{children:"No clauses for this tone"}))]}))]}))}function m(e){var t=e.type,o=e.onRiskRegenerate,i=e.initialTone,r=e.riskMode,a=e.onApply,l=e.chatTitle,d=e.chatBody,s=e.historicalClausesData,c=e.toneLevelsConfig,f=e.toneColorsConfig,p=e.riskModesConfig,m=e.mergedStyles,y=void 0===m?b:m;return"chat"===t?n(g,{chatTitle:l,chatBody:d,mergedStyles:y}):"risk"===t?n(u,{onRiskRegenerate:o,initialTone:i,riskMode:r,toneLevelsConfig:c,toneColorsConfig:f,riskModesConfig:p,mergedStyles:y}):"history"===t?n(h,{onApply:a,historicalClausesData:s,toneLevelsConfig:c,mergedStyles:y}):null}function y(r){var a=r.onBack,l=r.onChatClick,g=r.onRiskRegenerate,u=r.initialTone,h=r.riskMode,y=r.onApply,x=r.onTabToggle,v=r.menuItemsConfig,C=void 0===v?d:v,k=r.historicalClausesConfig,B=void 0===k?s:k,S=r.chatTitle,T=void 0===S?"Chat mode active":S,A=r.chatBody,R=void 0===A?"You are now chatting about this redline, continue the conversation in the left panel to refine or update it":A,w=r.headerTitle,z=void 0===w?"How would you like to iterate?":w,L=r.customStyles,D=void 0===L?{}:L,I=r.toneLevelsConfig,M=void 0===I?c:I,j=r.toneColorsConfig,F=void 0===j?f:j,H=r.riskModesConfig,W=void 0===H?p:H,E=o(null),G=E[0],N=E[1],q=e(e(e({},i.IterateMenuDefaults.styles),b),D);return t("div",e({style:q.card},{children:[t("div",e({style:q.header},{children:[n("button",e({onClick:a,style:q.backBtn,"aria-label":"Go back"},{children:"‹"})),n("span",e({style:q.headerTitle},{children:z}))]})),C.map(function(o,i){var r=G===o.id;return t("div",e({style:{borderBottom:i<C.length-1?"0.5px solid #e8e7e3":"none"}},{children:[t("button",e({onClick:function(){return e=o.id,N(function(n){return n===e?null:("chat"===e&&(null==l||l()),x&&x(e),e)});var e},style:q.row},{children:[n("div",e({style:q.rowLeft},{children:t("div",{children:[n("p",e({style:q.label},{children:o.label})),n("p",e({style:q.desc},{children:o.description}))]})})),n("span",e({style:e(e({},q.chevron),{transform:r?"rotate(90deg)":"rotate(0deg)"})},{children:"›"}))]})),n("div",e({style:{maxHeight:r?400:0,overflow:"hidden",transition:"max-height 0.25s ease"}},{children:n(m,{type:o.id,onRiskRegenerate:g,initialTone:u,riskMode:h,onApply:y,chatTitle:T,chatBody:R,historicalClausesData:B,toneLevelsConfig:M,toneColorsConfig:F,riskModesConfig:W,mergedStyles:q})}))]}),o.id)})]}))}var b={card:{background:"#fff",border:"0.5px solid #e8e7e3",borderRadius:14,width:300,maxHeight:"350px",overflow:"auto",fontFamily:"system-ui, sans-serif"},header:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"0.5px solid #e8e7e3"},backBtn:{background:"none",border:"none",cursor:"pointer",fontSize:20,color:"#888",padding:0,lineHeight:1},headerTitle:{fontSize:14,fontWeight:500,color:"#1a1a1a"},row:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",cursor:"pointer",border:"none",textAlign:"left",gap:10,boxSizing:"border-box",backgroundColor:"transparent"},rowLeft:{display:"flex",alignItems:"flex-start",gap:10,flex:1},icon:{fontSize:16,color:"#666",marginTop:1,flexShrink:0},label:{margin:0,fontSize:14,fontWeight:500,color:"#1a1a1a"},desc:{margin:"2px 0 0",fontSize:12,color:"#888",lineHeight:1.4},chevron:{fontSize:18,color:"#aaa",flexShrink:0,display:"inline-block",transition:"transform 0.2s"},body:{padding:"0 16px 14px 16px"},chatBanner:{background:"#eef4fd",border:"1px solid #c5d8f7",borderRadius:10,padding:"12px 14px",marginBottom:10},chatBannerTitle:{margin:"0 0 6px",fontSize:14,fontWeight:600,color:"#3a5a8a"},chatBannerBody:{margin:0,fontSize:13,color:"#4a6080",lineHeight:1.5},applyBtn:{display:"flex",padding:"7px 10.5px",justifyContent:"center",alignItems:"center",gap:"7px",marginTop:8,fontSize:13,borderRadius:6,border:"1px solid #2563EB",background:"#2563EB",color:"#fff"},rangeLabel:{fontSize:12,color:"#888"},segmentedControl:{border:"1px solid #F2F4F7",display:"flex",background:"#F9FAFB",borderRadius:4,padding:6,gap:8},segmentedBtn:{flex:1,padding:"7px 0",fontSize:13,fontWeight:500,color:"#888",background:"transparent",border:"none",borderRadius:8,cursor:"pointer",transition:"background 0.15s, color 0.15s"},segmentedBtnActive:{background:"#dce8fa",color:"#2a4a7a",fontWeight:700},clauseCard:{background:"#fff",border:"1px solid #dde5f0",borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",width:"100%"},clauseFilename:{margin:"0 0 6px",fontSize:13,fontWeight:600,color:"#2a4a7a"},clauseExcerpt:{margin:0,fontSize:13,color:"#4a5a70",fontStyle:"italic",lineHeight:1.5}};export{y as default};
2
2
  //# sourceMappingURL=IterateComponent.js.map
@@ -0,0 +1,2 @@
1
+ var e={root:{width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},title:{fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},bodyText:{fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},summary:{fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},impactContainer:{marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},actionContainer:{display:"flex",gap:8,marginBottom:18},toneContainer:{borderTop:"0.5px solid #eee",paddingTop:14}},o={styles:{card:{background:"#fff",border:"0.5px solid #e8e7e3",borderRadius:14,width:300,maxHeight:"350px",overflow:"auto",fontFamily:"system-ui, sans-serif"},header:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"0.5px solid #e8e7e3"},backBtn:{background:"none",border:"none",cursor:"pointer",fontSize:20,color:"#888",padding:0,lineHeight:1},headerTitle:{fontSize:14,fontWeight:500,color:"#1a1a1a"},row:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",cursor:"pointer",border:"none",textAlign:"left",gap:10,boxSizing:"border-box",backgroundColor:"transparent"},rowLeft:{display:"flex",alignItems:"flex-start",gap:10,flex:1},label:{margin:0,fontSize:14,fontWeight:500,color:"#1a1a1a"},desc:{margin:"2px 0 0",fontSize:12,color:"#888",lineHeight:1.4},chevron:{fontSize:18,color:"#aaa",flexShrink:0,display:"inline-block",transition:"transform 0.2s"},body:{padding:"0 16px 14px 16px"},chatBanner:{background:"#eef4fd",border:"1px solid #c5d8f7",borderRadius:10,padding:"12px 14px",marginBottom:10},chatBannerTitle:{margin:"0 0 6px",fontSize:14,fontWeight:600,color:"#3a5a8a"},chatBannerBody:{margin:0,fontSize:13,color:"#4a6080",lineHeight:1.5},segmentedControl:{border:"1px solid #F2F4F7",display:"flex",background:"#F9FAFB",borderRadius:4,padding:6,gap:8},segmentedBtn:{flex:1,padding:"7px 0",fontSize:13,fontWeight:500,color:"#888",background:"transparent",border:"none",borderRadius:8,cursor:"pointer",transition:"background 0.15s, color 0.15s"},segmentedBtnActive:{background:"#dce8fa",color:"#2a4a7a",fontWeight:700},clauseCard:{background:"#fff",border:"1px solid #dde5f0",borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",width:"100%"},clauseFilename:{margin:"0 0 6px",fontSize:13,fontWeight:600,color:"#2a4a7a"},clauseExcerpt:{margin:0,fontSize:13,color:"#4a5a70",fontStyle:"italic",lineHeight:1.5}}},n={root:{animation:"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both",width:350,background:"#fff",borderRadius:18,boxShadow:"0 8px 48px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.07)",overflow:"hidden",fontFamily:"'DM Sans', 'Segoe UI', sans-serif"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",borderBottom:"1.5px solid #e2e8f0"},closeBtn:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},body:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:13,overflow:"auto"},meta:{},divider:{height:1,background:"#f1f5f9"},impactText:{margin:"10px 0 0",fontSize:13,lineHeight:1.65,color:"#334155"},secondSection:{marginTop:12,background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:12,padding:"14px 16px",fontSize:13,lineHeight:1.7,color:"#64748b",fontStyle:"italic"},actionsContainer:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:2}},a={container:{background:"#fff"},header:{display:"flex",alignItems:"center",justifyContent:"space-between"},innerHeader:{padding:"8px 12px"},innerBody:{padding:"8px 12px",color:"#4b5563"}},i={DeviationSummaryDefaults:e,IterateMenuDefaults:o,RedlineCardDefaults:n,CitationAccordionDefaults:a};export{a as CitationAccordionDefaults,e as DeviationSummaryDefaults,o as IterateMenuDefaults,n as RedlineCardDefaults,i as default};
2
+ //# sourceMappingURL=PopupDefaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PopupDefaults.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Undo2 as n}from"lucide-react";import{useState as r}from"react";function i(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var d=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},l=function(){return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},a=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},s=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},h=function(o){var n=o.open;return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},f=function(n){var r=n.color,i=void 0===r?"#3b82f6":r;return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},p=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},u=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function g(n){var r=n.title,i=n.open,d=n.onToggle,c=n.children;return o("div",e({style:{maxHeight:"170px",overflow:"auto"}},{children:[o("div",e({onClick:d,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t("span",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:r})),t(h,{open:i})]})),t("div",e({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:c}))]}))}function k(t){var n=t.icon,r=t.label,i=t.onClick,d=t.customStyle,c=e({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},void 0===d?{}:d);return o("button",e({onClick:i,style:c,onMouseEnter:function(e){e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)"},onMouseLeave:function(e){e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow=""}},{children:[n,r]}))}function b(h){var b=h.status,m=h.onClose,v=h.impactText,y=h.secondText,x=h.actionTakenByName,B=h.actionTakenAtTime,w=void 0===B?"NA":B,L=h.onHistory,S=h.onIterate,M=h.onReinstate,C=h.onRevert,W=h.impactTitle,T=void 0===W?"Impact":W,I=h.customConfigs,R=void 0===I?{}:I,j=h.customStyles,z=void 0===j?{}:j,H=r(!0),A=H[0],D=H[1],F=r(!0),U=F[0],E=F[1],N=r(!1),O=N[0],P=N[1],Y={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t(a,{}),StatusIcon:t(d,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t(f,{}),label:"History",onClick:L},{icon:t(n,{size:17}),label:"Revert",onClick:C},{icon:t(u,{}),label:"Iterate",onClick:S}]},q={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t(s,{}),StatusIcon:t(c,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t(f,{color:"#3b82f6"}),label:"History",onClick:L},{icon:t(p,{}),label:"Reinstate",onClick:M},{icon:t(u,{}),label:"Iterate",onClick:S}]},G={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t(a,{}),StatusIcon:t(n,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t(f,{}),label:"History",onClick:L},{icon:t(u,{}),label:"Iterate",onClick:S}]},J=e(e({},"accepted"===b?Y:"rejected"===b?q:G),R[b]||{});return o("div",e({style:e({animation:O?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both",width:350,background:"#fff",borderRadius:18,boxShadow:"0 8px 48px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.07)",overflow:"hidden",fontFamily:"'DM Sans', 'Segoe UI', sans-serif"},z.root)},{children:[o("div",e({style:e({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",background:J.headerBg,borderBottom:"1.5px solid ".concat(J.headerBorder)},z.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[J.StatusIcon,t("span",e({style:{fontSize:15,fontWeight:700,color:J.titleColor,letterSpacing:"-0.01em"}},{children:J.label}))]})),t("button",e({onClick:function(){P(!0),m()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t(l,{})}))]})),o("div",e({style:e({padding:"14px 16px",display:"flex",flexDirection:"column",gap:13,overflow:"auto"},z.body)},{children:[o("div",e({style:z.meta},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[J.UserIcon,t("span",e({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:J.metaLabel}))]})),o("div",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[x,", ",i(w)]}))]})),t("div",{style:e({height:1,background:"#f1f5f9"},z.divider)}),t(g,e({title:T,open:A,onToggle:function(){return D(function(e){return!e})}},{children:t("p",e({style:e({margin:"10px 0 0",fontSize:13,lineHeight:1.65,color:"#334155"},z.impactText)},{children:v||""}))})),t("div",{style:e({height:1,background:"#f1f5f9"},z.divider)}),t(g,e({title:J.secondTitle,open:U,onToggle:function(){return E(function(e){return!e})}},{children:t("div",e({style:e({marginTop:12,background:J.secondBg,border:"1.5px solid ".concat(J.secondBorder),borderRadius:12,padding:"14px 16px",fontSize:13,lineHeight:1.7,color:"#64748b",fontStyle:"italic"},z.secondSection)},{children:y||""}))})),t("div",e({style:e({display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:2},z.actionsContainer)},{children:J.actions.map(function(e){return t(k,{icon:e.icon,label:e.label,onClick:e.onClick,customStyle:e.style},e.label)})}))]}))]}))}export{b as RedlineCard,i as formatDate};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Undo2 as n}from"lucide-react";import{useState as r}from"react";import i from"./PopupDefaults.js";function d(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var l=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},a=function(){return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},s=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(o){var n=o.open;return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},f=function(n){var r=n.color,i=void 0===r?"#3b82f6":r;return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},p=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},k=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function g(n){var r=n.title,i=n.open,d=n.onToggle,l=n.children;return o("div",e({style:{maxHeight:"170px",overflow:"auto"}},{children:[o("div",e({onClick:d,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t("span",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:r})),t(u,{open:i})]})),t("div",e({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:l}))]}))}function b(t){var n=t.icon,r=t.label,i=t.onClick,d=t.customStyle,l=e({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},void 0===d?{}:d);return o("button",e({onClick:i,style:l,onMouseEnter:function(e){e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)"},onMouseLeave:function(e){e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow=""}},{children:[n,r]}))}function v(u){var v=u.status,m=u.onClose,y=u.impactText,x=u.secondText,B=u.actionTakenByName,C=u.actionTakenAtTime,L=void 0===C?"NA":C,w=u.onHistory,R=u.onIterate,M=u.onReinstate,W=u.onRevert,S=u.impactTitle,T=void 0===S?"Impact":S,I=u.customConfigs,D=void 0===I?{}:I,j=u.customStyles,z=void 0===j?{}:j,A=r(!0),H=A[0],F=A[1],U=r(!0),E=U[0],N=U[1],P=r(!1),O=P[0],Y=P[1],q={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t(s,{}),StatusIcon:t(l,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t(f,{}),label:"History",onClick:w},{icon:t(n,{size:17}),label:"Revert",onClick:W},{icon:t(k,{}),label:"Iterate",onClick:R}]},G={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t(h,{}),StatusIcon:t(c,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t(f,{color:"#3b82f6"}),label:"History",onClick:w},{icon:t(p,{}),label:"Reinstate",onClick:M},{icon:t(k,{}),label:"Iterate",onClick:R}]},J={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t(s,{}),StatusIcon:t(n,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t(f,{}),label:"History",onClick:w},{icon:t(k,{}),label:"Iterate",onClick:R}]},K=e(e({},"accepted"===v?q:"rejected"===v?G:J),D[v]||{});return o("div",e({style:e(e(e({},i.RedlineCardDefaults.root),{animation:O?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":i.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),z.root)},{children:[o("div",e({style:e(e(e({},i.RedlineCardDefaults.header),{background:K.headerBg,borderBottom:"1.5px solid ".concat(K.headerBorder)}),z.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[K.StatusIcon,t("span",e({style:{fontSize:15,fontWeight:700,color:K.titleColor,letterSpacing:"-0.01em"}},{children:K.label}))]})),t("button",e({onClick:function(){Y(!0),m()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t(a,{})}))]})),o("div",e({style:e(e({},i.RedlineCardDefaults.body),z.body)},{children:[o("div",e({style:e(e({},i.RedlineCardDefaults.meta),z.meta)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[K.UserIcon,t("span",e({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:K.metaLabel}))]})),o("div",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[B,", ",d(L)]}))]})),t("div",{style:e(e({},i.RedlineCardDefaults.divider),z.divider)}),t(g,e({title:T,open:H,onToggle:function(){return F(function(e){return!e})}},{children:t("p",e({style:e(e({},i.RedlineCardDefaults.impactText),z.impactText)},{children:y||""}))})),t("div",{style:e(e({},i.RedlineCardDefaults.divider),z.divider)}),t(g,e({title:K.secondTitle,open:E,onToggle:function(){return N(function(e){return!e})}},{children:t("div",e({style:e(e(e({},i.RedlineCardDefaults.secondSection),{background:K.secondBg,border:"1.5px solid ".concat(K.secondBorder)}),z.secondSection)},{children:x||""}))})),t("div",e({style:e(e({},i.RedlineCardDefaults.actionsContainer),z.actionsContainer)},{children:K.actions.map(function(e){return t(b,{icon:e.icon,label:e.label,onClick:e.onClick,customStyle:e.style},e.label)})}))]}))]}))}export{v as RedlineCard,d as formatDate};
2
2
  //# sourceMappingURL=RedlineStatusCard.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{default as CognitiveCompare}from"./features/CognitiveCompare/CognitiveCompare.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";
1
+ export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";
2
2
  //# sourceMappingURL=index.js.map