@viswa-test/test-citation 0.0.230 → 0.0.232

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 (73) hide show
  1. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
  2. package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +2 -0
  3. package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js.map +1 -0
  4. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  5. package/dist/cjs/features/CognitiveCompare/components/connectedLines.js +1 -1
  6. package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  7. package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  8. package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
  9. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
  10. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
  11. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/Editor.js +1 -1
  12. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js +1 -1
  13. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js +1 -1
  14. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/theme/theme.css.js +1 -1
  15. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  16. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  17. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  18. package/dist/cjs/features/RequirementAI/utils/helpers.js +1 -1
  19. package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
  20. package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +2 -0
  21. package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js.map +1 -0
  22. package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  23. package/dist/features/CognitiveCompare/components/connectedLines.js +1 -1
  24. package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  25. package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  26. package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
  27. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
  28. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
  29. package/dist/features/RequirementAI/components/RichTextEditor/Editor/Editor.js +1 -1
  30. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js +1 -1
  31. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js +1 -1
  32. package/dist/features/RequirementAI/components/RichTextEditor/Editor/theme/theme.css.js +1 -1
  33. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  34. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  35. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  36. package/dist/features/RequirementAI/utils/helpers.js +1 -1
  37. package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
  38. package/dist/types/src/RedlineApprovalCardTest.d.ts +1 -0
  39. package/dist/types/src/RedlineApprovalCardTest.d.ts.map +1 -0
  40. package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
  41. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
  42. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
  43. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +5 -0
  44. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
  45. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +1 -0
  46. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
  47. package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts +3 -0
  48. package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts.map +1 -0
  49. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +3379 -0
  50. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -0
  51. package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
  52. package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts.map +1 -1
  53. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +2 -1
  54. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
  55. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts +1 -1
  56. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
  57. package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts +1 -1
  58. package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
  59. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/Editor.d.ts.map +1 -1
  60. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.d.ts +2 -6
  61. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.d.ts.map +1 -1
  62. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.d.ts +2 -6
  63. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.d.ts.map +1 -1
  64. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +6 -12
  65. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  66. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +2 -1
  67. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  68. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +0 -4
  69. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  70. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
  71. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +0 -1
  72. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
  73. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GptWebCitationMarkdown.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"),i=require("@lexical/react/LexicalComposer"),n=require("@lexical/react/LexicalHistoryPlugin"),r=require("@lexical/react/LexicalOnChangePlugin"),l=require("@lexical/react/LexicalTabIndentationPlugin"),o=require("@lexical/list"),a=require("@lexical/react/LexicalListPlugin"),u=require("@lexical/react/LexicalLinkPlugin"),s=require("@lexical/link"),d=require("@lexical/rich-text"),c=require("@lexical/react/LexicalTablePlugin"),g=require("@lexical/table"),p=require("lexical");require("./components/EditorToolbar/components/ToolbarButton/ToolbarButton.css.js");var x=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("./components/EditorContainer/EditorContainer.js"),m=require("./components/EditorToolbar/EditorToolbar.js"),h=require("./plugins/LayoutPlugin.js"),C=require("./theme/theme.js");require("./theme/theme.css.js"),require("./Editor.css.js");var N=require("./components/Context/ContextMenu.js"),q=require("@lexical/mark"),j=require("./plugins/CommentPlugin/HTMLNode.js"),v=require("./constants/editorConfig.js"),T=require("./plugins/InitialHtml.js"),S=require("./plugins/InsertNode.js"),y=require("./plugins/DeleteNode.js"),b=require("./plugins/HighlightNode.js"),P=require("@lexical/react/LexicalComposerContext"),L=require("./plugins/UpdateNode.js"),I=require("./plugins/ManualNode.js"),E=require("./plugins/PreservedNode.js"),R=require("./plugins/InvisibleNode.js");function _(e){console.log(e)}function B({onEditBlocked:e}){const[i]=P.useLexicalComposerContext();return t.useEffect(()=>{const t=e=>{let t=e;for(;t;){if(["preserved","insert","delete"].includes(t.getType()))return t;if(["update","manual"].includes(t.getType())&&t.getStatus()&&"pending"===t.getStatus())return t;t=t.getParent()}return!1};function n(e){let t=e.getParent();for(;t;){if(t instanceof L.UpdateNode||t instanceof I.ManualNode)return t.getId();t=t.getParent()}return null}return i.registerCommand(p.KEY_DOWN_COMMAND,i=>{const r=p.$getSelection();if(!p.$isRangeSelection(r))return!1;const l=r.getNodes().find(e=>!!t(e));if(l)return i.preventDefault(),null==e||e(n(l)||""),!0;if(r.isCollapsed()){const l=r.anchor.getNode(),o=t(l);if(o){const t=o?n(o):"";return null==e||e(t||""),i.preventDefault(),!0}if("Backspace"===i.key){const t=l.getPreviousSibling(),o=t&&(["delete","insert","preserved"].includes(t.getType())||["update","manual"].includes(t.getType())&&t.getStatus()&&"pending"===t.getStatus())?t:null;if(0===r.anchor.offset&&o)return null==e||e(n(o)||""),i.preventDefault(),!0}else if("Delete"===i.key){const t=l.getNextSibling(),o=t&&(["delete","insert","preserved"].includes(t.getType())||["update","manual"].includes(t.getType())&&t.getStatus()&&"pending"===t.getStatus())?t:null,a=l.getTextContent().length;if(r.anchor.offset===a&&o)return null==e||e(n(o)||""),i.preventDefault(),!0}}return!1},p.COMMAND_PRIORITY_CRITICAL)},[i]),null}exports.default=function({minHeight:P,height:M,placeholder:k,onFocus:H,onBlur:D,onChange:O,onToolbarButtonClick:A,toolbarConfig:w=v.DEFAULT_TOOLBAR_CONFIG,editorRef:$,editorState:F,initialString:U,customToolbar:W,plugins:Y,nodes:V,dynamicHeight:G,artifactContext:K,commentsPanelState:Q,mode:X,doNotShowBorderInViewMode:z,onEditBlocked:J}){var Z,ee,te;const ie=t.useRef(null),ne={namespace:"MyEditor",theme:C.default,onError:_,nodes:[p.TextNode,o.ListNode,o.ListItemNode,s.LinkNode,d.QuoteNode,d.HeadingNode,g.TableNode,g.TableRowNode,g.TableCellNode,q.MarkNode,j.default,S.InsertNode,y.DeleteNode,L.UpdateNode,E.PreservedNode,I.ManualNode,R.InvisibleNode,b.HighlightSpanNode,b.HighlightButtonNode],editorState:F},[re,le]=t.useState(null),[oe,ae]=t.useState(!1),{customStyles:ue}=x.useRequirementAI(),se=e=>{var t;null===(t=$.current)||void 0===t||t.update(()=>{const t=p.$getSelection();p.$isRangeSelection(t)&&t.getNodes().forEach(t=>{p.$isTextNode(t)&&t.setStyle(`color: ${e}`)})})};return document.getElementById("lexical_editor_wrapper"),e.jsxs(e.Fragment,{children:[(null===(Z=null==ue?void 0:ue.textEditorStyles)||void 0===Z?void 0:Z.themeStyles)&&e.jsx("style",{children:null===(ee=null==ue?void 0:ue.textEditorStyles)||void 0===ee?void 0:ee.themeStyles}),e.jsxs("div",{ref:ie,className:"w-full lexical_editor_wrapper "+(z&&"readOnly"===X?"":"lexical_editor_wrapper_box"),id:"lexical_editor_wrapper",onContextMenu:e=>{var t;e.preventDefault(),null===(t=$.current)||void 0===t||t.update(()=>{const t=p.$getSelection();p.$isRangeSelection(t)&&!t.isCollapsed()?(ae(!0),le({x:e.clientX,y:e.clientY})):(ae(!1),le(null))})},style:{minHeight:P,height:M,...null===(te=null==ue?void 0:ue.textEditorStyles)||void 0===te?void 0:te.textArea},children:[e.jsxs(i.LexicalComposer,{initialConfig:ne,children:[" ","edit"===X&&e.jsx(B,{onEditBlocked:J}),"edit"===X&&e.jsx(m.default,{onToolbarButtonClick:A,editorWrapperRef:ie,toolbarConfig:w,customToolbar:W,editorRef:$}),e.jsx(f.default,{placeholder:k}),e.jsx(l.TabIndentationPlugin,{}),e.jsx(n.HistoryPlugin,{}),e.jsx(a.ListPlugin,{}),e.jsx(u.LinkPlugin,{}),e.jsx(c.TablePlugin,{}),e.jsx(h.LayoutPlugin,{onFocus:H,onBlur:D,editorRef:$}),e.jsx(r.OnChangePlugin,{ignoreSelectionChange:!0,ignoreHistoryMergeTagChange:!0,onChange:(e,t,i)=>{O&&O(e,t,i)}}),U&&e.jsx(T.InitialHtml,{initialValue:U.value,initialFormat:U.type,mode:X}),Y&&Y]}),re&&oe&&"edit"===X&&e.jsx(N.default,{position:re,options:[{label:"Change Color to Red",action:()=>se("red")},{label:"Change Color to Blue",action:()=>se("blue")}],onClose:()=>{le(null)}})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("@lexical/react/LexicalComposer"),r=require("@lexical/react/LexicalHistoryPlugin"),l=require("@lexical/react/LexicalOnChangePlugin"),n=require("@lexical/react/LexicalTabIndentationPlugin"),o=require("@lexical/list"),a=require("@lexical/react/LexicalListPlugin"),u=require("@lexical/react/LexicalLinkPlugin"),s=require("@lexical/link"),d=require("@lexical/rich-text"),c=require("@lexical/react/LexicalTablePlugin"),g=require("@lexical/table"),p=require("lexical");require("./components/EditorToolbar/components/ToolbarButton/ToolbarButton.css.js");var x=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("./components/EditorContainer/EditorContainer.js"),m=require("./components/EditorToolbar/EditorToolbar.js"),h=require("./plugins/LayoutPlugin.js"),C=require("./theme/theme.js");require("./theme/theme.css.js"),require("./Editor.css.js");var N=require("./components/Context/ContextMenu.js"),q=require("@lexical/mark"),v=require("./plugins/CommentPlugin/HTMLNode.js"),j=require("./constants/editorConfig.js"),b=require("./plugins/InitialHtml.js"),y=require("./plugins/InsertNode.js"),T=require("./plugins/DeleteNode.js"),L=require("./plugins/HighlightNode.js"),P=require("@lexical/react/LexicalComposerContext"),S=require("./plugins/UpdateNode.js"),E=require("./plugins/ManualNode.js"),I=require("./plugins/PreservedNode.js"),_=require("./plugins/InvisibleNode.js");function k(e){console.log(e)}function R({onEditBlocked:e}){const[i]=P.useLexicalComposerContext();return t.useEffect(()=>{const t=e=>{let t=e;for(;t;){if(["preserved","insert","delete"].includes(t.getType()))return t;t=t.getParent()}return!1};function r(e){let t=e.getParent();for(;t;){if(t instanceof S.UpdateNode||t instanceof E.ManualNode)return t.__id;t=t.getParent()}return null}return i.registerCommand(p.KEY_DOWN_COMMAND,i=>{var l;if("Backspace"!==i.key&&"Delete"!==i.key)return!1;const n=p.$getSelection();if(!p.$isRangeSelection(n))return!1;const o=n.getNodes().find(e=>!!t(e));if(o)return i.preventDefault(),null==e||e(r(o)||""),!0;if(n.isCollapsed()){const o=n.anchor.getNode(),a=n.focus.getNode(),u=t(o),s=t(a);if(u||s){const t=u?r(u):s?r(s):"";return null==e||e(t||""),i.preventDefault(),!0}if("Backspace"===i.key){const a=o.getPreviousSibling(),u=null===(l=null==a?void 0:a.getLastDescendant)||void 0===l?void 0:l.call(a),s=a&&["delete","insert","preserved"].includes(a.getType())?a:u&&t(u)?u:null;if(0===n.anchor.offset&&s)return null==e||e(r(s)||""),i.preventDefault(),!0}else if("Delete"===i.key){const l=o.getNextSibling(),a=null==l?void 0:l.getFirstDescendant(),u=l&&["delete","insert","preserved"].includes(l.getType())?l:a&&t(a)?a:null,s=o.getTextContent().length;if(n.anchor.offset===s&&u)return null==e||e(r(u)||""),i.preventDefault(),!0}}return!1},p.COMMAND_PRIORITY_CRITICAL)},[i]),null}exports.default=function({minHeight:P,height:B,placeholder:D,onFocus:M,onBlur:H,onChange:O,onToolbarButtonClick:A,toolbarConfig:w=j.DEFAULT_TOOLBAR_CONFIG,editorRef:$,editorState:F,initialString:U,customToolbar:W,plugins:Y,nodes:V,dynamicHeight:G,artifactContext:K,commentsPanelState:Q,mode:X,doNotShowBorderInViewMode:z,onEditBlocked:J}){var Z,ee,te;const ie=t.useRef(null),re={namespace:"MyEditor",theme:C.default,onError:k,nodes:[p.TextNode,o.ListNode,o.ListItemNode,s.LinkNode,d.QuoteNode,d.HeadingNode,g.TableNode,g.TableRowNode,g.TableCellNode,q.MarkNode,v.default,y.InsertNode,T.DeleteNode,S.UpdateNode,I.PreservedNode,E.ManualNode,_.InvisibleNode,L.HighlightSpanNode,L.HighlightButtonNode],editorState:F},[le,ne]=t.useState(null),[oe,ae]=t.useState(!1),{customStyles:ue}=x.useRequirementAI(),se=e=>{var t;null===(t=$.current)||void 0===t||t.update(()=>{const t=p.$getSelection();p.$isRangeSelection(t)&&t.getNodes().forEach(t=>{p.$isTextNode(t)&&t.setStyle(`color: ${e}`)})})};return document.getElementById("lexical_editor_wrapper"),e.jsxs(e.Fragment,{children:[(null===(Z=null==ue?void 0:ue.textEditorStyles)||void 0===Z?void 0:Z.themeStyles)&&e.jsx("style",{children:null===(ee=null==ue?void 0:ue.textEditorStyles)||void 0===ee?void 0:ee.themeStyles}),e.jsxs("div",{ref:ie,className:"w-full lexical_editor_wrapper "+(z&&"readOnly"===X?"":"lexical_editor_wrapper_box"),id:"lexical_editor_wrapper",onContextMenu:e=>{var t;e.preventDefault(),null===(t=$.current)||void 0===t||t.update(()=>{const t=p.$getSelection();p.$isRangeSelection(t)&&!t.isCollapsed()?(ae(!0),ne({x:e.clientX,y:e.clientY})):(ae(!1),ne(null))})},style:{minHeight:P,height:B,...null===(te=null==ue?void 0:ue.textEditorStyles)||void 0===te?void 0:te.textArea},children:[e.jsxs(i.LexicalComposer,{initialConfig:re,children:[" ","edit"===X&&e.jsx(R,{onEditBlocked:J}),"edit"===X&&e.jsx(m.default,{onToolbarButtonClick:A,editorWrapperRef:ie,toolbarConfig:w,customToolbar:W,editorRef:$}),e.jsx(f.default,{placeholder:D}),e.jsx(n.TabIndentationPlugin,{}),e.jsx(r.HistoryPlugin,{}),e.jsx(a.ListPlugin,{}),e.jsx(u.LinkPlugin,{}),e.jsx(c.TablePlugin,{}),e.jsx(h.LayoutPlugin,{onFocus:M,onBlur:H,editorRef:$}),e.jsx(l.OnChangePlugin,{ignoreSelectionChange:!0,ignoreHistoryMergeTagChange:!0,onChange:(e,t,i)=>{O&&O(e,t,i)}}),U&&e.jsx(b.InitialHtml,{initialValue:U.value,initialFormat:U.type,mode:X}),Y&&Y]}),le&&oe&&"edit"===X&&e.jsx(N.default,{position:le,options:[{label:"Change Color to Red",action:()=>se("red")},{label:"Change Color to Blue",action:()=>se("blue")}],onClose:()=>{ne(null)}})]})]})};
