@viswa-test/test-citation 0.0.242 → 0.0.243

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 (69) hide show
  1. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
  2. package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  3. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  4. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  5. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  6. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
  7. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  8. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  9. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js +2 -0
  10. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js.map +1 -0
  11. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  12. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +2 -0
  13. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js.map +1 -0
  14. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +2 -0
  15. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js.map +1 -0
  16. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +2 -0
  17. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js.map +1 -0
  18. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +2 -0
  19. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js.map +1 -0
  20. package/dist/cjs/service/redlineService.js +1 -1
  21. package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
  22. package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  23. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  24. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  25. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  26. package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
  27. package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  28. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  29. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js +2 -0
  30. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js.map +1 -0
  31. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  32. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +2 -0
  33. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js.map +1 -0
  34. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +2 -0
  35. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js.map +1 -0
  36. package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +2 -0
  37. package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js.map +1 -0
  38. package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +2 -0
  39. package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js.map +1 -0
  40. package/dist/service/redlineService.js +1 -1
  41. package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
  42. package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
  43. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
  44. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +10 -1
  45. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
  46. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  47. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts +2398 -0
  48. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts.map +1 -0
  49. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  50. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.d.ts.map +1 -1
  51. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
  52. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts.map +1 -1
  53. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  54. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.d.ts +9 -0
  55. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.d.ts.map +1 -0
  56. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  57. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts +14 -0
  58. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts.map +1 -0
  59. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts +10 -0
  60. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts.map +1 -0
  61. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts +30 -0
  62. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts.map +1 -0
  63. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/index.d.ts +4 -0
  64. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/index.d.ts.map +1 -0
  65. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts +2 -0
  66. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts.map +1 -0
  67. package/dist/types/src/service/redlineService.d.ts +6 -0
  68. package/dist/types/src/service/redlineService.d.ts.map +1 -1
  69. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lucide-react"),i=require("react"),o=require("./PopupDefaults.js"),n=require("@mui/material"),r=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),s=require("./DeviationSummary.js"),l=require("../../../../../service/redlineService.js"),a=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(i);function x(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return 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")}const h=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),u=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),p=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),g=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),f=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),j=({open:t})=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),b=({color:t="#3b82f6"})=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M1.5 3.5v4h4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:t,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),v=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function y({title:t,open:i,onToggle:o,children:n}){return e.jsxs("div",{children:[e.jsxs("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:t}),e.jsx(j,{open:i})]}),e.jsx("div",{style:{maxHeight:i?100:0,opacity:i?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:i&&e.jsx(e.Fragment,{children:n})})]})}function m({icon:t,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:s={}}){const l={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:r?.5:1,...n,...r?s:{}};return e.jsxs("button",{onClick:r?void 0:o,disabled:r,style:l,onMouseEnter:e=>{r||(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:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[t,i]})}function w({steps:i}){if(!(null==i?void 0:i.length))return null;const o=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:o?"6px 8px":"8px 10px",background:"#F8FAFC",gap:o?4:8,overflow:"hidden"},children:i.map((n,r)=>{const s=(e=>{const t=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return t[e%t.length]})(r),l=r===i.length-1;return e.jsxs(c.default.Fragment,{children:[e.jsxs("span",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:o?4:6,overflow:"hidden"},children:[(a=n.status,"approved"===a?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===a?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsx(t.Hourglass,{size:o?14:16,color:"#F59E0B",style:{flexShrink:0}})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:o?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:o?20:22,height:o?20:22,minWidth:o?20:22,borderRadius:"50%",background:s.bg,color:s.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:o?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!l&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"18",height:o?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:o?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var a})})})}exports.ApprovedIcon=h,exports.ChevronIcon=j,exports.CloseIcon=p,exports.HistoryIcon=b,exports.IterateIcon=v,exports.RedlineCard=function({status:d,onClose:c,impactText:j,secondText:C,actionTakenByName:I,actionTakenAtTime:B="NA",onHistory:S,onIterate:R,onActionTrigger:L,disableAllActions:T=!1,impactTitle:W="Impact",customConfigs:A={},customStyles:M={},secondaryTitle:D,onAssignClick:F,onReviewUsersClick:E,assignedUsers:z,redlineId:H,aiReasonId:U,cognitiveIconSmall:q,cognitiveTootipTitle:N="Cognitive Decisioning",historyIconSmall:O,onHistoryClick:P,historyTootipTitle:$,onOpenCognitive:_,displayVariant:V="default",reviewTitle:K,reviewSubtitle:Y,reviewStatusIcon:G=e.jsx(t.Hourglass,{size:18}),reviewSteps:J=[],showReviewProgress:Q=!1,showOriginalText:X=!1,originalText:Z,originalTextHeader:ee="Original text",hideMeta:te=!1}){const[ie,oe]=i.useState(!0),[ne,re]=i.useState(!0),[se,le]=i.useState(!1);i.useState(!1);const[ae,de]=i.useState(!0),ce="review"===V||"review"===d,{redlineDcoumentId:xe,redlineConfig:he,updateRedlineDataParent:ue}=a.useRequirementAI(),pe={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e.jsx(g,{}),StatusIcon:e.jsx(h,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e.jsx(b,{}),label:"History",onClick:S},{icon:e.jsx(t.Undo2,{size:17}),label:"Revert",useLabel:!0},{icon:e.jsx(v,{}),label:"Iterate",onClick:R}],fallbackText:"No original text available"},ge={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e.jsx(f,{}),StatusIcon:e.jsx(u,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e.jsx(b,{color:"#3b82f6"}),label:"History",onClick:S},{icon:e.jsx(k,{}),label:"Reinstate",useLabel:!0},{icon:e.jsx(v,{}),label:"Iterate",onClick:R}],fallbackText:"No rejected recommendation available"},fe={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e.jsx(g,{}),StatusIcon:e.jsx(t.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e.jsx(b,{}),label:"History",onClick:S},{icon:e.jsx(v,{}),label:"Iterate",onClick:R}],fallbackText:"No reverted redline available"},je={headerBg:"#F8FAFC",headerBorder:"#E2E8F0",titleColor:"#1E293B",label:K||"Redline In Review",metaLabel:"Current Status",UserIcon:e.jsx(t.Hourglass,{size:16,color:"#94A3B8"}),StatusIcon:G,secondTitle:ee,secondBg:"#F8FAFC",secondBorder:"#CBD5E1",impactBox:!0,actions:[{icon:e.jsx(b,{}),label:"History",onClick:S},{icon:e.jsx(h,{}),label:"Approve",action:"accept",useLabel:!0},{icon:e.jsx(u,{}),label:"Reject",action:"reject",useLabel:!0},{icon:e.jsx(v,{}),label:"Iterate",onClick:R}],fallbackText:"No original text available"};let be;be=ce?je:"accepted"===d?pe:"rejected"===d?ge:fe;const ke={...be,...A[d]||{}},ve=ce&&Y||D;return e.jsxs("div",{style:{...o.default.RedlineCardDefaults.root,animation:se?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":o.default.RedlineCardDefaults.root.animation,...M.root},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.header,background:ke.headerBg,borderBottom:`1.5px solid ${ke.headerBorder}`,...M.header},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:ke.StatusIcon}),e.jsxs("div",{children:[e.jsx("span",{style:{fontSize:15,fontWeight:700,color:ke.titleColor,letterSpacing:"-0.01em"},children:ke.label}),e.jsx(n.Tooltip,{title:ve,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:ve})})]}),z&&z.length>0&&e.jsx(s.DisplayUsers,{users:z,onClick:e=>{e.stopPropagation(),null==E||E()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(F||_||P)&&e.jsx(s.KebabMenu,{onAssignClick:F,onOpenCognitive:_,cognitiveIconSmall:q,cognitiveTootipTitle:N,historyIconSmall:O,onHistoryClick:P,historyTootipTitle:$}),e.jsx("button",{onClick:()=>{le(!0),c()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e.jsx(p,{})})]})]}),ce&&Q&&J.length>0&&e.jsx("div",{style:{padding:"10px 14px 0"},children:e.jsx(w,{steps:J})}),e.jsxs("div",{style:{...o.default.RedlineCardDefaults.body,...M.body},children:[!ce&&!te&&e.jsxs("div",{style:{...o.default.RedlineCardDefaults.meta,...M.meta},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[ke.UserIcon,e.jsx("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:ke.metaLabel})]}),e.jsxs("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e.jsx(n.Tooltip,{title:I,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:I})}),e.jsx("span",{children:x(B)})]})]}),!ce&&!te&&e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...M.divider}}),e.jsx(y,{title:W,open:ie,onToggle:()=>oe(e=>!e),children:e.jsx("div",{style:{...o.default.RedlineCardDefaults.impactText,...M.impactText},children:e.jsx(r.AiReasonMarkdownWrapper,{message:`${j||""} [View chat](chat_citation$all)`,customStyles:M.impactMarkdown})})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...M.divider}}),e.jsx(y,{title:ce&&X?ee:ke.secondTitle,open:ce&&X?ae:ne,onToggle:()=>{ce&&X?de(e=>!e):re(e=>!e)},children:(ce&&X?Z:C)?e.jsx("div",{style:{...o.default.RedlineCardDefaults.secondSection,background:ke.secondBg,border:`1.5px solid ${ke.secondBorder}`,...M.secondSection},children:ce&&X?Z:C}):e.jsxs("div",{style:{...o.default.RedlineCardDefaults.fallbackSectionStyle,...M.fallbackSectionStyle},children:[ke.fallbackText," "]})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.actionsContainer,...M.actionsContainer},children:ke.actions.map(t=>e.jsx(m,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i;null==L||L({status:"loading",action:e,metadata:{redlineId:H,aiReasonId:U}});try{const{updated_reqai:o}=await l.resolveRedline({documentId:xe,userEmail:null==he?void 0:he.userEmail,userName:null==he?void 0:he.userName,redlineId:null!=H?H:"",action:e,baseApiUrl:null==he?void 0:he.baseApiUrl,redlineConfigId:null!==(t=null==he?void 0:he.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==he?void 0:he.token)&&void 0!==i?i:"");await(null==ue?void 0:ue(o)),null==L||L({status:"success",action:e,metadata:{redlineId:H,aiReasonId:U}})}catch(t){null==L||L({status:"failed",action:e,metadata:{redlineId:H,aiReasonId:U}})}})((t.action||t.label).toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...M.actionBtn},disabled:T||t.disabled,disabledStyle:M.actionBtnDisabled},t.label))})]})]})},exports.ReinstateIcon=k,exports.RejectedIcon=u,exports.UserApprovedIcon=g,exports.UserRejectedIcon=f,exports.formatDate=x;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lucide-react"),i=require("react"),o=require("./PopupDefaults.js"),n=require("@mui/material"),r=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),s=require("./DeviationSummary.js"),l=require("../../../../../service/redlineService.js"),a=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../cws/CwsEvent.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=c(i);function h(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return 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")}const u=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),p=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),f=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),g=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),j=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),v=({open:t})=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),b=({color:t="#3b82f6"})=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M1.5 3.5v4h4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:t,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),y=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function m({title:t,open:i,onToggle:o,children:n}){return e.jsxs("div",{children:[e.jsxs("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:t}),e.jsx(v,{open:i})]}),e.jsx("div",{style:{maxHeight:i?100:0,opacity:i?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:i&&e.jsx(e.Fragment,{children:n})})]})}function w({icon:t,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:s={}}){const l={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:r?.5:1,...n,...r?s:{}};return e.jsxs("button",{onClick:r?void 0:o,disabled:r,style:l,onMouseEnter:e=>{r||(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:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[t,i]})}function C({steps:i}){if(!(null==i?void 0:i.length))return null;const o=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:o?"6px 8px":"8px 10px",background:"#F8FAFC",gap:o?4:8,overflow:"hidden"},children:i.map((n,r)=>{const s=(e=>{const t=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return t[e%t.length]})(r),l=r===i.length-1;return e.jsxs(x.default.Fragment,{children:[e.jsxs("span",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:o?4:6,overflow:"hidden"},children:[(a=n.status,"approved"===a?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===a?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsx(t.Hourglass,{size:o?14:16,color:"#F59E0B",style:{flexShrink:0}})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:o?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:o?20:22,height:o?20:22,minWidth:o?20:22,borderRadius:"50%",background:s.bg,color:s.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:o?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!l&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"18",height:o?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:o?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var a})})})}exports.ApprovedIcon=u,exports.ChevronIcon=v,exports.CloseIcon=f,exports.HistoryIcon=b,exports.IterateIcon=y,exports.RedlineCard=function({status:c,onClose:x,impactText:v,secondText:I,actionTakenByName:B,actionTakenAtTime:S="NA",onHistory:R,onIterate:L,onActionTrigger:T,disableAllActions:W=!1,impactTitle:A="Impact",customConfigs:M={},customStyles:D={},secondaryTitle:F,onAssignClick:E,onReviewUsersClick:z,assignedUsers:H,redlineId:U,aiReasonId:q,cognitiveIconSmall:N,cognitiveTootipTitle:O="Cognitive Decisioning",historyIconSmall:P,onHistoryClick:$,historyTootipTitle:_,onOpenCognitive:V,displayVariant:K="default",reviewTitle:Y,reviewSubtitle:G,reviewStatusIcon:J=e.jsx(t.Hourglass,{size:18}),reviewSteps:Q=[],showReviewProgress:X=!1,showOriginalText:Z=!1,originalText:ee,originalTextHeader:te="Original text",hideMeta:ie=!1}){const[oe,ne]=i.useState(!0),[re,se]=i.useState(!0),[le,ae]=i.useState(!1);i.useState(!1);const[de,ce]=i.useState(!0),xe="review"===K||"review"===c,{redlineDcoumentId:he,redlineConfig:ue,updateRedlineDataParent:pe}=a.useRequirementAI(),fe={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e.jsx(g,{}),StatusIcon:e.jsx(u,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e.jsx(b,{}),label:"History",onClick:R},{icon:e.jsx(t.Undo2,{size:17}),label:"Revert",useLabel:!0},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No original text available"},ge={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e.jsx(j,{}),StatusIcon:e.jsx(p,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e.jsx(b,{color:"#3b82f6"}),label:"History",onClick:R},{icon:e.jsx(k,{}),label:"Reinstate",useLabel:!0},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No rejected recommendation available"},je={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e.jsx(g,{}),StatusIcon:e.jsx(t.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e.jsx(b,{}),label:"History",onClick:R},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No reverted redline available"},ve={headerBg:"#F8FAFC",headerBorder:"#E2E8F0",titleColor:"#1E293B",label:Y||"Redline In Review",metaLabel:"Current Status",UserIcon:e.jsx(t.Hourglass,{size:16,color:"#94A3B8"}),StatusIcon:J,secondTitle:te,secondBg:"#F8FAFC",secondBorder:"#CBD5E1",impactBox:!0,actions:[{icon:e.jsx(b,{}),label:"History",onClick:R},{icon:e.jsx(u,{}),label:"Approve",action:"accept",useLabel:!0},{icon:e.jsx(p,{}),label:"Reject",action:"reject",useLabel:!0},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No original text available"};let be;be=xe?ve:"accepted"===c?fe:"rejected"===c?ge:je;const ke={...be,...M[c]||{}},ye=xe&&G||F;return e.jsxs("div",{style:{...o.default.RedlineCardDefaults.root,animation:le?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":o.default.RedlineCardDefaults.root.animation,...D.root},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.header,background:ke.headerBg,borderBottom:`1.5px solid ${ke.headerBorder}`,...D.header},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:ke.StatusIcon}),e.jsxs("div",{children:[e.jsx("span",{style:{fontSize:15,fontWeight:700,color:ke.titleColor,letterSpacing:"-0.01em"},children:ke.label}),e.jsx(n.Tooltip,{title:ye,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:ye})})]}),H&&H.length>0&&e.jsx(s.DisplayUsers,{users:H,onClick:e=>{e.stopPropagation(),null==z||z()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(E||V||$)&&e.jsx(s.KebabMenu,{onAssignClick:E,onOpenCognitive:V,cognitiveIconSmall:N,cognitiveTootipTitle:O,historyIconSmall:P,onHistoryClick:$,historyTootipTitle:_}),e.jsx("button",{onClick:()=>{ae(!0),x()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e.jsx(f,{})})]})]}),xe&&X&&Q.length>0&&e.jsx("div",{style:{padding:"10px 14px 0"},children:e.jsx(C,{steps:Q})}),e.jsxs("div",{style:{...o.default.RedlineCardDefaults.body,...D.body},children:[!xe&&!ie&&e.jsxs("div",{style:{...o.default.RedlineCardDefaults.meta,...D.meta},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[ke.UserIcon,e.jsx("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:ke.metaLabel})]}),e.jsxs("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e.jsx(n.Tooltip,{title:B,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:B})}),e.jsx("span",{children:h(S)})]})]}),!xe&&!ie&&e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...D.divider}}),e.jsx(m,{title:A,open:oe,onToggle:()=>ne(e=>!e),children:e.jsx("div",{style:{...o.default.RedlineCardDefaults.impactText,...D.impactText},children:e.jsx(r.AiReasonMarkdownWrapper,{message:`${v||""} [View chat](chat_citation$all)`,customStyles:D.impactMarkdown})})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...D.divider}}),e.jsx(m,{title:xe&&Z?te:ke.secondTitle,open:xe&&Z?de:re,onToggle:()=>{xe&&Z?ce(e=>!e):se(e=>!e)},children:(xe&&Z?ee:I)?e.jsx("div",{style:{...o.default.RedlineCardDefaults.secondSection,background:ke.secondBg,border:`1.5px solid ${ke.secondBorder}`,...D.secondSection},children:xe&&Z?ee:I}):e.jsxs("div",{style:{...o.default.RedlineCardDefaults.fallbackSectionStyle,...D.fallbackSectionStyle},children:[ke.fallbackText," "]})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.actionsContainer,...D.actionsContainer},children:ke.actions.map(t=>e.jsx(w,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i,o,n,r,s;null==T||T({status:"loading",action:e,metadata:{redlineId:U,aiReasonId:q}});try{const{updated_reqai:a}=await l.resolveRedline({documentId:he,userEmail:null==ue?void 0:ue.userEmail,userName:null==ue?void 0:ue.userName,redlineId:null!=U?U:"",action:e,baseApiUrl:null==ue?void 0:ue.baseApiUrl,redlineConfigId:null!==(t=null==ue?void 0:ue.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==ue?void 0:ue.token)&&void 0!==i?i:"");await(null==pe?void 0:pe(a)),null===(o=d.default.emit)||void 0===o||o.call(d.default,`redline-edit:${he}:${null===(s=null===(r=null===(n=null==a?void 0:a.artifactData)||void 0===n?void 0:n.userStorySnapshot)||void 0===r?void 0:r[0])||void 0===s?void 0:s.artifactId}`,{updatedBy:null==ue?void 0:ue.userName}),null==T||T({status:"success",action:e,metadata:{redlineId:U,aiReasonId:q}})}catch(t){null==T||T({status:"failed",action:e,metadata:{redlineId:U,aiReasonId:q}})}})((t.action||t.label).toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...D.actionBtn},disabled:W||t.disabled,disabledStyle:D.actionBtnDisabled},t.label))})]})]})},exports.ReinstateIcon=k,exports.RejectedIcon=p,exports.UserApprovedIcon=g,exports.UserRejectedIcon=j,exports.formatDate=h;
2
2
  //# sourceMappingURL=RedlineStatusCard.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("lucide-react");exports.default=function({children:n,onRefresh:o,onCancel:t}){return e.jsxs("div",{style:{width:360,background:"#fff",borderRadius:12,border:"1px solid #e5e7eb",boxShadow:"0 10px 30px rgba(0, 0, 0, 0.12)",padding:12,fontFamily:"Inter"},children:[t&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:e.jsx("button",{onClick:t,style:{border:"none",background:"transparent",cursor:"pointer",fontSize:15,color:"#6b7280"},children:e.jsx(r.X,{})})}),e.jsx("div",{style:{fontSize:14,color:"#374151",lineHeight:1.6,marginBottom:5},children:n}),e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:o&&e.jsx("button",{onClick:o,style:{padding:"8px",borderRadius:8,border:"none",background:"#2563eb",color:"#fff",cursor:"pointer",fontSize:16},children:"Refresh"})})]})};
2
+ //# sourceMappingURL=RedlineToast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RedlineToast.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("lucide-react"),n=require("showdown"),o=require("@mui/material"),i=require("../../icons/Illustration.svg.js"),s=require("uuid"),a=require("./UserStoryCard.module.css.js"),r=require("../../utils/helpers.js"),d=require("../../utils/user-story.utils.js"),u=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),v=require("../userstory-with-citation/UserStoryWithCitation.js"),p=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../story-screen/BigEnoughPanel.js"),m=require("./TitleEditor/TitleEditor.js"),h=require("../../../../service/redlineService.js"),y=require("./ClinicalTrialSection.js"),S=require("../story-screen/CompletionPanel.js"),g=require("../../icons/CDIcon.js");function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=C(n);const I={[p.SectionStatus.WAITING]:"WAITING TO GENERATE",[p.SectionStatus.IN_PROGRESS]:"IN PROGRESS",[p.SectionStatus.GENERATED]:"GENERATED",[p.SectionStatus.FAILED]:"FAILED",[p.SectionStatus.GENERATE]:"GENERATE",[p.SectionStatus.APPROVED]:"APPROVED"};function j(t){const n=[],i=/<learned>(.*?)<\/learned>/g;let a,r=0,d=0;for(;null!==(a=i.exec(t));){const[,u]=a,c=a.index;c>r&&n.push(e.jsx("span",{children:t.slice(r,c)},"text-pre-"+d++)),n.push(e.jsx(o.Tooltip,{title:u,placement:"top",children:e.jsx(l.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${s.v4()}`)),r=i.lastIndex}return r<(null==t?void 0:t.length)&&n.push(e.jsx("span",{children:t.slice(r)},"text-post-"+d++)),n}function b(e,t,l){var n;if(!e)return{};if(t)return{...e.parentConfig};const o={...e.childConfig};return l&&(null===(n=e.subFeatureOverrides)||void 0===n?void 0:n[l])?{...o,...e.subFeatureOverrides[l]}:o}const w=({displayName:t})=>{var n;const{customStyles:o}=p.useRequirementAI(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e.jsxs("div",{className:a.default.displayName,style:null==i?void 0:i.wrapper,children:[e.jsx(l.Bookmark,{className:a.default.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e.jsxs("span",{style:null==i?void 0:i.label,children:[t,":"]})]})},N=({isUserStoryCurrentlyUpdated:n,artifactId:C,artifactTitleId:E,parentUserStory:D,currentUserStory:B,onUserStoryChange:A,parentIndex:T,currentIndex:k,enableDownload:U,isDiffEditReviewMode:P,showUserStoryDiff:R,handleDownloadUserStory:M,handleOpenSendDialog:_,updateUserStoryArtifact:q,selectedArtifactId:L,isDisplayHighlightControl:F,elementDisplayConfig:W,_resolvedConfig:O,showWrapper:z=!1,defaultExpanded:V,actionItemsConfig:G,onDelete:$,contextVariant:H,expandedSubFeatures:Q,showDisplayName:Y=!0,allowTitleEdit:X=!0,showConfidenceScore:Z=!0,showBorderTop:J=!0,sectionStatusConfig:K,showCompletionPanel:ee=!1,completionPanelConfig:te,showAddSectionButton:le=!1,disableEditPlan:ne=!1,useMuiTooltip:oe=!1,approveButtonConfig:ie,editButtonConfig:se,CDNeededInChip:ae,blockNumber:re,showWaitingIconInChip:de,showAssignSection:ue=!1,disableAssignSection:ce=!1,onAssignSectionClick:ve})=>{var pe,fe,me,he,ye,Se,ge,Ce,xe,Ie,je,be,we,Ne,Ee,De,Be,Ae,Te,ke,Ue,Pe,Re,Me;const{isLoadingSectionData:_e=!1,onLoadSectionData:qe,status:Le,onStatusClick:Fe,completedCount:We,totalCount:Oe,isNoDataAvailable:ze=!1}=null!=K?K:{},{searchQueryList:Ve,citations:Ge,customStyles:$e,onEditBlocked:He,redlineDcoumentId:Qe,redlineConfig:Ye,customSectionConfig:Xe,updateRedlineDataParent:Ze,aiReasoning:Je}=p.useRequirementAI(),Ke=null==$e?void 0:$e.userStoryCardStyles,et=null==Ke?void 0:Ke.customSectionEditButton,tt=null==Ke?void 0:Ke.statusStyles,lt=null===(pe=null==$e?void 0:$e.userStoryCardStyles)||void 0===pe?void 0:pe.userStoryEditStyles,nt=null===(fe=null==$e?void 0:$e.userStoryScreenStyles)||void 0===fe?void 0:fe.userStoryContentStyles,ot=null==Ke?void 0:Ke.progressHeaderStyles,it=null==Ke?void 0:Ke.clinicalTrialSectionStyles,st=null==Ke?void 0:Ke.CompletionStyles,at=null==Ke?void 0:Ke.noDataStyles,rt=null==Ke?void 0:Ke.approveButtonStyles,dt=null!==(he=null===(me=null==Xe?void 0:Xe.shouldRender)||void 0===me?void 0:me.call(Xe,B))&&void 0!==he&&he,ut=null===(ye=null==Xe?void 0:Xe.getValue)||void 0===ye?void 0:ye.call(Xe,B),ct=null!==(ge=null===(Se=null==Xe?void 0:Xe.getFields)||void 0===Se?void 0:Se.call(Xe,B))&&void 0!==ge?ge:[],vt=null!==(Ce=null==Xe?void 0:Xe.isEditDisabled)&&void 0!==Ce&&Ce,pt=null!==(Ie=null===(xe=null==Xe?void 0:Xe.isSaving)||void 0===xe?void 0:xe.call(Xe,B))&&void 0!==Ie&&Ie,ft=(mt=null!==(je=B.completion_percentage)&&void 0!==je?je:0,ht=st,mt>=80?null==ht?void 0:ht.highCompletion:mt>=50?null==ht?void 0:ht.mediumCompletion:null==ht?void 0:ht.lowCompletion);var mt,ht;const yt={[p.SectionStatus.WAITING]:null==tt?void 0:tt.waiting,[p.SectionStatus.IN_PROGRESS]:null==tt?void 0:tt.inProgress,[p.SectionStatus.GENERATED]:null==tt?void 0:tt.generated,[p.SectionStatus.FAILED]:null==tt?void 0:tt.failed,[p.SectionStatus.GENERATE]:null==tt?void 0:tt.generate,[p.SectionStatus.APPROVED]:null==tt?void 0:tt.approved},[St,gt]=t.useState({...structuredClone(B),value:r.formatMarkdown(B.value)||""}),[Ct,xt]=t.useState({userStory:!!B.isDefaultEdit}),[It,jt]=t.useState(!1),[bt,wt]=t.useState(!1),[Nt,Et]=t.useState(null),[Dt,Bt]=t.useState(null),{userStory:At,customIcons:Tt}=p.useRequirementAI(),[kt,Ut]=t.useState(null!=V?V:""===T||L===B.artifactId||!!B.isDefaultOpen),[Pt,Rt]=t.useState(!1),[Mt,_t]=t.useState(null),[qt,Lt]=t.useState(null),[Ft,Wt]=t.useState(!1),Ot=t.useRef(null),zt=t.useRef(null),[Vt,Gt]=t.useState(!1),[$t,Ht]=t.useState(!1),Qt=t.useRef(null),[Yt,Xt]=t.useState(!1),[Zt,Jt]=t.useState(B.value);t.useEffect(()=>{n&&Ut(n)},[n]),t.useEffect(()=>{gt({...structuredClone(B),value:r.formatMarkdown(B.value)||""})},[B]),t.useEffect(()=>{Ve.length>0?Ut(!0):void 0===V&&L&&Ut(L===B.artifactId)},[Ve,L,B.artifactId]),t.useEffect(()=>{Q&&Q.length>0&&Ut(Q.includes(B.artifactId)||""===T||L===B.artifactId||!!B.isDefaultOpen)},[Q]);const Kt=()=>{_t(null)},el=()=>{Lt(null)},tl=()=>{kt&&Ct.userStory&&zt.current&&!zt.current.requestClose()||Ut(e=>!e)},ll=async()=>{var e,t;try{"userStory"==="userStory"&&(A(St),console.log("I am changing RTE editor values",St)),await(null===(e=null==se?void 0:se.onSaveEditedSection)||void 0===e?void 0:e.call(se,St)),await q(Ge,At,C,null===(t=Qt.current)||void 0===t?void 0:t.signal)}finally{}};const nl=null!=(null==B?void 0:B.big_enough)&&!Number.isNaN(B.big_enough)&&!!(null==B?void 0:B.big_enough_decision_factors),ol=null!==(be=null==B?void 0:B.completion_percentage)&&void 0!==be?be:0,il=!!(null==B?void 0:B.completion_decision_factors),sl=""===T,al=null!=O?O:b(W,sl),rl=!P&&!R;t.useEffect(()=>{if(!Dt)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${Dt}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[Dt]),t.useEffect(()=>{B.isDefaultEdit&&xt(e=>({...e,userStory:!0}))},[B.isDefaultEdit]),console.log("block number in userstory card ",re),console.log("[TESTING-CURRENT-USER-STORY] \n",B,"\n[TESTING-USER-STORY] \n",At);return t.useEffect(()=>Jt(B.value),[B.value]),e.jsxs("div",{className:a.default.card,"data-block-id":"user-story-card-wrapper-"+re,style:null==Ke?void 0:Ke.cardStyle,id:`story-card-${B.title}`,"data-expanded":kt,children:[e.jsxs("div",{className:a.default.titleSection,style:null==Ke?void 0:Ke.titleSection,children:[e.jsxs("div",{className:a.default.titleRow,style:null==Ke?void 0:Ke.titleRow,onClick:tl,children:[e.jsxs("div",{className:a.default.titleLeft,style:null==Ke?void 0:Ke.titleLeft,onMouseEnter:()=>Gt(!0),onMouseLeave:()=>Gt(!1),children:[Y&&e.jsx(w,{displayName:E}),It&&rl?e.jsx(m.InlineTitleEditor,{title:B.title,onSave:e=>(async(e,t)=>{var l;try{let n={...B};B.artifactId===t?n.title=e:n.sub_features=(null===(l=B.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],gt(n),A(n),jt(!1)}catch(e){console.error("Failed to save title",e)}})(e,B.artifactId),onCancel:()=>{jt(!1)},inputStyle:null==lt?void 0:lt.inlineTitleInput,confirmButtonStyle:null==lt?void 0:lt.inlineTitleConfirm,cancelButtonStyle:null==lt?void 0:lt.inlineTitleCancel},"inline-title-editor"):e.jsxs("div",{className:a.default.storyTitleWrapper,children:[e.jsx(o.Tooltip,{title:j(B.title),arrow:!0,children:e.jsx("h2",{title:oe?void 0:B.title,className:a.default.storyTitle,style:null==Ke?void 0:Ke.storyTitle,children:j(B.title)},B.artifactId)}),ee&&(il?e.jsx(S.CompletionPanel,{customIcons:null==Tt?void 0:Tt.userStoryIcons,customStyles:null==Ke?void 0:Ke.aiReasoningCitaionStyles,currentUserStory:B,panelStyles:null==Ke?void 0:Ke.CompletionStyles,onToggleStateChange:Ht,completionPanelConfig:te,children:e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==st?void 0:st.badge,...ft},children:[e.jsxs("span",{children:[ol,"% Completed"]}),e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(g.default,{color:"currentColor"})}),$t?e.jsx(l.ChevronUp,{size:14,style:null==st?void 0:st.chevronStyle}):e.jsx(l.ChevronDown,{size:14,style:null==st?void 0:st.chevronStyle})]})}):e.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==st?void 0:st.badge,...ft},children:e.jsxs("span",{children:[ol,"% Completed"]})})),X&&e.jsx("button",{type:"button",className:a.default.titleEditButton,style:null==lt?void 0:lt.titleEditButton,onClick:e=>{e.stopPropagation(),jt(!0),kt||Ut(!0)},"aria-label":"Edit title",title:"Edit title",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]}),(Le||void 0!==We&&void 0!==Oe)&&e.jsxs("div",{className:a.default.statusContainer,children:[void 0!==We&&void 0!==Oe&&e.jsxs("div",{className:a.default.completedBadge,children:["Completed: ",We,"/",Oe]}),Le&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==Fe||Fe()},onMouseEnter:()=>Xt(!0),onMouseLeave:()=>Xt(!1),className:a.default.statusButton,style:{...null===(we=yt[Le])||void 0===we?void 0:we.default,...Yt&&(null===(Ne=yt[Le])||void 0===Ne?void 0:Ne.hover)},children:I[Le]})]}),e.jsxs("div",{className:a.default.titleActions,style:null==Ke?void 0:Ke.titleActions,onClick:e=>e.stopPropagation(),children:[(al.showProgressPercentage||al.showGapBox)&&z&&e.jsxs("div",{className:a.default.progressHeader,style:null==ot?void 0:ot.wrapper,children:[al.showProgressPercentage&&e.jsxs("div",{className:a.default.progressPercentage,style:null==ot?void 0:ot.percentage,children:[null!==(De=null!==(Ee=null==B?void 0:B.confidenceScore)&&void 0!==Ee?Ee:null==al?void 0:al.confidenceValue)&&void 0!==De?De:"0","%"]}),al.showGapBox&&e.jsxs("div",{className:a.default.gapBox,style:null==ot?void 0:ot.gapBox,children:[null!==(Ae=null!==(Be=null==B?void 0:B.gapValue)&&void 0!==Be?Be:null==al?void 0:al.gapBoxValue)&&void 0!==Ae?Ae:"2"," ","Gaps"]})]}),nl&&e.jsx(f.BigEnoughPanel,{customIcons:null==Tt?void 0:Tt.userStoryIcons,customStyles:null==Ke?void 0:Ke.aiReasoningCitaionStyles,currentUserStory:B,panelStyles:null==Ke?void 0:Ke.BigEnoughStyles}),ue&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==Ke?void 0:Ke.iconButton,disabled:ce,onClick:e=>{e.stopPropagation(),null==ve||ve(B)},"aria-label":"Assign section users",title:"Assign section users",children:e.jsx(l.Users,{size:16})}),!Ct.userStory&&e.jsxs(e.Fragment,{children:[!1!==(null==al?void 0:al.showShareButton)&&e.jsx("button",{className:a.default.iconButton,style:null==Ke?void 0:Ke.iconButton,onClick:e=>{_t(e.currentTarget)},children:e.jsx(l.ExternalLink,{size:16})}),e.jsxs(o.Menu,{id:"user-story-share-menu",anchorEl:Mt,open:!!Mt,onClose:()=>_t(null),style:null==Ke?void 0:Ke.userStoryShareMenu,children:[U&&e.jsx(o.MenuItem,{style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:async()=>{Rt(!0),M&&(await Promise.all([M("pdf"),M("doc")]),Rt(!1))},children:e.jsxs("div",{ref:Ot,className:a.default.menuItemContent,style:null==Ke?void 0:Ke.menuItemContent,children:[e.jsx(l.Download,{size:16,color:null==Ke?void 0:Ke.menuIconColor}),e.jsx("p",{style:null==Ke?void 0:Ke.menuLabel,children:"Download"})]})}),e.jsx(o.MenuItem,{style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:async()=>{let e=B;D&&(e={...B,value:`${d.replaceTitleSection(null==D?void 0:D.value,B.title)} \n${B.value}`}),null==_||_(!0,[e],B.artifactId),Kt()},children:e.jsxs("div",{style:null==Ke?void 0:Ke.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Share2,{size:16,color:null==Ke?void 0:Ke.menuIconColor}),e.jsx("p",{style:null==Ke?void 0:Ke.menuLabel,children:"Send"})]})}),e.jsx(o.MenuItem,{style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:async()=>{const e=(new x.default.Converter).makeHtml(r.formatMarkdown(B.value)||B.value),t=function(e){const t=(new x.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(r.formatMarkdown(B.value)||B.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Kt()}},children:e.jsxs("div",{style:null==Ke?void 0:Ke.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Copy,{size:16,color:null==Ke?void 0:Ke.menuIconColor}),e.jsx("p",{style:null==Ke?void 0:Ke.menuLabel,children:"Copy"})]})})]})]}),!Ft&&Ct.userStory&&kt?e.jsx(u.default,{type:"outline",children:"Cancel",style:null==Ke?void 0:Ke.cancelButton,onClick:()=>{var e;null===(e=Qt.current)||void 0===e||e.abort(),xt(e=>({...e,userStory:!1}))}}):e.jsx(e.Fragment,{}),Ct.userStory&&kt?e.jsx(u.default,{type:"fill",children:Ft?e.jsxs("span",{className:a.default.savingSpinner,style:null==Ke?void 0:Ke.savingSpinner,children:[e.jsx(l.LoaderCircle,{className:a.default.spinAnimation,style:null==Ke?void 0:Ke.spinAnimation}),e.jsx("span",{children:"Saving..."})]}):"Save",isDisable:Ft,style:Ft?null==Ke?void 0:Ke.savingButton:null==Ke?void 0:Ke.saveButton,onClick:async()=>{Wt(!0),await ll();let e=await(async()=>{var e,t,l,n,o;let i=St.value;console.log("[V] valueToUpdate before",i),i=i.replace(/<invisible\s+id="([^"]+)"\s*><\/invisible>/gi,"\x3c!-- $1 --\x3e"),console.log("[V] valueToUpdate after",i);try{if(null==Ye?void 0:Ye.callUpdateDocument){const{updated_reqai:s}=await h.updateRedlineDocument({documentId:Qe,sectionId:B.artifactId,baseApiUrl:null==Ye?void 0:Ye.baseApiUrl,updatedContent:i,userEmail:Ye.userEmail,userName:Ye.userName,redlineConfigId:null!==(e=Ye.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Ye?void 0:Ye.token)&&void 0!==t?t:"");i=null===(o=null===(n=null===(l=null==s?void 0:s.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===o?void 0:o.value,await(null==Ze?void 0:Ze(s))}}catch(e){console.error("failed to update redline document",e),i=Zt}return i=i.replace(/<!--\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,'<invisible id="$1"></invisible>'),i})();const t={...St,value:e};A({...t,isDefaultEdit:!1}),Jt(t.value),xt(e=>({...e,userStory:!1})),Wt(!1)}}):!P&&!R&&!ne&&kt&&!1!==(null==al?void 0:al.showEditButton)&&e.jsx("button",{className:a.default.iconButton,style:null==Ke?void 0:Ke.editButton,onClick:()=>xt(e=>({...e,userStory:!0})),children:e.jsx(l.PencilIcon,{color:null==Ke?void 0:Ke.pencilIconColor,size:16})}),le&&sl&&kt&&!P&&!R&&!1!==(null==al?void 0:al.showEditButton)&&e.jsxs("button",{type:"button",className:a.default.addSectionButton,style:null==lt?void 0:lt.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=B.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:s.v4(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...B,sub_features:[...null!==(n=B.sub_features)&&void 0!==n?n:[],i]};gt(a),A(a),Ut(!0),Bt(i.title)},"aria-label":"Add section",title:"Add section",children:[e.jsx(l.Plus,{size:14}),e.jsx("span",{className:a.default.addSectionLabel,children:"Add Section"})]}),!sl&&!P&&!ne&&!R&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==$||$()},className:a.default.iconButton,style:null==lt?void 0:lt.deleteButton,"aria-label":"Delete section",title:"Delete section",children:e.jsx(l.Trash2,{size:16})}),dt&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==et?void 0:et.button,disabled:vt,onClick:e=>{if(e.stopPropagation(),bt)return Et(null),void wt(!1);Et(structuredClone(null!=ut?ut:{})),Ut(!0),wt(!0)},children:bt?e.jsx(l.X,{size:16,color:null==Ke?void 0:Ke.pencilIconColor,style:null==et?void 0:et.cancelIcon}):e.jsx(l.PencilIcon,{size:16,color:null==Ke?void 0:Ke.pencilIconColor,style:null==et?void 0:et.editIcon})}),(null==al?void 0:al.actionItemsButton)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:a.default.actionItemBtn,style:null==Ke?void 0:Ke.actionItemBtn,onClick:e=>{e.stopPropagation(),Lt(e.currentTarget)},children:e.jsx(l.Ellipsis,{})}),e.jsx(o.Menu,{id:"user-story-action-menu",anchorEl:qt,open:!!qt,onClose:el,style:null==Ke?void 0:Ke.userStoryShareMenu,children:null==G?void 0:G.items.map((t,l)=>e.jsx(o.MenuItem,{style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:()=>{t.onclick(B),el()},children:e.jsxs("div",{className:a.default.menuItemContent,style:{...null==Ke?void 0:Ke.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[e.jsx("span",{className:a.default.menuItemIcon,style:null==Ke?void 0:Ke.menuItemIcon,children:t.icon}),e.jsx("p",{style:null==Ke?void 0:Ke.menuLabel,children:t.name}),e.jsx("span",{className:a.default.menuItemRight,style:null==Ke?void 0:Ke.menuItemRight})]})},`action-item-${l}-${t.name}`))})]}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),tl()},style:null==Ke?void 0:Ke.chevronButton,className:a.default.chevronButton,children:kt?e.jsx(l.ChevronUp,{className:a.default.chevronIcon,color:null==Ke?void 0:Ke.chevronIconColor}):e.jsx(l.ChevronDown,{className:a.default.chevronIcon,color:null==Ke?void 0:Ke.chevronIconColor})})]})]}),e.jsx("div",{className:a.default.divider,style:null==Ke?void 0:Ke.dividerStyle})]}),kt&&e.jsx("div",{className:a.default.cardContent,style:{...null==Ke?void 0:Ke.cardContentStyle,borderTop:J?"1px solid #E5E5E5":"none"},children:_e?e.jsxs("div",{className:a.default.loadingContainer,children:[e.jsx("div",{className:a.default.loadingIconWrapper,children:e.jsx(l.Hourglass,{size:28,color:"#5B3DF5",className:a.default.spinAnimation})}),e.jsxs("div",{children:[e.jsx("h3",{className:a.default.loadingTitle,children:"Section generation in progress.."}),e.jsx("p",{className:a.default.loadingSubtitle,children:"This may take a few minutes"})]}),e.jsx("button",{type:"button",onClick:()=>null==qe?void 0:qe(),className:a.default.viewStatusButton,children:"View Status"})]}):ze?e.jsxs("div",{className:a.default.noDataContainer,style:null==at?void 0:at.container,children:[e.jsx("img",{src:i.default,alt:"No data available",className:a.default.noDataIllustration,style:null==at?void 0:at.illustration}),e.jsx("h3",{className:a.default.noDataTitle,style:null==at?void 0:at.title,children:"No Data Available for This Section"}),e.jsx("p",{className:a.default.noDataSubtitle,style:null==at?void 0:at.subtitle,children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."})]}):e.jsxs("div",{className:a.default.contentInner,style:null==Ke?void 0:Ke.contentInner,children:[e.jsxs("div",{className:a.default.descriptionSection,style:null==Ke?void 0:Ke.descriptionSection,children:[e.jsx("div",{className:a.default.justifyBetween,style:null==Ke?void 0:Ke.justifyBetween}),Ct.userStory?e.jsx(c.default,{ref:zt,minHeight:"100%",height:"100%",type:"string",value:r.formatMarkdown(Zt)||"",handleUpdateState:(e,t)=>{const l=d.postprocessUserStoryAfterEdit(r.indentMarkdown(t));gt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:Ct.userStory?"edit":"readOnly",onEditBlocked:He,onSaveUnsavedChanges:async()=>{await ll(),Ut(!1)},onDiscardUnsavedChanges:()=>{gt({...structuredClone(B),value:r.formatMarkdown(B.value)||""}),xt(e=>({...e,userStory:!1})),Ut(!1)},isSavingUnsavedChanges:Ft}):dt?e.jsx(y.default,{styles:it,fields:ct,readonly:!bt,isSaving:pt,value:null!==(Te=null!=Nt?Nt:ut)&&void 0!==Te?Te:{},onChange:Et,onSave:async()=>{var e;Nt&&(await(null===(e=null==Xe?void 0:Xe.onSave)||void 0===e?void 0:e.call(Xe,B,Nt)),Et(null),wt(!1))},onCancel:()=>{Et(null),wt(!1)}}):e.jsxs(e.Fragment,{children:[e.jsx(v.default,{showUserStoryDiff:R,isParent:""===T,message:r.formatMarkdown(B.value)||"",artifactId:B.artifactId,customStyles:nt,isDisplayHighlightControl:F,contextVariant:H,showConfidenceScore:Z,CDNeededInChip:ae,blockId:re,showWaitingIconInChip:de}),(ie||se)&&e.jsxs("div",{className:a.default.actionButtonsContainer,style:null==rt?void 0:rt.container,children:[se&&!Ct.userStory&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:a.default.actionButton,style:null==rt?void 0:rt.button,disabled:se.disabled||se.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=se.onClick)||void 0===t||t.call(se),xt(e=>({...e,userStory:!0})),Ut(!0)},children:se.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==rt?void 0:rt.icon}),e.jsx("span",{style:null==rt?void 0:rt.text,children:null!==(ke=se.label)&&void 0!==ke?ke:"Edit"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.PencilIcon,{size:16,style:null==rt?void 0:rt.icon}),e.jsx("span",{style:null==rt?void 0:rt.text,children:null!==(Ue=se.label)&&void 0!==Ue?Ue:"Edit"})]})}),ie&&e.jsx("span",{className:a.default.actionButtonDivider})]}),ie&&e.jsx("button",{type:"button",className:a.default.actionButton,style:null==rt?void 0:rt.button,disabled:ie.disabled||ie.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=ie.onClick)||void 0===t||t.call(ie)},children:ie.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==rt?void 0:rt.icon}),e.jsx("span",{style:null==rt?void 0:rt.text,children:null!==(Pe=ie.label)&&void 0!==Pe?Pe:"Approve"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.Check,{size:16,style:null==rt?void 0:rt.icon}),e.jsx("span",{style:null==rt?void 0:rt.text,children:null!==(Re=ie.label)&&void 0!==Re?Re:"Approve"})]})})]})]})]}),null===(Me=St.sub_features)||void 0===Me?void 0:Me.map((t,l)=>{console.log("UserStoryCardWrapper: sub",t);const o=b(W,!1,t.artifactId);return e.jsx(N,{artifactId:C,isUserStoryCurrentlyUpdated:n,artifactTitleId:`${E}-${String.fromCharCode(65+l)}`,parentUserStory:B,parentIndex:`${T}${T&&"."}${k}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:e=>((e,t)=>{const l=[...B.sub_features||[]];l[e]=t,A({...B,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:P,showUserStoryDiff:R,updateUserStoryArtifact:q,handleDownloadUserStory:M,handleOpenSendDialog:_,isDisplayHighlightControl:F,elementDisplayConfig:W,_resolvedConfig:o,actionItemsConfig:G,onDelete:()=>(e=>{const t=(B.sub_features||[]).filter((t,l)=>l!==e),l={...B,sub_features:t};gt(l),A(l)})(l),expandedSubFeatures:Q,disableEditPlan:ne,useMuiTooltip:oe,blockNumber:t.blockNumber,showAssignSection:ue,onAssignSectionClick:ve},t.artifactId)})]})})]})};exports.StoryCard=N,exports.UserStoryCardWrapper=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:f,isDisplayHighlightControl:m,elementDisplayConfig:y,showWrapper:S,actionItemsConfig:g,contextVariant:C,showDisplayName:x,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:w,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:A=!1,disableEditPlan:T=!1,useMuiTooltip:k=!1,approveButtonConfig:U,editButtonConfig:P,CDNeededInChip:R,showWaitingIconInChip:M,setRedlineDocumentIdParent:_,showAssignSection:q,onAssignSectionClick:L,disableAssignSection:F})=>{const{userStory:W,setUserStory:O,customStyles:z,searchQueryList:V,currentHighlightIndex:G,setCurrentHighlightIndex:$,segmentComponentConfig:H,sectionStatusConfig:Q,redlineConfig:Y,setRedlineDocumentId:X}=p.useRequirementAI(),Z=null==z?void 0:z.userStoryCardStyles,J=0===G,K=G===V.length-1;return t.useEffect(()=>{if(!(null==Y?void 0:Y.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await h.getRedlineDocumentId({baseApiUrl:Y.documentBaseApiUrl||"",comparisonId:Y.documentComparisonId||""});if(t)X(t);else{const{document_id:t}=await h.createRedlineDocument({baseApiUrl:Y.baseApiUrl,changelogConfigId:Y.changelogConfigId,comparisonId:Y.documentComparisonId,artifactId:Y.artifactId,inputData:Y.inputData,redlineConfigId:Y.redlineConfigId,userEmail:Y.userEmail,userName:Y.userName},null!==(e=null==Y?void 0:Y.token)&&void 0!==e?e:"");t&&(X(t),null==_||_(t))}})()},[]),e.jsxs("div",{className:a.default.userStoryCardWrapper,style:m?{...null==Z?void 0:Z.userStoryCardWrapper,position:"relative"}:null==Z?void 0:Z.userStoryCardWrapper,children:[m&&e.jsx(e.Fragment,{children:V.length>0&&e.jsx("div",{className:a.default.wrapper,children:e.jsx("div",{className:a.default.highlightNavigation,children:e.jsxs("div",{className:a.default.navigationContainer,children:[e.jsxs("span",{className:a.default.navCounter,children:[G+1," of ",V.length]}),e.jsxs("div",{className:a.default.navButtons,children:[e.jsx("button",{onClick:()=>{G>0&&$(e=>e-1)},className:a.default.navButton,disabled:J,children:e.jsx(l.ChevronUpIcon,{size:20,className:a.default.navIcon})}),e.jsx("button",{onClick:()=>{G<V.length-1&&$(e=>e+1)},className:a.default.navButton,disabled:K,children:e.jsx(l.ChevronDownIcon,{size:20,className:a.default.navIcon})})]})]})})})}),W.map((t,l)=>{console.log("UserStoryCardWrapper: userstory",t);const a=b(y,!0);return e.jsx(N,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:t,onUserStoryChange:e=>{O(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:f,isDisplayHighlightControl:m,elementDisplayConfig:y,_resolvedConfig:a,showWrapper:S,defaultExpanded:E,actionItemsConfig:g,contextVariant:C,showDisplayName:x,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:w,sectionStatusConfig:Q,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:A,disableEditPlan:T,useMuiTooltip:k,approveButtonConfig:U,CDNeededInChip:R,editButtonConfig:P,showWaitingIconInChip:M,showAssignSection:q,disableAssignSection:F,onAssignSectionClick:L},t.artifactId)})]})},exports.default=N,exports.replaceLearnedTagsWithInfo=j;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("lucide-react"),n=require("showdown"),o=require("@mui/material"),i=require("../../icons/Illustration.svg.js"),s=require("uuid"),a=require("./UserStoryCard.module.css.js"),r=require("../../utils/helpers.js"),d=require("../../utils/user-story.utils.js"),u=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),v=require("../userstory-with-citation/UserStoryWithCitation.js"),p=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../story-screen/BigEnoughPanel.js"),h=require("./TitleEditor/TitleEditor.js"),m=require("../../../../service/redlineService.js"),y=require("./ClinicalTrialSection.js"),S=require("../story-screen/CompletionPanel.js"),g=require("../../icons/CDIcon.js"),C=require("./cws/CwsEvent.js"),x=require("./cws/useCwsEvent.js"),I=require("react-hot-toast"),j=require("./Popups/RedlineToast.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var w=b(n),N=b(I);const E={[p.SectionStatus.WAITING]:"WAITING TO GENERATE",[p.SectionStatus.IN_PROGRESS]:"IN PROGRESS",[p.SectionStatus.GENERATED]:"GENERATED",[p.SectionStatus.FAILED]:"FAILED",[p.SectionStatus.GENERATE]:"GENERATE",[p.SectionStatus.APPROVED]:"APPROVED"};function D(t){const n=[],i=/<learned>(.*?)<\/learned>/g;let a,r=0,d=0;for(;null!==(a=i.exec(t));){const[,u]=a,c=a.index;c>r&&n.push(e.jsx("span",{children:t.slice(r,c)},"text-pre-"+d++)),n.push(e.jsx(o.Tooltip,{title:u,placement:"top",children:e.jsx(l.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${s.v4()}`)),r=i.lastIndex}return r<(null==t?void 0:t.length)&&n.push(e.jsx("span",{children:t.slice(r)},"text-post-"+d++)),n}function B(e,t,l){var n;if(!e)return{};if(t)return{...e.parentConfig};const o={...e.childConfig};return l&&(null===(n=e.subFeatureOverrides)||void 0===n?void 0:n[l])?{...o,...e.subFeatureOverrides[l]}:o}const T=({displayName:t})=>{var n;const{customStyles:o}=p.useRequirementAI(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e.jsxs("div",{className:a.default.displayName,style:null==i?void 0:i.wrapper,children:[e.jsx(l.Bookmark,{className:a.default.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e.jsxs("span",{style:null==i?void 0:i.label,children:[t,":"]})]})},A=({isUserStoryCurrentlyUpdated:n,artifactId:I,artifactTitleId:b,parentUserStory:k,currentUserStory:U,onUserStoryChange:R,parentIndex:P,currentIndex:M,enableDownload:q,isDiffEditReviewMode:_,showUserStoryDiff:L,handleDownloadUserStory:W,handleOpenSendDialog:F,updateUserStoryArtifact:O,selectedArtifactId:$,isDisplayHighlightControl:z,elementDisplayConfig:V,_resolvedConfig:G,showWrapper:H=!1,defaultExpanded:Y,actionItemsConfig:Q,onDelete:X,contextVariant:Z,expandedSubFeatures:J,showDisplayName:K=!0,allowTitleEdit:ee=!0,showConfidenceScore:te=!0,showBorderTop:le=!0,sectionStatusConfig:ne,showCompletionPanel:oe=!1,completionPanelConfig:ie,showAddSectionButton:se=!1,disableEditPlan:ae=!1,useMuiTooltip:re=!1,approveButtonConfig:de,editButtonConfig:ue,CDNeededInChip:ce,blockNumber:ve,showWaitingIconInChip:pe,showAssignSection:fe=!1,disableAssignSection:he=!1,onAssignSectionClick:me})=>{var ye,Se,ge,Ce,xe,Ie,je,be,we,Ne,Ee,De,Be,Te,Ae,ke,Ue,Re,Pe,Me,qe,_e,Le,We;const{isLoadingSectionData:Fe=!1,onLoadSectionData:Oe,status:$e,onStatusClick:ze,completedCount:Ve,totalCount:Ge,isNoDataAvailable:He=!1}=null!=ne?ne:{},{searchQueryList:Ye,citations:Qe,customStyles:Xe,onEditBlocked:Ze,redlineDcoumentId:Je,redlineConfig:Ke,customSectionConfig:et,updateRedlineDataParent:tt,aiReasoning:lt,redlineCollaborativeConfig:nt}=p.useRequirementAI(),ot=null==Xe?void 0:Xe.userStoryCardStyles,it=null==ot?void 0:ot.customSectionEditButton,st=null==ot?void 0:ot.statusStyles,at=null===(ye=null==Xe?void 0:Xe.userStoryCardStyles)||void 0===ye?void 0:ye.userStoryEditStyles,rt=null===(Se=null==Xe?void 0:Xe.userStoryScreenStyles)||void 0===Se?void 0:Se.userStoryContentStyles,dt=null==ot?void 0:ot.progressHeaderStyles,ut=null==ot?void 0:ot.clinicalTrialSectionStyles,ct=null==ot?void 0:ot.CompletionStyles,vt=null==ot?void 0:ot.noDataStyles,pt=null==ot?void 0:ot.approveButtonStyles,ft=null!==(Ce=null===(ge=null==et?void 0:et.shouldRender)||void 0===ge?void 0:ge.call(et,U))&&void 0!==Ce&&Ce,ht=null===(xe=null==et?void 0:et.getValue)||void 0===xe?void 0:xe.call(et,U),mt=null!==(je=null===(Ie=null==et?void 0:et.getFields)||void 0===Ie?void 0:Ie.call(et,U))&&void 0!==je?je:[],yt=null!==(be=null==et?void 0:et.isEditDisabled)&&void 0!==be&&be,St=null!==(Ne=null===(we=null==et?void 0:et.isSaving)||void 0===we?void 0:we.call(et,U))&&void 0!==Ne&&Ne,gt=(Ct=null!==(Ee=U.completion_percentage)&&void 0!==Ee?Ee:0,xt=ct,Ct>=80?null==xt?void 0:xt.highCompletion:Ct>=50?null==xt?void 0:xt.mediumCompletion:null==xt?void 0:xt.lowCompletion);var Ct,xt;const It={[p.SectionStatus.WAITING]:null==st?void 0:st.waiting,[p.SectionStatus.IN_PROGRESS]:null==st?void 0:st.inProgress,[p.SectionStatus.GENERATED]:null==st?void 0:st.generated,[p.SectionStatus.FAILED]:null==st?void 0:st.failed,[p.SectionStatus.GENERATE]:null==st?void 0:st.generate,[p.SectionStatus.APPROVED]:null==st?void 0:st.approved},[jt,bt]=t.useState({...structuredClone(U),value:r.formatMarkdown(U.value)||""}),[wt,Nt]=t.useState({userStory:!!U.isDefaultEdit}),[Et,Dt]=t.useState(!1),[Bt,Tt]=t.useState(!1),[At,kt]=t.useState(null),[Ut,Rt]=t.useState(null),{userStory:Pt,customIcons:Mt}=p.useRequirementAI(),[qt,_t]=t.useState(null!=Y?Y:""===P||$===U.artifactId||!!U.isDefaultOpen),[Lt,Wt]=t.useState(!1),[Ft,Ot]=t.useState(null),[$t,zt]=t.useState(null),[Vt,Gt]=t.useState(!1),Ht=t.useRef(null),Yt=t.useRef(null),[Qt,Xt]=t.useState(!1),[Zt,Jt]=t.useState(!1),Kt=t.useRef(null),[el,tl]=t.useState(!1),[ll,nl]=t.useState(U.value);t.useEffect(()=>{n&&_t(n)},[n]),t.useEffect(()=>{bt({...structuredClone(U),value:r.formatMarkdown(U.value)||""})},[U]),t.useEffect(()=>{Ye.length>0?_t(!0):void 0===Y&&$&&_t($===U.artifactId)},[Ye,$,U.artifactId]),t.useEffect(()=>{J&&J.length>0&&_t(J.includes(U.artifactId)||""===P||$===U.artifactId||!!U.isDefaultOpen)},[J]);const ol=()=>{Ot(null)},il=()=>{zt(null)},sl=()=>{qt&&wt.userStory&&Yt.current&&!Yt.current.requestClose()||_t(e=>!e)},al=async()=>{var e,t;try{"userStory"==="userStory"&&(R(jt),console.log("I am changing RTE editor values",jt)),await(null===(e=null==ue?void 0:ue.onSaveEditedSection)||void 0===e?void 0:e.call(ue,jt)),await O(Qe,Pt,I,null===(t=Kt.current)||void 0===t?void 0:t.signal)}finally{}};const rl=null!=(null==U?void 0:U.big_enough)&&!Number.isNaN(U.big_enough)&&!!(null==U?void 0:U.big_enough_decision_factors),dl=null!==(De=null==U?void 0:U.completion_percentage)&&void 0!==De?De:0,ul=!!(null==U?void 0:U.completion_decision_factors),cl=""===P,vl=null!=G?G:B(V,cl),pl=!_&&!L;t.useEffect(()=>{if(!Ut)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${Ut}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[Ut]);const[fl,hl]=t.useState(0),[ml,yl]=t.useState(!1),Sl=async()=>{var e,t;let l=!0;if(yl(e=>(l=!e,!0)),l){let l;hl(e=>(l=e,e));try{const{updated_reqai:n}=await m.fetchRedlineDocumentSection({documentId:Je,sectionId:U.artifactId,baseApiUrl:null==Ke?void 0:Ke.baseApiUrl,redlineConfigId:null!==(e=null==Ke?void 0:Ke.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Ke?void 0:Ke.token)&&void 0!==t?t:"");await(null==tt?void 0:tt(n)),hl(e=>l===e?0:1)}catch(e){}yl(!1)}};t.useEffect(()=>{U.isDefaultEdit&&Nt(e=>({...e,userStory:!0}))},[U.isDefaultEdit]),console.log("block number in userstory card ",ve),console.log("[TESTING-CURRENT-USER-STORY] \n",U,"\n[TESTING-USER-STORY] \n",Pt),x.default(`redline-edit:${Je}:${U.artifactId}`,async({updatedBy:t})=>{var l;null===(l=Kt.current)||void 0===l||l.abort(),hl(e=>e+1),Nt(l=>l.userStory?(N.default.custom(l=>e.jsxs(j.default,{onCancel:()=>N.default.dismiss(l.id),onRefresh:()=>{N.default.dismiss(l.id),Sl()},children:["This ",e.jsx("span",{style:{fontWeight:600},children:U.title})," section has been updated by ",e.jsx("span",{style:{fontWeight:600},children:t})," while you were editing. Please refresh to view the latest version."]}),{duration:1e4,toasterId:p.ToasterId}),{...Pt,userStory:!1}):(Sl().then(()=>{N.default.custom(l=>e.jsxs(j.default,{onCancel:()=>N.default.dismiss(l.id),children:[e.jsx("span",{style:{fontWeight:600},children:U.title})," updated,",e.jsx("br",{}),t," saved changes. Your unsaved edits are untouched."]}),{duration:1e4,toasterId:p.ToasterId})}),l))});return t.useEffect(()=>nl(U.value),[U.value]),e.jsxs("div",{className:a.default.card,"data-block-id":"user-story-card-wrapper-"+ve,style:null==ot?void 0:ot.cardStyle,id:`story-card-${U.title}`,"data-expanded":qt,children:[e.jsxs("div",{className:a.default.titleSection,style:null==ot?void 0:ot.titleSection,children:[e.jsxs("div",{className:a.default.titleRow,style:null==ot?void 0:ot.titleRow,onClick:sl,children:[e.jsxs("div",{className:a.default.titleLeft,style:null==ot?void 0:ot.titleLeft,onMouseEnter:()=>Xt(!0),onMouseLeave:()=>Xt(!1),children:[K&&e.jsx(T,{displayName:b}),Et&&pl?e.jsx(h.InlineTitleEditor,{title:U.title,onSave:e=>(async(e,t)=>{var l;try{let n={...U};U.artifactId===t?n.title=e:n.sub_features=(null===(l=U.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],bt(n),R(n),Dt(!1)}catch(e){console.error("Failed to save title",e)}})(e,U.artifactId),onCancel:()=>{Dt(!1)},inputStyle:null==at?void 0:at.inlineTitleInput,confirmButtonStyle:null==at?void 0:at.inlineTitleConfirm,cancelButtonStyle:null==at?void 0:at.inlineTitleCancel},"inline-title-editor"):e.jsxs("div",{className:a.default.storyTitleWrapper,children:[e.jsx(o.Tooltip,{title:D(U.title),arrow:!0,children:e.jsx("h2",{title:re?void 0:U.title,className:a.default.storyTitle,style:null==ot?void 0:ot.storyTitle,children:D(U.title)},U.artifactId)}),oe&&(ul?e.jsx(S.CompletionPanel,{customIcons:null==Mt?void 0:Mt.userStoryIcons,customStyles:null==ot?void 0:ot.aiReasoningCitaionStyles,currentUserStory:U,panelStyles:null==ot?void 0:ot.CompletionStyles,onToggleStateChange:Jt,completionPanelConfig:ie,children:e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==ct?void 0:ct.badge,...gt},children:[e.jsxs("span",{children:[dl,"% Completed"]}),e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(g.default,{color:"currentColor"})}),Zt?e.jsx(l.ChevronUp,{size:14,style:null==ct?void 0:ct.chevronStyle}):e.jsx(l.ChevronDown,{size:14,style:null==ct?void 0:ct.chevronStyle})]})}):e.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==ct?void 0:ct.badge,...gt},children:e.jsxs("span",{children:[dl,"% Completed"]})})),ee&&e.jsx("button",{type:"button",className:a.default.titleEditButton,style:null==at?void 0:at.titleEditButton,onClick:e=>{e.stopPropagation(),Dt(!0),qt||_t(!0)},"aria-label":"Edit title",title:"Edit title",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]}),($e||void 0!==Ve&&void 0!==Ge)&&e.jsxs("div",{className:a.default.statusContainer,children:[void 0!==Ve&&void 0!==Ge&&e.jsxs("div",{className:a.default.completedBadge,children:["Completed: ",Ve,"/",Ge]}),$e&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==ze||ze()},onMouseEnter:()=>tl(!0),onMouseLeave:()=>tl(!1),className:a.default.statusButton,style:{...null===(Be=It[$e])||void 0===Be?void 0:Be.default,...el&&(null===(Te=It[$e])||void 0===Te?void 0:Te.hover)},children:E[$e]})]}),e.jsxs("div",{className:a.default.titleActions,style:null==ot?void 0:ot.titleActions,onClick:e=>e.stopPropagation(),children:[(vl.showProgressPercentage||vl.showGapBox)&&H&&e.jsxs("div",{className:a.default.progressHeader,style:null==dt?void 0:dt.wrapper,children:[vl.showProgressPercentage&&e.jsxs("div",{className:a.default.progressPercentage,style:null==dt?void 0:dt.percentage,children:[null!==(ke=null!==(Ae=null==U?void 0:U.confidenceScore)&&void 0!==Ae?Ae:null==vl?void 0:vl.confidenceValue)&&void 0!==ke?ke:"0","%"]}),vl.showGapBox&&e.jsxs("div",{className:a.default.gapBox,style:null==dt?void 0:dt.gapBox,children:[null!==(Re=null!==(Ue=null==U?void 0:U.gapValue)&&void 0!==Ue?Ue:null==vl?void 0:vl.gapBoxValue)&&void 0!==Re?Re:"2"," ","Gaps"]})]}),rl&&e.jsx(f.BigEnoughPanel,{customIcons:null==Mt?void 0:Mt.userStoryIcons,customStyles:null==ot?void 0:ot.aiReasoningCitaionStyles,currentUserStory:U,panelStyles:null==ot?void 0:ot.BigEnoughStyles}),fe&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==ot?void 0:ot.iconButton,disabled:he,onClick:e=>{e.stopPropagation(),null==me||me(U)},"aria-label":"Assign section users",title:"Assign section users",children:e.jsx(l.Users,{size:16})}),!wt.userStory&&e.jsxs(e.Fragment,{children:[!1!==(null==vl?void 0:vl.showShareButton)&&e.jsx("button",{className:a.default.iconButton,style:null==ot?void 0:ot.iconButton,onClick:e=>{Ot(e.currentTarget)},children:e.jsx(l.ExternalLink,{size:16})}),e.jsxs(o.Menu,{id:"user-story-share-menu",anchorEl:Ft,open:!!Ft,onClose:()=>Ot(null),style:null==ot?void 0:ot.userStoryShareMenu,children:[q&&e.jsx(o.MenuItem,{style:null==ot?void 0:ot.userStoryMenuItem,onClick:async()=>{Wt(!0),W&&(await Promise.all([W("pdf"),W("doc")]),Wt(!1))},children:e.jsxs("div",{ref:Ht,className:a.default.menuItemContent,style:null==ot?void 0:ot.menuItemContent,children:[e.jsx(l.Download,{size:16,color:null==ot?void 0:ot.menuIconColor}),e.jsx("p",{style:null==ot?void 0:ot.menuLabel,children:"Download"})]})}),e.jsx(o.MenuItem,{style:null==ot?void 0:ot.userStoryMenuItem,onClick:async()=>{let e=U;k&&(e={...U,value:`${d.replaceTitleSection(null==k?void 0:k.value,U.title)} \n${U.value}`}),null==F||F(!0,[e],U.artifactId),ol()},children:e.jsxs("div",{style:null==ot?void 0:ot.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Share2,{size:16,color:null==ot?void 0:ot.menuIconColor}),e.jsx("p",{style:null==ot?void 0:ot.menuLabel,children:"Send"})]})}),e.jsx(o.MenuItem,{style:null==ot?void 0:ot.userStoryMenuItem,onClick:async()=>{const e=(new w.default.Converter).makeHtml(r.formatMarkdown(U.value)||U.value),t=function(e){const t=(new w.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(r.formatMarkdown(U.value)||U.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{ol()}},children:e.jsxs("div",{style:null==ot?void 0:ot.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Copy,{size:16,color:null==ot?void 0:ot.menuIconColor}),e.jsx("p",{style:null==ot?void 0:ot.menuLabel,children:"Copy"})]})})]})]}),!Vt&&wt.userStory&&qt?e.jsx(u.default,{type:"outline",children:"Cancel",style:null==ot?void 0:ot.cancelButton,onClick:()=>{var e;null===(e=Kt.current)||void 0===e||e.abort(),Nt(e=>({...e,userStory:!1}))}}):e.jsx(e.Fragment,{}),wt.userStory&&qt?e.jsx(u.default,{type:"fill",children:Vt?e.jsxs("span",{className:a.default.savingSpinner,style:null==ot?void 0:ot.savingSpinner,children:[e.jsx(l.LoaderCircle,{className:a.default.spinAnimation,style:null==ot?void 0:ot.spinAnimation}),e.jsx("span",{children:"Saving..."})]}):"Save",isDisable:Vt,style:Vt?null==ot?void 0:ot.savingButton:null==ot?void 0:ot.saveButton,onClick:async()=>{Gt(!0),await al();let e=await(async()=>{var e,t,l,n,o,i,s,a;let r=jt.value;console.log("[V] valueToUpdate before",r),r=r.replace(/<invisible\s+id="([^"]+)"\s*><\/invisible>/gi,"\x3c!-- $1 --\x3e"),console.log("[V] valueToUpdate after",r);try{if(null==Ke?void 0:Ke.callUpdateDocument){const{updated_reqai:d}=await m.updateRedlineDocument({documentId:Je,sectionId:U.artifactId,baseApiUrl:null==Ke?void 0:Ke.baseApiUrl,updatedContent:r,userEmail:Ke.userEmail,userName:Ke.userName,redlineConfigId:null!==(e=Ke.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Ke?void 0:Ke.token)&&void 0!==t?t:"");r=null===(o=null===(n=null===(l=null==d?void 0:d.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===o?void 0:o.value,await(null==tt?void 0:tt(d)),C.default.emit(`redline-edit:${Je}:${null===(a=null===(s=null===(i=null==d?void 0:d.artifactData)||void 0===i?void 0:i.userStorySnapshot)||void 0===s?void 0:s[0])||void 0===a?void 0:a.artifactId}`,{updatedBy:null==Ke?void 0:Ke.userName})}}catch(e){console.error("failed to update redline document",e),r=ll}return r=r.replace(/<!--\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,'<invisible id="$1"></invisible>'),r})();const t={...jt,value:e};R({...t,isDefaultEdit:!1}),nl(t.value),Nt(e=>({...e,userStory:!1})),Gt(!1)}}):!fl&&!_&&!L&&!ae&&qt&&!1!==(null==vl?void 0:vl.showEditButton)&&e.jsx("button",{className:a.default.iconButton,style:null==ot?void 0:ot.editButton,onClick:()=>Nt(e=>({...e,userStory:!0})),children:e.jsx(l.PencilIcon,{color:null==ot?void 0:ot.pencilIconColor,size:16})}),(null==nt?void 0:nt.initiateCollaborativeFlow)&&!!fl&&e.jsx(o.Tooltip,{title:"Fetch latest section",children:e.jsx(l.RefreshCw,{color:ml?"#d3d3d3":"black",onClick:Sl})}),se&&cl&&qt&&!_&&!L&&!1!==(null==vl?void 0:vl.showEditButton)&&e.jsxs("button",{type:"button",className:a.default.addSectionButton,style:null==at?void 0:at.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=U.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:s.v4(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...U,sub_features:[...null!==(n=U.sub_features)&&void 0!==n?n:[],i]};bt(a),R(a),_t(!0),Rt(i.title)},"aria-label":"Add section",title:"Add section",children:[e.jsx(l.Plus,{size:14}),e.jsx("span",{className:a.default.addSectionLabel,children:"Add Section"})]}),!cl&&!_&&!ae&&!L&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==X||X()},className:a.default.iconButton,style:null==at?void 0:at.deleteButton,"aria-label":"Delete section",title:"Delete section",children:e.jsx(l.Trash2,{size:16})}),ft&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==it?void 0:it.button,disabled:yt,onClick:e=>{if(e.stopPropagation(),Bt)return kt(null),void Tt(!1);kt(structuredClone(null!=ht?ht:{})),_t(!0),Tt(!0)},children:Bt?e.jsx(l.X,{size:16,color:null==ot?void 0:ot.pencilIconColor,style:null==it?void 0:it.cancelIcon}):e.jsx(l.PencilIcon,{size:16,color:null==ot?void 0:ot.pencilIconColor,style:null==it?void 0:it.editIcon})}),(null==vl?void 0:vl.actionItemsButton)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:a.default.actionItemBtn,style:null==ot?void 0:ot.actionItemBtn,onClick:e=>{e.stopPropagation(),zt(e.currentTarget)},children:e.jsx(l.Ellipsis,{})}),e.jsx(o.Menu,{id:"user-story-action-menu",anchorEl:$t,open:!!$t,onClose:il,style:null==ot?void 0:ot.userStoryShareMenu,children:null==Q?void 0:Q.items.map((t,l)=>e.jsx(o.MenuItem,{style:null==ot?void 0:ot.userStoryMenuItem,onClick:()=>{t.onclick(U),il()},children:e.jsxs("div",{className:a.default.menuItemContent,style:{...null==ot?void 0:ot.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[e.jsx("span",{className:a.default.menuItemIcon,style:null==ot?void 0:ot.menuItemIcon,children:t.icon}),e.jsx("p",{style:null==ot?void 0:ot.menuLabel,children:t.name}),e.jsx("span",{className:a.default.menuItemRight,style:null==ot?void 0:ot.menuItemRight})]})},`action-item-${l}-${t.name}`))})]}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),sl()},style:null==ot?void 0:ot.chevronButton,className:a.default.chevronButton,children:qt?e.jsx(l.ChevronUp,{className:a.default.chevronIcon,color:null==ot?void 0:ot.chevronIconColor}):e.jsx(l.ChevronDown,{className:a.default.chevronIcon,color:null==ot?void 0:ot.chevronIconColor})})]})]}),e.jsx("div",{className:a.default.divider,style:null==ot?void 0:ot.dividerStyle})]}),qt&&e.jsx("div",{className:a.default.cardContent,style:{...null==ot?void 0:ot.cardContentStyle,borderTop:le?"1px solid #E5E5E5":"none"},children:Fe?e.jsxs("div",{className:a.default.loadingContainer,children:[e.jsx("div",{className:a.default.loadingIconWrapper,children:e.jsx(l.Hourglass,{size:28,color:"#5B3DF5",className:a.default.spinAnimation})}),e.jsxs("div",{children:[e.jsx("h3",{className:a.default.loadingTitle,children:"Section generation in progress.."}),e.jsx("p",{className:a.default.loadingSubtitle,children:"This may take a few minutes"})]}),e.jsx("button",{type:"button",onClick:()=>null==Oe?void 0:Oe(),className:a.default.viewStatusButton,children:"View Status"})]}):He?e.jsxs("div",{className:a.default.noDataContainer,style:null==vt?void 0:vt.container,children:[e.jsx("img",{src:i.default,alt:"No data available",className:a.default.noDataIllustration,style:null==vt?void 0:vt.illustration}),e.jsx("h3",{className:a.default.noDataTitle,style:null==vt?void 0:vt.title,children:"No Data Available for This Section"}),e.jsx("p",{className:a.default.noDataSubtitle,style:null==vt?void 0:vt.subtitle,children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."})]}):e.jsxs("div",{className:a.default.contentInner,style:null==ot?void 0:ot.contentInner,children:[e.jsxs("div",{className:a.default.descriptionSection,style:null==ot?void 0:ot.descriptionSection,children:[e.jsx("div",{className:a.default.justifyBetween,style:null==ot?void 0:ot.justifyBetween}),wt.userStory?e.jsx(c.default,{ref:Yt,minHeight:"100%",height:"100%",type:"string",value:r.formatMarkdown(ll)||"",handleUpdateState:(e,t)=>{const l=d.postprocessUserStoryAfterEdit(r.indentMarkdown(t));bt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:wt.userStory?"edit":"readOnly",onEditBlocked:Ze,onSaveUnsavedChanges:async()=>{await al(),_t(!1)},onDiscardUnsavedChanges:()=>{bt({...structuredClone(U),value:r.formatMarkdown(U.value)||""}),Nt(e=>({...e,userStory:!1})),_t(!1)},isSavingUnsavedChanges:Vt}):ft?e.jsx(y.default,{styles:ut,fields:mt,readonly:!Bt,isSaving:St,value:null!==(Pe=null!=At?At:ht)&&void 0!==Pe?Pe:{},onChange:kt,onSave:async()=>{var e;At&&(await(null===(e=null==et?void 0:et.onSave)||void 0===e?void 0:e.call(et,U,At)),kt(null),Tt(!1))},onCancel:()=>{kt(null),Tt(!1)}}):e.jsxs(e.Fragment,{children:[e.jsx(v.default,{showUserStoryDiff:L,isParent:""===P,message:r.formatMarkdown(U.value)||"",artifactId:U.artifactId,customStyles:rt,isDisplayHighlightControl:z,contextVariant:Z,showConfidenceScore:te,CDNeededInChip:ce,blockId:ve,showWaitingIconInChip:pe}),(de||ue)&&e.jsxs("div",{className:a.default.actionButtonsContainer,style:null==pt?void 0:pt.container,children:[ue&&!wt.userStory&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:a.default.actionButton,style:null==pt?void 0:pt.button,disabled:ue.disabled||ue.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=ue.onClick)||void 0===t||t.call(ue),Nt(e=>({...e,userStory:!0})),_t(!0)},children:ue.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==pt?void 0:pt.icon}),e.jsx("span",{style:null==pt?void 0:pt.text,children:null!==(Me=ue.label)&&void 0!==Me?Me:"Edit"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.PencilIcon,{size:16,style:null==pt?void 0:pt.icon}),e.jsx("span",{style:null==pt?void 0:pt.text,children:null!==(qe=ue.label)&&void 0!==qe?qe:"Edit"})]})}),de&&e.jsx("span",{className:a.default.actionButtonDivider})]}),de&&e.jsx("button",{type:"button",className:a.default.actionButton,style:null==pt?void 0:pt.button,disabled:de.disabled||de.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=de.onClick)||void 0===t||t.call(de)},children:de.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==pt?void 0:pt.icon}),e.jsx("span",{style:null==pt?void 0:pt.text,children:null!==(_e=de.label)&&void 0!==_e?_e:"Approve"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.Check,{size:16,style:null==pt?void 0:pt.icon}),e.jsx("span",{style:null==pt?void 0:pt.text,children:null!==(Le=de.label)&&void 0!==Le?Le:"Approve"})]})})]})]})]}),null===(We=jt.sub_features)||void 0===We?void 0:We.map((t,l)=>{console.log("UserStoryCardWrapper: sub",t);const o=B(V,!1,t.artifactId);return e.jsx(A,{artifactId:I,isUserStoryCurrentlyUpdated:n,artifactTitleId:`${b}-${String.fromCharCode(65+l)}`,parentUserStory:U,parentIndex:`${P}${P&&"."}${M}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:e=>((e,t)=>{const l=[...U.sub_features||[]];l[e]=t,R({...U,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:_,showUserStoryDiff:L,updateUserStoryArtifact:O,handleDownloadUserStory:W,handleOpenSendDialog:F,isDisplayHighlightControl:z,elementDisplayConfig:V,_resolvedConfig:o,actionItemsConfig:Q,onDelete:()=>(e=>{const t=(U.sub_features||[]).filter((t,l)=>l!==e),l={...U,sub_features:t};bt(l),R(l)})(l),expandedSubFeatures:J,disableEditPlan:ae,useMuiTooltip:re,blockNumber:t.blockNumber,showAssignSection:fe,onAssignSectionClick:me},t.artifactId)})]})})]})};exports.StoryCard=A,exports.UserStoryCardWrapper=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:f,isDisplayHighlightControl:h,elementDisplayConfig:y,showWrapper:S,actionItemsConfig:g,contextVariant:C,showDisplayName:x,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:b,defaultExpanded:w,showCompletionPanel:N=!1,completionPanelConfig:E,showAddSectionButton:D=!1,disableEditPlan:T=!1,useMuiTooltip:k=!1,approveButtonConfig:U,editButtonConfig:R,CDNeededInChip:P,showWaitingIconInChip:M,setRedlineDocumentIdParent:q,showAssignSection:_,onAssignSectionClick:L,disableAssignSection:W})=>{const{userStory:F,setUserStory:O,customStyles:$,searchQueryList:z,currentHighlightIndex:V,setCurrentHighlightIndex:G,segmentComponentConfig:H,sectionStatusConfig:Y,redlineConfig:Q,setRedlineDocumentId:X}=p.useRequirementAI(),Z=null==$?void 0:$.userStoryCardStyles,J=0===V,K=V===z.length-1;return t.useEffect(()=>{if(!(null==Q?void 0:Q.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await m.getRedlineDocumentId({baseApiUrl:Q.documentBaseApiUrl||"",comparisonId:Q.documentComparisonId||""});if(t)X(t);else{const{document_id:t}=await m.createRedlineDocument({baseApiUrl:Q.baseApiUrl,changelogConfigId:Q.changelogConfigId,comparisonId:Q.documentComparisonId,artifactId:Q.artifactId,inputData:Q.inputData,redlineConfigId:Q.redlineConfigId,userEmail:Q.userEmail,userName:Q.userName},null!==(e=null==Q?void 0:Q.token)&&void 0!==e?e:"");t&&(X(t),null==q||q(t))}})()},[]),e.jsxs("div",{className:a.default.userStoryCardWrapper,style:h?{...null==Z?void 0:Z.userStoryCardWrapper,position:"relative"}:null==Z?void 0:Z.userStoryCardWrapper,children:[h&&e.jsx(e.Fragment,{children:z.length>0&&e.jsx("div",{className:a.default.wrapper,children:e.jsx("div",{className:a.default.highlightNavigation,children:e.jsxs("div",{className:a.default.navigationContainer,children:[e.jsxs("span",{className:a.default.navCounter,children:[V+1," of ",z.length]}),e.jsxs("div",{className:a.default.navButtons,children:[e.jsx("button",{onClick:()=>{V>0&&G(e=>e-1)},className:a.default.navButton,disabled:J,children:e.jsx(l.ChevronUpIcon,{size:20,className:a.default.navIcon})}),e.jsx("button",{onClick:()=>{V<z.length-1&&G(e=>e+1)},className:a.default.navButton,disabled:K,children:e.jsx(l.ChevronDownIcon,{size:20,className:a.default.navIcon})})]})]})})})}),F.map((t,l)=>{console.log("UserStoryCardWrapper: userstory",t);const a=B(y,!0);return e.jsx(A,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:t,onUserStoryChange:e=>{O(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:f,isDisplayHighlightControl:h,elementDisplayConfig:y,_resolvedConfig:a,showWrapper:S,defaultExpanded:w,actionItemsConfig:g,contextVariant:C,showDisplayName:x,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:b,sectionStatusConfig:Y,showCompletionPanel:N,completionPanelConfig:E,showAddSectionButton:D,disableEditPlan:T,useMuiTooltip:k,approveButtonConfig:U,CDNeededInChip:P,editButtonConfig:R,showWaitingIconInChip:M,showAssignSection:_,disableAssignSection:W,onAssignSectionClick:L},t.artifactId)})]})},exports.default=A,exports.replaceLearnedTagsWithInfo=D;
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./SocketManager.js");class e{static initialize(r){if("string"!=typeof r.applicationId||!r.applicationId.trim()||"string"!=typeof r.authToken||!r.authToken.trim()||"string"!=typeof r.baseUrl||!r.baseUrl.trim())return;const a=t.SocketManager.getInstance();a.getInitStatus()||(a.initialize(r),a.setListener(e.dispatch))}static dispatch(t){const r=e.handlers.get(t.type);r&&r.forEach(e=>{e(t.payload)})}static on(t,r){if("string"!=typeof t||!t.trim()||"function"!=typeof r)throw Error("invalid event or handler type");return e.handlers.has(t)||e.handlers.set(t,new Set),e.handlers.get(t).add(r),()=>e.off(t,r)}static off(t,r){if("string"!=typeof t||!t.trim()||"function"!=typeof r)throw Error("invalid event or handler type");const a=e.handlers.get(t);a&&(a.delete(r),0===a.size&&e.handlers.delete(t))}static emit(e,r){if("string"!=typeof e||!e.trim())throw Error("invalid event type");t.SocketManager.getInstance().publish(e,r)}static isInitialized(){return t.SocketManager.getInstance().getInitStatus()}static destroy(){e.handlers.clear(),t.SocketManager.getInstance().destroy()}}e.handlers=new Map,exports.default=e;
2
+ //# sourceMappingURL=CwsEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CwsEvent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("./CwsEvent.js");exports.default=function({baseUrl:a,applicationId:i,children:u,authToken:n}){return r.useEffect(()=>(t.default.initialize({baseUrl:a,applicationId:i,authToken:n}),()=>{t.default.destroy()}),[n,i,a]),e.jsx(e.Fragment,{children:u})};
2
+ //# sourceMappingURL=CwsEventProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CwsEventProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("axios"),e=require("socket.io-client");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=i(t);class n{constructor(){this.isInitialized=!1}static getInstance(){return n.instance||(n.instance=new n),n.instance}async initialize(t){this.isInitialized||(this.applicationId=t.applicationId,this.authToken=t.authToken,this.isInitialized=!0,this.socket=e.io(t.baseUrl,{path:"/cwsEvent/socket-cwsEvent",autoConnect:!0,reconnection:!0,transports:["websocket"],auth:{token:this.authToken}}),this.socket.on("connect",()=>{console.log("Connected:",this.socket.id),this.socket.emit("subscribe",{applicationId:this.applicationId})}),this.socket.on("message",t=>{var e;null===(e=this.listener)||void 0===e||e.call(this,t)}))}async wakeupServer(t){try{await s.default.get(t),console.log("Server wakeup successful")}catch(t){console.error("Server wakeup failed",t)}}setListener(t){this.listener=t}publish(t,e){this.socket.emit("publish",{applicationId:this.applicationId,type:t,payload:e})}disconnect(){this.socket.disconnect()}getInitStatus(){return this.isInitialized}destroy(){this.socket&&(this.socket.removeAllListeners(),this.socket.disconnect(),this.listener=void 0,this.socket=void 0,this.applicationId="",this.authToken="",this.isInitialized=!1,n.instance=void 0)}}exports.SocketManager=n;
2
+ //# sourceMappingURL=SocketManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SocketManager.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./CwsEvent.js");exports.default=function(r,u){e.useEffect(()=>t.default.on(r,u),[r,u])};
2
+ //# sourceMappingURL=useCwsEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCwsEvent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("axios"));exports.createRedlineDocument=async(e,o)=>{try{console.log("[createRedlineDocument] Request:",e);const{data:t}=await n.default.post(`${e.baseApiUrl}/redlining/create`,{user_name:e.userName,user_email:e.userEmail,redline_config_id:e.redlineConfigId,changelog_config_id:e.changelogConfigId,artifact_id:e.artifactId,input_data:e.inputData,document_metadata:{comparison_id:e.comparisonId}},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});return console.log("[createRedlineDocument] Response:",t),t}catch(e){console.log("[createRedlineDocument] Error:",e)}return null},exports.getRedlineDocumentId=async e=>{try{console.log("[getRedlineDocumentId] Request:",e);const{data:o}=await n.default.get(`${e.baseApiUrl}/book-finder-mode/get_comparison/${e.comparisonId}`);return console.log("[getRedlineDocumentId] Response:",o),o}catch(e){console.log("[getRedlineDocumentId] Error:",e)}return null},exports.resolveRedline=async(e,o)=>{try{console.log("[resolveRedline] Request:",e);const{data:t}=await n.default.post(`${e.baseApiUrl}/redlining/resolve`,{document_id:e.documentId,user_name:e.userName,user_email:e.userEmail,redline_id:e.redlineId,action:e.action,redline_config_id:e.redlineConfigId},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});return console.log("[resolveRedline] Response:",t),t}catch(e){console.log("[resolveRedline] Error:",e)}return null},exports.updateRedlineDocument=async(e,o)=>{try{console.log("[updateRedlineDocument] Request:",e);const{data:t}=await n.default.put(`${e.baseApiUrl}/redlining/update-manual`,{document_id:e.documentId,segment_id:e.sectionId,user_name:e.userName,user_email:e.userEmail,new_plain_content:e.updatedContent,redline_config_id:e.redlineConfigId},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});return console.log("[updateRedlineDocument] Response:",t),t}catch(e){console.log("[updateRedlineDocument] Error:",e)}return null};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("axios"));exports.createRedlineDocument=async(e,o)=>{try{console.log("[createRedlineDocument] Request:",e);const{data:t}=await n.default.post(`${e.baseApiUrl}/redlining/create`,{user_name:e.userName,user_email:e.userEmail,redline_config_id:e.redlineConfigId,changelog_config_id:e.changelogConfigId,artifact_id:e.artifactId,input_data:e.inputData,document_metadata:{comparison_id:e.comparisonId}},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});return console.log("[createRedlineDocument] Response:",t),t}catch(e){console.log("[createRedlineDocument] Error:",e)}return null},exports.fetchRedlineDocumentSection=async(e,o)=>{try{console.log("[fetchRedlineDocumentSection] Request:",e);const{data:t}=await n.default.get(`${e.baseApiUrl}/redlining/segment/${e.documentId}/${e.sectionId}?redline_config_id=${e.redlineConfigId}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});return console.log("[fetchRedlineDocumentSection] Response:",t),t}catch(e){console.log("[fetchRedlineDocumentSection] Error:",e)}return null},exports.getRedlineDocumentId=async e=>{try{console.log("[getRedlineDocumentId] Request:",e);const{data:o}=await n.default.get(`${e.baseApiUrl}/book-finder-mode/get_comparison/${e.comparisonId}`);return console.log("[getRedlineDocumentId] Response:",o),o}catch(e){console.log("[getRedlineDocumentId] Error:",e)}return null},exports.resolveRedline=async(e,o)=>{try{console.log("[resolveRedline] Request:",e);const{data:t}=await n.default.post(`${e.baseApiUrl}/redlining/resolve`,{document_id:e.documentId,user_name:e.userName,user_email:e.userEmail,redline_id:e.redlineId,action:e.action,redline_config_id:e.redlineConfigId},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});return console.log("[resolveRedline] Response:",t),t}catch(e){console.log("[resolveRedline] Error:",e)}return null},exports.updateRedlineDocument=async(e,o)=>{try{console.log("[updateRedlineDocument] Request:",e);const{data:t}=await n.default.put(`${e.baseApiUrl}/redlining/update-manual`,{document_id:e.documentId,segment_id:e.sectionId,user_name:e.userName,user_email:e.userEmail,new_plain_content:e.updatedContent,redline_config_id:e.redlineConfigId},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});return console.log("[updateRedlineDocument] Response:",t),t}catch(e){console.log("[updateRedlineDocument] Error:",e)}return null};
2
2
  //# sourceMappingURL=redlineService.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as n,__awaiter as i,__generator as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as l,useRef as u,useMemo as c,useEffect as a,useCallback as s}from"react";import{Box as d,Snackbar as v,Alert as f,Tooltip as p,Typography as g,Tabs as h,Tab as m}from"@mui/material";import{ChevronDown as S}from"lucide-react";import{ButtonCognitiveIcon as x}from"../../assests/svg/ButtonCognitiveIcon.js";import R from"./OverlayComponent.js";import{safeStringify as b,extractDeviationScore as y,generateColorPalette as C,findKeyPathByNodeId as w,DEVIATION_BADGE_SEPARATOR as B,hasMeaningfulRedlineTags as _,scrollAndHighlightClause as I,scrollAndWait as F,waitForScrollIdle as T}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as E,DEFAULT_FIELD_CONFIG as A,DEFAULT_COMPARISON_CONFIG as k}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as D,EMPTY_SUMMARY_POPUP_STATE as O,DEFAULT_COMPONENT_HEADER_TEXT as P}from"./CognitiveCompareConstants.js";import j from"./CognitivePopup.js";import L from"./MoreFunctionsPopup.js";import N from"./LoaderComponent.js";import M from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as H}from"./hooks/useCompareData.js";import{useComparePopups as z}from"./hooks/useComparePopups.js";import{useSectionRefs as W}from"./hooks/useSectionRefs.js";import{useAccordionState as q}from"./hooks/useAccordionState.js";import{useDeviationNavigation as G}from"./hooks/useDeviationNavigation.js";import V from"./components/CompareHeader.js";import K from"./components/SubSectionAccordion.js";import Y from"./components/LHSSectionRow.js";import J from"./components/RHSSectionRow.js";import X from"./components/CognitiveSummaryPopup.js";import{CompareContextProvider as $}from"./CompareContext.js";import{useStyleHelpers as U}from"./hooks/useStyles.js";import{useResizeHandler as Q}from"./hooks/useResizeHandler.js";import{useLinesCalculator as Z}from"./hooks/useLinesCalculator.js";import{useSideBySide as ee}from"./hooks/useSideBySide.js";import ne from"./components/SvgConnectors.js";import ie from"./Guidelines/components/GuidelinePanel.js";import te from"./Guidelines/components/WebGptPanel.js";var oe=function(oe){var re,le,ue,ce,ae,se,de,ve,fe,pe,ge,he,me,Se,xe,Re,be,ye,Ce,we,Be,_e,Ie,Fe,Te,Ee,Ae,ke,De,Oe,Pe,je,Le,Ne,Me,He=oe.componentHeaderText,ze=void 0===He?P:He,We=oe.treeData,qe=oe.comparisonConfig,Ge=oe.leftColumnTitleText,Ve=oe.rightColumnTitleText,Ke=oe.markdownStyles,Ye=oe.resetTrigger,Je=oe.displayConfig,Xe=void 0===Je?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0,isStreamingEnabled:!1}:Je,$e=oe.onMaintainRelativeOrderChange,Ue=oe.popupConfig,Qe=oe.deviationData,Ze=void 0===Qe?{}:Qe,en=oe.deviationNodeIdToView,nn=oe.resetDeviationNodeId,tn=oe.isProposingFix,on=void 0!==tn&&tn,rn=oe.proposingFixNodeId,ln=oe.isRedlineFlow,un=oe.badgeStyleOverride,cn=oe.guidelinesData,an=oe.gptWebCitationConfig,sn=l(Xe.maintainRelativeOrder),dn=sn[0],vn=sn[1],fn=null!==(re=null==Xe?void 0:Xe.expandLevels)&&void 0!==re?re:0,pn=!!(null==Xe?void 0:Xe.expandAllSections),gn=!!dn||!!(null==Xe?void 0:Xe.showDeviationBadges),hn=l(!1),mn=hn[0],Sn=hn[1],xn=l(null),Rn=xn[0],bn=xn[1],yn=l(null===(ue=null!==(le=null==We?void 0:We.newEvaluationResult)&&void 0!==le?le:null==Xe?void 0:Xe.enableDeviationSchemaBackwardCompatibility)||void 0===ue||ue)[0],Cn=l(new Set),wn=Cn[0],Bn=Cn[1],_n=l([]),In=_n[0],Fn=_n[1],Tn=l(!1),En=Tn[0],An=Tn[1],kn=l(0),Dn=kn[0],On=kn[1],Pn=u(null),jn=u(null),Ln=u(null),Nn=u(null),Mn=u(null),Hn=u(!1),zn=u(null),Wn=u({}),qn=u([]),Gn=u(function(){}),Vn=u(null),Kn=u(function(){}),Yn=c(function(){return JSON.stringify(Ze||{})},[JSON.stringify(Ze)]),Jn=c(function(){return Ze||{}},[Yn]),Xn=c(function(){return(null==We?void 0:We.cognitive_decisioning)||{}},[We]),$n=c(function(){return e(e({},E),Ke)},[Ke]),Un=u(null),Qn=u(null),Zn=u(null),ei=u(null),ni=u(null),ii=u(null),ti=u(null),oi=u(null),ri=u(null),li=u(null),ui=z(Un),ci=ui.cognitivePopup,ai=ui.setCognitivePopup,si=ui.moreFunctions,di=ui.setMoreFunctions,vi=ui.position,fi=ui.setPosition,pi=ui.activeBadgeId,gi=ui.summaryPopup,hi=ui.setSummaryPopup,mi=ui.closeSummaryPopup,Si=ui.setActiveBadgeId,xi=ui.popupRef,Ri=ui.handleOpenCognitiveCompare,bi=ui.openCognitivePopupFromState,yi=ui.closeCognitivePopup,Ci=ui.closeMoreFunctionsPopup,wi=c(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==qe?void 0:qe.fields)&&void 0!==e?e:A,thresholds:{high:null!==(i=null===(n=null==qe?void 0:qe.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:k.thresholds.high,medium:null!==(o=null===(t=null==qe?void 0:qe.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:k.thresholds.medium,exact:null!==(l=null===(r=null==qe?void 0:qe.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:k.thresholds.exact}}},[qe]),Bi=l(null),_i=Bi[0];Bi[1];var Ii=null===(se=null===(ce=null==We?void 0:We.documents)||void 0===ce?void 0:ce[null===(ae=null==We?void 0:We.input_index_map)||void 0===ae?void 0:ae[0]])||void 0===se?void 0:se.title,Fi=null===(fe=null===(de=null==We?void 0:We.documents)||void 0===de?void 0:de[null===(ve=null==We?void 0:We.input_index_map)||void 0===ve?void 0:ve[1]])||void 0===fe?void 0:fe.title,Ti=b(Ge||Ii||"Uploaded Contract"),Ei=null===(me=null===(he=null===(pe=null==We?void 0:We.documents)||void 0===pe?void 0:pe[null===(ge=null==We?void 0:We.input_index_map)||void 0===ge?void 0:ge[0]])||void 0===he?void 0:he.metadata)||void 0===me?void 0:me.file_name,Ai=b(Ei),ki=null===(be=null===(Re=null===(Se=null==We?void 0:We.documents)||void 0===Se?void 0:Se[null===(xe=null==We?void 0:We.input_index_map)||void 0===xe?void 0:xe[1]])||void 0===Re?void 0:Re.metadata)||void 0===be?void 0:be.file_name,Di=b(ki),Oi=b(Ve||Fi||"Reference Template"),Pi=H(We,dn,Jn,wi,yn,cn),ji=Pi.isGuidelineMode,Li=Pi.activeProposed,Ni=Pi.existingRule,Mi=Pi.proposedSections,Hi=Pi.existingSections,zi=Pi.visibleFields,Wi=Pi.parentDeviationRecord,qi=Pi.deviationNumberRegistry,Gi=Pi.deviationParentRegistry,Vi=Pi.parseError;a(function(){Vi&&bn("Failed to load comparison: ".concat(Vi))},[Vi]);var Ki=Mi.length>0||Hi.length>0,Yi=c(function(){if(!ln)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";_(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(Mi),i(Hi),"".concat(e,":").concat(n)},[ln,Mi,Hi]);a(function(){if(Mi.length||Hi.length)if(pn){var e={},n={},i=function(i,t){i.forEach(function(i,o){var r,l=dn?"".concat(t,"-").concat(o):String(o);e[l]=!0;var u=function(e,i){null==e||e.forEach(function(e,t){var o,r="".concat(i,"-").concat(t);n[r]=!0,(null===(o=e.subsections)||void 0===o?void 0:o.length)&&u(e.subsections,r)})};(null===(r=i.subsections)||void 0===r?void 0:r.length)&&u(i.subsections,String(o))})};i(Mi,"left"),i(Hi,"right"),Tt(e),At(n)}else if(fn>0){var t={},o={},r=function(e,n,i){e.forEach(function(e,r){var l;if(i>=1){var u=dn?"".concat(n,"-").concat(r):String(r);t[u]=!0}var c=function(e,n,t){t>i||null==e||e.forEach(function(e,i){var r,l="".concat(n,"-").concat(i);o[l]=!0,(null===(r=e.subsections)||void 0===r?void 0:r.length)&&c(e.subsections,l,t+1)})};(null===(l=e.subsections)||void 0===l?void 0:l.length)&&i>=2&&c(e.subsections,String(r),2)})};r(Mi,"left",fn),r(Hi,"right",fn),Tt(t),At(o)}},[pn,fn,Mi,Hi,dn]);var Ji=W(zi.map(function(e){return e.key}),Math.max(Mi.length,Hi.length)),Xi=Ji.leftRefs,$i=Ji.rightRefs,Ui=Ji.sectionLeftRefs,Qi=Ji.sectionRightRefs,Zi=Ji.lhsBadgeRefs,et=Ji.rhsBadgeRefs,nt=Ji.sectionRightRowRefs,it=Ji.subSectionLeftRefs,tt=Ji.subSectionRightRefs,ot=Ji.sectionRowRefs,rt=Ji.getSectionRowRef,lt=Ji.getSubSectionRef,ut=Ji.getBadgeRef,ct=ee({isGuidelineMode:ji,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,leftContainerRef:oi,rightContainerRef:Zn,scrollContainerRef:Un,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,sectionRowRefs:ot,sectionRightRowRefs:nt,rhsTopSpacerRef:ei,rhsBottomSpacerRef:ni,lhsTopSpacerRef:ii,lhsBottomSpacerRef:ti,calculateLinesRef:Gn,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,closeMoreFunctionsPopup:Ci,setErrorToast:bn,moreFunctions:si,closeSummaryPopup:mi}),at=ct.isSideBySide,st=ct.isArrowVisible,dt=ct.setIsArrowVisible,vt=ct.isResizing,ft=ct.setIsResizing,pt=ct.isSideBySideLoading,gt=ct.activeSideBySideSection,ht=ct.scrollLock,mt=ct.sideBySideCacheRef,St=ct.isSideBySideRef,xt=ct.activeSideBySideRightSectionRef,Rt=ct.activeSideBySideSectionRef,bt=ct.sideBySideLineRef,yt=ct.highlightedClauseRefs,Ct=ct.clearClauseHighlight,wt=ct.resetSideBySide,Bt=ct.activateSideBySide,_t=u(Bt);a(function(){_t.current=Bt},[Bt]);var It=q({maintainRelativeOrder:!!dn,proposedSections:Mi,existingSections:Hi,activeSideBySideSection:gt,connectedSections:wn,resetSideBySide:wt,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,svgContainerRef:Pn,isAnimatingRef:Hn,animationTimerRef:zn,calculateLinesRef:Gn,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt}),Ft=It.expandedSections,Tt=It.setExpandedSections,Et=It.expandedSubSections,At=It.setExpandedSubSections,kt=It.handleSubSectionToggle,Dt=It.toggleSection,Ot=It.forceExpandCrossWiredSections,Pt=function(){var e,n;if(null!=gt){var i=null===(e=Ui.current[gt])||void 0===e?void 0:e.current,t=null===(n=Qi.current[gt])||void 0===n?void 0:n.current,o=Zn.current;if(i&&t&&o){var r=i.getBoundingClientRect(),l=t.getBoundingClientRect(),u=o.getBoundingClientRect(),c=r.top-u.top,a=l.top-u.top-c;o.scrollBy({top:a,behavior:"smooth"})}}},jt=s(function(e){null==e||e.stopPropagation(),An(function(e){var n=!e;return n&&requestAnimationFrame(function(){Pt()}),n})},[Pt]);a(function(){ln&&"off"!==Yi&&"0:0"!==Yi&&(mt.current=null,qn.current=[],requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)}))},[ln,Yi]);var Lt=c(function(){var e=new Map,n=new Map,i=1;if(dn)Mi.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),Hi.forEach(function(t){if(t.id&&!(!t.title&&!t.content)){var o=Mi.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(Mi.length,Hi.length),o=0;o<t;o++){var r=Mi[o],l=Hi[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[Mi,Hi,dn]),Nt=Ni.analysis,Mt=b(null===(Ce=null===(ye=null==Nt?void 0:Nt.rule_difference_comparison)||void 0===ye?void 0:ye.summary)||void 0===Ce?void 0:Ce.overall_summary),Ht=!!Mt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),zt=null!==(we=null==We?void 0:We.base_root_id)&&void 0!==we?we:"-1";null==We||We[zt];var Wt=yn?null!==(je=null!==(De=Ze&&(null===(ke=null==Ze?void 0:Ze[zt])||void 0===ke?void 0:ke.evaluation_result))&&void 0!==De?De:null===(Pe=null===(Oe=null==We?void 0:We.nodes)||void 0===Oe?void 0:Oe[zt])||void 0===Pe?void 0:Pe.evaluation_result)&&void 0!==je?je:null:null!==(Ae=null!==(Ie=Ze&&(null===(_e=null===(Be=null==Ze?void 0:Ze[zt])||void 0===Be?void 0:Be.evaluation_result)||void 0===_e?void 0:_e[0]))&&void 0!==Ie?Ie:null===(Ee=null===(Te=null===(Fe=null==We?void 0:We.nodes)||void 0===Fe?void 0:Fe[zt])||void 0===Te?void 0:Te.evaluation_result)||void 0===Ee?void 0:Ee[0])&&void 0!==Ae?Ae:null,qt=y(Wt),Gt=C(null!==(Me=null===(Ne=null===(Le=null==Wt?void 0:Wt.evaluation_outputs)||void 0===Le?void 0:Le.metadata)||void 0===Ne?void 0:Ne.label_color)&&void 0!==Me?Me:D);if(un){var Vt=un(qt);Vt&&(Gt=e(e({},Gt),{badgeBg:Vt.bg,badgeText:Vt.text,badgeBorder:Vt.border}))}var Kt=u(wt);a(function(){Kt.current=wt},[wt]);var Yt=u(yi);a(function(){Yt.current=yi},[yi]);var Jt=s(function(e,n,i,t,o,r){return nr.current(e,n,i,t,o,r)},[]),Xt=s(function(e,n,i,t,o){return tr.current(e,n,i,t,o)},[]),$t=s(function(){return or.current()},[]),Ut=s(function(e,n){return rr.current(e,n)},[]),Qt=s(function(e){return lr.current(e)},[]),Zt=s(function(e){return ur.current(e)},[]),eo=s(function(){return cr.current()},[]),no=s(function(){var e,n;Ct(),null===(e=Kt.current)||void 0===e||e.call(Kt),An(!1),Bn(new Set),Fn([]),qn.current=[],bo([]),Co(null),hi(O),null===(n=Yt.current)||void 0===n||n.call(Yt),requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)})},[]),io=u(no);a(function(){io.current=no},[no]),a(function(){Ye&&io.current()},[Ye]);var to=c(function(){return{documents:null==We?void 0:We.documents,input_index_map:null==We?void 0:We.input_index_map}},[JSON.stringify(null==We?void 0:We.documents),JSON.stringify(null==We?void 0:We.input_index_map)]),oo=u(We);a(function(){oo.current=We},[We]);var ro=u(Xn);a(function(){ro.current=Xn},[Xn]);var lo=s(function(n,i,t,o,r,l,u){var c,a,s,d,v,f,p,g,h,m,S,x,R=b(null==i?void 0:i.id)||b(null==t?void 0:t.id)||"",y=(R?null===(c=ro.current)||void 0===c?void 0:c[R]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:R,decisioning:[],gap:[],relevance_score:0},C=null!==(s=null===(a=ot.current[o])||void 0===a?void 0:a.current)&&void 0!==s?s:null,w=function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e(e({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(B)))return u(l);var c=o.split(B)[1];if(!c)return l;var a=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},s=(null===(n=null==a?void 0:a.deviation_entries)||void 0===n?void 0:n[c])||(null===(r=null==a?void 0:a.deviations)||void 0===r?void 0:r[c])||null;return s?e(e(e({},a),s),{deviation_summary:(null==s?void 0:s.deviation_summary)||(null==a?void 0:a.deviation_summary),deviation_title:(null==s?void 0:s.deviation_title)||(null==a?void 0:a.deviation_title),deviation_impact:(null==s?void 0:s.deviation_impact)||(null==a?void 0:a.deviation_impact),deviation_explanation:(null==s?void 0:s.deviation_explanation)||(null==a?void 0:a.deviation_explanation),evaluation_outputs:(null==s?void 0:s.evaluation_outputs)||(null==a?void 0:a.evaluation_outputs),cognitive_decisioning:(null==s?void 0:s.cognitive_decisioning)||(null==a?void 0:a.cognitive_decisioning)}):u(l)}(),_=(null!==(f=null===(v=null===(d=null==w?void 0:w.cognitive_decisioning)||void 0===d?void 0:d.decisioning_factors)||void 0===v?void 0:v.length)&&void 0!==f?f:0)>0||(null!==(h=null===(g=null===(p=null==w?void 0:w.cognitive_decisioning)||void 0===p?void 0:p.gaps_in_decision)||void 0===g?void 0:g.length)&&void 0!==h?h:0)>0,I=null!==(m=null==Xe?void 0:Xe.isLoading)&&void 0!==m&&m,F=!0;if(ji)if(w&&Object.keys(w).length>0){var T=Array.isArray(w)?w[0]:w,E=null===(x=null===(S=null==T?void 0:T.evaluation_outputs)||void 0===S?void 0:S.metadata)||void 0===x?void 0:x.is_orphan;!0!==E&&"true"!==E&&"Yes"!==E&&"yes"!==E||(F=!1)}else F=!1;return{isLoading:I&&!_,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:y,anchorEl:n,sectionAnchorEl:C,badgeStyle:l||null,sectionIdx:o,docData:to,deviationData:w,isOrphan:!!r,hasGuidelineMatches:F}},[to,null==Xe?void 0:Xe.isLoading,ji]),uo=s(function(e,n,i,t,o,r){var l;if(e.stopPropagation(),si.open&&si.sectionIdx===o)Ci();else{var u=e.currentTarget,c="left";(null===(l=Zn.current)||void 0===l?void 0:l.contains(u))&&(c="right");Ct(),St.current&&wt(),Bn(new Set),Fn([]),qn.current=[],yi(),gi.open?jo():mi(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(B)){var r=o.split(B),l="".concat(r[0]).concat(B).concat(r[1]);return"right"===c?null===(e=et.current[l])||void 0===e?void 0:e.current:null===(n=Zi.current[l])||void 0===n?void 0:n.current}return"right"===c?null===(i=et.current[o])||void 0===i?void 0:i.current:null===(t=Zi.current[o])||void 0===t?void 0:t.current}()||u;di(lo(e,n,t,o,i,r))})}},[si.open,si.sectionIdx,Ci,mi,lo]),co=s(function(){var e=si.sectionIdx;si.isOrphan,Ci(),mi(),null!==e&&(Ot(e),Ct(),St.current&&wt(),Fn([]),qn.current=[],ji&&null!==e&&On(Do(e)),Bn(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Gn.current&&Gn.current()},50))},[si.sectionIdx,si.isOrphan,Ci,mi,wt]),ao=s(function(){var e=Mn.current;if(e){Mn.current=null;var n=Mi.findIndex(function(n){return n.id===e}),i=Hi.findIndex(function(n){return n.id===e}),t=-1===n?w(Mi,e):null,o=-1===i?w(Hi,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,u;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(u=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==u?u:null},c=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(yt.current.add(r),I(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(dn)-1!==r&&oi.current&&c(function(){return u(n,t,Ui,it)},oi.current),-1!==l&&Zn.current&&c(function(){return u(i,o,Qi,tt)},Zn.current);else{var a=Un.current;if(!a)return;c(function(){return-1!==r?u(n,t,Ui,it):u(i,o,Qi,tt)},a)}}},[Mi,Hi,dn,Ui,Qi,it,tt,oi,Zn,Un]),so=s(function(n){if(n){Ct(),wt(),Bn(new Set),Fn([]),qn.current=[],mi(),yi();var i=Mi.findIndex(function(e){return e.id===n}),t=Hi.findIndex(function(e){return e.id===n}),o=-1===i?w(Mi,n):null,r=-1===t?w(Hi,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;Mn.current=n,Tt(function(n){var i,t=e({},n),o=!1;-1!==l&&(t[i=dn?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=dn?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),At(function(n){var i=e({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){Mn.current===n&&vo.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[Mi,Hi,dn,Tt,At,wt,mi,yi]),vo=u(ao);a(function(){vo.current=ao},[ao]);var fo=u(null);a(function(){if(_i){var e=wi.fields.find(function(e){return e.analysisKey===_i||e.key===_i});if(e){var n=Xi.current[e.key]||$i.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[_i,wi.fields]);var po=s(function(e){var n,i,t,o,r,l,u,c,a,s=null===(n=null==Nt?void 0:Nt.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!s||!s[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=s[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Nt]),go=U({proposedSections:Mi,existingSections:Hi,maintainRelativeOrder:dn,cognitiveMap:Xn,deviationData:Jn,treeData:We,resolvedComparisonConfig:wi,badgeStyleOverride:un}),ho=go.getSectionCompareStyle,mo=go.getSubSectionCompareStyle,So=go.getDeviationStyleByKey,xo=Z({containerRef:jn,leftContainerRef:oi,rightContainerRef:Zn,svgContainerRef:Pn,pathRefs:Wn,leftHeaderRef:Ln,rightHeaderRef:Nn,proposedSections:Mi,existingSections:Hi,visibleFields:zi,leftRefs:Xi,rightRefs:$i,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,sectionRowRefs:ot,expandedSections:Ft,expandedSubSections:Et,connectedSections:wn,isSideBySide:at,activeSideBySideSection:gt,maintainRelativeOrder:dn,isGuidelineMode:ji,cognitiveMap:Xn,getSectionCompareStyle:ho,getSubSectionCompareStyle:mo,getDeviationStyleByKey:So,isArrowVisible:st,isAnimatingRef:Hn,isSideBySideRef:St,sideBySideCacheRef:mt,sideBySideLineRef:bt,activeSideBySideSectionRef:Rt,activeSideBySideRightSectionRef:xt,connectedLines:In,setConnectedLines:Fn,cachedConnectedPositions:qn,calculateLinesRef:Gn,resizeTimerRef:Vn,scrollLock:ht,scrollSyncLocked:En,handleResizeRef:Kn,activeProposed:Li,existingRule:Ni,analysisData:Nt,pendingScrollTargetRef:ri,pendingScrollCallbackRef:li,resolvedComparisonConfig:wi,getFieldData:po}),Ro=xo.lines,bo=xo.setLines,yo=xo.overallConnector,Co=xo.setOverallConnector,wo=xo.svgDimensions,Bo=xo.handleColumnScroll;a(function(){gi.anchorEl&&requestAnimationFrame(function(){requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)})})},[gi.anchorEl,En]);var _o=s(function(){Ct(),An(!1),Tt({}),At({}),wt(),Bn(new Set),Fn([]),qn.current=[],mi(),yi(),Ci(),requestAnimationFrame(function(){Gn.current&&Gn.current()})},[Tt,At,wt,mi,yi,Ci]);a(function(){at||0!==wn.size||An(!1)},[at,wn]);var Io=c(function(){return Object.values(Ft).some(Boolean)||Object.values(Et).some(Boolean)},[Ft,Et]),Fo=u(null),To=u(0),Eo=u(0),Ao=u(0),ko=Q({timerRef:Fo,ruleComponentRef:Qn,scrollContainerRef:Un,containerRef:jn,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,isSideBySideRef:St,activeSideBySideSectionRef:Rt,activeSideBySideRightSectionRef:xt,sectionRowRefs:ot,sectionRightRowRefs:nt,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,leftContainerRef:oi,rightContainerRef:Zn,calculateLinesRef:Gn,handleResizeRef:Kn,setIsResizing:ft,setIsArrowVisible:dt,sideBySideCacheRef:mt,cachedConnectedPositions:qn}).handleResize;a(function(){Kn.current=ko},[ko,Kn]),a(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,u;i.current=null;var c=e[e.length-1];if(c){var a=null!==(u=null===(l=null===(r=c.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:c.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return Qn.current&&o.push(e(Qn.current,To,n,function(){return Kn.current()},function(){})),Un.current&&o.push(e(Un.current,Eo,i,function(){return Kn.current()},function(){return Gn.current()})),jn.current&&o.push(e(jn.current,Ao,t,function(){return Kn.current()},function(){return Gn.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),a(function(){St.current=at},[at]),a(function(){Rt.current=gt},[gt]);var Do=s(function(e){var n,i,t,o,r,l="",u="0";if("number"==typeof e)l=(null===(n=Mi[e])||void 0===n?void 0:n.nodeId)||(null===(i=Mi[e])||void 0===i?void 0:i.id)||"";else{var c=String(e).split(B);l=c[0],u=c[1]||"0"}var a=null===(t=null==Jn?void 0:Jn[l])||void 0===t?void 0:t.evaluation_result,s=Array.isArray(a)?a[parseInt(u,10)]:null==a?void 0:a[u];return!1===(null===(r=null===(o=null==s?void 0:s.evaluation_outputs)||void 0===o?void 0:o.guideline_flag)||void 0===r?void 0:r.rulebook_used)?1:0},[Mi,Jn]),Oo=s(function(e){var n,i,t=document.querySelectorAll('[id^="guideline-target-"], [data-web-gpt-active="true"]'),o=oi.current,r=Zn.current,l="string"==typeof e&&e.includes(B)?"".concat(e.split(B)[0]).concat(B).concat(e.split(B)[1]):e,u=(null===(n=Zi.current[l])||void 0===n?void 0:n.current)||(null===(i=Zi.current[e])||void 0===i?void 0:i.current);if(t.length>0&&u&&o&&r){var c=t[0];ii.current&&(ii.current.style.height="0px"),ei.current&&(ei.current.style.height="0px"),ti.current&&(ti.current.style.height="0px"),ni.current&&(ni.current.style.height="0px"),requestAnimationFrame(function(){var e=u.getBoundingClientRect(),n=c.getBoundingClientRect(),i=o.getBoundingClientRect(),t=r.getBoundingClientRect(),l=o.scrollTop+(e.top-i.top)+e.height/2,a=r.scrollTop+(n.top-t.top)+n.height/2,s=l-i.height/2,d=Math.max(0,s),v=o.scrollHeight-o.clientHeight,f=d>v?d-v:0,p=i.top+l-d,g=t.top+a-p,h=0;g<0&&(h=Math.abs(g),g=0);var m=r.scrollHeight-r.clientHeight+h,S=g>m?g-m:0;ti.current&&(ti.current.style.height="".concat(f,"px")),ei.current&&(ei.current.style.height="".concat(h,"px")),ni.current&&(ni.current.style.height="".concat(S,"px")),requestAnimationFrame(function(){o.scrollTo({top:d,behavior:"smooth"}),r.scrollTo({top:g,behavior:"smooth"}),Gn.current&&setTimeout(function(){return Gn.current()},50)})})}},[B]),Po=s(function(){var e,n=si.sectionIdx,i=si.isOrphan;if(mi(),null!=n){var t="left";si.anchorEl&&(null===(e=Zn.current)||void 0===e?void 0:e.contains(si.anchorEl))&&(t="right"),Ot(n),ji&&(On(Do(n)),Bn(new Set([n]))),Bt(n,i,{sourceSide:t,onReady:function(){ji&&setTimeout(function(){return Oo(String(n))},150)}})}},[Bt,si.isOrphan,si.sectionIdx,si.anchorEl,mi,Ot,ji,Oo,Jn]),jo=s(function(){mi(),wt(),Bn(new Set),Fn([]),qn.current=[]},[mi,wt]),Lo=null!==si.sectionIdx&&wn.has(si.sectionIdx),No=G({proposedSections:Mi,existingSections:Hi,parentDeviationRecord:Wi,expandedSections:Ft,maintainRelativeOrder:!!dn,scrollContainerRef:Un,leftContainerRef:oi,rightContainerRef:Zn,lhsBadgeRefs:Zi,rhsBadgeRefs:et}),Mo=No.showDeviationNavigation,Ho=No.showOpenNodeRef,zo=No.adjustScrollForPopup,Wo=s(function(e,n,i,t,o){var r,l="string"==typeof t?b(t).trim():b(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;yi();var c="left";(null===(r=Zn.current)||void 0===r?void 0:r.contains(u))&&(c="right");var a=function(){var e,i,t,o;if("string"==typeof n&&n.includes(B)){var r=n.split(B),l="".concat(r[0]).concat(B).concat(r[1]);return"right"===c?null===(e=et.current[l])||void 0===e?void 0:e.current:null===(i=Zi.current[l])||void 0===i?void 0:i.current}return"right"===c?null===(t=et.current[n])||void 0===t?void 0:t.current:null===(o=Zi.current[n])||void 0===o?void 0:o.current};if(i&&!ji)return wt(),Bn(new Set),Fn([]),qn.current=[],void(l&&(Ot(n),requestAnimationFrame(function(){var e=a()||u;e&&(e.getBoundingClientRect().top>.8*window.innerHeight&&e.scrollIntoView({behavior:"smooth",block:"center"}));hi({open:!0,anchorEl:e,summary:t,displayImpact:o})})));Ot(n),ji&&(On(Do(n)),Bn(new Set([n]))),l?setTimeout(function(){Bt(n,i,{toggleIfSame:!1,sourceSide:c,onReady:function(){var e,i,r,l=a()||u;if(ji)setTimeout(function(){return Oo(n)},150);else if(l){var c=l.getBoundingClientRect();if(c.top>.8*window.innerHeight||c.top<100){var s=c.top-window.innerHeight/2;dn?(null===(e=oi.current)||void 0===e||e.scrollBy({top:s,behavior:"smooth"}),null===(i=Zn.current)||void 0===i||i.scrollBy({top:s,behavior:"smooth"})):null===(r=Un.current)||void 0===r||r.scrollBy({top:s,behavior:"smooth"})}}hi({open:!0,anchorEl:l,summary:t,displayImpact:o})}})},350):setTimeout(function(){Bt(n,i,{toggleIfSame:!1,sourceSide:c}),ji&&setTimeout(function(){return Oo(n)},150)},350)},[Bt,yi,hi,wt,Ot,ji,dn,Oo,Jn]),qo=c(function(){var e;if(!en)return null;var n=null===(e=null==en?void 0:en.id)||void 0===e?void 0:e.split(":")[0];for(var i in Wi){if((Wi[i]||[]).some(function(e){return e.id===n}))return i}return null},[en,Wi]),Go=u({id:null,triggerMs:null}),Vo=u(null);a(function(){if(null==en?void 0:en.id){var o=Number(en.trigger),r=Go.current;if((null==r?void 0:r.id)!==en.id||(null==r?void 0:r.triggerMs)!==o){if(!(en.id.includes(":")&&/:\d+$/.test(en.id)))return Go.current={id:en.id,triggerMs:o},void so(en.id);var l=en.id.split(":"),u=l[0],c=l[1],a=null!=c?c:"0",s="".concat(en.id,":").concat(o);Vo.current!==s&&(mi(),yi(),wt(),Bn(new Set),Fn([]),qn.current=[],Vo.current=s);var d=!1,v=0,f=null,p=null,g=!1,h=function(e,n){for(var i=function(e,t){if(!e)return null;if(n.includes(e.id)||n.includes(e.nodeId)||n.includes(e.contentId))return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},m=function(){var r,l,c;if(!d){var s=function(){Go.current={id:en.id,triggerMs:o}},S=null,x=null;for(var R in Wi){var b=Wi[R].find(function(e){var n;return e.id===u||e.nodeId===u||e.contentId===u||(null===(n=e.evaluationResult)||void 0===n?void 0:n.nodeId)===u});if(b){S=R,x=b;break}}if(x&&S){var y=Array.from(new Set([u,x.id,x.nodeId,x.contentId,null===(r=x.evaluationResult)||void 0===r?void 0:r.nodeId].filter(Boolean))),C=Mi.findIndex(function(e){return e.id===S}),w=Hi.findIndex(function(e){return e.id===S}),_=-1===C&&-1!==w,I=h(Mi,y),E=h(Hi,y);if(I&&!E&&!_){var A=I.split("-"),k=Number(A[0]);if(dn){var D=null===(c=null===(l=Mi[k])||void 0===l?void 0:l.refIndexes)||void 0===c?void 0:c[0],O=Hi.findIndex(function(e){return e.selfIndex===D});-1!==O&&(k=O)}E=n([k],A.slice(1),!0).join("-")}if(I||E){var P=I?Number(I.split("-")[0]):C,j=E?Number(E.split("-")[0]):w,L=j>=0?j:E?Number(E.split("-")[0]):-1,N=Mi[P],M=Hi[L],H=N&&!N.title&&!N.content,z=M&&!M.title&&!M.content,W=_||(!I&&!!E||H&&!z);if(W){if(!(dn?!!ir.current["right-".concat(j)]:!!ir.current[String(j)])&&j>=0)return Dt(j,"right"),void(f=setTimeout(m,200))}else if(!(dn?!!ir.current["left-".concat(P)]:!!ir.current[String(P)])&&P>=0)return Dt(P,"left"),void(f=setTimeout(m,200));var q=I||"",G=E||"",V=y.map(function(e){return"".concat(e).concat(B).concat(a)}),K=V[0],Y=function(){for(var e,n,i=0,t=V;i<t.length;i++){var o=t[i],r=(null===(e=Zi.current[o])||void 0===e?void 0:e.current)||null,l=(null===(n=et.current[o])||void 0===n?void 0:n.current)||null;if(r||l)return{refId:o,left:r,right:l}}return{refId:K,left:null,right:null}},J=function(e){return"".concat(e).concat(B).concat(q).concat(B).concat(G)};if(!g){Ot(J(K)),g=!0,v=0;var X=function(){var e=Y(),n=e.left,i=e.right;return W||!n&&!!i?i:n};return null==p||p(),void(f=setTimeout(function(){var e,n,i,t,o,r,l,u;d||(e=X,n=function(){d||(p=null,m())},t=0,o=null,r=null,l=performance.now(),u=function(){if(!d)if(performance.now()-l>3e3)n();else{var c=e();if(c&&0!==c.getBoundingClientRect().height){var a=c.getBoundingClientRect(),s=a.top,v=a.height,f=null!==o&&Math.abs(s-o)<.5,p=null!==r&&Math.abs(v-r)<.5;if(f&&p){if(++t>=5)return void n()}else t=0;o=s,r=v,i=requestAnimationFrame(u)}else i=requestAnimationFrame(u)}},i=requestAnimationFrame(u),p=function(){return cancelAnimationFrame(i)})},300))}var $=Y(),U=$.refId,Q=$.left,Z=$.right,ee=J(U);if(Q||Z){var ne=W||!Q&&!!Z,ie=ne?Z:Q,te=dn?ne?Zn.current:oi.current:Un.current;if(ie&&te){var oe=ie.getBoundingClientRect();if(0!==oe.height){var re=te.getBoundingClientRect(),le=oe.top-re.top+te.scrollTop-re.height/2+oe.height/2,ue=(null==I?void 0:I.includes("-"))||(null==E?void 0:E.includes("-")),ce=function(){return i(void 0,void 0,void 0,function(){var n,i,o,r,l,u,c,v,f,p;return t(this,function(t){switch(t.label){case 0:return d?[2]:(s(),n=ie instanceof Element?window.getComputedStyle(ie).color:"",[Q,Z].forEach(function(e){e&&(e.style.transition="box-shadow 300ms ease-in-out",e.style.boxShadow="0 0 10px ".concat(n))}),setTimeout(function(){[Q,Z].forEach(function(e){e&&(e.style.boxShadow="")})},2e3),i=(null===(c=null===(u=x.evaluationResult)||void 0===u?void 0:u.deviations)||void 0===c?void 0:c[a])||x,o=(null===(v=x.evaluationResult)||void 0===v?void 0:v.evaluation_outputs)||x.evaluation_outputs,!!Q&&!!Z?(l=function(e,n){return Promise.race([e,new Promise(function(e){return setTimeout(e,n)})])},dn?[4,Promise.all([oi.current?l(T(oi.current),600):Promise.resolve(),Zn.current?l(T(Zn.current),600):Promise.resolve()])]:[3,2]):(r=ne?(null===(f=et.current[ue?U:j])||void 0===f?void 0:f.current)||Z:(null===(p=Zi.current[ue?U:P])||void 0===p?void 0:p.current)||Q,zo(r,function(){hi({open:!0,anchorEl:r,displayImpact:en.displayImpact,summary:e(e({},i),{evaluation_outputs:o})})},{skipScroll:!0}),null==nn||nn(),[2]));case 1:t.sent(),t.label=2;case 2:return _t.current(ee,!1,{toggleIfSame:!1,sourceSide:_?"right":"left",onReady:function(){var n,t,o,r;s();var l=ne?(null===(n=et.current[U])||void 0===n?void 0:n.current)||Z:(null===(t=Zi.current[U])||void 0===t?void 0:t.current)||Q,u=(null===(o=Zi.current[U])||void 0===o?void 0:o.current)||Q,c=(null===(r=et.current[U])||void 0===r?void 0:r.current)||Z;u&&(u.style.scrollMarginTop="150px",u.scrollIntoView({behavior:"smooth",block:"start"})),c&&(c.style.scrollMarginTop="150px",c.scrollIntoView({behavior:"smooth",block:"start"})),hi({open:!0,anchorEl:l,displayImpact:en.displayImpact,summary:e({},i)}),null==nn||nn()}}),[2]}})})};Math.abs(te.scrollTop-le)<=2?ce():F(te,le,ce)}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}};return f=setTimeout(m,100),function(){d=!0,f&&clearTimeout(f),null==p||p()}}}},[null==en?void 0:en.id,null==en?void 0:en.trigger,null==en?void 0:en.displayImpact,Wi,Mi,Hi,dn,hi,so]),a(function(){var n,i,t;if(gi.open){var o=gi.anchorEl;if(o&&!o.isConnected){var r=function(e){for(var n,i=0,t=Object.entries(e);i<t.length;i++){var r=t[i],l=r[0];if((null===(n=r[1].current)||void 0===n?void 0:n.textContent)===o.textContent)return l}return null},l=(null===(n=o.dataset)||void 0===n?void 0:n.deviationRefId)||r(Zi.current)||r(et.current);if(l){var u=(null===(i=et.current[l])||void 0===i?void 0:i.current)||(null===(t=Zi.current[l])||void 0===t?void 0:t.current);u&&u.isConnected&&hi(function(n){return e(e({},n),{anchorEl:u})})}}}},[gi.open,gi.anchorEl,En,wn,Ft]);var Ko=ci.open,Yo=ci.sectionIdx,Jo=ci.isOrphan,Xo=ci.badgeStyle,$o=ci.anchorEl,Uo=ci.sectionAnchorEl;a(function(){var n;if(Xe.isStreamingEnabled&&Ko&&null!=Yo&&Yo!==zt){var i="string"==typeof Yo?Yo.split(B)[0]:null,t=function(e,n){var i;if(!e||!Array.isArray(e))return null;for(var o=0,r=e;o<r.length;o++){var l=r[o];if(l.id===n)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var u=t(l.subsections,n);if(u)return u}}return null},o=i&&"string"==typeof i?t(Mi,i):null,r=i&&"string"==typeof i?t(Hi,i):null,l="number"==typeof Yo?Mi[Yo]||null:o||i&&((null===(n=null==We?void 0:We.nodes)||void 0===n?void 0:n[i])||(null==We?void 0:We[i]))||null,u="number"==typeof Yo?Hi[Yo]||null:r,c=lo($o,l,u,Yo,Jo,Xo);ai(function(n){return n.open?b(n.cognitiveData)===b(c.cognitiveData)&&b(n.deviationData)===b(c.deviationData)&&n.sectionTitle===c.sectionTitle&&n.refSectionTitle===c.refSectionTitle?n:e(e(e({},n),c),{open:!0,anchorEl:n.anchorEl,sectionAnchorEl:n.sectionAnchorEl}):n})}},[Ko,Yo,Jo,Xo,$o,Uo,Mi,Hi,lo]);var Qo=s(function(e){var n=e.section,i=e.keyPath,t=e.depth,r=void 0===t?0:t,l=e.columnKey,u=void 0===l?"left":l,c=e.parentNodeId,a=void 0===c?"":c,s=e.sectionOffset,d=e.rhsOrphanVisualIndexes;return o(K,{section:n,keyPath:i,depth:r,columnKey:u,parentNodeId:a,sectionOffset:s,rhsOrphanVisualIndexes:d})},[]),Zo=c(function(){return Mi.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&dn?null:o(Y,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"left-row-".concat(n))})},[Mi]),er=c(function(){return Hi.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&dn?null:o(J,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"right-row-".concat(n))})},[Hi]),nr=u(uo);a(function(){nr.current=uo},[uo]);var ir=u(Ft);a(function(){ir.current=Ft},[Ft]);var tr=u(Wo);a(function(){tr.current=Wo},[Wo]);var or=u(jo);a(function(){or.current=jo},[jo]);var rr=u(Dt);a(function(){rr.current=Dt},[Dt]);var lr=u(kt);a(function(){lr.current=kt},[kt]);var ur=u(Qo);a(function(){ur.current=Qo},[Qo]);var cr=u(wt);a(function(){cr.current=wt},[wt]);var ar=c(function(){return{isGuidelineMode:ji,maintainRelativeOrder:!!dn,showDeviationBadges:gn,isProposingFix:on,proposingFixNodeId:rn,isRedlineFlow:ln,isSideBySide:at,activeSideBySideSection:gt,scrollSyncLocked:En,toggleScrollSyncLocked:jt,summaryPopupAnchorEl:gi.anchorEl,connectedSections:wn,proposedSections:Mi,existingSections:Hi,deviationNumberRegistry:qi,deviationParentRegistry:Gi,treeData:We,displayConfig:Xe,resolvedMarkdownStyles:$n,unifiedNumbering:Lt,expandedSections:Ft,expandedSubSections:Et,setExpandedSubSections:At,getSectionCompareStyle:ho,getSubSectionCompareStyle:mo,getBadgeRef:ut,getSectionRowRef:rt,getSubSectionRef:lt,sectionLeftRefs:Ui,sectionRightRefs:Qi,sectionRowRefs:ot,sectionRightRowRefs:nt,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,openMoreFunctionsPopup:Jt,handleOpenSummaryPopup:Xt,openSummaryPopup:Xt,handleCloseSummaryPopup:$t,toggleSection:Ut,handleSubSectionToggle:Qt,renderSubSectionAccordion:Zt,resetSideBySide:eo,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,showDeviationNavigation:Mo,showOpenNodeRef:Ho,deviationNodeIdToView:null==en?void 0:en.id,deviationTargetParentId:qo,guidelinesData:cn,gptWebCitationConfig:an}},[ji,dn,gn,on,rn,ln,at,gt,En,jt,gi.anchorEl,wn,Mi,Hi,qi,Xe,$n,Lt,Ft,Et,At,ho,mo,ut,rt,lt,Mo,Ho,en,qo,cn,an]);return o($,e({value:ar},{children:r(d,e({ref:Qn,sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"visible",position:"relative"}},{children:[mn&&o(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:o(N,{})})),gi.open&&o(X,{open:gi.open,anchorEl:gi.anchorEl,containerEl:fo.current,clipTopEl:Ln.current,scrollContainerEl:Un.current,onClose:jo,summary:gi.summary,displayImpact:gi.displayImpact,isScrollLocked:En}),o(L,{open:si.open,anchorEl:si.anchorEl,maintainRelativeOrder:!!dn,sectionTitle:si.sectionTitle,referenceSectionTitle:si.refSectionTitle,onClose:Ci,onOpenCognitiveCompare:Ri,onOpenSideBySide:Po,onConnect:co,isConnected:Lo,isOrphan:!ji&&!!si.isOrphan,isGuidelineMode:ji,hasGuidelineMatches:si.hasGuidelineMatches}),ci.open&&o(j,{open:ci.open,popupRef:xi,position:vi,popupConfig:Ue,onClose:function(){fi(null),ai(function(n){return e(e({},n),{open:!1})}),Si(null)},markdownStyles:Ke,sectionTitle:Ai,referenceSectionTitle:Di,cognitiveData:ci.cognitiveData,anchorEl:ci.anchorEl,sectionAnchorEl:ci.sectionAnchorEl,scrollContainerEl:Un.current,badgeStyle:ci.badgeStyle,docData:ci.docData,deviationData:ci.deviationData,isLoading:ci.isLoading}),o(v,e({open:!!Rn,autoHideDuration:8e3,onClose:function(){return bn(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:o(f,e({onClose:function(){return bn(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Rn}))})),o(V,{componentHeaderText:ze,displayConfig:Xe,maintainRelativeOrder:dn,onCollapseAll:_o,showCollapseAll:Io,onToggleView:function(e){Sn(!0),setTimeout(function(){vn(!e),null==$e||$e(!e),An(!1),wt(),mi(),Bn(new Set),Fn([]),qn.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){Sn(!1)},600)})})},50)}}),o(d,e({ref:Un,onScroll:Bo,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:dn?"visible":"auto",borderTop:Mt&&Ht?"none":"1.5px solid #EEF0F4"}},{children:o(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},dn?{flex:1}:{})},{children:r(d,e({ref:jn,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"100px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},dn?{flex:1,overflow:"visible"}:{})},{children:[o(ne,{svgContainerRef:Pn,svgDimensions:wo,isResizing:vt,overallConnector:yo,rootDeviationStyle:Gt,lines:Ro,isSideBySide:at,activeSideBySideSection:gt,isArrowVisible:st,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,cognitivePopup:ci,activeBadgeId:pi,closeCognitivePopup:yi,setActiveBadgeId:Si,openCognitivePopupFromState:bi,buildSectionPopupState:lo,connectedLines:In,isGuidelineMode:ji,pathRefs:Wn}),r(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},dn?{flex:1,overflow:"visible"}:{})},{children:[o(d,e({ref:Ln,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:o(p,e({title:Ti,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Ti}))}))})),r(d,e({ref:oi,onScroll:Bo,sx:e({p:"12px",display:"flex",flexDirection:"column"},dn?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-180px",pr:"192px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[o("div",{ref:ii,style:{width:"100%",height:"0px",flexShrink:0}}),Ki&&Zo,o("div",{ref:ti,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),o(d,e({ref:fo,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:o(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:r(d,e({onClick:function(n){n.stopPropagation(),ci.open&&pi===zt?yi():(Si(zt),bi(lo(n.currentTarget,{title:"",content:"",evaluationResult:Wt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,zt,!0,e(e({},Gt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Gt.badgeBg,color:Gt.badgeText,border:"1px solid ".concat(Gt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=qt?qt:o(M,{}),o(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:o(x,{})})),o(S,{size:11,style:{transform:ci.open&&pi===zt?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),r(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},dn?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[pt&&o(R,{sections:11}),o(d,e({ref:Nn,sx:e({p:"8px",bgcolor:ji?"#F1F3F5":"#F7F8FA",borderBottom:"1px solid #D7DCE2",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center"},dn?e({maxHeight:"calc(100vh - 250px)",overflowY:"auto",overflowX:"hidden",minHeight:0},ji?{"&::-webkit-scrollbar":{width:"6px",display:"block"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"#94A3B8"},scrollbarWidth:"thin",scrollbarColor:"#CBD5E1 transparent"}:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}):{})},{children:ji?r(h,e({value:Dn,onChange:function(e,n){return On(n)},variant:"fullWidth",TabIndicatorProps:{sx:{display:"none"}},sx:{width:"100%",minHeight:"36px","& .MuiTab-root":{minHeight:"36px",px:1,py:0,borderRadius:"8px",fontSize:"14px",lineHeight:1,fontWeight:500,textTransform:"none",color:"#374151",minWidth:0,transition:"background-color 160ms ease, box-shadow 160ms ease"},"& .Mui-selected":{color:"#374151",bgcolor:"#FFFFFF"}}},{children:[o(m,{label:o(p,e({title:Oi,placement:"top"},{children:o(d,e({component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",width:"100%"}},{children:"Redline Guidelines"}))}))}),o(m,{label:o(p,e({title:"Web & GPT Sources",placement:"top"},{children:o(d,e({component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",width:"100%"}},{children:"Web & GPT Sources"}))}))})]})):o(p,e({title:Oi,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Oi}))}))})),r(d,e({ref:Zn,onScroll:Bo,sx:e({p:ji?"0px":"12px",display:"flex",flexDirection:"column"},dn?e(e({maxHeight:"calc(100vh - 250px)"},!ji&&{flex:1}),{overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}):{})},{children:[o("div",{ref:ei,style:{width:"100%",height:"0px",flexShrink:0}}),ji?o(0===Dn?ie:te,{guidelinesData:cn,deviationData:Ze,connectedSections:wn,proposedSections:Mi}):Ki&&er,o("div",{ref:ni,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};export{oe as default};
1
+ import{__assign as e,__spreadArray as n,__awaiter as i,__generator as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as l,useRef as u,useMemo as c,useEffect as a,useCallback as s}from"react";import{Box as d,Snackbar as v,Alert as f,Tooltip as p,Typography as g,Tabs as h,Tab as m}from"@mui/material";import{ChevronDown as S}from"lucide-react";import{ButtonCognitiveIcon as x}from"../../assests/svg/ButtonCognitiveIcon.js";import R from"./OverlayComponent.js";import{safeStringify as b,extractDeviationScore as y,generateColorPalette as C,findKeyPathByNodeId as w,DEVIATION_BADGE_SEPARATOR as B,hasMeaningfulRedlineTags as _,scrollAndHighlightClause as I,scrollAndWait as F,waitForScrollIdle as T}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as E,DEFAULT_FIELD_CONFIG as A,DEFAULT_COMPARISON_CONFIG as k}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as D,EMPTY_SUMMARY_POPUP_STATE as O,DEFAULT_COMPONENT_HEADER_TEXT as P}from"./CognitiveCompareConstants.js";import j from"./CognitivePopup.js";import L from"./MoreFunctionsPopup.js";import N from"./LoaderComponent.js";import M from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as H}from"./hooks/useCompareData.js";import{useComparePopups as z}from"./hooks/useComparePopups.js";import{useSectionRefs as W}from"./hooks/useSectionRefs.js";import{useAccordionState as q}from"./hooks/useAccordionState.js";import{useDeviationNavigation as G}from"./hooks/useDeviationNavigation.js";import V from"./components/CompareHeader.js";import K from"./components/SubSectionAccordion.js";import J from"./components/LHSSectionRow.js";import Y from"./components/RHSSectionRow.js";import X from"./components/CognitiveSummaryPopup.js";import{CompareContextProvider as $}from"./CompareContext.js";import{useStyleHelpers as U}from"./hooks/useStyles.js";import{useResizeHandler as Q}from"./hooks/useResizeHandler.js";import{useLinesCalculator as Z}from"./hooks/useLinesCalculator.js";import{useSideBySide as ee}from"./hooks/useSideBySide.js";import ne from"./components/SvgConnectors.js";import ie from"./Guidelines/components/GuidelinePanel.js";import te from"./Guidelines/components/WebGptPanel.js";var oe=function(oe){var re,le,ue,ce,ae,se,de,ve,fe,pe,ge,he,me,Se,xe,Re,be,ye,Ce,we,Be,_e,Ie,Fe,Te,Ee,Ae,ke,De,Oe,Pe,je,Le,Ne,Me,He=oe.componentHeaderText,ze=void 0===He?P:He,We=oe.treeData,qe=oe.comparisonConfig,Ge=oe.leftColumnTitleText,Ve=oe.rightColumnTitleText,Ke=oe.markdownStyles,Je=oe.resetTrigger,Ye=oe.displayConfig,Xe=void 0===Ye?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0,isStreamingEnabled:!1}:Ye,$e=oe.onMaintainRelativeOrderChange,Ue=oe.popupConfig,Qe=oe.deviationData,Ze=void 0===Qe?{}:Qe,en=oe.deviationNodeIdToView,nn=oe.resetDeviationNodeId,tn=oe.isProposingFix,on=void 0!==tn&&tn,rn=oe.proposingFixNodeId,ln=oe.isRedlineFlow,un=oe.badgeStyleOverride,cn=oe.guidelinesData,an=oe.gptWebCitationConfig,sn=l(Xe.maintainRelativeOrder),dn=sn[0],vn=sn[1],fn=null!==(re=null==Xe?void 0:Xe.expandLevels)&&void 0!==re?re:0,pn=!!(null==Xe?void 0:Xe.expandAllSections),gn=!!dn||!!(null==Xe?void 0:Xe.showDeviationBadges),hn=l(!1),mn=hn[0],Sn=hn[1],xn=l(null),Rn=xn[0],bn=xn[1],yn=l(null===(ue=null!==(le=null==We?void 0:We.newEvaluationResult)&&void 0!==le?le:null==Xe?void 0:Xe.enableDeviationSchemaBackwardCompatibility)||void 0===ue||ue)[0],Cn=l(new Set),wn=Cn[0],Bn=Cn[1],_n=l([]),In=_n[0],Fn=_n[1],Tn=l(!1),En=Tn[0],An=Tn[1],kn=l(0),Dn=kn[0],On=kn[1],Pn=u(null),jn=u(null),Ln=u(null),Nn=u(null),Mn=u(null),Hn=u(!1),zn=u(null),Wn=u({}),qn=u([]),Gn=u(function(){}),Vn=u(null),Kn=u(function(){}),Jn=c(function(){return JSON.stringify(Ze||{})},[JSON.stringify(Ze)]),Yn=c(function(){return Ze||{}},[Jn]),Xn=c(function(){return(null==We?void 0:We.cognitive_decisioning)||{}},[We]),$n=c(function(){return e(e({},E),Ke)},[Ke]),Un=u(null),Qn=u(null),Zn=u(null),ei=u(null),ni=u(null),ii=u(null),ti=u(null),oi=u(null),ri=u(null),li=u(null),ui=z(Un),ci=ui.cognitivePopup,ai=ui.setCognitivePopup,si=ui.moreFunctions,di=ui.setMoreFunctions,vi=ui.position,fi=ui.setPosition,pi=ui.activeBadgeId,gi=ui.summaryPopup,hi=ui.setSummaryPopup,mi=ui.closeSummaryPopup,Si=ui.setActiveBadgeId,xi=ui.popupRef,Ri=ui.handleOpenCognitiveCompare,bi=ui.openCognitivePopupFromState,yi=ui.closeCognitivePopup,Ci=ui.closeMoreFunctionsPopup,wi=c(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==qe?void 0:qe.fields)&&void 0!==e?e:A,thresholds:{high:null!==(i=null===(n=null==qe?void 0:qe.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:k.thresholds.high,medium:null!==(o=null===(t=null==qe?void 0:qe.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:k.thresholds.medium,exact:null!==(l=null===(r=null==qe?void 0:qe.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:k.thresholds.exact}}},[qe]),Bi=l(null),_i=Bi[0];Bi[1];var Ii=null===(se=null===(ce=null==We?void 0:We.documents)||void 0===ce?void 0:ce[null===(ae=null==We?void 0:We.input_index_map)||void 0===ae?void 0:ae[0]])||void 0===se?void 0:se.title,Fi=null===(fe=null===(de=null==We?void 0:We.documents)||void 0===de?void 0:de[null===(ve=null==We?void 0:We.input_index_map)||void 0===ve?void 0:ve[1]])||void 0===fe?void 0:fe.title,Ti=b(Ge||Ii||"Uploaded Contract"),Ei=null===(me=null===(he=null===(pe=null==We?void 0:We.documents)||void 0===pe?void 0:pe[null===(ge=null==We?void 0:We.input_index_map)||void 0===ge?void 0:ge[0]])||void 0===he?void 0:he.metadata)||void 0===me?void 0:me.file_name,Ai=b(Ei),ki=null===(be=null===(Re=null===(Se=null==We?void 0:We.documents)||void 0===Se?void 0:Se[null===(xe=null==We?void 0:We.input_index_map)||void 0===xe?void 0:xe[1]])||void 0===Re?void 0:Re.metadata)||void 0===be?void 0:be.file_name,Di=b(ki),Oi=b(Ve||Fi||"Reference Template"),Pi=H(We,dn,Yn,wi,yn,cn),ji=Pi.isGuidelineMode,Li=Pi.activeProposed,Ni=Pi.existingRule,Mi=Pi.proposedSections,Hi=Pi.existingSections,zi=Pi.visibleFields,Wi=Pi.parentDeviationRecord,qi=Pi.deviationNumberRegistry,Gi=Pi.deviationParentRegistry,Vi=Pi.parseError;a(function(){Vi&&bn("Failed to load comparison: ".concat(Vi))},[Vi]);var Ki=Mi.length>0||Hi.length>0,Ji=c(function(){if(!ln)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";_(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(Mi),i(Hi),"".concat(e,":").concat(n)},[ln,Mi,Hi]);a(function(){if(Mi.length||Hi.length)if(pn){var e={},n={},i=function(i,t){i.forEach(function(i,o){var r,l=dn?"".concat(t,"-").concat(o):String(o);e[l]=!0;var u=function(e,i){null==e||e.forEach(function(e,t){var o,r="".concat(i,"-").concat(t);n[r]=!0,(null===(o=e.subsections)||void 0===o?void 0:o.length)&&u(e.subsections,r)})};(null===(r=i.subsections)||void 0===r?void 0:r.length)&&u(i.subsections,String(o))})};i(Mi,"left"),i(Hi,"right"),Tt(e),At(n)}else if(fn>0){var t={},o={},r=function(e,n,i){e.forEach(function(e,r){var l;if(i>=1){var u=dn?"".concat(n,"-").concat(r):String(r);t[u]=!0}var c=function(e,n,t){t>i||null==e||e.forEach(function(e,i){var r,l="".concat(n,"-").concat(i);o[l]=!0,(null===(r=e.subsections)||void 0===r?void 0:r.length)&&c(e.subsections,l,t+1)})};(null===(l=e.subsections)||void 0===l?void 0:l.length)&&i>=2&&c(e.subsections,String(r),2)})};r(Mi,"left",fn),r(Hi,"right",fn),Tt(t),At(o)}},[pn,fn,Mi,Hi,dn]);var Yi=W(zi.map(function(e){return e.key}),Math.max(Mi.length,Hi.length)),Xi=Yi.leftRefs,$i=Yi.rightRefs,Ui=Yi.sectionLeftRefs,Qi=Yi.sectionRightRefs,Zi=Yi.lhsBadgeRefs,et=Yi.rhsBadgeRefs,nt=Yi.sectionRightRowRefs,it=Yi.subSectionLeftRefs,tt=Yi.subSectionRightRefs,ot=Yi.sectionRowRefs,rt=Yi.getSectionRowRef,lt=Yi.getSubSectionRef,ut=Yi.getBadgeRef,ct=ee({isGuidelineMode:ji,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,leftContainerRef:oi,rightContainerRef:Zn,scrollContainerRef:Un,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,sectionRowRefs:ot,sectionRightRowRefs:nt,rhsTopSpacerRef:ei,rhsBottomSpacerRef:ni,lhsTopSpacerRef:ii,lhsBottomSpacerRef:ti,calculateLinesRef:Gn,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,closeMoreFunctionsPopup:Ci,setErrorToast:bn,moreFunctions:si,closeSummaryPopup:mi}),at=ct.isSideBySide,st=ct.isArrowVisible,dt=ct.setIsArrowVisible,vt=ct.isResizing,ft=ct.setIsResizing,pt=ct.isSideBySideLoading,gt=ct.activeSideBySideSection,ht=ct.scrollLock,mt=ct.sideBySideCacheRef,St=ct.isSideBySideRef,xt=ct.activeSideBySideRightSectionRef,Rt=ct.activeSideBySideSectionRef,bt=ct.sideBySideLineRef,yt=ct.highlightedClauseRefs,Ct=ct.clearClauseHighlight,wt=ct.resetSideBySide,Bt=ct.activateSideBySide,_t=u(Bt);a(function(){_t.current=Bt},[Bt]);var It=q({maintainRelativeOrder:!!dn,proposedSections:Mi,existingSections:Hi,activeSideBySideSection:gt,connectedSections:wn,resetSideBySide:wt,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,svgContainerRef:Pn,isAnimatingRef:Hn,animationTimerRef:zn,calculateLinesRef:Gn,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt}),Ft=It.expandedSections,Tt=It.setExpandedSections,Et=It.expandedSubSections,At=It.setExpandedSubSections,kt=It.handleSubSectionToggle,Dt=It.toggleSection,Ot=It.forceExpandCrossWiredSections,Pt=function(){var e,n;if(null!=gt){var i=null===(e=Ui.current[gt])||void 0===e?void 0:e.current,t=null===(n=Qi.current[gt])||void 0===n?void 0:n.current,o=Zn.current;if(i&&t&&o){var r=i.getBoundingClientRect(),l=t.getBoundingClientRect(),u=o.getBoundingClientRect(),c=r.top-u.top,a=l.top-u.top-c;o.scrollBy({top:a,behavior:"smooth"})}}},jt=s(function(e){null==e||e.stopPropagation(),An(function(e){var n=!e;return n&&requestAnimationFrame(function(){Pt()}),n})},[Pt]);a(function(){ln&&"off"!==Ji&&"0:0"!==Ji&&(mt.current=null,qn.current=[],requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)}))},[ln,Ji]);var Lt=c(function(){var e=new Map,n=new Map,i=1;if(dn)Mi.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),Hi.forEach(function(t){if(t.id&&!(!t.title&&!t.content)){var o=Mi.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(Mi.length,Hi.length),o=0;o<t;o++){var r=Mi[o],l=Hi[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[Mi,Hi,dn]),Nt=Ni.analysis,Mt=b(null===(Ce=null===(ye=null==Nt?void 0:Nt.rule_difference_comparison)||void 0===ye?void 0:ye.summary)||void 0===Ce?void 0:Ce.overall_summary),Ht=!!Mt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),zt=null!==(we=null==We?void 0:We.base_root_id)&&void 0!==we?we:"-1";null==We||We[zt];var Wt=yn?null!==(je=null!==(De=Ze&&(null===(ke=null==Ze?void 0:Ze[zt])||void 0===ke?void 0:ke.evaluation_result))&&void 0!==De?De:null===(Pe=null===(Oe=null==We?void 0:We.nodes)||void 0===Oe?void 0:Oe[zt])||void 0===Pe?void 0:Pe.evaluation_result)&&void 0!==je?je:null:null!==(Ae=null!==(Ie=Ze&&(null===(_e=null===(Be=null==Ze?void 0:Ze[zt])||void 0===Be?void 0:Be.evaluation_result)||void 0===_e?void 0:_e[0]))&&void 0!==Ie?Ie:null===(Ee=null===(Te=null===(Fe=null==We?void 0:We.nodes)||void 0===Fe?void 0:Fe[zt])||void 0===Te?void 0:Te.evaluation_result)||void 0===Ee?void 0:Ee[0])&&void 0!==Ae?Ae:null,qt=y(Wt),Gt=C(null!==(Me=null===(Ne=null===(Le=null==Wt?void 0:Wt.evaluation_outputs)||void 0===Le?void 0:Le.metadata)||void 0===Ne?void 0:Ne.label_color)&&void 0!==Me?Me:D);if(un){var Vt=un(qt);Vt&&(Gt=e(e({},Gt),{badgeBg:Vt.bg,badgeText:Vt.text,badgeBorder:Vt.border}))}var Kt=u(wt);a(function(){Kt.current=wt},[wt]);var Jt=u(yi);a(function(){Jt.current=yi},[yi]);var Yt=s(function(e,n,i,t,o,r){return nr.current(e,n,i,t,o,r)},[]),Xt=s(function(e,n,i,t,o){return tr.current(e,n,i,t,o)},[]),$t=s(function(){return or.current()},[]),Ut=s(function(e,n){return rr.current(e,n)},[]),Qt=s(function(e){return lr.current(e)},[]),Zt=s(function(e){return ur.current(e)},[]),eo=s(function(){return cr.current()},[]),no=s(function(){var e,n;Ct(),null===(e=Kt.current)||void 0===e||e.call(Kt),An(!1),Bn(new Set),Fn([]),qn.current=[],bo([]),Co(null),hi(O),null===(n=Jt.current)||void 0===n||n.call(Jt),requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)})},[]),io=u(no);a(function(){io.current=no},[no]),a(function(){Je&&io.current()},[Je]);var to=c(function(){return{documents:null==We?void 0:We.documents,input_index_map:null==We?void 0:We.input_index_map}},[JSON.stringify(null==We?void 0:We.documents),JSON.stringify(null==We?void 0:We.input_index_map)]),oo=u(We);a(function(){oo.current=We},[We]);var ro=u(Xn);a(function(){ro.current=Xn},[Xn]);var lo=s(function(n,i,t,o,r,l,u){var c,a,s,d,v,f,p,g,h,m,S=b(null==i?void 0:i.id)||b(null==t?void 0:t.id)||"",x=(S?null===(c=ro.current)||void 0===c?void 0:c[S]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:S,decisioning:[],gap:[],relevance_score:0},R=null!==(s=null===(a=ot.current[o])||void 0===a?void 0:a.current)&&void 0!==s?s:null,y=function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e(e({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(B)))return u(l);var c=o.split(B)[1];if(!c)return l;var a=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},s=(null===(n=null==a?void 0:a.deviation_entries)||void 0===n?void 0:n[c])||(null===(r=null==a?void 0:a.deviations)||void 0===r?void 0:r[c])||null;return s?e(e(e({},a),s),{deviation_summary:(null==s?void 0:s.deviation_summary)||(null==a?void 0:a.deviation_summary),deviation_title:(null==s?void 0:s.deviation_title)||(null==a?void 0:a.deviation_title),deviation_impact:(null==s?void 0:s.deviation_impact)||(null==a?void 0:a.deviation_impact),deviation_explanation:(null==s?void 0:s.deviation_explanation)||(null==a?void 0:a.deviation_explanation),evaluation_outputs:(null==s?void 0:s.evaluation_outputs)||(null==a?void 0:a.evaluation_outputs),cognitive_decisioning:(null==s?void 0:s.cognitive_decisioning)||(null==a?void 0:a.cognitive_decisioning)}):u(l)}(),C=(null!==(f=null===(v=null===(d=null==y?void 0:y.cognitive_decisioning)||void 0===d?void 0:d.decisioning_factors)||void 0===v?void 0:v.length)&&void 0!==f?f:0)>0||(null!==(h=null===(g=null===(p=null==y?void 0:y.cognitive_decisioning)||void 0===p?void 0:p.gaps_in_decision)||void 0===g?void 0:g.length)&&void 0!==h?h:0)>0,w=null!==(m=null==Xe?void 0:Xe.isLoading)&&void 0!==m&&m,_=!0;if(ji){var I=null==y?void 0:y.deviation_highlights;if(I&&"object"==typeof I)_=Object.values(I).some(function(e){return Array.isArray(e)&&e.length>0});else _=!1}return{isLoading:w&&!C,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:x,anchorEl:n,sectionAnchorEl:R,badgeStyle:l||null,sectionIdx:o,docData:to,deviationData:y,isOrphan:!!r,hasGuidelineMatches:_}},[to,null==Xe?void 0:Xe.isLoading,ji]),uo=s(function(e,n,i,t,o,r){var l;if(e.stopPropagation(),si.open&&si.sectionIdx===o)Ci();else{var u=e.currentTarget,c="left";(null===(l=Zn.current)||void 0===l?void 0:l.contains(u))&&(c="right");Ct(),St.current&&wt(),Bn(new Set),Fn([]),qn.current=[],yi(),gi.open?jo():mi(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(B)){var r=o.split(B),l="".concat(r[0]).concat(B).concat(r[1]);return"right"===c?null===(e=et.current[l])||void 0===e?void 0:e.current:null===(n=Zi.current[l])||void 0===n?void 0:n.current}return"right"===c?null===(i=et.current[o])||void 0===i?void 0:i.current:null===(t=Zi.current[o])||void 0===t?void 0:t.current}()||u;di(lo(e,n,t,o,i,r))})}},[si.open,si.sectionIdx,Ci,mi,lo]),co=s(function(){var e=si.sectionIdx;si.isOrphan,Ci(),mi(),null!==e&&(Ot(e),Ct(),St.current&&wt(),Fn([]),qn.current=[],ji&&null!==e&&On(Do(e)),Bn(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Gn.current&&Gn.current()},50))},[si.sectionIdx,si.isOrphan,Ci,mi,wt]),ao=s(function(){var e=Mn.current;if(e){Mn.current=null;var n=Mi.findIndex(function(n){return n.id===e}),i=Hi.findIndex(function(n){return n.id===e}),t=-1===n?w(Mi,e):null,o=-1===i?w(Hi,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,u;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(u=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==u?u:null},c=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(yt.current.add(r),I(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(dn)-1!==r&&oi.current&&c(function(){return u(n,t,Ui,it)},oi.current),-1!==l&&Zn.current&&c(function(){return u(i,o,Qi,tt)},Zn.current);else{var a=Un.current;if(!a)return;c(function(){return-1!==r?u(n,t,Ui,it):u(i,o,Qi,tt)},a)}}},[Mi,Hi,dn,Ui,Qi,it,tt,oi,Zn,Un]),so=s(function(n){if(n){Ct(),wt(),Bn(new Set),Fn([]),qn.current=[],mi(),yi();var i=Mi.findIndex(function(e){return e.id===n}),t=Hi.findIndex(function(e){return e.id===n}),o=-1===i?w(Mi,n):null,r=-1===t?w(Hi,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;Mn.current=n,Tt(function(n){var i,t=e({},n),o=!1;-1!==l&&(t[i=dn?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=dn?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),At(function(n){var i=e({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){Mn.current===n&&vo.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[Mi,Hi,dn,Tt,At,wt,mi,yi]),vo=u(ao);a(function(){vo.current=ao},[ao]);var fo=u(null);a(function(){if(_i){var e=wi.fields.find(function(e){return e.analysisKey===_i||e.key===_i});if(e){var n=Xi.current[e.key]||$i.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[_i,wi.fields]);var po=s(function(e){var n,i,t,o,r,l,u,c,a,s=null===(n=null==Nt?void 0:Nt.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!s||!s[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=s[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Nt]),go=U({proposedSections:Mi,existingSections:Hi,maintainRelativeOrder:dn,cognitiveMap:Xn,deviationData:Yn,treeData:We,resolvedComparisonConfig:wi,badgeStyleOverride:un}),ho=go.getSectionCompareStyle,mo=go.getSubSectionCompareStyle,So=go.getDeviationStyleByKey,xo=Z({containerRef:jn,leftContainerRef:oi,rightContainerRef:Zn,svgContainerRef:Pn,pathRefs:Wn,leftHeaderRef:Ln,rightHeaderRef:Nn,proposedSections:Mi,existingSections:Hi,visibleFields:zi,leftRefs:Xi,rightRefs:$i,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,sectionRowRefs:ot,expandedSections:Ft,expandedSubSections:Et,connectedSections:wn,isSideBySide:at,activeSideBySideSection:gt,maintainRelativeOrder:dn,isGuidelineMode:ji,cognitiveMap:Xn,getSectionCompareStyle:ho,getSubSectionCompareStyle:mo,getDeviationStyleByKey:So,isArrowVisible:st,isAnimatingRef:Hn,isSideBySideRef:St,sideBySideCacheRef:mt,sideBySideLineRef:bt,activeSideBySideSectionRef:Rt,activeSideBySideRightSectionRef:xt,connectedLines:In,setConnectedLines:Fn,cachedConnectedPositions:qn,calculateLinesRef:Gn,resizeTimerRef:Vn,scrollLock:ht,scrollSyncLocked:En,handleResizeRef:Kn,activeProposed:Li,existingRule:Ni,analysisData:Nt,pendingScrollTargetRef:ri,pendingScrollCallbackRef:li,resolvedComparisonConfig:wi,getFieldData:po}),Ro=xo.lines,bo=xo.setLines,yo=xo.overallConnector,Co=xo.setOverallConnector,wo=xo.svgDimensions,Bo=xo.handleColumnScroll;a(function(){gi.anchorEl&&requestAnimationFrame(function(){requestAnimationFrame(function(){var e;null===(e=Gn.current)||void 0===e||e.call(Gn)})})},[gi.anchorEl,En]);var _o=s(function(){Ct(),An(!1),Tt({}),At({}),wt(),Bn(new Set),Fn([]),qn.current=[],mi(),yi(),Ci(),requestAnimationFrame(function(){Gn.current&&Gn.current()})},[Tt,At,wt,mi,yi,Ci]);a(function(){at||0!==wn.size||An(!1)},[at,wn]);var Io=c(function(){return Object.values(Ft).some(Boolean)||Object.values(Et).some(Boolean)},[Ft,Et]),Fo=u(null),To=u(0),Eo=u(0),Ao=u(0),ko=Q({timerRef:Fo,ruleComponentRef:Qn,scrollContainerRef:Un,containerRef:jn,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,isSideBySideRef:St,activeSideBySideSectionRef:Rt,activeSideBySideRightSectionRef:xt,sectionRowRefs:ot,sectionRightRowRefs:nt,sectionLeftRefs:Ui,sectionRightRefs:Qi,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,leftContainerRef:oi,rightContainerRef:Zn,calculateLinesRef:Gn,handleResizeRef:Kn,setIsResizing:ft,setIsArrowVisible:dt,sideBySideCacheRef:mt,cachedConnectedPositions:qn}).handleResize;a(function(){Kn.current=ko},[ko,Kn]),a(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,u;i.current=null;var c=e[e.length-1];if(c){var a=null!==(u=null===(l=null===(r=c.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:c.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return Qn.current&&o.push(e(Qn.current,To,n,function(){return Kn.current()},function(){})),Un.current&&o.push(e(Un.current,Eo,i,function(){return Kn.current()},function(){return Gn.current()})),jn.current&&o.push(e(jn.current,Ao,t,function(){return Kn.current()},function(){return Gn.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),a(function(){St.current=at},[at]),a(function(){Rt.current=gt},[gt]);var Do=s(function(e){var n,i,t,o,r,l="",u="0";if("number"==typeof e)l=(null===(n=Mi[e])||void 0===n?void 0:n.nodeId)||(null===(i=Mi[e])||void 0===i?void 0:i.id)||"";else{var c=String(e).split(B);l=c[0],u=c[1]||"0"}var a=null===(t=null==Yn?void 0:Yn[l])||void 0===t?void 0:t.evaluation_result,s=Array.isArray(a)?a[parseInt(u,10)]:null==a?void 0:a[u];return!1===(null===(r=null===(o=null==s?void 0:s.evaluation_outputs)||void 0===o?void 0:o.guideline_flag)||void 0===r?void 0:r.rulebook_used)?1:0},[Mi,Yn]),Oo=s(function(e){var n,i,t=document.querySelectorAll('[id^="guideline-target-"], [data-web-gpt-active="true"]'),o=oi.current,r=Zn.current,l="string"==typeof e&&e.includes(B)?"".concat(e.split(B)[0]).concat(B).concat(e.split(B)[1]):e,u=(null===(n=Zi.current[l])||void 0===n?void 0:n.current)||(null===(i=Zi.current[e])||void 0===i?void 0:i.current);if(t.length>0&&u&&o&&r){var c=t[0];ii.current&&(ii.current.style.height="0px"),ei.current&&(ei.current.style.height="0px"),ti.current&&(ti.current.style.height="0px"),ni.current&&(ni.current.style.height="0px"),requestAnimationFrame(function(){var e=u.getBoundingClientRect(),n=c.getBoundingClientRect(),i=o.getBoundingClientRect(),t=r.getBoundingClientRect(),l=o.scrollTop+(e.top-i.top)+e.height/2,a=r.scrollTop+(n.top-t.top)+n.height/2,s=l-i.height/2,d=Math.max(0,s),v=o.scrollHeight-o.clientHeight,f=d>v?d-v:0,p=i.top+l-d,g=t.top+a-p,h=0;g<0&&(h=Math.abs(g),g=0);var m=r.scrollHeight-r.clientHeight+h,S=g>m?g-m:0;ti.current&&(ti.current.style.height="".concat(f,"px")),ei.current&&(ei.current.style.height="".concat(h,"px")),ni.current&&(ni.current.style.height="".concat(S,"px")),requestAnimationFrame(function(){o.scrollTo({top:d,behavior:"smooth"}),r.scrollTo({top:g,behavior:"smooth"}),Gn.current&&setTimeout(function(){return Gn.current()},50)})})}},[B]),Po=s(function(){var e,n=si.sectionIdx,i=si.isOrphan;if(mi(),null!=n){var t="left";si.anchorEl&&(null===(e=Zn.current)||void 0===e?void 0:e.contains(si.anchorEl))&&(t="right"),Ot(n),ji&&(On(Do(n)),Bn(new Set([n]))),Bt(n,i,{sourceSide:t,onReady:function(){ji&&setTimeout(function(){return Oo(String(n))},150)}})}},[Bt,si.isOrphan,si.sectionIdx,si.anchorEl,mi,Ot,ji,Oo,Do]),jo=s(function(){mi(),wt(),Bn(new Set),Fn([]),qn.current=[]},[mi,wt]),Lo=null!==si.sectionIdx&&wn.has(si.sectionIdx),No=G({proposedSections:Mi,existingSections:Hi,parentDeviationRecord:Wi,expandedSections:Ft,maintainRelativeOrder:!!dn,scrollContainerRef:Un,leftContainerRef:oi,rightContainerRef:Zn,lhsBadgeRefs:Zi,rhsBadgeRefs:et}),Mo=No.showDeviationNavigation,Ho=No.showOpenNodeRef,zo=No.adjustScrollForPopup,Wo=s(function(e,n,i,t,o){var r,l="string"==typeof t?b(t).trim():b(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;yi();var c="left";(null===(r=Zn.current)||void 0===r?void 0:r.contains(u))&&(c="right");var a=function(){var e,i,t,o;if("string"==typeof n&&n.includes(B)){var r=n.split(B),l="".concat(r[0]).concat(B).concat(r[1]);return"right"===c?null===(e=et.current[l])||void 0===e?void 0:e.current:null===(i=Zi.current[l])||void 0===i?void 0:i.current}return"right"===c?null===(t=et.current[n])||void 0===t?void 0:t.current:null===(o=Zi.current[n])||void 0===o?void 0:o.current};if(i&&!ji)return wt(),Bn(new Set),Fn([]),qn.current=[],void(l&&(Ot(n),requestAnimationFrame(function(){var e=a()||u;e&&(e.getBoundingClientRect().top>.8*window.innerHeight&&e.scrollIntoView({behavior:"smooth",block:"center"}));hi({open:!0,anchorEl:e,summary:t,displayImpact:o})})));Ot(n),ji&&(On(Do(n)),Bn(new Set([n]))),l?setTimeout(function(){Bt(n,i,{toggleIfSame:!1,sourceSide:c,onReady:function(){var e,i,r,l=a()||u;if(ji)setTimeout(function(){return Oo(n)},150);else if(l){var c=l.getBoundingClientRect();if(c.top>.8*window.innerHeight||c.top<100){var s=c.top-window.innerHeight/2;dn?(null===(e=oi.current)||void 0===e||e.scrollBy({top:s,behavior:"smooth"}),null===(i=Zn.current)||void 0===i||i.scrollBy({top:s,behavior:"smooth"})):null===(r=Un.current)||void 0===r||r.scrollBy({top:s,behavior:"smooth"})}}hi({open:!0,anchorEl:l,summary:t,displayImpact:o})}})},350):setTimeout(function(){Bt(n,i,{toggleIfSame:!1,sourceSide:c}),ji&&setTimeout(function(){return Oo(n)},150)},350)},[Bt,yi,hi,wt,Ot,ji,dn,Oo,Yn]),qo=c(function(){var e;if(!en)return null;var n=null===(e=null==en?void 0:en.id)||void 0===e?void 0:e.split(":")[0];for(var i in Wi){if((Wi[i]||[]).some(function(e){return e.id===n}))return i}return null},[en,Wi]),Go=u({id:null,triggerMs:null}),Vo=u(null);a(function(){if(null==en?void 0:en.id){var o=Number(en.trigger),r=Go.current;if((null==r?void 0:r.id)!==en.id||(null==r?void 0:r.triggerMs)!==o){if(en.id.includes(":")&&/:\d+$/.test(en.id)){var l=en.id.split(":"),u=l[0],c=l[1],a=null!=c?c:"0",s="".concat(en.id,":").concat(o);Vo.current!==s&&(mi(),yi(),wt(),Bn(new Set),Fn([]),qn.current=[],Vo.current=s);var d=!1,v=0,f=null,p=null,g=!1,h=function(e,n){for(var i=function(e,t){if(!e)return null;if(n.includes(e.id)||n.includes(e.nodeId)||n.includes(e.contentId))return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},m=function(){var r,l,c;if(!d){var s=function(){Go.current={id:en.id,triggerMs:o}},S=null,x=null;for(var R in Wi){var b=Wi[R].find(function(e){var n;return e.id===u||e.nodeId===u||e.contentId===u||(null===(n=e.evaluationResult)||void 0===n?void 0:n.nodeId)===u});if(b){S=R,x=b;break}}if(x&&S){var y=Array.from(new Set([u,x.id,x.nodeId,x.contentId,null===(r=x.evaluationResult)||void 0===r?void 0:r.nodeId].filter(Boolean))),C=Mi.findIndex(function(e){return e.id===S}),w=Hi.findIndex(function(e){return e.id===S}),_=-1===C&&-1!==w,I=h(Mi,y),E=h(Hi,y);if(I&&!E&&!_){var A=I.split("-"),k=Number(A[0]);if(dn){var D=null===(c=null===(l=Mi[k])||void 0===l?void 0:l.refIndexes)||void 0===c?void 0:c[0],O=Hi.findIndex(function(e){return e.selfIndex===D});-1!==O&&(k=O)}E=n([k],A.slice(1),!0).join("-")}if(I||E){var P=I?Number(I.split("-")[0]):C,j=E?Number(E.split("-")[0]):w,L=j>=0?j:E?Number(E.split("-")[0]):-1,N=Mi[P],M=Hi[L],H=N&&!N.title&&!N.content,z=M&&!M.title&&!M.content,W=_||(!I&&!!E||H&&!z);if(W){if(!(dn?!!ir.current["right-".concat(j)]:!!ir.current[String(j)])&&j>=0)return Dt(j,"right"),void(f=setTimeout(m,200))}else if(!(dn?!!ir.current["left-".concat(P)]:!!ir.current[String(P)])&&P>=0)return Dt(P,"left"),void(f=setTimeout(m,200));var q=I||"",G=E||"",V=y.map(function(e){return"".concat(e).concat(B).concat(a)}),K=V[0],J=function(){for(var e,n,i=0,t=V;i<t.length;i++){var o=t[i],r=(null===(e=Zi.current[o])||void 0===e?void 0:e.current)||null,l=(null===(n=et.current[o])||void 0===n?void 0:n.current)||null;if(r||l)return{refId:o,left:r,right:l}}return{refId:K,left:null,right:null}},Y=function(e){return"".concat(e).concat(B).concat(q).concat(B).concat(G)};if(!g){Ot(Y(K)),g=!0,v=0;var X=function(){var e=J(),n=e.left,i=e.right;return W||!n&&!!i?i:n};return null==p||p(),void(f=setTimeout(function(){var e,n,i,t,o,r,l,u;d||(e=X,n=function(){d||(p=null,m())},t=0,o=null,r=null,l=performance.now(),u=function(){if(!d)if(performance.now()-l>3e3)n();else{var c=e();if(c&&0!==c.getBoundingClientRect().height){var a=c.getBoundingClientRect(),s=a.top,v=a.height,f=null!==o&&Math.abs(s-o)<.5,p=null!==r&&Math.abs(v-r)<.5;if(f&&p){if(++t>=5)return void n()}else t=0;o=s,r=v,i=requestAnimationFrame(u)}else i=requestAnimationFrame(u)}},i=requestAnimationFrame(u),p=function(){return cancelAnimationFrame(i)})},300))}var $=J(),U=$.refId,Q=$.left,Z=$.right,ee=Y(U);if(Q||Z){var ne=W||!Q&&!!Z,ie=ne?Z:Q,te=dn?ne?Zn.current:oi.current:Un.current;if(ie&&te){var oe=ie.getBoundingClientRect();if(0!==oe.height){var re=te.getBoundingClientRect(),le=oe.top-re.top+te.scrollTop-re.height/2+oe.height/2,ue=(null==I?void 0:I.includes("-"))||(null==E?void 0:E.includes("-")),ce=function(){return i(void 0,void 0,void 0,function(){var n,i,o,r,l,u,c,v,f,p;return t(this,function(t){switch(t.label){case 0:return d?[2]:(s(),n=ie instanceof Element?window.getComputedStyle(ie).color:"",[Q,Z].forEach(function(e){e&&(e.style.transition="box-shadow 300ms ease-in-out",e.style.boxShadow="0 0 10px ".concat(n))}),setTimeout(function(){[Q,Z].forEach(function(e){e&&(e.style.boxShadow="")})},2e3),i=(null===(c=null===(u=x.evaluationResult)||void 0===u?void 0:u.deviations)||void 0===c?void 0:c[a])||x,o=(null===(v=x.evaluationResult)||void 0===v?void 0:v.evaluation_outputs)||x.evaluation_outputs,!!Q&&!!Z||ji?(l=function(e,n){return Promise.race([e,new Promise(function(e){return setTimeout(e,n)})])},dn?[4,Promise.all([oi.current?l(T(oi.current),600):Promise.resolve(),Zn.current?l(T(Zn.current),600):Promise.resolve()])]:[3,2]):(r=ne?(null===(f=et.current[ue?U:j])||void 0===f?void 0:f.current)||Z:(null===(p=Zi.current[ue?U:P])||void 0===p?void 0:p.current)||Q,zo(r,function(){hi({open:!0,anchorEl:r,displayImpact:en.displayImpact,summary:e(e({},i),{evaluation_outputs:o})})},{skipScroll:!0}),null==nn||nn(),[2]));case 1:t.sent(),t.label=2;case 2:return ji&&(On(Do(ee)),Bn(new Set([ee]))),_t.current(ee,!1,{toggleIfSame:!1,sourceSide:_?"right":"left",onReady:function(){var n,t,o,r;s();var l=ne?(null===(n=et.current[U])||void 0===n?void 0:n.current)||Z:(null===(t=Zi.current[U])||void 0===t?void 0:t.current)||Q;if(ji)setTimeout(function(){return Oo(ee)},150);else{var u=(null===(o=Zi.current[U])||void 0===o?void 0:o.current)||Q,c=(null===(r=et.current[U])||void 0===r?void 0:r.current)||Z;u&&(u.style.scrollMarginTop="150px",u.scrollIntoView({behavior:"smooth",block:"start"})),c&&(c.style.scrollMarginTop="150px",c.scrollIntoView({behavior:"smooth",block:"start"}))}hi({open:!0,anchorEl:l,displayImpact:en.displayImpact,summary:e({},i)}),null==nn||nn()}}),[2]}})})};Math.abs(te.scrollTop-le)<=2?ce():F(te,le,ce)}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}else++v<30&&(f=setTimeout(m,100))}};return f=setTimeout(m,100),function(){d=!0,f&&clearTimeout(f),null==p||p()}}Go.current={id:en.id,triggerMs:o},so(en.id);var S=Mi.findIndex(function(e){return e.id===en.id}),x=Hi.findIndex(function(e){return e.id===en.id});-1===S&&-1===x||setTimeout(function(){var e=-1!==S?S:x,n=-1===S;ji&&On(Do(e)),Bn(new Set([e])),_t.current(e,n,{sourceSide:n?"right":"left",onReady:function(){ji&&setTimeout(function(){return Oo(String(e))},150)}})},400)}}},[null==en?void 0:en.id,null==en?void 0:en.trigger,null==en?void 0:en.displayImpact,Wi,Mi,Hi,dn,hi,so,ji,Do,Oo]),a(function(){var n,i,t;if(gi.open){var o=gi.anchorEl;if(o&&!o.isConnected){var r=function(e){for(var n,i=0,t=Object.entries(e);i<t.length;i++){var r=t[i],l=r[0];if((null===(n=r[1].current)||void 0===n?void 0:n.textContent)===o.textContent)return l}return null},l=(null===(n=o.dataset)||void 0===n?void 0:n.deviationRefId)||r(Zi.current)||r(et.current);if(l){var u=(null===(i=et.current[l])||void 0===i?void 0:i.current)||(null===(t=Zi.current[l])||void 0===t?void 0:t.current);u&&u.isConnected&&hi(function(n){return e(e({},n),{anchorEl:u})})}}}},[gi.open,gi.anchorEl,En,wn,Ft]);var Ko=ci.open,Jo=ci.sectionIdx,Yo=ci.isOrphan,Xo=ci.badgeStyle,$o=ci.anchorEl,Uo=ci.sectionAnchorEl;a(function(){var n;if(Xe.isStreamingEnabled&&Ko&&null!=Jo&&Jo!==zt){var i="string"==typeof Jo?Jo.split(B)[0]:null,t=function(e,n){var i;if(!e||!Array.isArray(e))return null;for(var o=0,r=e;o<r.length;o++){var l=r[o];if(l.id===n)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var u=t(l.subsections,n);if(u)return u}}return null},o=i&&"string"==typeof i?t(Mi,i):null,r=i&&"string"==typeof i?t(Hi,i):null,l="number"==typeof Jo?Mi[Jo]||null:o||i&&((null===(n=null==We?void 0:We.nodes)||void 0===n?void 0:n[i])||(null==We?void 0:We[i]))||null,u="number"==typeof Jo?Hi[Jo]||null:r,c=lo($o,l,u,Jo,Yo,Xo);ai(function(n){return n.open?b(n.cognitiveData)===b(c.cognitiveData)&&b(n.deviationData)===b(c.deviationData)&&n.sectionTitle===c.sectionTitle&&n.refSectionTitle===c.refSectionTitle?n:e(e(e({},n),c),{open:!0,anchorEl:n.anchorEl,sectionAnchorEl:n.sectionAnchorEl}):n})}},[Ko,Jo,Yo,Xo,$o,Uo,Mi,Hi,lo]);var Qo=s(function(e){var n=e.section,i=e.keyPath,t=e.depth,r=void 0===t?0:t,l=e.columnKey,u=void 0===l?"left":l,c=e.parentNodeId,a=void 0===c?"":c,s=e.sectionOffset,d=e.rhsOrphanVisualIndexes;return o(K,{section:n,keyPath:i,depth:r,columnKey:u,parentNodeId:a,sectionOffset:s,rhsOrphanVisualIndexes:d})},[]),Zo=c(function(){return Mi.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&dn?null:o(J,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"left-row-".concat(n))})},[Mi]),er=c(function(){return Hi.map(function(e,n){var i,t=!(null==e?void 0:e.title)&&!(null==e?void 0:e.content),r=!(null==e?void 0:e.refIndexes)||0===e.refIndexes.length;return t&&r&&dn?null:o(Y,{section:e,idx:n},null!==(i=null==e?void 0:e.id)&&void 0!==i?i:"right-row-".concat(n))})},[Hi]),nr=u(uo);a(function(){nr.current=uo},[uo]);var ir=u(Ft);a(function(){ir.current=Ft},[Ft]);var tr=u(Wo);a(function(){tr.current=Wo},[Wo]);var or=u(jo);a(function(){or.current=jo},[jo]);var rr=u(Dt);a(function(){rr.current=Dt},[Dt]);var lr=u(kt);a(function(){lr.current=kt},[kt]);var ur=u(Qo);a(function(){ur.current=Qo},[Qo]);var cr=u(wt);a(function(){cr.current=wt},[wt]);var ar=c(function(){return{isGuidelineMode:ji,maintainRelativeOrder:!!dn,showDeviationBadges:gn,isProposingFix:on,proposingFixNodeId:rn,isRedlineFlow:ln,isSideBySide:at,activeSideBySideSection:gt,scrollSyncLocked:En,toggleScrollSyncLocked:jt,summaryPopupAnchorEl:gi.anchorEl,connectedSections:wn,proposedSections:Mi,existingSections:Hi,deviationNumberRegistry:qi,deviationParentRegistry:Gi,treeData:We,displayConfig:Xe,resolvedMarkdownStyles:$n,unifiedNumbering:Lt,expandedSections:Ft,expandedSubSections:Et,setExpandedSubSections:At,getSectionCompareStyle:ho,getSubSectionCompareStyle:mo,getBadgeRef:ut,getSectionRowRef:rt,getSubSectionRef:lt,sectionLeftRefs:Ui,sectionRightRefs:Qi,sectionRowRefs:ot,sectionRightRowRefs:nt,subSectionLeftRefs:it,subSectionRightRefs:tt,lhsBadgeRefs:Zi,rhsBadgeRefs:et,openMoreFunctionsPopup:Yt,handleOpenSummaryPopup:Xt,openSummaryPopup:Xt,handleCloseSummaryPopup:$t,toggleSection:Ut,handleSubSectionToggle:Qt,renderSubSectionAccordion:Zt,resetSideBySide:eo,setConnectedSections:Bn,setConnectedLines:Fn,cachedConnectedPositions:qn,showDeviationNavigation:Mo,showOpenNodeRef:Ho,deviationNodeIdToView:null==en?void 0:en.id,deviationTargetParentId:qo,guidelinesData:cn,gptWebCitationConfig:an}},[ji,dn,gn,on,rn,ln,at,gt,En,jt,gi.anchorEl,wn,Mi,Hi,qi,Xe,$n,Lt,Ft,Et,At,ho,mo,ut,rt,lt,Mo,Ho,en,qo,cn,an]);return o($,e({value:ar},{children:r(d,e({ref:Qn,sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"visible",position:"relative"}},{children:[mn&&o(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:o(N,{})})),gi.open&&o(X,{open:gi.open,anchorEl:gi.anchorEl,containerEl:fo.current,clipTopEl:Ln.current,scrollContainerEl:Un.current,onClose:jo,summary:gi.summary,displayImpact:gi.displayImpact,isScrollLocked:En}),o(L,{open:si.open,anchorEl:si.anchorEl,maintainRelativeOrder:!!dn,sectionTitle:si.sectionTitle,referenceSectionTitle:si.refSectionTitle,onClose:Ci,onOpenCognitiveCompare:Ri,onOpenSideBySide:Po,onConnect:co,isConnected:Lo,isOrphan:!ji&&!!si.isOrphan,isGuidelineMode:ji,hasGuidelineMatches:si.hasGuidelineMatches}),ci.open&&o(j,{open:ci.open,popupRef:xi,position:vi,popupConfig:Ue,onClose:function(){fi(null),ai(function(n){return e(e({},n),{open:!1})}),Si(null)},markdownStyles:Ke,sectionTitle:Ai,referenceSectionTitle:Di,cognitiveData:ci.cognitiveData,anchorEl:ci.anchorEl,sectionAnchorEl:ci.sectionAnchorEl,scrollContainerEl:Un.current,badgeStyle:ci.badgeStyle,docData:ci.docData,deviationData:ci.deviationData,isLoading:ci.isLoading}),o(v,e({open:!!Rn,autoHideDuration:8e3,onClose:function(){return bn(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:o(f,e({onClose:function(){return bn(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Rn}))})),o(V,{componentHeaderText:ze,displayConfig:Xe,maintainRelativeOrder:dn,onCollapseAll:_o,showCollapseAll:Io,onToggleView:function(e){Sn(!0),setTimeout(function(){vn(!e),null==$e||$e(!e),An(!1),wt(),mi(),Bn(new Set),Fn([]),qn.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){Sn(!1)},600)})})},50)}}),o(d,e({ref:Un,onScroll:Bo,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:dn?"visible":"auto",borderTop:Mt&&Ht?"none":"1.5px solid #EEF0F4"}},{children:o(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},dn?{flex:1}:{})},{children:r(d,e({ref:jn,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"100px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},dn?{flex:1,overflow:"visible"}:{})},{children:[o(ne,{svgContainerRef:Pn,svgDimensions:wo,isResizing:vt,overallConnector:yo,rootDeviationStyle:Gt,lines:Ro,isSideBySide:at,activeSideBySideSection:gt,isArrowVisible:st,maintainRelativeOrder:dn,proposedSections:Mi,existingSections:Hi,cognitivePopup:ci,activeBadgeId:pi,closeCognitivePopup:yi,setActiveBadgeId:Si,openCognitivePopupFromState:bi,buildSectionPopupState:lo,connectedLines:In,isGuidelineMode:ji,pathRefs:Wn}),r(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},dn?{flex:1,overflow:"visible"}:{})},{children:[o(d,e({ref:Ln,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:o(p,e({title:Ti,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Ti}))}))})),r(d,e({ref:oi,onScroll:Bo,sx:e({p:"12px",display:"flex",flexDirection:"column"},dn?{maxHeight:"calc(100vh - 250px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-180px",pr:"192px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[o("div",{ref:ii,style:{width:"100%",height:"0px",flexShrink:0}}),Ki&&Zo,o("div",{ref:ti,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),o(d,e({ref:fo,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:o(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:r(d,e({onClick:function(n){n.stopPropagation(),ci.open&&pi===zt?yi():(Si(zt),bi(lo(n.currentTarget,{title:"",content:"",evaluationResult:Wt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,zt,!0,e(e({},Gt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Gt.badgeBg,color:Gt.badgeText,border:"1px solid ".concat(Gt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=qt?qt:o(M,{}),o(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:o(x,{})})),o(S,{size:11,style:{transform:ci.open&&pi===zt?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),r(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},dn?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[pt&&o(R,{sections:11}),o(d,e({ref:Nn,sx:e({p:"8px",bgcolor:ji?"#F1F3F5":"#F7F8FA",borderBottom:"1px solid #D7DCE2",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center"},dn?e({maxHeight:"calc(100vh - 250px)",overflowY:"auto",overflowX:"hidden",minHeight:0},ji?{"&::-webkit-scrollbar":{width:"6px",display:"block"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"#94A3B8"},scrollbarWidth:"thin",scrollbarColor:"#CBD5E1 transparent"}:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}):{})},{children:ji?r(h,e({value:Dn,onChange:function(e,n){return On(n)},variant:"fullWidth",TabIndicatorProps:{sx:{display:"none"}},sx:{width:"100%",minHeight:"36px","& .MuiTab-root":{minHeight:"36px",px:1,py:0,borderRadius:"8px",fontSize:"14px",lineHeight:1,fontWeight:500,textTransform:"none",color:"#374151",minWidth:0,transition:"background-color 160ms ease, box-shadow 160ms ease"},"& .Mui-selected":{color:"#374151",bgcolor:"#FFFFFF"}}},{children:[o(m,{label:o(p,e({title:Oi,placement:"top"},{children:o(d,e({component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",width:"100%"}},{children:"Redline Guidelines"}))}))}),o(m,{label:o(p,e({title:"Web & GPT Sources",placement:"top"},{children:o(d,e({component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",width:"100%"}},{children:"Web & GPT Sources"}))}))})]})):o(p,e({title:Oi,placement:"top"},{children:o(g,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Oi}))}))})),r(d,e({ref:Zn,onScroll:Bo,sx:e({p:ji?"0px":"12px",display:"flex",flexDirection:"column"},dn?e(e({maxHeight:"calc(100vh - 250px)"},!ji&&{flex:1}),{overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}):{})},{children:[o("div",{ref:ei,style:{width:"100%",height:"0px",flexShrink:0}}),ji?o(0===Dn?ie:te,{guidelinesData:cn,deviationData:Ze,connectedSections:wn,proposedSections:Mi}):Ki&&er,o("div",{ref:ni,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};export{oe as default};
2
2
  //# sourceMappingURL=CognitiveCompare.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import{createContext as n,useState as t,useMemo as i,useCallback as o,useContext as r}from"react";import{RefProvider as s}from"../../store/ref.context.js";var a;!function(e){e.WAITING="waiting",e.IN_PROGRESS="in_progress",e.GENERATED="generated",e.FAILED="failed",e.GENERATE="generate",e.APPROVED="approved"}(a||(a={}));const c=n(null),g=({children:n,userStory:r,setUserStory:a,aiReasoning:g,setAiReasoning:u,citations:d,setCitations:l,apiCachingConfig:f,customStyles:C,customIcons:m,searchQueryList:h,searchQueryReasoningIdList:p,citationConfig:R,chatHistory:I,chatCitationConfigs:S,gptCitationConfigs:y,diffEditConfig:E,aiReasoningAccordionOpenStates:A,persistedDataFiles:v,inlineUpdateComponentConfig:D,segmentComponentConfig:x,onEditBlocked:N,inlineManualComponentConfig:P,redlineConfig:L,sectionStatusConfig:_,customSectionConfig:w,updateRedlineDataParent:F})=>{const[G,H]=t(0),[O,Q]=t(""),U=i(()=>{if(0===r.length||0===g.length)return Array(r.length).fill(0);const e=Array.from({length:r.length},()=>[]);return g.forEach(n=>{const t=Number(n.relevance_score);if(isNaN(t)||t<=0)return;const i=`ai_reasoning$${n.id}`,o=r.findIndex(e=>{var n;return e.value.includes(i)||(null===(n=e.sub_features)||void 0===n?void 0:n.some(e=>e.value.includes(i)))});-1!==o&&e[o].push(t)}),e.map(e=>0===e.length?0:Math.round(e.reduce((e,n)=>e+n,0)/e.length))},[r,g]),b=o(e=>{var n;const t=r.findIndex(n=>n.artifactId===e);return-1===t?0:null!==(n=U[t])&&void 0!==n?n:0},[r,U]);return e(c.Provider,{value:{chatHistory:I,userStory:r,setUserStory:a,aiReasoning:g,setAiReasoning:u,citations:d,setCitations:l,apiCachingConfig:f,customStyles:C,customIcons:m,searchQueryList:h,searchQueryReasoningIdList:p,citationConfig:R,getAvgScoreForStory:b,chatCitationConfigs:S,gptCitationConfigs:y,diffEditConfig:E,aiReasoningAccordionOpenStates:A,persistedDataFiles:v,currentHighlightIndex:G,setCurrentHighlightIndex:H,inlineUpdateComponentConfig:D,segmentComponentConfig:x,onEditBlocked:N,inlineManualComponentConfig:P,redlineConfig:L,redlineDcoumentId:O,setRedlineDocumentId:Q,sectionStatusConfig:_,customSectionConfig:w,updateRedlineDataParent:F},children:e(s,{children:n})})},u=()=>{const e=r(c);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};export{a as SectionStatus,g as default,u as useRequirementAI};
1
+ import{jsxs as e,jsx as n}from"react/jsx-runtime";import{createContext as t,useState as i,useMemo as o,useCallback as r,useContext as s}from"react";import{RefProvider as a}from"../../store/ref.context.js";import"../UserStoryCard/cws/CwsEvent.js";import l from"../UserStoryCard/cws/CwsEventProvider.js";import{Toaster as d}from"react-hot-toast";var c;!function(e){e.WAITING="waiting",e.IN_PROGRESS="in_progress",e.GENERATED="generated",e.FAILED="failed",e.GENERATE="generate",e.APPROVED="approved"}(c||(c={}));const u=t(null),g="user-story-lib",f=({children:t,userStory:s,setUserStory:c,aiReasoning:f,setAiReasoning:C,citations:m,setCitations:p,apiCachingConfig:h,customStyles:v,customIcons:I,searchQueryList:y,searchQueryReasoningIdList:R,citationConfig:S,chatHistory:E,chatCitationConfigs:A,gptCitationConfigs:w,diffEditConfig:D,aiReasoningAccordionOpenStates:b,persistedDataFiles:U,inlineUpdateComponentConfig:x,segmentComponentConfig:N,onEditBlocked:P,inlineManualComponentConfig:F,redlineConfig:L,sectionStatusConfig:T,customSectionConfig:_,updateRedlineDataParent:j,redlineCollaborativeConfig:k})=>{const[G,H]=i(0),[O,Q]=i(""),B=o(()=>{if(0===s.length||0===f.length)return Array(s.length).fill(0);const e=Array.from({length:s.length},()=>[]);return f.forEach(n=>{const t=Number(n.relevance_score);if(isNaN(t)||t<=0)return;const i=`ai_reasoning$${n.id}`,o=s.findIndex(e=>{var n;return e.value.includes(i)||(null===(n=e.sub_features)||void 0===n?void 0:n.some(e=>e.value.includes(i)))});-1!==o&&e[o].push(t)}),e.map(e=>0===e.length?0:Math.round(e.reduce((e,n)=>e+n,0)/e.length))},[s,f]),M=r(e=>{var n;const t=s.findIndex(n=>n.artifactId===e);return-1===t?0:null!==(n=B[t])&&void 0!==n?n:0},[s,B]);return e(u.Provider,{value:{chatHistory:E,userStory:s,setUserStory:c,aiReasoning:f,setAiReasoning:C,citations:m,setCitations:p,apiCachingConfig:h,customStyles:v,customIcons:I,searchQueryList:y,searchQueryReasoningIdList:R,citationConfig:S,getAvgScoreForStory:M,chatCitationConfigs:A,gptCitationConfigs:w,diffEditConfig:D,aiReasoningAccordionOpenStates:b,persistedDataFiles:U,currentHighlightIndex:G,setCurrentHighlightIndex:H,inlineUpdateComponentConfig:x,segmentComponentConfig:N,onEditBlocked:P,inlineManualComponentConfig:F,redlineConfig:L,redlineDcoumentId:O,setRedlineDocumentId:Q,sectionStatusConfig:T,customSectionConfig:_,updateRedlineDataParent:j,redlineCollaborativeConfig:k},children:[n(d,{position:"top-right",toasterId:g}),(null==k?void 0:k.initiateCollaborativeFlow)?n(l,{applicationId:null==k?void 0:k.modeId,baseUrl:null==k?void 0:k.cwsBaseUrl,authToken:null==k?void 0:k.authToken,children:n(a,{children:t})}):n(a,{children:t})]})},C=()=>{const e=s(u);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};export{c as SectionStatus,g as ToasterId,f as default,C as useRequirementAI};
2
2
  //# sourceMappingURL=RequirementAIWrapper.js.map