@e-llm-studio/requirement-ai 0.0.207 → 0.0.208

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 (20) hide show
  1. package/dist/cjs/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.js +1 -1
  2. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  3. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  4. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.module.css.js +1 -1
  5. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.js +1 -1
  6. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.module.css.js +1 -1
  7. package/dist/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.js +1 -1
  8. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  9. package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  10. package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.module.css.js +1 -1
  11. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.js +1 -1
  12. package/dist/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.module.css.js +1 -1
  13. package/dist/types/src/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.d.ts.map +1 -1
  14. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +6 -2
  15. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  16. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts +7 -1
  17. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts.map +1 -1
  18. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.d.ts +4 -1
  19. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.d.ts.map +1 -1
  20. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("react"),l=require("lucide-react"),o=require("@mui/material"),s=require("uuid"),t=require("../RiskSidebarCategorySection/RiskSidebarCategorySection.js"),a=require("../RiskCategorySection/RiskCategorySection.js"),d=require("./StoryNode.module.css.js"),r=function(i){var e,n,l,o,s,t,a,d=(null===(n=null===(e=i.display_items)||void 0===e?void 0:e.critical)||void 0===n?void 0:n.length)||0,c=(null===(o=null===(l=i.display_items)||void 0===l?void 0:l.warning)||void 0===o?void 0:o.length)||0,u=(null===(t=null===(s=i.display_items)||void 0===s?void 0:s.recommendation)||void 0===t?void 0:t.length)||0;if((null===(a=i.sub_feature)||void 0===a?void 0:a.length)>0)for(var v=0,g=i.sub_feature;v<g.length;v++){var m=g[v],h=r(m);d+=h.critical,c+=h.warning,u+=h.recommendation}return{critical:d,warning:c,recommendation:u}};function c(n,t,a,r){for(var c,u=[],v=/<learned>(.*?)<\/learned>/g,g=0,m=0,h=t||l.Info;null!==(c=v.exec(n));){c[0];var p=c[1],_=c.index;_>g&&u.push(e.jsx("span",{children:n.slice(g,_)},"text-pre-".concat(m++))),u.push(e.jsx(o.Tooltip,i.__assign({title:p,placement:"top"},{children:e.jsx(h,{size:r||16,className:d.default.infoIcon,style:{color:a,width:r,height:r}})}),"tooltip-".concat(s.v4()))),g=v.lastIndex}return g<(null==n?void 0:n.length)&&u.push(e.jsx("span",{children:n.slice(g)},"text-post-".concat(m++))),u}var u=function(s){var v,g,m,h,p,_,y,f,C,x,I,S,j,k,b,w,R,N,G,q,z,W,A,F,P=s.story,H=s.depth,M=void 0===H?0:H,T=s.onClickStoryNodeCallback,L=s.type,O=s.isProcessingGapItems,B=s.onClickAiReasoning,D=s.handleFixRisk,E=s.handleHighlightGapContent,J=s.customStyles,K=s.customIcons,Q=s.onSelectStory,U=s.rootArtifactId,V=void 0===U?P.id:U,X=n.useState(0===M),Y=X[0],Z=X[1],$=n.useState(!1),ii=$[0],ei=$[1],ni=null==J?void 0:J.storyNode,li=(null===(v=null==K?void 0:K.icons)||void 0===v?void 0:v.bookmarkIcon)||l.Bookmark,oi=(null===(g=null==K?void 0:K.icons)||void 0===g?void 0:g.chevronDownIcon)||l.ChevronDown,si=(null===(m=null==K?void 0:K.icons)||void 0===m?void 0:m.chevronRightIcon)||l.ChevronRight,ti=n.useMemo(function(){return P.display_items.critical.length>0?"Critical":P.display_items.warning.length>0?"Warning":P.display_items.recommendation.length>0?"Suggestion":null},[P.display_items,L]),ai=n.useMemo(function(){return r(P)},[P]),di=0===((null===(p=null===(h=P.display_items)||void 0===h?void 0:h.critical)||void 0===p?void 0:p.length)||0)+((null===(y=null===(_=P.display_items)||void 0===_?void 0:_.warning)||void 0===y?void 0:y.length)||0)+((null===(C=null===(f=P.display_items)||void 0===f?void 0:f.recommendation)||void 0===C?void 0:C.length)||0);return e.jsxs("div",i.__assign({className:"".concat(d.default.container," ").concat(M>0?d.default.nestedContainer:""),style:i.__assign(i.__assign({},null==ni?void 0:ni.container),M>0?null==ni?void 0:ni.nestedContainer:{})},{children:[e.jsxs("div",i.__assign({onClick:function(){Z(!Y),null==T||T(),null==Q||Q(V)},className:d.default.headerRow,style:i.__assign(i.__assign({},null==ni?void 0:ni.headerRow),ii?null==ni?void 0:ni.headerRowHover:{}),onMouseEnter:function(){return ei(!0)},onMouseLeave:function(){return ei(!1)}},{children:[e.jsx("div",i.__assign({className:d.default.chevronWrapper,style:null==ni?void 0:ni.chevronWrapper},{children:Y?e.jsx(oi,{className:d.default.chevronIcon,style:{color:null===(x=null==K?void 0:K.iconColors)||void 0===x?void 0:x.chevronIcon,width:null===(I=null==K?void 0:K.iconSizes)||void 0===I?void 0:I.chevronIcon,height:null===(S=null==K?void 0:K.iconSizes)||void 0===S?void 0:S.chevronIcon}}):e.jsx(si,{className:d.default.chevronIcon,style:{color:null===(j=null==K?void 0:K.iconColors)||void 0===j?void 0:j.chevronIcon,width:null===(k=null==K?void 0:K.iconSizes)||void 0===k?void 0:k.chevronIcon,height:null===(b=null==K?void 0:K.iconSizes)||void 0===b?void 0:b.chevronIcon}})})),e.jsxs("div",i.__assign({className:d.default.headerContent,style:null==ni?void 0:ni.headerContent},{children:[e.jsxs("div",i.__assign({className:d.default.artifactIdRow,style:null==ni?void 0:ni.artifactIdRow},{children:[e.jsx(li,{className:d.default.bookmarkIcon,style:{color:null===(w=null==K?void 0:K.iconColors)||void 0===w?void 0:w.bookmarkIcon,width:null===(R=null==K?void 0:K.iconSizes)||void 0===R?void 0:R.bookmarkIcon,height:null===(N=null==K?void 0:K.iconSizes)||void 0===N?void 0:N.bookmarkIcon}}),e.jsx("span",i.__assign({style:null==ni?void 0:ni.artifactIdText},{children:P.artifactTitleID}))]})),e.jsx(o.Tooltip,i.__assign({title:c(P.title,null===(G=null==K?void 0:K.icons)||void 0===G?void 0:G.infoIcon,null===(q=null==K?void 0:K.iconColors)||void 0===q?void 0:q.infoIcon,null===(z=null==K?void 0:K.iconSizes)||void 0===z?void 0:z.infoIcon),arrow:!0},{children:e.jsx("h3",i.__assign({className:d.default.title,style:i.__assign(i.__assign({},null==ni?void 0:ni.title),ii?null==ni?void 0:ni.titleHover:{})},{children:c(P.title,null===(W=null==K?void 0:K.icons)||void 0===W?void 0:W.infoIcon,null===(A=null==K?void 0:K.iconColors)||void 0===A?void 0:A.infoIcon,null===(F=null==K?void 0:K.iconSizes)||void 0===F?void 0:F.infoIcon)}))})),!Y&&e.jsx("div",i.__assign({className:d.default.collapsedSummary,style:null==ni?void 0:ni.collapsedSummary},{children:(0===M||ai.critical+ai.warning+ai.recommendation>0)&&e.jsxs(e.Fragment,{children:[e.jsx("span",i.__assign({className:d.default.summaryLabel,style:null==ni?void 0:ni.summaryLabel},{children:"Gap"===L?"Gaps : ":"Risks : "})),e.jsxs("div",i.__assign({className:d.default.summaryBadgesContainer,style:null==ni?void 0:ni.summaryBadgesContainer},{children:[ai.critical>0&&e.jsx(t.default,{title:"Critical",length:ai.critical,badgeColorClass:"critical",customStyles:J}),ai.warning>0&&e.jsx(t.default,{title:"Warning",length:ai.warning,badgeColorClass:"warning",customStyles:J}),ai.recommendation>0&&e.jsx(t.default,{title:"JAS",length:ai.recommendation,badgeColorClass:"suggestion",customStyles:J})]}))]})}))]}))]})),Y&&e.jsxs("div",i.__assign({className:d.default.expandedContent,style:null==ni?void 0:ni.expandedContent},{children:[e.jsx("div",i.__assign({className:d.default.expandedInnerPadding,style:null==ni?void 0:ni.expandedInnerPadding},{children:!di&&e.jsxs("div",i.__assign({className:d.default.itemsContainer,style:null==ni?void 0:ni.itemsContainer},{children:[e.jsx(a.default,{title:"Critical",items:P.display_items.critical,badgeColorClass:"critical",defaultOpen:"Critical"===ti,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K}),e.jsx(a.default,{title:"Warning",items:P.display_items.warning,badgeColorClass:"warning",defaultOpen:"Warning"===ti,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K}),e.jsx(a.default,{title:"Suggestion",items:P.display_items.recommendation,badgeColorClass:"suggestion",defaultOpen:"Suggestion"===ti,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K})]}))})),P.sub_feature&&P.sub_feature.length>0&&e.jsx("div",i.__assign({className:d.default.subFeaturesWrapper,style:null==ni?void 0:ni.subFeaturesWrapper},{children:P.sub_feature.map(function(i,n){return e.jsx(u,{story:i,depth:M+1,onClickStoryNodeCallback:T,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K,onSelectStory:Q,rootArtifactId:V},n)})}))]}))]}))};exports.default=u,exports.replaceLearnedTagsWithInfo=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("react"),l=require("lucide-react"),o=require("@mui/material"),s=require("uuid"),t=require("../RiskSidebarCategorySection/RiskSidebarCategorySection.js"),a=require("../RiskCategorySection/RiskCategorySection.js"),d=require("./StoryNode.module.css.js"),r=function(i){var e,n,l,o,s,t,a,d=(null===(n=null===(e=i.display_items)||void 0===e?void 0:e.critical)||void 0===n?void 0:n.length)||0,c=(null===(o=null===(l=i.display_items)||void 0===l?void 0:l.warning)||void 0===o?void 0:o.length)||0,u=(null===(t=null===(s=i.display_items)||void 0===s?void 0:s.recommendation)||void 0===t?void 0:t.length)||0;if((null===(a=i.sub_feature)||void 0===a?void 0:a.length)>0)for(var v=0,g=i.sub_feature;v<g.length;v++){var m=g[v],h=r(m);d+=h.critical,c+=h.warning,u+=h.recommendation}return{critical:d,warning:c,recommendation:u}};function c(n,t,a,r){for(var c,u=[],v=/<learned>(.*?)<\/learned>/g,g=0,m=0,h=t||l.Info;null!==(c=v.exec(n));){c[0];var p=c[1],y=c.index;y>g&&u.push(e.jsx("span",{children:n.slice(g,y)},"text-pre-".concat(m++))),u.push(e.jsx(o.Tooltip,i.__assign({title:p,placement:"top"},{children:e.jsx(h,{size:r||16,className:d.default.infoIcon,style:{color:a,width:r,height:r}})}),"tooltip-".concat(s.v4()))),g=v.lastIndex}return g<(null==n?void 0:n.length)&&u.push(e.jsx("span",{children:n.slice(g)},"text-post-".concat(m++))),u}var u=function(s){var v,g,m,h,p,y,_,f,C,x,I,S,j,k,b,w,N,R,G,q,z,F,W,A,P=s.story,H=s.depth,L=void 0===H?0:H,M=s.onClickStoryNodeCallback,T=s.type,O=s.isProcessingGapItems,B=s.onClickAiReasoning,D=s.handleFixRisk,E=s.handleHighlightGapContent,J=s.customStyles,K=s.customIcons,Q=s.onSelectStory,U=s.rootArtifactId,V=void 0===U?P.id:U,X=n.useState(0===L),Y=X[0],Z=X[1],$=n.useState(!1),ii=$[0],ei=$[1],ni=null==J?void 0:J.storyNode,li=(null===(v=null==K?void 0:K.icons)||void 0===v?void 0:v.bookmarkIcon)||l.Bookmark,oi=(null===(g=null==K?void 0:K.icons)||void 0===g?void 0:g.chevronDownIcon)||l.ChevronDown,si=(null===(m=null==K?void 0:K.icons)||void 0===m?void 0:m.chevronRightIcon)||l.ChevronRight,ti=n.useMemo(function(){return P.display_items.critical.length>0?"Critical":P.display_items.warning.length>0?"Warning":P.display_items.recommendation.length>0?"Suggestion":null},[P.display_items,T]),ai=n.useMemo(function(){return r(P)},[P]),di=0===((null===(p=null===(h=P.display_items)||void 0===h?void 0:h.critical)||void 0===p?void 0:p.length)||0)+((null===(_=null===(y=P.display_items)||void 0===y?void 0:y.warning)||void 0===_?void 0:_.length)||0)+((null===(C=null===(f=P.display_items)||void 0===f?void 0:f.recommendation)||void 0===C?void 0:C.length)||0);return e.jsxs("div",i.__assign({className:"".concat(d.default.container," ").concat(L>0?d.default.nestedContainer:""),style:i.__assign(i.__assign({},null==ni?void 0:ni.container),L>0?null==ni?void 0:ni.nestedContainer:{})},{children:[e.jsxs("div",i.__assign({onClick:function(){Z(!Y),null==M||M(),null==Q||Q(V)},className:d.default.headerRow,style:i.__assign(i.__assign({},null==ni?void 0:ni.headerRow),ii?null==ni?void 0:ni.headerRowHover:{}),onMouseEnter:function(){return ei(!0)},onMouseLeave:function(){return ei(!1)}},{children:[e.jsx("div",i.__assign({className:d.default.chevronWrapper,style:null==ni?void 0:ni.chevronWrapper},{children:Y?e.jsx(oi,{className:d.default.chevronIcon,style:{color:null===(x=null==K?void 0:K.iconColors)||void 0===x?void 0:x.chevronIcon,width:null===(I=null==K?void 0:K.iconSizes)||void 0===I?void 0:I.chevronIcon,height:null===(S=null==K?void 0:K.iconSizes)||void 0===S?void 0:S.chevronIcon}}):e.jsx(si,{className:d.default.chevronIcon,style:{color:null===(j=null==K?void 0:K.iconColors)||void 0===j?void 0:j.chevronIcon,width:null===(k=null==K?void 0:K.iconSizes)||void 0===k?void 0:k.chevronIcon,height:null===(b=null==K?void 0:K.iconSizes)||void 0===b?void 0:b.chevronIcon}})})),e.jsxs("div",i.__assign({className:d.default.headerContent,style:null==ni?void 0:ni.headerContent},{children:[e.jsxs("div",i.__assign({className:d.default.artifactIdRow,style:null==ni?void 0:ni.artifactIdRow},{children:[e.jsx(li,{className:d.default.bookmarkIcon,style:{color:null===(w=null==K?void 0:K.iconColors)||void 0===w?void 0:w.bookmarkIcon,width:null===(N=null==K?void 0:K.iconSizes)||void 0===N?void 0:N.bookmarkIcon,height:null===(R=null==K?void 0:K.iconSizes)||void 0===R?void 0:R.bookmarkIcon}}),e.jsx("span",i.__assign({style:null==ni?void 0:ni.artifactIdText},{children:P.artifactTitleID}))]})),e.jsx(o.Tooltip,i.__assign({title:c(P.title,null===(G=null==K?void 0:K.icons)||void 0===G?void 0:G.infoIcon,null===(q=null==K?void 0:K.iconColors)||void 0===q?void 0:q.infoIcon,null===(z=null==K?void 0:K.iconSizes)||void 0===z?void 0:z.infoIcon),arrow:!0},{children:e.jsx("h3",i.__assign({className:d.default.title,style:i.__assign(i.__assign({},null==ni?void 0:ni.title),ii?null==ni?void 0:ni.titleHover:{})},{children:c(P.title,null===(F=null==K?void 0:K.icons)||void 0===F?void 0:F.infoIcon,null===(W=null==K?void 0:K.iconColors)||void 0===W?void 0:W.infoIcon,null===(A=null==K?void 0:K.iconSizes)||void 0===A?void 0:A.infoIcon)}))})),!Y&&e.jsx("div",i.__assign({className:d.default.collapsedSummary,style:null==ni?void 0:ni.collapsedSummary},{children:(0===L||ai.critical+ai.warning+ai.recommendation>0)&&e.jsxs(e.Fragment,{children:[e.jsx("span",i.__assign({className:d.default.summaryLabel,style:null==ni?void 0:ni.summaryLabel},{children:"Gap"===T?"Gaps : ":"Risks : "})),e.jsxs("div",i.__assign({className:d.default.summaryBadgesContainer,style:null==ni?void 0:ni.summaryBadgesContainer},{children:[ai.critical>0&&e.jsx(t.default,{title:"Critical",length:ai.critical,badgeColorClass:"critical",customStyles:J}),ai.warning>0&&e.jsx(t.default,{title:"Warning",length:ai.warning,badgeColorClass:"warning",customStyles:J}),ai.recommendation>0&&e.jsx(t.default,{title:"JAS",length:ai.recommendation,badgeColorClass:"suggestion",customStyles:J})]}))]})}))]}))]})),Y&&e.jsxs("div",i.__assign({className:d.default.expandedContent,style:null==ni?void 0:ni.expandedContent},{children:[e.jsx("div",i.__assign({className:d.default.expandedInnerPadding,style:null==ni?void 0:ni.expandedInnerPadding},{children:di?L>0&&e.jsx("span",i.__assign({className:d.default.summaryLabel,style:null==ni?void 0:ni.summaryLabel},{children:"Gaps: No Gaps Found"})):e.jsxs("div",i.__assign({className:d.default.itemsContainer,style:null==ni?void 0:ni.itemsContainer},{children:[e.jsx(a.default,{title:"Critical",items:P.display_items.critical,badgeColorClass:"critical",defaultOpen:"Critical"===ti,type:T,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K}),e.jsx(a.default,{title:"Warning",items:P.display_items.warning,badgeColorClass:"warning",defaultOpen:"Warning"===ti,type:T,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K}),e.jsx(a.default,{title:"Suggestion",items:P.display_items.recommendation,badgeColorClass:"suggestion",defaultOpen:"Suggestion"===ti,type:T,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K})]}))})),P.sub_feature&&P.sub_feature.length>0&&e.jsx("div",i.__assign({className:d.default.subFeaturesWrapper,style:null==ni?void 0:ni.subFeaturesWrapper},{children:P.sub_feature.map(function(i,n){return e.jsx(u,{story:i,depth:L+1,onClickStoryNodeCallback:M,type:T,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K,onSelectStory:Q,rootArtifactId:V},n)})}))]}))]}))};exports.default=u,exports.replaceLearnedTagsWithInfo=c;