2
2
  //# sourceMappingURL=Editor.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lexical");class e extends t.ElementNode{static getType(){return"manual"}static clone(t){return new e(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),e="",s){super(s),this.__id=t,this.__status=e}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("manual");return t.id=this.__id,t.className=`PlaygroundEditorTheme__manual-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("manual");return t.id=this.__id,{element:t}}updateDOM(t,e){return t.__id!==this.__id&&(e.id=this.__id),t.__status!==this.__status&&(this.__status?e.dataset.status=this.__status:delete e.dataset.status,e.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{manual:()=>({conversion:s,priority:1})}}static importJSON(t){var s;return new e(t.id,null!==(s=t.status)&&void 0!==s?s:"")}exportJSON(){return{...super.exportJSON(),type:"manual",version:1,id:this.__id,status:this.__status}}isInline(){return!0}}function s(t){var s;return{node:new e(t.id||crypto.randomUUID(),null!==(s=t.dataset.status)&&void 0!==s?s:"")}}exports.ManualNode=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lexical");class t extends e.ElementNode{static getType(){return"manual"}static clone(e){return new t(e.__id,e.__key)}constructor(e=crypto.randomUUID(),t){super(t),this.__id=e}createDOM(){const e=document.createElement("manual");return e.id=this.__id,e.className="PlaygroundEditorTheme__manual-node",e}exportDOM(){const e=document.createElement("manual");return e.id=this.__id,{element:e}}updateDOM(e,t){return e.__id!==this.__id&&(t.id=this.__id),!1}static importDOM(){return{manual:()=>({conversion:r,priority:1})}}static importJSON(e){const r=new t(e.id);return r.setFormat(e.format),r.setIndent(e.indent),r.setDirection(e.direction),r}exportJSON(){return{...super.exportJSON(),type:"manual",version:1,id:this.__id}}isInline(){return!0}getId(){return this.__id}}function r(e){const r=e.id||crypto.randomUUID();return{node:new t(r)}}exports.ManualNode=t;
2
2
  //# sourceMappingURL=ManualNode.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lexical");class e extends t.ElementNode{static getType(){return"update"}static clone(t){return new e(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),e="",s){super(s),this.__id=t,this.__status=e}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("upt");return t.id=this.__id,t.className=`PlaygroundEditorTheme__update-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("upt");return t.id=this.__id,{element:t}}updateDOM(t,e){return t.__id!==this.__id&&(e.id=this.__id),t.__status!==this.__status&&(this.__status?e.dataset.status=this.__status:delete e.dataset.status,e.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{upt:()=>({conversion:s,priority:1})}}static importJSON(t){var s;return new e(t.id,null!==(s=t.status)&&void 0!==s?s:"")}exportJSON(){return{...super.exportJSON(),type:"update",version:1,id:this.__id,status:this.__status}}isInline(){return!0}}function s(t){var s;return{node:new e(t.id||crypto.randomUUID(),null!==(s=t.dataset.status)&&void 0!==s?s:"")}}exports.UpdateNode=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lexical");class t extends e.ElementNode{static getType(){return"update"}static clone(e){return new t(e.__id,e.__key)}constructor(e=crypto.randomUUID(),t){super(t),this.__id=e}createDOM(){const e=document.createElement("upt");return e.id=this.__id,e.className="PlaygroundEditorTheme__update-node",e}exportDOM(){const e=document.createElement("upt");return e.id=this.__id,{element:e}}updateDOM(e,t){return e.__id!==this.__id&&(t.id=this.__id),!1}static importDOM(){return{upt:()=>({conversion:r,priority:1})}}static importJSON(e){const r=new t(e.id);return r.setFormat(e.format),r.setIndent(e.indent),r.setDirection(e.direction),r}exportJSON(){return{...super.exportJSON(),type:"update",version:1,id:this.__id}}isInline(){return!0}getId(){return this.__id}}function r(e){const r=e.id||crypto.randomUUID();return{node:new t(r)}}exports.UpdateNode=t;
2
2
  //# sourceMappingURL=UpdateNode.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e='.PlaygroundEditorTheme__ltr{text-align:left}.PlaygroundEditorTheme__rtl{text-align:right}.PlaygroundEditorTheme__paragraph{font-family:Inter,sans-serif;line-height:28px;margin:0 0 8px;position:relative}.PlaygroundEditorTheme__paragraph:last-child{margin-bottom:0}.PlaygroundEditorTheme__quote{border-left:4px solid #ced0d4;color:#65676b;font-size:15px;margin:0 0 10px 20px;padding-left:16px}.PlaygroundEditorTheme__h1{font-family:Inter,sans-serif;font-size:24px;margin:12px 0 4px;padding:0}.PlaygroundEditorTheme__h2{font-size:20px}.PlaygroundEditorTheme__h2,.PlaygroundEditorTheme__h3{font-family:Inter,sans-serif;margin:10px 0 0;padding:0}.PlaygroundEditorTheme__h3{font-size:18px;text-transform:uppercase}.PlaygroundEditorTheme__textBold{font-family:Inter,sans-serif;font-weight:700}.PlaygroundEditorTheme__textItalic{font-style:italic}.PlaygroundEditorTheme__textUnderline{text-decoration:underline}.PlaygroundEditorTheme__textStrikethrough{text-decoration:line-through}.PlaygroundEditorTheme__textUnderlineStrikethrough{text-decoration:underline line-through}.PlaygroundEditorTheme__textSubscript{font-size:.8em;vertical-align:sub!important}.PlaygroundEditorTheme__textSuperscript{font-size:.8em;vertical-align:super}.PlaygroundEditorTheme__textCode{background-color:#f0f2f5;font-family:Menlo,Consolas,Monaco,monospace;font-size:94%;padding:1px .25rem}.PlaygroundEditorTheme__hashtag{background-color:#5890ff26;border-bottom:1px solid #5890ff4d}.PlaygroundEditorTheme__link{color:#216fdb;text-decoration:none}.PlaygroundEditorTheme__link:hover{text-decoration:underline}.PlaygroundEditorTheme__code{background-color:#f0f2f5;display:block;font-family:Menlo,Consolas,Monaco,monospace;font-size:13px;line-height:1.53;margin:8px 0;overflow-x:auto;padding:8px 8px 8px 52px;position:relative;tab-size:2}.PlaygroundEditorTheme__code:before{background-color:#eee;border-right:1px solid #ccc;color:#777;content:attr(data-gutter);left:0;min-width:25px;padding:8px;position:absolute;text-align:right;top:0;white-space:pre-wrap}.PlaygroundEditorTheme__code:after{color:#00000080;content:attr(data-highlight-language);font-size:10px;padding:3px;position:absolute;right:3px;text-transform:uppercase;top:0}.PlaygroundEditorTheme__table{border-collapse:collapse;border-spacing:0;max-width:100%;overflow-y:scroll;table-layout:fixed;width:100%}.PlaygroundEditorTheme__tableCell{border:1px solid #000;min-width:75px;padding:6px 8px;text-align:start;vertical-align:top}.PlaygroundEditorTheme__tableCellHeader{background-color:#f2f3f5;text-align:start}.PlaygroundEditorTheme__characterLimit{background-color:#fbb!important;display:inline}.PlaygroundEditorTheme__ul{list-style-type:disc}.PlaygroundEditorTheme__ol1,.PlaygroundEditorTheme__ul{list-style-position:outside;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol1{list-style-type:decimal}.PlaygroundEditorTheme__ol2{list-style-position:outside;list-style-type:upper-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol3{list-style-position:outside;list-style-type:lower-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol4{list-style-position:outside;list-style-type:upper-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol5{list-style-position:outside;list-style-type:lower-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__listItem{display:list-item;margin:8px 24px 8px 8px;padding:0 8px}.PlaygroundEditorTheme__nestedListItem{list-style-type:inherit;margin-left:16px}ol .PlaygroundEditorTheme__nestedListItem{list-style-type:none}.PlaygroundEditorTheme__listItemChecked,.PlaygroundEditorTheme__listItemUnchecked{list-style-type:none;margin-left:8px;margin-right:8px;outline:none;padding-left:24px;padding-right:24px;position:relative}.PlaygroundEditorTheme__listItemChecked{text-decoration:line-through}.PlaygroundEditorTheme__listItemChecked:before,.PlaygroundEditorTheme__listItemUnchecked:before{background-size:cover;content:"";cursor:pointer;display:block;height:16px;left:0;position:absolute;top:2px;width:16px}.PlaygroundEditorTheme__listItemChecked[dir=rtl]:before,.PlaygroundEditorTheme__listItemUnchecked[dir=rtl]:before{left:auto;right:0}.PlaygroundEditorTheme__listItemChecked:focus:before,.PlaygroundEditorTheme__listItemUnchecked:focus:before{border-radius:2px;box-shadow:0 0 0 2px #a6cdfe}.PlaygroundEditorTheme__tokenComment{color:#708090}.PlaygroundEditorTheme__tokenPunctuation{color:#999}.PlaygroundEditorTheme__tokenProperty{color:#905}.PlaygroundEditorTheme__tokenSelector{color:#690}.PlaygroundEditorTheme__tokenOperator{color:#9a6e3a}.PlaygroundEditorTheme__tokenAttr{color:#07a}.PlaygroundEditorTheme__tokenVariable{color:#e90}.PlaygroundEditorTheme__tokenFunction{color:#dd4a68}.PlaygroundEditorTheme__mark{background:#ffd40024;border-bottom:2px solid #ffd4004d;padding-bottom:2px}.PlaygroundEditorTheme__markOverlap{background:#ffd4004d;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__mark.selected{background:#ffd40080;border-bottom:2px solid #ffd400}.PlaygroundEditorTheme__markOverlap.selected{background:#ffd400b3;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__embedBlock{user-select:none}.PlaygroundEditorTheme__embedBlockFocus{outline:2px solid #3c84f4}.PlaygroundEditorTheme__highlight-button{display:none}.PlaygroundEditorTheme__insert-node{background-color:#8cbeff;text-decoration:none}.PlaygroundEditorTheme__delete-node{text-decoration:line-through;text-decoration-color:#dc2626}[class^=PlaygroundEditorTheme__update-node]>.PlaygroundEditorTheme__insert-node{background-color:#f3e8ff}.PlaygroundEditorTheme__manual-node-accepted,[class^=PlaygroundEditorTheme__manual-node]>.PlaygroundEditorTheme__insert-node{background-color:#8cbeff}.PlaygroundEditorTheme__manual-node-rejected{text-decoration:underline;text-decoration-color:red}.PlaygroundEditorTheme__update-node-accepted{background-color:#f3e8ff;-webkit-box-decoration-break:clone;box-decoration-break:clone;display:inline}';!function(){if("undefined"==typeof document)return;const o=document.createElement("style");o.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&o.setAttribute("nonce",t),o.appendChild(document.createTextNode(e));const r=document.head||document.getElementsByTagName("head")[0]||document.documentElement;r&&r.appendChild(o)}(),exports.default=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e='.PlaygroundEditorTheme__ltr{text-align:left}.PlaygroundEditorTheme__rtl{text-align:right}.PlaygroundEditorTheme__paragraph{font-family:Inter,sans-serif;line-height:28px;margin:0 0 8px;position:relative}.PlaygroundEditorTheme__paragraph:last-child{margin-bottom:0}.PlaygroundEditorTheme__quote{border-left:4px solid #ced0d4;color:#65676b;font-size:15px;margin:0 0 10px 20px;padding-left:16px}.PlaygroundEditorTheme__h1{font-family:Inter,sans-serif;font-size:24px;margin:12px 0 4px;padding:0}.PlaygroundEditorTheme__h2{font-size:20px}.PlaygroundEditorTheme__h2,.PlaygroundEditorTheme__h3{font-family:Inter,sans-serif;margin:10px 0 0;padding:0}.PlaygroundEditorTheme__h3{font-size:18px;text-transform:uppercase}.PlaygroundEditorTheme__textBold{font-family:Inter,sans-serif;font-weight:700}.PlaygroundEditorTheme__textItalic{font-style:italic}.PlaygroundEditorTheme__textUnderline{text-decoration:underline}.PlaygroundEditorTheme__textStrikethrough{text-decoration:line-through}.PlaygroundEditorTheme__textUnderlineStrikethrough{text-decoration:underline line-through}.PlaygroundEditorTheme__textSubscript{font-size:.8em;vertical-align:sub!important}.PlaygroundEditorTheme__textSuperscript{font-size:.8em;vertical-align:super}.PlaygroundEditorTheme__textCode{background-color:#f0f2f5;font-family:Menlo,Consolas,Monaco,monospace;font-size:94%;padding:1px .25rem}.PlaygroundEditorTheme__hashtag{background-color:#5890ff26;border-bottom:1px solid #5890ff4d}.PlaygroundEditorTheme__link{color:#216fdb;text-decoration:none}.PlaygroundEditorTheme__link:hover{text-decoration:underline}.PlaygroundEditorTheme__code{background-color:#f0f2f5;display:block;font-family:Menlo,Consolas,Monaco,monospace;font-size:13px;line-height:1.53;margin:8px 0;overflow-x:auto;padding:8px 8px 8px 52px;position:relative;tab-size:2}.PlaygroundEditorTheme__code:before{background-color:#eee;border-right:1px solid #ccc;color:#777;content:attr(data-gutter);left:0;min-width:25px;padding:8px;position:absolute;text-align:right;top:0;white-space:pre-wrap}.PlaygroundEditorTheme__code:after{color:#00000080;content:attr(data-highlight-language);font-size:10px;padding:3px;position:absolute;right:3px;text-transform:uppercase;top:0}.PlaygroundEditorTheme__table{border-collapse:collapse;border-spacing:0;max-width:100%;overflow-y:scroll;table-layout:fixed;width:100%}.PlaygroundEditorTheme__tableCell{border:1px solid #000;min-width:75px;padding:6px 8px;text-align:start;vertical-align:top}.PlaygroundEditorTheme__tableCellHeader{background-color:#f2f3f5;text-align:start}.PlaygroundEditorTheme__characterLimit{background-color:#fbb!important;display:inline}.PlaygroundEditorTheme__ul{list-style-type:disc}.PlaygroundEditorTheme__ol1,.PlaygroundEditorTheme__ul{list-style-position:outside;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol1{list-style-type:decimal}.PlaygroundEditorTheme__ol2{list-style-position:outside;list-style-type:upper-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol3{list-style-position:outside;list-style-type:lower-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol4{list-style-position:outside;list-style-type:upper-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol5{list-style-position:outside;list-style-type:lower-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__listItem{display:list-item;margin:8px 24px 8px 8px;padding:0 8px}.PlaygroundEditorTheme__nestedListItem{list-style-type:inherit;margin-left:16px}ol .PlaygroundEditorTheme__nestedListItem{list-style-type:none}.PlaygroundEditorTheme__listItemChecked,.PlaygroundEditorTheme__listItemUnchecked{list-style-type:none;margin-left:8px;margin-right:8px;outline:none;padding-left:24px;padding-right:24px;position:relative}.PlaygroundEditorTheme__listItemChecked{text-decoration:line-through}.PlaygroundEditorTheme__listItemChecked:before,.PlaygroundEditorTheme__listItemUnchecked:before{background-size:cover;content:"";cursor:pointer;display:block;height:16px;left:0;position:absolute;top:2px;width:16px}.PlaygroundEditorTheme__listItemChecked[dir=rtl]:before,.PlaygroundEditorTheme__listItemUnchecked[dir=rtl]:before{left:auto;right:0}.PlaygroundEditorTheme__listItemChecked:focus:before,.PlaygroundEditorTheme__listItemUnchecked:focus:before{border-radius:2px;box-shadow:0 0 0 2px #a6cdfe}.PlaygroundEditorTheme__tokenComment{color:#708090}.PlaygroundEditorTheme__tokenPunctuation{color:#999}.PlaygroundEditorTheme__tokenProperty{color:#905}.PlaygroundEditorTheme__tokenSelector{color:#690}.PlaygroundEditorTheme__tokenOperator{color:#9a6e3a}.PlaygroundEditorTheme__tokenAttr{color:#07a}.PlaygroundEditorTheme__tokenVariable{color:#e90}.PlaygroundEditorTheme__tokenFunction{color:#dd4a68}.PlaygroundEditorTheme__mark{background:#ffd40024;border-bottom:2px solid #ffd4004d;padding-bottom:2px}.PlaygroundEditorTheme__markOverlap{background:#ffd4004d;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__mark.selected{background:#ffd40080;border-bottom:2px solid #ffd400}.PlaygroundEditorTheme__markOverlap.selected{background:#ffd400b3;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__embedBlock{user-select:none}.PlaygroundEditorTheme__embedBlockFocus{outline:2px solid #3c84f4}.PlaygroundEditorTheme__delete-node{text-decoration:var(--delete-node-text-decoration,line-through);text-decoration-color:var(--delete-node-decoration-color,#dc2626);text-decoration-thickness:var(--delete-node-decoration-thickness,2px)}.PlaygroundEditorTheme__insert-node{background-color:var(--insert-node-bg,#dbeafe);border-radius:var(--insert-node-border-radius,2px);color:var(--insert-node-color,#1e3a8a);padding:var(--insert-node-padding,1px 2px);text-decoration:var(--insert-node-text-decoration,none)}.PlaygroundEditorTheme__highlight-button{display:none}';!function(){if("undefined"==typeof document)return;const o=document.createElement("style");o.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&o.setAttribute("nonce",t),o.appendChild(document.createTextNode(e));const r=document.head||document.getElementsByTagName("head")[0]||document.documentElement;r&&r.appendChild(o)}(),exports.default=e;
2
2
  //# sourceMappingURL=theme.css.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),n=require("react"),o=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var t=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),s=require("@mui/material"),r=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),a=require("../../../../../service/redlineService.js"),d=require("../../ai-reasoning/AiReasonMarkdownWrapper.js");const c=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],p=({toneIndex:i,configs:n=c})=>{const o=Math.min(i,n.length-1),{color:t,angle:l,arcD:s}=n[o]||n[1]||n[0],r=(l-90)*Math.PI/180,a=11+9*Math.cos(r),d=13+9*Math.sin(r);return e.jsxs("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:s,stroke:t,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:"11",y1:"13",x2:a,y2:d,stroke:t,strokeWidth:"2",strokeLinecap:"round"})]})},x=({type:i,customStyles:n={}})=>{const o={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...n},t=o[i]||o.Medium;return e.jsx("div",{style:t,children:i})},u=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},v={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},m={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},y={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},h={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},f={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},j={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},S={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},C={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},b={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},I={display:"flex",gap:8,marginBottom:18},k={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},w={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},B={borderTop:"0.5px solid #eee",padding:"14px 0px"},T={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},A={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},R={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},D={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},E={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},z={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},W={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},L={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},M={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0};function H({onAssignClick:i,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:t,historyIconSmall:l,onHistoryClick:s,historyTootipTitle:r}){const a="20px";return e.jsxs("div",{style:{...M,minWidth:"200px"},children:[e.jsxs("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:i,children:[e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:a,height:a,flexShrink:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"})]})}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),n&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>n(e),children:[o&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:a,height:a,flexShrink:0},children:o}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),s&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>s(e),children:[l&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:a,height:a,flexShrink:0},children:l}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]})]})}function _({onAssignClick:i,onOpenCognitive:o,cognitiveIconSmall:t,cognitiveTootipTitle:l,historyIconSmall:s,onHistoryClick:r,historyTootipTitle:a}){const[d,c]=n.useState(!1);return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsx("button",{onClick:()=>c(!d),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),d&&e.jsx(H,{onAssignClick:i?()=>{c(!1),i&&i()}:void 0,onOpenCognitive:o?e=>{c(!1),o&&o(e)}:void 0,cognitiveIconSmall:t,cognitiveTootipTitle:l,historyIconSmall:s,onHistoryClick:r,historyTootipTitle:a})]})}function q({users:i,onClick:n}){const o=i.length;return e.jsxs("div",{onClick:n,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e.jsx("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==i?void 0:i[0].length)>9?(null==i?void 0:i[0].slice(0,9))+"...":null==i?void 0:i[0]}),o>1&&e.jsxs("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",o-1]})]})}exports.AssignMenu=H,exports.DisplayUsers=q,exports.KebabMenu=_,exports.default=function({onClose:M,aiReason:H,onActionTrigger:F,onIterate:N,initialTone:O,onRegenerate:P,labels:U={},toneLevelsConfig:$=u,toneColorsConfig:G=g,dialConfigs:K=c,actions:V,disableAllActions:X=!1,customStyles:J={},severityChipStyles:Q={},customIcons:Y={},onOpenCognitive:Z,onHistoryClick:ee,historyIconSmall:ie,historyTootipTitle:ne,showTone:oe=!0,cognitiveSectionStyle:te={},cognitiveScoreBadgeStyle:le={},cognitiveScoreTextStyle:se={},cognitiveStyles:re={},cognitiveClassNames:ae={},cognitiveTitle:de="Cognitive Integrity",cognitiveTootipTitle:ce="Cognitive Decisioning",cognitiveLeftIcon:pe,cognitiveIconSmall:xe,showCognitiveRightArrow:ue=!0,isStreaming:ge,onAssignClick:ve,assignedUsers:me,onReviewUsersClick:ye,redlineId:he,aiReasonId:fe}){var je,Se,Ce,be,Ie,ke,we,Be,Te,Ae,Re,De,Ee,ze,We,Le,Me,He,_e;let qe=$.findIndex(e=>e===O);-1===qe&&(qe=1);const[Fe,Ne]=n.useState(!0),[Oe,Pe]=n.useState(!1),[Ue,$e]=n.useState(!1),[Ge,Ke]=n.useState(qe),[Ve]=n.useState(qe),Xe=$[Ge],Je=G[Xe]||"#BA7517",Qe=Ge!==Ve,Ye=[{id:"iterate",icon:Y.iterateIcon||e.jsx(i.PenLine,{size:16,color:"#64748B"}),label:U.btnIterate||"Iterate",color:"#64748B",onClick:N},{id:"accept",icon:Y.acceptIcon||e.jsx(i.CheckCircle,{size:16,color:"#10B981"}),label:U.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:Y.rejectIcon||e.jsx(i.XCircle,{size:16,color:"#DC2626"}),label:U.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:Ze,redlineConfig:ei,updateRedlineDataParent:ii}=r.useRequirementAI(),ni=V||Ye;return e.jsxs("div",{onClick:e=>{e.stopPropagation()},style:{...v,...null===(je=null==J?void 0:J.DeviationSummaryStyles)||void 0===je?void 0:je.root},children:[e.jsxs("div",{style:{...m,...null===(Se=null==J?void 0:J.DeviationSummaryStyles)||void 0===Se?void 0:Se.header,marginBottom:Ue?"16px":"12px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{children:Y.summaryIcon||e.jsx(i.Info,{size:16,color:"#E24B4A"})}),e.jsx("span",{style:{...y,...null===(Ce=null==J?void 0:J.DeviationSummaryStyles)||void 0===Ce?void 0:Ce.title},children:U.summaryHeader||"Summary"})]}),me&&me.length>0&&e.jsx(q,{users:me,onClick:e=>{e.stopPropagation(),null==ye||ye()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(ve||Z)&&e.jsx(_,{onAssignClick:ve,onOpenCognitive:Z,cognitiveIconSmall:xe,cognitiveTootipTitle:ce,historyIconSmall:ie,onHistoryClick:ee,historyTootipTitle:ne}),e.jsx("button",{onClick:M,style:{...w,...null===(be=null==J?void 0:J.DeviationSummaryStyles)||void 0===be?void 0:be.closeBtn,color:"#64748B"},children:"✕"})]})]}),e.jsx(s.Tooltip,{title:null===(Ie=null==H?void 0:H.redlining_details)||void 0===Ie?void 0:Ie.redline_title,children:e.jsx("p",{style:{...h,...null===(ke=null==J?void 0:J.DeviationSummaryStyles)||void 0===ke?void 0:ke.bodyText},children:null===(we=null==H?void 0:H.redlining_details)||void 0===we?void 0:we.redline_title})}),e.jsx("p",{style:{...f,...null===(Be=null==J?void 0:J.DeviationSummaryStyles)||void 0===Be?void 0:Be.summary},children:null===(Te=null==H?void 0:H.redlining_details)||void 0===Te?void 0:Te.redline_summary}),e.jsxs("div",{style:{...j,...null===(Ae=null==J?void 0:J.DeviationSummaryStyles)||void 0===Ae?void 0:Ae.impactContainer},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("button",{onClick:()=>Ne(!Fe),style:{...C,...null===(Re=null==J?void 0:J.DeviationSummaryStyles)||void 0===Re?void 0:Re.impactToggle},children:[e.jsx("span",{style:{...b,...null===(De=null==J?void 0:J.DeviationSummaryStyles)||void 0===De?void 0:De.impactToggleLabel},children:U.impactHeader||"Impact"}),e.jsx("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Fe?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})})]}),e.jsx(x,{type:(null==H?void 0:H.severity)||"Medium",customStyles:Q})]}),Fe&&e.jsx(e.Fragment,{children:e.jsx("div",{style:{...S,...null===(Ee=null==J?void 0:J.DeviationSummaryStyles)||void 0===Ee?void 0:Ee.impactText},children:e.jsx(d.AiReasonMarkdownWrapper,{message:`${null!==(We=null===(ze=null==H?void 0:H.redlining_details)||void 0===ze?void 0:ze.redline_impact)&&void 0!==We?We:U.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(Le=null==J?void 0:J.DeviationSummaryStyles)||void 0===Le?void 0:Le.impactMarkdown})})})]}),e.jsx("div",{style:{...I,...null===(Me=null==J?void 0:J.DeviationSummaryStyles)||void 0===Me?void 0:Me.actionContainer},children:ni.map(i=>{var n,o;const t=X||i.disabled,l=t?{cursor:"not-allowed",opacity:.5,...null===(n=null==J?void 0:J.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtnDisabled,...i.disabledStyle}:{};return e.jsxs("button",{style:{...k,...null===(o=null==J?void 0:J.DeviationSummaryStyles)||void 0===o?void 0:o.actionBtn,color:i.color,...i.style,...l},onClick:t?void 0:()=>{var e;i.useLabel?(async e=>{var i,n,o;null==F||F({status:"loading",action:e,metadata:{redlineId:he,aiReasonId:fe}});try{const{updated_reqai:t}=await a.resolveRedline({documentId:Ze,userEmail:null==ei?void 0:ei.userEmail,userName:null==ei?void 0:ei.userName,redlineId:null!==(i=null==H?void 0:H.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==ei?void 0:ei.baseApiUrl,redlineConfigId:null!==(n=null==ei?void 0:ei.redlineConfigId)&&void 0!==n?n:""},null!==(o=null==ei?void 0:ei.token)&&void 0!==o?o:"");await(null==ii?void 0:ii(t)),null==F||F({status:"success",action:e,metadata:{redlineId:he,aiReasonId:fe}})}catch(e){null==F||F({status:"failed",action:null,metadata:{redlineId:he,aiReasonId:fe}})}})(i.id.toLowerCase()):null===(e=i.onClick)||void 0===e||e.call(i)},disabled:t,children:[i.icon,i.label]},i.id)})}),oe&&e.jsxs("div",{style:{...B,...null===(He=null==J?void 0:J.DeviationSummaryStyles)||void 0===He?void 0:He.toneContainer},children:[e.jsxs("button",{onClick:()=>Pe(!Oe),style:{...T,...null===(_e=null==J?void 0:J.DeviationSummaryStyles)||void 0===_e?void 0:_e.toneToggleBtn},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(p,{toneIndex:Ge,configs:K}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:U.toneHeader||"Redline Tone"})]}),e.jsx("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Oe?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#111"})})]}),Oe&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:U.toneDescription||"Controls how assertively AI is redlining"}),e.jsx(o.ToneToggle,{isDirty:Qe,onToneChange:e=>{Ke(e)},toneColor:Je,toneIndex:Ge,onClickRegenerate:()=>null==P?void 0:P(Xe),toneLabels:$,isStreaming:ge,aiReason:H})]})]}),Z&&e.jsxs("div",{className:null==ae?void 0:ae.section,onClick:e=>{e.stopPropagation(),Z&&Z(e)},style:{...A,...null==re?void 0:re.section,...te},children:[e.jsxs("div",{className:null==ae?void 0:ae.headerLeft,style:{...R,...null==re?void 0:re.headerLeft},children:[e.jsx("span",{className:null==ae?void 0:ae.titleIcon,style:{...D,...null==re?void 0:re.titleIcon},children:null!=pe?pe:e.jsx(t.ReactComponent,{})}),e.jsx("div",{className:null==ae?void 0:ae.cognitiveTitle,style:{...E,...null==re?void 0:re.cognitiveTitle},children:de})]}),e.jsxs("div",{className:null==ae?void 0:ae.headerRight,style:{...z,...null==re?void 0:re.headerRight},children:[void 0!==(null==H?void 0:H.relevance_score)&&null!==(null==H?void 0:H.relevance_score)?e.jsxs("span",{className:null==ae?void 0:ae.scoreBadge,style:{...W,...null==re?void 0:re.scoreBadge,...le},children:[e.jsx(l.ReactComponent,{}),e.jsxs("span",{className:null==ae?void 0:ae.scoreText,style:{...L,...null==re?void 0:re.scoreText,...se},children:[Math.round(Number(H.relevance_score)),"%"]})]}):null,ue&&e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(i.ChevronRight,{size:16,color:"#64748B"})})]})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),n=require("react"),o=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var t=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),s=require("@mui/material"),r=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),a=require("../../../../../service/redlineService.js"),d=require("../../ai-reasoning/AiReasonMarkdownWrapper.js");const c=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],p=({toneIndex:i,configs:n=c})=>{const o=Math.min(i,n.length-1),{color:t,angle:l,arcD:s}=n[o]||n[1]||n[0],r=(l-90)*Math.PI/180,a=11+9*Math.cos(r),d=13+9*Math.sin(r);return e.jsxs("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:s,stroke:t,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:"11",y1:"13",x2:a,y2:d,stroke:t,strokeWidth:"2",strokeLinecap:"round"})]})},u=({type:i,customStyles:n={}})=>{const o={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...n},t=o[i]||o.Medium;return e.jsx("div",{style:t,children:i})},x=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},v={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},m={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},h={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},y={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},f={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},j={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},S={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},b={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},C={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},I={display:"flex",gap:8,marginBottom:18},k={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},w={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},B={borderTop:"0.5px solid #eee",padding:"14px 0px"},A={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},T={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},R={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},D={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},E={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},z={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},W={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},L={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},M={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0};function _({onAssignClick:i,disableAssignButton:n=!1,onOpenCognitive:o,cognitiveIconSmall:t,cognitiveTootipTitle:l}){const s="20px";return e.jsxs("div",{style:{...M,minWidth:"200px"},children:[e.jsxs("div",{style:{padding:"8px",cursor:n?"not-allowed":"pointer",opacity:n?.5:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:n?void 0:i,children:[e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"})]})}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),o&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>o(e),children:[t&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:t}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l})]})]})}function q({onAssignClick:i,disableAssignButton:o=!1,onOpenCognitive:t,cognitiveIconSmall:l,cognitiveTootipTitle:s}){const[r,a]=n.useState(!1);return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsx("button",{onClick:()=>a(!r),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),r&&e.jsx(_,{onAssignClick:i?()=>{a(!1),i&&i()}:void 0,disableAssignButton:o,onOpenCognitive:t?e=>{a(!1),t&&t(e)}:void 0,cognitiveIconSmall:l,cognitiveTootipTitle:s})]})}function F({users:i,onClick:n}){const o=i.length;return e.jsxs("div",{onClick:n,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e.jsx("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==i?void 0:i[0].length)>9?(null==i?void 0:i[0].slice(0,9))+"...":null==i?void 0:i[0]}),o>1&&e.jsxs("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",o-1]})]})}exports.AssignMenu=_,exports.DisplayUsers=F,exports.KebabMenu=q,exports.default=function({onClose:M,aiReason:_,onActionTrigger:H,onIterate:N,initialTone:P,onRegenerate:O,labels:U={},toneLevelsConfig:$=x,toneColorsConfig:G=g,dialConfigs:K=c,actions:V,disableAllActions:X=!1,customStyles:J={},severityChipStyles:Q={},customIcons:Y={},onOpenCognitive:Z,showTone:ee=!0,cognitiveSectionStyle:ie={},cognitiveScoreBadgeStyle:ne={},cognitiveScoreTextStyle:oe={},cognitiveStyles:te={},cognitiveClassNames:le={},cognitiveTitle:se="Cognitive Integrity",cognitiveTootipTitle:re="Cognitive Decisioning",cognitiveLeftIcon:ae,cognitiveIconSmall:de,showCognitiveRightArrow:ce=!0,isStreaming:pe,onAssignClick:ue,disableAssignButton:xe=!1,assignedUsers:ge,onReviewUsersClick:ve,redlineId:me,aiReasonId:he}){var ye,fe,je,Se,be,Ce,Ie,ke,we,Be,Ae,Te,Re,De,Ee,ze,We,Le,Me;let _e=$.findIndex(e=>e===P);-1===_e&&(_e=1);const[qe,Fe]=n.useState(!0),[He,Ne]=n.useState(!1),[Pe,Oe]=n.useState(!1),[Ue,$e]=n.useState(_e),[Ge]=n.useState(_e),Ke=$[Ue],Ve=G[Ke]||"#BA7517",Xe=Ue!==Ge,Je=[{id:"iterate",icon:Y.iterateIcon||e.jsx(i.PenLine,{size:16,color:"#64748B"}),label:U.btnIterate||"Iterate",color:"#64748B",onClick:N},{id:"accept",icon:Y.acceptIcon||e.jsx(i.CheckCircle,{size:16,color:"#10B981"}),label:U.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:Y.rejectIcon||e.jsx(i.XCircle,{size:16,color:"#DC2626"}),label:U.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:Qe,redlineConfig:Ye,updateRedlineDataParent:Ze}=r.useRequirementAI(),ei=V||Je;return e.jsxs("div",{onClick:e=>{e.stopPropagation()},style:{...v,...null===(ye=null==J?void 0:J.DeviationSummaryStyles)||void 0===ye?void 0:ye.root},children:[e.jsxs("div",{style:{...m,...null===(fe=null==J?void 0:J.DeviationSummaryStyles)||void 0===fe?void 0:fe.header,marginBottom:Pe?"16px":"12px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{children:Y.summaryIcon||e.jsx(i.Info,{size:16,color:"#E24B4A"})}),e.jsx("span",{style:{...h,...null===(je=null==J?void 0:J.DeviationSummaryStyles)||void 0===je?void 0:je.title},children:U.summaryHeader||"Summary"})]}),ge&&ge.length>0&&e.jsx(F,{users:ge,onClick:e=>{e.stopPropagation(),null==ve||ve()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(ue||Z)&&e.jsx(q,{onAssignClick:ue,disableAssignButton:xe,onOpenCognitive:Z,cognitiveIconSmall:de,cognitiveTootipTitle:re}),e.jsx("button",{onClick:M,style:{...w,...null===(Se=null==J?void 0:J.DeviationSummaryStyles)||void 0===Se?void 0:Se.closeBtn,color:"#64748B"},children:"✕"})]})]}),e.jsx(s.Tooltip,{title:null===(be=null==_?void 0:_.redlining_details)||void 0===be?void 0:be.redline_title,children:e.jsx("p",{style:{...y,...null===(Ce=null==J?void 0:J.DeviationSummaryStyles)||void 0===Ce?void 0:Ce.bodyText},children:null===(Ie=null==_?void 0:_.redlining_details)||void 0===Ie?void 0:Ie.redline_title})}),e.jsx("p",{style:{...f,...null===(ke=null==J?void 0:J.DeviationSummaryStyles)||void 0===ke?void 0:ke.summary},children:null===(we=null==_?void 0:_.redlining_details)||void 0===we?void 0:we.redline_summary}),e.jsxs("div",{style:{...j,...null===(Be=null==J?void 0:J.DeviationSummaryStyles)||void 0===Be?void 0:Be.impactContainer},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("button",{onClick:()=>Fe(!qe),style:{...b,...null===(Ae=null==J?void 0:J.DeviationSummaryStyles)||void 0===Ae?void 0:Ae.impactToggle},children:[e.jsx("span",{style:{...C,...null===(Te=null==J?void 0:J.DeviationSummaryStyles)||void 0===Te?void 0:Te.impactToggleLabel},children:U.impactHeader||"Impact"}),e.jsx("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:qe?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})})]}),e.jsx(u,{type:(null==_?void 0:_.severity)||"Medium",customStyles:Q})]}),qe&&e.jsx(e.Fragment,{children:e.jsx("div",{style:{...S,...null===(Re=null==J?void 0:J.DeviationSummaryStyles)||void 0===Re?void 0:Re.impactText},children:e.jsx(d.AiReasonMarkdownWrapper,{message:`${null!==(Ee=null===(De=null==_?void 0:_.redlining_details)||void 0===De?void 0:De.redline_impact)&&void 0!==Ee?Ee:U.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(ze=null==J?void 0:J.DeviationSummaryStyles)||void 0===ze?void 0:ze.impactMarkdown})})})]}),e.jsx("div",{style:{...I,...null===(We=null==J?void 0:J.DeviationSummaryStyles)||void 0===We?void 0:We.actionContainer},children:ei.map(i=>{var n,o;const t=X||i.disabled,l=t?{cursor:"not-allowed",opacity:.5,...null===(n=null==J?void 0:J.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtnDisabled,...i.disabledStyle}:{};return e.jsxs("button",{style:{...k,...null===(o=null==J?void 0:J.DeviationSummaryStyles)||void 0===o?void 0:o.actionBtn,color:i.color,...i.style,...l},onClick:t?void 0:()=>{var e;i.useLabel?(async e=>{var i,n,o;null==H||H({status:"loading",action:e,metadata:{redlineId:me,aiReasonId:he}});try{const{updated_reqai:t}=await a.resolveRedline({documentId:Qe,userEmail:null==Ye?void 0:Ye.userEmail,userName:null==Ye?void 0:Ye.userName,redlineId:null!==(i=null==_?void 0:_.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==Ye?void 0:Ye.baseApiUrl,redlineConfigId:null!==(n=null==Ye?void 0:Ye.redlineConfigId)&&void 0!==n?n:""},null!==(o=null==Ye?void 0:Ye.token)&&void 0!==o?o:"");await(null==Ze?void 0:Ze(t)),null==H||H({status:"success",action:e,metadata:{redlineId:me,aiReasonId:he}})}catch(e){null==H||H({status:"failed",action:null,metadata:{redlineId:me,aiReasonId:he}})}})(i.id.toLowerCase()):null===(e=i.onClick)||void 0===e||e.call(i)},disabled:t,children:[i.icon,i.label]},i.id)})}),ee&&e.jsxs("div",{style:{...B,...null===(Le=null==J?void 0:J.DeviationSummaryStyles)||void 0===Le?void 0:Le.toneContainer},children:[e.jsxs("button",{onClick:()=>Ne(!He),style:{...A,...null===(Me=null==J?void 0:J.DeviationSummaryStyles)||void 0===Me?void 0:Me.toneToggleBtn},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(p,{toneIndex:Ue,configs:K}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:U.toneHeader||"Redline Tone"})]}),e.jsx("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:He?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#111"})})]}),He&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:U.toneDescription||"Controls how assertively AI is redlining"}),e.jsx(o.ToneToggle,{isDirty:Xe,onToneChange:e=>{$e(e)},toneColor:Ve,toneIndex:Ue,onClickRegenerate:()=>null==O?void 0:O(Ke),toneLabels:$,isStreaming:pe,aiReason:_})]})]}),Z&&e.jsxs("div",{className:null==le?void 0:le.section,onClick:e=>{e.stopPropagation(),Z&&Z(e)},style:{...T,...null==te?void 0:te.section,...ie},children:[e.jsxs("div",{className:null==le?void 0:le.headerLeft,style:{...R,...null==te?void 0:te.headerLeft},children:[e.jsx("span",{className:null==le?void 0:le.titleIcon,style:{...D,...null==te?void 0:te.titleIcon},children:null!=ae?ae:e.jsx(t.ReactComponent,{})}),e.jsx("div",{className:null==le?void 0:le.cognitiveTitle,style:{...E,...null==te?void 0:te.cognitiveTitle},children:se})]}),e.jsxs("div",{className:null==le?void 0:le.headerRight,style:{...z,...null==te?void 0:te.headerRight},children:[void 0!==(null==_?void 0:_.relevance_score)&&null!==(null==_?void 0:_.relevance_score)?e.jsxs("span",{className:null==le?void 0:le.scoreBadge,style:{...W,...null==te?void 0:te.scoreBadge,...ne},children:[e.jsx(l.ReactComponent,{}),e.jsxs("span",{className:null==le?void 0:le.scoreText,style:{...L,...null==te?void 0:te.scoreText,...oe},children:[Math.round(Number(_.relevance_score)),"%"]})]}):null,ce&&e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(i.ChevronRight,{size:16,color:"#64748B"})})]})]})]})};