2
2
  //# sourceMappingURL=StoryNode.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react"),s=require("showdown"),l=require("@mui/material"),o=require("../../icons/Illustration.svg.js"),a=require("uuid"),r=require("./UserStoryCard.module.css.js"),u=require("../../utils/helpers.js"),d=require("../../utils/user-story.utils.js"),c=require("../../shared/AtomicButton.js"),v=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),_=require("../RequirementAIWrapper/RequirementAIWrapper.js"),g=require("../story-screen/BigEnoughPanel.js"),p=require("./TitleEditor/TitleEditor.js"),h=require("./ClinicalTrialSection.js"),y=require("../story-screen/CompletionPanel.js"),m=require("../../icons/CDIcon.js");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x,C=S(s),j=((x={})[_.SectionStatus.WAITING]="WAITING TO GENERATE",x[_.SectionStatus.IN_PROGRESS]="IN PROGRESS",x[_.SectionStatus.GENERATED]="GENERATED",x[_.SectionStatus.FAILED]="FAILED",x[_.SectionStatus.GENERATE]="GENERATE",x[_.SectionStatus.APPROVED]="APPROVED",x);function I(t){for(var s,o=[],r=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(s=r.exec(t));){var c=s[1],v=s.index;v>u&&o.push(n.jsx("span",{children:t.slice(u,v)},"text-pre-".concat(d++))),o.push(n.jsx(l.Tooltip,e.__assign({title:c,placement:"top"},{children:n.jsx(i.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(a.v4()))),u=r.lastIndex}return u<(null==t?void 0:t.length)&&o.push(n.jsx("span",{children:t.slice(u)},"text-post-".concat(d++))),o}function w(n,t,i){var s;if(!n)return{};if(t)return e.__assign({},n.parentConfig);var l=e.__assign({},n.childConfig);return i&&(null===(s=n.subFeatureOverrides)||void 0===s?void 0:s[i])?e.__assign(e.__assign({},l),n.subFeatureOverrides[i]):l}var N=function(t){var s,l=t.displayName,o=_.useRequirementAI().customStyles,a=null===(s=null==o?void 0:o.userStoryCardStyles)||void 0===s?void 0:s.showDisplayName;return n.jsxs("div",e.__assign({className:r.default.displayName,style:null==a?void 0:a.wrapper},{children:[n.jsx(i.Bookmark,{className:r.default.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),n.jsxs("span",e.__assign({style:null==a?void 0:a.label},{children:[l,":"]}))]}))},b=function(s){var S,x,E,D,B,T,A,k,U,P,R,M,q,L,F,z,O,V,W,G,H,Q=s.isUserStoryCurrentlyUpdated,X=s.artifactId,Z=s.artifactTitleId,J=s.parentUserStory,K=s.currentUserStory,Y=s.onUserStoryChange,$=s.parentIndex,ee=s.currentIndex,ne=s.enableDownload,te=s.isDiffEditReviewMode,ie=s.showUserStoryDiff,se=s.handleDownloadUserStory,le=s.handleOpenSendDialog,oe=s.updateUserStoryArtifact,ae=s.selectedArtifactId,re=s.isDisplayHighlightControl,ue=s.elementDisplayConfig,de=s._resolvedConfig,ce=s.showWrapper,ve=void 0!==ce&&ce,fe=s.defaultExpanded,_e=s.actionItemsConfig,ge=s.onDelete,pe=s.contextVariant,he=s.expandedSubFeatures,ye=s.showDisplayName,me=void 0===ye||ye,Se=s.allowTitleEdit,xe=void 0===Se||Se,Ce=s.showConfidenceScore,je=void 0===Ce||Ce,Ie=s.showBorderTop,we=void 0===Ie||Ie,Ne=s.sectionStatusConfig,be=s.showCompletionPanel,Ee=void 0!==be&&be,De=s.showAddSectionButton,Be=void 0!==De&&De,Te=s.approveButtonConfig,Ae=null!=Ne?Ne:{},ke=Ae.isLoadingSectionData,Ue=void 0!==ke&&ke,Pe=Ae.onLoadSectionData,Re=Ae.status,Me=Ae.onStatusClick,qe=Ae.completedCount,Le=Ae.totalCount,Fe=Ae.isNoDataAvailable,ze=void 0!==Fe&&Fe,Oe=_.useRequirementAI(),Ve=Oe.searchQueryList,We=Oe.citations,Ge=Oe.customStyles,He=Oe.customSectionConfig,Qe=null==Ge?void 0:Ge.userStoryCardStyles,Xe=null==Qe?void 0:Qe.statusStyles,Ze=null===(x=null==Ge?void 0:Ge.userStoryCardStyles)||void 0===x?void 0:x.userStoryEditStyles,Je=null===(E=null==Ge?void 0:Ge.userStoryScreenStyles)||void 0===E?void 0:E.userStoryContentStyles,Ke=null==Qe?void 0:Qe.progressHeaderStyles,Ye=null==Qe?void 0:Qe.clinicalTrialSectionStyles,$e=null==Qe?void 0:Qe.CompletionStyles,en=null==Qe?void 0:Qe.noDataStyles,nn=null==Qe?void 0:Qe.approveButtonStyles,tn=null!==(B=null===(D=null==He?void 0:He.shouldRender)||void 0===D?void 0:D.call(He,K))&&void 0!==B&&B,sn=null===(T=null==He?void 0:He.getValue)||void 0===T?void 0:T.call(He,K),ln=null!==(k=null===(A=null==He?void 0:He.getFields)||void 0===A?void 0:A.call(He,K))&&void 0!==k?k:[],on=null!==(U=null==He?void 0:He.isEditDisabled)&&void 0!==U&&U,an=null!==(R=null===(P=null==He?void 0:He.isSaving)||void 0===P?void 0:P.call(He,K))&&void 0!==R&&R,rn=(G=null!==(M=K.completion_percentage)&&void 0!==M?M:0,H=$e,G>=80?null==H?void 0:H.highCompletion:G>=50?null==H?void 0:H.mediumCompletion:null==H?void 0:H.lowCompletion),un=((S={})[_.SectionStatus.WAITING]=null==Xe?void 0:Xe.waiting,S[_.SectionStatus.IN_PROGRESS]=null==Xe?void 0:Xe.inProgress,S[_.SectionStatus.GENERATED]=null==Xe?void 0:Xe.generated,S[_.SectionStatus.FAILED]=null==Xe?void 0:Xe.failed,S[_.SectionStatus.GENERATE]=null==Xe?void 0:Xe.generate,S[_.SectionStatus.APPROVED]=null==Xe?void 0:Xe.approved,S),dn=t.useState(e.__assign(e.__assign({},structuredClone(K)),{value:u.formatMarkdown(K.value)||""})),cn=dn[0],vn=dn[1],fn=t.useState({userStory:!!K.isDefaultEdit}),_n=fn[0],gn=fn[1],pn=t.useState(!1),hn=pn[0],yn=pn[1],mn=t.useState(!1),Sn=mn[0],xn=mn[1],Cn=t.useState(null),jn=Cn[0],In=Cn[1],wn=t.useState(null),Nn=wn[0],bn=wn[1],En=_.useRequirementAI(),Dn=En.userStory,Bn=En.customIcons,Tn=t.useState(null!=fe?fe:""===$||ae===K.artifactId||!!K.isDefaultOpen),An=Tn[0],kn=Tn[1],Un=t.useState(!1);Un[0];var Pn=Un[1],Rn=t.useState(null),Mn=Rn[0],qn=Rn[1],Ln=t.useState(null),Fn=Ln[0],zn=Ln[1],On=t.useState(!1),Vn=On[0],Wn=On[1],Gn=t.useRef(null),Hn=t.useState(!1);Hn[0];var Qn=Hn[1],Xn=t.useState(!1),Zn=Xn[0],Jn=Xn[1],Kn=t.useRef(null);t.useEffect(function(){Q&&kn(Q)},[Q]),t.useEffect(function(){vn(e.__assign(e.__assign({},structuredClone(K)),{value:u.formatMarkdown(K.value)||""}))},[K]),t.useEffect(function(){Ve.length>0?kn(!0):void 0===fe&&(ae?kn(ae===K.artifactId):he&&he.length>0&&kn(he.includes(K.artifactId)))},[Ve,ae,K.artifactId,he]);var Yn=function(){qn(null)},$n=function(){zn(null)},et=function(){kn(function(e){return!e})};var nt=null!=(null==K?void 0:K.big_enough)&&!Number.isNaN(K.big_enough)&&!!(null==K?void 0:K.big_enough_decision_factors),tt=null!==(q=null==K?void 0:K.completion_percentage)&&void 0!==q?q:0,it=!!(null==K?void 0:K.completion_decision_factors),st=""===$,lt=null!=de?de:w(ue,st),ot=!te&&!ie;return t.useEffect(function(){if(Nn){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(Nn));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[Nn]),t.useEffect(function(){K.isDefaultEdit&&gn(function(n){return e.__assign(e.__assign({},n),{userStory:!0})})},[K.isDefaultEdit]),n.jsxs("div",e.__assign({className:r.default.card,style:null==Qe?void 0:Qe.cardStyle,id:"story-card-".concat(K.title),"data-expanded":An},{children:[n.jsxs("div",e.__assign({className:r.default.titleSection,style:null==Qe?void 0:Qe.titleSection},{children:[n.jsxs("div",e.__assign({className:r.default.titleRow,style:null==Qe?void 0:Qe.titleRow,onClick:et},{children:[n.jsxs("div",e.__assign({className:r.default.titleLeft,style:null==Qe?void 0:Qe.titleLeft,onMouseEnter:function(){return Qn(!0)},onMouseLeave:function(){return Qn(!1)}},{children:[me&&n.jsx(N,{displayName:Z}),hn&&ot?n.jsx(p.InlineTitleEditor,{title:K.title,onSave:function(n){return function(n,t){return e.__awaiter(void 0,void 0,void 0,function(){var i,s;return e.__generator(this,function(l){try{i=e.__assign({},K),K.artifactId===t?i.title=n:i.sub_features=(null===(s=K.sub_features)||void 0===s?void 0:s.map(function(i){return i.artifactId===t?e.__assign(e.__assign({},i),{title:n}):i}))||[],vn(i),Y(i),yn(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(n,K.artifactId)},onCancel:function(){yn(!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"):n.jsxs("div",e.__assign({className:r.default.storyTitleWrapper},{children:[n.jsx("h2",e.__assign({title:K.title,className:r.default.storyTitle,style:null==Qe?void 0:Qe.storyTitle},{children:I(K.title)}),K.artifactId),Ee&&!tn&&(it?n.jsx(y.CompletionPanel,e.__assign({customIcons:null==Bn?void 0:Bn.userStoryIcons,customStyles:null==Qe?void 0:Qe.aiReasoningCitaionStyles,currentUserStory:K,panelStyles:null==Qe?void 0:Qe.CompletionStyles,onToggleStateChange:Jn},{children:n.jsxs("div",e.__assign({style:e.__assign(e.__assign({display:"inline-flex",alignItems:"center",gap:"4px"},null==$e?void 0:$e.badge),rn)},{children:[n.jsxs("span",{children:[tt,"% Completed"]}),n.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:n.jsx(m.default,{color:"currentColor"})})),Zn?n.jsx(i.ChevronUp,{size:14,style:null==$e?void 0:$e.chevronStyle}):n.jsx(i.ChevronDown,{size:14,style:null==$e?void 0:$e.chevronStyle})]}))})):n.jsx("div",e.__assign({style:e.__assign(e.__assign({display:"inline-flex",alignItems:"center",gap:"4px"},null==$e?void 0:$e.badge),rn)},{children:n.jsxs("span",{children:[tt,"% Completed"]})}))),xe&&n.jsx("button",e.__assign({type:"button",className:r.default.titleEditButton,style:null==Ze?void 0:Ze.titleEditButton,onClick:function(e){e.stopPropagation(),yn(!0),An||kn(!0)},"aria-label":"Edit title",title:"Edit title"},{children:n.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.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"})}))}))]}))]})),(Re||void 0!==qe&&void 0!==Le)&&n.jsxs("div",e.__assign({className:r.default.statusContainer},{children:[void 0!==qe&&void 0!==Le&&n.jsxs("div",e.__assign({className:r.default.completedBadge},{children:["Completed: ",qe,"/",Le]})),Re&&n.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==Me||Me()},className:r.default.statusButton,style:un[Re]},{children:j[Re]}))]})),n.jsxs("div",e.__assign({className:r.default.titleActions,style:null==Qe?void 0:Qe.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(lt.showProgressPercentage||lt.showGapBox)&&ve&&n.jsxs("div",e.__assign({className:r.default.progressHeader,style:null==Ke?void 0:Ke.wrapper},{children:[lt.showProgressPercentage&&n.jsxs("div",e.__assign({className:r.default.progressPercentage,style:null==Ke?void 0:Ke.percentage},{children:[null!==(F=null!==(L=null==K?void 0:K.confidenceScore)&&void 0!==L?L:null==lt?void 0:lt.confidenceValue)&&void 0!==F?F:"0","%"]})),lt.showGapBox&&n.jsxs("div",e.__assign({className:r.default.gapBox,style:null==Ke?void 0:Ke.gapBox},{children:[null!==(O=null!==(z=null==K?void 0:K.gapValue)&&void 0!==z?z:null==lt?void 0:lt.gapBoxValue)&&void 0!==O?O:"2"," ","Gaps"]}))]})),nt&&n.jsx(g.BigEnoughPanel,{customIcons:null==Bn?void 0:Bn.userStoryIcons,customStyles:null==Qe?void 0:Qe.aiReasoningCitaionStyles,currentUserStory:K,panelStyles:null==Qe?void 0:Qe.BigEnoughStyles}),!_n.userStory&&n.jsxs(n.Fragment,{children:[!1!==(null==lt?void 0:lt.showShareButton)&&n.jsx("button",e.__assign({className:r.default.iconButton,style:null==Qe?void 0:Qe.iconButton,onClick:function(e){qn(e.currentTarget)}},{children:n.jsx(i.ExternalLink,{size:16})})),n.jsxs(l.Menu,e.__assign({id:"user-story-share-menu",anchorEl:Mn,open:!!Mn,onClose:function(){return qn(null)},style:null==Qe?void 0:Qe.userStoryShareMenu},{children:[ne&&n.jsx(l.MenuItem,e.__assign({style:null==Qe?void 0:Qe.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return Pn(!0),se?[4,Promise.all([se("pdf"),se("doc")])]:[2];case 1:return e.sent(),Pn(!1),[2]}})})}},{children:n.jsxs("div",e.__assign({ref:Gn,className:r.default.menuItemContent,style:null==Qe?void 0:Qe.menuItemContent},{children:[n.jsx(i.Download,{size:16,color:null==Qe?void 0:Qe.menuIconColor}),n.jsx("p",e.__assign({style:null==Qe?void 0:Qe.menuLabel},{children:"Download"}))]}))})),n.jsx(l.MenuItem,e.__assign({style:null==Qe?void 0:Qe.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(t){return n=K,J&&(n=e.__assign(e.__assign({},K),{value:"".concat(d.replaceTitleSection(null==J?void 0:J.value,K.title)," \n").concat(K.value)})),null==le||le(!0,[n],K.artifactId),Yn(),[2]})})}},{children:n.jsxs("div",e.__assign({style:null==Qe?void 0:Qe.menuItemContent,className:r.default.menuItemContentPadded},{children:[n.jsx(i.Share2,{size:16,color:null==Qe?void 0:Qe.menuIconColor}),n.jsx("p",e.__assign({style:null==Qe?void 0:Qe.menuLabel},{children:"Send"}))]}))})),n.jsx(l.MenuItem,e.__assign({style:null==Qe?void 0:Qe.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,t,i,s,l;return e.__generator(this,function(e){switch(e.label){case 0:n=new C.default.Converter,t=n.makeHtml(u.formatMarkdown(K.value)||K.value),i=function(e){var n=(new C.default.Converter).makeHtml(e),t=document.createElement("div");return t.innerHTML=n,t.textContent||t.innerText||""}(u.formatMarkdown(K.value)||K.value),s=new ClipboardItem({"text/plain":new Blob([i],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,navigator.clipboard.write([s])];case 2:return e.sent(),console.log("Copied User Story"),[3,5];case 3:return l=e.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return Yn(),[7];case 5:return[2]}})})}},{children:n.jsxs("div",e.__assign({style:null==Qe?void 0:Qe.menuItemContent,className:r.default.menuItemContentPadded},{children:[n.jsx(i.Copy,{size:16,color:null==Qe?void 0:Qe.menuIconColor}),n.jsx("p",e.__assign({style:null==Qe?void 0:Qe.menuLabel},{children:"Copy"}))]}))}))]}))]}),_n.userStory&&An?n.jsx(c.default,{type:"outline",children:"Cancel",style:null==Qe?void 0:Qe.cancelButton,onClick:function(){var n;null===(n=Kn.current)||void 0===n||n.abort(),gn(function(n){return e.__assign(e.__assign({},n),{userStory:!1})})}}):n.jsx(n.Fragment,{}),_n.userStory&&An?n.jsx(c.default,{type:"fill",children:Vn?n.jsxs("span",e.__assign({className:r.default.savingSpinner,style:null==Qe?void 0:Qe.savingSpinner},{children:[n.jsx(i.LoaderCircle,{className:r.default.spinAnimation,style:null==Qe?void 0:Qe.spinAnimation}),n.jsx("span",{children:"Saving..."})]})):"Save",isDisable:Vn,style:Vn?null==Qe?void 0:Qe.savingButton:null==Qe?void 0:Qe.saveButton,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(t){switch(t.label){case 0:return Wn(!0),"userStory"==="userStory"&&(Y(cn),console.log("I am changing RTE editor values",cn)),[4,oe(We,Dn,X,null===(n=Kn.current)||void 0===n?void 0:n.signal)];case 1:return t.sent(),Y(e.__assign(e.__assign({},cn),{isDefaultEdit:!1})),gn(function(n){return e.__assign(e.__assign({},n),{userStory:!1})}),Wn(!1),[2]}})})}}):!te&&!ie&&An&&!1!==(null==lt?void 0:lt.showEditButton)&&n.jsx("button",e.__assign({className:r.default.iconButton,style:null==Qe?void 0:Qe.editButton,onClick:function(){return gn(function(n){return e.__assign(e.__assign({},n),{userStory:!0})})}},{children:n.jsx(i.PencilIcon,{color:null==Qe?void 0:Qe.pencilIconColor,size:16})})),Be&&st&&An&&!te&&!ie&&!1!==(null==lt?void 0:lt.showEditButton)&&n.jsxs("button",e.__assign({type:"button",className:r.default.addSectionButton,style:null==Ze?void 0:Ze.addSectionButton,onClick:function(n){var t,i,s;n.stopPropagation();var l=(null!==(i=null===(t=K.sub_features)||void 0===t?void 0:t.length)&&void 0!==i?i:0)+1,o={artifactId:a.v4(),title:"New Section ".concat(l),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},r=e.__assign(e.__assign({},K),{sub_features:e.__spreadArray(e.__spreadArray([],null!==(s=K.sub_features)&&void 0!==s?s:[],!0),[o],!1)});vn(r),Y(r),kn(!0),bn(o.title)},"aria-label":"Add section",title:"Add section"},{children:[n.jsx(i.Plus,{size:14}),n.jsx("span",e.__assign({className:r.default.addSectionLabel},{children:"Add Section"}))]})),!st&&!te&&!ie&&n.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==ge||ge()},className:r.default.iconButton,style:null==Ze?void 0:Ze.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:n.jsx(i.Trash2,{size:16})})),tn&&n.jsx("button",e.__assign({type:"button",className:r.default.iconButton,disabled:on,onClick:function(e){if(e.stopPropagation(),Sn)return In(null),void xn(!1);In(structuredClone(null!=sn?sn:{})),kn(!0),xn(!0)}},{children:Sn?n.jsx(i.X,{size:16,color:null==Qe?void 0:Qe.pencilIconColor}):n.jsx(i.PencilIcon,{size:16,color:null==Qe?void 0:Qe.pencilIconColor})})),(null==lt?void 0:lt.actionItemsButton)&&n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({className:r.default.actionItemBtn,style:null==Qe?void 0:Qe.actionItemBtn,onClick:function(e){e.stopPropagation(),zn(e.currentTarget)}},{children:n.jsx(i.Ellipsis,{})})),n.jsx(l.Menu,e.__assign({id:"user-story-action-menu",anchorEl:Fn,open:!!Fn,onClose:$n,style:null==Qe?void 0:Qe.userStoryShareMenu},{children:null==_e?void 0:_e.items.map(function(t,i){return n.jsx(l.MenuItem,e.__assign({style:null==Qe?void 0:Qe.userStoryMenuItem,onClick:function(){t.onclick(K),$n()}},{children:n.jsxs("div",e.__assign({className:r.default.menuItemContent,style:e.__assign(e.__assign({},null==Qe?void 0:Qe.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[n.jsx("span",e.__assign({className:r.default.menuItemIcon,style:null==Qe?void 0:Qe.menuItemIcon},{children:t.icon})),n.jsx("p",e.__assign({style:null==Qe?void 0:Qe.menuLabel},{children:t.name})),n.jsx("span",{className:r.default.menuItemRight,style:null==Qe?void 0:Qe.menuItemRight})]}))}),"action-item-".concat(i,"-").concat(t.name))})}))]}),n.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),et()},style:null==Qe?void 0:Qe.chevronButton,className:r.default.chevronButton},{children:An?n.jsx(i.ChevronUp,{className:r.default.chevronIcon,color:null==Qe?void 0:Qe.chevronIconColor}):n.jsx(i.ChevronDown,{className:r.default.chevronIcon,color:null==Qe?void 0:Qe.chevronIconColor})}))]}))]})),n.jsx("div",{className:r.default.divider,style:null==Qe?void 0:Qe.dividerStyle})]})),An&&n.jsx("div",e.__assign({className:r.default.cardContent,style:e.__assign(e.__assign({},null==Qe?void 0:Qe.cardContentStyle),{borderTop:we?"1px solid #E5E5E5":"none"})},{children:Ue?n.jsxs("div",e.__assign({className:r.default.loadingContainer},{children:[n.jsx("div",e.__assign({className:r.default.loadingIconWrapper},{children:n.jsx(i.Hourglass,{size:28,color:"#5B3DF5",className:r.default.spinAnimation})})),n.jsxs("div",{children:[n.jsx("h3",e.__assign({className:r.default.loadingTitle},{children:"Section generation in progress.."})),n.jsx("p",e.__assign({className:r.default.loadingSubtitle},{children:"This may take a few minutes"}))]}),n.jsx("button",e.__assign({type:"button",onClick:function(){return null==Pe?void 0:Pe()},className:r.default.viewStatusButton},{children:"View Status"}))]})):ze?n.jsxs("div",e.__assign({className:r.default.noDataContainer,style:null==en?void 0:en.container},{children:[n.jsx("img",{src:o.default,alt:"No data available",className:r.default.noDataIllustration,style:null==en?void 0:en.illustration}),n.jsx("h3",e.__assign({className:r.default.noDataTitle,style:null==en?void 0:en.title},{children:"No Data Available for This Section"})),n.jsx("p",e.__assign({className:r.default.noDataSubtitle,style:null==en?void 0:en.subtitle},{children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."}))]})):n.jsxs("div",e.__assign({className:r.default.contentInner,style:null==Qe?void 0:Qe.contentInner},{children:[n.jsxs("div",e.__assign({className:r.default.descriptionSection,style:null==Qe?void 0:Qe.descriptionSection},{children:[n.jsx("div",{className:r.default.justifyBetween,style:null==Qe?void 0:Qe.justifyBetween}),_n.userStory?n.jsx(v.default,{minHeight:"100%",height:"100%",type:"string",value:u.formatMarkdown(K.value)||"",handleUpdateState:function(n,t){var i=u.indentMarkdown(t);vn(function(n){return e.__assign(e.__assign({},n),{value:i||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:_n.userStory?"edit":"readOnly"}):tn?n.jsx(h.default,{styles:Ye,fields:ln,readonly:!Sn,isSaving:an,value:null!==(V=null!=jn?jn:sn)&&void 0!==V?V:{},onChange:In,onSave:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return jn?[4,null===(n=null==He?void 0:He.onSave)||void 0===n?void 0:n.call(He,K,jn)]:[2];case 1:return e.sent(),In(null),xn(!1),[2]}})})},onCancel:function(){In(null),xn(!1)}}):n.jsxs(n.Fragment,{children:[n.jsx(f.default,{showUserStoryDiff:ie,isParent:""===$,message:u.formatMarkdown(K.value)||"",artifactId:K.artifactId,customStyles:Je,isDisplayHighlightControl:re,contextVariant:pe,showConfidenceScore:je}),Te&&n.jsx("div",e.__assign({className:r.default.approveButtonContainer,style:null==nn?void 0:nn.container},{children:n.jsx("button",e.__assign({type:"button",className:r.default.approveButton,style:null==nn?void 0:nn.button,disabled:Te.disabled||Te.isLoading,onClick:function(e){var n;e.stopPropagation(),null===(n=null==Te?void 0:Te.onClick)||void 0===n||n.call(Te)}},{children:Te.isLoading?n.jsxs(n.Fragment,{children:[n.jsx(i.LoaderCircle,{size:16,className:r.default.spinner,style:null==nn?void 0:nn.icon}),n.jsx("span",e.__assign({style:null==nn?void 0:nn.text},{children:Te.label}))]}):n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({style:null==nn?void 0:nn.text},{children:Te.label})),n.jsx(i.Check,{size:16,style:null==nn?void 0:nn.icon})]})}))}))]})]})),null===(W=cn.sub_features)||void 0===W?void 0:W.map(function(t,i){var s=w(ue,!1,t.artifactId);return n.jsx(b,{artifactId:X,isUserStoryCurrentlyUpdated:Q,artifactTitleId:"".concat(Z,"-").concat(String.fromCharCode(65+i)),parentUserStory:K,parentIndex:"".concat($).concat($&&".").concat(ee),currentIndex:"".concat(i+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(n){return function(n,t){var i=e.__spreadArray([],K.sub_features||[],!0);i[n]=t,Y(e.__assign(e.__assign({},K),{sub_features:i}))}(i,n)},enableDownload:!0,isDiffEditReviewMode:te,showUserStoryDiff:ie,updateUserStoryArtifact:oe,handleDownloadUserStory:se,handleOpenSendDialog:le,isDisplayHighlightControl:re,elementDisplayConfig:ue,_resolvedConfig:s,actionItemsConfig:_e,onDelete:function(){return function(n){var t=(K.sub_features||[]).filter(function(e,t){return t!==n}),i=e.__assign(e.__assign({},K),{sub_features:t});vn(i),Y(i)}(i)},expandedSubFeatures:he},t.artifactId)})]}))}))]}))};exports.StoryCard=b,exports.UserStoryCardWrapper=function(t){var s=t.artifactTitleIDs,l=t.expandedSubFeatures,o=t.isDiffEditReviewMode,a=t.showUserStoryDiff,u=t.updateUserStoryArtifact,d=t.isUserStoryCurrentlyUpdated,c=t.artifactId,v=t.handleOpenSendDialog,f=t.handleDownloadUserStory,g=t.selectedArtifactId,p=t.isDisplayHighlightControl,h=t.elementDisplayConfig,y=t.showWrapper,m=t.actionItemsConfig,S=t.contextVariant,x=t.showDisplayName,C=t.allowTitleEdit,j=t.showConfidenceScore,I=t.showBorderTop,N=t.defaultExpanded,E=t.showCompletionPanel,D=void 0!==E&&E,B=t.showAddSectionButton,T=void 0!==B&&B,A=t.approveButtonConfig,k=_.useRequirementAI(),U=k.userStory,P=k.setUserStory,R=k.customStyles,M=k.searchQueryList,q=k.currentHighlightIndex,L=k.setCurrentHighlightIndex;k.segmentComponentConfig;var F=k.sectionStatusConfig,z=null==R?void 0:R.userStoryCardStyles,O=0===q,V=q===M.length-1;return n.jsxs("div",e.__assign({className:r.default.userStoryCardWrapper,style:p?e.__assign(e.__assign({},null==z?void 0:z.userStoryCardWrapper),{position:"relative"}):null==z?void 0:z.userStoryCardWrapper},{children:[p&&n.jsx(n.Fragment,{children:M.length>0&&n.jsx("div",e.__assign({className:r.default.wrapper},{children:n.jsx("div",e.__assign({className:r.default.highlightNavigation},{children:n.jsxs("div",e.__assign({className:r.default.navigationContainer},{children:[n.jsxs("span",e.__assign({className:r.default.navCounter},{children:[q+1," of ",M.length]})),n.jsxs("div",e.__assign({className:r.default.navButtons},{children:[n.jsx("button",e.__assign({onClick:function(){q>0&&L(function(e){return e-1})},className:r.default.navButton,disabled:O},{children:n.jsx(i.ChevronUpIcon,{size:20,className:r.default.navIcon})})),n.jsx("button",e.__assign({onClick:function(){q<M.length-1&&L(function(e){return e+1})},className:r.default.navButton,disabled:V},{children:n.jsx(i.ChevronDownIcon,{size:20,className:r.default.navIcon})}))]}))]}))}))}))}),U.map(function(t,i){var r=w(h,!0);return n.jsx(b,{isUserStoryCurrentlyUpdated:d,artifactId:c,artifactTitleId:s[i]||"",expandedSubFeatures:l,currentUserStory:t,onUserStoryChange:function(n){P(function(t){return t[i]=n,e.__spreadArray([],t,!0)})},parentIndex:"",currentIndex:"".concat(i+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:o,showUserStoryDiff:a,updateUserStoryArtifact:u,handleOpenSendDialog:v,handleDownloadUserStory:f,selectedArtifactId:g,isDisplayHighlightControl:p,elementDisplayConfig:h,_resolvedConfig:r,showWrapper:y,defaultExpanded:N,actionItemsConfig:m,contextVariant:S,showDisplayName:x,allowTitleEdit:C,showConfidenceScore:j,showBorderTop:I,sectionStatusConfig:F,showCompletionPanel:D,showAddSectionButton:T,approveButtonConfig:A},t.artifactId)})]}))},exports.default=b,exports.replaceLearnedTagsWithInfo=I;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("lucide-react"),s=require("showdown"),l=require("@mui/material"),o=require("../../icons/Illustration.svg.js"),a=require("uuid"),r=require("./UserStoryCard.module.css.js"),u=require("../../utils/helpers.js"),d=require("../../utils/user-story.utils.js"),c=require("../../shared/AtomicButton.js"),v=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),_=require("../RequirementAIWrapper/RequirementAIWrapper.js"),g=require("../story-screen/BigEnoughPanel.js"),p=require("./TitleEditor/TitleEditor.js"),h=require("./ClinicalTrialSection.js"),y=require("../story-screen/CompletionPanel.js"),m=require("../../icons/CDIcon.js");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x,C=S(s),j=((x={})[_.SectionStatus.WAITING]="WAITING TO GENERATE",x[_.SectionStatus.IN_PROGRESS]="IN PROGRESS",x[_.SectionStatus.GENERATED]="GENERATED",x[_.SectionStatus.FAILED]="FAILED",x[_.SectionStatus.GENERATE]="GENERATE",x[_.SectionStatus.APPROVED]="APPROVED",x);function I(n){for(var s,o=[],r=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(s=r.exec(n));){var c=s[1],v=s.index;v>u&&o.push(t.jsx("span",{children:n.slice(u,v)},"text-pre-".concat(d++))),o.push(t.jsx(l.Tooltip,e.__assign({title:c,placement:"top"},{children:t.jsx(i.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(a.v4()))),u=r.lastIndex}return u<(null==n?void 0:n.length)&&o.push(t.jsx("span",{children:n.slice(u)},"text-post-".concat(d++))),o}function w(t,n,i){var s;if(!t)return{};if(n)return e.__assign({},t.parentConfig);var l=e.__assign({},t.childConfig);return i&&(null===(s=t.subFeatureOverrides)||void 0===s?void 0:s[i])?e.__assign(e.__assign({},l),t.subFeatureOverrides[i]):l}var N=function(n){var s,l=n.displayName,o=_.useRequirementAI().customStyles,a=null===(s=null==o?void 0:o.userStoryCardStyles)||void 0===s?void 0:s.showDisplayName;return t.jsxs("div",e.__assign({className:r.default.displayName,style:null==a?void 0:a.wrapper},{children:[t.jsx(i.Bookmark,{className:r.default.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),t.jsxs("span",e.__assign({style:null==a?void 0:a.label},{children:[l,":"]}))]}))},b=function(s){var S,x,E,D,B,T,A,k,P,U,R,M,q,L,F,z,O,V,W,G,H,Q=s.isUserStoryCurrentlyUpdated,X=s.artifactId,Z=s.artifactTitleId,J=s.parentUserStory,K=s.currentUserStory,Y=s.onUserStoryChange,$=s.parentIndex,ee=s.currentIndex,te=s.enableDownload,ne=s.isDiffEditReviewMode,ie=s.showUserStoryDiff,se=s.handleDownloadUserStory,le=s.handleOpenSendDialog,oe=s.updateUserStoryArtifact,ae=s.selectedArtifactId,re=s.isDisplayHighlightControl,ue=s.elementDisplayConfig,de=s._resolvedConfig,ce=s.showWrapper,ve=void 0!==ce&&ce,fe=s.defaultExpanded,_e=s.actionItemsConfig,ge=s.onDelete,pe=s.contextVariant,he=s.expandedSubFeatures,ye=s.showDisplayName,me=void 0===ye||ye,Se=s.allowTitleEdit,xe=void 0===Se||Se,Ce=s.showConfidenceScore,je=void 0===Ce||Ce,Ie=s.showBorderTop,we=void 0===Ie||Ie,Ne=s.sectionStatusConfig,be=s.showCompletionPanel,Ee=void 0!==be&&be,De=s.showAddSectionButton,Be=void 0!==De&&De,Te=s.disableEditPlan,Ae=void 0!==Te&&Te,ke=s.useMuiTooltip,Pe=void 0!==ke&&ke,Ue=s.approveButtonConfig,Re=null!=Ne?Ne:{},Me=Re.isLoadingSectionData,qe=void 0!==Me&&Me,Le=Re.onLoadSectionData,Fe=Re.status,ze=Re.onStatusClick,Oe=Re.completedCount,Ve=Re.totalCount,We=Re.isNoDataAvailable,Ge=void 0!==We&&We,He=_.useRequirementAI(),Qe=He.searchQueryList,Xe=He.citations,Ze=He.customStyles,Je=He.customSectionConfig,Ke=null==Ze?void 0:Ze.userStoryCardStyles,Ye=null==Ke?void 0:Ke.statusStyles,$e=null===(x=null==Ze?void 0:Ze.userStoryCardStyles)||void 0===x?void 0:x.userStoryEditStyles,et=null===(E=null==Ze?void 0:Ze.userStoryScreenStyles)||void 0===E?void 0:E.userStoryContentStyles,tt=null==Ke?void 0:Ke.progressHeaderStyles,nt=null==Ke?void 0:Ke.clinicalTrialSectionStyles,it=null==Ke?void 0:Ke.CompletionStyles,st=null==Ke?void 0:Ke.noDataStyles,lt=null==Ke?void 0:Ke.approveButtonStyles,ot=null!==(B=null===(D=null==Je?void 0:Je.shouldRender)||void 0===D?void 0:D.call(Je,K))&&void 0!==B&&B,at=null===(T=null==Je?void 0:Je.getValue)||void 0===T?void 0:T.call(Je,K),rt=null!==(k=null===(A=null==Je?void 0:Je.getFields)||void 0===A?void 0:A.call(Je,K))&&void 0!==k?k:[],ut=null!==(P=null==Je?void 0:Je.isEditDisabled)&&void 0!==P&&P,dt=null!==(R=null===(U=null==Je?void 0:Je.isSaving)||void 0===U?void 0:U.call(Je,K))&&void 0!==R&&R,ct=(G=null!==(M=K.completion_percentage)&&void 0!==M?M:0,H=it,G>=80?null==H?void 0:H.highCompletion:G>=50?null==H?void 0:H.mediumCompletion:null==H?void 0:H.lowCompletion),vt=((S={})[_.SectionStatus.WAITING]=null==Ye?void 0:Ye.waiting,S[_.SectionStatus.IN_PROGRESS]=null==Ye?void 0:Ye.inProgress,S[_.SectionStatus.GENERATED]=null==Ye?void 0:Ye.generated,S[_.SectionStatus.FAILED]=null==Ye?void 0:Ye.failed,S[_.SectionStatus.GENERATE]=null==Ye?void 0:Ye.generate,S[_.SectionStatus.APPROVED]=null==Ye?void 0:Ye.approved,S),ft=n.useState(e.__assign(e.__assign({},structuredClone(K)),{value:u.formatMarkdown(K.value)||""})),_t=ft[0],gt=ft[1],pt=n.useState({userStory:!!K.isDefaultEdit}),ht=pt[0],yt=pt[1],mt=n.useState(!1),St=mt[0],xt=mt[1],Ct=n.useState(!1),jt=Ct[0],It=Ct[1],wt=n.useState(null),Nt=wt[0],bt=wt[1],Et=n.useState(null),Dt=Et[0],Bt=Et[1],Tt=_.useRequirementAI(),At=Tt.userStory,kt=Tt.customIcons,Pt=n.useState(null!=fe?fe:""===$||ae===K.artifactId||!!K.isDefaultOpen),Ut=Pt[0],Rt=Pt[1],Mt=n.useState(!1);Mt[0];var qt=Mt[1],Lt=n.useState(null),Ft=Lt[0],zt=Lt[1],Ot=n.useState(null),Vt=Ot[0],Wt=Ot[1],Gt=n.useState(!1),Ht=Gt[0],Qt=Gt[1],Xt=n.useRef(null),Zt=n.useState(!1);Zt[0];var Jt=Zt[1],Kt=n.useState(!1),Yt=Kt[0],$t=Kt[1],en=n.useRef(null);n.useEffect(function(){Q&&Rt(Q)},[Q]),n.useEffect(function(){gt(e.__assign(e.__assign({},structuredClone(K)),{value:u.formatMarkdown(K.value)||""}))},[K]),n.useEffect(function(){Qe.length>0?Rt(!0):void 0===fe&&(ae?Rt(ae===K.artifactId):he&&he.length>0&&Rt(he.includes(K.artifactId)))},[Qe,ae,K.artifactId,he]);var tn=function(){zt(null)},nn=function(){Wt(null)},sn=function(){Rt(function(e){return!e})};var ln=null!=(null==K?void 0:K.big_enough)&&!Number.isNaN(K.big_enough)&&!!(null==K?void 0:K.big_enough_decision_factors),on=null!==(q=null==K?void 0:K.completion_percentage)&&void 0!==q?q:0,an=!!(null==K?void 0:K.completion_decision_factors),rn=""===$,un=null!=de?de:w(ue,rn),dn=!ne&&!ie;return n.useEffect(function(){if(Dt){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(Dt));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[Dt]),n.useEffect(function(){K.isDefaultEdit&&yt(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})},[K.isDefaultEdit]),t.jsxs("div",e.__assign({className:r.default.card,style:null==Ke?void 0:Ke.cardStyle,id:"story-card-".concat(K.title),"data-expanded":Ut},{children:[t.jsxs("div",e.__assign({className:r.default.titleSection,style:null==Ke?void 0:Ke.titleSection},{children:[t.jsxs("div",e.__assign({className:r.default.titleRow,style:null==Ke?void 0:Ke.titleRow,onClick:sn},{children:[t.jsxs("div",e.__assign({className:r.default.titleLeft,style:null==Ke?void 0:Ke.titleLeft,onMouseEnter:function(){return Jt(!0)},onMouseLeave:function(){return Jt(!1)}},{children:[me&&t.jsx(N,{displayName:Z}),St&&dn?t.jsx(p.InlineTitleEditor,{title:K.title,onSave:function(t){return function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var i,s;return e.__generator(this,function(l){try{i=e.__assign({},K),K.artifactId===n?i.title=t:i.sub_features=(null===(s=K.sub_features)||void 0===s?void 0:s.map(function(i){return i.artifactId===n?e.__assign(e.__assign({},i),{title:t}):i}))||[],gt(i),Y(i),xt(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(t,K.artifactId)},onCancel:function(){xt(!1)},inputStyle:null==$e?void 0:$e.inlineTitleInput,confirmButtonStyle:null==$e?void 0:$e.inlineTitleConfirm,cancelButtonStyle:null==$e?void 0:$e.inlineTitleCancel},"inline-title-editor"):t.jsxs("div",e.__assign({className:r.default.storyTitleWrapper},{children:[t.jsx(l.Tooltip,e.__assign({title:I(K.title),arrow:!0},{children:t.jsx("h2",e.__assign({title:Pe?void 0:K.title,className:r.default.storyTitle,style:null==Ke?void 0:Ke.storyTitle},{children:I(K.title)}),K.artifactId)})),Ee&&!ot&&(an?t.jsx(y.CompletionPanel,e.__assign({customIcons:null==kt?void 0:kt.userStoryIcons,customStyles:null==Ke?void 0:Ke.aiReasoningCitaionStyles,currentUserStory:K,panelStyles:null==Ke?void 0:Ke.CompletionStyles,onToggleStateChange:$t},{children:t.jsxs("div",e.__assign({style:e.__assign(e.__assign({display:"inline-flex",alignItems:"center",gap:"4px"},null==it?void 0:it.badge),ct)},{children:[t.jsxs("span",{children:[on,"% Completed"]}),t.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:t.jsx(m.default,{color:"currentColor"})})),Yt?t.jsx(i.ChevronUp,{size:14,style:null==it?void 0:it.chevronStyle}):t.jsx(i.ChevronDown,{size:14,style:null==it?void 0:it.chevronStyle})]}))})):t.jsx("div",e.__assign({style:e.__assign(e.__assign({display:"inline-flex",alignItems:"center",gap:"4px"},null==it?void 0:it.badge),ct)},{children:t.jsxs("span",{children:[on,"% Completed"]})}))),xe&&t.jsx("button",e.__assign({type:"button",className:r.default.titleEditButton,style:null==$e?void 0:$e.titleEditButton,onClick:function(e){e.stopPropagation(),xt(!0),Ut||Rt(!0)},"aria-label":"Edit title",title:"Edit title"},{children:t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:t.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"})}))}))]}))]})),(Fe||void 0!==Oe&&void 0!==Ve)&&t.jsxs("div",e.__assign({className:r.default.statusContainer},{children:[void 0!==Oe&&void 0!==Ve&&t.jsxs("div",e.__assign({className:r.default.completedBadge},{children:["Completed: ",Oe,"/",Ve]})),Fe&&t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==ze||ze()},className:r.default.statusButton,style:vt[Fe]},{children:j[Fe]}))]})),t.jsxs("div",e.__assign({className:r.default.titleActions,style:null==Ke?void 0:Ke.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(un.showProgressPercentage||un.showGapBox)&&ve&&t.jsxs("div",e.__assign({className:r.default.progressHeader,style:null==tt?void 0:tt.wrapper},{children:[un.showProgressPercentage&&t.jsxs("div",e.__assign({className:r.default.progressPercentage,style:null==tt?void 0:tt.percentage},{children:[null!==(F=null!==(L=null==K?void 0:K.confidenceScore)&&void 0!==L?L:null==un?void 0:un.confidenceValue)&&void 0!==F?F:"0","%"]})),un.showGapBox&&t.jsxs("div",e.__assign({className:r.default.gapBox,style:null==tt?void 0:tt.gapBox},{children:[null!==(O=null!==(z=null==K?void 0:K.gapValue)&&void 0!==z?z:null==un?void 0:un.gapBoxValue)&&void 0!==O?O:"2"," ","Gaps"]}))]})),ln&&t.jsx(g.BigEnoughPanel,{customIcons:null==kt?void 0:kt.userStoryIcons,customStyles:null==Ke?void 0:Ke.aiReasoningCitaionStyles,currentUserStory:K,panelStyles:null==Ke?void 0:Ke.BigEnoughStyles}),!ht.userStory&&t.jsxs(t.Fragment,{children:[!1!==(null==un?void 0:un.showShareButton)&&t.jsx("button",e.__assign({className:r.default.iconButton,style:null==Ke?void 0:Ke.iconButton,onClick:function(e){zt(e.currentTarget)}},{children:t.jsx(i.ExternalLink,{size:16})})),t.jsxs(l.Menu,e.__assign({id:"user-story-share-menu",anchorEl:Ft,open:!!Ft,onClose:function(){return zt(null)},style:null==Ke?void 0:Ke.userStoryShareMenu},{children:[te&&t.jsx(l.MenuItem,e.__assign({style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return qt(!0),se?[4,Promise.all([se("pdf"),se("doc")])]:[2];case 1:return e.sent(),qt(!1),[2]}})})}},{children:t.jsxs("div",e.__assign({ref:Xt,className:r.default.menuItemContent,style:null==Ke?void 0:Ke.menuItemContent},{children:[t.jsx(i.Download,{size:16,color:null==Ke?void 0:Ke.menuIconColor}),t.jsx("p",e.__assign({style:null==Ke?void 0:Ke.menuLabel},{children:"Download"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){return t=K,J&&(t=e.__assign(e.__assign({},K),{value:"".concat(d.replaceTitleSection(null==J?void 0:J.value,K.title)," \n").concat(K.value)})),null==le||le(!0,[t],K.artifactId),tn(),[2]})})}},{children:t.jsxs("div",e.__assign({style:null==Ke?void 0:Ke.menuItemContent,className:r.default.menuItemContentPadded},{children:[t.jsx(i.Share2,{size:16,color:null==Ke?void 0:Ke.menuIconColor}),t.jsx("p",e.__assign({style:null==Ke?void 0:Ke.menuLabel},{children:"Send"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,i,s,l;return e.__generator(this,function(e){switch(e.label){case 0:t=new C.default.Converter,n=t.makeHtml(u.formatMarkdown(K.value)||K.value),i=function(e){var t=(new C.default.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(u.formatMarkdown(K.value)||K.value),s=new ClipboardItem({"text/plain":new Blob([i],{type:"text/plain"}),"text/html":new Blob([n],{type:"text/html"})}),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,navigator.clipboard.write([s])];case 2:return e.sent(),console.log("Copied User Story"),[3,5];case 3:return l=e.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return tn(),[7];case 5:return[2]}})})}},{children:t.jsxs("div",e.__assign({style:null==Ke?void 0:Ke.menuItemContent,className:r.default.menuItemContentPadded},{children:[t.jsx(i.Copy,{size:16,color:null==Ke?void 0:Ke.menuIconColor}),t.jsx("p",e.__assign({style:null==Ke?void 0:Ke.menuLabel},{children:"Copy"}))]}))}))]}))]}),ht.userStory&&Ut?t.jsx(c.default,{type:"outline",children:"Cancel",style:null==Ke?void 0:Ke.cancelButton,onClick:function(){var t;null===(t=en.current)||void 0===t||t.abort(),yt(function(t){return e.__assign(e.__assign({},t),{userStory:!1})})}}):t.jsx(t.Fragment,{}),ht.userStory&&Ut?t.jsx(c.default,{type:"fill",children:Ht?t.jsxs("span",e.__assign({className:r.default.savingSpinner,style:null==Ke?void 0:Ke.savingSpinner},{children:[t.jsx(i.LoaderCircle,{className:r.default.spinAnimation,style:null==Ke?void 0:Ke.spinAnimation}),t.jsx("span",{children:"Saving..."})]})):"Save",isDisable:Ht,style:Ht?null==Ke?void 0:Ke.savingButton:null==Ke?void 0:Ke.saveButton,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){switch(n.label){case 0:return Qt(!0),"userStory"==="userStory"&&(Y(_t),console.log("I am changing RTE editor values",_t)),[4,oe(Xe,At,X,null===(t=en.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),Y(e.__assign(e.__assign({},_t),{isDefaultEdit:!1})),yt(function(t){return e.__assign(e.__assign({},t),{userStory:!1})}),Qt(!1),[2]}})})}}):!ne&&!ie&&!Ae&&Ut&&!1!==(null==un?void 0:un.showEditButton)&&t.jsx("button",e.__assign({className:r.default.iconButton,style:null==Ke?void 0:Ke.editButton,onClick:function(){return yt(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})}},{children:t.jsx(i.PencilIcon,{color:null==Ke?void 0:Ke.pencilIconColor,size:16})})),Be&&rn&&Ut&&!ne&&!ie&&!1!==(null==un?void 0:un.showEditButton)&&t.jsxs("button",e.__assign({type:"button",className:r.default.addSectionButton,style:null==$e?void 0:$e.addSectionButton,onClick:function(t){var n,i,s;t.stopPropagation();var l=(null!==(i=null===(n=K.sub_features)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+1,o={artifactId:a.v4(),title:"New Section ".concat(l),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},r=e.__assign(e.__assign({},K),{sub_features:e.__spreadArray(e.__spreadArray([],null!==(s=K.sub_features)&&void 0!==s?s:[],!0),[o],!1)});gt(r),Y(r),Rt(!0),Bt(o.title)},"aria-label":"Add section",title:"Add section"},{children:[t.jsx(i.Plus,{size:14}),t.jsx("span",e.__assign({className:r.default.addSectionLabel},{children:"Add Section"}))]})),!rn&&!ne&&!Ae&&!ie&&t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==ge||ge()},className:r.default.iconButton,style:null==$e?void 0:$e.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:t.jsx(i.Trash2,{size:16})})),ot&&t.jsx("button",e.__assign({type:"button",className:r.default.iconButton,disabled:ut,onClick:function(e){if(e.stopPropagation(),jt)return bt(null),void It(!1);bt(structuredClone(null!=at?at:{})),Rt(!0),It(!0)}},{children:jt?t.jsx(i.X,{size:16,color:null==Ke?void 0:Ke.pencilIconColor}):t.jsx(i.PencilIcon,{size:16,color:null==Ke?void 0:Ke.pencilIconColor})})),(null==un?void 0:un.actionItemsButton)&&t.jsxs(t.Fragment,{children:[t.jsx("span",e.__assign({className:r.default.actionItemBtn,style:null==Ke?void 0:Ke.actionItemBtn,onClick:function(e){e.stopPropagation(),Wt(e.currentTarget)}},{children:t.jsx(i.Ellipsis,{})})),t.jsx(l.Menu,e.__assign({id:"user-story-action-menu",anchorEl:Vt,open:!!Vt,onClose:nn,style:null==Ke?void 0:Ke.userStoryShareMenu},{children:null==_e?void 0:_e.items.map(function(n,i){return t.jsx(l.MenuItem,e.__assign({style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:function(){n.onclick(K),nn()}},{children:t.jsxs("div",e.__assign({className:r.default.menuItemContent,style:e.__assign(e.__assign({},null==Ke?void 0:Ke.menuItemContent),!n.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[t.jsx("span",e.__assign({className:r.default.menuItemIcon,style:null==Ke?void 0:Ke.menuItemIcon},{children:n.icon})),t.jsx("p",e.__assign({style:null==Ke?void 0:Ke.menuLabel},{children:n.name})),t.jsx("span",{className:r.default.menuItemRight,style:null==Ke?void 0:Ke.menuItemRight})]}))}),"action-item-".concat(i,"-").concat(n.name))})}))]}),t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),sn()},style:null==Ke?void 0:Ke.chevronButton,className:r.default.chevronButton},{children:Ut?t.jsx(i.ChevronUp,{className:r.default.chevronIcon,color:null==Ke?void 0:Ke.chevronIconColor}):t.jsx(i.ChevronDown,{className:r.default.chevronIcon,color:null==Ke?void 0:Ke.chevronIconColor})}))]}))]})),t.jsx("div",{className:r.default.divider,style:null==Ke?void 0:Ke.dividerStyle})]})),Ut&&t.jsx("div",e.__assign({className:r.default.cardContent,style:e.__assign(e.__assign({},null==Ke?void 0:Ke.cardContentStyle),{borderTop:we?"1px solid #E5E5E5":"none"})},{children:qe?t.jsxs("div",e.__assign({className:r.default.loadingContainer},{children:[t.jsx("div",e.__assign({className:r.default.loadingIconWrapper},{children:t.jsx(i.Hourglass,{size:28,color:"#5B3DF5",className:r.default.spinAnimation})})),t.jsxs("div",{children:[t.jsx("h3",e.__assign({className:r.default.loadingTitle},{children:"Section generation in progress.."})),t.jsx("p",e.__assign({className:r.default.loadingSubtitle},{children:"This may take a few minutes"}))]}),t.jsx("button",e.__assign({type:"button",onClick:function(){return null==Le?void 0:Le()},className:r.default.viewStatusButton},{children:"View Status"}))]})):Ge?t.jsxs("div",e.__assign({className:r.default.noDataContainer,style:null==st?void 0:st.container},{children:[t.jsx("img",{src:o.default,alt:"No data available",className:r.default.noDataIllustration,style:null==st?void 0:st.illustration}),t.jsx("h3",e.__assign({className:r.default.noDataTitle,style:null==st?void 0:st.title},{children:"No Data Available for This Section"})),t.jsx("p",e.__assign({className:r.default.noDataSubtitle,style:null==st?void 0:st.subtitle},{children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."}))]})):t.jsxs("div",e.__assign({className:r.default.contentInner,style:null==Ke?void 0:Ke.contentInner},{children:[t.jsxs("div",e.__assign({className:r.default.descriptionSection,style:null==Ke?void 0:Ke.descriptionSection},{children:[t.jsx("div",{className:r.default.justifyBetween,style:null==Ke?void 0:Ke.justifyBetween}),ht.userStory?t.jsx(v.default,{minHeight:"100%",height:"100%",type:"string",value:u.formatMarkdown(K.value)||"",handleUpdateState:function(t,n){var i=u.indentMarkdown(n);gt(function(t){return e.__assign(e.__assign({},t),{value:i||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:ht.userStory?"edit":"readOnly"}):ot?t.jsx(h.default,{styles:nt,fields:rt,readonly:!jt,isSaving:dt,value:null!==(V=null!=Nt?Nt:at)&&void 0!==V?V:{},onChange:bt,onSave:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return Nt?[4,null===(t=null==Je?void 0:Je.onSave)||void 0===t?void 0:t.call(Je,K,Nt)]:[2];case 1:return e.sent(),bt(null),It(!1),[2]}})})},onCancel:function(){bt(null),It(!1)}}):t.jsxs(t.Fragment,{children:[t.jsx(f.default,{showUserStoryDiff:ie,isParent:""===$,message:u.formatMarkdown(K.value)||"",artifactId:K.artifactId,customStyles:et,isDisplayHighlightControl:re,contextVariant:pe,showConfidenceScore:je}),Ue&&t.jsx("div",e.__assign({className:r.default.approveButtonContainer,style:null==lt?void 0:lt.container},{children:t.jsx("button",e.__assign({type:"button",className:r.default.approveButton,style:null==lt?void 0:lt.button,disabled:Ue.disabled||Ue.isLoading,onClick:function(e){var t;e.stopPropagation(),null===(t=null==Ue?void 0:Ue.onClick)||void 0===t||t.call(Ue)}},{children:Ue.isLoading?t.jsxs(t.Fragment,{children:[t.jsx(i.LoaderCircle,{size:16,className:r.default.spinner,style:null==lt?void 0:lt.icon}),t.jsx("span",e.__assign({style:null==lt?void 0:lt.text},{children:Ue.label}))]}):t.jsxs(t.Fragment,{children:[t.jsx("span",e.__assign({style:null==lt?void 0:lt.text},{children:Ue.label})),t.jsx(i.Check,{size:16,style:null==lt?void 0:lt.icon})]})}))}))]})]})),null===(W=_t.sub_features)||void 0===W?void 0:W.map(function(n,i){var s=w(ue,!1,n.artifactId);return t.jsx(b,{artifactId:X,isUserStoryCurrentlyUpdated:Q,artifactTitleId:"".concat(Z,"-").concat(String.fromCharCode(65+i)),parentUserStory:K,parentIndex:"".concat($).concat($&&".").concat(ee),currentIndex:"".concat(i+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(t){return function(t,n){var i=e.__spreadArray([],K.sub_features||[],!0);i[t]=n,Y(e.__assign(e.__assign({},K),{sub_features:i}))}(i,t)},enableDownload:!0,isDiffEditReviewMode:ne,showUserStoryDiff:ie,updateUserStoryArtifact:oe,handleDownloadUserStory:se,handleOpenSendDialog:le,isDisplayHighlightControl:re,elementDisplayConfig:ue,_resolvedConfig:s,actionItemsConfig:_e,onDelete:function(){return function(t){var n=(K.sub_features||[]).filter(function(e,n){return n!==t}),i=e.__assign(e.__assign({},K),{sub_features:n});gt(i),Y(i)}(i)},expandedSubFeatures:he,disableEditPlan:Ae,useMuiTooltip:Pe},n.artifactId)})]}))}))]}))};exports.StoryCard=b,exports.UserStoryCardWrapper=function(n){var s=n.artifactTitleIDs,l=n.expandedSubFeatures,o=n.isDiffEditReviewMode,a=n.showUserStoryDiff,u=n.updateUserStoryArtifact,d=n.isUserStoryCurrentlyUpdated,c=n.artifactId,v=n.handleOpenSendDialog,f=n.handleDownloadUserStory,g=n.selectedArtifactId,p=n.isDisplayHighlightControl,h=n.elementDisplayConfig,y=n.showWrapper,m=n.actionItemsConfig,S=n.contextVariant,x=n.showDisplayName,C=n.allowTitleEdit,j=n.showConfidenceScore,I=n.showBorderTop,N=n.defaultExpanded,E=n.showCompletionPanel,D=void 0!==E&&E,B=n.showAddSectionButton,T=void 0!==B&&B,A=n.disableEditPlan,k=void 0!==A&&A,P=n.useMuiTooltip,U=void 0!==P&&P,R=n.approveButtonConfig,M=_.useRequirementAI(),q=M.userStory,L=M.setUserStory,F=M.customStyles,z=M.searchQueryList,O=M.currentHighlightIndex,V=M.setCurrentHighlightIndex;M.segmentComponentConfig;var W=M.sectionStatusConfig,G=null==F?void 0:F.userStoryCardStyles,H=0===O,Q=O===z.length-1;return t.jsxs("div",e.__assign({className:r.default.userStoryCardWrapper,style:p?e.__assign(e.__assign({},null==G?void 0:G.userStoryCardWrapper),{position:"relative"}):null==G?void 0:G.userStoryCardWrapper},{children:[p&&t.jsx(t.Fragment,{children:z.length>0&&t.jsx("div",e.__assign({className:r.default.wrapper},{children:t.jsx("div",e.__assign({className:r.default.highlightNavigation},{children:t.jsxs("div",e.__assign({className:r.default.navigationContainer},{children:[t.jsxs("span",e.__assign({className:r.default.navCounter},{children:[O+1," of ",z.length]})),t.jsxs("div",e.__assign({className:r.default.navButtons},{children:[t.jsx("button",e.__assign({onClick:function(){O>0&&V(function(e){return e-1})},className:r.default.navButton,disabled:H},{children:t.jsx(i.ChevronUpIcon,{size:20,className:r.default.navIcon})})),t.jsx("button",e.__assign({onClick:function(){O<z.length-1&&V(function(e){return e+1})},className:r.default.navButton,disabled:Q},{children:t.jsx(i.ChevronDownIcon,{size:20,className:r.default.navIcon})}))]}))]}))}))}))}),q.map(function(n,i){var r=w(h,!0);return t.jsx(b,{isUserStoryCurrentlyUpdated:d,artifactId:c,artifactTitleId:s[i]||"",expandedSubFeatures:l,currentUserStory:n,onUserStoryChange:function(t){L(function(n){return n[i]=t,e.__spreadArray([],n,!0)})},parentIndex:"",currentIndex:"".concat(i+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:o,showUserStoryDiff:a,updateUserStoryArtifact:u,handleOpenSendDialog:v,handleDownloadUserStory:f,selectedArtifactId:g,isDisplayHighlightControl:p,elementDisplayConfig:h,_resolvedConfig:r,showWrapper:y,defaultExpanded:N,actionItemsConfig:m,contextVariant:S,showDisplayName:x,allowTitleEdit:C,showConfidenceScore:j,showBorderTop:I,sectionStatusConfig:W,showCompletionPanel:D,showAddSectionButton:T,disableEditPlan:k,useMuiTooltip:U,approveButtonConfig:R},n.artifactId)})]}))},exports.default=b,exports.replaceLearnedTagsWithInfo=I;
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),o=require("react"),n=require("../RequirementAIWrapper/RequirementAIWrapper.js"),r=require("../../utils/userstory-approval-transform.utils.js"),a=require("../../utils/userstory-approval.utils.js"),i=require("../../hooks/useApprovalStatus.js"),l=require("./components/ContentSegment/ContentSegment.js"),s=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),c=require("../../icons/CheckIcon.js"),u=require("../../icons/BookmarkIcon.js"),v=require("./components/ApprovalSidebar/ApprovalSidebar.js"),p=require("lucide-react"),g=require("./UserStoryApprovalContext.js"),S=require("../story-screen/BigEnoughPanel.js"),f=require("../../icons/BigEnoughIcon.js"),h={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},y={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},_=Object.assign(function(l){var s,c=l.artifactTitleIds,u=l.config,v=void 0===u?{}:u,p=l.callbacks,S=void 0===p?{}:p,f=l.labels,_=void 0===f?{}:f,m=l.isDisabled,A=void 0!==m&&m,b=l.children,I=l.classNames,C=l.selectedArtifactId,x=n.useRequirementAI(),j=x.userStory,E=x.customStyles,U=e.__assign(e.__assign({},h),v),N=e.__assign(e.__assign({},y),_),w=o.useState([]),k=w[0],q=w[1],F=o.useState(""),T=F[0],B=F[1],R=o.useState(""),D=R[0],P=R[1],M=o.useState(!1),W=M[0],O=M[1],V=o.useState(!0),z=V[0],L=V[1],H=o.useRef(void 0),G=o.useCallback(function(e,t,o,n){S.onShowNotification?S.onShowNotification(e,t,o,n):console.log("[".concat(e.toUpperCase(),"] ").concat(t,": ").concat(o))},[S]),Y=o.useCallback(function(e){S.onScrollToElement?S.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[S]),J=o.useMemo(function(){var e=k.findIndex(function(e){return e.artifactId===T});return e>=0?e:0},[k,T]),K=k[J];o.useEffect(function(){H.current=K},[K]),o.useEffect(function(){var e;if(null==j?void 0:j.length){null===(e=S.onInitialize)||void 0===e||e.call(S),1===j.length&&L(!1),j.length>0&&!T&&B(C||j[0].artifactId);var t=r.createUserStoriesForApproval(r.cloneUserStories(j));q(t)}},[j,C]),o.useEffect(function(){C&&C!==T&&B(C)},[C,T]),o.useEffect(function(){if(K){var e=a.getFirstNonApprovedSegmentId(K,"");P(e)}},[null==K?void 0:K.artifactId]);var Q=o.useCallback(function(t,o){q(function(n){var r=e.__spreadArray([],n,!0);if("APPROVED"===o.approval_status&&"APPROVED"!==n[t].approval_status){var i=a.getFirstUnapprovedStoryId(n,o.artifactId);i&&B(i)}return r[t]=o,r})},[]),X=o.useCallback(function(e){var t=H.current;if(t){var o=a.getFirstNonApprovedSegmentId(t,e);"NA"!==o&&(P(""),setTimeout(function(){P(o)},0))}},[]);i.useApprovalStatus({userStoryForApproval:k,selectedUserStoryForApproval:K,userStoryIndex:J,callbacks:S,labels:N,onSaveUserStory:Q});var Z=e.__assign({height:U.containerHeight},U.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),$={userStoryForApproval:k,setUserStoryForApproval:q,selectedStoryArtifactId:T,setSelectedStoryArtifactId:B,selectedUserStoryIndex:J,selectedUserStoryForApproval:K,currentContentId:D,setCurrentContentId:P,isEditingSegment:W,setIsEditingSegment:O,isSidebarExpanded:z,setIsSidebarExpanded:L,artifactTitleIds:c,config:U,labels:N,callbacks:S,isDisabled:A,handleSaveUserStory:Q,handleUpdateContentId:X,showNotification:G,scrollToElement:Y};return t.jsx(g.UserStoryApprovalScreenContext.Provider,e.__assign({value:$},{children:t.jsx("div",e.__assign({className:"".concat(d.default.container," ").concat((null==I?void 0:I.container)||""),style:e.__assign(e.__assign({},Z),null===(s=null==E?void 0:E.approvalScreen)||void 0===s?void 0:s.wrapperContainer)},{children:b}))}))},{Sidebar:function(e){var o=e.Component,n=e.config,r=e.className,a=g.useUserStoryApprovalScreen(),i=a.isSidebarExpanded,l=a.selectedStoryArtifactId,s=a.setSelectedStoryArtifactId,d=a.userStoryForApproval,c=a.isEditingSegment,u=a.artifactTitleIds;return o?t.jsx(o,{isSidebarExpanded:i,selectedStoryArtifactId:l,setSelectedStoryArtifactId:s,userStoryForApproval:d,isEditingAnUserStorySegment:c,artifactTitleIds:u}):t.jsx(v.ApprovalSidebar,{config:n,className:r})},SidebarToggle:function(o){var n=o.OpenIcon,r=o.CloseIcon,a=o.className,i=void 0===a?"":a,l=g.useUserStoryApprovalScreen(),s=l.isSidebarExpanded,c=l.setIsSidebarExpanded,u=n||p.SidebarOpenIcon,v=r||p.SidebarCloseIcon;return t.jsx("div",e.__assign({className:"".concat(d.default.sidebarToggleWrapper," ").concat(i)},{children:t.jsx("button",e.__assign({onClick:function(){return c(function(e){return!e})},className:d.default.sidebarToggleBtn,"aria-label":s?"Collapse sidebar":"Expand sidebar",type:"button"},{children:s?t.jsx(v,{}):t.jsx(u,{})}))}))},Content:function(r){var i,l,v,p,h,y,_,m,A,b,I,C,x,j,E,U,N,w,k,q,F,T,B,R,D,P,M,W,O,V,z,L=r.children,H=r.ButtonComponent,G=r.hideApproveAll,Y=void 0!==G&&G,J=r.pageTitle,K=void 0===J?"Review Generated Requirements":J,Q=r.pageDescription,X=void 0===Q?"This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements.":Q,Z=g.useUserStoryApprovalScreen(),$=Z.selectedUserStoryForApproval,ee=Z.selectedUserStoryIndex,te=Z.artifactTitleIds,oe=Z.labels,ne=Z.config,re=Z.isDisabled,ae=Z.isEditingSegment,ie=Z.handleSaveUserStory,le=Z.setCurrentContentId,se=Z.showNotification,de=n.useRequirementAI(),ce=de.customStyles,ue=de.customIcons,ve=o.useState(!1),pe=ve[0],ge=ve[1],Se=o.useCallback(function(){if($)if(ae)se("warn","Warning!",oe.unsavedChangesWarning,3e3);else{var e=a.approveAllSegments($);ie(ee,e),le("")}},[$,ee,ae,oe,ie,le,se]);if(!$)return null;var fe=te[ee]||"",he="APPROVED"===$.approval_status,ye=null!=(null==$?void 0:$.big_enough)&&!Number.isNaN($.big_enough)&&!!(null==$?void 0:$.big_enough_decision_factors);return t.jsxs("div",e.__assign({className:d.default.content,style:e.__assign({},null===(l=null===(i=null==ce?void 0:ce.approvalScreen)||void 0===i?void 0:i.content)||void 0===l?void 0:l.content),"data-lsc-ui-page-title":K,"data-lsc-ui-page-description":X},{children:[t.jsxs("div",e.__assign({className:d.default.header,style:e.__assign({},null===(h=null===(p=null===(v=null==ce?void 0:ce.approvalScreen)||void 0===v?void 0:v.body)||void 0===p?void 0:p.contentSegment)||void 0===h?void 0:h.header)},{children:[t.jsxs("div",e.__assign({className:d.default.headerLeft,style:e.__assign({},null===(_=null===(y=null==ce?void 0:ce.approvalScreen)||void 0===y?void 0:y.content)||void 0===_?void 0:_.headerLeft)},{children:[t.jsxs("div",e.__assign({className:d.default.headerMeta,style:e.__assign({},null===(b=null===(A=null===(m=null==ce?void 0:ce.approvalScreen)||void 0===m?void 0:m.body)||void 0===A?void 0:A.contentSegment)||void 0===b?void 0:b.headerMeta)},{children:[t.jsx(u.BookmarkIcon,{size:16,color:(null===(x=null===(C=null===(I=null==ce?void 0:ce.approvalScreen)||void 0===I?void 0:I.body)||void 0===C?void 0:C.contentSegment)||void 0===x?void 0:x.bookMarkColor)||"#8C8C8C"}),t.jsx("h2",e.__assign({className:d.default.headerArtifactId,style:e.__assign({},null===(U=null===(E=null===(j=null==ce?void 0:ce.approvalScreen)||void 0===j?void 0:j.body)||void 0===E?void 0:E.contentSegment)||void 0===U?void 0:U.headerArtifactId)},{children:fe}))]})),t.jsx("p",e.__assign({className:d.default.headerTitle,style:e.__assign({},null===(k=null===(w=null===(N=null==ce?void 0:ce.approvalScreen)||void 0===N?void 0:N.body)||void 0===w?void 0:w.contentSegment)||void 0===k?void 0:k.headerTitle)},{children:null==$?void 0:$.title}))]})),t.jsxs("div",e.__assign({className:null===d.default||void 0===d.default?void 0:d.default.containerStyle,style:null===(F=null===(q=null==ce?void 0:ce.approvalScreen)||void 0===q?void 0:q.BigEnoughStyles)||void 0===F?void 0:F.containerStyle},{children:[ye&&t.jsx("button",e.__assign({className:d.default.developerEffortButton,style:null===(B=null===(T=null==ce?void 0:ce.approvalScreen)||void 0===T?void 0:T.BigEnoughStyles)||void 0===B?void 0:B.buttonStyle,onClick:function(){return ge(!pe)}},{children:t.jsx(f.default,{color:null===(D=null===(R=null==ce?void 0:ce.approvalScreen)||void 0===R?void 0:R.BigEnoughStyles)||void 0===D?void 0:D.iconColor,size:null===(M=null===(P=null==ce?void 0:ce.approvalScreen)||void 0===P?void 0:P.BigEnoughStyles)||void 0===M?void 0:M.iconSize})})),!Y&&ne.showApproveAllButton&&t.jsx("div",e.__assign({className:d.default.headerRight},{children:he?t.jsx(s.ApprovalBadge,{status:"APPROVED",label:oe.approved}):H?t.jsx(H,e.__assign({type:"fill",onClick:Se,isDisable:re,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:oe.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."}},{children:t.jsxs("div",e.__assign({className:d.default.approveAllContent},{children:[t.jsx(c.CheckIcon,{size:16,color:"white"}),t.jsx("span",{children:oe.approveAll})]}))})):t.jsxs("button",e.__assign({onClick:Se,disabled:re,className:d.default.approveAllButtonDefault,style:e.__assign({},null===(O=null===(W=null==ce?void 0:ce.approvalScreen)||void 0===W?void 0:W.content)||void 0===O?void 0:O.approveAllButtonDefault)},{children:[t.jsx(c.CheckIcon,{size:16,color:"white"}),t.jsx("span",{children:oe.approveAll})]}))}))]}))]})),pe&&ye&&t.jsx("div",e.__assign({className:d.default.bigEnoughWrapper},{children:t.jsx(S.BigEnoughPanel,{customIcons:null==ue?void 0:ue.userStoryIcons,customStyles:null===(V=null==ce?void 0:ce.approvalScreen)||void 0===V?void 0:V.aiReasoningCitaionStyles,currentUserStory:$,panelStyles:null===(z=null==ce?void 0:ce.approvalScreen)||void 0===z?void 0:z.BigEnoughStyles,showPanel:pe})})),L]}))},Body:function(r){var a,i,s,c=r.children,u=r.EditorComponent,v=r.ViewerComponent,p=g.useUserStoryApprovalScreen(),S=p.selectedUserStoryForApproval,f=p.selectedUserStoryIndex,h=p.artifactTitleIds,y=p.handleSaveUserStory,_=n.useRequirementAI().customStyles,m=o.useCallback(function(e){y(f,e)},[f,y]),A=o.useCallback(function(t,o){var n;if(S){var r=e.__assign(e.__assign({},S),{sub_features:null===(n=S.sub_features)||void 0===n?void 0:n.map(function(e,n){return n===t?o:e})});y(f,r)}},[S,f,y]),b=o.useCallback(function(t){var o;if(S){var n=e.__assign(e.__assign({},S),{sub_features:null===(o=S.sub_features)||void 0===o?void 0:o.filter(function(e,o){return o!==t})});y(f,n)}},[S,f,y]);if(!S)return null;var I=h[f]||"";return t.jsxs("div",e.__assign({className:d.default.body,style:e.__assign({},null===(i=null===(a=null==_?void 0:_.approvalScreen)||void 0===a?void 0:a.body)||void 0===i?void 0:i.container)},{children:[t.jsx(l.ContentSegment,{userStoryForApproval:S,artifactTitleId:I,onSaveMainStoryContent:m,EditorComponent:u,ViewerComponent:v}),null===(s=S.sub_features)||void 0===s?void 0:s.map(function(e,o){return t.jsx(l.ContentSegment,{userStoryForApproval:e,artifactTitleId:"".concat(I," - ").concat(String.fromCharCode(65+o)),isSubFeature:!0,subFeatureIndex:o,onSaveSubFeature:A,onDeleteSubFeature:b,EditorComponent:u,ViewerComponent:v},e.artifactId)}),c]}))}});exports.default=_;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),o=require("showdown"),r=require("../RequirementAIWrapper/RequirementAIWrapper.js"),l=require("../../utils/userstory-approval-transform.utils.js"),a=require("../../utils/userstory-approval.utils.js"),i=require("../../hooks/useApprovalStatus.js"),s=require("./components/ContentSegment/ContentSegment.js"),d=require("./components/ApprovalBadge/ApprovalBadge.js"),u=require("./UserStoryApprovalScreen.module.css.js"),c=require("../../icons/CheckIcon.js"),v=require("../../icons/BookmarkIcon.js"),p=require("./components/ApprovalSidebar/ApprovalSidebar.js"),g=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),f=require("../story-screen/BigEnoughPanel.js"),h=require("../../icons/BigEnoughIcon.js"),m=require("@mui/material"),_=require("../../utils/helpers.js"),y=require("../../utils/user-story.utils.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=b(o),A={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},C={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},x=Object.assign(function(o){var s,d=o.artifactTitleIds,c=o.config,v=void 0===c?{}:c,p=o.callbacks,g=void 0===p?{}:p,f=o.labels,h=void 0===f?{}:f,m=o.isDisabled,_=void 0!==m&&m,y=o.children,b=o.classNames,I=o.selectedArtifactId,x=r.useRequirementAI(),j=x.userStory,w=x.customStyles,E=e.__assign(e.__assign({},A),v),k=e.__assign(e.__assign({},C),h),U=t.useState([]),N=U[0],q=U[1],T=t.useState(""),B=T[0],F=T[1],D=t.useState(""),M=D[0],R=D[1],P=t.useState(!1),z=P[0],O=P[1],W=t.useState(!0),L=W[0],V=W[1],H=t.useRef(void 0),G=t.useCallback(function(e,n,t,o){g.onShowNotification?g.onShowNotification(e,n,t,o):console.log("[".concat(e.toUpperCase(),"] ").concat(n,": ").concat(t))},[g]),Y=t.useCallback(function(e){g.onScrollToElement?g.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[g]),J=t.useMemo(function(){var e=N.findIndex(function(e){return e.artifactId===B});return e>=0?e:0},[N,B]),K=N[J];t.useEffect(function(){H.current=K},[K]),t.useEffect(function(){var e;if(null==j?void 0:j.length){null===(e=g.onInitialize)||void 0===e||e.call(g),1===j.length&&V(!1),j.length>0&&!B&&F(I||j[0].artifactId);var n=l.createUserStoriesForApproval(l.cloneUserStories(j));q(n)}},[j,I]),t.useEffect(function(){I&&I!==B&&F(I)},[I,B]),t.useEffect(function(){if(K){var e=a.getFirstNonApprovedSegmentId(K,"");R(e)}},[null==K?void 0:K.artifactId]);var Q=t.useCallback(function(n,t){q(function(o){var r=e.__spreadArray([],o,!0);if("APPROVED"===t.approval_status&&"APPROVED"!==o[n].approval_status){var l=a.getFirstUnapprovedStoryId(o,t.artifactId);l&&F(l)}return r[n]=t,r})},[]),X=t.useCallback(function(e){var n=H.current;if(n){var t=a.getFirstNonApprovedSegmentId(n,e);"NA"!==t&&(R(""),setTimeout(function(){R(t)},0))}},[]);i.useApprovalStatus({userStoryForApproval:N,selectedUserStoryForApproval:K,userStoryIndex:J,callbacks:g,labels:k,onSaveUserStory:Q});var Z=e.__assign({height:E.containerHeight},E.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),$={userStoryForApproval:N,setUserStoryForApproval:q,selectedStoryArtifactId:B,setSelectedStoryArtifactId:F,selectedUserStoryIndex:J,selectedUserStoryForApproval:K,currentContentId:M,setCurrentContentId:R,isEditingSegment:z,setIsEditingSegment:O,isSidebarExpanded:L,setIsSidebarExpanded:V,artifactTitleIds:d,config:E,labels:k,callbacks:g,isDisabled:_,handleSaveUserStory:Q,handleUpdateContentId:X,showNotification:G,scrollToElement:Y};return n.jsx(S.UserStoryApprovalScreenContext.Provider,e.__assign({value:$},{children:n.jsx("div",e.__assign({className:"".concat(u.default.container," ").concat((null==b?void 0:b.container)||""),style:e.__assign(e.__assign({},Z),null===(s=null==w?void 0:w.approvalScreen)||void 0===s?void 0:s.wrapperContainer)},{children:y}))}))},{Sidebar:function(e){var t=e.Component,o=e.config,r=e.className,l=S.useUserStoryApprovalScreen(),a=l.isSidebarExpanded,i=l.selectedStoryArtifactId,s=l.setSelectedStoryArtifactId,d=l.userStoryForApproval,u=l.isEditingSegment,c=l.artifactTitleIds;return t?n.jsx(t,{isSidebarExpanded:a,selectedStoryArtifactId:i,setSelectedStoryArtifactId:s,userStoryForApproval:d,isEditingAnUserStorySegment:u,artifactTitleIds:c}):n.jsx(p.ApprovalSidebar,{config:o,className:r})},SidebarToggle:function(t){var o=t.OpenIcon,r=t.CloseIcon,l=t.className,a=void 0===l?"":l,i=S.useUserStoryApprovalScreen(),s=i.isSidebarExpanded,d=i.setIsSidebarExpanded,c=o||g.SidebarOpenIcon,v=r||g.SidebarCloseIcon;return n.jsx("div",e.__assign({className:"".concat(u.default.sidebarToggleWrapper," ").concat(a)},{children:n.jsx("button",e.__assign({onClick:function(){return d(function(e){return!e})},className:u.default.sidebarToggleBtn,"aria-label":s?"Collapse sidebar":"Expand sidebar",type:"button"},{children:s?n.jsx(v,{}):n.jsx(c,{})}))}))},Content:function(o){var l,i,s,p,b,A,C,x,j,w,E,k,U,N,q,T,B,F,D,M,R,P,z,O,W,L,V,H,G,Y,J,K=o.children,Q=o.ButtonComponent,X=o.hideApproveAll,Z=void 0!==X&&X,$=o.pageTitle,ee=void 0===$?"Review Generated Requirements":$,ne=o.showShareIcon,te=void 0!==ne&&ne,oe=o.handleDownloadUserStory,re=o.handleOpenSendDialog,le=o.pageDescription,ae=void 0===le?"This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements.":le,ie=S.useUserStoryApprovalScreen(),se=ie.selectedUserStoryForApproval,de=ie.selectedUserStoryIndex,ue=ie.artifactTitleIds,ce=ie.labels,ve=ie.config,pe=ie.isDisabled,ge=ie.isEditingSegment,Se=ie.handleSaveUserStory,fe=ie.setCurrentContentId,he=ie.showNotification,me=r.useRequirementAI(),_e=me.userStory;me.setUserStory;var ye=_e[0],be=t.useState(null),Ie=be[0],Ae=be[1],Ce=function(){Ae(null)},xe=t.useRef(null),je=t.useState(!1);je[0];var we=je[1],Ee=r.useRequirementAI(),ke=Ee.customStyles,Ue=Ee.customIcons,Ne=null==ke?void 0:ke.userStoryCardStyles,qe=t.useState(!1),Te=qe[0],Be=qe[1],Fe=t.useCallback(function(){if(se)if(ge)he("warn","Warning!",ce.unsavedChangesWarning,3e3);else{var e=a.approveAllSegments(se);Se(de,e),fe("")}},[se,de,ge,ce,Se,fe,he]);if(!se)return null;var De=ue[de]||"",Me="APPROVED"===se.approval_status,Re=null!=(null==se?void 0:se.big_enough)&&!Number.isNaN(se.big_enough)&&!!(null==se?void 0:se.big_enough_decision_factors);return n.jsxs("div",e.__assign({className:u.default.content,style:e.__assign({},null===(i=null===(l=null==ke?void 0:ke.approvalScreen)||void 0===l?void 0:l.content)||void 0===i?void 0:i.content),"data-lsc-ui-page-title":ee,"data-lsc-ui-page-description":ae},{children:[n.jsxs("div",e.__assign({className:u.default.header,style:e.__assign({},null===(b=null===(p=null===(s=null==ke?void 0:ke.approvalScreen)||void 0===s?void 0:s.body)||void 0===p?void 0:p.contentSegment)||void 0===b?void 0:b.header)},{children:[n.jsxs("div",e.__assign({className:u.default.headerLeft,style:e.__assign({},null===(C=null===(A=null==ke?void 0:ke.approvalScreen)||void 0===A?void 0:A.content)||void 0===C?void 0:C.headerLeft)},{children:[n.jsxs("div",e.__assign({className:u.default.headerMeta,style:e.__assign({},null===(w=null===(j=null===(x=null==ke?void 0:ke.approvalScreen)||void 0===x?void 0:x.body)||void 0===j?void 0:j.contentSegment)||void 0===w?void 0:w.headerMeta)},{children:[n.jsx(v.BookmarkIcon,{size:16,color:(null===(U=null===(k=null===(E=null==ke?void 0:ke.approvalScreen)||void 0===E?void 0:E.body)||void 0===k?void 0:k.contentSegment)||void 0===U?void 0:U.bookMarkColor)||"#8C8C8C"}),n.jsx("h2",e.__assign({className:u.default.headerArtifactId,style:e.__assign({},null===(T=null===(q=null===(N=null==ke?void 0:ke.approvalScreen)||void 0===N?void 0:N.body)||void 0===q?void 0:q.contentSegment)||void 0===T?void 0:T.headerArtifactId)},{children:De}))]})),n.jsx("p",e.__assign({className:u.default.headerTitle,style:e.__assign({},null===(D=null===(F=null===(B=null==ke?void 0:ke.approvalScreen)||void 0===B?void 0:B.body)||void 0===F?void 0:F.contentSegment)||void 0===D?void 0:D.headerTitle)},{children:null==se?void 0:se.title}))]})),n.jsxs("div",e.__assign({className:null===u.default||void 0===u.default?void 0:u.default.containerStyle,style:null===(R=null===(M=null==ke?void 0:ke.approvalScreen)||void 0===M?void 0:M.BigEnoughStyles)||void 0===R?void 0:R.containerStyle},{children:[Re&&n.jsx("button",e.__assign({className:u.default.developerEffortButton,style:null===(z=null===(P=null==ke?void 0:ke.approvalScreen)||void 0===P?void 0:P.BigEnoughStyles)||void 0===z?void 0:z.buttonStyle,onClick:function(){return Be(!Te)}},{children:n.jsx(h.default,{color:null===(W=null===(O=null==ke?void 0:ke.approvalScreen)||void 0===O?void 0:O.BigEnoughStyles)||void 0===W?void 0:W.iconColor,size:null===(V=null===(L=null==ke?void 0:ke.approvalScreen)||void 0===L?void 0:L.BigEnoughStyles)||void 0===V?void 0:V.iconSize})})),te&&n.jsxs(n.Fragment,{children:[n.jsx("button",e.__assign({className:u.default.iconButton,style:null==Ne?void 0:Ne.iconButton,onClick:function(e){Ae(e.currentTarget)}},{children:n.jsx(g.ExternalLink,{size:16})})),n.jsxs(m.Menu,e.__assign({id:"user-story-share-menu",anchorEl:Ie,open:!!Ie,onClose:function(){return Ae(null)},style:null==Ne?void 0:Ne.userStoryShareMenu},{children:[n.jsx(m.MenuItem,e.__assign({style:null==Ne?void 0:Ne.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return we(!0),oe?[4,Promise.all([oe("pdf"),oe("doc")])]:[2];case 1:return e.sent(),we(!1),[2]}})})}},{children:n.jsxs("div",e.__assign({ref:xe,className:u.default.menuItemContent,style:null==Ne?void 0:Ne.menuItemContent},{children:[n.jsx(g.Download,{size:16,color:null==Ne?void 0:Ne.menuIconColor}),n.jsx("p",e.__assign({style:null==Ne?void 0:Ne.menuLabel},{children:"Download"}))]}))})),n.jsx(m.MenuItem,e.__assign({style:null==Ne?void 0:Ne.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(t){return ye,n=e.__assign(e.__assign({},ye),{value:"".concat(y.replaceTitleSection(null==ye?void 0:ye.value,ye.title)," \n").concat(ye.value)}),null==re||re(!0,[n],ye.artifactId),Ce(),[2]})})}},{children:n.jsxs("div",e.__assign({style:null==Ne?void 0:Ne.menuItemContent,className:u.default.menuItemContentPadded},{children:[n.jsx(g.Share2,{size:16,color:null==Ne?void 0:Ne.menuIconColor}),n.jsx("p",e.__assign({style:null==Ne?void 0:Ne.menuLabel},{children:"Send"}))]}))})),n.jsx(m.MenuItem,e.__assign({style:null==Ne?void 0:Ne.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,t,o,r,l;return e.__generator(this,function(e){switch(e.label){case 0:n=new I.default.Converter,t=n.makeHtml(_.formatMarkdown(ye.value)||ye.value),o=function(e){var n=(new I.default.Converter).makeHtml(e),t=document.createElement("div");return t.innerHTML=n,t.textContent||t.innerText||""}(_.formatMarkdown(ye.value)||ye.value),r=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,navigator.clipboard.write([r])];case 2:return e.sent(),console.log("Copied User Story"),[3,5];case 3:return l=e.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return Ce(),[7];case 5:return[2]}})})}},{children:n.jsxs("div",e.__assign({style:null==Ne?void 0:Ne.menuItemContent,className:u.default.menuItemContentPadded},{children:[n.jsx(g.Copy,{size:16,color:null==Ne?void 0:Ne.menuIconColor}),n.jsx("p",e.__assign({style:null==Ne?void 0:Ne.menuLabel},{children:"Copy"}))]}))}))]}))]}),!Z&&ve.showApproveAllButton&&n.jsx("div",e.__assign({className:u.default.headerRight},{children:Me?n.jsx(d.ApprovalBadge,{status:"APPROVED",label:ce.approved}):Q?n.jsx(Q,e.__assign({type:"fill",onClick:Fe,isDisable:pe,className:u.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:ce.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."}},{children:n.jsxs("div",e.__assign({className:u.default.approveAllContent},{children:[n.jsx(c.CheckIcon,{size:16,color:"white"}),n.jsx("span",{children:ce.approveAll})]}))})):n.jsxs("button",e.__assign({onClick:Fe,disabled:pe,className:u.default.approveAllButtonDefault,style:e.__assign({},null===(G=null===(H=null==ke?void 0:ke.approvalScreen)||void 0===H?void 0:H.content)||void 0===G?void 0:G.approveAllButtonDefault)},{children:[n.jsx(c.CheckIcon,{size:16,color:"white"}),n.jsx("span",{children:ce.approveAll})]}))}))]}))]})),Te&&Re&&n.jsx("div",e.__assign({className:u.default.bigEnoughWrapper},{children:n.jsx(f.BigEnoughPanel,{customIcons:null==Ue?void 0:Ue.userStoryIcons,customStyles:null===(Y=null==ke?void 0:ke.approvalScreen)||void 0===Y?void 0:Y.aiReasoningCitaionStyles,currentUserStory:se,panelStyles:null===(J=null==ke?void 0:ke.approvalScreen)||void 0===J?void 0:J.BigEnoughStyles,showPanel:Te})})),K]}))},Body:function(o){var l,a,i,d=o.children,c=o.EditorComponent,v=o.ViewerComponent,p=o.handleDownloadUserStory,g=o.handleOpenSendDialog,f=o.showShareIcon,h=void 0!==f&&f,m=S.useUserStoryApprovalScreen(),_=m.selectedUserStoryForApproval,y=m.selectedUserStoryIndex,b=m.artifactTitleIds,I=m.handleSaveUserStory,A=r.useRequirementAI().customStyles,C=t.useCallback(function(e){I(y,e)},[y,I]),x=t.useCallback(function(n,t){var o;if(_){var r=e.__assign(e.__assign({},_),{sub_features:null===(o=_.sub_features)||void 0===o?void 0:o.map(function(e,o){return o===n?t:e})});I(y,r)}},[_,y,I]),j=t.useCallback(function(n){var t;if(_){var o=e.__assign(e.__assign({},_),{sub_features:null===(t=_.sub_features)||void 0===t?void 0:t.filter(function(e,t){return t!==n})});I(y,o)}},[_,y,I]);if(!_)return null;var w=b[y]||"";return n.jsxs("div",e.__assign({className:u.default.body,style:e.__assign({},null===(a=null===(l=null==A?void 0:A.approvalScreen)||void 0===l?void 0:l.body)||void 0===a?void 0:a.container)},{children:[n.jsx(s.ContentSegment,{userStoryForApproval:_,artifactTitleId:w,onSaveMainStoryContent:C,EditorComponent:c,ViewerComponent:v}),null===(i=_.sub_features)||void 0===i?void 0:i.map(function(e,t){return n.jsx(s.ContentSegment,{userStoryForApproval:e,artifactTitleId:"".concat(w," - ").concat(String.fromCharCode(65+t)),isSubFeature:!0,subFeatureIndex:t,onSaveSubFeature:x,onDeleteSubFeature:j,EditorComponent:c,ViewerComponent:v,handleDownloadUserStory:p,handleOpenSendDialog:g,showShareIcon:h},e.artifactId)}),d]}))}});exports.default=x;
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const r=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;r&&e.setAttribute("nonce",r),e.appendChild(document.createTextNode(".UserStoryApprovalScreen-module_container__Hy5uc{border:1px solid #d1d5db;display:flex;flex-direction:row;font-family:Inter,sans-serif;min-height:100vh}.UserStoryApprovalScreen-module_container__Hy5uc *{font-family:inherit}.UserStoryApprovalScreen-module_developerEffortButton__9EfUX{background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;margin-right:3px;padding:.4rem .8rem}.UserStoryApprovalScreen-module_containerStyle__PS6Gn{align-items:center;display:flex;gap:3px}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf{transition:color .2s ease}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf:hover{opacity:.8}.UserStoryApprovalScreen-module_content__VQ6Z9{display:flex;flex:1;flex-direction:column;min-height:100%;overflow-y:auto;position:relative;width:100%}.UserStoryApprovalScreen-module_header__zsOki{align-items:center;background-color:#fff;border-bottom:1px solid #d1d5db;display:flex;flex-direction:row;justify-content:space-between;padding:16px 32px;position:sticky;top:0;z-index:50}.UserStoryApprovalScreen-module_headerLeft__s-1Eq{display:flex;flex-direction:column;gap:4px}.UserStoryApprovalScreen-module_headerMeta__3JPhW{align-items:center;color:#6932e2;display:flex;flex-direction:row;gap:8px}.UserStoryApprovalScreen-module_headerArtifactId__xjOR9{font-family:Inter,sans-serif;font-size:14px;font-weight:400;margin:0}.UserStoryApprovalScreen-module_headerTitle__xxkv-{font-family:Inter,sans-serif;font-size:16px;font-weight:600;margin:0}.UserStoryApprovalScreen-module_headerRight__BWc-W{align-items:center;display:flex}.UserStoryApprovalScreen-module_approveAllButton__HkH1f{height:40px}.UserStoryApprovalScreen-module_approveAllContent__-UTDs{align-items:center;display:flex;flex-direction:row;gap:4px;height:32px;padding:0 2px}.UserStoryApprovalScreen-module_approveAllContent__-UTDs span{color:#fff;font-family:Inter,sans-serif;font-size:14px;text-transform:none}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR{align-items:center;background:linear-gradient(115.1deg,#2546f0 -23.58%,#5928ed 74.92%);border:none;border-radius:8px;color:#fff;cursor:pointer;display:flex;flex-direction:row;font-family:Inter,sans-serif;font-size:14px;gap:4px;height:40px;padding:0 16px;transition:opacity .2s ease}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR:hover{opacity:.9}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR:disabled{cursor:not-allowed;opacity:.5}.UserStoryApprovalScreen-module_body__aAJwQ{display:flex;flex-direction:column;width:100%}.UserStoryApprovalScreen-module_sidebarToggleWrapper__Z9C-4{flex-shrink:0;height:100%;position:relative;width:0}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf{align-items:center;background:none;border:none;cursor:pointer;display:flex;justify-content:center;left:0;margin:0;padding:0;position:absolute;top:50%;transform:translateY(-50%);transition:opacity .2s ease;z-index:10}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf:focus{outline:none}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"UserStoryApprovalScreen-module_container__Hy5uc",sidebarToggleWrapper:"UserStoryApprovalScreen-module_sidebarToggleWrapper__Z9C-4",developerEffortButton:"UserStoryApprovalScreen-module_developerEffortButton__9EfUX",containerStyle:"UserStoryApprovalScreen-module_containerStyle__PS6Gn",sidebarToggleBtn:"UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf",content:"UserStoryApprovalScreen-module_content__VQ6Z9",header:"UserStoryApprovalScreen-module_header__zsOki",headerLeft:"UserStoryApprovalScreen-module_headerLeft__s-1Eq",headerMeta:"UserStoryApprovalScreen-module_headerMeta__3JPhW",headerArtifactId:"UserStoryApprovalScreen-module_headerArtifactId__xjOR9",headerTitle:"UserStoryApprovalScreen-module_headerTitle__xxkv-",headerRight:"UserStoryApprovalScreen-module_headerRight__BWc-W",approveAllButton:"UserStoryApprovalScreen-module_approveAllButton__HkH1f",approveAllContent:"UserStoryApprovalScreen-module_approveAllContent__-UTDs",approveAllButtonDefault:"UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR",body:"UserStoryApprovalScreen-module_body__aAJwQ"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const r=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;r&&e.setAttribute("nonce",r),e.appendChild(document.createTextNode(".UserStoryApprovalScreen-module_container__Hy5uc{border:1px solid #d1d5db;display:flex;flex-direction:row;font-family:Inter,sans-serif;min-height:100vh}.UserStoryApprovalScreen-module_container__Hy5uc *{font-family:inherit}.UserStoryApprovalScreen-module_developerEffortButton__9EfUX{background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;margin-right:3px;padding:.4rem .8rem}.UserStoryApprovalScreen-module_containerStyle__PS6Gn{align-items:center;display:flex;gap:3px}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf{transition:color .2s ease}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf:hover{opacity:.8}.UserStoryApprovalScreen-module_content__VQ6Z9{display:flex;flex:1;flex-direction:column;min-height:100%;overflow-y:auto;position:relative;width:100%}.UserStoryApprovalScreen-module_header__zsOki{align-items:center;background-color:#fff;border-bottom:1px solid #d1d5db;display:flex;flex-direction:row;justify-content:space-between;padding:16px 32px;position:sticky;top:0;z-index:50}.UserStoryApprovalScreen-module_headerLeft__s-1Eq{display:flex;flex-direction:column;gap:4px}.UserStoryApprovalScreen-module_headerMeta__3JPhW{align-items:center;color:#6932e2;display:flex;flex-direction:row;gap:8px}.UserStoryApprovalScreen-module_headerArtifactId__xjOR9{font-family:Inter,sans-serif;font-size:14px;font-weight:400;margin:0}.UserStoryApprovalScreen-module_headerTitle__xxkv-{font-family:Inter,sans-serif;font-size:16px;font-weight:600;margin:0}.UserStoryApprovalScreen-module_headerRight__BWc-W{align-items:center;display:flex}.UserStoryApprovalScreen-module_approveAllButton__HkH1f{height:40px}.UserStoryApprovalScreen-module_approveAllContent__-UTDs{align-items:center;display:flex;flex-direction:row;gap:4px;height:32px;padding:0 2px}.UserStoryApprovalScreen-module_approveAllContent__-UTDs span{color:#fff;font-family:Inter,sans-serif;font-size:14px;text-transform:none}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR{align-items:center;background:linear-gradient(115.1deg,#2546f0 -23.58%,#5928ed 74.92%);border:none;border-radius:8px;color:#fff;cursor:pointer;display:flex;flex-direction:row;font-family:Inter,sans-serif;font-size:14px;gap:4px;height:40px;padding:0 16px;transition:opacity .2s ease}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR:hover{opacity:.9}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR:disabled{cursor:not-allowed;opacity:.5}.UserStoryApprovalScreen-module_body__aAJwQ{display:flex;flex-direction:column;width:100%}.UserStoryApprovalScreen-module_sidebarToggleWrapper__Z9C-4{flex-shrink:0;height:100%;position:relative;width:0}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf{align-items:center;background:none;border:none;cursor:pointer;display:flex;justify-content:center;left:0;margin:0;padding:0;position:absolute;top:50%;transform:translateY(-50%);transition:opacity .2s ease;z-index:10}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf:focus{outline:none}.UserStoryApprovalScreen-module_iconButton__PGTVl{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;display:flex;justify-content:center;margin-left:.5rem;padding:.4rem .8rem}.UserStoryApprovalScreen-module_menuItemContent__SCM6V{align-items:center;display:flex;flex-direction:row;gap:.5rem;margin-left:.25rem}.UserStoryApprovalScreen-module_menuItemContentPadded__3UjuU{align-items:center;display:flex;flex-direction:row;gap:.5rem;padding-left:.25rem}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"UserStoryApprovalScreen-module_container__Hy5uc",sidebarToggleWrapper:"UserStoryApprovalScreen-module_sidebarToggleWrapper__Z9C-4",developerEffortButton:"UserStoryApprovalScreen-module_developerEffortButton__9EfUX",containerStyle:"UserStoryApprovalScreen-module_containerStyle__PS6Gn",sidebarToggleBtn:"UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf",content:"UserStoryApprovalScreen-module_content__VQ6Z9",header:"UserStoryApprovalScreen-module_header__zsOki",headerLeft:"UserStoryApprovalScreen-module_headerLeft__s-1Eq",headerMeta:"UserStoryApprovalScreen-module_headerMeta__3JPhW",headerArtifactId:"UserStoryApprovalScreen-module_headerArtifactId__xjOR9",headerTitle:"UserStoryApprovalScreen-module_headerTitle__xxkv-",headerRight:"UserStoryApprovalScreen-module_headerRight__BWc-W",approveAllButton:"UserStoryApprovalScreen-module_approveAllButton__HkH1f",approveAllContent:"UserStoryApprovalScreen-module_approveAllContent__-UTDs",approveAllButtonDefault:"UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR",body:"UserStoryApprovalScreen-module_body__aAJwQ",iconButton:"UserStoryApprovalScreen-module_iconButton__PGTVl",menuItemContent:"UserStoryApprovalScreen-module_menuItemContent__SCM6V",menuItemContentPadded:"UserStoryApprovalScreen-module_menuItemContentPadded__3UjuU"};
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.module.css.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react"),i=require("../ContentBlock/ContentBlock.js"),l=require("./ContentSegment.module.css.js"),a=require("../../../../icons/ChevronUpIcon.js"),t=require("../../../../icons/BookmarkIcon.js"),s=require("../../../../icons/ChevronDownIcon.js"),r=require("../../../RequirementAIWrapper/RequirementAIWrapper.js"),u=require("../../../story-screen/BigEnoughPanel.js"),d=function(d){var v,c,_,g,p,m,S,f,h,C,y,b,j,I,x,k,q,A,N,B,F,E,M,T,w,D,R,W,z,P=d.userStoryForApproval,U=d.artifactTitleId,V=d.isSubFeature,O=void 0!==V&&V,G=d.subFeatureIndex,H=d.onSaveSubFeature,J=d.onDeleteSubFeature,K=d.onSaveMainStoryContent,L=d.EditorComponent,Q=d.ViewerComponent,X=o.useState(!0),Y=X[0],Z=X[1],$=r.useRequirementAI(),ee=$.customStyles,ne=$.customIcons,oe=o.useCallback(function(){Z(function(e){return!e})},[]),ie=o.useCallback(function(n){if(void 0!==G){var o=e.__assign(e.__assign({},P),{value:P.value.map(function(o,i){return i===n?e.__assign(e.__assign({},o),{isApproved:!0}):o})});null==H||H(G,o)}},[P,G,H]),le=o.useCallback(function(n,o){if(void 0!==G){var i=e.__assign(e.__assign({},P),{value:P.value.map(function(i,l){return l===n?e.__assign(e.__assign({},i),{content:o}):i})});null==H||H(G,i)}},[P,G,H]),ae=o.useCallback(function(n){if(void 0!==G){var o=e.__assign(e.__assign({},P),{value:P.value.filter(function(e,o){return o!==n})});0!==o.value.length?null==H||H(G,o):null==J||J(G)}},[P,G,H,J]),te=o.useCallback(function(n,o){var i;if(!O){var l=null===(i=P.value[n])||void 0===i?void 0:i.contentId;if(l){var a=e.__assign(e.__assign({},P),{value:P.value.map(function(n){return n.contentId===l?e.__assign(e.__assign({},n),{content:o}):n})});null==K||K(a)}}},[P,O,K]),se=o.useCallback(function(n){var o;if(!O){var i=null===(o=P.value[n])||void 0===o?void 0:o.contentId;if(i){var l=e.__assign(e.__assign({},P),{value:P.value.map(function(n){return n.contentId===i?e.__assign(e.__assign({},n),{isApproved:!0}):n})});null==K||K(l)}}},[P,O,K]),re=null!=(null==P?void 0:P.big_enough)&&!Number.isNaN(P.big_enough)&&!!(null==P?void 0:P.big_enough_decision_factors);return n.jsxs("div",e.__assign({className:l.default.container,style:e.__assign({},null===(_=null===(c=null===(v=null==ee?void 0:ee.approvalScreen)||void 0===v?void 0:v.body)||void 0===c?void 0:c.contentSegment)||void 0===_?void 0:_.container)},{children:[O&&n.jsxs("button",e.__assign({onClick:oe,className:l.default.header,style:e.__assign({},null===(m=null===(p=null===(g=null==ee?void 0:ee.approvalScreen)||void 0===g?void 0:g.body)||void 0===p?void 0:p.contentSegment)||void 0===m?void 0:m.header)},{children:[n.jsxs("div",e.__assign({className:l.default.headerContent,style:e.__assign({},null===(h=null===(f=null===(S=null==ee?void 0:ee.approvalScreen)||void 0===S?void 0:S.body)||void 0===f?void 0:f.contentSegment)||void 0===h?void 0:h.headerContent)},{children:[n.jsxs("div",e.__assign({className:l.default.headerMeta,style:e.__assign({},null===(b=null===(y=null===(C=null==ee?void 0:ee.approvalScreen)||void 0===C?void 0:C.body)||void 0===y?void 0:y.contentSegment)||void 0===b?void 0:b.headerMeta)},{children:[n.jsx(t.BookmarkIcon,{size:16,color:(null===(x=null===(I=null===(j=null==ee?void 0:ee.approvalScreen)||void 0===j?void 0:j.body)||void 0===I?void 0:I.contentSegment)||void 0===x?void 0:x.bookMarkColor)||"#8C8C8C"}),n.jsx("h2",e.__assign({className:l.default.headerArtifactId,style:e.__assign({},null===(A=null===(q=null===(k=null==ee?void 0:ee.approvalScreen)||void 0===k?void 0:k.body)||void 0===q?void 0:q.contentSegment)||void 0===A?void 0:A.headerArtifactId)},{children:U}))]})),n.jsx("p",e.__assign({className:l.default.headerTitle,style:e.__assign({},null===(F=null===(B=null===(N=null==ee?void 0:ee.approvalScreen)||void 0===N?void 0:N.body)||void 0===B?void 0:B.contentSegment)||void 0===F?void 0:F.headerTitle)},{children:null==P?void 0:P.title}))]})),n.jsxs("div",e.__assign({className:l.default.headerToggle,style:e.__assign({},null===(T=null===(M=null===(E=null==ee?void 0:ee.approvalScreen)||void 0===E?void 0:E.body)||void 0===M?void 0:M.contentSegment)||void 0===T?void 0:T.headerToggle)},{children:[re&&n.jsx(u.BigEnoughPanel,{customIcons:null==ne?void 0:ne.userStoryIcons,customStyles:null===(w=null==ee?void 0:ee.approvalScreen)||void 0===w?void 0:w.aiReasoningCitaionStyles,currentUserStory:P,panelStyles:null===(D=null==ee?void 0:ee.approvalScreen)||void 0===D?void 0:D.BigEnoughStyles}),Y?n.jsx(a.ChevronUpIcon,{size:16}):n.jsx(s.ChevronDownIcon,{size:16})]}))]})),Y&&n.jsx("div",e.__assign({className:l.default.contentWrapper,style:e.__assign({},null===(z=null===(W=null===(R=null==ee?void 0:ee.approvalScreen)||void 0===R?void 0:R.body)||void 0===W?void 0:W.contentSegment)||void 0===z?void 0:z.contentWrapper)},{children:Array.isArray(null==P?void 0:P.value)&&P.value.map(function(e,o){return n.jsx(i.ContentBlock,{segment:e,segmentIndex:o,isSubFeature:O,onSaveContent:O?le:te,onApproveContent:O?ie:se,onDeleteContent:O?ae:void 0,EditorComponent:L,ViewerComponent:Q},e.contentId)})}))]}))};exports.ContentSegment=d,exports.default=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react"),l=require("../ContentBlock/ContentBlock.js"),t=require("./ContentSegment.module.css.js"),i=require("../../../../icons/ChevronUpIcon.js"),r=require("../../../../icons/BookmarkIcon.js"),s=require("../../../../icons/ChevronDownIcon.js"),a=require("../../../RequirementAIWrapper/RequirementAIWrapper.js"),u=require("../../../story-screen/BigEnoughPanel.js"),d=require("@mui/material"),v=require("lucide-react"),c=require("showdown"),_=require("../../../../utils/helpers.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=m(c),p=function(c){var m,p,f,h,y,S,C,b,j,x,I,k,w,q,M,N,B,A,D,E,F,T,z,P,L,R,U,W,H,O=c.userStoryForApproval,V=c.artifactTitleId,G=c.isSubFeature,J=void 0!==G&&G,K=c.subFeatureIndex,Q=c.onSaveSubFeature,X=c.onDeleteSubFeature,Y=c.onSaveMainStoryContent,Z=c.EditorComponent,$=c.ViewerComponent,ee=c.handleDownloadUserStory,ne=c.handleOpenSendDialog,oe=c.showShareIcon,le=void 0!==oe&&oe,te=o.useState(!0),ie=te[0],re=te[1],se=a.useRequirementAI(),ae=se.customStyles,ue=se.customIcons,de=null==ae?void 0:ae.userStoryCardStyles,ve=o.useState(null),ce=ve[0],_e=ve[1],me=o.useState(!1);me[0];var ge=me[1],pe=o.useRef(null),fe=o.useCallback(function(){re(function(e){return!e})},[]),he=o.useCallback(function(n){if(void 0!==K){var o=e.__assign(e.__assign({},O),{value:O.value.map(function(o,l){return l===n?e.__assign(e.__assign({},o),{isApproved:!0}):o})});null==Q||Q(K,o)}},[O,K,Q]),ye=o.useCallback(function(n,o){if(void 0!==K){var l=e.__assign(e.__assign({},O),{value:O.value.map(function(l,t){return t===n?e.__assign(e.__assign({},l),{content:o}):l})});null==Q||Q(K,l)}},[O,K,Q]),Se=o.useCallback(function(n){if(void 0!==K){var o=e.__assign(e.__assign({},O),{value:O.value.filter(function(e,o){return o!==n})});0!==o.value.length?null==Q||Q(K,o):null==X||X(K)}},[O,K,Q,X]),Ce=o.useCallback(function(n,o){var l;if(!J){var t=null===(l=O.value[n])||void 0===l?void 0:l.contentId;if(t){var i=e.__assign(e.__assign({},O),{value:O.value.map(function(n){return n.contentId===t?e.__assign(e.__assign({},n),{content:o}):n})});null==Y||Y(i)}}},[O,J,Y]),be=o.useCallback(function(n){var o;if(!J){var l=null===(o=O.value[n])||void 0===o?void 0:o.contentId;if(l){var t=e.__assign(e.__assign({},O),{value:O.value.map(function(n){return n.contentId===l?e.__assign(e.__assign({},n),{isApproved:!0}):n})});null==Y||Y(t)}}},[O,J,Y]),je=function(){_e(null)},xe=function(n){var o,l=n.value.map(function(e){return e.content}).join("");return e.__assign(e.__assign({},n),{value:l,sub_features:null===(o=n.sub_features)||void 0===o?void 0:o.map(xe)})},Ie=null!=(null==O?void 0:O.big_enough)&&!Number.isNaN(O.big_enough)&&!!(null==O?void 0:O.big_enough_decision_factors);return n.jsxs("div",e.__assign({className:t.default.container,style:e.__assign({},null===(f=null===(p=null===(m=null==ae?void 0:ae.approvalScreen)||void 0===m?void 0:m.body)||void 0===p?void 0:p.contentSegment)||void 0===f?void 0:f.container)},{children:[J&&n.jsxs("button",e.__assign({onClick:fe,className:t.default.header,style:e.__assign({},null===(S=null===(y=null===(h=null==ae?void 0:ae.approvalScreen)||void 0===h?void 0:h.body)||void 0===y?void 0:y.contentSegment)||void 0===S?void 0:S.header)},{children:[n.jsxs("div",e.__assign({className:t.default.headerContent,style:e.__assign({},null===(j=null===(b=null===(C=null==ae?void 0:ae.approvalScreen)||void 0===C?void 0:C.body)||void 0===b?void 0:b.contentSegment)||void 0===j?void 0:j.headerContent)},{children:[n.jsxs("div",e.__assign({className:t.default.headerMeta,style:e.__assign({},null===(k=null===(I=null===(x=null==ae?void 0:ae.approvalScreen)||void 0===x?void 0:x.body)||void 0===I?void 0:I.contentSegment)||void 0===k?void 0:k.headerMeta)},{children:[n.jsx(r.BookmarkIcon,{size:16,color:(null===(M=null===(q=null===(w=null==ae?void 0:ae.approvalScreen)||void 0===w?void 0:w.body)||void 0===q?void 0:q.contentSegment)||void 0===M?void 0:M.bookMarkColor)||"#8C8C8C"}),n.jsx("h2",e.__assign({className:t.default.headerArtifactId,style:e.__assign({},null===(A=null===(B=null===(N=null==ae?void 0:ae.approvalScreen)||void 0===N?void 0:N.body)||void 0===B?void 0:B.contentSegment)||void 0===A?void 0:A.headerArtifactId)},{children:V}))]})),n.jsx("p",e.__assign({className:t.default.headerTitle,style:e.__assign({},null===(F=null===(E=null===(D=null==ae?void 0:ae.approvalScreen)||void 0===D?void 0:D.body)||void 0===E?void 0:E.contentSegment)||void 0===F?void 0:F.headerTitle)},{children:null==O?void 0:O.title}))]})),n.jsxs("div",e.__assign({className:t.default.headerToggle,style:e.__assign({},null===(P=null===(z=null===(T=null==ae?void 0:ae.approvalScreen)||void 0===T?void 0:T.body)||void 0===z?void 0:z.contentSegment)||void 0===P?void 0:P.headerToggle)},{children:[Ie&&n.jsx(u.BigEnoughPanel,{customIcons:null==ue?void 0:ue.userStoryIcons,customStyles:null===(L=null==ae?void 0:ae.approvalScreen)||void 0===L?void 0:L.aiReasoningCitaionStyles,currentUserStory:O,panelStyles:null===(R=null==ae?void 0:ae.approvalScreen)||void 0===R?void 0:R.BigEnoughStyles}),le&&n.jsxs(n.Fragment,{children:[n.jsx("button",e.__assign({className:t.default.iconButton,style:null==de?void 0:de.iconButton,onClick:function(e){_e(e.currentTarget)}},{children:n.jsx(v.ExternalLink,{size:16})})),n.jsxs(d.Menu,e.__assign({id:"user-story-share-menu",anchorEl:ce,open:!!ce,onClose:function(){return _e(null)},style:null==de?void 0:de.userStoryShareMenu},{children:[n.jsx(d.MenuItem,e.__assign({style:null==de?void 0:de.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return ge(!0),ee?[4,Promise.all([ee("pdf"),ee("doc")])]:[2];case 1:return e.sent(),ge(!1),[2]}})})}},{children:n.jsxs("div",e.__assign({ref:pe,className:t.default.menuItemContent,style:null==de?void 0:de.menuItemContent},{children:[n.jsx(v.Download,{size:16,color:null==de?void 0:de.menuIconColor}),n.jsx("p",e.__assign({style:null==de?void 0:de.menuLabel},{children:"Download"}))]}))})),n.jsx(d.MenuItem,e.__assign({style:null==de?void 0:de.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){return n=xe(O),null==ne||ne(!0,[n],O.artifactId),je(),[2]})})}},{children:n.jsxs("div",e.__assign({style:null==de?void 0:de.menuItemContent,className:t.default.menuItemContentPadded},{children:[n.jsx(v.Share2,{size:16,color:null==de?void 0:de.menuIconColor}),n.jsx("p",e.__assign({style:null==de?void 0:de.menuLabel},{children:"Send"}))]}))})),n.jsx(d.MenuItem,e.__assign({style:null==de?void 0:de.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,o,l,t,i,r;return e.__generator(this,function(e){switch(e.label){case 0:n=new g.default.Converter,o=O.value.map(function(e){return e.content}).join(""),l=n.makeHtml(_.formatMarkdown(o)||o),t=function(e){var n=(new g.default.Converter).makeHtml(e),o=document.createElement("div");return o.innerHTML=n,o.textContent||o.innerText||""}(_.formatMarkdown(o)||o),i=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})}),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,navigator.clipboard.write([i])];case 2:return e.sent(),console.log("Copied User Story"),[3,5];case 3:return r=e.sent(),console.error("Failed to copy user story:",r),[3,5];case 4:return je(),[7];case 5:return[2]}})})}},{children:n.jsxs("div",e.__assign({style:null==de?void 0:de.menuItemContent,className:t.default.menuItemContentPadded},{children:[n.jsx(v.Copy,{size:16,color:null==de?void 0:de.menuIconColor}),n.jsx("p",e.__assign({style:null==de?void 0:de.menuLabel},{children:"Copy"}))]}))}))]}))]}),ie?n.jsx(i.ChevronUpIcon,{size:16}):n.jsx(s.ChevronDownIcon,{size:16})]}))]})),ie&&n.jsx("div",e.__assign({className:t.default.contentWrapper,style:e.__assign({},null===(H=null===(W=null===(U=null==ae?void 0:ae.approvalScreen)||void 0===U?void 0:U.body)||void 0===W?void 0:W.contentSegment)||void 0===H?void 0:H.contentWrapper)},{children:Array.isArray(null==O?void 0:O.value)&&O.value.map(function(e,o){return n.jsx(l.ContentBlock,{segment:e,segmentIndex:o,isSubFeature:J,onSaveContent:J?ye:Ce,onApproveContent:J?he:be,onDeleteContent:J?Se:void 0,EditorComponent:Z,ViewerComponent:$},e.contentId)})}))]}))};exports.ContentSegment=p,exports.default=p;
2
2
  //# sourceMappingURL=ContentSegment.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".ContentSegment-module_container__pZD9O{display:flex;flex-direction:column;font-family:Inter,sans-serif}.ContentSegment-module_header__zzh-M{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-left:none;border-right:none;cursor:pointer;display:flex;flex-direction:row;font-family:Inter,sans-serif;justify-content:space-between;padding:1rem 2rem;position:relative}.ContentSegment-module_headerContent__o77O4{display:flex;flex-direction:column;gap:.5rem}.ContentSegment-module_headerMeta__Iv4Wf{align-items:center;color:#8c8c8c;display:flex;flex-direction:row;gap:8px}.ContentSegment-module_headerArtifactId__Gr4B2{color:#6932e2;font-family:Inter,sans-serif;font-size:14px;font-weight:400;margin:0}.ContentSegment-module_headerTitle__U7nsT{font-family:Inter,sans-serif;font-size:16px;font-weight:600;margin:0}.ContentSegment-module_headerToggle__45got{align-items:center;display:flex;justify-content:center}.ContentSegment-module_contentWrapper__eIUig{display:flex;flex-direction:column;gap:16px;padding:16px 32px}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={container:"ContentSegment-module_container__pZD9O",header:"ContentSegment-module_header__zzh-M",headerContent:"ContentSegment-module_headerContent__o77O4",headerMeta:"ContentSegment-module_headerMeta__Iv4Wf",headerArtifactId:"ContentSegment-module_headerArtifactId__Gr4B2",headerTitle:"ContentSegment-module_headerTitle__U7nsT",headerToggle:"ContentSegment-module_headerToggle__45got",contentWrapper:"ContentSegment-module_contentWrapper__eIUig"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".ContentSegment-module_container__pZD9O{display:flex;flex-direction:column;font-family:Inter,sans-serif}.ContentSegment-module_header__zzh-M{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-left:none;border-right:none;cursor:pointer;display:flex;flex-direction:row;font-family:Inter,sans-serif;justify-content:space-between;padding:1rem 2rem;position:relative}.ContentSegment-module_headerContent__o77O4{display:flex;flex-direction:column;gap:.5rem}.ContentSegment-module_headerMeta__Iv4Wf{align-items:center;color:#8c8c8c;display:flex;flex-direction:row;gap:8px}.ContentSegment-module_headerArtifactId__Gr4B2{color:#6932e2;font-family:Inter,sans-serif;font-size:14px;font-weight:400;margin:0}.ContentSegment-module_headerTitle__U7nsT{font-family:Inter,sans-serif;font-size:16px;font-weight:600;margin:0}.ContentSegment-module_headerToggle__45got{align-items:center;display:flex;justify-content:center}.ContentSegment-module_contentWrapper__eIUig{display:flex;flex-direction:column;gap:16px;padding:16px 32px}.ContentSegment-module_iconButton__0F6ls{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;display:flex;justify-content:center;margin-left:.5rem;padding:.4rem .8rem}.ContentSegment-module_menuItemContent__39-so{align-items:center;display:flex;flex-direction:row;gap:.5rem;margin-left:.25rem}.ContentSegment-module_menuItemContentPadded__CP7YL{align-items:center;display:flex;flex-direction:row;gap:.5rem;padding-left:.25rem}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={container:"ContentSegment-module_container__pZD9O",header:"ContentSegment-module_header__zzh-M",headerContent:"ContentSegment-module_headerContent__o77O4",headerMeta:"ContentSegment-module_headerMeta__Iv4Wf",headerArtifactId:"ContentSegment-module_headerArtifactId__Gr4B2",headerTitle:"ContentSegment-module_headerTitle__U7nsT",headerToggle:"ContentSegment-module_headerToggle__45got",contentWrapper:"ContentSegment-module_contentWrapper__eIUig",iconButton:"ContentSegment-module_iconButton__0F6ls",menuItemContent:"ContentSegment-module_menuItemContent__39-so",menuItemContentPadded:"ContentSegment-module_menuItemContentPadded__CP7YL"};
2
2
  //# sourceMappingURL=ContentSegment.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as i}from"tslib";import{jsxs as n,jsx as o,Fragment as l}from"react/jsx-runtime";import{useState as e,useMemo as t}from"react";import{Bookmark as s,ChevronDown as a,ChevronRight as d,Info as r}from"lucide-react";import{Tooltip as c}from"@mui/material";import{v4 as u}from"uuid";import v from"../RiskSidebarCategorySection/RiskSidebarCategorySection.js";import m from"../RiskCategorySection/RiskCategorySection.js";import h from"./StoryNode.module.css.js";var g=function(i){var n,o,l,e,t,s,a,d=(null===(o=null===(n=i.display_items)||void 0===n?void 0:n.critical)||void 0===o?void 0:o.length)||0,r=(null===(e=null===(l=i.display_items)||void 0===l?void 0:l.warning)||void 0===e?void 0:e.length)||0,c=(null===(s=null===(t=i.display_items)||void 0===t?void 0:t.recommendation)||void 0===s?void 0:s.length)||0;if((null===(a=i.sub_feature)||void 0===a?void 0:a.length)>0)for(var u=0,v=i.sub_feature;u<v.length;u++){var m=v[u],h=g(m);d+=h.critical,r+=h.warning,c+=h.recommendation}return{critical:d,warning:r,recommendation:c}};function p(n,l,e,t){for(var s,a=[],d=/<learned>(.*?)<\/learned>/g,v=0,m=0,g=l||r;null!==(s=d.exec(n));){s[0];var p=s[1],y=s.index;y>v&&a.push(o("span",{children:n.slice(v,y)},"text-pre-".concat(m++))),a.push(o(c,i({title:p,placement:"top"},{children:o(g,{size:t||16,className:h.infoIcon,style:{color:e,width:t,height:t}})}),"tooltip-".concat(u()))),v=d.lastIndex}return v<(null==n?void 0:n.length)&&a.push(o("span",{children:n.slice(v)},"text-post-".concat(m++))),a}var y=function(r){var u,C,f,I,S,k,b,w,N,R,_,x,G,z,A,W,F,H,P,j,L,O,B,D,M=r.story,T=r.depth,E=void 0===T?0:T,J=r.onClickStoryNodeCallback,q=r.type,K=r.isProcessingGapItems,Q=r.onClickAiReasoning,U=r.handleFixRisk,V=r.handleHighlightGapContent,X=r.customStyles,Y=r.customIcons,Z=r.onSelectStory,$=r.rootArtifactId,ii=void 0===$?M.id:$,ni=e(0===E),oi=ni[0],li=ni[1],ei=e(!1),ti=ei[0],si=ei[1],ai=null==X?void 0:X.storyNode,di=(null===(u=null==Y?void 0:Y.icons)||void 0===u?void 0:u.bookmarkIcon)||s,ri=(null===(C=null==Y?void 0:Y.icons)||void 0===C?void 0:C.chevronDownIcon)||a,ci=(null===(f=null==Y?void 0:Y.icons)||void 0===f?void 0:f.chevronRightIcon)||d,ui=t(function(){return M.display_items.critical.length>0?"Critical":M.display_items.warning.length>0?"Warning":M.display_items.recommendation.length>0?"Suggestion":null},[M.display_items,q]),vi=t(function(){return g(M)},[M]),mi=0===((null===(S=null===(I=M.display_items)||void 0===I?void 0:I.critical)||void 0===S?void 0:S.length)||0)+((null===(b=null===(k=M.display_items)||void 0===k?void 0:k.warning)||void 0===b?void 0:b.length)||0)+((null===(N=null===(w=M.display_items)||void 0===w?void 0:w.recommendation)||void 0===N?void 0:N.length)||0);return n("div",i({className:"".concat(h.container," ").concat(E>0?h.nestedContainer:""),style:i(i({},null==ai?void 0:ai.container),E>0?null==ai?void 0:ai.nestedContainer:{})},{children:[n("div",i({onClick:function(){li(!oi),null==J||J(),null==Z||Z(ii)},className:h.headerRow,style:i(i({},null==ai?void 0:ai.headerRow),ti?null==ai?void 0:ai.headerRowHover:{}),onMouseEnter:function(){return si(!0)},onMouseLeave:function(){return si(!1)}},{children:[o("div",i({className:h.chevronWrapper,style:null==ai?void 0:ai.chevronWrapper},{children:oi?o(ri,{className:h.chevronIcon,style:{color:null===(R=null==Y?void 0:Y.iconColors)||void 0===R?void 0:R.chevronIcon,width:null===(_=null==Y?void 0:Y.iconSizes)||void 0===_?void 0:_.chevronIcon,height:null===(x=null==Y?void 0:Y.iconSizes)||void 0===x?void 0:x.chevronIcon}}):o(ci,{className:h.chevronIcon,style:{color:null===(G=null==Y?void 0:Y.iconColors)||void 0===G?void 0:G.chevronIcon,width:null===(z=null==Y?void 0:Y.iconSizes)||void 0===z?void 0:z.chevronIcon,height:null===(A=null==Y?void 0:Y.iconSizes)||void 0===A?void 0:A.chevronIcon}})})),n("div",i({className:h.headerContent,style:null==ai?void 0:ai.headerContent},{children:[n("div",i({className:h.artifactIdRow,style:null==ai?void 0:ai.artifactIdRow},{children:[o(di,{className:h.bookmarkIcon,style:{color:null===(W=null==Y?void 0:Y.iconColors)||void 0===W?void 0:W.bookmarkIcon,width:null===(F=null==Y?void 0:Y.iconSizes)||void 0===F?void 0:F.bookmarkIcon,height:null===(H=null==Y?void 0:Y.iconSizes)||void 0===H?void 0:H.bookmarkIcon}}),o("span",i({style:null==ai?void 0:ai.artifactIdText},{children:M.artifactTitleID}))]})),o(c,i({title:p(M.title,null===(P=null==Y?void 0:Y.icons)||void 0===P?void 0:P.infoIcon,null===(j=null==Y?void 0:Y.iconColors)||void 0===j?void 0:j.infoIcon,null===(L=null==Y?void 0:Y.iconSizes)||void 0===L?void 0:L.infoIcon),arrow:!0},{children:o("h3",i({className:h.title,style:i(i({},null==ai?void 0:ai.title),ti?null==ai?void 0:ai.titleHover:{})},{children:p(M.title,null===(O=null==Y?void 0:Y.icons)||void 0===O?void 0:O.infoIcon,null===(B=null==Y?void 0:Y.iconColors)||void 0===B?void 0:B.infoIcon,null===(D=null==Y?void 0:Y.iconSizes)||void 0===D?void 0:D.infoIcon)}))})),!oi&&o("div",i({className:h.collapsedSummary,style:null==ai?void 0:ai.collapsedSummary},{children:(0===E||vi.critical+vi.warning+vi.recommendation>0)&&n(l,{children:[o("span",i({className:h.summaryLabel,style:null==ai?void 0:ai.summaryLabel},{children:"Gap"===q?"Gaps : ":"Risks : "})),n("div",i({className:h.summaryBadgesContainer,style:null==ai?void 0:ai.summaryBadgesContainer},{children:[vi.critical>0&&o(v,{title:"Critical",length:vi.critical,badgeColorClass:"critical",customStyles:X}),vi.warning>0&&o(v,{title:"Warning",length:vi.warning,badgeColorClass:"warning",customStyles:X}),vi.recommendation>0&&o(v,{title:"JAS",length:vi.recommendation,badgeColorClass:"suggestion",customStyles:X})]}))]})}))]}))]})),oi&&n("div",i({className:h.expandedContent,style:null==ai?void 0:ai.expandedContent},{children:[o("div",i({className:h.expandedInnerPadding,style:null==ai?void 0:ai.expandedInnerPadding},{children:!mi&&n("div",i({className:h.itemsContainer,style:null==ai?void 0:ai.itemsContainer},{children:[o(m,{title:"Critical",items:M.display_items.critical,badgeColorClass:"critical",defaultOpen:"Critical"===ui,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y}),o(m,{title:"Warning",items:M.display_items.warning,badgeColorClass:"warning",defaultOpen:"Warning"===ui,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y}),o(m,{title:"Suggestion",items:M.display_items.recommendation,badgeColorClass:"suggestion",defaultOpen:"Suggestion"===ui,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y})]}))})),M.sub_feature&&M.sub_feature.length>0&&o("div",i({className:h.subFeaturesWrapper,style:null==ai?void 0:ai.subFeaturesWrapper},{children:M.sub_feature.map(function(i,n){return o(y,{story:i,depth:E+1,onClickStoryNodeCallback:J,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y,onSelectStory:Z,rootArtifactId:ii},n)})}))]}))]}))};export{y as default,p as replaceLearnedTagsWithInfo};
1
+ import{__assign as i}from"tslib";import{jsxs as n,jsx as o,Fragment as l}from"react/jsx-runtime";import{useState as e,useMemo as t}from"react";import{Bookmark as a,ChevronDown as s,ChevronRight as d,Info as r}from"lucide-react";import{Tooltip as c}from"@mui/material";import{v4 as u}from"uuid";import v from"../RiskSidebarCategorySection/RiskSidebarCategorySection.js";import m from"../RiskCategorySection/RiskCategorySection.js";import h from"./StoryNode.module.css.js";var g=function(i){var n,o,l,e,t,a,s,d=(null===(o=null===(n=i.display_items)||void 0===n?void 0:n.critical)||void 0===o?void 0:o.length)||0,r=(null===(e=null===(l=i.display_items)||void 0===l?void 0:l.warning)||void 0===e?void 0:e.length)||0,c=(null===(a=null===(t=i.display_items)||void 0===t?void 0:t.recommendation)||void 0===a?void 0:a.length)||0;if((null===(s=i.sub_feature)||void 0===s?void 0:s.length)>0)for(var u=0,v=i.sub_feature;u<v.length;u++){var m=v[u],h=g(m);d+=h.critical,r+=h.warning,c+=h.recommendation}return{critical:d,warning:r,recommendation:c}};function p(n,l,e,t){for(var a,s=[],d=/<learned>(.*?)<\/learned>/g,v=0,m=0,g=l||r;null!==(a=d.exec(n));){a[0];var p=a[1],y=a.index;y>v&&s.push(o("span",{children:n.slice(v,y)},"text-pre-".concat(m++))),s.push(o(c,i({title:p,placement:"top"},{children:o(g,{size:t||16,className:h.infoIcon,style:{color:e,width:t,height:t}})}),"tooltip-".concat(u()))),v=d.lastIndex}return v<(null==n?void 0:n.length)&&s.push(o("span",{children:n.slice(v)},"text-post-".concat(m++))),s}var y=function(r){var u,C,f,I,S,k,b,N,w,R,_,x,G,z,A,F,W,H,P,L,j,O,B,D,M=r.story,T=r.depth,E=void 0===T?0:T,J=r.onClickStoryNodeCallback,q=r.type,K=r.isProcessingGapItems,Q=r.onClickAiReasoning,U=r.handleFixRisk,V=r.handleHighlightGapContent,X=r.customStyles,Y=r.customIcons,Z=r.onSelectStory,$=r.rootArtifactId,ii=void 0===$?M.id:$,ni=e(0===E),oi=ni[0],li=ni[1],ei=e(!1),ti=ei[0],ai=ei[1],si=null==X?void 0:X.storyNode,di=(null===(u=null==Y?void 0:Y.icons)||void 0===u?void 0:u.bookmarkIcon)||a,ri=(null===(C=null==Y?void 0:Y.icons)||void 0===C?void 0:C.chevronDownIcon)||s,ci=(null===(f=null==Y?void 0:Y.icons)||void 0===f?void 0:f.chevronRightIcon)||d,ui=t(function(){return M.display_items.critical.length>0?"Critical":M.display_items.warning.length>0?"Warning":M.display_items.recommendation.length>0?"Suggestion":null},[M.display_items,q]),vi=t(function(){return g(M)},[M]),mi=0===((null===(S=null===(I=M.display_items)||void 0===I?void 0:I.critical)||void 0===S?void 0:S.length)||0)+((null===(b=null===(k=M.display_items)||void 0===k?void 0:k.warning)||void 0===b?void 0:b.length)||0)+((null===(w=null===(N=M.display_items)||void 0===N?void 0:N.recommendation)||void 0===w?void 0:w.length)||0);return n("div",i({className:"".concat(h.container," ").concat(E>0?h.nestedContainer:""),style:i(i({},null==si?void 0:si.container),E>0?null==si?void 0:si.nestedContainer:{})},{children:[n("div",i({onClick:function(){li(!oi),null==J||J(),null==Z||Z(ii)},className:h.headerRow,style:i(i({},null==si?void 0:si.headerRow),ti?null==si?void 0:si.headerRowHover:{}),onMouseEnter:function(){return ai(!0)},onMouseLeave:function(){return ai(!1)}},{children:[o("div",i({className:h.chevronWrapper,style:null==si?void 0:si.chevronWrapper},{children:oi?o(ri,{className:h.chevronIcon,style:{color:null===(R=null==Y?void 0:Y.iconColors)||void 0===R?void 0:R.chevronIcon,width:null===(_=null==Y?void 0:Y.iconSizes)||void 0===_?void 0:_.chevronIcon,height:null===(x=null==Y?void 0:Y.iconSizes)||void 0===x?void 0:x.chevronIcon}}):o(ci,{className:h.chevronIcon,style:{color:null===(G=null==Y?void 0:Y.iconColors)||void 0===G?void 0:G.chevronIcon,width:null===(z=null==Y?void 0:Y.iconSizes)||void 0===z?void 0:z.chevronIcon,height:null===(A=null==Y?void 0:Y.iconSizes)||void 0===A?void 0:A.chevronIcon}})})),n("div",i({className:h.headerContent,style:null==si?void 0:si.headerContent},{children:[n("div",i({className:h.artifactIdRow,style:null==si?void 0:si.artifactIdRow},{children:[o(di,{className:h.bookmarkIcon,style:{color:null===(F=null==Y?void 0:Y.iconColors)||void 0===F?void 0:F.bookmarkIcon,width:null===(W=null==Y?void 0:Y.iconSizes)||void 0===W?void 0:W.bookmarkIcon,height:null===(H=null==Y?void 0:Y.iconSizes)||void 0===H?void 0:H.bookmarkIcon}}),o("span",i({style:null==si?void 0:si.artifactIdText},{children:M.artifactTitleID}))]})),o(c,i({title:p(M.title,null===(P=null==Y?void 0:Y.icons)||void 0===P?void 0:P.infoIcon,null===(L=null==Y?void 0:Y.iconColors)||void 0===L?void 0:L.infoIcon,null===(j=null==Y?void 0:Y.iconSizes)||void 0===j?void 0:j.infoIcon),arrow:!0},{children:o("h3",i({className:h.title,style:i(i({},null==si?void 0:si.title),ti?null==si?void 0:si.titleHover:{})},{children:p(M.title,null===(O=null==Y?void 0:Y.icons)||void 0===O?void 0:O.infoIcon,null===(B=null==Y?void 0:Y.iconColors)||void 0===B?void 0:B.infoIcon,null===(D=null==Y?void 0:Y.iconSizes)||void 0===D?void 0:D.infoIcon)}))})),!oi&&o("div",i({className:h.collapsedSummary,style:null==si?void 0:si.collapsedSummary},{children:(0===E||vi.critical+vi.warning+vi.recommendation>0)&&n(l,{children:[o("span",i({className:h.summaryLabel,style:null==si?void 0:si.summaryLabel},{children:"Gap"===q?"Gaps : ":"Risks : "})),n("div",i({className:h.summaryBadgesContainer,style:null==si?void 0:si.summaryBadgesContainer},{children:[vi.critical>0&&o(v,{title:"Critical",length:vi.critical,badgeColorClass:"critical",customStyles:X}),vi.warning>0&&o(v,{title:"Warning",length:vi.warning,badgeColorClass:"warning",customStyles:X}),vi.recommendation>0&&o(v,{title:"JAS",length:vi.recommendation,badgeColorClass:"suggestion",customStyles:X})]}))]})}))]}))]})),oi&&n("div",i({className:h.expandedContent,style:null==si?void 0:si.expandedContent},{children:[o("div",i({className:h.expandedInnerPadding,style:null==si?void 0:si.expandedInnerPadding},{children:mi?E>0&&o("span",i({className:h.summaryLabel,style:null==si?void 0:si.summaryLabel},{children:"Gaps: No Gaps Found"})):n("div",i({className:h.itemsContainer,style:null==si?void 0:si.itemsContainer},{children:[o(m,{title:"Critical",items:M.display_items.critical,badgeColorClass:"critical",defaultOpen:"Critical"===ui,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y}),o(m,{title:"Warning",items:M.display_items.warning,badgeColorClass:"warning",defaultOpen:"Warning"===ui,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y}),o(m,{title:"Suggestion",items:M.display_items.recommendation,badgeColorClass:"suggestion",defaultOpen:"Suggestion"===ui,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y})]}))})),M.sub_feature&&M.sub_feature.length>0&&o("div",i({className:h.subFeaturesWrapper,style:null==si?void 0:si.subFeaturesWrapper},{children:M.sub_feature.map(function(i,n){return o(y,{story:i,depth:E+1,onClickStoryNodeCallback:J,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y,onSelectStory:Z,rootArtifactId:ii},n)})}))]}))]}))};export{y as default,p as replaceLearnedTagsWithInfo};
2
2
  //# sourceMappingURL=StoryNode.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as t,__generator as n,__spreadArray as o}from"tslib";import{jsxs as l,jsx as i,Fragment as r}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as u}from"react";import{ChevronUp as d,ChevronDown as c,ExternalLink as v,Download as p,Share2 as m,Copy as h,LoaderCircle as f,PencilIcon as y,Plus as S,Trash2 as g,X as C,Ellipsis as I,Hourglass as N,Check as b,ChevronUpIcon as w,ChevronDownIcon as D,Info as E,Bookmark as B}from"lucide-react";import x from"showdown";import{Menu as T,MenuItem as A,Tooltip as U}from"@mui/material";import P from"../../icons/Illustration.svg.js";import{v4 as k}from"uuid";import R from"./UserStoryCard.module.css.js";import{formatMarkdown as _,indentMarkdown as L}from"../../utils/helpers.js";import{replaceTitleSection as M}from"../../utils/user-story.utils.js";import j from"../../shared/AtomicButton.js";import V from"../RichTextEditor/RichTextEditor.js";import G from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as O,useRequirementAI as z}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as H}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as W}from"./TitleEditor/TitleEditor.js";import F from"./ClinicalTrialSection.js";import{CompletionPanel as q}from"../story-screen/CompletionPanel.js";import Q from"../../icons/CDIcon.js";var Z,J=((Z={})[O.WAITING]="WAITING TO GENERATE",Z[O.IN_PROGRESS]="IN PROGRESS",Z[O.GENERATED]="GENERATED",Z[O.FAILED]="FAILED",Z[O.GENERATE]="GENERATE",Z[O.APPROVED]="APPROVED",Z);function K(t){for(var n,o=[],l=/<learned>(.*?)<\/learned>/g,r=0,a=0;null!==(n=l.exec(t));){var s=n[1],u=n.index;u>r&&o.push(i("span",{children:t.slice(r,u)},"text-pre-".concat(a++))),o.push(i(U,e({title:s,placement:"top"},{children:i(E,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(k()))),r=l.lastIndex}return r<(null==t?void 0:t.length)&&o.push(i("span",{children:t.slice(r)},"text-post-".concat(a++))),o}function X(t,n,o){var l;if(!t)return{};if(n)return e({},t.parentConfig);var i=e({},t.childConfig);return o&&(null===(l=t.subFeatureOverrides)||void 0===l?void 0:l[o])?e(e({},i),t.subFeatureOverrides[o]):i}var Y=function(t){var n,o=t.displayName,r=z().customStyles,a=null===(n=null==r?void 0:r.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return l("div",e({className:R.displayName,style:null==a?void 0:a.wrapper},{children:[i(B,{className:R.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),l("span",e({style:null==a?void 0:a.label},{children:[o,":"]}))]}))},$=function(w){var D,E,B,U,Z,ee,te,ne,oe,le,ie,re,ae,se,ue,de,ce,ve,pe,me=w.isUserStoryCurrentlyUpdated,he=w.artifactId,fe=w.artifactTitleId,ye=w.parentUserStory,Se=w.currentUserStory,ge=w.onUserStoryChange,Ce=w.parentIndex,Ie=w.currentIndex,Ne=w.enableDownload,be=w.isDiffEditReviewMode,we=w.showUserStoryDiff,De=w.handleDownloadUserStory,Ee=w.handleOpenSendDialog,Be=w.updateUserStoryArtifact,xe=w.selectedArtifactId,Te=w.isDisplayHighlightControl,Ae=w.elementDisplayConfig,Ue=w._resolvedConfig,Pe=w.showWrapper,ke=void 0!==Pe&&Pe,Re=w.defaultExpanded,_e=w.actionItemsConfig,Le=w.onDelete,Me=w.contextVariant,je=w.expandedSubFeatures,Ve=w.showDisplayName,Ge=void 0===Ve||Ve,Oe=w.allowTitleEdit,ze=void 0===Oe||Oe,He=w.showConfidenceScore,We=void 0===He||He,Fe=w.showBorderTop,qe=void 0===Fe||Fe,Qe=w.sectionStatusConfig,Ze=w.showCompletionPanel,Je=void 0!==Ze&&Ze,Ke=w.showAddSectionButton,Xe=void 0!==Ke&&Ke,Ye=w.approveButtonConfig,$e=null!=Qe?Qe:{},et=$e.isLoadingSectionData,tt=void 0!==et&&et,nt=$e.onLoadSectionData,ot=$e.status,lt=$e.onStatusClick,it=$e.completedCount,rt=$e.totalCount,at=$e.isNoDataAvailable,st=void 0!==at&&at,ut=z(),dt=ut.searchQueryList,ct=ut.citations,vt=ut.customStyles,pt=ut.customSectionConfig,mt=null==vt?void 0:vt.userStoryCardStyles,ht=null==mt?void 0:mt.statusStyles,ft=null===(E=null==vt?void 0:vt.userStoryCardStyles)||void 0===E?void 0:E.userStoryEditStyles,yt=null===(B=null==vt?void 0:vt.userStoryScreenStyles)||void 0===B?void 0:B.userStoryContentStyles,St=null==mt?void 0:mt.progressHeaderStyles,gt=null==mt?void 0:mt.clinicalTrialSectionStyles,Ct=null==mt?void 0:mt.CompletionStyles,It=null==mt?void 0:mt.noDataStyles,Nt=null==mt?void 0:mt.approveButtonStyles,bt=null!==(Z=null===(U=null==pt?void 0:pt.shouldRender)||void 0===U?void 0:U.call(pt,Se))&&void 0!==Z&&Z,wt=null===(ee=null==pt?void 0:pt.getValue)||void 0===ee?void 0:ee.call(pt,Se),Dt=null!==(ne=null===(te=null==pt?void 0:pt.getFields)||void 0===te?void 0:te.call(pt,Se))&&void 0!==ne?ne:[],Et=null!==(oe=null==pt?void 0:pt.isEditDisabled)&&void 0!==oe&&oe,Bt=null!==(ie=null===(le=null==pt?void 0:pt.isSaving)||void 0===le?void 0:le.call(pt,Se))&&void 0!==ie&&ie,xt=function(e,t){return e>=80?null==t?void 0:t.highCompletion:e>=50?null==t?void 0:t.mediumCompletion:null==t?void 0:t.lowCompletion}(null!==(re=Se.completion_percentage)&&void 0!==re?re:0,Ct),Tt=((D={})[O.WAITING]=null==ht?void 0:ht.waiting,D[O.IN_PROGRESS]=null==ht?void 0:ht.inProgress,D[O.GENERATED]=null==ht?void 0:ht.generated,D[O.FAILED]=null==ht?void 0:ht.failed,D[O.GENERATE]=null==ht?void 0:ht.generate,D[O.APPROVED]=null==ht?void 0:ht.approved,D),At=a(e(e({},structuredClone(Se)),{value:_(Se.value)||""})),Ut=At[0],Pt=At[1],kt=a({userStory:!!Se.isDefaultEdit}),Rt=kt[0],_t=kt[1],Lt=a(!1),Mt=Lt[0],jt=Lt[1],Vt=a(!1),Gt=Vt[0],Ot=Vt[1],zt=a(null),Ht=zt[0],Wt=zt[1],Ft=a(null),qt=Ft[0],Qt=Ft[1],Zt=z(),Jt=Zt.userStory,Kt=Zt.customIcons,Xt=a(null!=Re?Re:""===Ce||xe===Se.artifactId||!!Se.isDefaultOpen),Yt=Xt[0],$t=Xt[1],en=a(!1);en[0];var tn=en[1],nn=a(null),on=nn[0],ln=nn[1],rn=a(null),an=rn[0],sn=rn[1],un=a(!1),dn=un[0],cn=un[1],vn=s(null),pn=a(!1);pn[0];var mn=pn[1],hn=a(!1),fn=hn[0],yn=hn[1],Sn=s(null);u(function(){me&&$t(me)},[me]),u(function(){Pt(e(e({},structuredClone(Se)),{value:_(Se.value)||""}))},[Se]),u(function(){dt.length>0?$t(!0):void 0===Re&&(xe?$t(xe===Se.artifactId):je&&je.length>0&&$t(je.includes(Se.artifactId)))},[dt,xe,Se.artifactId,je]);var gn=function(){ln(null)},Cn=function(){sn(null)},In=function(){$t(function(e){return!e})};var Nn=null!=(null==Se?void 0:Se.big_enough)&&!Number.isNaN(Se.big_enough)&&!!(null==Se?void 0:Se.big_enough_decision_factors),bn=null!==(ae=null==Se?void 0:Se.completion_percentage)&&void 0!==ae?ae:0,wn=!!(null==Se?void 0:Se.completion_decision_factors),Dn=""===Ce,En=null!=Ue?Ue:X(Ae,Dn),Bn=!be&&!we;return u(function(){if(qt){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(qt));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[qt]),u(function(){Se.isDefaultEdit&&_t(function(t){return e(e({},t),{userStory:!0})})},[Se.isDefaultEdit]),l("div",e({className:R.card,style:null==mt?void 0:mt.cardStyle,id:"story-card-".concat(Se.title),"data-expanded":Yt},{children:[l("div",e({className:R.titleSection,style:null==mt?void 0:mt.titleSection},{children:[l("div",e({className:R.titleRow,style:null==mt?void 0:mt.titleRow,onClick:In},{children:[l("div",e({className:R.titleLeft,style:null==mt?void 0:mt.titleLeft,onMouseEnter:function(){return mn(!0)},onMouseLeave:function(){return mn(!1)}},{children:[Ge&&i(Y,{displayName:fe}),Mt&&Bn?i(W,{title:Se.title,onSave:function(o){return function(o,l){return t(void 0,void 0,void 0,function(){var t,i;return n(this,function(n){try{t=e({},Se),Se.artifactId===l?t.title=o:t.sub_features=(null===(i=Se.sub_features)||void 0===i?void 0:i.map(function(t){return t.artifactId===l?e(e({},t),{title:o}):t}))||[],Pt(t),ge(t),jt(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(o,Se.artifactId)},onCancel:function(){jt(!1)},inputStyle:null==ft?void 0:ft.inlineTitleInput,confirmButtonStyle:null==ft?void 0:ft.inlineTitleConfirm,cancelButtonStyle:null==ft?void 0:ft.inlineTitleCancel},"inline-title-editor"):l("div",e({className:R.storyTitleWrapper},{children:[i("h2",e({title:Se.title,className:R.storyTitle,style:null==mt?void 0:mt.storyTitle},{children:K(Se.title)}),Se.artifactId),Je&&!bt&&(wn?i(q,e({customIcons:null==Kt?void 0:Kt.userStoryIcons,customStyles:null==mt?void 0:mt.aiReasoningCitaionStyles,currentUserStory:Se,panelStyles:null==mt?void 0:mt.CompletionStyles,onToggleStateChange:yn},{children:l("div",e({style:e(e({display:"inline-flex",alignItems:"center",gap:"4px"},null==Ct?void 0:Ct.badge),xt)},{children:[l("span",{children:[bn,"% Completed"]}),i("span",e({style:{display:"flex",alignItems:"center"}},{children:i(Q,{color:"currentColor"})})),i(fn?d:c,{size:14,style:null==Ct?void 0:Ct.chevronStyle})]}))})):i("div",e({style:e(e({display:"inline-flex",alignItems:"center",gap:"4px"},null==Ct?void 0:Ct.badge),xt)},{children:l("span",{children:[bn,"% Completed"]})}))),ze&&i("button",e({type:"button",className:R.titleEditButton,style:null==ft?void 0:ft.titleEditButton,onClick:function(e){e.stopPropagation(),jt(!0),Yt||$t(!0)},"aria-label":"Edit title",title:"Edit title"},{children:i("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("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"})}))}))]}))]})),(ot||void 0!==it&&void 0!==rt)&&l("div",e({className:R.statusContainer},{children:[void 0!==it&&void 0!==rt&&l("div",e({className:R.completedBadge},{children:["Completed: ",it,"/",rt]})),ot&&i("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==lt||lt()},className:R.statusButton,style:Tt[ot]},{children:J[ot]}))]})),l("div",e({className:R.titleActions,style:null==mt?void 0:mt.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(En.showProgressPercentage||En.showGapBox)&&ke&&l("div",e({className:R.progressHeader,style:null==St?void 0:St.wrapper},{children:[En.showProgressPercentage&&l("div",e({className:R.progressPercentage,style:null==St?void 0:St.percentage},{children:[null!==(ue=null!==(se=null==Se?void 0:Se.confidenceScore)&&void 0!==se?se:null==En?void 0:En.confidenceValue)&&void 0!==ue?ue:"0","%"]})),En.showGapBox&&l("div",e({className:R.gapBox,style:null==St?void 0:St.gapBox},{children:[null!==(ce=null!==(de=null==Se?void 0:Se.gapValue)&&void 0!==de?de:null==En?void 0:En.gapBoxValue)&&void 0!==ce?ce:"2"," ","Gaps"]}))]})),Nn&&i(H,{customIcons:null==Kt?void 0:Kt.userStoryIcons,customStyles:null==mt?void 0:mt.aiReasoningCitaionStyles,currentUserStory:Se,panelStyles:null==mt?void 0:mt.BigEnoughStyles}),!Rt.userStory&&l(r,{children:[!1!==(null==En?void 0:En.showShareButton)&&i("button",e({className:R.iconButton,style:null==mt?void 0:mt.iconButton,onClick:function(e){ln(e.currentTarget)}},{children:i(v,{size:16})})),l(T,e({id:"user-story-share-menu",anchorEl:on,open:!!on,onClose:function(){return ln(null)},style:null==mt?void 0:mt.userStoryShareMenu},{children:[Ne&&i(A,e({style:null==mt?void 0:mt.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return tn(!0),De?[4,Promise.all([De("pdf"),De("doc")])]:[2];case 1:return e.sent(),tn(!1),[2]}})})}},{children:l("div",e({ref:vn,className:R.menuItemContent,style:null==mt?void 0:mt.menuItemContent},{children:[i(p,{size:16,color:null==mt?void 0:mt.menuIconColor}),i("p",e({style:null==mt?void 0:mt.menuLabel},{children:"Download"}))]}))})),i(A,e({style:null==mt?void 0:mt.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){return t=Se,ye&&(t=e(e({},Se),{value:"".concat(M(null==ye?void 0:ye.value,Se.title)," \n").concat(Se.value)})),null==Ee||Ee(!0,[t],Se.artifactId),gn(),[2]})})}},{children:l("div",e({style:null==mt?void 0:mt.menuItemContent,className:R.menuItemContentPadded},{children:[i(m,{size:16,color:null==mt?void 0:mt.menuIconColor}),i("p",e({style:null==mt?void 0:mt.menuLabel},{children:"Send"}))]}))})),i(A,e({style:null==mt?void 0:mt.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var e,t,o,l,i;return n(this,function(n){switch(n.label){case 0:e=new x.Converter,t=e.makeHtml(_(Se.value)||Se.value),o=function(e){var t=(new x.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(_(Se.value)||Se.value),l=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,navigator.clipboard.write([l])];case 2:return n.sent(),console.log("Copied User Story"),[3,5];case 3:return i=n.sent(),console.error("Failed to copy user story:",i),[3,5];case 4:return gn(),[7];case 5:return[2]}})})}},{children:l("div",e({style:null==mt?void 0:mt.menuItemContent,className:R.menuItemContentPadded},{children:[i(h,{size:16,color:null==mt?void 0:mt.menuIconColor}),i("p",e({style:null==mt?void 0:mt.menuLabel},{children:"Copy"}))]}))}))]}))]}),Rt.userStory&&Yt?i(j,{type:"outline",children:"Cancel",style:null==mt?void 0:mt.cancelButton,onClick:function(){var t;null===(t=Sn.current)||void 0===t||t.abort(),_t(function(t){return e(e({},t),{userStory:!1})})}}):i(r,{}),Rt.userStory&&Yt?i(j,{type:"fill",children:dn?l("span",e({className:R.savingSpinner,style:null==mt?void 0:mt.savingSpinner},{children:[i(f,{className:R.spinAnimation,style:null==mt?void 0:mt.spinAnimation}),i("span",{children:"Saving..."})]})):"Save",isDisable:dn,style:dn?null==mt?void 0:mt.savingButton:null==mt?void 0:mt.saveButton,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return cn(!0),"userStory"==="userStory"&&(ge(Ut),console.log("I am changing RTE editor values",Ut)),[4,Be(ct,Jt,he,null===(t=Sn.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),ge(e(e({},Ut),{isDefaultEdit:!1})),_t(function(t){return e(e({},t),{userStory:!1})}),cn(!1),[2]}})})}}):!be&&!we&&Yt&&!1!==(null==En?void 0:En.showEditButton)&&i("button",e({className:R.iconButton,style:null==mt?void 0:mt.editButton,onClick:function(){return _t(function(t){return e(e({},t),{userStory:!0})})}},{children:i(y,{color:null==mt?void 0:mt.pencilIconColor,size:16})})),Xe&&Dn&&Yt&&!be&&!we&&!1!==(null==En?void 0:En.showEditButton)&&l("button",e({type:"button",className:R.addSectionButton,style:null==ft?void 0:ft.addSectionButton,onClick:function(t){var n,l,i;t.stopPropagation();var r=(null!==(l=null===(n=Se.sub_features)||void 0===n?void 0:n.length)&&void 0!==l?l:0)+1,a={artifactId:k(),title:"New Section ".concat(r),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},s=e(e({},Se),{sub_features:o(o([],null!==(i=Se.sub_features)&&void 0!==i?i:[],!0),[a],!1)});Pt(s),ge(s),$t(!0),Qt(a.title)},"aria-label":"Add section",title:"Add section"},{children:[i(S,{size:14}),i("span",e({className:R.addSectionLabel},{children:"Add Section"}))]})),!Dn&&!be&&!we&&i("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==Le||Le()},className:R.iconButton,style:null==ft?void 0:ft.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:i(g,{size:16})})),bt&&i("button",e({type:"button",className:R.iconButton,disabled:Et,onClick:function(e){if(e.stopPropagation(),Gt)return Wt(null),void Ot(!1);Wt(structuredClone(null!=wt?wt:{})),$t(!0),Ot(!0)}},{children:i(Gt?C:y,{size:16,color:null==mt?void 0:mt.pencilIconColor})})),(null==En?void 0:En.actionItemsButton)&&l(r,{children:[i("span",e({className:R.actionItemBtn,style:null==mt?void 0:mt.actionItemBtn,onClick:function(e){e.stopPropagation(),sn(e.currentTarget)}},{children:i(I,{})})),i(T,e({id:"user-story-action-menu",anchorEl:an,open:!!an,onClose:Cn,style:null==mt?void 0:mt.userStoryShareMenu},{children:null==_e?void 0:_e.items.map(function(t,n){return i(A,e({style:null==mt?void 0:mt.userStoryMenuItem,onClick:function(){t.onclick(Se),Cn()}},{children:l("div",e({className:R.menuItemContent,style:e(e({},null==mt?void 0:mt.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[i("span",e({className:R.menuItemIcon,style:null==mt?void 0:mt.menuItemIcon},{children:t.icon})),i("p",e({style:null==mt?void 0:mt.menuLabel},{children:t.name})),i("span",{className:R.menuItemRight,style:null==mt?void 0:mt.menuItemRight})]}))}),"action-item-".concat(n,"-").concat(t.name))})}))]}),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),In()},style:null==mt?void 0:mt.chevronButton,className:R.chevronButton},{children:i(Yt?d:c,{className:R.chevronIcon,color:null==mt?void 0:mt.chevronIconColor})}))]}))]})),i("div",{className:R.divider,style:null==mt?void 0:mt.dividerStyle})]})),Yt&&i("div",e({className:R.cardContent,style:e(e({},null==mt?void 0:mt.cardContentStyle),{borderTop:qe?"1px solid #E5E5E5":"none"})},{children:l("div",tt?e({className:R.loadingContainer},{children:[i("div",e({className:R.loadingIconWrapper},{children:i(N,{size:28,color:"#5B3DF5",className:R.spinAnimation})})),l("div",{children:[i("h3",e({className:R.loadingTitle},{children:"Section generation in progress.."})),i("p",e({className:R.loadingSubtitle},{children:"This may take a few minutes"}))]}),i("button",e({type:"button",onClick:function(){return null==nt?void 0:nt()},className:R.viewStatusButton},{children:"View Status"}))]}):st?e({className:R.noDataContainer,style:null==It?void 0:It.container},{children:[i("img",{src:P,alt:"No data available",className:R.noDataIllustration,style:null==It?void 0:It.illustration}),i("h3",e({className:R.noDataTitle,style:null==It?void 0:It.title},{children:"No Data Available for This Section"})),i("p",e({className:R.noDataSubtitle,style:null==It?void 0:It.subtitle},{children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."}))]}):e({className:R.contentInner,style:null==mt?void 0:mt.contentInner},{children:[l("div",e({className:R.descriptionSection,style:null==mt?void 0:mt.descriptionSection},{children:[i("div",{className:R.justifyBetween,style:null==mt?void 0:mt.justifyBetween}),Rt.userStory?i(V,{minHeight:"100%",height:"100%",type:"string",value:_(Se.value)||"",handleUpdateState:function(t,n){var o=L(n);Pt(function(t){return e(e({},t),{value:o||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:Rt.userStory?"edit":"readOnly"}):bt?i(F,{styles:gt,fields:Dt,readonly:!Gt,isSaving:Bt,value:null!==(ve=null!=Ht?Ht:wt)&&void 0!==ve?ve:{},onChange:Wt,onSave:function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return Ht?[4,null===(e=null==pt?void 0:pt.onSave)||void 0===e?void 0:e.call(pt,Se,Ht)]:[2];case 1:return t.sent(),Wt(null),Ot(!1),[2]}})})},onCancel:function(){Wt(null),Ot(!1)}}):l(r,{children:[i(G,{showUserStoryDiff:we,isParent:""===Ce,message:_(Se.value)||"",artifactId:Se.artifactId,customStyles:yt,isDisplayHighlightControl:Te,contextVariant:Me,showConfidenceScore:We}),Ye&&i("div",e({className:R.approveButtonContainer,style:null==Nt?void 0:Nt.container},{children:i("button",e({type:"button",className:R.approveButton,style:null==Nt?void 0:Nt.button,disabled:Ye.disabled||Ye.isLoading,onClick:function(e){var t;e.stopPropagation(),null===(t=null==Ye?void 0:Ye.onClick)||void 0===t||t.call(Ye)}},{children:Ye.isLoading?l(r,{children:[i(f,{size:16,className:R.spinner,style:null==Nt?void 0:Nt.icon}),i("span",e({style:null==Nt?void 0:Nt.text},{children:Ye.label}))]}):l(r,{children:[i("span",e({style:null==Nt?void 0:Nt.text},{children:Ye.label})),i(b,{size:16,style:null==Nt?void 0:Nt.icon})]})}))}))]})]})),null===(pe=Ut.sub_features)||void 0===pe?void 0:pe.map(function(t,n){var l=X(Ae,!1,t.artifactId);return i($,{artifactId:he,isUserStoryCurrentlyUpdated:me,artifactTitleId:"".concat(fe,"-").concat(String.fromCharCode(65+n)),parentUserStory:Se,parentIndex:"".concat(Ce).concat(Ce&&".").concat(Ie),currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(t){return function(t,n){var l=o([],Se.sub_features||[],!0);l[t]=n,ge(e(e({},Se),{sub_features:l}))}(n,t)},enableDownload:!0,isDiffEditReviewMode:be,showUserStoryDiff:we,updateUserStoryArtifact:Be,handleDownloadUserStory:De,handleOpenSendDialog:Ee,isDisplayHighlightControl:Te,elementDisplayConfig:Ae,_resolvedConfig:l,actionItemsConfig:_e,onDelete:function(){return function(t){var n=(Se.sub_features||[]).filter(function(e,n){return n!==t}),o=e(e({},Se),{sub_features:n});Pt(o),ge(o)}(n)},expandedSubFeatures:je},t.artifactId)})]}))}))]}))},ee=function(t){var n=t.artifactTitleIDs,a=t.expandedSubFeatures,s=t.isDiffEditReviewMode,u=t.showUserStoryDiff,d=t.updateUserStoryArtifact,c=t.isUserStoryCurrentlyUpdated,v=t.artifactId,p=t.handleOpenSendDialog,m=t.handleDownloadUserStory,h=t.selectedArtifactId,f=t.isDisplayHighlightControl,y=t.elementDisplayConfig,S=t.showWrapper,g=t.actionItemsConfig,C=t.contextVariant,I=t.showDisplayName,N=t.allowTitleEdit,b=t.showConfidenceScore,E=t.showBorderTop,B=t.defaultExpanded,x=t.showCompletionPanel,T=void 0!==x&&x,A=t.showAddSectionButton,U=void 0!==A&&A,P=t.approveButtonConfig,k=z(),_=k.userStory,L=k.setUserStory,M=k.customStyles,j=k.searchQueryList,V=k.currentHighlightIndex,G=k.setCurrentHighlightIndex;k.segmentComponentConfig;var O=k.sectionStatusConfig,H=null==M?void 0:M.userStoryCardStyles,W=0===V,F=V===j.length-1;return l("div",e({className:R.userStoryCardWrapper,style:f?e(e({},null==H?void 0:H.userStoryCardWrapper),{position:"relative"}):null==H?void 0:H.userStoryCardWrapper},{children:[f&&i(r,{children:j.length>0&&i("div",e({className:R.wrapper},{children:i("div",e({className:R.highlightNavigation},{children:l("div",e({className:R.navigationContainer},{children:[l("span",e({className:R.navCounter},{children:[V+1," of ",j.length]})),l("div",e({className:R.navButtons},{children:[i("button",e({onClick:function(){V>0&&G(function(e){return e-1})},className:R.navButton,disabled:W},{children:i(w,{size:20,className:R.navIcon})})),i("button",e({onClick:function(){V<j.length-1&&G(function(e){return e+1})},className:R.navButton,disabled:F},{children:i(D,{size:20,className:R.navIcon})}))]}))]}))}))}))}),_.map(function(e,t){var l=X(y,!0);return i($,{isUserStoryCurrentlyUpdated:c,artifactId:v,artifactTitleId:n[t]||"",expandedSubFeatures:a,currentUserStory:e,onUserStoryChange:function(e){L(function(n){return n[t]=e,o([],n,!0)})},parentIndex:"",currentIndex:"".concat(t+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:s,showUserStoryDiff:u,updateUserStoryArtifact:d,handleOpenSendDialog:p,handleDownloadUserStory:m,selectedArtifactId:h,isDisplayHighlightControl:f,elementDisplayConfig:y,_resolvedConfig:l,showWrapper:S,defaultExpanded:B,actionItemsConfig:g,contextVariant:C,showDisplayName:I,allowTitleEdit:N,showConfidenceScore:b,showBorderTop:E,sectionStatusConfig:O,showCompletionPanel:T,showAddSectionButton:U,approveButtonConfig:P},e.artifactId)})]}))};export{$ as StoryCard,ee as UserStoryCardWrapper,$ as default,K as replaceLearnedTagsWithInfo};
1
+ import{__assign as e,__awaiter as t,__generator as n,__spreadArray as o}from"tslib";import{jsxs as l,jsx as i,Fragment as r}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as d}from"react";import{ChevronUp as u,ChevronDown as c,ExternalLink as v,Download as p,Share2 as m,Copy as h,LoaderCircle as f,PencilIcon as y,Plus as S,Trash2 as g,X as C,Ellipsis as I,Hourglass as N,Check as b,ChevronUpIcon as w,ChevronDownIcon as E,Info as D,Bookmark as B}from"lucide-react";import x from"showdown";import{Tooltip as T,Menu as A,MenuItem as P}from"@mui/material";import U from"../../icons/Illustration.svg.js";import{v4 as k}from"uuid";import R from"./UserStoryCard.module.css.js";import{formatMarkdown as _,indentMarkdown as M}from"../../utils/helpers.js";import{replaceTitleSection as L}from"../../utils/user-story.utils.js";import j from"../../shared/AtomicButton.js";import V from"../RichTextEditor/RichTextEditor.js";import G from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as O,useRequirementAI as z}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as H}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as W}from"./TitleEditor/TitleEditor.js";import F from"./ClinicalTrialSection.js";import{CompletionPanel as q}from"../story-screen/CompletionPanel.js";import Q from"../../icons/CDIcon.js";var Z,J=((Z={})[O.WAITING]="WAITING TO GENERATE",Z[O.IN_PROGRESS]="IN PROGRESS",Z[O.GENERATED]="GENERATED",Z[O.FAILED]="FAILED",Z[O.GENERATE]="GENERATE",Z[O.APPROVED]="APPROVED",Z);function K(t){for(var n,o=[],l=/<learned>(.*?)<\/learned>/g,r=0,a=0;null!==(n=l.exec(t));){var s=n[1],d=n.index;d>r&&o.push(i("span",{children:t.slice(r,d)},"text-pre-".concat(a++))),o.push(i(T,e({title:s,placement:"top"},{children:i(D,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(k()))),r=l.lastIndex}return r<(null==t?void 0:t.length)&&o.push(i("span",{children:t.slice(r)},"text-post-".concat(a++))),o}function X(t,n,o){var l;if(!t)return{};if(n)return e({},t.parentConfig);var i=e({},t.childConfig);return o&&(null===(l=t.subFeatureOverrides)||void 0===l?void 0:l[o])?e(e({},i),t.subFeatureOverrides[o]):i}var Y=function(t){var n,o=t.displayName,r=z().customStyles,a=null===(n=null==r?void 0:r.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return l("div",e({className:R.displayName,style:null==a?void 0:a.wrapper},{children:[i(B,{className:R.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),l("span",e({style:null==a?void 0:a.label},{children:[o,":"]}))]}))},$=function(w){var E,D,B,Z,ee,te,ne,oe,le,ie,re,ae,se,de,ue,ce,ve,pe,me,he=w.isUserStoryCurrentlyUpdated,fe=w.artifactId,ye=w.artifactTitleId,Se=w.parentUserStory,ge=w.currentUserStory,Ce=w.onUserStoryChange,Ie=w.parentIndex,Ne=w.currentIndex,be=w.enableDownload,we=w.isDiffEditReviewMode,Ee=w.showUserStoryDiff,De=w.handleDownloadUserStory,Be=w.handleOpenSendDialog,xe=w.updateUserStoryArtifact,Te=w.selectedArtifactId,Ae=w.isDisplayHighlightControl,Pe=w.elementDisplayConfig,Ue=w._resolvedConfig,ke=w.showWrapper,Re=void 0!==ke&&ke,_e=w.defaultExpanded,Me=w.actionItemsConfig,Le=w.onDelete,je=w.contextVariant,Ve=w.expandedSubFeatures,Ge=w.showDisplayName,Oe=void 0===Ge||Ge,ze=w.allowTitleEdit,He=void 0===ze||ze,We=w.showConfidenceScore,Fe=void 0===We||We,qe=w.showBorderTop,Qe=void 0===qe||qe,Ze=w.sectionStatusConfig,Je=w.showCompletionPanel,Ke=void 0!==Je&&Je,Xe=w.showAddSectionButton,Ye=void 0!==Xe&&Xe,$e=w.disableEditPlan,et=void 0!==$e&&$e,tt=w.useMuiTooltip,nt=void 0!==tt&&tt,ot=w.approveButtonConfig,lt=null!=Ze?Ze:{},it=lt.isLoadingSectionData,rt=void 0!==it&&it,at=lt.onLoadSectionData,st=lt.status,dt=lt.onStatusClick,ut=lt.completedCount,ct=lt.totalCount,vt=lt.isNoDataAvailable,pt=void 0!==vt&&vt,mt=z(),ht=mt.searchQueryList,ft=mt.citations,yt=mt.customStyles,St=mt.customSectionConfig,gt=null==yt?void 0:yt.userStoryCardStyles,Ct=null==gt?void 0:gt.statusStyles,It=null===(D=null==yt?void 0:yt.userStoryCardStyles)||void 0===D?void 0:D.userStoryEditStyles,Nt=null===(B=null==yt?void 0:yt.userStoryScreenStyles)||void 0===B?void 0:B.userStoryContentStyles,bt=null==gt?void 0:gt.progressHeaderStyles,wt=null==gt?void 0:gt.clinicalTrialSectionStyles,Et=null==gt?void 0:gt.CompletionStyles,Dt=null==gt?void 0:gt.noDataStyles,Bt=null==gt?void 0:gt.approveButtonStyles,xt=null!==(ee=null===(Z=null==St?void 0:St.shouldRender)||void 0===Z?void 0:Z.call(St,ge))&&void 0!==ee&&ee,Tt=null===(te=null==St?void 0:St.getValue)||void 0===te?void 0:te.call(St,ge),At=null!==(oe=null===(ne=null==St?void 0:St.getFields)||void 0===ne?void 0:ne.call(St,ge))&&void 0!==oe?oe:[],Pt=null!==(le=null==St?void 0:St.isEditDisabled)&&void 0!==le&&le,Ut=null!==(re=null===(ie=null==St?void 0:St.isSaving)||void 0===ie?void 0:ie.call(St,ge))&&void 0!==re&&re,kt=function(e,t){return e>=80?null==t?void 0:t.highCompletion:e>=50?null==t?void 0:t.mediumCompletion:null==t?void 0:t.lowCompletion}(null!==(ae=ge.completion_percentage)&&void 0!==ae?ae:0,Et),Rt=((E={})[O.WAITING]=null==Ct?void 0:Ct.waiting,E[O.IN_PROGRESS]=null==Ct?void 0:Ct.inProgress,E[O.GENERATED]=null==Ct?void 0:Ct.generated,E[O.FAILED]=null==Ct?void 0:Ct.failed,E[O.GENERATE]=null==Ct?void 0:Ct.generate,E[O.APPROVED]=null==Ct?void 0:Ct.approved,E),_t=a(e(e({},structuredClone(ge)),{value:_(ge.value)||""})),Mt=_t[0],Lt=_t[1],jt=a({userStory:!!ge.isDefaultEdit}),Vt=jt[0],Gt=jt[1],Ot=a(!1),zt=Ot[0],Ht=Ot[1],Wt=a(!1),Ft=Wt[0],qt=Wt[1],Qt=a(null),Zt=Qt[0],Jt=Qt[1],Kt=a(null),Xt=Kt[0],Yt=Kt[1],$t=z(),en=$t.userStory,tn=$t.customIcons,nn=a(null!=_e?_e:""===Ie||Te===ge.artifactId||!!ge.isDefaultOpen),on=nn[0],ln=nn[1],rn=a(!1);rn[0];var an=rn[1],sn=a(null),dn=sn[0],un=sn[1],cn=a(null),vn=cn[0],pn=cn[1],mn=a(!1),hn=mn[0],fn=mn[1],yn=s(null),Sn=a(!1);Sn[0];var gn=Sn[1],Cn=a(!1),In=Cn[0],Nn=Cn[1],bn=s(null);d(function(){he&&ln(he)},[he]),d(function(){Lt(e(e({},structuredClone(ge)),{value:_(ge.value)||""}))},[ge]),d(function(){ht.length>0?ln(!0):void 0===_e&&(Te?ln(Te===ge.artifactId):Ve&&Ve.length>0&&ln(Ve.includes(ge.artifactId)))},[ht,Te,ge.artifactId,Ve]);var wn=function(){un(null)},En=function(){pn(null)},Dn=function(){ln(function(e){return!e})};var Bn=null!=(null==ge?void 0:ge.big_enough)&&!Number.isNaN(ge.big_enough)&&!!(null==ge?void 0:ge.big_enough_decision_factors),xn=null!==(se=null==ge?void 0:ge.completion_percentage)&&void 0!==se?se:0,Tn=!!(null==ge?void 0:ge.completion_decision_factors),An=""===Ie,Pn=null!=Ue?Ue:X(Pe,An),Un=!we&&!Ee;return d(function(){if(Xt){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(Xt));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[Xt]),d(function(){ge.isDefaultEdit&&Gt(function(t){return e(e({},t),{userStory:!0})})},[ge.isDefaultEdit]),l("div",e({className:R.card,style:null==gt?void 0:gt.cardStyle,id:"story-card-".concat(ge.title),"data-expanded":on},{children:[l("div",e({className:R.titleSection,style:null==gt?void 0:gt.titleSection},{children:[l("div",e({className:R.titleRow,style:null==gt?void 0:gt.titleRow,onClick:Dn},{children:[l("div",e({className:R.titleLeft,style:null==gt?void 0:gt.titleLeft,onMouseEnter:function(){return gn(!0)},onMouseLeave:function(){return gn(!1)}},{children:[Oe&&i(Y,{displayName:ye}),zt&&Un?i(W,{title:ge.title,onSave:function(o){return function(o,l){return t(void 0,void 0,void 0,function(){var t,i;return n(this,function(n){try{t=e({},ge),ge.artifactId===l?t.title=o:t.sub_features=(null===(i=ge.sub_features)||void 0===i?void 0:i.map(function(t){return t.artifactId===l?e(e({},t),{title:o}):t}))||[],Lt(t),Ce(t),Ht(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(o,ge.artifactId)},onCancel:function(){Ht(!1)},inputStyle:null==It?void 0:It.inlineTitleInput,confirmButtonStyle:null==It?void 0:It.inlineTitleConfirm,cancelButtonStyle:null==It?void 0:It.inlineTitleCancel},"inline-title-editor"):l("div",e({className:R.storyTitleWrapper},{children:[i(T,e({title:K(ge.title),arrow:!0},{children:i("h2",e({title:nt?void 0:ge.title,className:R.storyTitle,style:null==gt?void 0:gt.storyTitle},{children:K(ge.title)}),ge.artifactId)})),Ke&&!xt&&(Tn?i(q,e({customIcons:null==tn?void 0:tn.userStoryIcons,customStyles:null==gt?void 0:gt.aiReasoningCitaionStyles,currentUserStory:ge,panelStyles:null==gt?void 0:gt.CompletionStyles,onToggleStateChange:Nn},{children:l("div",e({style:e(e({display:"inline-flex",alignItems:"center",gap:"4px"},null==Et?void 0:Et.badge),kt)},{children:[l("span",{children:[xn,"% Completed"]}),i("span",e({style:{display:"flex",alignItems:"center"}},{children:i(Q,{color:"currentColor"})})),i(In?u:c,{size:14,style:null==Et?void 0:Et.chevronStyle})]}))})):i("div",e({style:e(e({display:"inline-flex",alignItems:"center",gap:"4px"},null==Et?void 0:Et.badge),kt)},{children:l("span",{children:[xn,"% Completed"]})}))),He&&i("button",e({type:"button",className:R.titleEditButton,style:null==It?void 0:It.titleEditButton,onClick:function(e){e.stopPropagation(),Ht(!0),on||ln(!0)},"aria-label":"Edit title",title:"Edit title"},{children:i("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("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"})}))}))]}))]})),(st||void 0!==ut&&void 0!==ct)&&l("div",e({className:R.statusContainer},{children:[void 0!==ut&&void 0!==ct&&l("div",e({className:R.completedBadge},{children:["Completed: ",ut,"/",ct]})),st&&i("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==dt||dt()},className:R.statusButton,style:Rt[st]},{children:J[st]}))]})),l("div",e({className:R.titleActions,style:null==gt?void 0:gt.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(Pn.showProgressPercentage||Pn.showGapBox)&&Re&&l("div",e({className:R.progressHeader,style:null==bt?void 0:bt.wrapper},{children:[Pn.showProgressPercentage&&l("div",e({className:R.progressPercentage,style:null==bt?void 0:bt.percentage},{children:[null!==(ue=null!==(de=null==ge?void 0:ge.confidenceScore)&&void 0!==de?de:null==Pn?void 0:Pn.confidenceValue)&&void 0!==ue?ue:"0","%"]})),Pn.showGapBox&&l("div",e({className:R.gapBox,style:null==bt?void 0:bt.gapBox},{children:[null!==(ve=null!==(ce=null==ge?void 0:ge.gapValue)&&void 0!==ce?ce:null==Pn?void 0:Pn.gapBoxValue)&&void 0!==ve?ve:"2"," ","Gaps"]}))]})),Bn&&i(H,{customIcons:null==tn?void 0:tn.userStoryIcons,customStyles:null==gt?void 0:gt.aiReasoningCitaionStyles,currentUserStory:ge,panelStyles:null==gt?void 0:gt.BigEnoughStyles}),!Vt.userStory&&l(r,{children:[!1!==(null==Pn?void 0:Pn.showShareButton)&&i("button",e({className:R.iconButton,style:null==gt?void 0:gt.iconButton,onClick:function(e){un(e.currentTarget)}},{children:i(v,{size:16})})),l(A,e({id:"user-story-share-menu",anchorEl:dn,open:!!dn,onClose:function(){return un(null)},style:null==gt?void 0:gt.userStoryShareMenu},{children:[be&&i(P,e({style:null==gt?void 0:gt.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return an(!0),De?[4,Promise.all([De("pdf"),De("doc")])]:[2];case 1:return e.sent(),an(!1),[2]}})})}},{children:l("div",e({ref:yn,className:R.menuItemContent,style:null==gt?void 0:gt.menuItemContent},{children:[i(p,{size:16,color:null==gt?void 0:gt.menuIconColor}),i("p",e({style:null==gt?void 0:gt.menuLabel},{children:"Download"}))]}))})),i(P,e({style:null==gt?void 0:gt.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){return t=ge,Se&&(t=e(e({},ge),{value:"".concat(L(null==Se?void 0:Se.value,ge.title)," \n").concat(ge.value)})),null==Be||Be(!0,[t],ge.artifactId),wn(),[2]})})}},{children:l("div",e({style:null==gt?void 0:gt.menuItemContent,className:R.menuItemContentPadded},{children:[i(m,{size:16,color:null==gt?void 0:gt.menuIconColor}),i("p",e({style:null==gt?void 0:gt.menuLabel},{children:"Send"}))]}))})),i(P,e({style:null==gt?void 0:gt.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var e,t,o,l,i;return n(this,function(n){switch(n.label){case 0:e=new x.Converter,t=e.makeHtml(_(ge.value)||ge.value),o=function(e){var t=(new x.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(_(ge.value)||ge.value),l=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,navigator.clipboard.write([l])];case 2:return n.sent(),console.log("Copied User Story"),[3,5];case 3:return i=n.sent(),console.error("Failed to copy user story:",i),[3,5];case 4:return wn(),[7];case 5:return[2]}})})}},{children:l("div",e({style:null==gt?void 0:gt.menuItemContent,className:R.menuItemContentPadded},{children:[i(h,{size:16,color:null==gt?void 0:gt.menuIconColor}),i("p",e({style:null==gt?void 0:gt.menuLabel},{children:"Copy"}))]}))}))]}))]}),Vt.userStory&&on?i(j,{type:"outline",children:"Cancel",style:null==gt?void 0:gt.cancelButton,onClick:function(){var t;null===(t=bn.current)||void 0===t||t.abort(),Gt(function(t){return e(e({},t),{userStory:!1})})}}):i(r,{}),Vt.userStory&&on?i(j,{type:"fill",children:hn?l("span",e({className:R.savingSpinner,style:null==gt?void 0:gt.savingSpinner},{children:[i(f,{className:R.spinAnimation,style:null==gt?void 0:gt.spinAnimation}),i("span",{children:"Saving..."})]})):"Save",isDisable:hn,style:hn?null==gt?void 0:gt.savingButton:null==gt?void 0:gt.saveButton,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return fn(!0),"userStory"==="userStory"&&(Ce(Mt),console.log("I am changing RTE editor values",Mt)),[4,xe(ft,en,fe,null===(t=bn.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),Ce(e(e({},Mt),{isDefaultEdit:!1})),Gt(function(t){return e(e({},t),{userStory:!1})}),fn(!1),[2]}})})}}):!we&&!Ee&&!et&&on&&!1!==(null==Pn?void 0:Pn.showEditButton)&&i("button",e({className:R.iconButton,style:null==gt?void 0:gt.editButton,onClick:function(){return Gt(function(t){return e(e({},t),{userStory:!0})})}},{children:i(y,{color:null==gt?void 0:gt.pencilIconColor,size:16})})),Ye&&An&&on&&!we&&!Ee&&!1!==(null==Pn?void 0:Pn.showEditButton)&&l("button",e({type:"button",className:R.addSectionButton,style:null==It?void 0:It.addSectionButton,onClick:function(t){var n,l,i;t.stopPropagation();var r=(null!==(l=null===(n=ge.sub_features)||void 0===n?void 0:n.length)&&void 0!==l?l:0)+1,a={artifactId:k(),title:"New Section ".concat(r),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},s=e(e({},ge),{sub_features:o(o([],null!==(i=ge.sub_features)&&void 0!==i?i:[],!0),[a],!1)});Lt(s),Ce(s),ln(!0),Yt(a.title)},"aria-label":"Add section",title:"Add section"},{children:[i(S,{size:14}),i("span",e({className:R.addSectionLabel},{children:"Add Section"}))]})),!An&&!we&&!et&&!Ee&&i("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==Le||Le()},className:R.iconButton,style:null==It?void 0:It.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:i(g,{size:16})})),xt&&i("button",e({type:"button",className:R.iconButton,disabled:Pt,onClick:function(e){if(e.stopPropagation(),Ft)return Jt(null),void qt(!1);Jt(structuredClone(null!=Tt?Tt:{})),ln(!0),qt(!0)}},{children:i(Ft?C:y,{size:16,color:null==gt?void 0:gt.pencilIconColor})})),(null==Pn?void 0:Pn.actionItemsButton)&&l(r,{children:[i("span",e({className:R.actionItemBtn,style:null==gt?void 0:gt.actionItemBtn,onClick:function(e){e.stopPropagation(),pn(e.currentTarget)}},{children:i(I,{})})),i(A,e({id:"user-story-action-menu",anchorEl:vn,open:!!vn,onClose:En,style:null==gt?void 0:gt.userStoryShareMenu},{children:null==Me?void 0:Me.items.map(function(t,n){return i(P,e({style:null==gt?void 0:gt.userStoryMenuItem,onClick:function(){t.onclick(ge),En()}},{children:l("div",e({className:R.menuItemContent,style:e(e({},null==gt?void 0:gt.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[i("span",e({className:R.menuItemIcon,style:null==gt?void 0:gt.menuItemIcon},{children:t.icon})),i("p",e({style:null==gt?void 0:gt.menuLabel},{children:t.name})),i("span",{className:R.menuItemRight,style:null==gt?void 0:gt.menuItemRight})]}))}),"action-item-".concat(n,"-").concat(t.name))})}))]}),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),Dn()},style:null==gt?void 0:gt.chevronButton,className:R.chevronButton},{children:i(on?u:c,{className:R.chevronIcon,color:null==gt?void 0:gt.chevronIconColor})}))]}))]})),i("div",{className:R.divider,style:null==gt?void 0:gt.dividerStyle})]})),on&&i("div",e({className:R.cardContent,style:e(e({},null==gt?void 0:gt.cardContentStyle),{borderTop:Qe?"1px solid #E5E5E5":"none"})},{children:l("div",rt?e({className:R.loadingContainer},{children:[i("div",e({className:R.loadingIconWrapper},{children:i(N,{size:28,color:"#5B3DF5",className:R.spinAnimation})})),l("div",{children:[i("h3",e({className:R.loadingTitle},{children:"Section generation in progress.."})),i("p",e({className:R.loadingSubtitle},{children:"This may take a few minutes"}))]}),i("button",e({type:"button",onClick:function(){return null==at?void 0:at()},className:R.viewStatusButton},{children:"View Status"}))]}):pt?e({className:R.noDataContainer,style:null==Dt?void 0:Dt.container},{children:[i("img",{src:U,alt:"No data available",className:R.noDataIllustration,style:null==Dt?void 0:Dt.illustration}),i("h3",e({className:R.noDataTitle,style:null==Dt?void 0:Dt.title},{children:"No Data Available for This Section"})),i("p",e({className:R.noDataSubtitle,style:null==Dt?void 0:Dt.subtitle},{children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."}))]}):e({className:R.contentInner,style:null==gt?void 0:gt.contentInner},{children:[l("div",e({className:R.descriptionSection,style:null==gt?void 0:gt.descriptionSection},{children:[i("div",{className:R.justifyBetween,style:null==gt?void 0:gt.justifyBetween}),Vt.userStory?i(V,{minHeight:"100%",height:"100%",type:"string",value:_(ge.value)||"",handleUpdateState:function(t,n){var o=M(n);Lt(function(t){return e(e({},t),{value:o||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:Vt.userStory?"edit":"readOnly"}):xt?i(F,{styles:wt,fields:At,readonly:!Ft,isSaving:Ut,value:null!==(pe=null!=Zt?Zt:Tt)&&void 0!==pe?pe:{},onChange:Jt,onSave:function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return Zt?[4,null===(e=null==St?void 0:St.onSave)||void 0===e?void 0:e.call(St,ge,Zt)]:[2];case 1:return t.sent(),Jt(null),qt(!1),[2]}})})},onCancel:function(){Jt(null),qt(!1)}}):l(r,{children:[i(G,{showUserStoryDiff:Ee,isParent:""===Ie,message:_(ge.value)||"",artifactId:ge.artifactId,customStyles:Nt,isDisplayHighlightControl:Ae,contextVariant:je,showConfidenceScore:Fe}),ot&&i("div",e({className:R.approveButtonContainer,style:null==Bt?void 0:Bt.container},{children:i("button",e({type:"button",className:R.approveButton,style:null==Bt?void 0:Bt.button,disabled:ot.disabled||ot.isLoading,onClick:function(e){var t;e.stopPropagation(),null===(t=null==ot?void 0:ot.onClick)||void 0===t||t.call(ot)}},{children:ot.isLoading?l(r,{children:[i(f,{size:16,className:R.spinner,style:null==Bt?void 0:Bt.icon}),i("span",e({style:null==Bt?void 0:Bt.text},{children:ot.label}))]}):l(r,{children:[i("span",e({style:null==Bt?void 0:Bt.text},{children:ot.label})),i(b,{size:16,style:null==Bt?void 0:Bt.icon})]})}))}))]})]})),null===(me=Mt.sub_features)||void 0===me?void 0:me.map(function(t,n){var l=X(Pe,!1,t.artifactId);return i($,{artifactId:fe,isUserStoryCurrentlyUpdated:he,artifactTitleId:"".concat(ye,"-").concat(String.fromCharCode(65+n)),parentUserStory:ge,parentIndex:"".concat(Ie).concat(Ie&&".").concat(Ne),currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(t){return function(t,n){var l=o([],ge.sub_features||[],!0);l[t]=n,Ce(e(e({},ge),{sub_features:l}))}(n,t)},enableDownload:!0,isDiffEditReviewMode:we,showUserStoryDiff:Ee,updateUserStoryArtifact:xe,handleDownloadUserStory:De,handleOpenSendDialog:Be,isDisplayHighlightControl:Ae,elementDisplayConfig:Pe,_resolvedConfig:l,actionItemsConfig:Me,onDelete:function(){return function(t){var n=(ge.sub_features||[]).filter(function(e,n){return n!==t}),o=e(e({},ge),{sub_features:n});Lt(o),Ce(o)}(n)},expandedSubFeatures:Ve,disableEditPlan:et,useMuiTooltip:nt},t.artifactId)})]}))}))]}))},ee=function(t){var n=t.artifactTitleIDs,a=t.expandedSubFeatures,s=t.isDiffEditReviewMode,d=t.showUserStoryDiff,u=t.updateUserStoryArtifact,c=t.isUserStoryCurrentlyUpdated,v=t.artifactId,p=t.handleOpenSendDialog,m=t.handleDownloadUserStory,h=t.selectedArtifactId,f=t.isDisplayHighlightControl,y=t.elementDisplayConfig,S=t.showWrapper,g=t.actionItemsConfig,C=t.contextVariant,I=t.showDisplayName,N=t.allowTitleEdit,b=t.showConfidenceScore,D=t.showBorderTop,B=t.defaultExpanded,x=t.showCompletionPanel,T=void 0!==x&&x,A=t.showAddSectionButton,P=void 0!==A&&A,U=t.disableEditPlan,k=void 0!==U&&U,_=t.useMuiTooltip,M=void 0!==_&&_,L=t.approveButtonConfig,j=z(),V=j.userStory,G=j.setUserStory,O=j.customStyles,H=j.searchQueryList,W=j.currentHighlightIndex,F=j.setCurrentHighlightIndex;j.segmentComponentConfig;var q=j.sectionStatusConfig,Q=null==O?void 0:O.userStoryCardStyles,Z=0===W,J=W===H.length-1;return l("div",e({className:R.userStoryCardWrapper,style:f?e(e({},null==Q?void 0:Q.userStoryCardWrapper),{position:"relative"}):null==Q?void 0:Q.userStoryCardWrapper},{children:[f&&i(r,{children:H.length>0&&i("div",e({className:R.wrapper},{children:i("div",e({className:R.highlightNavigation},{children:l("div",e({className:R.navigationContainer},{children:[l("span",e({className:R.navCounter},{children:[W+1," of ",H.length]})),l("div",e({className:R.navButtons},{children:[i("button",e({onClick:function(){W>0&&F(function(e){return e-1})},className:R.navButton,disabled:Z},{children:i(w,{size:20,className:R.navIcon})})),i("button",e({onClick:function(){W<H.length-1&&F(function(e){return e+1})},className:R.navButton,disabled:J},{children:i(E,{size:20,className:R.navIcon})}))]}))]}))}))}))}),V.map(function(e,t){var l=X(y,!0);return i($,{isUserStoryCurrentlyUpdated:c,artifactId:v,artifactTitleId:n[t]||"",expandedSubFeatures:a,currentUserStory:e,onUserStoryChange:function(e){G(function(n){return n[t]=e,o([],n,!0)})},parentIndex:"",currentIndex:"".concat(t+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:s,showUserStoryDiff:d,updateUserStoryArtifact:u,handleOpenSendDialog:p,handleDownloadUserStory:m,selectedArtifactId:h,isDisplayHighlightControl:f,elementDisplayConfig:y,_resolvedConfig:l,showWrapper:S,defaultExpanded:B,actionItemsConfig:g,contextVariant:C,showDisplayName:I,allowTitleEdit:N,showConfidenceScore:b,showBorderTop:D,sectionStatusConfig:q,showCompletionPanel:T,showAddSectionButton:P,disableEditPlan:k,useMuiTooltip:M,approveButtonConfig:L},e.artifactId)})]}))};export{$ as StoryCard,ee as UserStoryCardWrapper,$ as default,K as replaceLearnedTagsWithInfo};
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as o}from"tslib";import{jsx as t,jsxs as r}from"react/jsx-runtime";import{useState as n,useRef as i,useCallback as l,useMemo as a,useEffect as d}from"react";import{useRequirementAI as s}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{createUserStoriesForApproval as c,cloneUserStories as v}from"../../utils/userstory-approval-transform.utils.js";import{getFirstNonApprovedSegmentId as u,getFirstUnapprovedStoryId as p,approveAllSegments as f}from"../../utils/userstory-approval.utils.js";import{useApprovalStatus as S}from"../../hooks/useApprovalStatus.js";import{ContentSegment as m}from"./components/ContentSegment/ContentSegment.js";import{ApprovalBadge as h}from"./components/ApprovalBadge/ApprovalBadge.js";import g from"./UserStoryApprovalScreen.module.css.js";import{CheckIcon as y}from"../../icons/CheckIcon.js";import{BookmarkIcon as b}from"../../icons/BookmarkIcon.js";import{ApprovalSidebar as A}from"./components/ApprovalSidebar/ApprovalSidebar.js";import{SidebarOpenIcon as I,SidebarCloseIcon as C}from"lucide-react";import{UserStoryApprovalScreenContext as E,useUserStoryApprovalScreen as w}from"./UserStoryApprovalContext.js";import{BigEnoughPanel as N}from"../story-screen/BigEnoughPanel.js";import T from"../../icons/BigEnoughIcon.js";var U={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},x={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},F=Object.assign(function(r){var f,m=r.artifactTitleIds,h=r.config,y=void 0===h?{}:h,b=r.callbacks,A=void 0===b?{}:b,I=r.labels,C=void 0===I?{}:I,w=r.isDisabled,N=void 0!==w&&w,T=r.children,F=r.classNames,B=r.selectedArtifactId,k=s(),j=k.userStory,D=k.customStyles,_=e(e({},U),y),P=e(e({},x),C),R=n([]),W=R[0],M=R[1],V=n(""),q=V[0],z=V[1],O=n(""),L=O[0],H=O[1],G=n(!1),Y=G[0],J=G[1],K=n(!0),Q=K[0],X=K[1],Z=i(void 0),$=l(function(e,o,t,r){A.onShowNotification?A.onShowNotification(e,o,t,r):console.log("[".concat(e.toUpperCase(),"] ").concat(o,": ").concat(t))},[A]),ee=l(function(e){A.onScrollToElement?A.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[A]),oe=a(function(){var e=W.findIndex(function(e){return e.artifactId===q});return e>=0?e:0},[W,q]),te=W[oe];d(function(){Z.current=te},[te]),d(function(){var e;if(null==j?void 0:j.length){null===(e=A.onInitialize)||void 0===e||e.call(A),1===j.length&&X(!1),j.length>0&&!q&&z(B||j[0].artifactId);var o=c(v(j));M(o)}},[j,B]),d(function(){B&&B!==q&&z(B)},[B,q]),d(function(){if(te){var e=u(te,"");H(e)}},[null==te?void 0:te.artifactId]);var re=l(function(e,t){M(function(r){var n=o([],r,!0);if("APPROVED"===t.approval_status&&"APPROVED"!==r[e].approval_status){var i=p(r,t.artifactId);i&&z(i)}return n[e]=t,n})},[]),ne=l(function(e){var o=Z.current;if(o){var t=u(o,e);"NA"!==t&&(H(""),setTimeout(function(){H(t)},0))}},[]);S({userStoryForApproval:W,selectedUserStoryForApproval:te,userStoryIndex:oe,callbacks:A,labels:P,onSaveUserStory:re});var ie=e({height:_.containerHeight},_.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),le={userStoryForApproval:W,setUserStoryForApproval:M,selectedStoryArtifactId:q,setSelectedStoryArtifactId:z,selectedUserStoryIndex:oe,selectedUserStoryForApproval:te,currentContentId:L,setCurrentContentId:H,isEditingSegment:Y,setIsEditingSegment:J,isSidebarExpanded:Q,setIsSidebarExpanded:X,artifactTitleIds:m,config:_,labels:P,callbacks:A,isDisabled:N,handleSaveUserStory:re,handleUpdateContentId:ne,showNotification:$,scrollToElement:ee};return t(E.Provider,e({value:le},{children:t("div",e({className:"".concat(g.container," ").concat((null==F?void 0:F.container)||""),style:e(e({},ie),null===(f=null==D?void 0:D.approvalScreen)||void 0===f?void 0:f.wrapperContainer)},{children:T}))}))},{Sidebar:function(e){var o=e.Component,r=e.config,n=e.className,i=w(),l=i.isSidebarExpanded,a=i.selectedStoryArtifactId,d=i.setSelectedStoryArtifactId,s=i.userStoryForApproval,c=i.isEditingSegment,v=i.artifactTitleIds;return o?t(o,{isSidebarExpanded:l,selectedStoryArtifactId:a,setSelectedStoryArtifactId:d,userStoryForApproval:s,isEditingAnUserStorySegment:c,artifactTitleIds:v}):t(A,{config:r,className:n})},SidebarToggle:function(o){var r=o.OpenIcon,n=o.CloseIcon,i=o.className,l=void 0===i?"":i,a=w(),d=a.isSidebarExpanded,s=a.setIsSidebarExpanded,c=r||I,v=n||C;return t("div",e({className:"".concat(g.sidebarToggleWrapper," ").concat(l)},{children:t("button",e({onClick:function(){return s(function(e){return!e})},className:g.sidebarToggleBtn,"aria-label":d?"Collapse sidebar":"Expand sidebar",type:"button"},{children:t(d?v:c,{})}))}))},Content:function(o){var i,a,d,c,v,u,p,S,m,A,I,C,E,U,x,F,B,k,j,D,_,P,R,W,M,V,q,z,O,L,H,G=o.children,Y=o.ButtonComponent,J=o.hideApproveAll,K=void 0!==J&&J,Q=o.pageTitle,X=void 0===Q?"Review Generated Requirements":Q,Z=o.pageDescription,$=void 0===Z?"This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements.":Z,ee=w(),oe=ee.selectedUserStoryForApproval,te=ee.selectedUserStoryIndex,re=ee.artifactTitleIds,ne=ee.labels,ie=ee.config,le=ee.isDisabled,ae=ee.isEditingSegment,de=ee.handleSaveUserStory,se=ee.setCurrentContentId,ce=ee.showNotification,ve=s(),ue=ve.customStyles,pe=ve.customIcons,fe=n(!1),Se=fe[0],me=fe[1],he=l(function(){if(oe)if(ae)ce("warn","Warning!",ne.unsavedChangesWarning,3e3);else{var e=f(oe);de(te,e),se("")}},[oe,te,ae,ne,de,se,ce]);if(!oe)return null;var ge=re[te]||"",ye="APPROVED"===oe.approval_status,be=null!=(null==oe?void 0:oe.big_enough)&&!Number.isNaN(oe.big_enough)&&!!(null==oe?void 0:oe.big_enough_decision_factors);return r("div",e({className:g.content,style:e({},null===(a=null===(i=null==ue?void 0:ue.approvalScreen)||void 0===i?void 0:i.content)||void 0===a?void 0:a.content),"data-lsc-ui-page-title":X,"data-lsc-ui-page-description":$},{children:[r("div",e({className:g.header,style:e({},null===(v=null===(c=null===(d=null==ue?void 0:ue.approvalScreen)||void 0===d?void 0:d.body)||void 0===c?void 0:c.contentSegment)||void 0===v?void 0:v.header)},{children:[r("div",e({className:g.headerLeft,style:e({},null===(p=null===(u=null==ue?void 0:ue.approvalScreen)||void 0===u?void 0:u.content)||void 0===p?void 0:p.headerLeft)},{children:[r("div",e({className:g.headerMeta,style:e({},null===(A=null===(m=null===(S=null==ue?void 0:ue.approvalScreen)||void 0===S?void 0:S.body)||void 0===m?void 0:m.contentSegment)||void 0===A?void 0:A.headerMeta)},{children:[t(b,{size:16,color:(null===(E=null===(C=null===(I=null==ue?void 0:ue.approvalScreen)||void 0===I?void 0:I.body)||void 0===C?void 0:C.contentSegment)||void 0===E?void 0:E.bookMarkColor)||"#8C8C8C"}),t("h2",e({className:g.headerArtifactId,style:e({},null===(F=null===(x=null===(U=null==ue?void 0:ue.approvalScreen)||void 0===U?void 0:U.body)||void 0===x?void 0:x.contentSegment)||void 0===F?void 0:F.headerArtifactId)},{children:ge}))]})),t("p",e({className:g.headerTitle,style:e({},null===(j=null===(k=null===(B=null==ue?void 0:ue.approvalScreen)||void 0===B?void 0:B.body)||void 0===k?void 0:k.contentSegment)||void 0===j?void 0:j.headerTitle)},{children:null==oe?void 0:oe.title}))]})),r("div",e({className:null==g?void 0:g.containerStyle,style:null===(_=null===(D=null==ue?void 0:ue.approvalScreen)||void 0===D?void 0:D.BigEnoughStyles)||void 0===_?void 0:_.containerStyle},{children:[be&&t("button",e({className:g.developerEffortButton,style:null===(R=null===(P=null==ue?void 0:ue.approvalScreen)||void 0===P?void 0:P.BigEnoughStyles)||void 0===R?void 0:R.buttonStyle,onClick:function(){return me(!Se)}},{children:t(T,{color:null===(M=null===(W=null==ue?void 0:ue.approvalScreen)||void 0===W?void 0:W.BigEnoughStyles)||void 0===M?void 0:M.iconColor,size:null===(q=null===(V=null==ue?void 0:ue.approvalScreen)||void 0===V?void 0:V.BigEnoughStyles)||void 0===q?void 0:q.iconSize})})),!K&&ie.showApproveAllButton&&t("div",e({className:g.headerRight},{children:ye?t(h,{status:"APPROVED",label:ne.approved}):Y?t(Y,e({type:"fill",onClick:he,isDisable:le,className:g.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:ne.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."}},{children:r("div",e({className:g.approveAllContent},{children:[t(y,{size:16,color:"white"}),t("span",{children:ne.approveAll})]}))})):r("button",e({onClick:he,disabled:le,className:g.approveAllButtonDefault,style:e({},null===(O=null===(z=null==ue?void 0:ue.approvalScreen)||void 0===z?void 0:z.content)||void 0===O?void 0:O.approveAllButtonDefault)},{children:[t(y,{size:16,color:"white"}),t("span",{children:ne.approveAll})]}))}))]}))]})),Se&&be&&t("div",e({className:g.bigEnoughWrapper},{children:t(N,{customIcons:null==pe?void 0:pe.userStoryIcons,customStyles:null===(L=null==ue?void 0:ue.approvalScreen)||void 0===L?void 0:L.aiReasoningCitaionStyles,currentUserStory:oe,panelStyles:null===(H=null==ue?void 0:ue.approvalScreen)||void 0===H?void 0:H.BigEnoughStyles,showPanel:Se})})),G]}))},Body:function(o){var n,i,a,d=o.children,c=o.EditorComponent,v=o.ViewerComponent,u=w(),p=u.selectedUserStoryForApproval,f=u.selectedUserStoryIndex,S=u.artifactTitleIds,h=u.handleSaveUserStory,y=s().customStyles,b=l(function(e){h(f,e)},[f,h]),A=l(function(o,t){var r;if(p){var n=e(e({},p),{sub_features:null===(r=p.sub_features)||void 0===r?void 0:r.map(function(e,r){return r===o?t:e})});h(f,n)}},[p,f,h]),I=l(function(o){var t;if(p){var r=e(e({},p),{sub_features:null===(t=p.sub_features)||void 0===t?void 0:t.filter(function(e,t){return t!==o})});h(f,r)}},[p,f,h]);if(!p)return null;var C=S[f]||"";return r("div",e({className:g.body,style:e({},null===(i=null===(n=null==y?void 0:y.approvalScreen)||void 0===n?void 0:n.body)||void 0===i?void 0:i.container)},{children:[t(m,{userStoryForApproval:p,artifactTitleId:C,onSaveMainStoryContent:b,EditorComponent:c,ViewerComponent:v}),null===(a=p.sub_features)||void 0===a?void 0:a.map(function(e,o){return t(m,{userStoryForApproval:e,artifactTitleId:"".concat(C," - ").concat(String.fromCharCode(65+o)),isSubFeature:!0,subFeatureIndex:o,onSaveSubFeature:A,onDeleteSubFeature:I,EditorComponent:c,ViewerComponent:v},e.artifactId)}),d]}))}});export{F as default};
1
+ import{__assign as e,__spreadArray as o,__awaiter as t,__generator as n}from"tslib";import{jsx as r,jsxs as l,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as s,useCallback as d,useMemo as c,useEffect as u}from"react";import v from"showdown";import{useRequirementAI as p}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{createUserStoriesForApproval as m,cloneUserStories as h}from"../../utils/userstory-approval-transform.utils.js";import{getFirstNonApprovedSegmentId as f,getFirstUnapprovedStoryId as S,approveAllSegments as y}from"../../utils/userstory-approval.utils.js";import{useApprovalStatus as g}from"../../hooks/useApprovalStatus.js";import{ContentSegment as b}from"./components/ContentSegment/ContentSegment.js";import{ApprovalBadge as I}from"./components/ApprovalBadge/ApprovalBadge.js";import C from"./UserStoryApprovalScreen.module.css.js";import{CheckIcon as A}from"../../icons/CheckIcon.js";import{BookmarkIcon as w}from"../../icons/BookmarkIcon.js";import{ApprovalSidebar as E}from"./components/ApprovalSidebar/ApprovalSidebar.js";import{ExternalLink as N,Download as U,Share2 as x,Copy as T,SidebarOpenIcon as k,SidebarCloseIcon as B}from"lucide-react";import{UserStoryApprovalScreenContext as D,useUserStoryApprovalScreen as F}from"./UserStoryApprovalContext.js";import{BigEnoughPanel as j}from"../story-screen/BigEnoughPanel.js";import P from"../../icons/BigEnoughIcon.js";import{Menu as M,MenuItem as _}from"@mui/material";import{formatMarkdown as R}from"../../utils/helpers.js";import{replaceTitleSection as z}from"../../utils/user-story.utils.js";var W={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},L={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},O=Object.assign(function(t){var n,l=t.artifactTitleIds,i=t.config,v=void 0===i?{}:i,y=t.callbacks,b=void 0===y?{}:y,I=t.labels,A=void 0===I?{}:I,w=t.isDisabled,E=void 0!==w&&w,N=t.children,U=t.classNames,x=t.selectedArtifactId,T=p(),k=T.userStory,B=T.customStyles,F=e(e({},W),v),j=e(e({},L),A),P=a([]),M=P[0],_=P[1],R=a(""),z=R[0],O=R[1],V=a(""),q=V[0],H=V[1],G=a(!1),Y=G[0],J=G[1],K=a(!0),Q=K[0],X=K[1],Z=s(void 0),$=d(function(e,o,t,n){b.onShowNotification?b.onShowNotification(e,o,t,n):console.log("[".concat(e.toUpperCase(),"] ").concat(o,": ").concat(t))},[b]),ee=d(function(e){b.onScrollToElement?b.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[b]),oe=c(function(){var e=M.findIndex(function(e){return e.artifactId===z});return e>=0?e:0},[M,z]),te=M[oe];u(function(){Z.current=te},[te]),u(function(){var e;if(null==k?void 0:k.length){null===(e=b.onInitialize)||void 0===e||e.call(b),1===k.length&&X(!1),k.length>0&&!z&&O(x||k[0].artifactId);var o=m(h(k));_(o)}},[k,x]),u(function(){x&&x!==z&&O(x)},[x,z]),u(function(){if(te){var e=f(te,"");H(e)}},[null==te?void 0:te.artifactId]);var ne=d(function(e,t){_(function(n){var r=o([],n,!0);if("APPROVED"===t.approval_status&&"APPROVED"!==n[e].approval_status){var l=S(n,t.artifactId);l&&O(l)}return r[e]=t,r})},[]),re=d(function(e){var o=Z.current;if(o){var t=f(o,e);"NA"!==t&&(H(""),setTimeout(function(){H(t)},0))}},[]);g({userStoryForApproval:M,selectedUserStoryForApproval:te,userStoryIndex:oe,callbacks:b,labels:j,onSaveUserStory:ne});var le=e({height:F.containerHeight},F.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),ie={userStoryForApproval:M,setUserStoryForApproval:_,selectedStoryArtifactId:z,setSelectedStoryArtifactId:O,selectedUserStoryIndex:oe,selectedUserStoryForApproval:te,currentContentId:q,setCurrentContentId:H,isEditingSegment:Y,setIsEditingSegment:J,isSidebarExpanded:Q,setIsSidebarExpanded:X,artifactTitleIds:l,config:F,labels:j,callbacks:b,isDisabled:E,handleSaveUserStory:ne,handleUpdateContentId:re,showNotification:$,scrollToElement:ee};return r(D.Provider,e({value:ie},{children:r("div",e({className:"".concat(C.container," ").concat((null==U?void 0:U.container)||""),style:e(e({},le),null===(n=null==B?void 0:B.approvalScreen)||void 0===n?void 0:n.wrapperContainer)},{children:N}))}))},{Sidebar:function(e){var o=e.Component,t=e.config,n=e.className,l=F(),i=l.isSidebarExpanded,a=l.selectedStoryArtifactId,s=l.setSelectedStoryArtifactId,d=l.userStoryForApproval,c=l.isEditingSegment,u=l.artifactTitleIds;return o?r(o,{isSidebarExpanded:i,selectedStoryArtifactId:a,setSelectedStoryArtifactId:s,userStoryForApproval:d,isEditingAnUserStorySegment:c,artifactTitleIds:u}):r(E,{config:t,className:n})},SidebarToggle:function(o){var t=o.OpenIcon,n=o.CloseIcon,l=o.className,i=void 0===l?"":l,a=F(),s=a.isSidebarExpanded,d=a.setIsSidebarExpanded,c=t||k,u=n||B;return r("div",e({className:"".concat(C.sidebarToggleWrapper," ").concat(i)},{children:r("button",e({onClick:function(){return d(function(e){return!e})},className:C.sidebarToggleBtn,"aria-label":s?"Collapse sidebar":"Expand sidebar",type:"button"},{children:r(s?u:c,{})}))}))},Content:function(o){var c,u,m,h,f,S,g,b,E,k,B,D,W,L,O,V,q,H,G,Y,J,K,Q,X,Z,$,ee,oe,te,ne,re,le=o.children,ie=o.ButtonComponent,ae=o.hideApproveAll,se=void 0!==ae&&ae,de=o.pageTitle,ce=void 0===de?"Review Generated Requirements":de,ue=o.showShareIcon,ve=void 0!==ue&&ue,pe=o.handleDownloadUserStory,me=o.handleOpenSendDialog,he=o.pageDescription,fe=void 0===he?"This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements.":he,Se=F(),ye=Se.selectedUserStoryForApproval,ge=Se.selectedUserStoryIndex,be=Se.artifactTitleIds,Ie=Se.labels,Ce=Se.config,Ae=Se.isDisabled,we=Se.isEditingSegment,Ee=Se.handleSaveUserStory,Ne=Se.setCurrentContentId,Ue=Se.showNotification,xe=p(),Te=xe.userStory;xe.setUserStory;var ke=Te[0],Be=a(null),De=Be[0],Fe=Be[1],je=function(){Fe(null)},Pe=s(null),Me=a(!1);Me[0];var _e=Me[1],Re=p(),ze=Re.customStyles,We=Re.customIcons,Le=null==ze?void 0:ze.userStoryCardStyles,Oe=a(!1),Ve=Oe[0],qe=Oe[1],He=d(function(){if(ye)if(we)Ue("warn","Warning!",Ie.unsavedChangesWarning,3e3);else{var e=y(ye);Ee(ge,e),Ne("")}},[ye,ge,we,Ie,Ee,Ne,Ue]);if(!ye)return null;var Ge=be[ge]||"",Ye="APPROVED"===ye.approval_status,Je=null!=(null==ye?void 0:ye.big_enough)&&!Number.isNaN(ye.big_enough)&&!!(null==ye?void 0:ye.big_enough_decision_factors);return l("div",e({className:C.content,style:e({},null===(u=null===(c=null==ze?void 0:ze.approvalScreen)||void 0===c?void 0:c.content)||void 0===u?void 0:u.content),"data-lsc-ui-page-title":ce,"data-lsc-ui-page-description":fe},{children:[l("div",e({className:C.header,style:e({},null===(f=null===(h=null===(m=null==ze?void 0:ze.approvalScreen)||void 0===m?void 0:m.body)||void 0===h?void 0:h.contentSegment)||void 0===f?void 0:f.header)},{children:[l("div",e({className:C.headerLeft,style:e({},null===(g=null===(S=null==ze?void 0:ze.approvalScreen)||void 0===S?void 0:S.content)||void 0===g?void 0:g.headerLeft)},{children:[l("div",e({className:C.headerMeta,style:e({},null===(k=null===(E=null===(b=null==ze?void 0:ze.approvalScreen)||void 0===b?void 0:b.body)||void 0===E?void 0:E.contentSegment)||void 0===k?void 0:k.headerMeta)},{children:[r(w,{size:16,color:(null===(W=null===(D=null===(B=null==ze?void 0:ze.approvalScreen)||void 0===B?void 0:B.body)||void 0===D?void 0:D.contentSegment)||void 0===W?void 0:W.bookMarkColor)||"#8C8C8C"}),r("h2",e({className:C.headerArtifactId,style:e({},null===(V=null===(O=null===(L=null==ze?void 0:ze.approvalScreen)||void 0===L?void 0:L.body)||void 0===O?void 0:O.contentSegment)||void 0===V?void 0:V.headerArtifactId)},{children:Ge}))]})),r("p",e({className:C.headerTitle,style:e({},null===(G=null===(H=null===(q=null==ze?void 0:ze.approvalScreen)||void 0===q?void 0:q.body)||void 0===H?void 0:H.contentSegment)||void 0===G?void 0:G.headerTitle)},{children:null==ye?void 0:ye.title}))]})),l("div",e({className:null==C?void 0:C.containerStyle,style:null===(J=null===(Y=null==ze?void 0:ze.approvalScreen)||void 0===Y?void 0:Y.BigEnoughStyles)||void 0===J?void 0:J.containerStyle},{children:[Je&&r("button",e({className:C.developerEffortButton,style:null===(Q=null===(K=null==ze?void 0:ze.approvalScreen)||void 0===K?void 0:K.BigEnoughStyles)||void 0===Q?void 0:Q.buttonStyle,onClick:function(){return qe(!Ve)}},{children:r(P,{color:null===(Z=null===(X=null==ze?void 0:ze.approvalScreen)||void 0===X?void 0:X.BigEnoughStyles)||void 0===Z?void 0:Z.iconColor,size:null===(ee=null===($=null==ze?void 0:ze.approvalScreen)||void 0===$?void 0:$.BigEnoughStyles)||void 0===ee?void 0:ee.iconSize})})),ve&&l(i,{children:[r("button",e({className:C.iconButton,style:null==Le?void 0:Le.iconButton,onClick:function(e){Fe(e.currentTarget)}},{children:r(N,{size:16})})),l(M,e({id:"user-story-share-menu",anchorEl:De,open:!!De,onClose:function(){return Fe(null)},style:null==Le?void 0:Le.userStoryShareMenu},{children:[r(_,e({style:null==Le?void 0:Le.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return _e(!0),pe?[4,Promise.all([pe("pdf"),pe("doc")])]:[2];case 1:return e.sent(),_e(!1),[2]}})})}},{children:l("div",e({ref:Pe,className:C.menuItemContent,style:null==Le?void 0:Le.menuItemContent},{children:[r(U,{size:16,color:null==Le?void 0:Le.menuIconColor}),r("p",e({style:null==Le?void 0:Le.menuLabel},{children:"Download"}))]}))})),r(_,e({style:null==Le?void 0:Le.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var o;return n(this,function(t){return ke,o=e(e({},ke),{value:"".concat(z(null==ke?void 0:ke.value,ke.title)," \n").concat(ke.value)}),null==me||me(!0,[o],ke.artifactId),je(),[2]})})}},{children:l("div",e({style:null==Le?void 0:Le.menuItemContent,className:C.menuItemContentPadded},{children:[r(x,{size:16,color:null==Le?void 0:Le.menuIconColor}),r("p",e({style:null==Le?void 0:Le.menuLabel},{children:"Send"}))]}))})),r(_,e({style:null==Le?void 0:Le.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var e,o,t,r,l;return n(this,function(n){switch(n.label){case 0:e=new v.Converter,o=e.makeHtml(R(ke.value)||ke.value),t=function(e){var o=(new v.Converter).makeHtml(e),t=document.createElement("div");return t.innerHTML=o,t.textContent||t.innerText||""}(R(ke.value)||ke.value),r=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([o],{type:"text/html"})}),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,navigator.clipboard.write([r])];case 2:return n.sent(),console.log("Copied User Story"),[3,5];case 3:return l=n.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return je(),[7];case 5:return[2]}})})}},{children:l("div",e({style:null==Le?void 0:Le.menuItemContent,className:C.menuItemContentPadded},{children:[r(T,{size:16,color:null==Le?void 0:Le.menuIconColor}),r("p",e({style:null==Le?void 0:Le.menuLabel},{children:"Copy"}))]}))}))]}))]}),!se&&Ce.showApproveAllButton&&r("div",e({className:C.headerRight},{children:Ye?r(I,{status:"APPROVED",label:Ie.approved}):ie?r(ie,e({type:"fill",onClick:He,isDisable:Ae,className:C.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:Ie.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."}},{children:l("div",e({className:C.approveAllContent},{children:[r(A,{size:16,color:"white"}),r("span",{children:Ie.approveAll})]}))})):l("button",e({onClick:He,disabled:Ae,className:C.approveAllButtonDefault,style:e({},null===(te=null===(oe=null==ze?void 0:ze.approvalScreen)||void 0===oe?void 0:oe.content)||void 0===te?void 0:te.approveAllButtonDefault)},{children:[r(A,{size:16,color:"white"}),r("span",{children:Ie.approveAll})]}))}))]}))]})),Ve&&Je&&r("div",e({className:C.bigEnoughWrapper},{children:r(j,{customIcons:null==We?void 0:We.userStoryIcons,customStyles:null===(ne=null==ze?void 0:ze.approvalScreen)||void 0===ne?void 0:ne.aiReasoningCitaionStyles,currentUserStory:ye,panelStyles:null===(re=null==ze?void 0:ze.approvalScreen)||void 0===re?void 0:re.BigEnoughStyles,showPanel:Ve})})),le]}))},Body:function(o){var t,n,i,a=o.children,s=o.EditorComponent,c=o.ViewerComponent,u=o.handleDownloadUserStory,v=o.handleOpenSendDialog,m=o.showShareIcon,h=void 0!==m&&m,f=F(),S=f.selectedUserStoryForApproval,y=f.selectedUserStoryIndex,g=f.artifactTitleIds,I=f.handleSaveUserStory,A=p().customStyles,w=d(function(e){I(y,e)},[y,I]),E=d(function(o,t){var n;if(S){var r=e(e({},S),{sub_features:null===(n=S.sub_features)||void 0===n?void 0:n.map(function(e,n){return n===o?t:e})});I(y,r)}},[S,y,I]),N=d(function(o){var t;if(S){var n=e(e({},S),{sub_features:null===(t=S.sub_features)||void 0===t?void 0:t.filter(function(e,t){return t!==o})});I(y,n)}},[S,y,I]);if(!S)return null;var U=g[y]||"";return l("div",e({className:C.body,style:e({},null===(n=null===(t=null==A?void 0:A.approvalScreen)||void 0===t?void 0:t.body)||void 0===n?void 0:n.container)},{children:[r(b,{userStoryForApproval:S,artifactTitleId:U,onSaveMainStoryContent:w,EditorComponent:s,ViewerComponent:c}),null===(i=S.sub_features)||void 0===i?void 0:i.map(function(e,o){return r(b,{userStoryForApproval:e,artifactTitleId:"".concat(U," - ").concat(String.fromCharCode(65+o)),isSubFeature:!0,subFeatureIndex:o,onSaveSubFeature:E,onDeleteSubFeature:N,EditorComponent:s,ViewerComponent:c,handleDownloadUserStory:u,handleOpenSendDialog:v,showShareIcon:h},e.artifactId)}),a]}))}});export{O as default};
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.js.map
@@ -1,2 +1,2 @@
1
- var e={container:"UserStoryApprovalScreen-module_container__Hy5uc",sidebarToggleWrapper:"UserStoryApprovalScreen-module_sidebarToggleWrapper__Z9C-4",developerEffortButton:"UserStoryApprovalScreen-module_developerEffortButton__9EfUX",containerStyle:"UserStoryApprovalScreen-module_containerStyle__PS6Gn",sidebarToggleBtn:"UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf",content:"UserStoryApprovalScreen-module_content__VQ6Z9",header:"UserStoryApprovalScreen-module_header__zsOki",headerLeft:"UserStoryApprovalScreen-module_headerLeft__s-1Eq",headerMeta:"UserStoryApprovalScreen-module_headerMeta__3JPhW",headerArtifactId:"UserStoryApprovalScreen-module_headerArtifactId__xjOR9",headerTitle:"UserStoryApprovalScreen-module_headerTitle__xxkv-",headerRight:"UserStoryApprovalScreen-module_headerRight__BWc-W",approveAllButton:"UserStoryApprovalScreen-module_approveAllButton__HkH1f",approveAllContent:"UserStoryApprovalScreen-module_approveAllContent__-UTDs",approveAllButtonDefault:"UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR",body:"UserStoryApprovalScreen-module_body__aAJwQ"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const r=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;r&&e.setAttribute("nonce",r),e.appendChild(document.createTextNode(".UserStoryApprovalScreen-module_container__Hy5uc{border:1px solid #d1d5db;display:flex;flex-direction:row;font-family:Inter,sans-serif;min-height:100vh}.UserStoryApprovalScreen-module_container__Hy5uc *{font-family:inherit}.UserStoryApprovalScreen-module_developerEffortButton__9EfUX{background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;margin-right:3px;padding:.4rem .8rem}.UserStoryApprovalScreen-module_containerStyle__PS6Gn{align-items:center;display:flex;gap:3px}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf{transition:color .2s ease}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf:hover{opacity:.8}.UserStoryApprovalScreen-module_content__VQ6Z9{display:flex;flex:1;flex-direction:column;min-height:100%;overflow-y:auto;position:relative;width:100%}.UserStoryApprovalScreen-module_header__zsOki{align-items:center;background-color:#fff;border-bottom:1px solid #d1d5db;display:flex;flex-direction:row;justify-content:space-between;padding:16px 32px;position:sticky;top:0;z-index:50}.UserStoryApprovalScreen-module_headerLeft__s-1Eq{display:flex;flex-direction:column;gap:4px}.UserStoryApprovalScreen-module_headerMeta__3JPhW{align-items:center;color:#6932e2;display:flex;flex-direction:row;gap:8px}.UserStoryApprovalScreen-module_headerArtifactId__xjOR9{font-family:Inter,sans-serif;font-size:14px;font-weight:400;margin:0}.UserStoryApprovalScreen-module_headerTitle__xxkv-{font-family:Inter,sans-serif;font-size:16px;font-weight:600;margin:0}.UserStoryApprovalScreen-module_headerRight__BWc-W{align-items:center;display:flex}.UserStoryApprovalScreen-module_approveAllButton__HkH1f{height:40px}.UserStoryApprovalScreen-module_approveAllContent__-UTDs{align-items:center;display:flex;flex-direction:row;gap:4px;height:32px;padding:0 2px}.UserStoryApprovalScreen-module_approveAllContent__-UTDs span{color:#fff;font-family:Inter,sans-serif;font-size:14px;text-transform:none}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR{align-items:center;background:linear-gradient(115.1deg,#2546f0 -23.58%,#5928ed 74.92%);border:none;border-radius:8px;color:#fff;cursor:pointer;display:flex;flex-direction:row;font-family:Inter,sans-serif;font-size:14px;gap:4px;height:40px;padding:0 16px;transition:opacity .2s ease}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR:hover{opacity:.9}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR:disabled{cursor:not-allowed;opacity:.5}.UserStoryApprovalScreen-module_body__aAJwQ{display:flex;flex-direction:column;width:100%}.UserStoryApprovalScreen-module_sidebarToggleWrapper__Z9C-4{flex-shrink:0;height:100%;position:relative;width:0}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf{align-items:center;background:none;border:none;cursor:pointer;display:flex;justify-content:center;left:0;margin:0;padding:0;position:absolute;top:50%;transform:translateY(-50%);transition:opacity .2s ease;z-index:10}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf:focus{outline:none}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
1
+ var e={container:"UserStoryApprovalScreen-module_container__Hy5uc",sidebarToggleWrapper:"UserStoryApprovalScreen-module_sidebarToggleWrapper__Z9C-4",developerEffortButton:"UserStoryApprovalScreen-module_developerEffortButton__9EfUX",containerStyle:"UserStoryApprovalScreen-module_containerStyle__PS6Gn",sidebarToggleBtn:"UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf",content:"UserStoryApprovalScreen-module_content__VQ6Z9",header:"UserStoryApprovalScreen-module_header__zsOki",headerLeft:"UserStoryApprovalScreen-module_headerLeft__s-1Eq",headerMeta:"UserStoryApprovalScreen-module_headerMeta__3JPhW",headerArtifactId:"UserStoryApprovalScreen-module_headerArtifactId__xjOR9",headerTitle:"UserStoryApprovalScreen-module_headerTitle__xxkv-",headerRight:"UserStoryApprovalScreen-module_headerRight__BWc-W",approveAllButton:"UserStoryApprovalScreen-module_approveAllButton__HkH1f",approveAllContent:"UserStoryApprovalScreen-module_approveAllContent__-UTDs",approveAllButtonDefault:"UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR",body:"UserStoryApprovalScreen-module_body__aAJwQ",iconButton:"UserStoryApprovalScreen-module_iconButton__PGTVl",menuItemContent:"UserStoryApprovalScreen-module_menuItemContent__SCM6V",menuItemContentPadded:"UserStoryApprovalScreen-module_menuItemContentPadded__3UjuU"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const r=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;r&&e.setAttribute("nonce",r),e.appendChild(document.createTextNode(".UserStoryApprovalScreen-module_container__Hy5uc{border:1px solid #d1d5db;display:flex;flex-direction:row;font-family:Inter,sans-serif;min-height:100vh}.UserStoryApprovalScreen-module_container__Hy5uc *{font-family:inherit}.UserStoryApprovalScreen-module_developerEffortButton__9EfUX{background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;margin-right:3px;padding:.4rem .8rem}.UserStoryApprovalScreen-module_containerStyle__PS6Gn{align-items:center;display:flex;gap:3px}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf{transition:color .2s ease}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf:hover{opacity:.8}.UserStoryApprovalScreen-module_content__VQ6Z9{display:flex;flex:1;flex-direction:column;min-height:100%;overflow-y:auto;position:relative;width:100%}.UserStoryApprovalScreen-module_header__zsOki{align-items:center;background-color:#fff;border-bottom:1px solid #d1d5db;display:flex;flex-direction:row;justify-content:space-between;padding:16px 32px;position:sticky;top:0;z-index:50}.UserStoryApprovalScreen-module_headerLeft__s-1Eq{display:flex;flex-direction:column;gap:4px}.UserStoryApprovalScreen-module_headerMeta__3JPhW{align-items:center;color:#6932e2;display:flex;flex-direction:row;gap:8px}.UserStoryApprovalScreen-module_headerArtifactId__xjOR9{font-family:Inter,sans-serif;font-size:14px;font-weight:400;margin:0}.UserStoryApprovalScreen-module_headerTitle__xxkv-{font-family:Inter,sans-serif;font-size:16px;font-weight:600;margin:0}.UserStoryApprovalScreen-module_headerRight__BWc-W{align-items:center;display:flex}.UserStoryApprovalScreen-module_approveAllButton__HkH1f{height:40px}.UserStoryApprovalScreen-module_approveAllContent__-UTDs{align-items:center;display:flex;flex-direction:row;gap:4px;height:32px;padding:0 2px}.UserStoryApprovalScreen-module_approveAllContent__-UTDs span{color:#fff;font-family:Inter,sans-serif;font-size:14px;text-transform:none}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR{align-items:center;background:linear-gradient(115.1deg,#2546f0 -23.58%,#5928ed 74.92%);border:none;border-radius:8px;color:#fff;cursor:pointer;display:flex;flex-direction:row;font-family:Inter,sans-serif;font-size:14px;gap:4px;height:40px;padding:0 16px;transition:opacity .2s ease}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR:hover{opacity:.9}.UserStoryApprovalScreen-module_approveAllButtonDefault__MrKNR:disabled{cursor:not-allowed;opacity:.5}.UserStoryApprovalScreen-module_body__aAJwQ{display:flex;flex-direction:column;width:100%}.UserStoryApprovalScreen-module_sidebarToggleWrapper__Z9C-4{flex-shrink:0;height:100%;position:relative;width:0}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf{align-items:center;background:none;border:none;cursor:pointer;display:flex;justify-content:center;left:0;margin:0;padding:0;position:absolute;top:50%;transform:translateY(-50%);transition:opacity .2s ease;z-index:10}.UserStoryApprovalScreen-module_sidebarToggleBtn__9edtf:focus{outline:none}.UserStoryApprovalScreen-module_iconButton__PGTVl{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;display:flex;justify-content:center;margin-left:.5rem;padding:.4rem .8rem}.UserStoryApprovalScreen-module_menuItemContent__SCM6V{align-items:center;display:flex;flex-direction:row;gap:.5rem;margin-left:.25rem}.UserStoryApprovalScreen-module_menuItemContentPadded__3UjuU{align-items:center;display:flex;flex-direction:row;gap:.5rem;padding-left:.25rem}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as o}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useState as l,useCallback as i}from"react";import{ContentBlock as t}from"../ContentBlock/ContentBlock.js";import r from"./ContentSegment.module.css.js";import{ChevronUpIcon as d}from"../../../../icons/ChevronUpIcon.js";import{BookmarkIcon as v}from"../../../../icons/BookmarkIcon.js";import{ChevronDownIcon as u}from"../../../../icons/ChevronDownIcon.js";import{useRequirementAI as a}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as c}from"../../../story-screen/BigEnoughPanel.js";var s=function(s){var p,m,f,S,h,y,g,b,C,I,N,A,j,k,F,B,T,_,x,E,M,W,w,D,R,q,z,U,V,P=s.userStoryForApproval,G=s.artifactTitleId,H=s.isSubFeature,J=void 0!==H&&H,K=s.subFeatureIndex,L=s.onSaveSubFeature,O=s.onDeleteSubFeature,Q=s.onSaveMainStoryContent,X=s.EditorComponent,Y=s.ViewerComponent,Z=l(!0),$=Z[0],oo=Z[1],eo=a(),no=eo.customStyles,lo=eo.customIcons,io=i(function(){oo(function(o){return!o})},[]),to=i(function(e){if(void 0!==K){var n=o(o({},P),{value:P.value.map(function(n,l){return l===e?o(o({},n),{isApproved:!0}):n})});null==L||L(K,n)}},[P,K,L]),ro=i(function(e,n){if(void 0!==K){var l=o(o({},P),{value:P.value.map(function(l,i){return i===e?o(o({},l),{content:n}):l})});null==L||L(K,l)}},[P,K,L]),vo=i(function(e){if(void 0!==K){var n=o(o({},P),{value:P.value.filter(function(o,n){return n!==e})});0!==n.value.length?null==L||L(K,n):null==O||O(K)}},[P,K,L,O]),uo=i(function(e,n){var l;if(!J){var i=null===(l=P.value[e])||void 0===l?void 0:l.contentId;if(i){var t=o(o({},P),{value:P.value.map(function(e){return e.contentId===i?o(o({},e),{content:n}):e})});null==Q||Q(t)}}},[P,J,Q]),ao=i(function(e){var n;if(!J){var l=null===(n=P.value[e])||void 0===n?void 0:n.contentId;if(l){var i=o(o({},P),{value:P.value.map(function(e){return e.contentId===l?o(o({},e),{isApproved:!0}):e})});null==Q||Q(i)}}},[P,J,Q]),co=null!=(null==P?void 0:P.big_enough)&&!Number.isNaN(P.big_enough)&&!!(null==P?void 0:P.big_enough_decision_factors);return e("div",o({className:r.container,style:o({},null===(f=null===(m=null===(p=null==no?void 0:no.approvalScreen)||void 0===p?void 0:p.body)||void 0===m?void 0:m.contentSegment)||void 0===f?void 0:f.container)},{children:[J&&e("button",o({onClick:io,className:r.header,style:o({},null===(y=null===(h=null===(S=null==no?void 0:no.approvalScreen)||void 0===S?void 0:S.body)||void 0===h?void 0:h.contentSegment)||void 0===y?void 0:y.header)},{children:[e("div",o({className:r.headerContent,style:o({},null===(C=null===(b=null===(g=null==no?void 0:no.approvalScreen)||void 0===g?void 0:g.body)||void 0===b?void 0:b.contentSegment)||void 0===C?void 0:C.headerContent)},{children:[e("div",o({className:r.headerMeta,style:o({},null===(A=null===(N=null===(I=null==no?void 0:no.approvalScreen)||void 0===I?void 0:I.body)||void 0===N?void 0:N.contentSegment)||void 0===A?void 0:A.headerMeta)},{children:[n(v,{size:16,color:(null===(F=null===(k=null===(j=null==no?void 0:no.approvalScreen)||void 0===j?void 0:j.body)||void 0===k?void 0:k.contentSegment)||void 0===F?void 0:F.bookMarkColor)||"#8C8C8C"}),n("h2",o({className:r.headerArtifactId,style:o({},null===(_=null===(T=null===(B=null==no?void 0:no.approvalScreen)||void 0===B?void 0:B.body)||void 0===T?void 0:T.contentSegment)||void 0===_?void 0:_.headerArtifactId)},{children:G}))]})),n("p",o({className:r.headerTitle,style:o({},null===(M=null===(E=null===(x=null==no?void 0:no.approvalScreen)||void 0===x?void 0:x.body)||void 0===E?void 0:E.contentSegment)||void 0===M?void 0:M.headerTitle)},{children:null==P?void 0:P.title}))]})),e("div",o({className:r.headerToggle,style:o({},null===(D=null===(w=null===(W=null==no?void 0:no.approvalScreen)||void 0===W?void 0:W.body)||void 0===w?void 0:w.contentSegment)||void 0===D?void 0:D.headerToggle)},{children:[co&&n(c,{customIcons:null==lo?void 0:lo.userStoryIcons,customStyles:null===(R=null==no?void 0:no.approvalScreen)||void 0===R?void 0:R.aiReasoningCitaionStyles,currentUserStory:P,panelStyles:null===(q=null==no?void 0:no.approvalScreen)||void 0===q?void 0:q.BigEnoughStyles}),n($?d:u,{size:16})]}))]})),$&&n("div",o({className:r.contentWrapper,style:o({},null===(V=null===(U=null===(z=null==no?void 0:no.approvalScreen)||void 0===z?void 0:z.body)||void 0===U?void 0:U.contentSegment)||void 0===V?void 0:V.contentWrapper)},{children:Array.isArray(null==P?void 0:P.value)&&P.value.map(function(o,e){return n(t,{segment:o,segmentIndex:e,isSubFeature:J,onSaveContent:J?ro:uo,onApproveContent:J?to:ao,onDeleteContent:J?vo:void 0,EditorComponent:X,ViewerComponent:Y},o.contentId)})}))]}))};export{s as ContentSegment,s as default};
1
+ import{__assign as e,__awaiter as n,__generator as o}from"tslib";import{jsxs as l,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as r,useRef as u,useCallback as d}from"react";import{ContentBlock as a}from"../ContentBlock/ContentBlock.js";import v from"./ContentSegment.module.css.js";import{ChevronUpIcon as c}from"../../../../icons/ChevronUpIcon.js";import{BookmarkIcon as s}from"../../../../icons/BookmarkIcon.js";import{ChevronDownIcon as m}from"../../../../icons/ChevronDownIcon.js";import{useRequirementAI as p}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as f}from"../../../story-screen/BigEnoughPanel.js";import{Menu as h,MenuItem as y}from"@mui/material";import{ExternalLink as S,Download as C,Share2 as b,Copy as I}from"lucide-react";import g from"showdown";import{formatMarkdown as w}from"../../../../utils/helpers.js";var N=function(N){var k,j,x,A,B,M,T,F,_,z,D,E,L,P,U,W,H,R,q,V,O,G,J,K,Q,X,Y,Z,$,ee=N.userStoryForApproval,ne=N.artifactTitleId,oe=N.isSubFeature,le=void 0!==oe&&oe,te=N.subFeatureIndex,ie=N.onSaveSubFeature,re=N.onDeleteSubFeature,ue=N.onSaveMainStoryContent,de=N.EditorComponent,ae=N.ViewerComponent,ve=N.handleDownloadUserStory,ce=N.handleOpenSendDialog,se=N.showShareIcon,me=void 0!==se&&se,pe=r(!0),fe=pe[0],he=pe[1],ye=p(),Se=ye.customStyles,Ce=ye.customIcons,be=null==Se?void 0:Se.userStoryCardStyles,Ie=r(null),ge=Ie[0],we=Ie[1],Ne=r(!1);Ne[0];var ke=Ne[1],je=u(null),xe=d(function(){he(function(e){return!e})},[]),Ae=d(function(n){if(void 0!==te){var o=e(e({},ee),{value:ee.value.map(function(o,l){return l===n?e(e({},o),{isApproved:!0}):o})});null==ie||ie(te,o)}},[ee,te,ie]),Be=d(function(n,o){if(void 0!==te){var l=e(e({},ee),{value:ee.value.map(function(l,t){return t===n?e(e({},l),{content:o}):l})});null==ie||ie(te,l)}},[ee,te,ie]),Me=d(function(n){if(void 0!==te){var o=e(e({},ee),{value:ee.value.filter(function(e,o){return o!==n})});0!==o.value.length?null==ie||ie(te,o):null==re||re(te)}},[ee,te,ie,re]),Te=d(function(n,o){var l;if(!le){var t=null===(l=ee.value[n])||void 0===l?void 0:l.contentId;if(t){var i=e(e({},ee),{value:ee.value.map(function(n){return n.contentId===t?e(e({},n),{content:o}):n})});null==ue||ue(i)}}},[ee,le,ue]),Fe=d(function(n){var o;if(!le){var l=null===(o=ee.value[n])||void 0===o?void 0:o.contentId;if(l){var t=e(e({},ee),{value:ee.value.map(function(n){return n.contentId===l?e(e({},n),{isApproved:!0}):n})});null==ue||ue(t)}}},[ee,le,ue]),_e=function(){we(null)},ze=function(n){var o,l=n.value.map(function(e){return e.content}).join("");return e(e({},n),{value:l,sub_features:null===(o=n.sub_features)||void 0===o?void 0:o.map(ze)})},De=null!=(null==ee?void 0:ee.big_enough)&&!Number.isNaN(ee.big_enough)&&!!(null==ee?void 0:ee.big_enough_decision_factors);return l("div",e({className:v.container,style:e({},null===(x=null===(j=null===(k=null==Se?void 0:Se.approvalScreen)||void 0===k?void 0:k.body)||void 0===j?void 0:j.contentSegment)||void 0===x?void 0:x.container)},{children:[le&&l("button",e({onClick:xe,className:v.header,style:e({},null===(M=null===(B=null===(A=null==Se?void 0:Se.approvalScreen)||void 0===A?void 0:A.body)||void 0===B?void 0:B.contentSegment)||void 0===M?void 0:M.header)},{children:[l("div",e({className:v.headerContent,style:e({},null===(_=null===(F=null===(T=null==Se?void 0:Se.approvalScreen)||void 0===T?void 0:T.body)||void 0===F?void 0:F.contentSegment)||void 0===_?void 0:_.headerContent)},{children:[l("div",e({className:v.headerMeta,style:e({},null===(E=null===(D=null===(z=null==Se?void 0:Se.approvalScreen)||void 0===z?void 0:z.body)||void 0===D?void 0:D.contentSegment)||void 0===E?void 0:E.headerMeta)},{children:[t(s,{size:16,color:(null===(U=null===(P=null===(L=null==Se?void 0:Se.approvalScreen)||void 0===L?void 0:L.body)||void 0===P?void 0:P.contentSegment)||void 0===U?void 0:U.bookMarkColor)||"#8C8C8C"}),t("h2",e({className:v.headerArtifactId,style:e({},null===(R=null===(H=null===(W=null==Se?void 0:Se.approvalScreen)||void 0===W?void 0:W.body)||void 0===H?void 0:H.contentSegment)||void 0===R?void 0:R.headerArtifactId)},{children:ne}))]})),t("p",e({className:v.headerTitle,style:e({},null===(O=null===(V=null===(q=null==Se?void 0:Se.approvalScreen)||void 0===q?void 0:q.body)||void 0===V?void 0:V.contentSegment)||void 0===O?void 0:O.headerTitle)},{children:null==ee?void 0:ee.title}))]})),l("div",e({className:v.headerToggle,style:e({},null===(K=null===(J=null===(G=null==Se?void 0:Se.approvalScreen)||void 0===G?void 0:G.body)||void 0===J?void 0:J.contentSegment)||void 0===K?void 0:K.headerToggle)},{children:[De&&t(f,{customIcons:null==Ce?void 0:Ce.userStoryIcons,customStyles:null===(Q=null==Se?void 0:Se.approvalScreen)||void 0===Q?void 0:Q.aiReasoningCitaionStyles,currentUserStory:ee,panelStyles:null===(X=null==Se?void 0:Se.approvalScreen)||void 0===X?void 0:X.BigEnoughStyles}),me&&l(i,{children:[t("button",e({className:v.iconButton,style:null==be?void 0:be.iconButton,onClick:function(e){we(e.currentTarget)}},{children:t(S,{size:16})})),l(h,e({id:"user-story-share-menu",anchorEl:ge,open:!!ge,onClose:function(){return we(null)},style:null==be?void 0:be.userStoryShareMenu},{children:[t(y,e({style:null==be?void 0:be.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return ke(!0),ve?[4,Promise.all([ve("pdf"),ve("doc")])]:[2];case 1:return e.sent(),ke(!1),[2]}})})}},{children:l("div",e({ref:je,className:v.menuItemContent,style:null==be?void 0:be.menuItemContent},{children:[t(C,{size:16,color:null==be?void 0:be.menuIconColor}),t("p",e({style:null==be?void 0:be.menuLabel},{children:"Download"}))]}))})),t(y,e({style:null==be?void 0:be.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var e;return o(this,function(n){return e=ze(ee),null==ce||ce(!0,[e],ee.artifactId),_e(),[2]})})}},{children:l("div",e({style:null==be?void 0:be.menuItemContent,className:v.menuItemContentPadded},{children:[t(b,{size:16,color:null==be?void 0:be.menuIconColor}),t("p",e({style:null==be?void 0:be.menuLabel},{children:"Send"}))]}))})),t(y,e({style:null==be?void 0:be.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var e,n,l,t,i,r;return o(this,function(o){switch(o.label){case 0:e=new g.Converter,n=ee.value.map(function(e){return e.content}).join(""),l=e.makeHtml(w(n)||n),t=function(e){var n=(new g.Converter).makeHtml(e),o=document.createElement("div");return o.innerHTML=n,o.textContent||o.innerText||""}(w(n)||n),i=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})}),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,navigator.clipboard.write([i])];case 2:return o.sent(),console.log("Copied User Story"),[3,5];case 3:return r=o.sent(),console.error("Failed to copy user story:",r),[3,5];case 4:return _e(),[7];case 5:return[2]}})})}},{children:l("div",e({style:null==be?void 0:be.menuItemContent,className:v.menuItemContentPadded},{children:[t(I,{size:16,color:null==be?void 0:be.menuIconColor}),t("p",e({style:null==be?void 0:be.menuLabel},{children:"Copy"}))]}))}))]}))]}),t(fe?c:m,{size:16})]}))]})),fe&&t("div",e({className:v.contentWrapper,style:e({},null===($=null===(Z=null===(Y=null==Se?void 0:Se.approvalScreen)||void 0===Y?void 0:Y.body)||void 0===Z?void 0:Z.contentSegment)||void 0===$?void 0:$.contentWrapper)},{children:Array.isArray(null==ee?void 0:ee.value)&&ee.value.map(function(e,n){return t(a,{segment:e,segmentIndex:n,isSubFeature:le,onSaveContent:le?Be:Te,onApproveContent:le?Ae:Fe,onDeleteContent:le?Me:void 0,EditorComponent:de,ViewerComponent:ae},e.contentId)})}))]}))};export{N as ContentSegment,N as default};
2
2
  //# sourceMappingURL=ContentSegment.js.map
@@ -1,2 +1,2 @@
1
- var e={container:"ContentSegment-module_container__pZD9O",header:"ContentSegment-module_header__zzh-M",headerContent:"ContentSegment-module_headerContent__o77O4",headerMeta:"ContentSegment-module_headerMeta__Iv4Wf",headerArtifactId:"ContentSegment-module_headerArtifactId__Gr4B2",headerTitle:"ContentSegment-module_headerTitle__U7nsT",headerToggle:"ContentSegment-module_headerToggle__45got",contentWrapper:"ContentSegment-module_contentWrapper__eIUig"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".ContentSegment-module_container__pZD9O{display:flex;flex-direction:column;font-family:Inter,sans-serif}.ContentSegment-module_header__zzh-M{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-left:none;border-right:none;cursor:pointer;display:flex;flex-direction:row;font-family:Inter,sans-serif;justify-content:space-between;padding:1rem 2rem;position:relative}.ContentSegment-module_headerContent__o77O4{display:flex;flex-direction:column;gap:.5rem}.ContentSegment-module_headerMeta__Iv4Wf{align-items:center;color:#8c8c8c;display:flex;flex-direction:row;gap:8px}.ContentSegment-module_headerArtifactId__Gr4B2{color:#6932e2;font-family:Inter,sans-serif;font-size:14px;font-weight:400;margin:0}.ContentSegment-module_headerTitle__U7nsT{font-family:Inter,sans-serif;font-size:16px;font-weight:600;margin:0}.ContentSegment-module_headerToggle__45got{align-items:center;display:flex;justify-content:center}.ContentSegment-module_contentWrapper__eIUig{display:flex;flex-direction:column;gap:16px;padding:16px 32px}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
1
+ var e={container:"ContentSegment-module_container__pZD9O",header:"ContentSegment-module_header__zzh-M",headerContent:"ContentSegment-module_headerContent__o77O4",headerMeta:"ContentSegment-module_headerMeta__Iv4Wf",headerArtifactId:"ContentSegment-module_headerArtifactId__Gr4B2",headerTitle:"ContentSegment-module_headerTitle__U7nsT",headerToggle:"ContentSegment-module_headerToggle__45got",contentWrapper:"ContentSegment-module_contentWrapper__eIUig",iconButton:"ContentSegment-module_iconButton__0F6ls",menuItemContent:"ContentSegment-module_menuItemContent__39-so",menuItemContentPadded:"ContentSegment-module_menuItemContentPadded__CP7YL"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".ContentSegment-module_container__pZD9O{display:flex;flex-direction:column;font-family:Inter,sans-serif}.ContentSegment-module_header__zzh-M{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-left:none;border-right:none;cursor:pointer;display:flex;flex-direction:row;font-family:Inter,sans-serif;justify-content:space-between;padding:1rem 2rem;position:relative}.ContentSegment-module_headerContent__o77O4{display:flex;flex-direction:column;gap:.5rem}.ContentSegment-module_headerMeta__Iv4Wf{align-items:center;color:#8c8c8c;display:flex;flex-direction:row;gap:8px}.ContentSegment-module_headerArtifactId__Gr4B2{color:#6932e2;font-family:Inter,sans-serif;font-size:14px;font-weight:400;margin:0}.ContentSegment-module_headerTitle__U7nsT{font-family:Inter,sans-serif;font-size:16px;font-weight:600;margin:0}.ContentSegment-module_headerToggle__45got{align-items:center;display:flex;justify-content:center}.ContentSegment-module_contentWrapper__eIUig{display:flex;flex-direction:column;gap:16px;padding:16px 32px}.ContentSegment-module_iconButton__0F6ls{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;display:flex;justify-content:center;margin-left:.5rem;padding:.4rem .8rem}.ContentSegment-module_menuItemContent__39-so{align-items:center;display:flex;flex-direction:row;gap:.5rem;margin-left:.25rem}.ContentSegment-module_menuItemContentPadded__CP7YL{align-items:center;display:flex;flex-direction:row;gap:.5rem;padding-left:.25rem}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
2
2
  //# sourceMappingURL=ContentSegment.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StoryNode.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAoBpH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC,EACF,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,KAAK,CAAC,SAAS,EAAE,CAiDnB;AAED;;GAEG;AACH,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,yBAAyB,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IACxE,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAiRA,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"StoryNode.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAsB1C,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC,EACF,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,KAAK,CAAC,SAAS,EAAE,CA+CnB;AAED;;GAEG;AACH,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,yBAAyB,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IACxE,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAsRA,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -65,10 +65,12 @@ interface StoryCardProps {
65
65
  sectionStatusConfig?: SectionStatusConfig;
66
66
  showCompletionPanel?: boolean;
67
67
  showAddSectionButton?: boolean;
68
+ disableEditPlan?: boolean;
69
+ useMuiTooltip?: boolean;
68
70
  approveButtonConfig?: ApproveButtonConfig;
69
71
  }
70
72
  export declare function replaceLearnedTagsWithInfo(content: string): React.ReactNode[];
71
- export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, _resolvedConfig, showWrapper, defaultExpanded, actionItemsConfig, onDelete, contextVariant, expandedSubFeatures, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, sectionStatusConfig, showCompletionPanel, showAddSectionButton, approveButtonConfig }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
73
+ export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, _resolvedConfig, showWrapper, defaultExpanded, actionItemsConfig, onDelete, contextVariant, expandedSubFeatures, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, sectionStatusConfig, showCompletionPanel, showAddSectionButton, disableEditPlan, useMuiTooltip, approveButtonConfig }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
72
74
  interface IProps {
73
75
  isUserStoryCurrentlyUpdated?: boolean;
74
76
  artifactId: string;
@@ -92,8 +94,10 @@ interface IProps {
92
94
  defaultExpanded?: boolean;
93
95
  showCompletionPanel?: boolean;
94
96
  showAddSectionButton?: boolean;
97
+ disableEditPlan?: boolean;
98
+ useMuiTooltip?: boolean;
95
99
  approveButtonConfig?: ApproveButtonConfig;
96
100
  }
97
- export declare const UserStoryCardWrapper: ({ artifactTitleIDs, expandedSubFeatures, isDiffEditReviewMode, showUserStoryDiff, updateUserStoryArtifact, isUserStoryCurrentlyUpdated, artifactId, handleOpenSendDialog, handleDownloadUserStory, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, showWrapper, actionItemsConfig, contextVariant, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, defaultExpanded, showCompletionPanel, showAddSectionButton, approveButtonConfig }: IProps) => import("react/jsx-runtime").JSX.Element;
101
+ export declare const UserStoryCardWrapper: ({ artifactTitleIDs, expandedSubFeatures, isDiffEditReviewMode, showUserStoryDiff, updateUserStoryArtifact, isUserStoryCurrentlyUpdated, artifactId, handleOpenSendDialog, handleDownloadUserStory, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, showWrapper, actionItemsConfig, contextVariant, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, defaultExpanded, showCompletionPanel, showAddSectionButton, disableEditPlan, useMuiTooltip, approveButtonConfig }: IProps) => import("react/jsx-runtime").JSX.Element;
98
102
  export default StoryCard;
99
103
  //# sourceMappingURL=UserStoryCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AA0B/D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAMlE,OAAQ,EAA8C,mBAAmB,EAAoB,MAAM,8CAA8C,CAAC;AAClJ,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAYzE,UAAU,iBAAiB;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAGD,MAAM,WAAW,oBAAoB;IACjC,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,gBAAgB,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,UAAU,cAAc;IACpB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,gBAAgB,EAAE,UAAU,CAAC;IAC7B,iBAAiB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAEpD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB,EAAE,OAAO,CAAC;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,2CAA2C;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnK,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAC,UAAU,GAAG,QAAQ,CAAC;IACtC,eAAe,CAAC,EAAC,OAAO,CAAC;IACzB,cAAc,CAAC,EAAC,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAC,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAC,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC9B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAG7C;AA+BD,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAwC7E;AAgDD,eAAO,MAAM,SAAS,mmBAkCnB,cAAc,4CA85BhB,CAAC;AAEF,UAAU,MAAM;IACZ,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAG,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACpK,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAC,UAAU,GAAG,QAAQ,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAC,OAAO,CAAC;IACvB,eAAe,CAAC,EAAC,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAG7C;AAED,eAAO,MAAM,oBAAoB,mdAAie,MAAM,4CA0GvgB,CAAA;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AA0B/D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAMlE,OAAQ,EAA8C,mBAAmB,EAAoB,MAAM,8CAA8C,CAAC;AAClJ,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAYzE,UAAU,iBAAiB;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAGD,MAAM,WAAW,oBAAoB;IACjC,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,gBAAgB,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,UAAU,cAAc;IACpB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,gBAAgB,EAAE,UAAU,CAAC;IAC7B,iBAAiB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAEpD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB,EAAE,OAAO,CAAC;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,2CAA2C;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnK,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAC,UAAU,GAAG,QAAQ,CAAC;IACtC,eAAe,CAAC,EAAC,OAAO,CAAC;IACzB,cAAc,CAAC,EAAC,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAC,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAC,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC9B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAG7C;AA+BD,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAwC7E;AAgDD,eAAO,MAAM,SAAS,moBAoCnB,cAAc,4CAs6BhB,CAAC;AAEF,UAAU,MAAM;IACZ,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAG,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACpK,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAC,UAAU,GAAG,QAAQ,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAC,OAAO,CAAC;IACvB,eAAe,CAAC,EAAC,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC7C;AAED,eAAO,MAAM,oBAAoB,mfAAihB,MAAM,4CA4GvjB,CAAA;AAED,eAAe,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { UserStoryApprovalScreenConfig, UserStoryApprovalScreenCallbacks, UserStoryApprovalScreenLabels, UserStoryApprovalScreenClassNames, ApprovalSidebarConfig } from "../../interfaces/userstory.interface";
2
+ import { UserStoryApprovalScreenConfig, UserStoryApprovalScreenCallbacks, UserStoryApprovalScreenLabels, UserStoryApprovalScreenClassNames, ApprovalSidebarConfig, IUserStory } from "../../interfaces/userstory.interface";
3
3
  interface RootProps {
4
4
  /**
5
5
  * Artifact title IDs for each story
@@ -54,11 +54,17 @@ interface ContentProps {
54
54
  pageTitle?: string;
55
55
  /** Page description for accessibility */
56
56
  pageDescription?: string;
57
+ handleDownloadUserStory?: (filetype: "pdf" | "doc") => Promise<void>;
58
+ handleOpenSendDialog?: (sendEmailDialog: boolean, userStoryToSend: IUserStory[], artifactId: string, initSelectedEmails?: string[], autoSendEmail?: boolean) => void;
59
+ showShareIcon?: boolean;
57
60
  }
58
61
  interface BodyProps {
59
62
  children?: React.ReactNode;
60
63
  EditorComponent?: React.ComponentType<any>;
61
64
  ViewerComponent?: React.ComponentType<any>;
65
+ handleDownloadUserStory?: (filetype: "pdf" | "doc") => Promise<void>;
66
+ handleOpenSendDialog?: (sendEmailDialog: boolean, userStoryToSend: IUserStory[], artifactId: string, initSelectedEmails?: string[], autoSendEmail?: boolean) => void;
67
+ showShareIcon?: boolean;
62
68
  }
63
69
  declare const UserStoryApprovalScreen: React.FC<RootProps> & {
64
70
  Sidebar: React.FC<SidebarProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"UserStoryApprovalScreen.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,6BAA6B,EAC7B,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EAEjC,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AA6D9C,UAAU,SAAS;IACjB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,6BAA6B,CAAC;IACvC,mEAAmE;IACnE,SAAS,CAAC,EAAE,gCAAgC,CAAC;IAC7C,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAChD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0BAA0B;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB;IACzB,UAAU,CAAC,EAAE,iCAAiC,CAAC;IAC/C,uDAAuD;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAyOD,UAAU,YAAY;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkCD,UAAU,kBAAkB;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,mDAAmD;IACnD,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2BD,UAAU,YAAY;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wDAAwD;IACxD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAkKD,UAAU,SAAS;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;CAC5C;AA0FD,QAAA,MAAM,uBAAuB;;;;;CAK3B,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"UserStoryApprovalScreen.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,6BAA6B,EAC7B,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EAEjC,qBAAqB,EACrB,UAAU,EACX,MAAM,sCAAsC,CAAC;AA4E9C,UAAU,SAAS;IACjB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,6BAA6B,CAAC;IACvC,mEAAmE;IACnE,SAAS,CAAC,EAAE,gCAAgC,CAAC;IAC7C,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAChD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0BAA0B;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB;IACzB,UAAU,CAAC,EAAE,iCAAiC,CAAC;IAC/C,uDAAuD;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AA2OD,UAAU,YAAY;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkCD,UAAU,kBAAkB;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,mDAAmD;IACnD,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2BD,UAAU,YAAY;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wDAAwD;IACxD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CACrB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,UAAU,EAAE,EAC7B,UAAU,EAAE,MAAM,EAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,aAAa,CAAC,EAAE,OAAO,KACpB,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA2UD,UAAU,SAAS;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CACrB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,UAAU,EAAE,EAC7B,UAAU,EAAE,MAAM,EAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,aAAa,CAAC,EAAE,OAAO,KACpB,IAAI,CAAC;IACV,aAAa,CAAC,EAAC,OAAO,CAAC;CACxB;AAmGD,QAAA,MAAM,uBAAuB;;;;;CAK3B,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { IUserStoryForApproval } from "../../../../interfaces/userstory.interface";
2
+ import { IUserStory, IUserStoryForApproval } from "../../../../interfaces/userstory.interface";
3
3
  export interface ContentSegmentProps {
4
4
  /** User story or sub-feature data */
5
5
  userStoryForApproval: IUserStoryForApproval;
@@ -19,6 +19,9 @@ export interface ContentSegmentProps {
19
19
  EditorComponent?: React.ComponentType<any>;
20
20
  /** Content viewer component */
21
21
  ViewerComponent?: React.ComponentType<any>;
22
+ handleDownloadUserStory?: (filetype: "pdf" | "doc") => Promise<void>;
23
+ handleOpenSendDialog?: (sendEmailDialog: boolean, userStoryToSend: IUserStory[], artifactId: string, initSelectedEmails?: string[], autoSendEmail?: boolean) => void;
24
+ showShareIcon?: boolean;
22
25
  }
23
26
  /**
24
27
  * Content segment component that displays either main story or sub-feature content.
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSegment.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAIrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAQnF,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,oBAAoB,EAAE,qBAAqB,CAAC;IAC5C,oCAAoC;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uDAAuD;IACvD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,CACjB,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,qBAAqB,KACrC,IAAI,CAAC;IACV,oCAAoC;IACpC,kBAAkB,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,yCAAyC;IACzC,sBAAsB,CAAC,EAAE,CAAC,YAAY,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACvE,iCAAiC;IACjC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,+BAA+B;IAC/B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;CAC5C;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwLxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ContentSegment.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/features/RequirementAI/components/userstory-approval-screen/components/ContentSegment/ContentSegment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAI7D,OAAO,EACL,UAAU,EACV,qBAAqB,EACtB,MAAM,4CAA4C,CAAC;AAgBpD,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,oBAAoB,EAAE,qBAAqB,CAAC;IAC5C,oCAAoC;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uDAAuD;IACvD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,CACjB,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,qBAAqB,KACrC,IAAI,CAAC;IACV,oCAAoC;IACpC,kBAAkB,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,yCAAyC;IACzC,sBAAsB,CAAC,EAAE,CAAC,YAAY,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACvE,iCAAiC;IACjC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,+BAA+B;IAC/B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAE3C,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CACrB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,UAAU,EAAE,EAC7B,UAAU,EAAE,MAAM,EAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,aAAa,CAAC,EAAE,OAAO,KACpB,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwYxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/requirement-ai",
3
- "version": "0.0.207",
3
+ "version": "0.0.208",
4
4
  "author": "Saptyadeep Bhattacharjee",
5
5
  "description": "",
6
6
  "license": "MIT",