2
2
  //# sourceMappingURL=DeviationSummary.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("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"),y=require("../../../../service/redlineService.js"),h=require("./ClinicalTrialSection.js"),S=require("../story-screen/CompletionPanel.js"),g=require("../../icons/CDIcon.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var C=x(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 w(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 N=({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,":"]})]})},b=({isUserStoryCurrentlyUpdated:n,artifactId:x,artifactTitleId:D,parentUserStory:E,currentUserStory:B,onUserStoryChange:T,parentIndex:U,currentIndex:A,enableDownload:k,isDiffEditReviewMode:P,showUserStoryDiff:R,handleDownloadUserStory:M,handleOpenSendDialog:_,updateUserStoryArtifact:q,selectedArtifactId:L,isDisplayHighlightControl:F,elementDisplayConfig:$,_resolvedConfig:V,showWrapper:O=!1,defaultExpanded:z,actionItemsConfig:W,onDelete:G,contextVariant:H,expandedSubFeatures:Q,showDisplayName:X=!0,allowTitleEdit:Z=!0,showConfidenceScore:J=!0,showBorderTop:K=!0,sectionStatusConfig:Y,showCompletionPanel:ee=!1,showAddSectionButton:te=!1,disableEditPlan:le=!1,useMuiTooltip:ne=!1,approveButtonConfig:oe,CDNeededInChip:ie})=>{var se,ae,re,de,ue,ce,ve,pe,fe,me,ye,he,Se,ge,xe,Ce,Ie,je;const{isLoadingSectionData:we=!1,onLoadSectionData:Ne,status:be,onStatusClick:De,completedCount:Ee,totalCount:Be,isNoDataAvailable:Te=!1}=null!=Y?Y:{},{searchQueryList:Ue,citations:Ae,customStyles:ke,onEditBlocked:Pe,redlineDcoumentId:Re,redlineConfig:Me,customSectionConfig:_e,updateRedlineDataParent:qe,aiReasoning:Le}=p.useRequirementAI(),Fe=null==ke?void 0:ke.userStoryCardStyles,$e=null==Fe?void 0:Fe.customSectionEditButton,Ve=null==Fe?void 0:Fe.statusStyles,Oe=null===(se=null==ke?void 0:ke.userStoryCardStyles)||void 0===se?void 0:se.userStoryEditStyles,ze=null===(ae=null==ke?void 0:ke.userStoryScreenStyles)||void 0===ae?void 0:ae.userStoryContentStyles,We=null==Fe?void 0:Fe.progressHeaderStyles,Ge=null==Fe?void 0:Fe.clinicalTrialSectionStyles,He=null==Fe?void 0:Fe.CompletionStyles,Qe=null==Fe?void 0:Fe.noDataStyles,Xe=null==Fe?void 0:Fe.approveButtonStyles,Ze=null!==(de=null===(re=null==_e?void 0:_e.shouldRender)||void 0===re?void 0:re.call(_e,B))&&void 0!==de&&de,Je=null===(ue=null==_e?void 0:_e.getValue)||void 0===ue?void 0:ue.call(_e,B),Ke=null!==(ve=null===(ce=null==_e?void 0:_e.getFields)||void 0===ce?void 0:ce.call(_e,B))&&void 0!==ve?ve:[],Ye=null!==(pe=null==_e?void 0:_e.isEditDisabled)&&void 0!==pe&&pe,et=null!==(me=null===(fe=null==_e?void 0:_e.isSaving)||void 0===fe?void 0:fe.call(_e,B))&&void 0!==me&&me,tt=(lt=null!==(ye=B.completion_percentage)&&void 0!==ye?ye:0,nt=He,lt>=80?null==nt?void 0:nt.highCompletion:lt>=50?null==nt?void 0:nt.mediumCompletion:null==nt?void 0:nt.lowCompletion);var lt,nt;const ot={[p.SectionStatus.WAITING]:null==Ve?void 0:Ve.waiting,[p.SectionStatus.IN_PROGRESS]:null==Ve?void 0:Ve.inProgress,[p.SectionStatus.GENERATED]:null==Ve?void 0:Ve.generated,[p.SectionStatus.FAILED]:null==Ve?void 0:Ve.failed,[p.SectionStatus.GENERATE]:null==Ve?void 0:Ve.generate,[p.SectionStatus.APPROVED]:null==Ve?void 0:Ve.approved},[it,st]=t.useState({...structuredClone(B),value:r.formatMarkdown(B.value)||""}),[at,rt]=t.useState({userStory:!!B.isDefaultEdit}),[dt,ut]=t.useState(!1),[ct,vt]=t.useState(!1),[pt,ft]=t.useState(null),[mt,yt]=t.useState(null),{userStory:ht,customIcons:St}=p.useRequirementAI(),[gt,xt]=t.useState(null!=z?z:""===U||L===B.artifactId||!!B.isDefaultOpen),[Ct,It]=t.useState(!1),[jt,wt]=t.useState(null),[Nt,bt]=t.useState(null),[Dt,Et]=t.useState(!1),Bt=t.useRef(null),Tt=t.useRef(null),[Ut,At]=t.useState(!1),[kt,Pt]=t.useState(!1),Rt=t.useRef(null),[Mt,_t]=t.useState(B.value);t.useEffect(()=>{n&&xt(n)},[n]),t.useEffect(()=>{st({...structuredClone(B),value:r.formatMarkdown(B.value)||""})},[B]),t.useEffect(()=>{Ue.length>0?xt(!0):void 0===z&&(L?xt(L===B.artifactId):Q&&Q.length>0&&xt(Q.includes(B.artifactId)))},[Ue,L,B.artifactId,Q]);const qt=()=>{wt(null)},Lt=()=>{bt(null)},Ft=()=>{gt&&at.userStory&&Tt.current&&!Tt.current.requestClose()||xt(e=>!e)},$t=async()=>{var e;try{"userStory"==="userStory"&&(T(it),console.log("I am changing RTE editor values",it)),await q(Ae,ht,x,null===(e=Rt.current)||void 0===e?void 0:e.signal)}finally{}};const Vt=null!=(null==B?void 0:B.big_enough)&&!Number.isNaN(B.big_enough)&&!!(null==B?void 0:B.big_enough_decision_factors),Ot=null!==(he=null==B?void 0:B.completion_percentage)&&void 0!==he?he:0,zt=!!(null==B?void 0:B.completion_decision_factors),Wt=""===U,Gt=null!=V?V:w($,Wt),Ht=!P&&!R;t.useEffect(()=>{if(!mt)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${mt}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[mt]),t.useEffect(()=>{B.isDefaultEdit&&rt(e=>({...e,userStory:!0}))},[B.isDefaultEdit]);return t.useEffect(()=>_t(B.value),[B.value]),e.jsxs("div",{className:a.default.card,style:null==Fe?void 0:Fe.cardStyle,id:`story-card-${B.title}`,"data-expanded":gt,children:[e.jsxs("div",{className:a.default.titleSection,style:null==Fe?void 0:Fe.titleSection,children:[e.jsxs("div",{className:a.default.titleRow,style:null==Fe?void 0:Fe.titleRow,onClick:Ft,children:[e.jsxs("div",{className:a.default.titleLeft,style:null==Fe?void 0:Fe.titleLeft,onMouseEnter:()=>At(!0),onMouseLeave:()=>At(!1),children:[X&&e.jsx(N,{displayName:D}),dt&&Ht?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))||[],st(n),T(n),ut(!1)}catch(e){console.error("Failed to save title",e)}})(e,B.artifactId),onCancel:()=>{ut(!1)},inputStyle:null==Oe?void 0:Oe.inlineTitleInput,confirmButtonStyle:null==Oe?void 0:Oe.inlineTitleConfirm,cancelButtonStyle:null==Oe?void 0:Oe.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:ne?void 0:B.title,className:a.default.storyTitle,style:null==Fe?void 0:Fe.storyTitle,children:j(B.title)},B.artifactId)}),ee&&!Ze&&(zt?e.jsx(S.CompletionPanel,{customIcons:null==St?void 0:St.userStoryIcons,customStyles:null==Fe?void 0:Fe.aiReasoningCitaionStyles,currentUserStory:B,panelStyles:null==Fe?void 0:Fe.CompletionStyles,onToggleStateChange:Pt,children:e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==He?void 0:He.badge,...tt},children:[e.jsxs("span",{children:[Ot,"% Completed"]}),e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(g.default,{color:"currentColor"})}),kt?e.jsx(l.ChevronUp,{size:14,style:null==He?void 0:He.chevronStyle}):e.jsx(l.ChevronDown,{size:14,style:null==He?void 0:He.chevronStyle})]})}):e.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==He?void 0:He.badge,...tt},children:e.jsxs("span",{children:[Ot,"% Completed"]})})),Z&&e.jsx("button",{type:"button",className:a.default.titleEditButton,style:null==Oe?void 0:Oe.titleEditButton,onClick:e=>{e.stopPropagation(),ut(!0),gt||xt(!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"})})})]})]}),(be||void 0!==Ee&&void 0!==Be)&&e.jsxs("div",{className:a.default.statusContainer,children:[void 0!==Ee&&void 0!==Be&&e.jsxs("div",{className:a.default.completedBadge,children:["Completed: ",Ee,"/",Be]}),be&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==De||De()},className:a.default.statusButton,style:ot[be],children:I[be]})]}),e.jsxs("div",{className:a.default.titleActions,style:null==Fe?void 0:Fe.titleActions,onClick:e=>e.stopPropagation(),children:[(Gt.showProgressPercentage||Gt.showGapBox)&&O&&e.jsxs("div",{className:a.default.progressHeader,style:null==We?void 0:We.wrapper,children:[Gt.showProgressPercentage&&e.jsxs("div",{className:a.default.progressPercentage,style:null==We?void 0:We.percentage,children:[null!==(ge=null!==(Se=null==B?void 0:B.confidenceScore)&&void 0!==Se?Se:null==Gt?void 0:Gt.confidenceValue)&&void 0!==ge?ge:"0","%"]}),Gt.showGapBox&&e.jsxs("div",{className:a.default.gapBox,style:null==We?void 0:We.gapBox,children:[null!==(Ce=null!==(xe=null==B?void 0:B.gapValue)&&void 0!==xe?xe:null==Gt?void 0:Gt.gapBoxValue)&&void 0!==Ce?Ce:"2"," ","Gaps"]})]}),Vt&&e.jsx(f.BigEnoughPanel,{customIcons:null==St?void 0:St.userStoryIcons,customStyles:null==Fe?void 0:Fe.aiReasoningCitaionStyles,currentUserStory:B,panelStyles:null==Fe?void 0:Fe.BigEnoughStyles}),!at.userStory&&e.jsxs(e.Fragment,{children:[!1!==(null==Gt?void 0:Gt.showShareButton)&&e.jsx("button",{className:a.default.iconButton,style:null==Fe?void 0:Fe.iconButton,onClick:e=>{wt(e.currentTarget)},children:e.jsx(l.ExternalLink,{size:16})}),e.jsxs(o.Menu,{id:"user-story-share-menu",anchorEl:jt,open:!!jt,onClose:()=>wt(null),style:null==Fe?void 0:Fe.userStoryShareMenu,children:[k&&e.jsx(o.MenuItem,{style:null==Fe?void 0:Fe.userStoryMenuItem,onClick:async()=>{It(!0),M&&(await Promise.all([M("pdf"),M("doc")]),It(!1))},children:e.jsxs("div",{ref:Bt,className:a.default.menuItemContent,style:null==Fe?void 0:Fe.menuItemContent,children:[e.jsx(l.Download,{size:16,color:null==Fe?void 0:Fe.menuIconColor}),e.jsx("p",{style:null==Fe?void 0:Fe.menuLabel,children:"Download"})]})}),e.jsx(o.MenuItem,{style:null==Fe?void 0:Fe.userStoryMenuItem,onClick:async()=>{let e=B;E&&(e={...B,value:`${d.replaceTitleSection(null==E?void 0:E.value,B.title)} \n${B.value}`}),null==_||_(!0,[e],B.artifactId),qt()},children:e.jsxs("div",{style:null==Fe?void 0:Fe.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Share2,{size:16,color:null==Fe?void 0:Fe.menuIconColor}),e.jsx("p",{style:null==Fe?void 0:Fe.menuLabel,children:"Send"})]})}),e.jsx(o.MenuItem,{style:null==Fe?void 0:Fe.userStoryMenuItem,onClick:async()=>{const e=(new C.default.Converter).makeHtml(r.formatMarkdown(B.value)||B.value),t=function(e){const t=(new C.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{qt()}},children:e.jsxs("div",{style:null==Fe?void 0:Fe.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Copy,{size:16,color:null==Fe?void 0:Fe.menuIconColor}),e.jsx("p",{style:null==Fe?void 0:Fe.menuLabel,children:"Copy"})]})})]})]}),!Dt&&at.userStory&&gt?e.jsx(u.default,{type:"outline",children:"Cancel",style:null==Fe?void 0:Fe.cancelButton,onClick:()=>{var e;null===(e=Rt.current)||void 0===e||e.abort(),rt(e=>({...e,userStory:!1}))}}):e.jsx(e.Fragment,{}),at.userStory&&gt?e.jsx(u.default,{type:"fill",children:Dt?e.jsxs("span",{className:a.default.savingSpinner,style:null==Fe?void 0:Fe.savingSpinner,children:[e.jsx(l.LoaderCircle,{className:a.default.spinAnimation,style:null==Fe?void 0:Fe.spinAnimation}),e.jsx("span",{children:"Saving..."})]}):"Save",isDisable:Dt,style:Dt?null==Fe?void 0:Fe.savingButton:null==Fe?void 0:Fe.saveButton,onClick:async()=>{Et(!0),await $t();let e=await(async()=>{var e,t,l,n,o;let i=it.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==Me?void 0:Me.callUpdateDocument){const{updated_reqai:s}=await y.updateRedlineDocument({documentId:Re,sectionId:B.artifactId,baseApiUrl:null==Me?void 0:Me.baseApiUrl,updatedContent:i,userEmail:Me.userEmail,userName:Me.userName,redlineConfigId:null!==(e=Me.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Me?void 0:Me.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==qe?void 0:qe(s))}}catch(e){console.error("failed to update redline document",e),i=Mt}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={...it,value:e};T({...t,isDefaultEdit:!1}),_t(t.value),rt(e=>({...e,userStory:!1})),Et(!1)}}):!P&&!R&&!le&&gt&&!1!==(null==Gt?void 0:Gt.showEditButton)&&e.jsx("button",{className:a.default.iconButton,style:null==Fe?void 0:Fe.editButton,onClick:()=>rt(e=>({...e,userStory:!0})),children:e.jsx(l.PencilIcon,{color:null==Fe?void 0:Fe.pencilIconColor,size:16})}),te&&Wt&&gt&&!P&&!R&&!1!==(null==Gt?void 0:Gt.showEditButton)&&e.jsxs("button",{type:"button",className:a.default.addSectionButton,style:null==Oe?void 0:Oe.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]};st(a),T(a),xt(!0),yt(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"})]}),!Wt&&!P&&!le&&!R&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==G||G()},className:a.default.iconButton,style:null==Oe?void 0:Oe.deleteButton,"aria-label":"Delete section",title:"Delete section",children:e.jsx(l.Trash2,{size:16})}),Ze&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==$e?void 0:$e.button,disabled:Ye,onClick:e=>{if(e.stopPropagation(),ct)return ft(null),void vt(!1);ft(structuredClone(null!=Je?Je:{})),xt(!0),vt(!0)},children:ct?e.jsx(l.X,{size:16,color:null==Fe?void 0:Fe.pencilIconColor,style:null==$e?void 0:$e.cancelIcon}):e.jsx(l.PencilIcon,{size:16,color:null==Fe?void 0:Fe.pencilIconColor,style:null==$e?void 0:$e.editIcon})}),(null==Gt?void 0:Gt.actionItemsButton)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:a.default.actionItemBtn,style:null==Fe?void 0:Fe.actionItemBtn,onClick:e=>{e.stopPropagation(),bt(e.currentTarget)},children:e.jsx(l.Ellipsis,{})}),e.jsx(o.Menu,{id:"user-story-action-menu",anchorEl:Nt,open:!!Nt,onClose:Lt,style:null==Fe?void 0:Fe.userStoryShareMenu,children:null==W?void 0:W.items.map((t,l)=>e.jsx(o.MenuItem,{style:null==Fe?void 0:Fe.userStoryMenuItem,onClick:()=>{t.onclick(B),Lt()},children:e.jsxs("div",{className:a.default.menuItemContent,style:{...null==Fe?void 0:Fe.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[e.jsx("span",{className:a.default.menuItemIcon,style:null==Fe?void 0:Fe.menuItemIcon,children:t.icon}),e.jsx("p",{style:null==Fe?void 0:Fe.menuLabel,children:t.name}),e.jsx("span",{className:a.default.menuItemRight,style:null==Fe?void 0:Fe.menuItemRight})]})},`action-item-${l}-${t.name}`))})]}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),Ft()},style:null==Fe?void 0:Fe.chevronButton,className:a.default.chevronButton,children:gt?e.jsx(l.ChevronUp,{className:a.default.chevronIcon,color:null==Fe?void 0:Fe.chevronIconColor}):e.jsx(l.ChevronDown,{className:a.default.chevronIcon,color:null==Fe?void 0:Fe.chevronIconColor})})]})]}),e.jsx("div",{className:a.default.divider,style:null==Fe?void 0:Fe.dividerStyle})]}),gt&&e.jsx("div",{className:a.default.cardContent,style:{...null==Fe?void 0:Fe.cardContentStyle,borderTop:K?"1px solid #E5E5E5":"none"},children:we?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==Ne?void 0:Ne(),className:a.default.viewStatusButton,children:"View Status"})]}):Te?e.jsxs("div",{className:a.default.noDataContainer,style:null==Qe?void 0:Qe.container,children:[e.jsx("img",{src:i.default,alt:"No data available",className:a.default.noDataIllustration,style:null==Qe?void 0:Qe.illustration}),e.jsx("h3",{className:a.default.noDataTitle,style:null==Qe?void 0:Qe.title,children:"No Data Available for This Section"}),e.jsx("p",{className:a.default.noDataSubtitle,style:null==Qe?void 0:Qe.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==Fe?void 0:Fe.contentInner,children:[e.jsxs("div",{className:a.default.descriptionSection,style:null==Fe?void 0:Fe.descriptionSection,children:[e.jsx("div",{className:a.default.justifyBetween,style:null==Fe?void 0:Fe.justifyBetween}),at.userStory?e.jsx(c.default,{ref:Tt,minHeight:"100%",height:"100%",type:"string",value:r.formatMarkdown((Qt=Mt,Qt.replace(/<(upt|manual)\s+id="([^"]+)"[^>]*>/gs,(e,t,l)=>{if(/\sdata-status=/.test(e))return e;const n=function(e){var t;const l=e.split("$"),n=l[1]||l[0];for(const e of Le)if(e.id===n)return(null===(t=e.redlining_details)||void 0===t?void 0:t.status)||"";return""}(l);return e.replace(/>$/,` data-status="${n}">`)})))||"",handleUpdateState:(e,t)=>{const l=r.indentMarkdown(t);st(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:at.userStory?"edit":"readOnly",onEditBlocked:Pe,onSaveUnsavedChanges:async()=>{await $t(),xt(!1)},onDiscardUnsavedChanges:()=>{st({...structuredClone(B),value:r.formatMarkdown(B.value)||""}),rt(e=>({...e,userStory:!1})),xt(!1)},isSavingUnsavedChanges:Dt}):Ze?e.jsx(h.default,{styles:Ge,fields:Ke,readonly:!ct,isSaving:et,value:null!==(Ie=null!=pt?pt:Je)&&void 0!==Ie?Ie:{},onChange:ft,onSave:async()=>{var e;pt&&(await(null===(e=null==_e?void 0:_e.onSave)||void 0===e?void 0:e.call(_e,B,pt)),ft(null),vt(!1))},onCancel:()=>{ft(null),vt(!1)}}):e.jsxs(e.Fragment,{children:[e.jsx(v.default,{showUserStoryDiff:R,isParent:""===U,message:r.formatMarkdown(B.value)||"",artifactId:B.artifactId,customStyles:ze,isDisplayHighlightControl:F,contextVariant:H,showConfidenceScore:J,CDNeededInChip:ie}),oe&&e.jsx("div",{className:a.default.approveButtonContainer,style:null==Xe?void 0:Xe.container,children:e.jsx("button",{type:"button",className:a.default.approveButton,style:null==Xe?void 0:Xe.button,disabled:oe.disabled||oe.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=null==oe?void 0:oe.onClick)||void 0===t||t.call(oe)},children:oe.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.spinner,style:null==Xe?void 0:Xe.icon}),e.jsx("span",{style:null==Xe?void 0:Xe.text,children:oe.label})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{style:null==Xe?void 0:Xe.text,children:oe.label}),e.jsx(l.Check,{size:16,style:null==Xe?void 0:Xe.icon})]})})})]})]}),null===(je=it.sub_features)||void 0===je?void 0:je.map((t,l)=>{const o=w($,!1,t.artifactId);return e.jsx(b,{artifactId:x,isUserStoryCurrentlyUpdated:n,artifactTitleId:`${D}-${String.fromCharCode(65+l)}`,parentUserStory:B,parentIndex:`${U}${U&&"."}${A}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:e=>((e,t)=>{const l=[...B.sub_features||[]];l[e]=t,T({...B,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:P,showUserStoryDiff:R,updateUserStoryArtifact:q,handleDownloadUserStory:M,handleOpenSendDialog:_,isDisplayHighlightControl:F,elementDisplayConfig:$,_resolvedConfig:o,actionItemsConfig:W,onDelete:()=>(e=>{const t=(B.sub_features||[]).filter((t,l)=>l!==e),l={...B,sub_features:t};st(l),T(l)})(l),expandedSubFeatures:Q,disableEditPlan:le,useMuiTooltip:ne},t.artifactId)})]})})]});var Qt};exports.StoryCard=b,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:h,showWrapper:S,actionItemsConfig:g,contextVariant:x,showDisplayName:C,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:N,defaultExpanded:D,showCompletionPanel:E=!1,showAddSectionButton:B=!1,disableEditPlan:T=!1,useMuiTooltip:U=!1,approveButtonConfig:A,CDNeededInChip:k,setRedlineDocumentIdParent:P})=>{const{userStory:R,setUserStory:M,customStyles:_,searchQueryList:q,currentHighlightIndex:L,setCurrentHighlightIndex:F,segmentComponentConfig:$,sectionStatusConfig:V,redlineConfig:O,setRedlineDocumentId:z}=p.useRequirementAI(),W=null==_?void 0:_.userStoryCardStyles,G=0===L,H=L===q.length-1;return t.useEffect(()=>{if(!(null==O?void 0:O.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await y.getRedlineDocumentId({baseApiUrl:O.documentBaseApiUrl||"",comparisonId:O.documentComparisonId||""});if(t)z(t);else{const{document_id:t}=await y.createRedlineDocument({baseApiUrl:O.baseApiUrl,changelogConfigId:O.changelogConfigId,comparisonId:O.documentComparisonId,artifactId:O.artifactId,inputData:O.inputData,redlineConfigId:O.redlineConfigId,userEmail:O.userEmail,userName:O.userName},null!==(e=null==O?void 0:O.token)&&void 0!==e?e:"");t&&(z(t),null==P||P(t))}})()},[]),e.jsxs("div",{className:a.default.userStoryCardWrapper,style:m?{...null==W?void 0:W.userStoryCardWrapper,position:"relative"}:null==W?void 0:W.userStoryCardWrapper,children:[m&&e.jsx(e.Fragment,{children:q.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:[L+1," of ",q.length]}),e.jsxs("div",{className:a.default.navButtons,children:[e.jsx("button",{onClick:()=>{L>0&&F(e=>e-1)},className:a.default.navButton,disabled:G,children:e.jsx(l.ChevronUpIcon,{size:20,className:a.default.navIcon})}),e.jsx("button",{onClick:()=>{L<q.length-1&&F(e=>e+1)},className:a.default.navButton,disabled:H,children:e.jsx(l.ChevronDownIcon,{size:20,className:a.default.navIcon})})]})]})})})}),R.map((t,l)=>{const a=w(h,!0);return e.jsx(b,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:t,onUserStoryChange:e=>{M(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:h,_resolvedConfig:a,showWrapper:S,defaultExpanded:D,actionItemsConfig:g,contextVariant:x,showDisplayName:C,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:N,sectionStatusConfig:V,showCompletionPanel:E,showAddSectionButton:B,disableEditPlan:T,useMuiTooltip:U,approveButtonConfig:A,CDNeededInChip:k},t.artifactId)})]})},exports.default=b,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"),m=require("./TitleEditor/TitleEditor.js"),h=require("../../../../service/redlineService.js"),y=require("./ClinicalTrialSection.js"),S=require("../story-screen/CompletionPanel.js"),x=require("../../icons/CDIcon.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var C=g(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 w(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 b=({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:g,artifactTitleId:D,parentUserStory:E,currentUserStory:B,onUserStoryChange:T,parentIndex:k,currentIndex:A,enableDownload:U,isDiffEditReviewMode:P,showUserStoryDiff:R,handleDownloadUserStory:M,handleOpenSendDialog:F,updateUserStoryArtifact:_,selectedArtifactId:q,isDisplayHighlightControl:L,elementDisplayConfig:V,_resolvedConfig:W,showWrapper:z=!1,defaultExpanded:O,actionItemsConfig:$,onDelete:G,contextVariant:H,expandedSubFeatures:Q,showDisplayName:X=!0,allowTitleEdit:Z=!0,showConfidenceScore:J=!0,showBorderTop:K=!0,sectionStatusConfig:Y,showCompletionPanel:ee=!1,showAddSectionButton:te=!1,disableEditPlan:le=!1,useMuiTooltip:ne=!1,approveButtonConfig:oe,CDNeededInChip:ie,onAssignSectionClick:se})=>{var ae,re,de,ue,ce,ve,pe,fe,me,he,ye,Se,xe,ge,Ce,Ie,je,we;const{isLoadingSectionData:be=!1,onLoadSectionData:Ne,status:De,onStatusClick:Ee,completedCount:Be,totalCount:Te,isNoDataAvailable:ke=!1}=null!=Y?Y:{},{searchQueryList:Ae,citations:Ue,customStyles:Pe,onEditBlocked:Re,redlineDcoumentId:Me,redlineConfig:Fe,customSectionConfig:_e,updateRedlineDataParent:qe}=p.useRequirementAI(),Le=null==Pe?void 0:Pe.userStoryCardStyles,Ve=null==Le?void 0:Le.customSectionEditButton,We=null==Le?void 0:Le.statusStyles,ze=null===(ae=null==Pe?void 0:Pe.userStoryCardStyles)||void 0===ae?void 0:ae.userStoryEditStyles,Oe=null===(re=null==Pe?void 0:Pe.userStoryScreenStyles)||void 0===re?void 0:re.userStoryContentStyles,$e=null==Le?void 0:Le.progressHeaderStyles,Ge=null==Le?void 0:Le.clinicalTrialSectionStyles,He=null==Le?void 0:Le.CompletionStyles,Qe=null==Le?void 0:Le.noDataStyles,Xe=null==Le?void 0:Le.approveButtonStyles,Ze=null!==(ue=null===(de=null==_e?void 0:_e.shouldRender)||void 0===de?void 0:de.call(_e,B))&&void 0!==ue&&ue,Je=null===(ce=null==_e?void 0:_e.getValue)||void 0===ce?void 0:ce.call(_e,B),Ke=null!==(pe=null===(ve=null==_e?void 0:_e.getFields)||void 0===ve?void 0:ve.call(_e,B))&&void 0!==pe?pe:[],Ye=null!==(fe=null==_e?void 0:_e.isEditDisabled)&&void 0!==fe&&fe,et=null!==(he=null===(me=null==_e?void 0:_e.isSaving)||void 0===me?void 0:me.call(_e,B))&&void 0!==he&&he,tt=(lt=null!==(ye=B.completion_percentage)&&void 0!==ye?ye:0,nt=He,lt>=80?null==nt?void 0:nt.highCompletion:lt>=50?null==nt?void 0:nt.mediumCompletion:null==nt?void 0:nt.lowCompletion);var lt,nt;const ot={[p.SectionStatus.WAITING]:null==We?void 0:We.waiting,[p.SectionStatus.IN_PROGRESS]:null==We?void 0:We.inProgress,[p.SectionStatus.GENERATED]:null==We?void 0:We.generated,[p.SectionStatus.FAILED]:null==We?void 0:We.failed,[p.SectionStatus.GENERATE]:null==We?void 0:We.generate,[p.SectionStatus.APPROVED]:null==We?void 0:We.approved},[it,st]=t.useState({...structuredClone(B),value:r.formatMarkdown(B.value)||""}),[at,rt]=t.useState({userStory:!!B.isDefaultEdit}),[dt,ut]=t.useState(!1),[ct,vt]=t.useState(!1),[pt,ft]=t.useState(null),[mt,ht]=t.useState(null),{userStory:yt,customIcons:St}=p.useRequirementAI(),[xt,gt]=t.useState(null!=O?O:""===k||q===B.artifactId||!!B.isDefaultOpen),[Ct,It]=t.useState(!1),[jt,wt]=t.useState(null),[bt,Nt]=t.useState(null),[Dt,Et]=t.useState(!1),Bt=t.useRef(null),Tt=t.useRef(null),[kt,At]=t.useState(!1),[Ut,Pt]=t.useState(!1),Rt=t.useRef(null),[Mt,Ft]=t.useState(B.value);t.useEffect(()=>{n&&gt(n)},[n]),t.useEffect(()=>{st({...structuredClone(B),value:r.formatMarkdown(B.value)||""})},[B]),t.useEffect(()=>{Ae.length>0?gt(!0):void 0===O&&(q?gt(q===B.artifactId):Q&&Q.length>0&&gt(Q.includes(B.artifactId)))},[Ae,q,B.artifactId,Q]);const _t=()=>{wt(null)},qt=()=>{Nt(null)},Lt=()=>{xt&&at.userStory&&Tt.current&&!Tt.current.requestClose()||gt(e=>!e)},Vt=async()=>{var e;try{"userStory"==="userStory"&&(T(it),console.log("I am changing RTE editor values",it)),await _(Ue,yt,g,null===(e=Rt.current)||void 0===e?void 0:e.signal)}finally{}};const Wt=null!=(null==B?void 0:B.big_enough)&&!Number.isNaN(B.big_enough)&&!!(null==B?void 0:B.big_enough_decision_factors),zt=null!==(Se=null==B?void 0:B.completion_percentage)&&void 0!==Se?Se:0,Ot=!!(null==B?void 0:B.completion_decision_factors),$t=""===k,Gt=null!=W?W:w(V,$t),Ht=!P&&!R;t.useEffect(()=>{if(!mt)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${mt}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[mt]),t.useEffect(()=>{B.isDefaultEdit&&rt(e=>({...e,userStory:!0}))},[B.isDefaultEdit]);return t.useEffect(()=>Ft(B.value),[B.value]),e.jsxs("div",{className:a.default.card,style:null==Le?void 0:Le.cardStyle,id:`story-card-${B.title}`,"data-expanded":xt,children:[e.jsxs("div",{className:a.default.titleSection,style:null==Le?void 0:Le.titleSection,children:[e.jsxs("div",{className:a.default.titleRow,style:null==Le?void 0:Le.titleRow,onClick:Lt,children:[e.jsxs("div",{className:a.default.titleLeft,style:null==Le?void 0:Le.titleLeft,onMouseEnter:()=>At(!0),onMouseLeave:()=>At(!1),children:[X&&e.jsx(b,{displayName:D}),dt&&Ht?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))||[],st(n),T(n),ut(!1)}catch(e){console.error("Failed to save title",e)}})(e,B.artifactId),onCancel:()=>{ut(!1)},inputStyle:null==ze?void 0:ze.inlineTitleInput,confirmButtonStyle:null==ze?void 0:ze.inlineTitleConfirm,cancelButtonStyle:null==ze?void 0:ze.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:ne?void 0:B.title,className:a.default.storyTitle,style:null==Le?void 0:Le.storyTitle,children:j(B.title)},B.artifactId)}),ee&&!Ze&&(Ot?e.jsx(S.CompletionPanel,{customIcons:null==St?void 0:St.userStoryIcons,customStyles:null==Le?void 0:Le.aiReasoningCitaionStyles,currentUserStory:B,panelStyles:null==Le?void 0:Le.CompletionStyles,onToggleStateChange:Pt,children:e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==He?void 0:He.badge,...tt},children:[e.jsxs("span",{children:[zt,"% Completed"]}),e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(x.default,{color:"currentColor"})}),Ut?e.jsx(l.ChevronUp,{size:14,style:null==He?void 0:He.chevronStyle}):e.jsx(l.ChevronDown,{size:14,style:null==He?void 0:He.chevronStyle})]})}):e.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==He?void 0:He.badge,...tt},children:e.jsxs("span",{children:[zt,"% Completed"]})})),Z&&e.jsx("button",{type:"button",className:a.default.titleEditButton,style:null==ze?void 0:ze.titleEditButton,onClick:e=>{e.stopPropagation(),ut(!0),xt||gt(!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"})})})]})]}),(De||void 0!==Be&&void 0!==Te)&&e.jsxs("div",{className:a.default.statusContainer,children:[void 0!==Be&&void 0!==Te&&e.jsxs("div",{className:a.default.completedBadge,children:["Completed: ",Be,"/",Te]}),De&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==Ee||Ee()},className:a.default.statusButton,style:ot[De],children:I[De]})]}),e.jsxs("div",{className:a.default.titleActions,style:null==Le?void 0:Le.titleActions,onClick:e=>e.stopPropagation(),children:[(Gt.showProgressPercentage||Gt.showGapBox)&&z&&e.jsxs("div",{className:a.default.progressHeader,style:null==$e?void 0:$e.wrapper,children:[Gt.showProgressPercentage&&e.jsxs("div",{className:a.default.progressPercentage,style:null==$e?void 0:$e.percentage,children:[null!==(ge=null!==(xe=null==B?void 0:B.confidenceScore)&&void 0!==xe?xe:null==Gt?void 0:Gt.confidenceValue)&&void 0!==ge?ge:"0","%"]}),Gt.showGapBox&&e.jsxs("div",{className:a.default.gapBox,style:null==$e?void 0:$e.gapBox,children:[null!==(Ie=null!==(Ce=null==B?void 0:B.gapValue)&&void 0!==Ce?Ce:null==Gt?void 0:Gt.gapBoxValue)&&void 0!==Ie?Ie:"2"," ","Gaps"]})]}),Wt&&e.jsx(f.BigEnoughPanel,{customIcons:null==St?void 0:St.userStoryIcons,customStyles:null==Le?void 0:Le.aiReasoningCitaionStyles,currentUserStory:B,panelStyles:null==Le?void 0:Le.BigEnoughStyles}),e.jsx(o.Tooltip,{title:"Assign Section",arrow:!0,placement:"top",slotProps:{tooltip:{sx:{bgcolor:"#1E293B",color:"#FFFFFF",fontSize:"14px",fontWeight:400,px:2,py:2,borderRadius:"18px",boxShadow:"0px 8px 20px rgba(0,0,0,0.18)"}},arrow:{sx:{color:"#1E293B"}}},children:e.jsx("div",{style:{border:"1px solid #D1D5DB",padding:"5px 15px",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",background:"#FFFFFF"},onClick:se,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-users-round-icon lucide-users-round",children:[e.jsx("path",{d:"M18 21a8 8 0 0 0-16 0"}),e.jsx("circle",{cx:"10",cy:"8",r:"5"}),e.jsx("path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3"})]})})}),!at.userStory&&e.jsxs(e.Fragment,{children:[!1!==(null==Gt?void 0:Gt.showShareButton)&&e.jsx("button",{className:a.default.iconButton,style:null==Le?void 0:Le.iconButton,onClick:e=>{wt(e.currentTarget)},children:e.jsx(l.ExternalLink,{size:16})}),e.jsxs(o.Menu,{id:"user-story-share-menu",anchorEl:jt,open:!!jt,onClose:()=>wt(null),style:null==Le?void 0:Le.userStoryShareMenu,children:[U&&e.jsx(o.MenuItem,{style:null==Le?void 0:Le.userStoryMenuItem,onClick:async()=>{It(!0),M&&(await Promise.all([M("pdf"),M("doc")]),It(!1))},children:e.jsxs("div",{ref:Bt,className:a.default.menuItemContent,style:null==Le?void 0:Le.menuItemContent,children:[e.jsx(l.Download,{size:16,color:null==Le?void 0:Le.menuIconColor}),e.jsx("p",{style:null==Le?void 0:Le.menuLabel,children:"Download"})]})}),e.jsx(o.MenuItem,{style:null==Le?void 0:Le.userStoryMenuItem,onClick:async()=>{let e=B;E&&(e={...B,value:`${d.replaceTitleSection(null==E?void 0:E.value,B.title)} \n${B.value}`}),null==F||F(!0,[e],B.artifactId),_t()},children:e.jsxs("div",{style:null==Le?void 0:Le.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Share2,{size:16,color:null==Le?void 0:Le.menuIconColor}),e.jsx("p",{style:null==Le?void 0:Le.menuLabel,children:"Send"})]})}),e.jsx(o.MenuItem,{style:null==Le?void 0:Le.userStoryMenuItem,onClick:async()=>{const e=(new C.default.Converter).makeHtml(r.formatMarkdown(B.value)||B.value),t=function(e){const t=(new C.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{_t()}},children:e.jsxs("div",{style:null==Le?void 0:Le.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Copy,{size:16,color:null==Le?void 0:Le.menuIconColor}),e.jsx("p",{style:null==Le?void 0:Le.menuLabel,children:"Copy"})]})})]})]}),!Dt&&at.userStory&&xt?e.jsx(u.default,{type:"outline",children:"Cancel",style:null==Le?void 0:Le.cancelButton,onClick:()=>{var e;null===(e=Rt.current)||void 0===e||e.abort(),rt(e=>({...e,userStory:!1}))}}):e.jsx(e.Fragment,{}),at.userStory&&xt?e.jsx(u.default,{type:"fill",children:Dt?e.jsxs("span",{className:a.default.savingSpinner,style:null==Le?void 0:Le.savingSpinner,children:[e.jsx(l.LoaderCircle,{className:a.default.spinAnimation,style:null==Le?void 0:Le.spinAnimation}),e.jsx("span",{children:"Saving..."})]}):"Save",isDisable:Dt,style:Dt?null==Le?void 0:Le.savingButton:null==Le?void 0:Le.saveButton,onClick:async()=>{Et(!0),await Vt();let e=await(async()=>{var e,t,l,n,o;let i=it.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==Fe?void 0:Fe.callUpdateDocument){const{updated_reqai:s}=await h.updateRedlineDocument({documentId:Me,sectionId:B.artifactId,baseApiUrl:null==Fe?void 0:Fe.baseApiUrl,updatedContent:i,userEmail:Fe.userEmail,userName:Fe.userName,redlineConfigId:null!==(e=Fe.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Fe?void 0:Fe.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==qe?void 0:qe(s))}}catch(e){console.error("failed to update redline document",e),i=Mt}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={...it,value:e};T({...t,isDefaultEdit:!1}),Ft(t.value),rt(e=>({...e,userStory:!1})),Et(!1)}}):!P&&!R&&!le&&xt&&!1!==(null==Gt?void 0:Gt.showEditButton)&&e.jsx("button",{className:a.default.iconButton,style:null==Le?void 0:Le.editButton,onClick:()=>rt(e=>({...e,userStory:!0})),children:e.jsx(l.PencilIcon,{color:null==Le?void 0:Le.pencilIconColor,size:16})}),te&&$t&&xt&&!P&&!R&&!1!==(null==Gt?void 0:Gt.showEditButton)&&e.jsxs("button",{type:"button",className:a.default.addSectionButton,style:null==ze?void 0:ze.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]};st(a),T(a),gt(!0),ht(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"})]}),!$t&&!P&&!le&&!R&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==G||G()},className:a.default.iconButton,style:null==ze?void 0:ze.deleteButton,"aria-label":"Delete section",title:"Delete section",children:e.jsx(l.Trash2,{size:16})}),Ze&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==Ve?void 0:Ve.button,disabled:Ye,onClick:e=>{if(e.stopPropagation(),ct)return ft(null),void vt(!1);ft(structuredClone(null!=Je?Je:{})),gt(!0),vt(!0)},children:ct?e.jsx(l.X,{size:16,color:null==Le?void 0:Le.pencilIconColor,style:null==Ve?void 0:Ve.cancelIcon}):e.jsx(l.PencilIcon,{size:16,color:null==Le?void 0:Le.pencilIconColor,style:null==Ve?void 0:Ve.editIcon})}),(null==Gt?void 0:Gt.actionItemsButton)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:a.default.actionItemBtn,style:null==Le?void 0:Le.actionItemBtn,onClick:e=>{e.stopPropagation(),Nt(e.currentTarget)},children:e.jsx(l.Ellipsis,{})}),e.jsx(o.Menu,{id:"user-story-action-menu",anchorEl:bt,open:!!bt,onClose:qt,style:null==Le?void 0:Le.userStoryShareMenu,children:null==$?void 0:$.items.map((t,l)=>e.jsx(o.MenuItem,{style:null==Le?void 0:Le.userStoryMenuItem,onClick:()=>{t.onclick(B),qt()},children:e.jsxs("div",{className:a.default.menuItemContent,style:{...null==Le?void 0:Le.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[e.jsx("span",{className:a.default.menuItemIcon,style:null==Le?void 0:Le.menuItemIcon,children:t.icon}),e.jsx("p",{style:null==Le?void 0:Le.menuLabel,children:t.name}),e.jsx("span",{className:a.default.menuItemRight,style:null==Le?void 0:Le.menuItemRight})]})},`action-item-${l}-${t.name}`))})]}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),Lt()},style:null==Le?void 0:Le.chevronButton,className:a.default.chevronButton,children:xt?e.jsx(l.ChevronUp,{className:a.default.chevronIcon,color:null==Le?void 0:Le.chevronIconColor}):e.jsx(l.ChevronDown,{className:a.default.chevronIcon,color:null==Le?void 0:Le.chevronIconColor})})]})]}),e.jsx("div",{className:a.default.divider,style:null==Le?void 0:Le.dividerStyle})]}),xt&&e.jsx("div",{className:a.default.cardContent,style:{...null==Le?void 0:Le.cardContentStyle,borderTop:K?"1px solid #E5E5E5":"none"},children:be?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==Ne?void 0:Ne(),className:a.default.viewStatusButton,children:"View Status"})]}):ke?e.jsxs("div",{className:a.default.noDataContainer,style:null==Qe?void 0:Qe.container,children:[e.jsx("img",{src:i.default,alt:"No data available",className:a.default.noDataIllustration,style:null==Qe?void 0:Qe.illustration}),e.jsx("h3",{className:a.default.noDataTitle,style:null==Qe?void 0:Qe.title,children:"No Data Available for This Section"}),e.jsx("p",{className:a.default.noDataSubtitle,style:null==Qe?void 0:Qe.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==Le?void 0:Le.contentInner,children:[e.jsxs("div",{className:a.default.descriptionSection,style:null==Le?void 0:Le.descriptionSection,children:[e.jsx("div",{className:a.default.justifyBetween,style:null==Le?void 0:Le.justifyBetween}),at.userStory?e.jsx(c.default,{ref:Tt,minHeight:"100%",height:"100%",type:"string",value:r.formatMarkdown(Mt)||"",handleUpdateState:(e,t)=>{const l=r.indentMarkdown(t);st(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:at.userStory?"edit":"readOnly",onEditBlocked:Re,onSaveUnsavedChanges:async()=>{await Vt(),gt(!1)},onDiscardUnsavedChanges:()=>{st({...structuredClone(B),value:r.formatMarkdown(B.value)||""}),rt(e=>({...e,userStory:!1})),gt(!1)},isSavingUnsavedChanges:Dt}):Ze?e.jsx(y.default,{styles:Ge,fields:Ke,readonly:!ct,isSaving:et,value:null!==(je=null!=pt?pt:Je)&&void 0!==je?je:{},onChange:ft,onSave:async()=>{var e;pt&&(await(null===(e=null==_e?void 0:_e.onSave)||void 0===e?void 0:e.call(_e,B,pt)),ft(null),vt(!1))},onCancel:()=>{ft(null),vt(!1)}}):e.jsxs(e.Fragment,{children:[e.jsx(v.default,{showUserStoryDiff:R,isParent:""===k,message:r.formatMarkdown(B.value)||"",artifactId:B.artifactId,customStyles:Oe,isDisplayHighlightControl:L,contextVariant:H,showConfidenceScore:J,CDNeededInChip:ie}),oe&&e.jsx("div",{className:a.default.approveButtonContainer,style:null==Xe?void 0:Xe.container,children:e.jsx("button",{type:"button",className:a.default.approveButton,style:null==Xe?void 0:Xe.button,disabled:oe.disabled||oe.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=null==oe?void 0:oe.onClick)||void 0===t||t.call(oe)},children:oe.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.spinner,style:null==Xe?void 0:Xe.icon}),e.jsx("span",{style:null==Xe?void 0:Xe.text,children:oe.label})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{style:null==Xe?void 0:Xe.text,children:oe.label}),e.jsx(l.Check,{size:16,style:null==Xe?void 0:Xe.icon})]})})})]})]}),null===(we=it.sub_features)||void 0===we?void 0:we.map((t,l)=>{const o=w(V,!1,t.artifactId);return e.jsx(N,{artifactId:g,isUserStoryCurrentlyUpdated:n,artifactTitleId:`${D}-${String.fromCharCode(65+l)}`,parentUserStory:B,parentIndex:`${k}${k&&"."}${A}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:e=>((e,t)=>{const l=[...B.sub_features||[]];l[e]=t,T({...B,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:P,showUserStoryDiff:R,updateUserStoryArtifact:_,handleDownloadUserStory:M,handleOpenSendDialog:F,isDisplayHighlightControl:L,elementDisplayConfig:V,_resolvedConfig:o,actionItemsConfig:$,onDelete:()=>(e=>{const t=(B.sub_features||[]).filter((t,l)=>l!==e),l={...B,sub_features:t};st(l),T(l)})(l),expandedSubFeatures:Q,disableEditPlan:le,useMuiTooltip:ne},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:x,contextVariant:g,showDisplayName:C,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:b,defaultExpanded:D,showCompletionPanel:E=!1,showAddSectionButton:B=!1,disableEditPlan:T=!1,useMuiTooltip:k=!1,approveButtonConfig:A,CDNeededInChip:U,setRedlineDocumentIdParent:P})=>{const{userStory:R,setUserStory:M,customStyles:F,searchQueryList:_,currentHighlightIndex:q,setCurrentHighlightIndex:L,segmentComponentConfig:V,sectionStatusConfig:W,redlineConfig:z,setRedlineDocumentId:O}=p.useRequirementAI(),$=null==F?void 0:F.userStoryCardStyles,G=0===q,H=q===_.length-1;return t.useEffect(()=>{if(!(null==z?void 0:z.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await h.getRedlineDocumentId({baseApiUrl:z.documentBaseApiUrl||"",comparisonId:z.documentComparisonId||""});if(t)O(t);else{const{document_id:t}=await h.createRedlineDocument({baseApiUrl:z.baseApiUrl,changelogConfigId:z.changelogConfigId,comparisonId:z.documentComparisonId,artifactId:z.artifactId,inputData:z.inputData,redlineConfigId:z.redlineConfigId,userEmail:z.userEmail,userName:z.userName},null!==(e=null==z?void 0:z.token)&&void 0!==e?e:"");t&&(O(t),null==P||P(t))}})()},[]),e.jsxs("div",{className:a.default.userStoryCardWrapper,style:m?{...null==$?void 0:$.userStoryCardWrapper,position:"relative"}:null==$?void 0:$.userStoryCardWrapper,children:[m&&e.jsx(e.Fragment,{children:_.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:[q+1," of ",_.length]}),e.jsxs("div",{className:a.default.navButtons,children:[e.jsx("button",{onClick:()=>{q>0&&L(e=>e-1)},className:a.default.navButton,disabled:G,children:e.jsx(l.ChevronUpIcon,{size:20,className:a.default.navIcon})}),e.jsx("button",{onClick:()=>{q<_.length-1&&L(e=>e+1)},className:a.default.navButton,disabled:H,children:e.jsx(l.ChevronDownIcon,{size:20,className:a.default.navIcon})})]})]})})})}),R.map((t,l)=>{const a=w(y,!0);return e.jsx(N,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:t,onUserStoryChange:e=>{M(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:D,actionItemsConfig:x,contextVariant:g,showDisplayName:C,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:b,sectionStatusConfig:W,showCompletionPanel:E,showAddSectionButton:B,disableEditPlan:T,useMuiTooltip:k,approveButtonConfig:A,CDNeededInChip:U},t.artifactId)})]})},exports.default=N,exports.replaceLearnedTagsWithInfo=j;
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("@mui/material"),n=require("../../../utils/css.utils.js"),i=require("./InlineUpdatedComponent.module.css.js"),o=require("../../../icons/CognitiveDecision.js"),t=require("lucide-react"),r=require("react");exports.default=({aiReason:d,children:s,customStyles:a,handleClickCognitiveDecision:u,handleClickUpdatedPill:c,handleClickOutputValue:v,customIcons:p,CDNeededInChip:f=!0})=>{var g,m,h,x,j,C,y,b,_,w,k,D,N,P,S,T,q,O,$,I,L,R,z;const E=r.useRef(null),A=r.useRef(null),[W,M]=r.useState(null),U=r.useCallback(()=>{var e;const l=A.current,n=(null===(e=E.current)||void 0===e?void 0:e.offsetParent)||(null==l?void 0:l.offsetParent);if(!(l&&n instanceof HTMLElement))return;const i=l.getBoundingClientRect(),o=n.getBoundingClientRect(),t=i.top-o.top+i.height/2;M(e=>null!==e&&Math.abs(e-t)<.5?e:t)},[]);r.useLayoutEffect(()=>{U()}),r.useLayoutEffect(()=>{var e,l;if("undefined"==typeof window)return;const n=window.requestAnimationFrame(U);window.addEventListener("resize",U);const i="undefined"!=typeof ResizeObserver?new ResizeObserver(U):null;A.current&&(null==i||i.observe(A.current));const o=(null===(e=E.current)||void 0===e?void 0:e.offsetParent)||(null===(l=A.current)||void 0===l?void 0:l.offsetParent);return o instanceof HTMLElement&&(null==i||i.observe(o)),()=>{window.cancelAnimationFrame(n),window.removeEventListener("resize",U),null==i||i.disconnect()}},[U]);const F="pending"!==(null===(g=d.redlining_details)||void 0===g?void 0:g.status)?"#303030":null===(x=null===(h=null===(m=d.redlining_details)||void 0===m?void 0:m.evaluation_outputs)||void 0===h?void 0:h.metadata)||void 0===x?void 0:x.label_color,B={color:F||"#000000",background:n.hexToOpacity(F||"#000000",25),border:`1px solid ${n.hexToOpacity(F||"#000000",75)}`},H=F||"#000000",V=n.hexToOpacity(F||"#000000",25),X={background:n.hexToOpacity(F||"#000000",75),...null==a?void 0:a.dividerStyle};let G=null;const J=null===(j=d.redlining_details)||void 0===j?void 0:j.status;"accepted"===J?G=null!==(C=null==p?void 0:p.accepted)&&void 0!==C?C:e.jsx(t.Check,{color:"#16A34A"}):"rejected"===J?G=null!==(y=null==p?void 0:p.rejected)&&void 0!==y?y:e.jsx(t.X,{color:"#DC2626"}):"reverted"===J&&(G=null!==(b=null==p?void 0:p.reverted)&&void 0!==b?b:e.jsx(t.Undo2,{color:"#475569"}));const K=null===W?{}:{"--inline-update-anchor-top":`${W}px`},Q=null===W?"":` ${i.default.anchorAligned}`;return e.jsxs("span",{className:i.default.inlineUpdatedWrapper,children:[G&&e.jsx("span",{className:`${i.default.resolvedStatus}${Q}`,style:{...K,...null==a?void 0:a.resolvedIcon},children:G}),e.jsx("span",{ref:E,id:d.id.toString(),onClick:e=>{e.stopPropagation(),null==c||c(e.currentTarget,d)},className:`${i.default.pillWrapper}${Q}`,style:{...K,...null==a?void 0:a.pillStyleWrapper},children:e.jsxs("span",{className:i.default.pillComponent,style:{...B,...null===(_=null==a?void 0:a.pillComponent)||void 0===_?void 0:_.commonStyle},children:[e.jsx("span",{children:(null===(D=null===(k=null===(w=d.redlining_details)||void 0===w?void 0:w.evaluation_outputs)||void 0===k?void 0:k.metadata)||void 0===D?void 0:D.label_text)||""}),e.jsx(l.Divider,{className:i.default.dividerStyle,style:X}),e.jsx("span",{className:i.default["output-container"],onClick:e=>{v&&(e.stopPropagation(),null==v||v(e.currentTarget,d))},children:d.resolving?e.jsx(l.CircularProgress,{size:(null===(N=null==a?void 0:a.loader)||void 0===N?void 0:N.size)||18,"aria-label":"Loading…",sx:{color:(null===(P=null==a?void 0:a.loader)||void 0===P?void 0:P.color)||F}}):"pending"!==(null===(S=d.redlining_details)||void 0===S?void 0:S.status)?G:null===(q=null===(T=null==d?void 0:d.redlining_details)||void 0===T?void 0:T.evaluation_outputs)||void 0===q?void 0:q.output_value}),f&&e.jsxs(e.Fragment,{children:[e.jsx(l.Divider,{className:i.default.dividerStyle,style:X}),e.jsx("span",{onClick:e=>{e.stopPropagation(),null==u||u(e.currentTarget,d)},className:i.default.cognitiveDecisionWrapper,style:null===(O=null==a?void 0:a.cognitiveDecisionIcon)||void 0===O?void 0:O.wrapper,children:e.jsx(o.default,{color:(null===($=null==a?void 0:a.cognitiveDecisionIcon)||void 0===$?void 0:$.color)||H,backgroundColor:(null===(I=null==a?void 0:a.cognitiveDecisionIcon)||void 0===I?void 0:I.backgroundColor)||V})}),e.jsx("span",{className:i.default.chevronWrapper,style:null===(L=null==a?void 0:a.Chevron)||void 0===L?void 0:L.wrapper,children:e.jsx(t.ChevronDown,{color:(null===(R=null==a?void 0:a.Chevron)||void 0===R?void 0:R.color)||F})})]})]})}),e.jsx("span",{ref:A,className:i.default[`upt-${null===(z=d.redlining_details)||void 0===z?void 0:z.status}`],onClick:e=>{e.preventDefault(),e.stopPropagation(),E.current&&(null==c||c(E.current,d))},children:s})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("@mui/material"),n=require("../../../utils/css.utils.js"),i=require("./InlineUpdatedComponent.module.css.js"),o=require("../../../icons/CognitiveDecision.js"),t=require("lucide-react"),r=require("react");exports.default=({aiReason:d,children:s,customStyles:a,handleClickCognitiveDecision:u,handleClickUpdatedPill:c,handleClickOutputValue:v,customIcons:p,CDNeededInChip:f=!0})=>{var g,m,h,x,j,C,y,b,_,w,k,D,N,P,S,T,q,O,$,I,L;const R=r.useRef(null),E=r.useRef(null),[z,A]=r.useState(null),W=r.useCallback(()=>{var e;const l=E.current,n=(null===(e=R.current)||void 0===e?void 0:e.offsetParent)||(null==l?void 0:l.offsetParent);if(!(l&&n instanceof HTMLElement))return;const i=l.getBoundingClientRect(),o=n.getBoundingClientRect(),t=i.top-o.top+i.height/2;A(e=>null!==e&&Math.abs(e-t)<.5?e:t)},[]);r.useLayoutEffect(()=>{W()}),r.useLayoutEffect(()=>{var e,l;if("undefined"==typeof window)return;const n=window.requestAnimationFrame(W);window.addEventListener("resize",W);const i="undefined"!=typeof ResizeObserver?new ResizeObserver(W):null;E.current&&(null==i||i.observe(E.current));const o=(null===(e=R.current)||void 0===e?void 0:e.offsetParent)||(null===(l=E.current)||void 0===l?void 0:l.offsetParent);return o instanceof HTMLElement&&(null==i||i.observe(o)),()=>{window.cancelAnimationFrame(n),window.removeEventListener("resize",W),null==i||i.disconnect()}},[W]);const M="pending"!==(null===(g=d.redlining_details)||void 0===g?void 0:g.status)?"#303030":null===(x=null===(h=null===(m=d.redlining_details)||void 0===m?void 0:m.evaluation_outputs)||void 0===h?void 0:h.metadata)||void 0===x?void 0:x.label_color,U={color:M||"#000000",background:n.hexToOpacity(M||"#000000",25),border:`1px solid ${n.hexToOpacity(M||"#000000",75)}`},F=M||"#000000",B=n.hexToOpacity(M||"#000000",25),H={background:n.hexToOpacity(M||"#000000",75),...null==a?void 0:a.dividerStyle};let V=null;const X=null===(j=d.redlining_details)||void 0===j?void 0:j.status;"accepted"===X?V=null!==(C=null==p?void 0:p.accepted)&&void 0!==C?C:e.jsx(t.Check,{color:"#16A34A"}):"rejected"===X?V=null!==(y=null==p?void 0:p.rejected)&&void 0!==y?y:e.jsx(t.X,{color:"#DC2626"}):"reverted"===X&&(V=null!==(b=null==p?void 0:p.reverted)&&void 0!==b?b:e.jsx(t.Undo2,{color:"#475569"}));const G=null===z?{}:{"--inline-update-anchor-top":`${z}px`},J=null===z?"":` ${i.default.anchorAligned}`;return e.jsxs("span",{className:i.default.inlineUpdatedWrapper,children:[V&&e.jsx("span",{className:`${i.default.resolvedStatus}${J}`,style:{...G,...null==a?void 0:a.resolvedIcon},children:V}),e.jsx("span",{ref:R,id:d.id.toString(),onClick:e=>{e.stopPropagation(),null==c||c(e.currentTarget,d)},className:`${i.default.pillWrapper}${J}`,style:{...G,...null==a?void 0:a.pillStyleWrapper},children:e.jsxs("span",{className:i.default.pillComponent,style:{...U,...null===(_=null==a?void 0:a.pillComponent)||void 0===_?void 0:_.commonStyle},children:[e.jsx("span",{children:(null===(D=null===(k=null===(w=d.redlining_details)||void 0===w?void 0:w.evaluation_outputs)||void 0===k?void 0:k.metadata)||void 0===D?void 0:D.label_text)||""}),e.jsx(l.Divider,{className:i.default.dividerStyle,style:H}),e.jsx("span",{className:i.default["output-container"],onClick:e=>{v&&(e.stopPropagation(),null==v||v(e.currentTarget,d))},children:d.resolving?e.jsx(l.CircularProgress,{size:20,"aria-label":"Loading…"}):"pending"!==(null===(N=d.redlining_details)||void 0===N?void 0:N.status)?V:null===(S=null===(P=null==d?void 0:d.redlining_details)||void 0===P?void 0:P.evaluation_outputs)||void 0===S?void 0:S.output_value}),f&&e.jsxs(e.Fragment,{children:[e.jsx(l.Divider,{className:i.default.dividerStyle,style:H}),e.jsx("span",{onClick:e=>{e.stopPropagation(),null==u||u(e.currentTarget,d)},className:i.default.cognitiveDecisionWrapper,style:null===(T=null==a?void 0:a.cognitiveDecisionIcon)||void 0===T?void 0:T.wrapper,children:e.jsx(o.default,{color:(null===(q=null==a?void 0:a.cognitiveDecisionIcon)||void 0===q?void 0:q.color)||F,backgroundColor:(null===(O=null==a?void 0:a.cognitiveDecisionIcon)||void 0===O?void 0:O.backgroundColor)||B})}),e.jsx("span",{className:i.default.chevronWrapper,style:null===($=null==a?void 0:a.Chevron)||void 0===$?void 0:$.wrapper,children:e.jsx(t.ChevronDown,{color:(null===(I=null==a?void 0:a.Chevron)||void 0===I?void 0:I.color)||M})})]})]})}),e.jsx("span",{ref:E,className:i.default[`upt-${null===(L=d.redlining_details)||void 0===L?void 0:L.status}`],onClick:e=>{e.preventDefault(),e.stopPropagation(),R.current&&(null==c||c(R.current,d))},children:s})]})};
2
2
  //# sourceMappingURL=InlineUpdatedComponent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.extractAllAiReasoningIds=e=>{const r=(new DOMParser).parseFromString(e,"text/html");return Array.from(r.querySelectorAll('a[href^="ai_reasoning$"]')).map(e=>e.getAttribute("href").replace("ai_reasoning$",""))},exports.formatMarkdown=function(e){try{return e}catch(e){console.error("Error in formatMarkdown",e)}},exports.indentMarkdown=function(e){return e.includes("Acceptance Criteria")?e=null==(e=null==(e=null==(e=null==e?void 0:e.replace(/\\n/g,"\n"))?void 0:e.replace(/(\*\*.+?\*\*)\s*:/g,"\n$1:\n"))?void 0:e.replace(/(?<!\d)(\d+(?:\.\d+)+)\./g,(e,r)=>{const n=r.split(".");return`${" ".repeat(n.length-1)}${r}.`}))?void 0:e.replace(/([^\n])\n(?![\n\*#])/g,"$1<br>\n"):e},exports.stripAiReasoningAnchors=e=>{const r=(new DOMParser).parseFromString(e,"text/html");return r.querySelectorAll('a[href^="ai_reasoning$"]').forEach(e=>{e.remove()}),r.body.innerHTML.trim()},exports.stripHtmlAndMetadata=e=>{if(!e)return"";e=(e=(e=(e=(e=e.replace(/%&&%[\s\S]*?%&&%/g,"")).replace(/<!--[\s\S]*?-->/g,"")).replace(/<crredirection[^>]*>[\s\S]*?<\/crredirection>/gi,"")).replace(/<answerExample[^>]*>[\s\S]*?<\/answerExample>/gi,"")).replace(/<a\s+data-cognitive-reasoning[^>]*>[\s\S]*?<\/a>/gi,"");return["b","strong","i","em","u","ol","ul","li","p","div","span","h1","h2","h3","h4","h5","h6","highlight","br","hr"].forEach(r=>{const n=new RegExp(`</?${r}[^>]*>`,"gi");e=e.replace(n,"")}),e=(e=(e=(e=(e=e.replace("ð","")).replace(/\*\*/g,"")).replace(/\n/g," ")).replace(/\s+/g," ")).trim()};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.extractAllAiReasoningIds=e=>{const r=(new DOMParser).parseFromString(e,"text/html");return Array.from(r.querySelectorAll('a[href^="ai_reasoning$"]')).map(e=>e.getAttribute("href").replace("ai_reasoning$",""))},exports.formatMarkdown=function(e){try{return e=null==e?void 0:e.replace(/(?<!\d)(\d+(?:\.\d+)+)\./g,(e,r)=>{const n=r.split(".");return`${" ".repeat(n.length-1)}${r}.`})}catch(e){console.error("Error in formatMarkdown",e)}},exports.indentMarkdown=function(e){return e.includes("Acceptance Criteria")?e=null==(e=null==(e=null==(e=null==e?void 0:e.replace(/\\n/g,"\n"))?void 0:e.replace(/(\*\*.+?\*\*)\s*:/g,"\n$1:\n"))?void 0:e.replace(/(?<!\d)(\d+(?:\.\d+)+)\./g,(e,r)=>{const n=r.split(".");return`${" ".repeat(n.length-1)}${r}.`}))?void 0:e.replace(/([^\n])\n(?![\n\*#])/g,"$1<br>\n"):e},exports.stripAiReasoningAnchors=e=>{const r=(new DOMParser).parseFromString(e,"text/html");return r.querySelectorAll('a[href^="ai_reasoning$"]').forEach(e=>{e.remove()}),r.body.innerHTML.trim()},exports.stripHtmlAndMetadata=e=>{if(!e)return"";e=(e=(e=(e=(e=e.replace(/%&&%[\s\S]*?%&&%/g,"")).replace(/<!--[\s\S]*?-->/g,"")).replace(/<crredirection[^>]*>[\s\S]*?<\/crredirection>/gi,"")).replace(/<answerExample[^>]*>[\s\S]*?<\/answerExample>/gi,"")).replace(/<a\s+data-cognitive-reasoning[^>]*>[\s\S]*?<\/a>/gi,"");return["b","strong","i","em","u","ol","ul","li","p","div","span","h1","h2","h3","h4","h5","h6","highlight","br","hr"].forEach(r=>{const n=new RegExp(`</?${r}[^>]*>`,"gi");e=e.replace(n,"")}),e=(e=(e=(e=(e=e.replace("ð","")).replace(/\*\*/g,"")).replace(/\n/g," ")).replace(/\s+/g," ")).trim()};
2
2
  //# sourceMappingURL=helpers.js.map