@e-llm-studio/requirement-ai 0.0.173 → 0.0.174

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 (27) hide show
  1. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  2. package/dist/cjs/features/RequirementAI/components/cra/PartialRequirementContent.js +1 -1
  3. package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
  4. package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  5. package/dist/cjs/features/RequirementAI/components/story-screen/SubfeatureBlock.js +1 -1
  6. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  7. package/dist/cjs/features/RequirementAI/store/markdown-context.js +2 -0
  8. package/dist/cjs/features/RequirementAI/store/markdown-context.js.map +1 -0
  9. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  10. package/dist/features/RequirementAI/components/cra/PartialRequirementContent.js +1 -1
  11. package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
  12. package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  13. package/dist/features/RequirementAI/components/story-screen/SubfeatureBlock.js +1 -1
  14. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  15. package/dist/features/RequirementAI/store/markdown-context.js +2 -0
  16. package/dist/features/RequirementAI/store/markdown-context.js.map +1 -0
  17. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +1 -3
  18. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  19. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +1 -0
  20. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
  21. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts +2 -1
  22. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
  23. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +1 -3
  24. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  25. package/dist/types/src/features/RequirementAI/store/markdown-context.d.ts +17 -0
  26. package/dist/types/src/features/RequirementAI/store/markdown-context.d.ts.map +1 -0
  27. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),i=require("showdown"),l=require("@mui/material"),o=require("uuid"),r=require("./UserStoryCard.module.css.js"),a=require("../../utils/helpers.js"),u=require("../../utils/user-story.utils.js"),d=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),_=require("../story-screen/BigEnoughPanel.js"),g=require("./TitleEditor/TitleEditor.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=y(i);function m(n){for(var i,r=[],a=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(i=a.exec(n));){var c=i[1],f=i.index;f>u&&r.push(t.jsx("span",{children:n.slice(u,f)},"text-pre-".concat(d++))),r.push(t.jsx(l.Tooltip,e.__assign({title:c,placement:"top"},{children:t.jsx(s.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(o.v4()))),u=a.lastIndex}return u<(null==n?void 0:n.length)&&r.push(t.jsx("span",{children:n.slice(u)},"text-post-".concat(d++))),r}function p(t,n,s){var i;if(!t)return{};if(n)return e.__assign({},t.parentConfig);var l=e.__assign({},t.childConfig);return s&&(null===(i=t.subFeatureOverrides)||void 0===i?void 0:i[s])?e.__assign(e.__assign({},l),t.subFeatureOverrides[s]):l}var S=function(n){var i,l=n.displayName,o=v.useRequirementAI().customStyles,a=null===(i=null==o?void 0:o.userStoryCardStyles)||void 0===i?void 0:i.showDisplayName;return t.jsxs("div",e.__assign({className:r.default.displayName,style:null==a?void 0:a.wrapper},{children:[t.jsx(s.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,":"]}))]}))},x=function(i){var y,C,I,j,w,b,N,B=i.isUserStoryCurrentlyUpdated,D=i.artifactId,U=i.artifactTitleId,k=i.parentUserStory,E=i.currentUserStory,M=i.onUserStoryChange,A=i.parentIndex,T=i.currentIndex,q=i.enableDownload,P=i.isDiffEditReviewMode,R=i.showUserStoryDiff,L=i.handleDownloadUserStory,H=i.handleOpenSendDialog,W=i.updateUserStoryArtifact,z=i.selectedArtifactId,O=i.isDisplayHighlightControl,F=i.elementDisplayConfig,V=i._resolvedConfig,G=i.showWrapper,Q=void 0!==G&&G,Z=i.segmentComponentConfig,J=i.actionItemsConfig,K=i.onDelete,X=v.useRequirementAI(),Y=X.searchQueryList,$=X.citations,ee=X.customStyles,te=null==ee?void 0:ee.userStoryCardStyles,ne=null===(y=null==ee?void 0:ee.userStoryCardStyles)||void 0===y?void 0:y.userStoryEditStyles,se=null===(C=null==ee?void 0:ee.userStoryScreenStyles)||void 0===C?void 0:C.userStoryContentStyles,ie=null==te?void 0:te.progressHeaderStyles,le=n.useState(e.__assign(e.__assign({},structuredClone(E)),{value:a.formatMarkdown(E.value)||""})),oe=le[0],re=le[1],ae=n.useState({userStory:!!E.isDefaultEdit}),ue=ae[0],de=ae[1],ce=n.useState(!1),fe=ce[0],ve=ce[1],_e=n.useState(null),ge=_e[0],ye=_e[1],he=v.useRequirementAI(),me=he.userStory,pe=he.customIcons,Se=n.useState(""===A||z===E.artifactId||!!E.isDefaultOpen),xe=Se[0],Ce=Se[1],Ie=n.useState(!1);Ie[0];var je=Ie[1],we=n.useState(null),be=we[0],Ne=we[1],Be=n.useState(null),De=Be[0],Ue=Be[1],ke=n.useState(!1),Ee=ke[0],Me=ke[1],Ae=n.useRef(null),Te=n.useState(!1);Te[0];var qe=Te[1],Pe=n.useRef(null);n.useEffect(function(){B&&Ce(B)},[B]),n.useEffect(function(){re(e.__assign(e.__assign({},structuredClone(E)),{value:a.formatMarkdown(E.value)||""}))},[E]),n.useEffect(function(){Y.length>0?Ce(!0):z&&Ce(z===E.artifactId)},[Y,z,E.artifactId]);var Re=function(){Ne(null)},Le=function(){Ue(null)},He=function(){Ce(function(e){return!e})};var We=null!=(null==E?void 0:E.big_enough)&&!Number.isNaN(E.big_enough)&&!!(null==E?void 0:E.big_enough_decision_factors),ze=""===A,Oe=null!=V?V:p(F,ze),Fe=!P&&!R;return n.useEffect(function(){if(ge){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(ge));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[ge]),n.useEffect(function(){E.isDefaultEdit&&de(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})},[E.isDefaultEdit]),t.jsxs("div",e.__assign({className:r.default.card,style:null==te?void 0:te.cardStyle,id:"story-card-".concat(E.title),"data-expanded":xe},{children:[t.jsxs("div",e.__assign({className:r.default.titleSection,style:null==te?void 0:te.titleSection},{children:[t.jsxs("div",e.__assign({className:r.default.titleRow,style:null==te?void 0:te.titleRow,onClick:He},{children:[t.jsxs("div",e.__assign({className:r.default.titleLeft,style:null==te?void 0:te.titleLeft,onMouseEnter:function(){return qe(!0)},onMouseLeave:function(){return qe(!1)}},{children:[t.jsx(S,{displayName:U}),fe&&Fe?t.jsx(g.InlineTitleEditor,{title:E.title,onSave:function(t){return function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var s,i;return e.__generator(this,function(l){try{s=e.__assign({},E),E.artifactId===n?s.title=t:s.sub_features=(null===(i=E.sub_features)||void 0===i?void 0:i.map(function(s){return s.artifactId===n?e.__assign(e.__assign({},s),{title:t}):s}))||[],re(s),M(s),ve(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(t,E.artifactId)},onCancel:function(){ve(!1)},inputStyle:null==ne?void 0:ne.inlineTitleInput,confirmButtonStyle:null==ne?void 0:ne.inlineTitleConfirm,cancelButtonStyle:null==ne?void 0:ne.inlineTitleCancel},"inline-title-editor"):t.jsxs("div",e.__assign({className:r.default.storyTitleWrapper},{children:[t.jsx("h2",e.__assign({title:E.title,className:r.default.storyTitle,style:null==te?void 0:te.storyTitle},{children:m(E.title)}),E.artifactId),t.jsx("button",e.__assign({type:"button",className:r.default.titleEditButton,style:null==ne?void 0:ne.titleEditButton,onClick:function(e){e.stopPropagation(),ve(!0),xe||Ce(!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"})}))}))]}))]})),t.jsxs("div",e.__assign({className:r.default.titleActions,style:null==te?void 0:te.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(Oe.showProgressPercentage||Oe.showGapBox)&&Q&&t.jsxs("div",e.__assign({className:r.default.progressHeader,style:null==ie?void 0:ie.wrapper},{children:[Oe.showProgressPercentage&&t.jsxs("div",e.__assign({className:r.default.progressPercentage,style:null==ie?void 0:ie.percentage},{children:[null!==(j=null!==(I=null==E?void 0:E.confidenceScore)&&void 0!==I?I:null==Oe?void 0:Oe.confidenceValue)&&void 0!==j?j:"0","%"]})),Oe.showGapBox&&t.jsxs("div",e.__assign({className:r.default.gapBox,style:null==ie?void 0:ie.gapBox},{children:[null!==(b=null!==(w=null==E?void 0:E.gapValue)&&void 0!==w?w:null==Oe?void 0:Oe.gapBoxValue)&&void 0!==b?b:"2"," ","Gaps"]}))]})),We&&t.jsx(_.BigEnoughPanel,{customIcons:null==pe?void 0:pe.userStoryIcons,customStyles:null==te?void 0:te.aiReasoningCitaionStyles,currentUserStory:E,panelStyles:null==te?void 0:te.BigEnoughStyles}),!ue.userStory&&t.jsxs(t.Fragment,{children:[!1!==(null==Oe?void 0:Oe.showShareButton)&&t.jsx("button",e.__assign({className:r.default.iconButton,style:null==te?void 0:te.iconButton,onClick:function(e){Ne(e.currentTarget)}},{children:t.jsx(s.ExternalLink,{size:16})})),t.jsxs(l.Menu,e.__assign({id:"user-story-share-menu",anchorEl:be,open:!!be,onClose:function(){return Ne(null)},style:null==te?void 0:te.userStoryShareMenu},{children:[q&&t.jsx(l.MenuItem,e.__assign({style:null==te?void 0:te.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 je(!0),L?[4,Promise.all([L("pdf"),L("doc")])]:[2];case 1:return e.sent(),je(!1),[2]}})})}},{children:t.jsxs("div",e.__assign({ref:Ae,className:r.default.menuItemContent,style:null==te?void 0:te.menuItemContent},{children:[t.jsx(s.Download,{size:16,color:null==te?void 0:te.menuIconColor}),t.jsx("p",e.__assign({style:null==te?void 0:te.menuLabel},{children:"Download"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==te?void 0:te.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){return t=E,k&&(t=e.__assign(e.__assign({},E),{value:"".concat(u.replaceTitleSection(null==k?void 0:k.value,E.title)," \n").concat(E.value)})),null==H||H(!0,[t],E.artifactId),Re(),[2]})})}},{children:t.jsxs("div",e.__assign({style:null==te?void 0:te.menuItemContent,className:r.default.menuItemContentPadded},{children:[t.jsx(s.Share2,{size:16,color:null==te?void 0:te.menuIconColor}),t.jsx("p",e.__assign({style:null==te?void 0:te.menuLabel},{children:"Send"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==te?void 0:te.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,s,i,l;return e.__generator(this,function(e){switch(e.label){case 0:t=new h.default.Converter,n=t.makeHtml(a.formatMarkdown(E.value)||E.value),s=function(e){var t=(new h.default.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(a.formatMarkdown(E.value)||E.value),i=new ClipboardItem({"text/plain":new Blob([s],{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([i])];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 Re(),[7];case 5:return[2]}})})}},{children:t.jsxs("div",e.__assign({style:null==te?void 0:te.menuItemContent,className:r.default.menuItemContentPadded},{children:[t.jsx(s.Copy,{size:16,color:null==te?void 0:te.menuIconColor}),t.jsx("p",e.__assign({style:null==te?void 0:te.menuLabel},{children:"Copy"}))]}))}))]}))]}),ue.userStory&&xe?t.jsx(d.default,{type:"outline",children:"Cancel",style:null==te?void 0:te.cancelButton,onClick:function(){var t;null===(t=Pe.current)||void 0===t||t.abort(),de(function(t){return e.__assign(e.__assign({},t),{userStory:!1})})}}):t.jsx(t.Fragment,{}),ue.userStory&&xe?t.jsx(d.default,{type:"fill",children:Ee?t.jsxs("span",e.__assign({className:r.default.savingSpinner,style:null==te?void 0:te.savingSpinner},{children:[t.jsx(s.LoaderCircle,{className:r.default.spinAnimation,style:null==te?void 0:te.spinAnimation}),t.jsx("span",{children:"Saving..."})]})):"Save",isDisable:Ee,style:Ee?null==te?void 0:te.savingButton:null==te?void 0:te.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 Me(!0),"userStory"==="userStory"&&(M(oe),console.log("I am changing RTE editor values",oe)),[4,W($,me,D,null===(t=Pe.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),M(e.__assign(e.__assign({},oe),{isDefaultEdit:!1})),de(function(t){return e.__assign(e.__assign({},t),{userStory:!1})}),Me(!1),[2]}})})}}):!P&&!R&&xe&&!1!==(null==Oe?void 0:Oe.showEditButton)&&t.jsx("button",e.__assign({className:r.default.iconButton,style:null==te?void 0:te.editButton,onClick:function(){return de(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})}},{children:t.jsx(s.PencilIcon,{color:null==te?void 0:te.pencilIconColor,size:16})})),ze&&xe&&!P&&!R&&!1!==(null==Oe?void 0:Oe.showEditButton)&&t.jsxs("button",e.__assign({type:"button",className:r.default.addSectionButton,style:null==ne?void 0:ne.addSectionButton,onClick:function(t){var n,s,i;t.stopPropagation();var l=(null!==(s=null===(n=E.sub_features)||void 0===n?void 0:n.length)&&void 0!==s?s:0)+1,r={artifactId:o.v4(),title:"New Section ".concat(l),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a=e.__assign(e.__assign({},E),{sub_features:e.__spreadArray(e.__spreadArray([],null!==(i=E.sub_features)&&void 0!==i?i:[],!0),[r],!1)});re(a),M(a),Ce(!0),ye(r.title)},"aria-label":"Add section",title:"Add section"},{children:[t.jsx(s.Plus,{size:14}),t.jsx("span",e.__assign({className:r.default.addSectionLabel},{children:"Add Section"}))]})),!ze&&!P&&!R&&t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==K||K()},className:r.default.iconButton,style:null==ne?void 0:ne.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:t.jsx(s.Trash2,{size:16})})),(null==Oe?void 0:Oe.actionItemsButton)&&t.jsxs(t.Fragment,{children:[t.jsx("span",e.__assign({className:r.default.actionItemBtn,style:null==te?void 0:te.actionItemBtn,onClick:function(e){e.stopPropagation(),Ue(e.currentTarget)}},{children:t.jsx(s.Ellipsis,{})})),t.jsx(l.Menu,e.__assign({id:"user-story-action-menu",anchorEl:De,open:!!De,onClose:Le,style:null==te?void 0:te.userStoryShareMenu},{children:null==J?void 0:J.items.map(function(n,s){return t.jsx(l.MenuItem,e.__assign({style:null==te?void 0:te.userStoryMenuItem,onClick:function(){n.onclick(),Le()}},{children:t.jsxs("div",e.__assign({className:r.default.menuItemContent,style:e.__assign(e.__assign({},null==te?void 0:te.menuItemContent),!n.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[t.jsx("span",e.__assign({className:r.default.menuItemIcon,style:null==te?void 0:te.menuItemIcon},{children:n.icon})),t.jsx("p",e.__assign({style:null==te?void 0:te.menuLabel},{children:n.name})),t.jsx("span",{className:r.default.menuItemRight,style:null==te?void 0:te.menuItemRight})]}))}),"action-item-".concat(s,"-").concat(n.name))})}))]}),t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),He()},style:null==te?void 0:te.chevronButton,className:r.default.chevronButton},{children:xe?t.jsx(s.ChevronUp,{className:r.default.chevronIcon,color:null==te?void 0:te.chevronIconColor}):t.jsx(s.ChevronDown,{className:r.default.chevronIcon,color:null==te?void 0:te.chevronIconColor})}))]}))]})),t.jsx("div",{className:r.default.divider,style:null==te?void 0:te.dividerStyle})]})),xe&&t.jsx("div",e.__assign({className:r.default.cardContent,style:null==te?void 0:te.cardContentStyle},{children:t.jsxs("div",e.__assign({className:r.default.contentInner,style:null==te?void 0:te.contentInner},{children:[t.jsxs("div",e.__assign({className:r.default.descriptionSection,style:null==te?void 0:te.descriptionSection},{children:[t.jsx("div",{className:r.default.justifyBetween,style:null==te?void 0:te.justifyBetween}),ue.userStory?t.jsx(c.default,{minHeight:"100%",height:"100%",type:"string",value:a.formatMarkdown(E.value)||"",handleUpdateState:function(t,n){var s=a.indentMarkdown(n);re(function(t){return e.__assign(e.__assign({},t),{value:s||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:ue.userStory?"edit":"readOnly"}):t.jsx(f.default,{showUserStoryDiff:R,isParent:""===A,message:a.formatMarkdown(E.value)||"",artifactId:E.artifactId,customStyles:se,isDisplayHighlightControl:O,segmentComponentConfig:Z})]})),null===(N=oe.sub_features)||void 0===N?void 0:N.map(function(n,s){var i=p(F,!1,n.artifactId);return t.jsx(x,{artifactId:D,isUserStoryCurrentlyUpdated:B,artifactTitleId:"".concat(U,"-").concat(String.fromCharCode(65+s)),parentUserStory:E,parentIndex:"".concat(A).concat(A&&".").concat(T),currentIndex:"".concat(s+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(t){return function(t,n){var s=e.__spreadArray([],E.sub_features||[],!0);s[t]=n,M(e.__assign(e.__assign({},E),{sub_features:s}))}(s,t)},enableDownload:!0,isDiffEditReviewMode:P,showUserStoryDiff:R,updateUserStoryArtifact:W,handleDownloadUserStory:L,handleOpenSendDialog:H,isDisplayHighlightControl:O,elementDisplayConfig:F,_resolvedConfig:i,segmentComponentConfig:Z,actionItemsConfig:J,onDelete:function(){return function(t){var n=(E.sub_features||[]).filter(function(e,n){return n!==t}),s=e.__assign(e.__assign({},E),{sub_features:n});re(s),M(s)}(s)}},n.artifactId)})]}))}))]}))};exports.StoryCard=x,exports.UserStoryCardWrapper=function(n){var i=n.artifactTitleIDs,l=n.isDiffEditReviewMode,o=n.showUserStoryDiff,a=n.updateUserStoryArtifact,u=n.isUserStoryCurrentlyUpdated,d=n.artifactId,c=n.handleOpenSendDialog,f=n.handleDownloadUserStory,_=n.selectedArtifactId,g=n.isDisplayHighlightControl,y=n.elementDisplayConfig,h=n.showWrapper,m=n.actionItemsConfig,S=v.useRequirementAI(),C=S.userStory,I=S.setUserStory,j=S.customStyles,w=S.searchQueryList,b=S.currentHighlightIndex,N=S.setCurrentHighlightIndex,B=S.segmentComponentConfig,D=null==j?void 0:j.userStoryCardStyles,U=0===b,k=b===w.length-1;return t.jsxs("div",e.__assign({className:r.default.userStoryCardWrapper,style:g?e.__assign(e.__assign({},null==D?void 0:D.userStoryCardWrapper),{position:"relative"}):null==D?void 0:D.userStoryCardWrapper},{children:[g&&t.jsx(t.Fragment,{children:w.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:[b+1," of ",w.length]})),t.jsxs("div",e.__assign({className:r.default.navButtons},{children:[t.jsx("button",e.__assign({onClick:function(){b>0&&N(function(e){return e-1})},className:r.default.navButton,disabled:U},{children:t.jsx(s.ChevronUpIcon,{size:20,className:r.default.navIcon})})),t.jsx("button",e.__assign({onClick:function(){b<w.length-1&&N(function(e){return e+1})},className:r.default.navButton,disabled:k},{children:t.jsx(s.ChevronDownIcon,{size:20,className:r.default.navIcon})}))]}))]}))}))}))}),C.map(function(n,s){var r=p(y,!0);return t.jsx(x,{isUserStoryCurrentlyUpdated:u,artifactId:d,artifactTitleId:i[s]||"",currentUserStory:n,onUserStoryChange:function(t){I(function(n){return n[s]=t,e.__spreadArray([],n,!0)})},parentIndex:"",currentIndex:"".concat(s+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:l,showUserStoryDiff:o,updateUserStoryArtifact:a,handleOpenSendDialog:c,handleDownloadUserStory:f,selectedArtifactId:_,isDisplayHighlightControl:g,elementDisplayConfig:y,_resolvedConfig:r,showWrapper:h,segmentComponentConfig:B,actionItemsConfig:m},n.artifactId)})]}))},exports.default=x,exports.replaceLearnedTagsWithInfo=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),i=require("showdown"),l=require("@mui/material"),r=require("uuid"),o=require("./UserStoryCard.module.css.js"),a=require("../../utils/helpers.js"),u=require("../../utils/user-story.utils.js"),d=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),_=require("../story-screen/BigEnoughPanel.js"),g=require("./TitleEditor/TitleEditor.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=y(i);function m(n){for(var i,o=[],a=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(i=a.exec(n));){var c=i[1],f=i.index;f>u&&o.push(t.jsx("span",{children:n.slice(u,f)},"text-pre-".concat(d++))),o.push(t.jsx(l.Tooltip,e.__assign({title:c,placement:"top"},{children:t.jsx(s.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(r.v4()))),u=a.lastIndex}return u<(null==n?void 0:n.length)&&o.push(t.jsx("span",{children:n.slice(u)},"text-post-".concat(d++))),o}function p(t,n,s){var i;if(!t)return{};if(n)return e.__assign({},t.parentConfig);var l=e.__assign({},t.childConfig);return s&&(null===(i=t.subFeatureOverrides)||void 0===i?void 0:i[s])?e.__assign(e.__assign({},l),t.subFeatureOverrides[s]):l}var S=function(n){var i,l=n.displayName,r=v.useRequirementAI().customStyles,a=null===(i=null==r?void 0:r.userStoryCardStyles)||void 0===i?void 0:i.showDisplayName;return t.jsxs("div",e.__assign({className:o.default.displayName,style:null==a?void 0:a.wrapper},{children:[t.jsx(s.Bookmark,{className:o.default.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),t.jsxs("span",e.__assign({style:null==a?void 0:a.label},{children:[l,":"]}))]}))},x=function(i){var y,C,I,j,w,b,N,B=i.isUserStoryCurrentlyUpdated,D=i.artifactId,U=i.artifactTitleId,k=i.parentUserStory,E=i.currentUserStory,M=i.onUserStoryChange,A=i.parentIndex,T=i.currentIndex,q=i.enableDownload,P=i.isDiffEditReviewMode,R=i.showUserStoryDiff,L=i.handleDownloadUserStory,H=i.handleOpenSendDialog,W=i.updateUserStoryArtifact,z=i.selectedArtifactId,O=i.isDisplayHighlightControl,F=i.elementDisplayConfig,V=i._resolvedConfig,G=i.showWrapper,Q=void 0!==G&&G,Z=i.actionItemsConfig,J=i.onDelete,K=v.useRequirementAI(),X=K.searchQueryList,Y=K.citations,$=K.customStyles,ee=null==$?void 0:$.userStoryCardStyles,te=null===(y=null==$?void 0:$.userStoryCardStyles)||void 0===y?void 0:y.userStoryEditStyles,ne=null===(C=null==$?void 0:$.userStoryScreenStyles)||void 0===C?void 0:C.userStoryContentStyles,se=null==ee?void 0:ee.progressHeaderStyles,ie=n.useState(e.__assign(e.__assign({},structuredClone(E)),{value:a.formatMarkdown(E.value)||""})),le=ie[0],re=ie[1],oe=n.useState({userStory:!!E.isDefaultEdit}),ae=oe[0],ue=oe[1],de=n.useState(!1),ce=de[0],fe=de[1],ve=n.useState(null),_e=ve[0],ge=ve[1],ye=v.useRequirementAI(),he=ye.userStory,me=ye.customIcons,pe=n.useState(""===A||z===E.artifactId||!!E.isDefaultOpen),Se=pe[0],xe=pe[1],Ce=n.useState(!1);Ce[0];var Ie=Ce[1],je=n.useState(null),we=je[0],be=je[1],Ne=n.useState(null),Be=Ne[0],De=Ne[1],Ue=n.useState(!1),ke=Ue[0],Ee=Ue[1],Me=n.useRef(null),Ae=n.useState(!1);Ae[0];var Te=Ae[1],qe=n.useRef(null);n.useEffect(function(){B&&xe(B)},[B]),n.useEffect(function(){re(e.__assign(e.__assign({},structuredClone(E)),{value:a.formatMarkdown(E.value)||""}))},[E]),n.useEffect(function(){X.length>0?xe(!0):z&&xe(z===E.artifactId)},[X,z,E.artifactId]);var Pe=function(){be(null)},Re=function(){De(null)},Le=function(){xe(function(e){return!e})};var He=null!=(null==E?void 0:E.big_enough)&&!Number.isNaN(E.big_enough)&&!!(null==E?void 0:E.big_enough_decision_factors),We=""===A,ze=null!=V?V:p(F,We),Oe=!P&&!R;return n.useEffect(function(){if(_e){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(_e));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[_e]),n.useEffect(function(){E.isDefaultEdit&&ue(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})},[E.isDefaultEdit]),t.jsxs("div",e.__assign({className:o.default.card,style:null==ee?void 0:ee.cardStyle,id:"story-card-".concat(E.title),"data-expanded":Se},{children:[t.jsxs("div",e.__assign({className:o.default.titleSection,style:null==ee?void 0:ee.titleSection},{children:[t.jsxs("div",e.__assign({className:o.default.titleRow,style:null==ee?void 0:ee.titleRow,onClick:Le},{children:[t.jsxs("div",e.__assign({className:o.default.titleLeft,style:null==ee?void 0:ee.titleLeft,onMouseEnter:function(){return Te(!0)},onMouseLeave:function(){return Te(!1)}},{children:[t.jsx(S,{displayName:U}),ce&&Oe?t.jsx(g.InlineTitleEditor,{title:E.title,onSave:function(t){return function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var s,i;return e.__generator(this,function(l){try{s=e.__assign({},E),E.artifactId===n?s.title=t:s.sub_features=(null===(i=E.sub_features)||void 0===i?void 0:i.map(function(s){return s.artifactId===n?e.__assign(e.__assign({},s),{title:t}):s}))||[],re(s),M(s),fe(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(t,E.artifactId)},onCancel:function(){fe(!1)},inputStyle:null==te?void 0:te.inlineTitleInput,confirmButtonStyle:null==te?void 0:te.inlineTitleConfirm,cancelButtonStyle:null==te?void 0:te.inlineTitleCancel},"inline-title-editor"):t.jsxs("div",e.__assign({className:o.default.storyTitleWrapper},{children:[t.jsx("h2",e.__assign({title:E.title,className:o.default.storyTitle,style:null==ee?void 0:ee.storyTitle},{children:m(E.title)}),E.artifactId),t.jsx("button",e.__assign({type:"button",className:o.default.titleEditButton,style:null==te?void 0:te.titleEditButton,onClick:function(e){e.stopPropagation(),fe(!0),Se||xe(!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"})}))}))]}))]})),t.jsxs("div",e.__assign({className:o.default.titleActions,style:null==ee?void 0:ee.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(ze.showProgressPercentage||ze.showGapBox)&&Q&&t.jsxs("div",e.__assign({className:o.default.progressHeader,style:null==se?void 0:se.wrapper},{children:[ze.showProgressPercentage&&t.jsxs("div",e.__assign({className:o.default.progressPercentage,style:null==se?void 0:se.percentage},{children:[null!==(j=null!==(I=null==E?void 0:E.confidenceScore)&&void 0!==I?I:null==ze?void 0:ze.confidenceValue)&&void 0!==j?j:"0","%"]})),ze.showGapBox&&t.jsxs("div",e.__assign({className:o.default.gapBox,style:null==se?void 0:se.gapBox},{children:[null!==(b=null!==(w=null==E?void 0:E.gapValue)&&void 0!==w?w:null==ze?void 0:ze.gapBoxValue)&&void 0!==b?b:"2"," ","Gaps"]}))]})),He&&t.jsx(_.BigEnoughPanel,{customIcons:null==me?void 0:me.userStoryIcons,customStyles:null==ee?void 0:ee.aiReasoningCitaionStyles,currentUserStory:E,panelStyles:null==ee?void 0:ee.BigEnoughStyles}),!ae.userStory&&t.jsxs(t.Fragment,{children:[!1!==(null==ze?void 0:ze.showShareButton)&&t.jsx("button",e.__assign({className:o.default.iconButton,style:null==ee?void 0:ee.iconButton,onClick:function(e){be(e.currentTarget)}},{children:t.jsx(s.ExternalLink,{size:16})})),t.jsxs(l.Menu,e.__assign({id:"user-story-share-menu",anchorEl:we,open:!!we,onClose:function(){return be(null)},style:null==ee?void 0:ee.userStoryShareMenu},{children:[q&&t.jsx(l.MenuItem,e.__assign({style:null==ee?void 0:ee.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 Ie(!0),L?[4,Promise.all([L("pdf"),L("doc")])]:[2];case 1:return e.sent(),Ie(!1),[2]}})})}},{children:t.jsxs("div",e.__assign({ref:Me,className:o.default.menuItemContent,style:null==ee?void 0:ee.menuItemContent},{children:[t.jsx(s.Download,{size:16,color:null==ee?void 0:ee.menuIconColor}),t.jsx("p",e.__assign({style:null==ee?void 0:ee.menuLabel},{children:"Download"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){return t=E,k&&(t=e.__assign(e.__assign({},E),{value:"".concat(u.replaceTitleSection(null==k?void 0:k.value,E.title)," \n").concat(E.value)})),null==H||H(!0,[t],E.artifactId),Pe(),[2]})})}},{children:t.jsxs("div",e.__assign({style:null==ee?void 0:ee.menuItemContent,className:o.default.menuItemContentPadded},{children:[t.jsx(s.Share2,{size:16,color:null==ee?void 0:ee.menuIconColor}),t.jsx("p",e.__assign({style:null==ee?void 0:ee.menuLabel},{children:"Send"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,s,i,l;return e.__generator(this,function(e){switch(e.label){case 0:t=new h.default.Converter,n=t.makeHtml(a.formatMarkdown(E.value)||E.value),s=function(e){var t=(new h.default.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(a.formatMarkdown(E.value)||E.value),i=new ClipboardItem({"text/plain":new Blob([s],{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([i])];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 Pe(),[7];case 5:return[2]}})})}},{children:t.jsxs("div",e.__assign({style:null==ee?void 0:ee.menuItemContent,className:o.default.menuItemContentPadded},{children:[t.jsx(s.Copy,{size:16,color:null==ee?void 0:ee.menuIconColor}),t.jsx("p",e.__assign({style:null==ee?void 0:ee.menuLabel},{children:"Copy"}))]}))}))]}))]}),ae.userStory&&Se?t.jsx(d.default,{type:"outline",children:"Cancel",style:null==ee?void 0:ee.cancelButton,onClick:function(){var t;null===(t=qe.current)||void 0===t||t.abort(),ue(function(t){return e.__assign(e.__assign({},t),{userStory:!1})})}}):t.jsx(t.Fragment,{}),ae.userStory&&Se?t.jsx(d.default,{type:"fill",children:ke?t.jsxs("span",e.__assign({className:o.default.savingSpinner,style:null==ee?void 0:ee.savingSpinner},{children:[t.jsx(s.LoaderCircle,{className:o.default.spinAnimation,style:null==ee?void 0:ee.spinAnimation}),t.jsx("span",{children:"Saving..."})]})):"Save",isDisable:ke,style:ke?null==ee?void 0:ee.savingButton:null==ee?void 0:ee.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 Ee(!0),"userStory"==="userStory"&&(M(le),console.log("I am changing RTE editor values",le)),[4,W(Y,he,D,null===(t=qe.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),M(e.__assign(e.__assign({},le),{isDefaultEdit:!1})),ue(function(t){return e.__assign(e.__assign({},t),{userStory:!1})}),Ee(!1),[2]}})})}}):!P&&!R&&Se&&!1!==(null==ze?void 0:ze.showEditButton)&&t.jsx("button",e.__assign({className:o.default.iconButton,style:null==ee?void 0:ee.editButton,onClick:function(){return ue(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})}},{children:t.jsx(s.PencilIcon,{color:null==ee?void 0:ee.pencilIconColor,size:16})})),We&&Se&&!P&&!R&&!1!==(null==ze?void 0:ze.showEditButton)&&t.jsxs("button",e.__assign({type:"button",className:o.default.addSectionButton,style:null==te?void 0:te.addSectionButton,onClick:function(t){var n,s,i;t.stopPropagation();var l=(null!==(s=null===(n=E.sub_features)||void 0===n?void 0:n.length)&&void 0!==s?s:0)+1,o={artifactId:r.v4(),title:"New Section ".concat(l),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a=e.__assign(e.__assign({},E),{sub_features:e.__spreadArray(e.__spreadArray([],null!==(i=E.sub_features)&&void 0!==i?i:[],!0),[o],!1)});re(a),M(a),xe(!0),ge(o.title)},"aria-label":"Add section",title:"Add section"},{children:[t.jsx(s.Plus,{size:14}),t.jsx("span",e.__assign({className:o.default.addSectionLabel},{children:"Add Section"}))]})),!We&&!P&&!R&&t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==J||J()},className:o.default.iconButton,style:null==te?void 0:te.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:t.jsx(s.Trash2,{size:16})})),(null==ze?void 0:ze.actionItemsButton)&&t.jsxs(t.Fragment,{children:[t.jsx("span",e.__assign({className:o.default.actionItemBtn,style:null==ee?void 0:ee.actionItemBtn,onClick:function(e){e.stopPropagation(),De(e.currentTarget)}},{children:t.jsx(s.Ellipsis,{})})),t.jsx(l.Menu,e.__assign({id:"user-story-action-menu",anchorEl:Be,open:!!Be,onClose:Re,style:null==ee?void 0:ee.userStoryShareMenu},{children:null==Z?void 0:Z.items.map(function(n,s){return t.jsx(l.MenuItem,e.__assign({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){n.onclick(),Re()}},{children:t.jsxs("div",e.__assign({className:o.default.menuItemContent,style:e.__assign(e.__assign({},null==ee?void 0:ee.menuItemContent),!n.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[t.jsx("span",e.__assign({className:o.default.menuItemIcon,style:null==ee?void 0:ee.menuItemIcon},{children:n.icon})),t.jsx("p",e.__assign({style:null==ee?void 0:ee.menuLabel},{children:n.name})),t.jsx("span",{className:o.default.menuItemRight,style:null==ee?void 0:ee.menuItemRight})]}))}),"action-item-".concat(s,"-").concat(n.name))})}))]}),t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),Le()},style:null==ee?void 0:ee.chevronButton,className:o.default.chevronButton},{children:Se?t.jsx(s.ChevronUp,{className:o.default.chevronIcon,color:null==ee?void 0:ee.chevronIconColor}):t.jsx(s.ChevronDown,{className:o.default.chevronIcon,color:null==ee?void 0:ee.chevronIconColor})}))]}))]})),t.jsx("div",{className:o.default.divider,style:null==ee?void 0:ee.dividerStyle})]})),Se&&t.jsx("div",e.__assign({className:o.default.cardContent,style:null==ee?void 0:ee.cardContentStyle},{children:t.jsxs("div",e.__assign({className:o.default.contentInner,style:null==ee?void 0:ee.contentInner},{children:[t.jsxs("div",e.__assign({className:o.default.descriptionSection,style:null==ee?void 0:ee.descriptionSection},{children:[t.jsx("div",{className:o.default.justifyBetween,style:null==ee?void 0:ee.justifyBetween}),ae.userStory?t.jsx(c.default,{minHeight:"100%",height:"100%",type:"string",value:a.formatMarkdown(E.value)||"",handleUpdateState:function(t,n){var s=a.indentMarkdown(n);re(function(t){return e.__assign(e.__assign({},t),{value:s||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:ae.userStory?"edit":"readOnly"}):t.jsx(f.default,{showUserStoryDiff:R,isParent:""===A,message:a.formatMarkdown(E.value)||"",artifactId:E.artifactId,customStyles:ne,isDisplayHighlightControl:O})]})),null===(N=le.sub_features)||void 0===N?void 0:N.map(function(n,s){var i=p(F,!1,n.artifactId);return t.jsx(x,{artifactId:D,isUserStoryCurrentlyUpdated:B,artifactTitleId:"".concat(U,"-").concat(String.fromCharCode(65+s)),parentUserStory:E,parentIndex:"".concat(A).concat(A&&".").concat(T),currentIndex:"".concat(s+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(t){return function(t,n){var s=e.__spreadArray([],E.sub_features||[],!0);s[t]=n,M(e.__assign(e.__assign({},E),{sub_features:s}))}(s,t)},enableDownload:!0,isDiffEditReviewMode:P,showUserStoryDiff:R,updateUserStoryArtifact:W,handleDownloadUserStory:L,handleOpenSendDialog:H,isDisplayHighlightControl:O,elementDisplayConfig:F,_resolvedConfig:i,actionItemsConfig:Z,onDelete:function(){return function(t){var n=(E.sub_features||[]).filter(function(e,n){return n!==t}),s=e.__assign(e.__assign({},E),{sub_features:n});re(s),M(s)}(s)}},n.artifactId)})]}))}))]}))};exports.StoryCard=x,exports.UserStoryCardWrapper=function(n){var i=n.artifactTitleIDs,l=n.isDiffEditReviewMode,r=n.showUserStoryDiff,a=n.updateUserStoryArtifact,u=n.isUserStoryCurrentlyUpdated,d=n.artifactId,c=n.handleOpenSendDialog,f=n.handleDownloadUserStory,_=n.selectedArtifactId,g=n.isDisplayHighlightControl,y=n.elementDisplayConfig,h=n.showWrapper,m=n.actionItemsConfig,S=v.useRequirementAI(),C=S.userStory,I=S.setUserStory,j=S.customStyles,w=S.searchQueryList,b=S.currentHighlightIndex,N=S.setCurrentHighlightIndex;S.segmentComponentConfig;var B=null==j?void 0:j.userStoryCardStyles,D=0===b,U=b===w.length-1;return t.jsxs("div",e.__assign({className:o.default.userStoryCardWrapper,style:g?e.__assign(e.__assign({},null==B?void 0:B.userStoryCardWrapper),{position:"relative"}):null==B?void 0:B.userStoryCardWrapper},{children:[g&&t.jsx(t.Fragment,{children:w.length>0&&t.jsx("div",e.__assign({className:o.default.wrapper},{children:t.jsx("div",e.__assign({className:o.default.highlightNavigation},{children:t.jsxs("div",e.__assign({className:o.default.navigationContainer},{children:[t.jsxs("span",e.__assign({className:o.default.navCounter},{children:[b+1," of ",w.length]})),t.jsxs("div",e.__assign({className:o.default.navButtons},{children:[t.jsx("button",e.__assign({onClick:function(){b>0&&N(function(e){return e-1})},className:o.default.navButton,disabled:D},{children:t.jsx(s.ChevronUpIcon,{size:20,className:o.default.navIcon})})),t.jsx("button",e.__assign({onClick:function(){b<w.length-1&&N(function(e){return e+1})},className:o.default.navButton,disabled:U},{children:t.jsx(s.ChevronDownIcon,{size:20,className:o.default.navIcon})}))]}))]}))}))}))}),C.map(function(n,s){var o=p(y,!0);return t.jsx(x,{isUserStoryCurrentlyUpdated:u,artifactId:d,artifactTitleId:i[s]||"",currentUserStory:n,onUserStoryChange:function(t){I(function(n){return n[s]=t,e.__spreadArray([],n,!0)})},parentIndex:"",currentIndex:"".concat(s+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:l,showUserStoryDiff:r,updateUserStoryArtifact:a,handleOpenSendDialog:c,handleDownloadUserStory:f,selectedArtifactId:_,isDisplayHighlightControl:g,elementDisplayConfig:y,_resolvedConfig:o,showWrapper:h,actionItemsConfig:m},n.artifactId)})]}))},exports.default=x,exports.replaceLearnedTagsWithInfo=m;
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"),i=require("react"),n=require("lucide-react"),l=require("../../utils/user-story.utils.js"),s=require("../userstory-with-citation/UserStoryWithCitation.js"),o=require("./PartialRequirementContent.module.css.js"),a=require("@mui/material"),r=require("../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../RichTextEditor/RichTextEditor.js"),u=function(u){var v,c,m,g,y,_,p,f,C,q,S,j,h,x,R,P,w,B,b=u.loadingPartialRequirements,N=u.localUserStory,A=u.setLocalUserStory,E=u.onCraFlowDiffAgentAction,k=u.disableEditing,U=u.isCraflow,D=void 0===U||U,T=u.onCraAccept,W=u.onCraReject,F=i.useState(!1),I=F[0],M=F[1],z=i.useState(""),L=z[0],H=z[1],O=r.useRequirementAI(),V=O.customStyles,X=O.segmentComponentConfig;i.useEffect(function(){k&&M(!1)},[k]),i.useEffect(function(){var e;H(null===(e=null==N?void 0:N[0])||void 0===e?void 0:e.value)},[N]);if(b)return t.jsx("div",e.__assign({className:o.default.skeletonWrapper,style:null===(v=null==V?void 0:V.PartialRequirementContentStyles)||void 0===v?void 0:v.skeletonWrapper},{children:[1,2,3,4,5].map(function(e){var i;return t.jsx("div",{className:o.default.skeletonLine,style:null===(i=null==V?void 0:V.PartialRequirementContentStyles)||void 0===i?void 0:i.skeletonLine},e)})}));var G=!L||""===L.trim();return t.jsxs("div",e.__assign({className:o.default.wrapper,style:null===(c=null==V?void 0:V.PartialRequirementContentStyles)||void 0===c?void 0:c.wrapper},{children:[t.jsx("div",e.__assign({className:o.default.actionBar,style:null===(m=null==V?void 0:V.PartialRequirementContentStyles)||void 0===m?void 0:m.actionBar},{children:I?t.jsxs(t.Fragment,{children:[t.jsxs("span",e.__assign({className:o.default.editingBadge,style:null===(p=null==V?void 0:V.PartialRequirementContentStyles)||void 0===p?void 0:p.editingBadge},{children:[t.jsx("span",{className:o.default.editingDot,style:null===(f=null==V?void 0:V.PartialRequirementContentStyles)||void 0===f?void 0:f.editingDot}),"Editing"]})),t.jsx("div",{className:o.default.btnDivider,style:null===(C=null==V?void 0:V.PartialRequirementContentStyles)||void 0===C?void 0:C.btnDivider}),t.jsx(a.Tooltip,e.__assign({title:G?"This field cannot be empty":"Save changes",slotProps:{tooltip:{sx:e.__assign({},null===(q=null==V?void 0:V.PartialRequirementContentStyles)||void 0===q?void 0:q.headerTooltip)}}},{children:t.jsx("span",{children:t.jsx("button",e.__assign({className:o.default.saveBtn,style:e.__assign(e.__assign(e.__assign({},null===(S=null==V?void 0:V.PartialRequirementContentStyles)||void 0===S?void 0:S.actionBtn),null===(j=null==V?void 0:V.PartialRequirementContentStyles)||void 0===j?void 0:j.saveBtn),{opacity:G?.5:1,cursor:G?"not-allowed":"pointer"}),onClick:function(){G||(A(function(t){var i=e.__assign(e.__assign({},t[0]),{value:l.postprocessUserStoryAfterEdit(L)});return null==E||E("accept",[i]),[i]}),M(!1))},disabled:G},{children:t.jsx(n.Save,{size:16})}))})})),t.jsx("button",e.__assign({className:o.default.cancelBtn,style:e.__assign(e.__assign({},null===(h=null==V?void 0:V.PartialRequirementContentStyles)||void 0===h?void 0:h.actionBtn),null===(x=null==V?void 0:V.PartialRequirementContentStyles)||void 0===x?void 0:x.cancelBtn),onClick:function(){var e;H(null===(e=null==N?void 0:N[0])||void 0===e?void 0:e.value),M(!1)},title:"Discard changes","aria-label":"Discard changes"},{children:t.jsx(n.X,{size:16})}))]}):t.jsx(a.Tooltip,e.__assign({title:k?"Editing is disabled":"Edit",slotProps:{tooltip:{sx:e.__assign({},null===(g=null==V?void 0:V.PartialRequirementContentStyles)||void 0===g?void 0:g.headerTooltip)}}},{children:t.jsx("span",{children:t.jsx("button",e.__assign({className:o.default.editBtn,style:e.__assign(e.__assign(e.__assign({},null===(y=null==V?void 0:V.PartialRequirementContentStyles)||void 0===y?void 0:y.actionBtn),null===(_=null==V?void 0:V.PartialRequirementContentStyles)||void 0===_?void 0:_.editBtn),{opacity:k?.5:1,cursor:k?"not-allowed":"pointer"}),onClick:function(){k||M(!0)},disabled:k,"aria-label":"Edit requirement"},{children:t.jsx(n.Pencil,{size:16})}))})}))})),I?t.jsx("div",e.__assign({className:o.default.editorContainer,style:null===(R=null==V?void 0:V.PartialRequirementContentStyles)||void 0===R?void 0:R.editorContainer},{children:t.jsx(d.default,{minHeight:"100%",height:"100%",type:"string",value:l.preprocessUserStoryForEdit(l.formatMarkdown((null===(P=null==N?void 0:N[0])||void 0===P?void 0:P.value)||"")||""),handleUpdateState:function(e,t){H(t)},doNotShowBorderInViewMode:!1,mode:"edit"})})):t.jsx("div",e.__assign({className:o.default.viewContainer,style:null===(w=null==V?void 0:V.PartialRequirementContentStyles)||void 0===w?void 0:w.viewContainer},{children:t.jsx(s.default,{message:l.formatMarkdown((null===(B=null==N?void 0:N[0])||void 0===B?void 0:B.value)||""),craFlowConfig:{isCraflow:!0,craUserStory:N,setCraUserStory:A,onCraFlowDiffAgentAction:E,displayActionButtons:!I},isCraflow:D,onCraAccept:T,onCraReject:W,customStyles:null==V?void 0:V.UserStoryWithCitationCustomStyles,segmentComponentConfig:X})}))]}))};exports.PartialRequirementContent=u,exports.default=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("lucide-react"),l=require("../../utils/user-story.utils.js"),s=require("../userstory-with-citation/UserStoryWithCitation.js"),a=require("./PartialRequirementContent.module.css.js"),o=require("@mui/material"),r=require("../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../RichTextEditor/RichTextEditor.js"),u=function(u){var v,c,m,y,_,g,p,f,C,q,S,j,h,x,R,P,w,B,b=u.loadingPartialRequirements,N=u.localUserStory,A=u.setLocalUserStory,E=u.onCraFlowDiffAgentAction,k=u.disableEditing,U=u.isCraflow,D=void 0===U||U,T=u.onCraAccept,W=u.onCraReject,F=i.useState(!1),I=F[0],M=F[1],z=i.useState(""),L=z[0],H=z[1],O=r.useRequirementAI(),V=O.customStyles;O.segmentComponentConfig,i.useEffect(function(){k&&M(!1)},[k]),i.useEffect(function(){var e;H(null===(e=null==N?void 0:N[0])||void 0===e?void 0:e.value)},[N]);if(b)return t.jsx("div",e.__assign({className:a.default.skeletonWrapper,style:null===(v=null==V?void 0:V.PartialRequirementContentStyles)||void 0===v?void 0:v.skeletonWrapper},{children:[1,2,3,4,5].map(function(e){var i;return t.jsx("div",{className:a.default.skeletonLine,style:null===(i=null==V?void 0:V.PartialRequirementContentStyles)||void 0===i?void 0:i.skeletonLine},e)})}));var X=!L||""===L.trim();return t.jsxs("div",e.__assign({className:a.default.wrapper,style:null===(c=null==V?void 0:V.PartialRequirementContentStyles)||void 0===c?void 0:c.wrapper},{children:[t.jsx("div",e.__assign({className:a.default.actionBar,style:null===(m=null==V?void 0:V.PartialRequirementContentStyles)||void 0===m?void 0:m.actionBar},{children:I?t.jsxs(t.Fragment,{children:[t.jsxs("span",e.__assign({className:a.default.editingBadge,style:null===(p=null==V?void 0:V.PartialRequirementContentStyles)||void 0===p?void 0:p.editingBadge},{children:[t.jsx("span",{className:a.default.editingDot,style:null===(f=null==V?void 0:V.PartialRequirementContentStyles)||void 0===f?void 0:f.editingDot}),"Editing"]})),t.jsx("div",{className:a.default.btnDivider,style:null===(C=null==V?void 0:V.PartialRequirementContentStyles)||void 0===C?void 0:C.btnDivider}),t.jsx(o.Tooltip,e.__assign({title:X?"This field cannot be empty":"Save changes",slotProps:{tooltip:{sx:e.__assign({},null===(q=null==V?void 0:V.PartialRequirementContentStyles)||void 0===q?void 0:q.headerTooltip)}}},{children:t.jsx("span",{children:t.jsx("button",e.__assign({className:a.default.saveBtn,style:e.__assign(e.__assign(e.__assign({},null===(S=null==V?void 0:V.PartialRequirementContentStyles)||void 0===S?void 0:S.actionBtn),null===(j=null==V?void 0:V.PartialRequirementContentStyles)||void 0===j?void 0:j.saveBtn),{opacity:X?.5:1,cursor:X?"not-allowed":"pointer"}),onClick:function(){X||(A(function(t){var i=e.__assign(e.__assign({},t[0]),{value:l.postprocessUserStoryAfterEdit(L)});return null==E||E("accept",[i]),[i]}),M(!1))},disabled:X},{children:t.jsx(n.Save,{size:16})}))})})),t.jsx("button",e.__assign({className:a.default.cancelBtn,style:e.__assign(e.__assign({},null===(h=null==V?void 0:V.PartialRequirementContentStyles)||void 0===h?void 0:h.actionBtn),null===(x=null==V?void 0:V.PartialRequirementContentStyles)||void 0===x?void 0:x.cancelBtn),onClick:function(){var e;H(null===(e=null==N?void 0:N[0])||void 0===e?void 0:e.value),M(!1)},title:"Discard changes","aria-label":"Discard changes"},{children:t.jsx(n.X,{size:16})}))]}):t.jsx(o.Tooltip,e.__assign({title:k?"Editing is disabled":"Edit",slotProps:{tooltip:{sx:e.__assign({},null===(y=null==V?void 0:V.PartialRequirementContentStyles)||void 0===y?void 0:y.headerTooltip)}}},{children:t.jsx("span",{children:t.jsx("button",e.__assign({className:a.default.editBtn,style:e.__assign(e.__assign(e.__assign({},null===(_=null==V?void 0:V.PartialRequirementContentStyles)||void 0===_?void 0:_.actionBtn),null===(g=null==V?void 0:V.PartialRequirementContentStyles)||void 0===g?void 0:g.editBtn),{opacity:k?.5:1,cursor:k?"not-allowed":"pointer"}),onClick:function(){k||M(!0)},disabled:k,"aria-label":"Edit requirement"},{children:t.jsx(n.Pencil,{size:16})}))})}))})),I?t.jsx("div",e.__assign({className:a.default.editorContainer,style:null===(R=null==V?void 0:V.PartialRequirementContentStyles)||void 0===R?void 0:R.editorContainer},{children:t.jsx(d.default,{minHeight:"100%",height:"100%",type:"string",value:l.preprocessUserStoryForEdit(l.formatMarkdown((null===(P=null==N?void 0:N[0])||void 0===P?void 0:P.value)||"")||""),handleUpdateState:function(e,t){H(t)},doNotShowBorderInViewMode:!1,mode:"edit"})})):t.jsx("div",e.__assign({className:a.default.viewContainer,style:null===(w=null==V?void 0:V.PartialRequirementContentStyles)||void 0===w?void 0:w.viewContainer},{children:t.jsx(s.default,{message:l.formatMarkdown((null===(B=null==N?void 0:N[0])||void 0===B?void 0:B.value)||""),craFlowConfig:{isCraflow:!0,craUserStory:N,setCraUserStory:A,onCraFlowDiffAgentAction:E,displayActionButtons:!I},isCraflow:D,onCraAccept:T,onCraReject:W,customStyles:null==V?void 0:V.UserStoryWithCitationCustomStyles})}))]}))};exports.PartialRequirementContent=u,exports.default=u;
2
2
  //# sourceMappingURL=PartialRequirementContent.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"),a=require("lucide-react"),s=require("../../../UserStoryImport/lib/cn.js"),l=require("./segment.module.css.js"),o=require("./ExampleComponentWrapper.js"),i=require("../ai-reasoning/AiReasoningCitationContent.js"),r=require("./SegmentLoader.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./segment-common.css.js");var c=u(t);exports.default=function(t){var u=t.id,d=void 0===u?"Segment":u,m=t.label,g=t.originalValue;t.decisionStrength;var p=t.aiReason,v=t.customStyles,f=t.customIcons,_=t.aiReasoningCitationCustomStyles,x=t.segmentExampleComponent,j=t.handleViewGlossary,S=t.isUpdatedSegment,h=t.onOpen,y=c.default.useState(!1),C=y[0],b=y[1],q=c.default.useState(!1),E=q[0],I=q[1],w=c.default.useState(!1),N=w[0],R=w[1];return n.jsxs("div",e.__assign({className:"".concat(l.default.segmentWrapper),style:e.__assign({},null==v?void 0:v.segmentWrapper)},{children:[n.jsxs("div",e.__assign({className:"segment-".concat(d,"-container segmentContainer ").concat(S?"updatedSegmentContainer":""),style:e.__assign({},null==v?void 0:v.container)},{children:[n.jsx("span",e.__assign({className:"segment-".concat(d," segmentLabel ").concat(S?"updatedSegmentLabel":""),style:e.__assign({},null==v?void 0:v.label)},{children:S?g:m})),n.jsx("button",e.__assign({className:"".concat(l.default.segmentExplanationButtonContainer),style:e.__assign({},null==v?void 0:v.buttonContainer),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:if(n=!C,I(!1),!n||(null==p?void 0:p.reason))return[3,5];R(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,null==h?void 0:h()];case 2:return e.sent(),[3,4];case 3:return R(!1),b(!0),[7];case 4:return[3,6];case 5:b(n),e.label=6;case 6:return[2]}})})}},{children:N?n.jsx(a.Loader2,{size:16,className:l.default.spinner}):n.jsx(a.ChevronDown,{className:s.cn(S&&l.default.updatedChevronIcon,l.default.cheveronIcon,C&&l.default.cheveronIconRotated),style:e.__assign({},null==v?void 0:v.cheveronIcon)})}))]})),E&&!S?n.jsx(o.default,{label:null!=m?m:"",segmentExampleComponent:x,customStyles:null==v?void 0:v.segmentExample,handleCancelExample:function(){I(!1)}}):C&&(N?n.jsx(r.default,{customStyles:null==v?void 0:v.loadingSkeleton}):n.jsx(i.default,{aiReason:p,customStyles:_,customIcons:f,isSegmentExplanation:!0,handleViewGlossary:j?function(){b(!1),null==j||j(d)}:void 0,handleViewExample:x?function(){I(!0)}:void 0,isUpdatedSegment:S}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),a=require("lucide-react"),s=require("../../../UserStoryImport/lib/cn.js"),o=require("./segment.module.css.js"),i=require("./ExampleComponentWrapper.js"),r=require("../ai-reasoning/AiReasoningCitationContent.js"),l=require("./SegmentLoader.js");require("./segment-common.css.js");var u=require("../../store/markdown-context.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(t);exports.default=function(c){var m=c.id,g=void 0===m?"Segment":m,p=c.label,f=c.segmentUUID,v=c.originalValue;c.decisionStrength;var _=c.aiReason,x=c.customStyles,y=c.customIcons,j=c.aiReasoningCitationCustomStyles,C=c.segmentExampleComponent,h=c.handleViewGlossary,S=c.isUpdatedSegment,b=c.onOpen,q=t.useContext(u.MarkdownStateContext),w=q.citationsMetadata,E=q.updateCitationsMetadata;console.log("citation metadata ",w);var I=d.default.useState(!1),M=I[0],N=I[1],k=t.useMemo(function(){return w.get(f)},[w,f]),R=t.useMemo(function(){return(null==k?void 0:k.open)||!1},[k]),U=t.useMemo(function(){return k&&"loading"===k.state},[k]);return n.jsxs("div",e.__assign({className:"".concat(o.default.segmentWrapper),style:e.__assign({},null==x?void 0:x.segmentWrapper)},{children:[n.jsxs("div",e.__assign({className:"segment-".concat(g,"-container segmentContainer ").concat(S?"updatedSegmentContainer":""),style:e.__assign({},null==x?void 0:x.container)},{children:[n.jsx("span",e.__assign({className:"segment-".concat(g," segmentLabel ").concat(S?"updatedSegmentLabel":""),style:e.__assign({},null==x?void 0:x.label)},{children:S?v:p})),n.jsx("button",e.__assign({className:"".concat(o.default.segmentExplanationButtonContainer),style:e.__assign({},null==x?void 0:x.buttonContainer),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:if(n=!R,N(!1),console.log("citation metadata::",n,_),!n||(null==_?void 0:_.reason))return[3,5];E(f,function(t){if(t){var a=e.__assign({},t);return a.state="loading",a}return{open:n,state:"loading"}}),t.label=1;case 1:return t.trys.push([1,,3,4]),console.log("citation metadata:: onopen"),[4,null==b?void 0:b()];case 2:return t.sent(),[3,4];case 3:return E(f,function(t){if(t){var a=e.__assign({},t);return a.state="ready",a.open=n,a}return{open:n,state:"ready"}}),[7];case 4:return[3,6];case 5:console.log("citation metadata:: else block"),E(f,function(t){if(t){var a=e.__assign({},t);return a.open=n,a}return{open:n,state:U?"loading":"ready"}}),t.label=6;case 6:return[2]}})})}},{children:U?n.jsx(a.Loader2,{size:16,className:o.default.spinner}):n.jsx(a.ChevronDown,{className:s.cn(S&&o.default.updatedChevronIcon,o.default.cheveronIcon,R&&o.default.cheveronIconRotated),style:e.__assign({},null==x?void 0:x.cheveronIcon)})}))]})),M&&!S?n.jsx(i.default,{label:null!=p?p:"",segmentExampleComponent:C,customStyles:null==x?void 0:x.segmentExample,handleCancelExample:function(){N(!1)}}):R&&(U?n.jsx(l.default,{customStyles:null==x?void 0:x.loadingSkeleton}):n.jsx(r.default,{aiReason:_,customStyles:j,customIcons:y,isSegmentExplanation:!0,handleViewGlossary:h?function(){E(f,function(n){if(n){var t=e.__assign({},n);return t.open=!1,t}return{open:!1,state:U?"loading":"ready"}}),null==h||h(g)}:void 0,handleViewExample:C?function(){N(!0)}:void 0,isUpdatedSegment:S}))]}))};
2
2
  //# sourceMappingURL=Segment.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("./Segment.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(require("dompurify"));exports.default=function(o){var i,d,a,r,s,u,v,g,m,c,p,S,f,h=o.children,b=o.props,x=o.segmentComponentConfig,_=o.customStyles,y=o.customIcons,C=o.extractText,j=o.isUpdatedSegment,I=void 0!==j&&j,w=(null==b?void 0:b.id)||"Segment",q=(null==b?void 0:b.decisionstrength)||"80",D=x||{},E=D.segmentDataList,L=D.getSegmentExampleComponent,U=D.handleViewGlossary,k=D.upadatedSegmentDataList,F=D.handleFetchUpdatedSegmentDetails,O=D.handleFetchSegmentDetails,R=I?null==k?void 0:k.find(function(e){return String(e.segment_id)===String(w)}):null==E?void 0:E.find(function(e){return String(e.segment_id)===String(w)});console.log("meee work",R,I,E,k);var V={id:w,reason:null!==(i=null==R?void 0:R.reason)&&void 0!==i?i:"",gap:null!==(d=null==R?void 0:R.gap)&&void 0!==d?d:"",explanation:null!==(a=null==R?void 0:R.explanation)&&void 0!==a?a:"",relevance_score:null!==(r=null==R?void 0:R.relevance_score)&&void 0!==r?r:0,isOpen:!1},G=void 0,M=C(h),T=b["data-table"],W="";if(T&&!I)try{W=decodeURIComponent(atob(T))}catch(e){console.error("Failed to decode data-table for segment",w,e)}var z=l.default.sanitize(W);return R||!O||I||null==O||O(w),w&&R&&L&&!I&&(G=T?n.jsx(function(){return n.jsx("div",{dangerouslySetInnerHTML:{__html:z}})},{}):L(w,M,R.segment_type)),n.jsx(t.default,{id:w,label:null!==(s=null==R?void 0:R.label)&&void 0!==s?s:null==R?void 0:R.segment_name,originalValue:M,decisionStrength:q,aiReason:V,customIcons:y,aiReasoningCitationCustomStyles:_,segmentExampleComponent:G,handleViewGlossary:U,customStyles:{segmentWrapper:null===(u=null==_?void 0:_.segment)||void 0===u?void 0:u.segmentWrapper,container:null===(v=null==_?void 0:_.segment)||void 0===v?void 0:v.container,label:null===(g=null==_?void 0:_.segment)||void 0===g?void 0:g.label,decisionStrength:null===(m=null==_?void 0:_.segment)||void 0===m?void 0:m.decisionStrength,buttonContainer:null===(c=null==_?void 0:_.segment)||void 0===c?void 0:c.buttonContainer,cheveronIcon:null===(p=null==_?void 0:_.segment)||void 0===p?void 0:p.cheveronIcon,segmentExample:null===(S=null==_?void 0:_.segment)||void 0===S?void 0:S.segmentExample,loadingSkeleton:null===(f=null==_?void 0:_.segment)||void 0===f?void 0:f.SegmentLoadingSkeletonStyles},isUpdatedSegment:I,onOpen:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return R||!I?[3,2]:[4,null==F?void 0:F(w)];case 1:e.sent(),e.label=2;case 2:return[2]}})})}},w)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("./Segment.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(require("dompurify"));exports.default=function(o){var i,d,a,r,s,u,v,g,m,c,p,S,f,h=o.id,b=o.children,x=o.props,_=o.segmentComponentConfig,y=o.customStyles,C=o.customIcons,j=o.extractText,I=o.isUpdatedSegment,U=void 0!==I&&I,D=(null==x?void 0:x.id)||"Segment",w=(null==x?void 0:x.decisionstrength)||"80",q=_||{},E=q.segmentDataList,F=q.getSegmentExampleComponent,L=q.handleViewGlossary,k=q.upadatedSegmentDataList,O=q.handleFetchUpdatedSegmentDetails,R=q.handleFetchSegmentDetails,V=U?null==k?void 0:k.find(function(e){return String(e.segment_id)===String(D)}):null==E?void 0:E.find(function(e){return String(e.segment_id)===String(D)});console.log("meee work",V,U,E,k);var G={id:D,reason:null!==(i=null==V?void 0:V.reason)&&void 0!==i?i:"",gap:null!==(d=null==V?void 0:V.gap)&&void 0!==d?d:"",explanation:null!==(a=null==V?void 0:V.explanation)&&void 0!==a?a:"",relevance_score:null!==(r=null==V?void 0:V.relevance_score)&&void 0!==r?r:0,isOpen:!1},M=void 0,T=j(b),W=x["data-table"],z="";if(W&&!U)try{z=decodeURIComponent(atob(W))}catch(e){console.error("Failed to decode data-table for segment",D,e)}var H=l.default.sanitize(z);return V||!R||U||null==R||R(D),D&&V&&F&&!U&&(M=W?n.jsx(function(){return n.jsx("div",{dangerouslySetInnerHTML:{__html:H}})},{}):F(D,T,V.segment_type)),n.jsx(t.default,{id:D,segmentUUID:h,label:null!==(s=null==V?void 0:V.label)&&void 0!==s?s:null==V?void 0:V.segment_name,originalValue:T,decisionStrength:w,aiReason:G,customIcons:C,aiReasoningCitationCustomStyles:y,segmentExampleComponent:M,handleViewGlossary:L,customStyles:{segmentWrapper:null===(u=null==y?void 0:y.segment)||void 0===u?void 0:u.segmentWrapper,container:null===(v=null==y?void 0:y.segment)||void 0===v?void 0:v.container,label:null===(g=null==y?void 0:y.segment)||void 0===g?void 0:g.label,decisionStrength:null===(m=null==y?void 0:y.segment)||void 0===m?void 0:m.decisionStrength,buttonContainer:null===(c=null==y?void 0:y.segment)||void 0===c?void 0:c.buttonContainer,cheveronIcon:null===(p=null==y?void 0:y.segment)||void 0===p?void 0:p.cheveronIcon,segmentExample:null===(S=null==y?void 0:y.segment)||void 0===S?void 0:S.segmentExample,loadingSkeleton:null===(f=null==y?void 0:y.segment)||void 0===f?void 0:f.SegmentLoadingSkeletonStyles},isUpdatedSegment:U,onOpen:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return V||!U?[3,2]:(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),[4,null==O?void 0:O(D)]);case 1:e.sent(),e.label=2;case 2:return[2]}})})}},D)};
2
2
  //# sourceMappingURL=SegmentWrapper.js.map
@@ -1,2 +1,2 @@
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("../RequirementAIWrapper/RequirementAIWrapper.js"),r=require("../../utils/helpers.js"),a=require("../RichTextEditor/RichTextEditor.js"),o=require("../userstory-with-citation/UserStoryWithCitation.js"),l=require("../../shared/AtomicButton.js"),u=require("./SubfeatureBlock.module.css.js");exports.default=function(d){var c,f,v=d.parentArtifactId,_=d.artifactId,g=d.title,p=d.content,m=d.isEditingModeOn,h=d.setIsEditingModeOn,y=d.isCitationLoadingDisplay,j=void 0!==y&&y,x=s.useRequirementAI(),S=x.userStory,I=x.setUserStory,C=x.customStyles,q=x.customIcons,b=x.segmentComponentConfig,N=null===(c=null==C?void 0:C.userStoryScreenStyles)||void 0===c?void 0:c.subFeatureBlock,B=null===(f=null==C?void 0:C.userStoryScreenStyles)||void 0===f?void 0:f.userStoryContentStyles,k=n.useState(!0),A=k[0],w=k[1],W=n.useState(!1),M=W[0],E=W[1],P=n.useState(S),R=P[0],F=P[1];n.useEffect(function(){F(S)},[S]);return t.jsxs("div",e.__assign({className:u.default.container,style:null==N?void 0:N.container},{children:[t.jsxs("button",e.__assign({onClick:function(){w(function(e){return!e})},className:u.default.toggleButton,style:null==N?void 0:N.toggleButton},{children:[t.jsx("h1",e.__assign({className:u.default.title,style:null==N?void 0:N.title},{children:g})),t.jsxs("div",e.__assign({className:u.default.subFeatureToolbar,style:null==N?void 0:N.subFeatureToolbar},{children:[A&&t.jsx("div",e.__assign({className:u.default.actionBar,style:null==N?void 0:N.actionBar},{children:M?t.jsxs("div",e.__assign({className:u.default.editingActions},{children:[t.jsx(l.default,{type:"outline",children:"Cancel",onClick:function(e){e.stopPropagation(),E(!1),h(!1)}}),t.jsx(l.default,{type:"fill",children:"Save",onClick:function(e){e.stopPropagation(),I(R),E(!1),h(!1)}})]})):!m&&t.jsx("div",e.__assign({className:u.default.viewActions},{children:t.jsx("button",e.__assign({className:u.default.editButton,style:null==N?void 0:N.editButton,onClick:function(e){e.stopPropagation(),E(!0),h(!0)}},{children:t.jsx(i.PencilIcon,{size:16})}))}))})),t.jsx(i.ChevronDown,{className:"".concat(u.default.chevron," ").concat(A?u.default.chevronOpen:""),style:null==N?void 0:N.chevron})]}))]})),A&&t.jsx(t.Fragment,{children:M?t.jsx("div",e.__assign({className:u.default.editorWrapper,style:null==N?void 0:N.editorWrapper},{children:t.jsx(a.default,{minHeight:"100%",height:"100%",type:"string",value:r.formatMarkdown(p)||"",handleUpdateState:function(t,n){var i=r.indentMarkdown(n);F(function(t){var n=e.__spreadArray([],t,!0),s=n.findIndex(function(e){return e.artifactId===v});if(-1===s)return n;var r=n[s].sub_features;if(r){var a=r.findIndex(function(e){return e.artifactId===_});-1!==a&&(n[s]=e.__assign(e.__assign({},n[s]),{sub_features:r.map(function(t,n){return n===a?e.__assign(e.__assign({},t),{value:i}):t})}))}return n})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:"edit"})})):t.jsx("div",e.__assign({className:u.default.contentWrapper,style:null==N?void 0:N.contentWrapper},{children:t.jsx(o.default,{message:p,isCitationLoadingDisplay:j,customStyles:e.__assign({},B),customIcons:e.__assign({},null==q?void 0:q.userStoryIcons),segmentComponentConfig:b})}))})]}),_)};
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("../RequirementAIWrapper/RequirementAIWrapper.js"),r=require("../../utils/helpers.js"),a=require("../RichTextEditor/RichTextEditor.js"),o=require("../userstory-with-citation/UserStoryWithCitation.js"),l=require("../../shared/AtomicButton.js"),u=require("./SubfeatureBlock.module.css.js");exports.default=function(d){var c,f,v=d.parentArtifactId,_=d.artifactId,g=d.title,p=d.content,h=d.isEditingModeOn,m=d.setIsEditingModeOn,y=d.isCitationLoadingDisplay,j=void 0!==y&&y,x=s.useRequirementAI(),S=x.userStory,I=x.setUserStory,q=x.customStyles,b=x.customIcons;x.segmentComponentConfig;var C=null===(c=null==q?void 0:q.userStoryScreenStyles)||void 0===c?void 0:c.subFeatureBlock,N=null===(f=null==q?void 0:q.userStoryScreenStyles)||void 0===f?void 0:f.userStoryContentStyles,B=n.useState(!0),k=B[0],A=B[1],w=n.useState(!1),W=w[0],M=w[1],E=n.useState(S),P=E[0],R=E[1];n.useEffect(function(){R(S)},[S]);return t.jsxs("div",e.__assign({className:u.default.container,style:null==C?void 0:C.container},{children:[t.jsxs("button",e.__assign({onClick:function(){A(function(e){return!e})},className:u.default.toggleButton,style:null==C?void 0:C.toggleButton},{children:[t.jsx("h1",e.__assign({className:u.default.title,style:null==C?void 0:C.title},{children:g})),t.jsxs("div",e.__assign({className:u.default.subFeatureToolbar,style:null==C?void 0:C.subFeatureToolbar},{children:[k&&t.jsx("div",e.__assign({className:u.default.actionBar,style:null==C?void 0:C.actionBar},{children:W?t.jsxs("div",e.__assign({className:u.default.editingActions},{children:[t.jsx(l.default,{type:"outline",children:"Cancel",onClick:function(e){e.stopPropagation(),M(!1),m(!1)}}),t.jsx(l.default,{type:"fill",children:"Save",onClick:function(e){e.stopPropagation(),I(P),M(!1),m(!1)}})]})):!h&&t.jsx("div",e.__assign({className:u.default.viewActions},{children:t.jsx("button",e.__assign({className:u.default.editButton,style:null==C?void 0:C.editButton,onClick:function(e){e.stopPropagation(),M(!0),m(!0)}},{children:t.jsx(i.PencilIcon,{size:16})}))}))})),t.jsx(i.ChevronDown,{className:"".concat(u.default.chevron," ").concat(k?u.default.chevronOpen:""),style:null==C?void 0:C.chevron})]}))]})),k&&t.jsx(t.Fragment,{children:W?t.jsx("div",e.__assign({className:u.default.editorWrapper,style:null==C?void 0:C.editorWrapper},{children:t.jsx(a.default,{minHeight:"100%",height:"100%",type:"string",value:r.formatMarkdown(p)||"",handleUpdateState:function(t,n){var i=r.indentMarkdown(n);R(function(t){var n=e.__spreadArray([],t,!0),s=n.findIndex(function(e){return e.artifactId===v});if(-1===s)return n;var r=n[s].sub_features;if(r){var a=r.findIndex(function(e){return e.artifactId===_});-1!==a&&(n[s]=e.__assign(e.__assign({},n[s]),{sub_features:r.map(function(t,n){return n===a?e.__assign(e.__assign({},t),{value:i}):t})}))}return n})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:"edit"})})):t.jsx("div",e.__assign({className:u.default.contentWrapper,style:null==C?void 0:C.contentWrapper},{children:t.jsx(o.default,{message:p,isCitationLoadingDisplay:j,customStyles:e.__assign({},N),customIcons:e.__assign({},null==b?void 0:b.userStoryIcons)})}))})]}),_)};
2
2
  //# sourceMappingURL=SubfeatureBlock.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),a=require("./UserStoryWithCitation.module.css.js"),l=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),s=require("@mui/material"),d=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),v=require("../../icons/CognitiveDecision.js"),f=require("../../icons/BrainRed.js"),h=require("../ai-reasoning/AiReasoningCitation.js"),p=require("../../icons/RelevanceScoreIcon.js"),C=require("../RecommendationBlock/RecommendationBlock.js"),m=require("../UserStoryCard/AttachedContext.js"),_=require("../ai-reasoning/AiReasoningCitationContent.js"),x=require("./components/InlineUpdatedComponent.js"),j=require("../segment/SegmentWrapper.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var S=y(i),R=y(t),I=y(o),b=i.createContext(!1),w=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),N=i.createContext({rowId:""}),A=function(t){var o,l=t.aiReason,r=t.isHighConfidence,s=t.customStyle,d=t.customIcons,c=i.useContext(w),u=c.expandedInfo,g=c.setExpanded,h=c.reasonToRow,p=i.useContext(N).rowId,C=String(l.id);p&&h.current.set(C,p);var m=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===l.id,_=r?(null==d?void 0:d.highConfidence)||n.jsx(v.default,{}):(null==d?void 0:d.lowConfidence)||n.jsx(f.default,{});return n.jsxs("button",e.__assign({className:a.default.aiReasoningButton,style:s,onClick:function(e){e.stopPropagation(),e.preventDefault(),g(m?null:p,m?null:l)}},{children:[_,m?n.jsx("i",{className:"pi pi-angle-up ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)})]}))},q=function(t){var o,l,r=t.children,s=t.node,d=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,g=i.useContext(w).expandedInfo,v=(null==g?void 0:g.rowId)===u,f=Array.isArray(null==s?void 0:s.children)?s.children.filter(function(e){return"element"===e.type}).length:1,h=null!==(l=null===(o=null==s?void 0:s.properties)||void 0===o?void 0:o.style)&&void 0!==l?l:void 0;return n.jsxs(N.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:h?{cssText:h}:void 0},{children:r})),v&&(null==g?void 0:g.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:f||1,className:a.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellContent},{children:n.jsx(_.default,{aiReason:g.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==d?void 0:d.aiReasoningContent,aiReasoningAccordion:null==d?void 0:d.aiReasoningAccordion,aiReasoningMarkdown:null==d?void 0:d.aiReasoningMarkdown,aiReasoningPill:null==d?void 0:d.aiReasoningPill,webCitation:null==d?void 0:d.webCitation,stormeeCitation:null==d?void 0:d.stormeeCitation,waveformCitation:null==d?void 0:d.waveformCitation,imageCitation:null==d?void 0:d.imageCitation,fileCitation:null==d?void 0:d.fileCitation,appModCitation:null==d?void 0:d.appModCitation,rcaCitation:null==d?void 0:d.rcaCitation,readFileCitation:null==d?void 0:d.readFileCitation,loadingCitations:null==d?void 0:d.loadingCitations,chatCitation:null==d?void 0:d.chatCitation}})}))}))}))}))]}))};var k=["del","ins"];function E(e){return function(e,n,i){var t=n.join("|");return e.replace(new RegExp("<(".concat(t,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(e,n,t){return"<".concat(n,">").concat(i(t),"</").concat(n,">")})}(e,k,function(e){return e.split(/(<[^>]+>)/g).map(function(e){return!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;var n=[];return e.replace(/`([^`\n]+)`/g,function(e,i){var t=n.push(i)-1;return"@@CODE_SPAN_".concat(t,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(e,i){var t,o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return"<code>".concat(o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(e)}).join("")})}exports.default=function(t){var o,v=t.message,f=t.isParent,_=t.scenario,y=t.showUserStoryDiff,N=void 0!==y&&y,k=t.aiReasoningsForBlock,T=t.isCitationLoadingDisplay,U=void 0!==T&&T,M=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var P=t.customStyles,L=t.customIcons,$=t.aiReasoningDiffView,D=t.userStoryCitations,H=t.artifactId,O=t.isCraflow,F=t.onCraAccept,B=t.onCraReject,W=t.craFlowConfig,z=t.isDisplayHighlightControl,V=void 0!==z&&z,G=t.segmentComponentConfig,Q=i.useRef(null),J=g.useRequirementAI(),K=J.userStory,X=J.inlineUpdateComponentConfig,Y=J.getAvgScoreForStory,Z=J.setUserStory,ee=J.aiReasoning,ne=J.setAiReasoning,ie=J.customIcons,te=J.searchQueryList,oe=J.searchQueryReasoningIdList,ae=J.currentHighlightIndex,le=null!=L?L:null==ie?void 0:ie.userStoryIcons;null==P||P.searchHighlight;var re=l.useMarkdownSearch(Q),se=re.search,de=re.clear,ce=i.useState("1"),ue=ce[0],ge=ce[1],ve=i.useState(null),fe=ve[0],he=ve[1],pe=i.useRef(new Map),Ce=i.useCallback(function(e,n){he(e&&n?{rowId:e,aiReason:n}:null)},[]),me=H?Y(H):0,_e=i.useState([]),xe=_e[0],je=_e[1],ye=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(ye).join(""):S.default.isValidElement(e)?ye(e.props.children):""},Se=function(e){var n=e;return n=function(e){for(var n,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[],o=new RegExp(i.source,i.flags);null!==(n=o.exec(e));){var a=n[0],l=a.match(/<deleted>([\s\S]*?)<\/deleted>/i),r=a.match(/<changed>([\s\S]*?)<\/changed>/i),s=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:s((null==l?void 0:l[1])||""),changedItemCount:s((null==r?void 0:r[1])||"")})}if(0===t.length)return e;for(var d=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,a=0,l=d.substring(0,n.index).split("\n").reverse();a<l.length;a++){var r=l[a].trim();if(""!==r){/^\d+\.\s/.test(r)&&(o=!0);break}}if(!o)return"continue";var s=n.endIndex,c=e+1<t.length?t[e+1].index:d.length,u=d.substring(s,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),d=d.substring(0,s)+u+d.substring(c)},u=t.length-1;u>=0;u--)c(u);return d}(n=(n=(n=(n=(n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/ai_reasoning\$(\d+)/g,function(e,n){return"ai_reasoning$".concat(n,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(e,n,i){var t=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(n,' data-raw="').concat(t,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(e,n,i,t,o){var a=t.match(/<table[\s\S]*?<\/table>/i);if(a){var l=btoa(encodeURIComponent(a[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var a=n.substring(0,o),l=a.lastIndexOf("\n"),r=/^\s+[-*]\s/.test(a.substring(l+1))||/^\s+\d+\.\s/.test(a.substring(l+1)),s=/^\s*(\d+\.|\s*[-*])\s+$/.test(a.substring(l+1));if(r||s){var d=t;return d=(d=(d=(d=d.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(d,"</updated>")}return e})),n=function(e){var n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),"<deleted>".concat(i,"</deleted>")});return n.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(n),n=E(n)},Re=i.useMemo(function(){return v?Se(v):v},[v]);i.useEffect(function(){je(k||ee)},[k,ee]);var Ie=i.useMemo(function(){return{upt:function(i){var t;i.node;var o=i.children,a=e.__rest(i,["node","children"]),l=null==a?void 0:a.id,r=l?null===(t=l.split("$"))||void 0===t?void 0:t[1]:null,s=ee.find(function(e){return e.id.toString()===r});return s?n.jsx(x.default,e.__assign({aiReason:s,customStyles:null==P?void 0:P.inlineUpdatedComponent,handleClickCognitiveDecision:null==X?void 0:X.handleClickCognitiveDecision,handleClickUpdatedPill:null==X?void 0:X.handleClickUpdatedPill,handleClickOutputValue:null==X?void 0:X.handleClickOutputValue,customIcons:null==X?void 0:X.customIcons},{children:o})):o},del:function(i){i.node;var t=i.children,o=e.__rest(i,["node","children"]);return n.jsx("span",e.__assign({className:a.default.deleted,style:null==P?void 0:P.deleted},o,{onClick:o.onclick},{children:t}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.inserted,style:null==P?void 0:P.inserted},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:a.default.heading1,style:null==P?void 0:P.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:a.default.heading2,style:null==P?void 0:P.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:a.default.heading3,style:null==P?void 0:P.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:a.default.bold,style:null==P?void 0:P.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:a.default.paragraph,style:null==P?void 0:P.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(d.default,e.__assign({},o,{showUserStoryDiff:N,currentUpdatedTagId:ue,setCurrentUpdatedTagId:ge,userStory:K,setUserStory:Z,setAiReasoning:ne,node:t,isCraflow:O,onCraAccept:F,onCraReject:B,customStyles:null==P?void 0:P.updatedContent,craFlowConfig:W}))},ol:function(i){var t,o,l,r=i.node,s=e.__rest(i,["node"]),d=null!==(l=null!==(o=null===(t=null==r?void 0:r.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==s?void 0:s.start)&&void 0!==l?l:void 0;return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==P?void 0:P.olist},d?{start:Number(d)}:{},{children:null==s?void 0:s.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:a.default.unorderedList,style:null==P?void 0:P.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:a.default.tableWrapper},{children:n.jsx("table",e.__assign({className:a.default.table,style:null==P?void 0:P.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(q,{node:i,children:t,customStyles:P})},td:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,s=e.__rest(l,["style"]);return n.jsx(b.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},s,{style:r?{cssText:r}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,s=e.__rest(l,["style"]);return n.jsx(b.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},s,{style:r?{cssText:r}:void 0},{children:a}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),a="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(C.default,e.__assign({},o,{customStyles:null==P?void 0:P.recommendationBlock,label:a}))},a:function(t){var o,a,l;t.inline,t.children,t.node;var r=e.__rest(t,["inline","children","node"]),s=i.useContext(b)||"true"==(null==r?void 0:r.table),d="".concat(null==r?void 0:r.href),c=null===(o=d.split("$"))||void 0===o?void 0:o[0],u=null===(a=d.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===c){var g=(null!==(l=N?$:ee)&&void 0!==l?l:[]).find(function(e){return e.id.toString()===decodeURIComponent(u)}),v=oe.includes(u);if(g)return s?n.jsx(A,{aiReason:g,customStyle:null==P?void 0:P.tableAiReasoning,customIcons:le,isHighConfidence:g.relevance_score>=h.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING}):n.jsx(h.default,{aiReason:g,isSourceHasHighlight:v,customIcons:le,customStyles:{aiReasoningContent:null==P?void 0:P.aiReasoningContent,aiReasoningAccordion:null==P?void 0:P.aiReasoningAccordion,aiReasoningMarkdown:null==P?void 0:P.aiReasoningMarkdown,aiReasoningPill:null==P?void 0:P.aiReasoningPill,webCitation:null==P?void 0:P.webCitation,stormeeCitation:null==P?void 0:P.stormeeCitation,waveformCitation:null==P?void 0:P.waveformCitation,imageCitation:null==P?void 0:P.imageCitation,fileCitation:null==P?void 0:P.fileCitation,appModCitation:null==P?void 0:P.appModCitation,rcaCitation:null==P?void 0:P.rcaCitation,readFileCitation:null==P?void 0:P.readFileCitation,loadingCitations:null==P?void 0:P.loadingCitations,chatCitation:null==P?void 0:P.chatCitation,bigEnoughCitation:null==P?void 0:P.bigEnoughCitation}})}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:a.default.blockCode,style:null==P?void 0:P.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==P?void 0:P.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(s.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(r.Info,{size:16,className:a.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",a=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(e){var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n}(t);return n.jsx(c.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==P?void 0:P.generatedCodePill,content:null==P?void 0:P.generatedCodeContent}})},updatedsegment:function(i){var t=i.node,o=i.children,a=e.__rest(i,["node","children"]);return n.jsx(j.default,{node:t,children:o,props:a,segmentComponentConfig:G,customStyles:P,customIcons:L,extractText:ye,isUpdatedSegment:!0})},segment:function(i){var t=i.node,o=i.children,a=e.__rest(i,["node","children"]);return n.jsx(j.default,{node:t,children:o,props:a,segmentComponentConfig:G,customStyles:P,customIcons:L,extractText:ye})}}},[xe,W,ee,D,ue,N,v,L,te,oe,P]);return i.useEffect(function(){if(Q.current){if(te.length){var e;if(0===oe.length||V)requestAnimationFrame(function(){se([te[ae].replace(/\*/g,"")])});else{var n=Q.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){se([te[ae].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}de()}},[te,oe,ae,V]),n.jsx(w.Provider,e.__assign({value:{expandedInfo:fe,setExpanded:Ce,reasonToRow:pe}},{children:n.jsxs("div",e.__assign({ref:Q,className:"".concat(a.default.container," ").concat("approving"!==_?a.default.wrapper:""," ").concat(M||""),style:null==P?void 0:P.container},{children:[n.jsx(R.default,e.__assign({components:Ie,rehypePlugins:[I.default]},{children:Re})),me>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==P?void 0:P.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==P?void 0:P.confidenceScore},{children:[n.jsx(p.default,{size:14,color:(null==P?void 0:P.confidenceScoreIconColor)||"#166534"}),me,"%"]}))})),U&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==P?void 0:P.citationLoaderContainer},{children:n.jsx(u.default,{customStyles:{container:null==P?void 0:P.citationLoadingContainer,icon:null==P?void 0:P.citationLoadingIcon,text:null==P?void 0:P.citationLoadingText}})})),f&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==P?void 0:P.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(m.default,{customStyles:null==P?void 0:P.attachedContext})}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),a=require("./UserStoryWithCitation.module.css.js"),l=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),s=require("@mui/material"),d=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),v=require("../../icons/CognitiveDecision.js"),f=require("../../icons/BrainRed.js"),h=require("../ai-reasoning/AiReasoningCitation.js"),p=require("../../icons/RelevanceScoreIcon.js"),m=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),_=require("../ai-reasoning/AiReasoningCitationContent.js"),x=require("./components/InlineUpdatedComponent.js"),j=require("../segment/SegmentWrapper.js"),y=require("../../store/markdown-context.js");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R=S(i),I=S(t),w=S(o),b=i.createContext(!1),N=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),A=i.createContext({rowId:""}),q=function(t){var o,l=t.aiReason,r=t.isHighConfidence,s=t.customStyle,d=t.customIcons,c=i.useContext(N),u=c.expandedInfo,g=c.setExpanded,h=c.reasonToRow,p=i.useContext(A).rowId,m=String(l.id);p&&h.current.set(m,p);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===l.id,_=r?(null==d?void 0:d.highConfidence)||n.jsx(v.default,{}):(null==d?void 0:d.lowConfidence)||n.jsx(f.default,{});return n.jsxs("button",e.__assign({className:a.default.aiReasoningButton,style:s,onClick:function(e){e.stopPropagation(),e.preventDefault(),g(C?null:p,C?null:l)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)})]}))},k=function(t){var o,l,r=t.children,s=t.node,d=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,g=i.useContext(N).expandedInfo,v=(null==g?void 0:g.rowId)===u,f=Array.isArray(null==s?void 0:s.children)?s.children.filter(function(e){return"element"===e.type}).length:1,h=null!==(l=null===(o=null==s?void 0:s.properties)||void 0===o?void 0:o.style)&&void 0!==l?l:void 0;return n.jsxs(A.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:h?{cssText:h}:void 0},{children:r})),v&&(null==g?void 0:g.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:f||1,className:a.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellContent},{children:n.jsx(_.default,{aiReason:g.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==d?void 0:d.aiReasoningContent,aiReasoningAccordion:null==d?void 0:d.aiReasoningAccordion,aiReasoningMarkdown:null==d?void 0:d.aiReasoningMarkdown,aiReasoningPill:null==d?void 0:d.aiReasoningPill,webCitation:null==d?void 0:d.webCitation,stormeeCitation:null==d?void 0:d.stormeeCitation,waveformCitation:null==d?void 0:d.waveformCitation,imageCitation:null==d?void 0:d.imageCitation,fileCitation:null==d?void 0:d.fileCitation,appModCitation:null==d?void 0:d.appModCitation,rcaCitation:null==d?void 0:d.rcaCitation,readFileCitation:null==d?void 0:d.readFileCitation,loadingCitations:null==d?void 0:d.loadingCitations,chatCitation:null==d?void 0:d.chatCitation}})}))}))}))}))]}))};var E=["del","ins"];function T(e){return function(e,n,i){var t=n.join("|");return e.replace(new RegExp("<(".concat(t,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(e,n,t){return"<".concat(n,">").concat(i(t),"</").concat(n,">")})}(e,E,function(e){return e.split(/(<[^>]+>)/g).map(function(e){return!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;var n=[];return e.replace(/`([^`\n]+)`/g,function(e,i){var t=n.push(i)-1;return"@@CODE_SPAN_".concat(t,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(e,i){var t,o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return"<code>".concat(o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(e)}).join("")})}exports.default=function(t){var o,v=t.message,f=t.isParent,_=t.scenario,S=t.showUserStoryDiff,A=void 0!==S&&S,E=t.aiReasoningsForBlock,U=t.isCitationLoadingDisplay,M=void 0!==U&&U,P=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var L=t.customStyles,$=t.customIcons,D=t.aiReasoningDiffView,H=t.userStoryCitations,O=t.artifactId,F=t.isCraflow,B=t.onCraAccept,W=t.onCraReject,z=t.craFlowConfig,V=t.isDisplayHighlightControl,G=void 0!==V&&V,Q=i.useRef(null),J=g.useRequirementAI(),K=J.userStory,X=J.inlineUpdateComponentConfig,Y=J.getAvgScoreForStory,Z=J.setUserStory,ee=J.aiReasoning,ne=J.setAiReasoning,ie=J.customIcons,te=J.searchQueryList,oe=J.searchQueryReasoningIdList,ae=J.currentHighlightIndex,le=J.segmentComponentConfig,re=null!=$?$:null==ie?void 0:ie.userStoryIcons;null==L||L.searchHighlight;var se=l.useMarkdownSearch(Q),de=se.search,ce=se.clear,ue=i.useState("1"),ge=ue[0],ve=ue[1],fe=i.useState(null),he=fe[0],pe=fe[1],me=i.useRef(new Map),Ce=i.useCallback(function(e,n){pe(e&&n?{rowId:e,aiReason:n}:null)},[]),_e=O?Y(O):0,xe=i.useState([]),je=xe[0],ye=xe[1],Se=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Se).join(""):R.default.isValidElement(e)?Se(e.props.children):""},Re=function(e){var n=e;return n=function(e){for(var n,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[],o=new RegExp(i.source,i.flags);null!==(n=o.exec(e));){var a=n[0],l=a.match(/<deleted>([\s\S]*?)<\/deleted>/i),r=a.match(/<changed>([\s\S]*?)<\/changed>/i),s=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:s((null==l?void 0:l[1])||""),changedItemCount:s((null==r?void 0:r[1])||"")})}if(0===t.length)return e;for(var d=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,a=0,l=d.substring(0,n.index).split("\n").reverse();a<l.length;a++){var r=l[a].trim();if(""!==r){/^\d+\.\s/.test(r)&&(o=!0);break}}if(!o)return"continue";var s=n.endIndex,c=e+1<t.length?t[e+1].index:d.length,u=d.substring(s,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),d=d.substring(0,s)+u+d.substring(c)},u=t.length-1;u>=0;u--)c(u);return d}(n=(n=(n=(n=(n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/ai_reasoning\$(\d+)/g,function(e,n){return"ai_reasoning$".concat(n,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(e,n,i){var t=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(n,' data-raw="').concat(t,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(e,n,i,t,o){var a=t.match(/<table[\s\S]*?<\/table>/i);if(a){var l=btoa(encodeURIComponent(a[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var a=n.substring(0,o),l=a.lastIndexOf("\n"),r=/^\s+[-*]\s/.test(a.substring(l+1))||/^\s+\d+\.\s/.test(a.substring(l+1)),s=/^\s*(\d+\.|\s*[-*])\s+$/.test(a.substring(l+1));if(r||s){var d=t;return d=(d=(d=(d=d.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(d,"</updated>")}return e})),n=function(e){var n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),"<deleted>".concat(i,"</deleted>")});return n.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(n),n=T(n)},Ie=i.useMemo(function(){return v?Re(v):v},[v]);i.useEffect(function(){ye(E||ee)},[E,ee]);var we=i.useMemo(function(){return{upt:function(i){var t;i.node;var o=i.children,a=e.__rest(i,["node","children"]),l=null==a?void 0:a.id,r=l?null===(t=l.split("$"))||void 0===t?void 0:t[1]:null,s=ee.find(function(e){return e.id.toString()===r});return s?n.jsx(x.default,e.__assign({aiReason:s,customStyles:null==L?void 0:L.inlineUpdatedComponent,handleClickCognitiveDecision:null==X?void 0:X.handleClickCognitiveDecision,handleClickUpdatedPill:null==X?void 0:X.handleClickUpdatedPill,handleClickOutputValue:null==X?void 0:X.handleClickOutputValue,customIcons:null==X?void 0:X.customIcons},{children:o})):o},del:function(i){i.node;var t=i.children,o=e.__rest(i,["node","children"]);return n.jsx("span",e.__assign({className:a.default.deleted,style:null==L?void 0:L.deleted},o,{onClick:o.onclick},{children:t}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.inserted,style:null==L?void 0:L.inserted},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:a.default.heading1,style:null==L?void 0:L.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:a.default.heading2,style:null==L?void 0:L.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:a.default.heading3,style:null==L?void 0:L.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:a.default.bold,style:null==L?void 0:L.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:a.default.paragraph,style:null==L?void 0:L.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(d.default,e.__assign({},o,{showUserStoryDiff:A,currentUpdatedTagId:ge,setCurrentUpdatedTagId:ve,userStory:K,setUserStory:Z,setAiReasoning:ne,node:t,isCraflow:F,onCraAccept:B,onCraReject:W,customStyles:null==L?void 0:L.updatedContent,craFlowConfig:z}))},ol:function(i){var t,o,l,r=i.node,s=e.__rest(i,["node"]),d=null!==(l=null!==(o=null===(t=null==r?void 0:r.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==s?void 0:s.start)&&void 0!==l?l:void 0;return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==L?void 0:L.olist},d?{start:Number(d)}:{},{children:null==s?void 0:s.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:a.default.unorderedList,style:null==L?void 0:L.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:a.default.tableWrapper},{children:n.jsx("table",e.__assign({className:a.default.table,style:null==L?void 0:L.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(k,{node:i,children:t,customStyles:L})},td:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,s=e.__rest(l,["style"]);return n.jsx(b.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},s,{style:r?{cssText:r}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,s=e.__rest(l,["style"]);return n.jsx(b.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},s,{style:r?{cssText:r}:void 0},{children:a}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),a="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(m.default,e.__assign({},o,{customStyles:null==L?void 0:L.recommendationBlock,label:a}))},a:function(t){var o,a,l;t.inline,t.children,t.node;var r=e.__rest(t,["inline","children","node"]),s=i.useContext(b)||"true"==(null==r?void 0:r.table),d="".concat(null==r?void 0:r.href),c=null===(o=d.split("$"))||void 0===o?void 0:o[0],u=null===(a=d.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===c){var g=(null!==(l=A?D:ee)&&void 0!==l?l:[]).find(function(e){return e.id.toString()===decodeURIComponent(u)}),v=oe.includes(u);if(g)return s?n.jsx(q,{aiReason:g,customStyle:null==L?void 0:L.tableAiReasoning,customIcons:re,isHighConfidence:g.relevance_score>=h.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING}):n.jsx(h.default,{aiReason:g,isSourceHasHighlight:v,customIcons:re,customStyles:{aiReasoningContent:null==L?void 0:L.aiReasoningContent,aiReasoningAccordion:null==L?void 0:L.aiReasoningAccordion,aiReasoningMarkdown:null==L?void 0:L.aiReasoningMarkdown,aiReasoningPill:null==L?void 0:L.aiReasoningPill,webCitation:null==L?void 0:L.webCitation,stormeeCitation:null==L?void 0:L.stormeeCitation,waveformCitation:null==L?void 0:L.waveformCitation,imageCitation:null==L?void 0:L.imageCitation,fileCitation:null==L?void 0:L.fileCitation,appModCitation:null==L?void 0:L.appModCitation,rcaCitation:null==L?void 0:L.rcaCitation,readFileCitation:null==L?void 0:L.readFileCitation,loadingCitations:null==L?void 0:L.loadingCitations,chatCitation:null==L?void 0:L.chatCitation,bigEnoughCitation:null==L?void 0:L.bigEnoughCitation}})}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:a.default.blockCode,style:null==L?void 0:L.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==L?void 0:L.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(s.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(r.Info,{size:16,className:a.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",a=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(e){var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n}(t);return n.jsx(c.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==L?void 0:L.generatedCodePill,content:null==L?void 0:L.generatedCodeContent}})},updatedsegment:function(i){var t,o,a,l,r=i.node,s=i.children,d=e.__rest(i,["node","children"]),c="".concat(null===(t=r.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=r.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=r.position)||void 0===a?void 0:a.end.line,"-").concat(null===(l=r.position)||void 0===l?void 0:l.end.column);return n.jsx(j.default,{id:c,node:r,children:s,props:d,segmentComponentConfig:le,customStyles:L,customIcons:$,extractText:Se,isUpdatedSegment:!0})},segment:function(i){var t,o,a,l,r=i.node,s=i.children,d=e.__rest(i,["node","children"]),c="".concat(null===(t=r.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=r.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=r.position)||void 0===a?void 0:a.end.line,"-").concat(null===(l=r.position)||void 0===l?void 0:l.end.column);return n.jsx(j.default,{id:c,node:r,children:s,props:d,segmentComponentConfig:le,customStyles:L,customIcons:$,extractText:Se})}}},[je,z,ee,H,ge,A,v,$,te,oe,L,le]);return i.useEffect(function(){if(Q.current){if(te.length){var e;if(0===oe.length||G)requestAnimationFrame(function(){de([te[ae].replace(/\*/g,"")])});else{var n=Q.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){de([te[ae].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}ce()}},[te,oe,ae,G]),i.useEffect(function(){return console.log("mounting userstorywithcitation"),function(){console.log("unmounting userstorywithcitation")}},[]),n.jsx(N.Provider,e.__assign({value:{expandedInfo:he,setExpanded:Ce,reasonToRow:me}},{children:n.jsxs("div",e.__assign({ref:Q,className:"".concat(a.default.container," ").concat("approving"!==_?a.default.wrapper:""," ").concat(P||""),style:null==L?void 0:L.container},{children:[n.jsx(y.MarkdownContextProvider,{children:n.jsx(I.default,e.__assign({components:we,rehypePlugins:[w.default]},{children:Ie}))}),_e>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==L?void 0:L.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==L?void 0:L.confidenceScore},{children:[n.jsx(p.default,{size:14,color:(null==L?void 0:L.confidenceScoreIconColor)||"#166534"}),_e,"%"]}))})),M&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==L?void 0:L.citationLoaderContainer},{children:n.jsx(u.default,{customStyles:{container:null==L?void 0:L.citationLoadingContainer,icon:null==L?void 0:L.citationLoadingIcon,text:null==L?void 0:L.citationLoadingText}})})),f&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==L?void 0:L.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(C.default,{customStyles:null==L?void 0:L.attachedContext})}))]}))}))};
2
2
  //# sourceMappingURL=UserStoryWithCitation.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),e=require("react/jsx-runtime"),a=require("react"),r=a.createContext({citationsMetadata:new Map,setCitationsMetadata:function(){return new Map},updateCitationsMetadata:function(){}});exports.MarkdownContextProvider=function(n){var i=n.children,o=a.useState(new Map),s=o[0],u=o[1];return e.jsx(r.Provider,t.__assign({value:{citationsMetadata:s,setCitationsMetadata:u,updateCitationsMetadata:function(t,e){u(function(a){var r=void 0;a.has(t)&&(r=a.get(t));var n=e(r),i=new Map(a);return i.set(t,n),i})}}},{children:i}))},exports.MarkdownStateContext=r;
2
+ //# sourceMappingURL=markdown-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-context.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as t,__generator as n,__spreadArray as o}from"tslib";import{jsxs as i,jsx as l,Fragment as r}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as u}from"react";import{ExternalLink as c,Download as d,Share2 as v,Copy as m,LoaderCircle as f,PencilIcon as y,Plus as h,Trash2 as p,Ellipsis as S,ChevronUp as g,ChevronDown as C,ChevronUpIcon as I,ChevronDownIcon as w,Info as b,Bookmark as N}from"lucide-react";import B from"showdown";import{Menu as D,MenuItem as U,Tooltip as x}from"@mui/material";import{v4 as E}from"uuid";import k from"./UserStoryCard.module.css.js";import{formatMarkdown as T,indentMarkdown as A}from"../../utils/helpers.js";import{replaceTitleSection as M}from"../../utils/user-story.utils.js";import _ from"../../shared/AtomicButton.js";import P from"../RichTextEditor/RichTextEditor.js";import H from"../userstory-with-citation/UserStoryWithCitation.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as j}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as L}from"./TitleEditor/TitleEditor.js";function z(t){for(var n,o=[],i=/<learned>(.*?)<\/learned>/g,r=0,a=0;null!==(n=i.exec(t));){var s=n[1],u=n.index;u>r&&o.push(l("span",{children:t.slice(r,u)},"text-pre-".concat(a++))),o.push(l(x,e({title:s,placement:"top"},{children:l(b,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(E()))),r=i.lastIndex}return r<(null==t?void 0:t.length)&&o.push(l("span",{children:t.slice(r)},"text-post-".concat(a++))),o}function W(t,n,o){var i;if(!t)return{};if(n)return e({},t.parentConfig);var l=e({},t.childConfig);return o&&(null===(i=t.subFeatureOverrides)||void 0===i?void 0:i[o])?e(e({},l),t.subFeatureOverrides[o]):l}var O=function(t){var n,o=t.displayName,r=R().customStyles,a=null===(n=null==r?void 0:r.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return i("div",e({className:k.displayName,style:null==a?void 0:a.wrapper},{children:[l(N,{className:k.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),i("span",e({style:null==a?void 0:a.label},{children:[o,":"]}))]}))},V=function(I){var w,b,N,x,F,G,q,Q=I.isUserStoryCurrentlyUpdated,Z=I.artifactId,J=I.artifactTitleId,K=I.parentUserStory,X=I.currentUserStory,Y=I.onUserStoryChange,$=I.parentIndex,ee=I.currentIndex,te=I.enableDownload,ne=I.isDiffEditReviewMode,oe=I.showUserStoryDiff,ie=I.handleDownloadUserStory,le=I.handleOpenSendDialog,re=I.updateUserStoryArtifact,ae=I.selectedArtifactId,se=I.isDisplayHighlightControl,ue=I.elementDisplayConfig,ce=I._resolvedConfig,de=I.showWrapper,ve=void 0!==de&&de,me=I.segmentComponentConfig,fe=I.actionItemsConfig,ye=I.onDelete,he=R(),pe=he.searchQueryList,Se=he.citations,ge=he.customStyles,Ce=null==ge?void 0:ge.userStoryCardStyles,Ie=null===(w=null==ge?void 0:ge.userStoryCardStyles)||void 0===w?void 0:w.userStoryEditStyles,we=null===(b=null==ge?void 0:ge.userStoryScreenStyles)||void 0===b?void 0:b.userStoryContentStyles,be=null==Ce?void 0:Ce.progressHeaderStyles,Ne=a(e(e({},structuredClone(X)),{value:T(X.value)||""})),Be=Ne[0],De=Ne[1],Ue=a({userStory:!!X.isDefaultEdit}),xe=Ue[0],Ee=Ue[1],ke=a(!1),Te=ke[0],Ae=ke[1],Me=a(null),_e=Me[0],Pe=Me[1],He=R(),Re=He.userStory,je=He.customIcons,Le=a(""===$||ae===X.artifactId||!!X.isDefaultOpen),ze=Le[0],We=Le[1],Oe=a(!1);Oe[0];var Ve=Oe[1],Fe=a(null),Ge=Fe[0],qe=Fe[1],Qe=a(null),Ze=Qe[0],Je=Qe[1],Ke=a(!1),Xe=Ke[0],Ye=Ke[1],$e=s(null),et=a(!1);et[0];var tt=et[1],nt=s(null);u(function(){Q&&We(Q)},[Q]),u(function(){De(e(e({},structuredClone(X)),{value:T(X.value)||""}))},[X]),u(function(){pe.length>0?We(!0):ae&&We(ae===X.artifactId)},[pe,ae,X.artifactId]);var ot=function(){qe(null)},it=function(){Je(null)},lt=function(){We(function(e){return!e})};var rt=null!=(null==X?void 0:X.big_enough)&&!Number.isNaN(X.big_enough)&&!!(null==X?void 0:X.big_enough_decision_factors),at=""===$,st=null!=ce?ce:W(ue,at),ut=!ne&&!oe;return u(function(){if(_e){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(_e));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[_e]),u(function(){X.isDefaultEdit&&Ee(function(t){return e(e({},t),{userStory:!0})})},[X.isDefaultEdit]),i("div",e({className:k.card,style:null==Ce?void 0:Ce.cardStyle,id:"story-card-".concat(X.title),"data-expanded":ze},{children:[i("div",e({className:k.titleSection,style:null==Ce?void 0:Ce.titleSection},{children:[i("div",e({className:k.titleRow,style:null==Ce?void 0:Ce.titleRow,onClick:lt},{children:[i("div",e({className:k.titleLeft,style:null==Ce?void 0:Ce.titleLeft,onMouseEnter:function(){return tt(!0)},onMouseLeave:function(){return tt(!1)}},{children:[l(O,{displayName:J}),Te&&ut?l(L,{title:X.title,onSave:function(o){return function(o,i){return t(void 0,void 0,void 0,function(){var t,l;return n(this,function(n){try{t=e({},X),X.artifactId===i?t.title=o:t.sub_features=(null===(l=X.sub_features)||void 0===l?void 0:l.map(function(t){return t.artifactId===i?e(e({},t),{title:o}):t}))||[],De(t),Y(t),Ae(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(o,X.artifactId)},onCancel:function(){Ae(!1)},inputStyle:null==Ie?void 0:Ie.inlineTitleInput,confirmButtonStyle:null==Ie?void 0:Ie.inlineTitleConfirm,cancelButtonStyle:null==Ie?void 0:Ie.inlineTitleCancel},"inline-title-editor"):i("div",e({className:k.storyTitleWrapper},{children:[l("h2",e({title:X.title,className:k.storyTitle,style:null==Ce?void 0:Ce.storyTitle},{children:z(X.title)}),X.artifactId),l("button",e({type:"button",className:k.titleEditButton,style:null==Ie?void 0:Ie.titleEditButton,onClick:function(e){e.stopPropagation(),Ae(!0),ze||We(!0)},"aria-label":"Edit title",title:"Edit title"},{children:l("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:l("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"})}))}))]}))]})),i("div",e({className:k.titleActions,style:null==Ce?void 0:Ce.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(st.showProgressPercentage||st.showGapBox)&&ve&&i("div",e({className:k.progressHeader,style:null==be?void 0:be.wrapper},{children:[st.showProgressPercentage&&i("div",e({className:k.progressPercentage,style:null==be?void 0:be.percentage},{children:[null!==(x=null!==(N=null==X?void 0:X.confidenceScore)&&void 0!==N?N:null==st?void 0:st.confidenceValue)&&void 0!==x?x:"0","%"]})),st.showGapBox&&i("div",e({className:k.gapBox,style:null==be?void 0:be.gapBox},{children:[null!==(G=null!==(F=null==X?void 0:X.gapValue)&&void 0!==F?F:null==st?void 0:st.gapBoxValue)&&void 0!==G?G:"2"," ","Gaps"]}))]})),rt&&l(j,{customIcons:null==je?void 0:je.userStoryIcons,customStyles:null==Ce?void 0:Ce.aiReasoningCitaionStyles,currentUserStory:X,panelStyles:null==Ce?void 0:Ce.BigEnoughStyles}),!xe.userStory&&i(r,{children:[!1!==(null==st?void 0:st.showShareButton)&&l("button",e({className:k.iconButton,style:null==Ce?void 0:Ce.iconButton,onClick:function(e){qe(e.currentTarget)}},{children:l(c,{size:16})})),i(D,e({id:"user-story-share-menu",anchorEl:Ge,open:!!Ge,onClose:function(){return qe(null)},style:null==Ce?void 0:Ce.userStoryShareMenu},{children:[te&&l(U,e({style:null==Ce?void 0:Ce.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return Ve(!0),ie?[4,Promise.all([ie("pdf"),ie("doc")])]:[2];case 1:return e.sent(),Ve(!1),[2]}})})}},{children:i("div",e({ref:$e,className:k.menuItemContent,style:null==Ce?void 0:Ce.menuItemContent},{children:[l(d,{size:16,color:null==Ce?void 0:Ce.menuIconColor}),l("p",e({style:null==Ce?void 0:Ce.menuLabel},{children:"Download"}))]}))})),l(U,e({style:null==Ce?void 0:Ce.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){return t=X,K&&(t=e(e({},X),{value:"".concat(M(null==K?void 0:K.value,X.title)," \n").concat(X.value)})),null==le||le(!0,[t],X.artifactId),ot(),[2]})})}},{children:i("div",e({style:null==Ce?void 0:Ce.menuItemContent,className:k.menuItemContentPadded},{children:[l(v,{size:16,color:null==Ce?void 0:Ce.menuIconColor}),l("p",e({style:null==Ce?void 0:Ce.menuLabel},{children:"Send"}))]}))})),l(U,e({style:null==Ce?void 0:Ce.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var e,t,o,i,l;return n(this,function(n){switch(n.label){case 0:e=new B.Converter,t=e.makeHtml(T(X.value)||X.value),o=function(e){var t=(new B.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(T(X.value)||X.value),i=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([i])];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 ot(),[7];case 5:return[2]}})})}},{children:i("div",e({style:null==Ce?void 0:Ce.menuItemContent,className:k.menuItemContentPadded},{children:[l(m,{size:16,color:null==Ce?void 0:Ce.menuIconColor}),l("p",e({style:null==Ce?void 0:Ce.menuLabel},{children:"Copy"}))]}))}))]}))]}),xe.userStory&&ze?l(_,{type:"outline",children:"Cancel",style:null==Ce?void 0:Ce.cancelButton,onClick:function(){var t;null===(t=nt.current)||void 0===t||t.abort(),Ee(function(t){return e(e({},t),{userStory:!1})})}}):l(r,{}),xe.userStory&&ze?l(_,{type:"fill",children:Xe?i("span",e({className:k.savingSpinner,style:null==Ce?void 0:Ce.savingSpinner},{children:[l(f,{className:k.spinAnimation,style:null==Ce?void 0:Ce.spinAnimation}),l("span",{children:"Saving..."})]})):"Save",isDisable:Xe,style:Xe?null==Ce?void 0:Ce.savingButton:null==Ce?void 0:Ce.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 Ye(!0),"userStory"==="userStory"&&(Y(Be),console.log("I am changing RTE editor values",Be)),[4,re(Se,Re,Z,null===(t=nt.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),Y(e(e({},Be),{isDefaultEdit:!1})),Ee(function(t){return e(e({},t),{userStory:!1})}),Ye(!1),[2]}})})}}):!ne&&!oe&&ze&&!1!==(null==st?void 0:st.showEditButton)&&l("button",e({className:k.iconButton,style:null==Ce?void 0:Ce.editButton,onClick:function(){return Ee(function(t){return e(e({},t),{userStory:!0})})}},{children:l(y,{color:null==Ce?void 0:Ce.pencilIconColor,size:16})})),at&&ze&&!ne&&!oe&&!1!==(null==st?void 0:st.showEditButton)&&i("button",e({type:"button",className:k.addSectionButton,style:null==Ie?void 0:Ie.addSectionButton,onClick:function(t){var n,i,l;t.stopPropagation();var r=(null!==(i=null===(n=X.sub_features)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+1,a={artifactId:E(),title:"New Section ".concat(r),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},s=e(e({},X),{sub_features:o(o([],null!==(l=X.sub_features)&&void 0!==l?l:[],!0),[a],!1)});De(s),Y(s),We(!0),Pe(a.title)},"aria-label":"Add section",title:"Add section"},{children:[l(h,{size:14}),l("span",e({className:k.addSectionLabel},{children:"Add Section"}))]})),!at&&!ne&&!oe&&l("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==ye||ye()},className:k.iconButton,style:null==Ie?void 0:Ie.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:l(p,{size:16})})),(null==st?void 0:st.actionItemsButton)&&i(r,{children:[l("span",e({className:k.actionItemBtn,style:null==Ce?void 0:Ce.actionItemBtn,onClick:function(e){e.stopPropagation(),Je(e.currentTarget)}},{children:l(S,{})})),l(D,e({id:"user-story-action-menu",anchorEl:Ze,open:!!Ze,onClose:it,style:null==Ce?void 0:Ce.userStoryShareMenu},{children:null==fe?void 0:fe.items.map(function(t,n){return l(U,e({style:null==Ce?void 0:Ce.userStoryMenuItem,onClick:function(){t.onclick(),it()}},{children:i("div",e({className:k.menuItemContent,style:e(e({},null==Ce?void 0:Ce.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[l("span",e({className:k.menuItemIcon,style:null==Ce?void 0:Ce.menuItemIcon},{children:t.icon})),l("p",e({style:null==Ce?void 0:Ce.menuLabel},{children:t.name})),l("span",{className:k.menuItemRight,style:null==Ce?void 0:Ce.menuItemRight})]}))}),"action-item-".concat(n,"-").concat(t.name))})}))]}),l("button",e({type:"button",onClick:function(e){e.stopPropagation(),lt()},style:null==Ce?void 0:Ce.chevronButton,className:k.chevronButton},{children:l(ze?g:C,{className:k.chevronIcon,color:null==Ce?void 0:Ce.chevronIconColor})}))]}))]})),l("div",{className:k.divider,style:null==Ce?void 0:Ce.dividerStyle})]})),ze&&l("div",e({className:k.cardContent,style:null==Ce?void 0:Ce.cardContentStyle},{children:i("div",e({className:k.contentInner,style:null==Ce?void 0:Ce.contentInner},{children:[i("div",e({className:k.descriptionSection,style:null==Ce?void 0:Ce.descriptionSection},{children:[l("div",{className:k.justifyBetween,style:null==Ce?void 0:Ce.justifyBetween}),xe.userStory?l(P,{minHeight:"100%",height:"100%",type:"string",value:T(X.value)||"",handleUpdateState:function(t,n){var o=A(n);De(function(t){return e(e({},t),{value:o||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:xe.userStory?"edit":"readOnly"}):l(H,{showUserStoryDiff:oe,isParent:""===$,message:T(X.value)||"",artifactId:X.artifactId,customStyles:we,isDisplayHighlightControl:se,segmentComponentConfig:me})]})),null===(q=Be.sub_features)||void 0===q?void 0:q.map(function(t,n){var i=W(ue,!1,t.artifactId);return l(V,{artifactId:Z,isUserStoryCurrentlyUpdated:Q,artifactTitleId:"".concat(J,"-").concat(String.fromCharCode(65+n)),parentUserStory:X,parentIndex:"".concat($).concat($&&".").concat(ee),currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(t){return function(t,n){var i=o([],X.sub_features||[],!0);i[t]=n,Y(e(e({},X),{sub_features:i}))}(n,t)},enableDownload:!0,isDiffEditReviewMode:ne,showUserStoryDiff:oe,updateUserStoryArtifact:re,handleDownloadUserStory:ie,handleOpenSendDialog:le,isDisplayHighlightControl:se,elementDisplayConfig:ue,_resolvedConfig:i,segmentComponentConfig:me,actionItemsConfig:fe,onDelete:function(){return function(t){var n=(X.sub_features||[]).filter(function(e,n){return n!==t}),o=e(e({},X),{sub_features:n});De(o),Y(o)}(n)}},t.artifactId)})]}))}))]}))},F=function(t){var n=t.artifactTitleIDs,a=t.isDiffEditReviewMode,s=t.showUserStoryDiff,u=t.updateUserStoryArtifact,c=t.isUserStoryCurrentlyUpdated,d=t.artifactId,v=t.handleOpenSendDialog,m=t.handleDownloadUserStory,f=t.selectedArtifactId,y=t.isDisplayHighlightControl,h=t.elementDisplayConfig,p=t.showWrapper,S=t.actionItemsConfig,g=R(),C=g.userStory,b=g.setUserStory,N=g.customStyles,B=g.searchQueryList,D=g.currentHighlightIndex,U=g.setCurrentHighlightIndex,x=g.segmentComponentConfig,E=null==N?void 0:N.userStoryCardStyles,T=0===D,A=D===B.length-1;return i("div",e({className:k.userStoryCardWrapper,style:y?e(e({},null==E?void 0:E.userStoryCardWrapper),{position:"relative"}):null==E?void 0:E.userStoryCardWrapper},{children:[y&&l(r,{children:B.length>0&&l("div",e({className:k.wrapper},{children:l("div",e({className:k.highlightNavigation},{children:i("div",e({className:k.navigationContainer},{children:[i("span",e({className:k.navCounter},{children:[D+1," of ",B.length]})),i("div",e({className:k.navButtons},{children:[l("button",e({onClick:function(){D>0&&U(function(e){return e-1})},className:k.navButton,disabled:T},{children:l(I,{size:20,className:k.navIcon})})),l("button",e({onClick:function(){D<B.length-1&&U(function(e){return e+1})},className:k.navButton,disabled:A},{children:l(w,{size:20,className:k.navIcon})}))]}))]}))}))}))}),C.map(function(e,t){var i=W(h,!0);return l(V,{isUserStoryCurrentlyUpdated:c,artifactId:d,artifactTitleId:n[t]||"",currentUserStory:e,onUserStoryChange:function(e){b(function(n){return n[t]=e,o([],n,!0)})},parentIndex:"",currentIndex:"".concat(t+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:u,handleOpenSendDialog:v,handleDownloadUserStory:m,selectedArtifactId:f,isDisplayHighlightControl:y,elementDisplayConfig:h,_resolvedConfig:i,showWrapper:p,segmentComponentConfig:x,actionItemsConfig:S},e.artifactId)})]}))};export{V as StoryCard,F as UserStoryCardWrapper,V as default,z as replaceLearnedTagsWithInfo};
1
+ import{__assign as e,__awaiter as t,__generator as n,__spreadArray as o}from"tslib";import{jsxs as i,jsx as l,Fragment as r}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as u}from"react";import{ExternalLink as c,Download as d,Share2 as v,Copy as f,LoaderCircle as m,PencilIcon as y,Plus as h,Trash2 as p,Ellipsis as S,ChevronUp as g,ChevronDown as C,ChevronUpIcon as I,ChevronDownIcon as w,Info as b,Bookmark as N}from"lucide-react";import B from"showdown";import{Menu as D,MenuItem as U,Tooltip as x}from"@mui/material";import{v4 as E}from"uuid";import k from"./UserStoryCard.module.css.js";import{formatMarkdown as T,indentMarkdown as A}from"../../utils/helpers.js";import{replaceTitleSection as M}from"../../utils/user-story.utils.js";import _ from"../../shared/AtomicButton.js";import P from"../RichTextEditor/RichTextEditor.js";import H from"../userstory-with-citation/UserStoryWithCitation.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as j}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as L}from"./TitleEditor/TitleEditor.js";function z(t){for(var n,o=[],i=/<learned>(.*?)<\/learned>/g,r=0,a=0;null!==(n=i.exec(t));){var s=n[1],u=n.index;u>r&&o.push(l("span",{children:t.slice(r,u)},"text-pre-".concat(a++))),o.push(l(x,e({title:s,placement:"top"},{children:l(b,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(E()))),r=i.lastIndex}return r<(null==t?void 0:t.length)&&o.push(l("span",{children:t.slice(r)},"text-post-".concat(a++))),o}function W(t,n,o){var i;if(!t)return{};if(n)return e({},t.parentConfig);var l=e({},t.childConfig);return o&&(null===(i=t.subFeatureOverrides)||void 0===i?void 0:i[o])?e(e({},l),t.subFeatureOverrides[o]):l}var O=function(t){var n,o=t.displayName,r=R().customStyles,a=null===(n=null==r?void 0:r.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return i("div",e({className:k.displayName,style:null==a?void 0:a.wrapper},{children:[l(N,{className:k.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),i("span",e({style:null==a?void 0:a.label},{children:[o,":"]}))]}))},V=function(I){var w,b,N,x,F,G,q,Q=I.isUserStoryCurrentlyUpdated,Z=I.artifactId,J=I.artifactTitleId,K=I.parentUserStory,X=I.currentUserStory,Y=I.onUserStoryChange,$=I.parentIndex,ee=I.currentIndex,te=I.enableDownload,ne=I.isDiffEditReviewMode,oe=I.showUserStoryDiff,ie=I.handleDownloadUserStory,le=I.handleOpenSendDialog,re=I.updateUserStoryArtifact,ae=I.selectedArtifactId,se=I.isDisplayHighlightControl,ue=I.elementDisplayConfig,ce=I._resolvedConfig,de=I.showWrapper,ve=void 0!==de&&de,fe=I.actionItemsConfig,me=I.onDelete,ye=R(),he=ye.searchQueryList,pe=ye.citations,Se=ye.customStyles,ge=null==Se?void 0:Se.userStoryCardStyles,Ce=null===(w=null==Se?void 0:Se.userStoryCardStyles)||void 0===w?void 0:w.userStoryEditStyles,Ie=null===(b=null==Se?void 0:Se.userStoryScreenStyles)||void 0===b?void 0:b.userStoryContentStyles,we=null==ge?void 0:ge.progressHeaderStyles,be=a(e(e({},structuredClone(X)),{value:T(X.value)||""})),Ne=be[0],Be=be[1],De=a({userStory:!!X.isDefaultEdit}),Ue=De[0],xe=De[1],Ee=a(!1),ke=Ee[0],Te=Ee[1],Ae=a(null),Me=Ae[0],_e=Ae[1],Pe=R(),He=Pe.userStory,Re=Pe.customIcons,je=a(""===$||ae===X.artifactId||!!X.isDefaultOpen),Le=je[0],ze=je[1],We=a(!1);We[0];var Oe=We[1],Ve=a(null),Fe=Ve[0],Ge=Ve[1],qe=a(null),Qe=qe[0],Ze=qe[1],Je=a(!1),Ke=Je[0],Xe=Je[1],Ye=s(null),$e=a(!1);$e[0];var et=$e[1],tt=s(null);u(function(){Q&&ze(Q)},[Q]),u(function(){Be(e(e({},structuredClone(X)),{value:T(X.value)||""}))},[X]),u(function(){he.length>0?ze(!0):ae&&ze(ae===X.artifactId)},[he,ae,X.artifactId]);var nt=function(){Ge(null)},ot=function(){Ze(null)},it=function(){ze(function(e){return!e})};var lt=null!=(null==X?void 0:X.big_enough)&&!Number.isNaN(X.big_enough)&&!!(null==X?void 0:X.big_enough_decision_factors),rt=""===$,at=null!=ce?ce:W(ue,rt),st=!ne&&!oe;return u(function(){if(Me){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(Me));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[Me]),u(function(){X.isDefaultEdit&&xe(function(t){return e(e({},t),{userStory:!0})})},[X.isDefaultEdit]),i("div",e({className:k.card,style:null==ge?void 0:ge.cardStyle,id:"story-card-".concat(X.title),"data-expanded":Le},{children:[i("div",e({className:k.titleSection,style:null==ge?void 0:ge.titleSection},{children:[i("div",e({className:k.titleRow,style:null==ge?void 0:ge.titleRow,onClick:it},{children:[i("div",e({className:k.titleLeft,style:null==ge?void 0:ge.titleLeft,onMouseEnter:function(){return et(!0)},onMouseLeave:function(){return et(!1)}},{children:[l(O,{displayName:J}),ke&&st?l(L,{title:X.title,onSave:function(o){return function(o,i){return t(void 0,void 0,void 0,function(){var t,l;return n(this,function(n){try{t=e({},X),X.artifactId===i?t.title=o:t.sub_features=(null===(l=X.sub_features)||void 0===l?void 0:l.map(function(t){return t.artifactId===i?e(e({},t),{title:o}):t}))||[],Be(t),Y(t),Te(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(o,X.artifactId)},onCancel:function(){Te(!1)},inputStyle:null==Ce?void 0:Ce.inlineTitleInput,confirmButtonStyle:null==Ce?void 0:Ce.inlineTitleConfirm,cancelButtonStyle:null==Ce?void 0:Ce.inlineTitleCancel},"inline-title-editor"):i("div",e({className:k.storyTitleWrapper},{children:[l("h2",e({title:X.title,className:k.storyTitle,style:null==ge?void 0:ge.storyTitle},{children:z(X.title)}),X.artifactId),l("button",e({type:"button",className:k.titleEditButton,style:null==Ce?void 0:Ce.titleEditButton,onClick:function(e){e.stopPropagation(),Te(!0),Le||ze(!0)},"aria-label":"Edit title",title:"Edit title"},{children:l("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:l("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"})}))}))]}))]})),i("div",e({className:k.titleActions,style:null==ge?void 0:ge.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(at.showProgressPercentage||at.showGapBox)&&ve&&i("div",e({className:k.progressHeader,style:null==we?void 0:we.wrapper},{children:[at.showProgressPercentage&&i("div",e({className:k.progressPercentage,style:null==we?void 0:we.percentage},{children:[null!==(x=null!==(N=null==X?void 0:X.confidenceScore)&&void 0!==N?N:null==at?void 0:at.confidenceValue)&&void 0!==x?x:"0","%"]})),at.showGapBox&&i("div",e({className:k.gapBox,style:null==we?void 0:we.gapBox},{children:[null!==(G=null!==(F=null==X?void 0:X.gapValue)&&void 0!==F?F:null==at?void 0:at.gapBoxValue)&&void 0!==G?G:"2"," ","Gaps"]}))]})),lt&&l(j,{customIcons:null==Re?void 0:Re.userStoryIcons,customStyles:null==ge?void 0:ge.aiReasoningCitaionStyles,currentUserStory:X,panelStyles:null==ge?void 0:ge.BigEnoughStyles}),!Ue.userStory&&i(r,{children:[!1!==(null==at?void 0:at.showShareButton)&&l("button",e({className:k.iconButton,style:null==ge?void 0:ge.iconButton,onClick:function(e){Ge(e.currentTarget)}},{children:l(c,{size:16})})),i(D,e({id:"user-story-share-menu",anchorEl:Fe,open:!!Fe,onClose:function(){return Ge(null)},style:null==ge?void 0:ge.userStoryShareMenu},{children:[te&&l(U,e({style:null==ge?void 0:ge.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return Oe(!0),ie?[4,Promise.all([ie("pdf"),ie("doc")])]:[2];case 1:return e.sent(),Oe(!1),[2]}})})}},{children:i("div",e({ref:Ye,className:k.menuItemContent,style:null==ge?void 0:ge.menuItemContent},{children:[l(d,{size:16,color:null==ge?void 0:ge.menuIconColor}),l("p",e({style:null==ge?void 0:ge.menuLabel},{children:"Download"}))]}))})),l(U,e({style:null==ge?void 0:ge.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){return t=X,K&&(t=e(e({},X),{value:"".concat(M(null==K?void 0:K.value,X.title)," \n").concat(X.value)})),null==le||le(!0,[t],X.artifactId),nt(),[2]})})}},{children:i("div",e({style:null==ge?void 0:ge.menuItemContent,className:k.menuItemContentPadded},{children:[l(v,{size:16,color:null==ge?void 0:ge.menuIconColor}),l("p",e({style:null==ge?void 0:ge.menuLabel},{children:"Send"}))]}))})),l(U,e({style:null==ge?void 0:ge.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var e,t,o,i,l;return n(this,function(n){switch(n.label){case 0:e=new B.Converter,t=e.makeHtml(T(X.value)||X.value),o=function(e){var t=(new B.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(T(X.value)||X.value),i=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([i])];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 nt(),[7];case 5:return[2]}})})}},{children:i("div",e({style:null==ge?void 0:ge.menuItemContent,className:k.menuItemContentPadded},{children:[l(f,{size:16,color:null==ge?void 0:ge.menuIconColor}),l("p",e({style:null==ge?void 0:ge.menuLabel},{children:"Copy"}))]}))}))]}))]}),Ue.userStory&&Le?l(_,{type:"outline",children:"Cancel",style:null==ge?void 0:ge.cancelButton,onClick:function(){var t;null===(t=tt.current)||void 0===t||t.abort(),xe(function(t){return e(e({},t),{userStory:!1})})}}):l(r,{}),Ue.userStory&&Le?l(_,{type:"fill",children:Ke?i("span",e({className:k.savingSpinner,style:null==ge?void 0:ge.savingSpinner},{children:[l(m,{className:k.spinAnimation,style:null==ge?void 0:ge.spinAnimation}),l("span",{children:"Saving..."})]})):"Save",isDisable:Ke,style:Ke?null==ge?void 0:ge.savingButton:null==ge?void 0:ge.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 Xe(!0),"userStory"==="userStory"&&(Y(Ne),console.log("I am changing RTE editor values",Ne)),[4,re(pe,He,Z,null===(t=tt.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),Y(e(e({},Ne),{isDefaultEdit:!1})),xe(function(t){return e(e({},t),{userStory:!1})}),Xe(!1),[2]}})})}}):!ne&&!oe&&Le&&!1!==(null==at?void 0:at.showEditButton)&&l("button",e({className:k.iconButton,style:null==ge?void 0:ge.editButton,onClick:function(){return xe(function(t){return e(e({},t),{userStory:!0})})}},{children:l(y,{color:null==ge?void 0:ge.pencilIconColor,size:16})})),rt&&Le&&!ne&&!oe&&!1!==(null==at?void 0:at.showEditButton)&&i("button",e({type:"button",className:k.addSectionButton,style:null==Ce?void 0:Ce.addSectionButton,onClick:function(t){var n,i,l;t.stopPropagation();var r=(null!==(i=null===(n=X.sub_features)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+1,a={artifactId:E(),title:"New Section ".concat(r),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},s=e(e({},X),{sub_features:o(o([],null!==(l=X.sub_features)&&void 0!==l?l:[],!0),[a],!1)});Be(s),Y(s),ze(!0),_e(a.title)},"aria-label":"Add section",title:"Add section"},{children:[l(h,{size:14}),l("span",e({className:k.addSectionLabel},{children:"Add Section"}))]})),!rt&&!ne&&!oe&&l("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==me||me()},className:k.iconButton,style:null==Ce?void 0:Ce.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:l(p,{size:16})})),(null==at?void 0:at.actionItemsButton)&&i(r,{children:[l("span",e({className:k.actionItemBtn,style:null==ge?void 0:ge.actionItemBtn,onClick:function(e){e.stopPropagation(),Ze(e.currentTarget)}},{children:l(S,{})})),l(D,e({id:"user-story-action-menu",anchorEl:Qe,open:!!Qe,onClose:ot,style:null==ge?void 0:ge.userStoryShareMenu},{children:null==fe?void 0:fe.items.map(function(t,n){return l(U,e({style:null==ge?void 0:ge.userStoryMenuItem,onClick:function(){t.onclick(),ot()}},{children:i("div",e({className:k.menuItemContent,style:e(e({},null==ge?void 0:ge.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[l("span",e({className:k.menuItemIcon,style:null==ge?void 0:ge.menuItemIcon},{children:t.icon})),l("p",e({style:null==ge?void 0:ge.menuLabel},{children:t.name})),l("span",{className:k.menuItemRight,style:null==ge?void 0:ge.menuItemRight})]}))}),"action-item-".concat(n,"-").concat(t.name))})}))]}),l("button",e({type:"button",onClick:function(e){e.stopPropagation(),it()},style:null==ge?void 0:ge.chevronButton,className:k.chevronButton},{children:l(Le?g:C,{className:k.chevronIcon,color:null==ge?void 0:ge.chevronIconColor})}))]}))]})),l("div",{className:k.divider,style:null==ge?void 0:ge.dividerStyle})]})),Le&&l("div",e({className:k.cardContent,style:null==ge?void 0:ge.cardContentStyle},{children:i("div",e({className:k.contentInner,style:null==ge?void 0:ge.contentInner},{children:[i("div",e({className:k.descriptionSection,style:null==ge?void 0:ge.descriptionSection},{children:[l("div",{className:k.justifyBetween,style:null==ge?void 0:ge.justifyBetween}),Ue.userStory?l(P,{minHeight:"100%",height:"100%",type:"string",value:T(X.value)||"",handleUpdateState:function(t,n){var o=A(n);Be(function(t){return e(e({},t),{value:o||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:Ue.userStory?"edit":"readOnly"}):l(H,{showUserStoryDiff:oe,isParent:""===$,message:T(X.value)||"",artifactId:X.artifactId,customStyles:Ie,isDisplayHighlightControl:se})]})),null===(q=Ne.sub_features)||void 0===q?void 0:q.map(function(t,n){var i=W(ue,!1,t.artifactId);return l(V,{artifactId:Z,isUserStoryCurrentlyUpdated:Q,artifactTitleId:"".concat(J,"-").concat(String.fromCharCode(65+n)),parentUserStory:X,parentIndex:"".concat($).concat($&&".").concat(ee),currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(t){return function(t,n){var i=o([],X.sub_features||[],!0);i[t]=n,Y(e(e({},X),{sub_features:i}))}(n,t)},enableDownload:!0,isDiffEditReviewMode:ne,showUserStoryDiff:oe,updateUserStoryArtifact:re,handleDownloadUserStory:ie,handleOpenSendDialog:le,isDisplayHighlightControl:se,elementDisplayConfig:ue,_resolvedConfig:i,actionItemsConfig:fe,onDelete:function(){return function(t){var n=(X.sub_features||[]).filter(function(e,n){return n!==t}),o=e(e({},X),{sub_features:n});Be(o),Y(o)}(n)}},t.artifactId)})]}))}))]}))},F=function(t){var n=t.artifactTitleIDs,a=t.isDiffEditReviewMode,s=t.showUserStoryDiff,u=t.updateUserStoryArtifact,c=t.isUserStoryCurrentlyUpdated,d=t.artifactId,v=t.handleOpenSendDialog,f=t.handleDownloadUserStory,m=t.selectedArtifactId,y=t.isDisplayHighlightControl,h=t.elementDisplayConfig,p=t.showWrapper,S=t.actionItemsConfig,g=R(),C=g.userStory,b=g.setUserStory,N=g.customStyles,B=g.searchQueryList,D=g.currentHighlightIndex,U=g.setCurrentHighlightIndex;g.segmentComponentConfig;var x=null==N?void 0:N.userStoryCardStyles,E=0===D,T=D===B.length-1;return i("div",e({className:k.userStoryCardWrapper,style:y?e(e({},null==x?void 0:x.userStoryCardWrapper),{position:"relative"}):null==x?void 0:x.userStoryCardWrapper},{children:[y&&l(r,{children:B.length>0&&l("div",e({className:k.wrapper},{children:l("div",e({className:k.highlightNavigation},{children:i("div",e({className:k.navigationContainer},{children:[i("span",e({className:k.navCounter},{children:[D+1," of ",B.length]})),i("div",e({className:k.navButtons},{children:[l("button",e({onClick:function(){D>0&&U(function(e){return e-1})},className:k.navButton,disabled:E},{children:l(I,{size:20,className:k.navIcon})})),l("button",e({onClick:function(){D<B.length-1&&U(function(e){return e+1})},className:k.navButton,disabled:T},{children:l(w,{size:20,className:k.navIcon})}))]}))]}))}))}))}),C.map(function(e,t){var i=W(h,!0);return l(V,{isUserStoryCurrentlyUpdated:c,artifactId:d,artifactTitleId:n[t]||"",currentUserStory:e,onUserStoryChange:function(e){b(function(n){return n[t]=e,o([],n,!0)})},parentIndex:"",currentIndex:"".concat(t+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:u,handleOpenSendDialog:v,handleDownloadUserStory:f,selectedArtifactId:m,isDisplayHighlightControl:y,elementDisplayConfig:h,_resolvedConfig:i,showWrapper:p,actionItemsConfig:S},e.artifactId)})]}))};export{V as StoryCard,F as UserStoryCardWrapper,V as default,z as replaceLearnedTagsWithInfo};
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as i,Fragment as n}from"react/jsx-runtime";import{useState as l,useEffect as o}from"react";import{Pencil as r,Save as a,X as d}from"lucide-react";import{preprocessUserStoryForEdit as s,formatMarkdown as u,postprocessUserStoryAfterEdit as v}from"../../utils/user-story.utils.js";import c from"../userstory-with-citation/UserStoryWithCitation.js";import m from"./PartialRequirementContent.module.css.js";import{Tooltip as p}from"@mui/material";import{useRequirementAI as y}from"../RequirementAIWrapper/RequirementAIWrapper.js";import C from"../RichTextEditor/RichTextEditor.js";var f=function(f){var h,S,R,g,q,P,w,B,b,N,A,j,D,k,E,U,x,W,T=f.loadingPartialRequirements,z=f.localUserStory,F=f.setLocalUserStory,I=f.onCraFlowDiffAgentAction,L=f.disableEditing,H=f.isCraflow,M=void 0===H||H,V=f.onCraAccept,G=f.onCraReject,J=l(!1),K=J[0],O=J[1],Q=l(""),X=Q[0],Y=Q[1],Z=y(),$=Z.customStyles,_=Z.segmentComponentConfig;o(function(){L&&O(!1)},[L]),o(function(){var e;Y(null===(e=null==z?void 0:z[0])||void 0===e?void 0:e.value)},[z]);if(T)return t("div",e({className:m.skeletonWrapper,style:null===(h=null==$?void 0:$.PartialRequirementContentStyles)||void 0===h?void 0:h.skeletonWrapper},{children:[1,2,3,4,5].map(function(e){var i;return t("div",{className:m.skeletonLine,style:null===(i=null==$?void 0:$.PartialRequirementContentStyles)||void 0===i?void 0:i.skeletonLine},e)})}));var ee=!X||""===X.trim();return i("div",e({className:m.wrapper,style:null===(S=null==$?void 0:$.PartialRequirementContentStyles)||void 0===S?void 0:S.wrapper},{children:[t("div",e({className:m.actionBar,style:null===(R=null==$?void 0:$.PartialRequirementContentStyles)||void 0===R?void 0:R.actionBar},{children:K?i(n,{children:[i("span",e({className:m.editingBadge,style:null===(w=null==$?void 0:$.PartialRequirementContentStyles)||void 0===w?void 0:w.editingBadge},{children:[t("span",{className:m.editingDot,style:null===(B=null==$?void 0:$.PartialRequirementContentStyles)||void 0===B?void 0:B.editingDot}),"Editing"]})),t("div",{className:m.btnDivider,style:null===(b=null==$?void 0:$.PartialRequirementContentStyles)||void 0===b?void 0:b.btnDivider}),t(p,e({title:ee?"This field cannot be empty":"Save changes",slotProps:{tooltip:{sx:e({},null===(N=null==$?void 0:$.PartialRequirementContentStyles)||void 0===N?void 0:N.headerTooltip)}}},{children:t("span",{children:t("button",e({className:m.saveBtn,style:e(e(e({},null===(A=null==$?void 0:$.PartialRequirementContentStyles)||void 0===A?void 0:A.actionBtn),null===(j=null==$?void 0:$.PartialRequirementContentStyles)||void 0===j?void 0:j.saveBtn),{opacity:ee?.5:1,cursor:ee?"not-allowed":"pointer"}),onClick:function(){ee||(F(function(t){var i=e(e({},t[0]),{value:v(X)});return null==I||I("accept",[i]),[i]}),O(!1))},disabled:ee},{children:t(a,{size:16})}))})})),t("button",e({className:m.cancelBtn,style:e(e({},null===(D=null==$?void 0:$.PartialRequirementContentStyles)||void 0===D?void 0:D.actionBtn),null===(k=null==$?void 0:$.PartialRequirementContentStyles)||void 0===k?void 0:k.cancelBtn),onClick:function(){var e;Y(null===(e=null==z?void 0:z[0])||void 0===e?void 0:e.value),O(!1)},title:"Discard changes","aria-label":"Discard changes"},{children:t(d,{size:16})}))]}):t(p,e({title:L?"Editing is disabled":"Edit",slotProps:{tooltip:{sx:e({},null===(g=null==$?void 0:$.PartialRequirementContentStyles)||void 0===g?void 0:g.headerTooltip)}}},{children:t("span",{children:t("button",e({className:m.editBtn,style:e(e(e({},null===(q=null==$?void 0:$.PartialRequirementContentStyles)||void 0===q?void 0:q.actionBtn),null===(P=null==$?void 0:$.PartialRequirementContentStyles)||void 0===P?void 0:P.editBtn),{opacity:L?.5:1,cursor:L?"not-allowed":"pointer"}),onClick:function(){L||O(!0)},disabled:L,"aria-label":"Edit requirement"},{children:t(r,{size:16})}))})}))})),t("div",K?e({className:m.editorContainer,style:null===(E=null==$?void 0:$.PartialRequirementContentStyles)||void 0===E?void 0:E.editorContainer},{children:t(C,{minHeight:"100%",height:"100%",type:"string",value:s(u((null===(U=null==z?void 0:z[0])||void 0===U?void 0:U.value)||"")||""),handleUpdateState:function(e,t){Y(t)},doNotShowBorderInViewMode:!1,mode:"edit"})}):e({className:m.viewContainer,style:null===(x=null==$?void 0:$.PartialRequirementContentStyles)||void 0===x?void 0:x.viewContainer},{children:t(c,{message:u((null===(W=null==z?void 0:z[0])||void 0===W?void 0:W.value)||""),craFlowConfig:{isCraflow:!0,craUserStory:z,setCraUserStory:F,onCraFlowDiffAgentAction:I,displayActionButtons:!K},isCraflow:M,onCraAccept:V,onCraReject:G,customStyles:null==$?void 0:$.UserStoryWithCitationCustomStyles,segmentComponentConfig:_})}))]}))};export{f as PartialRequirementContent,f as default};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as i,Fragment as n}from"react/jsx-runtime";import{useState as l,useEffect as o}from"react";import{Pencil as r,Save as a,X as d}from"lucide-react";import{preprocessUserStoryForEdit as s,formatMarkdown as u,postprocessUserStoryAfterEdit as v}from"../../utils/user-story.utils.js";import c from"../userstory-with-citation/UserStoryWithCitation.js";import m from"./PartialRequirementContent.module.css.js";import{Tooltip as p}from"@mui/material";import{useRequirementAI as y}from"../RequirementAIWrapper/RequirementAIWrapper.js";import C from"../RichTextEditor/RichTextEditor.js";var f=function(f){var h,S,R,g,q,P,w,B,b,N,A,j,D,k,E,U,x,W,T=f.loadingPartialRequirements,z=f.localUserStory,F=f.setLocalUserStory,I=f.onCraFlowDiffAgentAction,L=f.disableEditing,H=f.isCraflow,M=void 0===H||H,V=f.onCraAccept,G=f.onCraReject,J=l(!1),K=J[0],O=J[1],Q=l(""),X=Q[0],Y=Q[1],Z=y(),$=Z.customStyles;Z.segmentComponentConfig,o(function(){L&&O(!1)},[L]),o(function(){var e;Y(null===(e=null==z?void 0:z[0])||void 0===e?void 0:e.value)},[z]);if(T)return t("div",e({className:m.skeletonWrapper,style:null===(h=null==$?void 0:$.PartialRequirementContentStyles)||void 0===h?void 0:h.skeletonWrapper},{children:[1,2,3,4,5].map(function(e){var i;return t("div",{className:m.skeletonLine,style:null===(i=null==$?void 0:$.PartialRequirementContentStyles)||void 0===i?void 0:i.skeletonLine},e)})}));var _=!X||""===X.trim();return i("div",e({className:m.wrapper,style:null===(S=null==$?void 0:$.PartialRequirementContentStyles)||void 0===S?void 0:S.wrapper},{children:[t("div",e({className:m.actionBar,style:null===(R=null==$?void 0:$.PartialRequirementContentStyles)||void 0===R?void 0:R.actionBar},{children:K?i(n,{children:[i("span",e({className:m.editingBadge,style:null===(w=null==$?void 0:$.PartialRequirementContentStyles)||void 0===w?void 0:w.editingBadge},{children:[t("span",{className:m.editingDot,style:null===(B=null==$?void 0:$.PartialRequirementContentStyles)||void 0===B?void 0:B.editingDot}),"Editing"]})),t("div",{className:m.btnDivider,style:null===(b=null==$?void 0:$.PartialRequirementContentStyles)||void 0===b?void 0:b.btnDivider}),t(p,e({title:_?"This field cannot be empty":"Save changes",slotProps:{tooltip:{sx:e({},null===(N=null==$?void 0:$.PartialRequirementContentStyles)||void 0===N?void 0:N.headerTooltip)}}},{children:t("span",{children:t("button",e({className:m.saveBtn,style:e(e(e({},null===(A=null==$?void 0:$.PartialRequirementContentStyles)||void 0===A?void 0:A.actionBtn),null===(j=null==$?void 0:$.PartialRequirementContentStyles)||void 0===j?void 0:j.saveBtn),{opacity:_?.5:1,cursor:_?"not-allowed":"pointer"}),onClick:function(){_||(F(function(t){var i=e(e({},t[0]),{value:v(X)});return null==I||I("accept",[i]),[i]}),O(!1))},disabled:_},{children:t(a,{size:16})}))})})),t("button",e({className:m.cancelBtn,style:e(e({},null===(D=null==$?void 0:$.PartialRequirementContentStyles)||void 0===D?void 0:D.actionBtn),null===(k=null==$?void 0:$.PartialRequirementContentStyles)||void 0===k?void 0:k.cancelBtn),onClick:function(){var e;Y(null===(e=null==z?void 0:z[0])||void 0===e?void 0:e.value),O(!1)},title:"Discard changes","aria-label":"Discard changes"},{children:t(d,{size:16})}))]}):t(p,e({title:L?"Editing is disabled":"Edit",slotProps:{tooltip:{sx:e({},null===(g=null==$?void 0:$.PartialRequirementContentStyles)||void 0===g?void 0:g.headerTooltip)}}},{children:t("span",{children:t("button",e({className:m.editBtn,style:e(e(e({},null===(q=null==$?void 0:$.PartialRequirementContentStyles)||void 0===q?void 0:q.actionBtn),null===(P=null==$?void 0:$.PartialRequirementContentStyles)||void 0===P?void 0:P.editBtn),{opacity:L?.5:1,cursor:L?"not-allowed":"pointer"}),onClick:function(){L||O(!0)},disabled:L,"aria-label":"Edit requirement"},{children:t(r,{size:16})}))})}))})),t("div",K?e({className:m.editorContainer,style:null===(E=null==$?void 0:$.PartialRequirementContentStyles)||void 0===E?void 0:E.editorContainer},{children:t(C,{minHeight:"100%",height:"100%",type:"string",value:s(u((null===(U=null==z?void 0:z[0])||void 0===U?void 0:U.value)||"")||""),handleUpdateState:function(e,t){Y(t)},doNotShowBorderInViewMode:!1,mode:"edit"})}):e({className:m.viewContainer,style:null===(x=null==$?void 0:$.PartialRequirementContentStyles)||void 0===x?void 0:x.viewContainer},{children:t(c,{message:u((null===(W=null==z?void 0:z[0])||void 0===W?void 0:W.value)||""),craFlowConfig:{isCraflow:!0,craUserStory:z,setCraUserStory:F,onCraFlowDiffAgentAction:I,displayActionButtons:!K},isCraflow:M,onCraAccept:V,onCraReject:G,customStyles:null==$?void 0:$.UserStoryWithCitationCustomStyles})}))]}))};export{f as PartialRequirementContent,f as default};
2
2
  //# sourceMappingURL=PartialRequirementContent.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as n,__generator as t}from"tslib";import{jsxs as o,jsx as a}from"react/jsx-runtime";import s from"react";import{Loader2 as l,ChevronDown as i}from"lucide-react";import{cn as r}from"../../../UserStoryImport/lib/cn.js";import c from"./segment.module.css.js";import m from"./ExampleComponentWrapper.js";import u from"../ai-reasoning/AiReasoningCitationContent.js";import d from"./SegmentLoader.js";import"./segment-common.css.js";var p=function(p){var g=p.id,v=void 0===g?"Segment":g,f=p.label,S=p.originalValue;p.decisionStrength;var h=p.aiReason,y=p.customStyles,C=p.customIcons,b=p.aiReasoningCitationCustomStyles,x=p.segmentExampleComponent,E=p.handleViewGlossary,j=p.isUpdatedSegment,I=p.onOpen,N=s.useState(!1),R=N[0],w=N[1],V=s.useState(!1),L=V[0],U=V[1],W=s.useState(!1),k=W[0],G=W[1];return o("div",e({className:"".concat(c.segmentWrapper),style:e({},null==y?void 0:y.segmentWrapper)},{children:[o("div",e({className:"segment-".concat(v,"-container segmentContainer ").concat(j?"updatedSegmentContainer":""),style:e({},null==y?void 0:y.container)},{children:[a("span",e({className:"segment-".concat(v," segmentLabel ").concat(j?"updatedSegmentLabel":""),style:e({},null==y?void 0:y.label)},{children:j?S:f})),a("button",e({className:"".concat(c.segmentExplanationButtonContainer),style:e({},null==y?void 0:y.buttonContainer),onClick:function(){return n(void 0,void 0,void 0,function(){var e;return t(this,function(n){switch(n.label){case 0:if(e=!R,U(!1),!e||(null==h?void 0:h.reason))return[3,5];G(!0),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,null==I?void 0:I()];case 2:return n.sent(),[3,4];case 3:return G(!1),w(!0),[7];case 4:return[3,6];case 5:w(e),n.label=6;case 6:return[2]}})})}},{children:k?a(l,{size:16,className:c.spinner}):a(i,{className:r(j&&c.updatedChevronIcon,c.cheveronIcon,R&&c.cheveronIconRotated),style:e({},null==y?void 0:y.cheveronIcon)})}))]})),L&&!j?a(m,{label:null!=f?f:"",segmentExampleComponent:x,customStyles:null==y?void 0:y.segmentExample,handleCancelExample:function(){U(!1)}}):R&&(k?a(d,{customStyles:null==y?void 0:y.loadingSkeleton}):a(u,{aiReason:h,customStyles:b,customIcons:C,isSegmentExplanation:!0,handleViewGlossary:E?function(){w(!1),null==E||E(v)}:void 0,handleViewExample:x?function(){U(!0)}:void 0,isUpdatedSegment:j}))]}))};export{p as default};
1
+ import{__assign as e,__awaiter as n,__generator as t}from"tslib";import{jsxs as o,jsx as a}from"react/jsx-runtime";import r,{useContext as i,useMemo as s}from"react";import{Loader2 as l,ChevronDown as c}from"lucide-react";import{cn as m}from"../../../UserStoryImport/lib/cn.js";import u from"./segment.module.css.js";import d from"./ExampleComponentWrapper.js";import p from"../ai-reasoning/AiReasoningCitationContent.js";import g from"./SegmentLoader.js";import"./segment-common.css.js";import{MarkdownStateContext as v}from"../../store/markdown-context.js";var f=function(f){var y=f.id,h=void 0===y?"Segment":y,S=f.label,C=f.segmentUUID,b=f.originalValue;f.decisionStrength;var x=f.aiReason,j=f.customStyles,E=f.customIcons,I=f.aiReasoningCitationCustomStyles,N=f.segmentExampleComponent,w=f.handleViewGlossary,R=f.isUpdatedSegment,U=f.onOpen,k=i(v),V=k.citationsMetadata,L=k.updateCitationsMetadata;console.log("citation metadata ",V);var W=r.useState(!1),G=W[0],M=W[1],z=s(function(){return V.get(C)},[V,C]),A=s(function(){return(null==z?void 0:z.open)||!1},[z]),B=s(function(){return z&&"loading"===z.state},[z]);return o("div",e({className:"".concat(u.segmentWrapper),style:e({},null==j?void 0:j.segmentWrapper)},{children:[o("div",e({className:"segment-".concat(h,"-container segmentContainer ").concat(R?"updatedSegmentContainer":""),style:e({},null==j?void 0:j.container)},{children:[a("span",e({className:"segment-".concat(h," segmentLabel ").concat(R?"updatedSegmentLabel":""),style:e({},null==j?void 0:j.label)},{children:R?b:S})),a("button",e({className:"".concat(u.segmentExplanationButtonContainer),style:e({},null==j?void 0:j.buttonContainer),onClick:function(){return n(void 0,void 0,void 0,function(){var n;return t(this,function(t){switch(t.label){case 0:if(n=!A,M(!1),console.log("citation metadata::",n,x),!n||(null==x?void 0:x.reason))return[3,5];L(C,function(t){if(t){var o=e({},t);return o.state="loading",o}return{open:n,state:"loading"}}),t.label=1;case 1:return t.trys.push([1,,3,4]),console.log("citation metadata:: onopen"),[4,null==U?void 0:U()];case 2:return t.sent(),[3,4];case 3:return L(C,function(t){if(t){var o=e({},t);return o.state="ready",o.open=n,o}return{open:n,state:"ready"}}),[7];case 4:return[3,6];case 5:console.log("citation metadata:: else block"),L(C,function(t){if(t){var o=e({},t);return o.open=n,o}return{open:n,state:B?"loading":"ready"}}),t.label=6;case 6:return[2]}})})}},{children:B?a(l,{size:16,className:u.spinner}):a(c,{className:m(R&&u.updatedChevronIcon,u.cheveronIcon,A&&u.cheveronIconRotated),style:e({},null==j?void 0:j.cheveronIcon)})}))]})),G&&!R?a(d,{label:null!=S?S:"",segmentExampleComponent:N,customStyles:null==j?void 0:j.segmentExample,handleCancelExample:function(){M(!1)}}):A&&(B?a(g,{customStyles:null==j?void 0:j.loadingSkeleton}):a(p,{aiReason:x,customStyles:I,customIcons:E,isSegmentExplanation:!0,handleViewGlossary:w?function(){L(C,function(n){if(n){var t=e({},n);return t.open=!1,t}return{open:!1,state:B?"loading":"ready"}}),null==w||w(h)}:void 0,handleViewExample:N?function(){M(!0)}:void 0,isUpdatedSegment:R}))]}))};export{f as default};
2
2
  //# sourceMappingURL=Segment.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e,__generator as n}from"tslib";import{jsx as o}from"react/jsx-runtime";import t from"./Segment.js";import l from"dompurify";var i=function(i){var d,a,r,s,u,m,v,g,c,p,S,f,h,b=i.children,x=i.props,y=i.segmentComponentConfig,C=i.customStyles,_=i.customIcons,I=i.extractText,w=i.isUpdatedSegment,D=void 0!==w&&w,E=(null==x?void 0:x.id)||"Segment",L=(null==x?void 0:x.decisionstrength)||"80",U=y||{},k=U.segmentDataList,F=U.getSegmentExampleComponent,R=U.handleViewGlossary,V=U.upadatedSegmentDataList,j=U.handleFetchUpdatedSegmentDetails,G=U.handleFetchSegmentDetails,O=D?null==V?void 0:V.find(function(e){return String(e.segment_id)===String(E)}):null==k?void 0:k.find(function(e){return String(e.segment_id)===String(E)});console.log("meee work",O,D,k,V);var T={id:E,reason:null!==(d=null==O?void 0:O.reason)&&void 0!==d?d:"",gap:null!==(a=null==O?void 0:O.gap)&&void 0!==a?a:"",explanation:null!==(r=null==O?void 0:O.explanation)&&void 0!==r?r:"",relevance_score:null!==(s=null==O?void 0:O.relevance_score)&&void 0!==s?s:0,isOpen:!1},W=void 0,z=I(b),H=x["data-table"],M="";if(H&&!D)try{M=decodeURIComponent(atob(H))}catch(e){console.error("Failed to decode data-table for segment",E,e)}var q=l.sanitize(M);return O||!G||D||null==G||G(E),E&&O&&F&&!D&&(W=H?o(function(){return o("div",{dangerouslySetInnerHTML:{__html:q}})},{}):F(E,z,O.segment_type)),o(t,{id:E,label:null!==(u=null==O?void 0:O.label)&&void 0!==u?u:null==O?void 0:O.segment_name,originalValue:z,decisionStrength:L,aiReason:T,customIcons:_,aiReasoningCitationCustomStyles:C,segmentExampleComponent:W,handleViewGlossary:R,customStyles:{segmentWrapper:null===(m=null==C?void 0:C.segment)||void 0===m?void 0:m.segmentWrapper,container:null===(v=null==C?void 0:C.segment)||void 0===v?void 0:v.container,label:null===(g=null==C?void 0:C.segment)||void 0===g?void 0:g.label,decisionStrength:null===(c=null==C?void 0:C.segment)||void 0===c?void 0:c.decisionStrength,buttonContainer:null===(p=null==C?void 0:C.segment)||void 0===p?void 0:p.buttonContainer,cheveronIcon:null===(S=null==C?void 0:C.segment)||void 0===S?void 0:S.cheveronIcon,segmentExample:null===(f=null==C?void 0:C.segment)||void 0===f?void 0:f.segmentExample,loadingSkeleton:null===(h=null==C?void 0:C.segment)||void 0===h?void 0:h.SegmentLoadingSkeletonStyles},isUpdatedSegment:D,onOpen:function(){return e(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return O||!D?[3,2]:[4,null==j?void 0:j(E)];case 1:e.sent(),e.label=2;case 2:return[2]}})})}},E)};export{i as default};
1
+ import{__awaiter as e,__generator as n}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"./Segment.js";import l from"dompurify";var i=function(i){var d,a,s,r,u,m,v,g,c,p,S,h,f,b=i.id,x=i.children,y=i.props,C=i.segmentComponentConfig,_=i.customStyles,I=i.customIcons,U=i.extractText,D=i.isUpdatedSegment,w=void 0!==D&&D,E=(null==y?void 0:y.id)||"Segment",F=(null==y?void 0:y.decisionstrength)||"80",L=C||{},k=L.segmentDataList,R=L.getSegmentExampleComponent,V=L.handleViewGlossary,j=L.upadatedSegmentDataList,G=L.handleFetchUpdatedSegmentDetails,O=L.handleFetchSegmentDetails,T=w?null==j?void 0:j.find(function(e){return String(e.segment_id)===String(E)}):null==k?void 0:k.find(function(e){return String(e.segment_id)===String(E)});console.log("meee work",T,w,k,j);var W={id:E,reason:null!==(d=null==T?void 0:T.reason)&&void 0!==d?d:"",gap:null!==(a=null==T?void 0:T.gap)&&void 0!==a?a:"",explanation:null!==(s=null==T?void 0:T.explanation)&&void 0!==s?s:"",relevance_score:null!==(r=null==T?void 0:T.relevance_score)&&void 0!==r?r:0,isOpen:!1},z=void 0,H=U(x),M=y["data-table"],q="";if(M&&!w)try{q=decodeURIComponent(atob(M))}catch(e){console.error("Failed to decode data-table for segment",E,e)}var A=l.sanitize(q);return T||!O||w||null==O||O(E),E&&T&&R&&!w&&(z=M?t(function(){return t("div",{dangerouslySetInnerHTML:{__html:A}})},{}):R(E,H,T.segment_type)),t(o,{id:E,segmentUUID:b,label:null!==(u=null==T?void 0:T.label)&&void 0!==u?u:null==T?void 0:T.segment_name,originalValue:H,decisionStrength:F,aiReason:W,customIcons:I,aiReasoningCitationCustomStyles:_,segmentExampleComponent:z,handleViewGlossary:V,customStyles:{segmentWrapper:null===(m=null==_?void 0:_.segment)||void 0===m?void 0:m.segmentWrapper,container:null===(v=null==_?void 0:_.segment)||void 0===v?void 0:v.container,label:null===(g=null==_?void 0:_.segment)||void 0===g?void 0:g.label,decisionStrength:null===(c=null==_?void 0:_.segment)||void 0===c?void 0:c.decisionStrength,buttonContainer:null===(p=null==_?void 0:_.segment)||void 0===p?void 0:p.buttonContainer,cheveronIcon:null===(S=null==_?void 0:_.segment)||void 0===S?void 0:S.cheveronIcon,segmentExample:null===(h=null==_?void 0:_.segment)||void 0===h?void 0:h.segmentExample,loadingSkeleton:null===(f=null==_?void 0:_.segment)||void 0===f?void 0:f.SegmentLoadingSkeletonStyles},isUpdatedSegment:w,onOpen:function(){return e(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return T||!w?[3,2]:(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),[4,null==G?void 0:G(E)]);case 1:e.sent(),e.label=2;case 2:return[2]}})})}},E)};export{i as default};
2
2
  //# sourceMappingURL=SegmentWrapper.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as t,__spreadArray as e}from"tslib";import{jsxs as o,jsx as n,Fragment as i}from"react/jsx-runtime";import{useState as r,useEffect as l}from"react";import{PencilIcon as s,ChevronDown as a}from"lucide-react";import{useRequirementAI as c}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{formatMarkdown as u,indentMarkdown as d}from"../../utils/helpers.js";import m from"../RichTextEditor/RichTextEditor.js";import p from"../userstory-with-citation/UserStoryWithCitation.js";import f from"../../shared/AtomicButton.js";import v from"./SubfeatureBlock.module.css.js";var h=function(h){var y,g,S=h.parentArtifactId,C=h.artifactId,I=h.title,N=h.content,b=h.isEditingModeOn,B=h.setIsEditingModeOn,j=h.isCitationLoadingDisplay,W=void 0!==j&&j,k=c(),x=k.userStory,A=k.setUserStory,w=k.customStyles,E=k.customIcons,R=k.segmentComponentConfig,T=null===(y=null==w?void 0:w.userStoryScreenStyles)||void 0===y?void 0:y.subFeatureBlock,F=null===(g=null==w?void 0:w.userStoryScreenStyles)||void 0===g?void 0:g.userStoryContentStyles,M=r(!0),O=M[0],P=M[1],U=r(!1),q=U[0],D=U[1],L=r(x),_=L[0],z=L[1];l(function(){z(x)},[x]);return o("div",t({className:v.container,style:null==T?void 0:T.container},{children:[o("button",t({onClick:function(){P(function(t){return!t})},className:v.toggleButton,style:null==T?void 0:T.toggleButton},{children:[n("h1",t({className:v.title,style:null==T?void 0:T.title},{children:I})),o("div",t({className:v.subFeatureToolbar,style:null==T?void 0:T.subFeatureToolbar},{children:[O&&n("div",t({className:v.actionBar,style:null==T?void 0:T.actionBar},{children:q?o("div",t({className:v.editingActions},{children:[n(f,{type:"outline",children:"Cancel",onClick:function(t){t.stopPropagation(),D(!1),B(!1)}}),n(f,{type:"fill",children:"Save",onClick:function(t){t.stopPropagation(),A(_),D(!1),B(!1)}})]})):!b&&n("div",t({className:v.viewActions},{children:n("button",t({className:v.editButton,style:null==T?void 0:T.editButton,onClick:function(t){t.stopPropagation(),D(!0),B(!0)}},{children:n(s,{size:16})}))}))})),n(a,{className:"".concat(v.chevron," ").concat(O?v.chevronOpen:""),style:null==T?void 0:T.chevron})]}))]})),O&&n(i,{children:n("div",q?t({className:v.editorWrapper,style:null==T?void 0:T.editorWrapper},{children:n(m,{minHeight:"100%",height:"100%",type:"string",value:u(N)||"",handleUpdateState:function(o,n){var i=d(n);z(function(o){var n=e([],o,!0),r=n.findIndex(function(t){return t.artifactId===S});if(-1===r)return n;var l=n[r].sub_features;if(l){var s=l.findIndex(function(t){return t.artifactId===C});-1!==s&&(n[r]=t(t({},n[r]),{sub_features:l.map(function(e,o){return o===s?t(t({},e),{value:i}):e})}))}return n})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:"edit"})}):t({className:v.contentWrapper,style:null==T?void 0:T.contentWrapper},{children:n(p,{message:N,isCitationLoadingDisplay:W,customStyles:t({},F),customIcons:t({},null==E?void 0:E.userStoryIcons),segmentComponentConfig:R})}))})]}),C)};export{h as default};
1
+ import{__assign as t,__spreadArray as e}from"tslib";import{jsxs as o,jsx as i,Fragment as n}from"react/jsx-runtime";import{useState as r,useEffect as l}from"react";import{PencilIcon as s,ChevronDown as a}from"lucide-react";import{useRequirementAI as c}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{formatMarkdown as u,indentMarkdown as d}from"../../utils/helpers.js";import m from"../RichTextEditor/RichTextEditor.js";import p from"../userstory-with-citation/UserStoryWithCitation.js";import f from"../../shared/AtomicButton.js";import v from"./SubfeatureBlock.module.css.js";var h=function(h){var y,g,S=h.parentArtifactId,I=h.artifactId,N=h.title,b=h.content,B=h.isEditingModeOn,C=h.setIsEditingModeOn,j=h.isCitationLoadingDisplay,W=void 0!==j&&j,k=c(),x=k.userStory,A=k.setUserStory,w=k.customStyles,E=k.customIcons;k.segmentComponentConfig;var R=null===(y=null==w?void 0:w.userStoryScreenStyles)||void 0===y?void 0:y.subFeatureBlock,T=null===(g=null==w?void 0:w.userStoryScreenStyles)||void 0===g?void 0:g.userStoryContentStyles,F=r(!0),M=F[0],O=F[1],P=r(!1),U=P[0],q=P[1],D=r(x),L=D[0],_=D[1];l(function(){_(x)},[x]);return o("div",t({className:v.container,style:null==R?void 0:R.container},{children:[o("button",t({onClick:function(){O(function(t){return!t})},className:v.toggleButton,style:null==R?void 0:R.toggleButton},{children:[i("h1",t({className:v.title,style:null==R?void 0:R.title},{children:N})),o("div",t({className:v.subFeatureToolbar,style:null==R?void 0:R.subFeatureToolbar},{children:[M&&i("div",t({className:v.actionBar,style:null==R?void 0:R.actionBar},{children:U?o("div",t({className:v.editingActions},{children:[i(f,{type:"outline",children:"Cancel",onClick:function(t){t.stopPropagation(),q(!1),C(!1)}}),i(f,{type:"fill",children:"Save",onClick:function(t){t.stopPropagation(),A(L),q(!1),C(!1)}})]})):!B&&i("div",t({className:v.viewActions},{children:i("button",t({className:v.editButton,style:null==R?void 0:R.editButton,onClick:function(t){t.stopPropagation(),q(!0),C(!0)}},{children:i(s,{size:16})}))}))})),i(a,{className:"".concat(v.chevron," ").concat(M?v.chevronOpen:""),style:null==R?void 0:R.chevron})]}))]})),M&&i(n,{children:i("div",U?t({className:v.editorWrapper,style:null==R?void 0:R.editorWrapper},{children:i(m,{minHeight:"100%",height:"100%",type:"string",value:u(b)||"",handleUpdateState:function(o,i){var n=d(i);_(function(o){var i=e([],o,!0),r=i.findIndex(function(t){return t.artifactId===S});if(-1===r)return i;var l=i[r].sub_features;if(l){var s=l.findIndex(function(t){return t.artifactId===I});-1!==s&&(i[r]=t(t({},i[r]),{sub_features:l.map(function(e,o){return o===s?t(t({},e),{value:n}):e})}))}return i})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:"edit"})}):t({className:v.contentWrapper,style:null==R?void 0:R.contentWrapper},{children:i(p,{message:b,isCitationLoadingDisplay:W,customStyles:t({},T),customIcons:t({},null==E?void 0:E.userStoryIcons)})}))})]}),I)};export{h as default};
2
2
  //# sourceMappingURL=SubfeatureBlock.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as n,__assign as e}from"tslib";import{jsx as i,jsxs as o}from"react/jsx-runtime";import t,{createContext as r,useRef as l,useState as a,useCallback as d,useMemo as c,useEffect as s,useContext as u}from"react";import v from"react-markdown";import g from"rehype-raw";import m from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as p}from"../../shared/useMarkdownSearch.js";import{Info as h}from"lucide-react";import{Tooltip as f}from"@mui/material";import C from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import S from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import I from"../../icons/CognitiveDecision.js";import w from"../../icons/BrainRed.js";import b,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as x}from"../ai-reasoning/AiReasoningCitation.js";import N from"../../icons/RelevanceScoreIcon.js";import A from"../RecommendationBlock/RecommendationBlock.js";import k from"../UserStoryCard/AttachedContext.js";import j from"../ai-reasoning/AiReasoningCitationContent.js";import U from"./components/InlineUpdatedComponent.js";import T from"../segment/SegmentWrapper.js";var P=r(!1),$=r({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),E=r({rowId:""}),L=function(n){var t,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=u($),s=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,p=u(E).rowId,h=String(r.id);p&&g.current.set(h,p);var f=(null===(t=null==s?void 0:s.aiReason)||void 0===t?void 0:t.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||i(I,{}):(null==d?void 0:d.lowConfidence)||i(w,{});return o("button",e({className:m.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),v(f?null:p,f?null:r)}},{children:[C,i("i",f?{className:"pi pi-angle-up ".concat(l?m.aiReasoningIconHighConfidence:m.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?m.aiReasoningIconHighConfidence:m.aiReasoningIconLowConfidence)})]}))},M=function(n){var t,r,a=n.children,d=n.node,c=n.customStyles,s=n.customIcons,v=l(Math.random().toString(36).slice(2)).current,g=u($).expandedInfo,p=(null==g?void 0:g.rowId)===v,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t.style)&&void 0!==r?r:void 0;return o(E.Provider,e({value:{rowId:v}},{children:[i("tr",e({style:f?{cssText:f}:void 0},{children:a})),p&&(null==g?void 0:g.aiReason)&&i("tr",e({style:{width:"100%"}},{children:i("td",e({colSpan:h||1,className:m.tableExpandedCell},{children:i("div",e({className:m.tableExpandedCellInner},{children:i("div",e({className:m.tableExpandedCellContent},{children:i(j,{aiReason:g.aiReason,customIcons:s,customStyles:{aiReasoningContent:null==c?void 0:c.aiReasoningContent,aiReasoningAccordion:null==c?void 0:c.aiReasoningAccordion,aiReasoningMarkdown:null==c?void 0:c.aiReasoningMarkdown,aiReasoningPill:null==c?void 0:c.aiReasoningPill,webCitation:null==c?void 0:c.webCitation,stormeeCitation:null==c?void 0:c.stormeeCitation,waveformCitation:null==c?void 0:c.waveformCitation,imageCitation:null==c?void 0:c.imageCitation,fileCitation:null==c?void 0:c.fileCitation,appModCitation:null==c?void 0:c.appModCitation,rcaCitation:null==c?void 0:c.rcaCitation,readFileCitation:null==c?void 0:c.readFileCitation,loadingCitations:null==c?void 0:c.loadingCitations,chatCitation:null==c?void 0:c.chatCitation}})}))}))}))}))]}))};var _=["del","ins"];function D(n){return function(n,e,i){var o=e.join("|");return n.replace(new RegExp("<(".concat(o,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(n,e,o){return"<".concat(e,">").concat(i(o),"</").concat(e,">")})}(n,_,function(n){return n.split(/(<[^>]+>)/g).map(function(n){return!n||/^<[^>]+>$/.test(n)?n:function(n){if(!n)return n;var e=[];return n.replace(/`([^`\n]+)`/g,function(n,i){var o=e.push(i)-1;return"@@CODE_SPAN_".concat(o,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(n,i){var o,t=null!==(o=e[Number(i)])&&void 0!==o?o:"";return"<code>".concat(t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(n)}).join("")})}var F=function(r){var I,w=r.message,j=r.isParent,E=r.scenario,_=r.showUserStoryDiff,F=void 0!==_&&_,H=r.aiReasoningsForBlock,B=r.isCitationLoadingDisplay,O=void 0!==B&&B,q=r.className;r.highConfidenceIcon,r.lowConfidenceIcon;var W=r.customStyles,z=r.customIcons,V=r.aiReasoningDiffView,G=r.userStoryCitations,Q=r.artifactId,J=r.isCraflow,K=r.onCraAccept,X=r.onCraReject,Y=r.craFlowConfig,Z=r.isDisplayHighlightControl,nn=void 0!==Z&&Z,en=r.segmentComponentConfig,on=l(null),tn=R(),rn=tn.userStory,ln=tn.inlineUpdateComponentConfig,an=tn.getAvgScoreForStory,dn=tn.setUserStory,cn=tn.aiReasoning,sn=tn.setAiReasoning,un=tn.customIcons,vn=tn.searchQueryList,gn=tn.searchQueryReasoningIdList,mn=tn.currentHighlightIndex,pn=null!=z?z:null==un?void 0:un.userStoryIcons;null==W||W.searchHighlight;var hn=p(on),fn=hn.search,Cn=hn.clear,yn=a("1"),Sn=yn[0],Rn=yn[1],In=a(null),wn=In[0],bn=In[1],xn=l(new Map),Nn=d(function(n,e){bn(n&&e?{rowId:n,aiReason:e}:null)},[]),An=Q?an(Q):0,kn=a([]),jn=kn[0],Un=kn[1],Tn=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map(Tn).join(""):t.isValidElement(n)?Tn(n.props.children):""},Pn=function(n){var e=n;return e=function(n){for(var e,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,o=[],t=new RegExp(i.source,i.flags);null!==(e=t.exec(n));){var r=e[0],l=r.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=r.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(n){return(n.match(/^\s*\d+\.\s/gm)||[]).length};o.push({index:e.index,endIndex:e.index+e[0].length,deletedItemCount:d((null==l?void 0:l[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===o.length)return n;for(var c=n,s=function(n){var e=o[n],i=e.changedItemCount-e.deletedItemCount;if(0===i)return"continue";for(var t=!1,r=0,l=c.substring(0,e.index).split("\n").reverse();r<l.length;r++){var a=l[r].trim();if(""!==a){/^\d+\.\s/.test(a)&&(t=!0);break}}if(!t)return"continue";var d=e.endIndex,s=n+1<o.length?o[n+1].index:c.length,u=c.substring(d,s);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(n,e,o){return"".concat(e).concat(parseInt(o,10)+i,". ")}),c=c.substring(0,d)+u+c.substring(s)},u=o.length-1;u>=0;u--)s(u);return c}(e=(e=(e=(e=(e=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/ai_reasoning\$(\d+)/g,function(n,e){return"ai_reasoning$".concat(e,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(n,e,i){var o=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(e,' data-raw="').concat(o,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(n,e,i,o,t){var r=o.match(/<table[\s\S]*?<\/table>/i);if(r){var l=btoa(encodeURIComponent(r[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,i,o,t){var r=e.substring(0,t),l=r.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(r.substring(l+1))||/^\s+\d+\.\s/.test(r.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(r.substring(l+1));if(a||d){var c=o;return c=(c=(c=(c=c.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(c,"</updated>")}return n})),e=function(n){var e=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==e}),"<deleted>".concat(i,"</deleted>")});return e.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==e,preview:e.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(e),e=D(e)},$n=c(function(){return w?Pn(w):w},[w]);s(function(){Un(H||cn)},[H,cn]);var En=c(function(){return{upt:function(o){var t;o.node;var r=o.children,l=n(o,["node","children"]),a=null==l?void 0:l.id,d=a?null===(t=a.split("$"))||void 0===t?void 0:t[1]:null,c=cn.find(function(n){return n.id.toString()===d});return c?i(U,e({aiReason:c,customStyles:null==W?void 0:W.inlineUpdatedComponent,handleClickCognitiveDecision:null==ln?void 0:ln.handleClickCognitiveDecision,handleClickUpdatedPill:null==ln?void 0:ln.handleClickUpdatedPill,handleClickOutputValue:null==ln?void 0:ln.handleClickOutputValue,customIcons:null==ln?void 0:ln.customIcons},{children:r})):r},del:function(o){o.node;var t=o.children,r=n(o,["node","children"]);return i("span",e({className:m.deleted,style:null==W?void 0:W.deleted},r,{onClick:r.onclick},{children:t}))},ins:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:m.inserted,style:null==W?void 0:W.inserted},r,{onClick:r.onclick},{children:t}))},h1:function(o){o.node;var t=n(o,["node"]);return i("h1",e({className:m.heading1,style:null==W?void 0:W.heading1},{children:t.children}))},h2:function(o){o.node;var t=n(o,["node"]);return i("h2",e({className:m.heading2,style:null==W?void 0:W.heading2},{children:t.children}))},h3:function(o){o.node;var t=n(o,["node"]);return i("h3",e({className:m.heading3,style:null==W?void 0:W.heading3},{children:t.children}))},b:function(o){o.node;var t=n(o,["node"]);return i("b",e({className:m.bold,style:null==W?void 0:W.bold},{children:null==t?void 0:t.children}))},p:function(o){o.node;var t=n(o,["node"]);return i("p",e({},t,{className:m.paragraph,style:null==W?void 0:W.paragraph},{children:t.children}))},updated:function(o){var t=o.node,r=n(o,["node"]);return i(C,e({},r,{showUserStoryDiff:F,currentUpdatedTagId:Sn,setCurrentUpdatedTagId:Rn,userStory:rn,setUserStory:dn,setAiReasoning:sn,node:t,isCraflow:J,onCraAccept:K,onCraReject:X,customStyles:null==W?void 0:W.updatedContent,craFlowConfig:Y}))},ol:function(o){var t,r,l,a=o.node,d=n(o,["node"]),c=null!==(l=null!==(r=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==d?void 0:d.start)&&void 0!==l?l:void 0;return i("ol",e({className:m.orderedList,style:null==W?void 0:W.olist},c?{start:Number(c)}:{},{children:null==d?void 0:d.children}))},ul:function(o){o.node;var t=n(o,["node"]);return i("ul",e({className:m.unorderedList,style:null==W?void 0:W.ulist},{children:null==t?void 0:t.children}))},table:function(n){var o=n.children;return i("div",e({className:m.tableWrapper},{children:i("table",e({className:m.table,style:null==W?void 0:W.table},{children:o}))}))},tr:function(n){var e=n.node,o=n.children;return i(M,{node:e,children:o,customStyles:W})},td:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i(P.Provider,e({value:!0},{children:i("td",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},th:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i(P.Provider,e({value:!0},{children:i("th",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},recommendation:function(o){var t;o.node;var r=n(o,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==r?void 0:r.children)||void 0===t?void 0:t[0])||"");return i(A,e({},r,{customStyles:null==W?void 0:W.recommendationBlock,label:l}))},a:function(e){var o,t,r;e.inline,e.children,e.node;var l=n(e,["inline","children","node"]),a=u(P)||"true"==(null==l?void 0:l.table),d="".concat(null==l?void 0:l.href),c=null===(o=d.split("$"))||void 0===o?void 0:o[0],s=null===(t=d.split("$"))||void 0===t?void 0:t[1];if("ai_reasoning"===c){var v=(null!==(r=F?V:cn)&&void 0!==r?r:[]).find(function(n){return n.id.toString()===decodeURIComponent(s)}),g=gn.includes(s);if(v)return a?i(L,{aiReason:v,customStyle:null==W?void 0:W.tableAiReasoning,customIcons:pn,isHighConfidence:v.relevance_score>=x}):i(b,{aiReason:v,isSourceHasHighlight:g,customIcons:pn,customStyles:{aiReasoningContent:null==W?void 0:W.aiReasoningContent,aiReasoningAccordion:null==W?void 0:W.aiReasoningAccordion,aiReasoningMarkdown:null==W?void 0:W.aiReasoningMarkdown,aiReasoningPill:null==W?void 0:W.aiReasoningPill,webCitation:null==W?void 0:W.webCitation,stormeeCitation:null==W?void 0:W.stormeeCitation,waveformCitation:null==W?void 0:W.waveformCitation,imageCitation:null==W?void 0:W.imageCitation,fileCitation:null==W?void 0:W.fileCitation,appModCitation:null==W?void 0:W.appModCitation,rcaCitation:null==W?void 0:W.rcaCitation,readFileCitation:null==W?void 0:W.readFileCitation,loadingCitations:null==W?void 0:W.loadingCitations,chatCitation:null==W?void 0:W.chatCitation,bigEnoughCitation:null==W?void 0:W.bigEnoughCitation}})}return null},code:function(o){o.inline;var t=o.children,r=o.className;return o.node,n(o,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?i("div",{children:i("code",e({className:m.blockCode,style:null==W?void 0:W.code},{children:t}))}):i("code",e({className:m.inlineCode,style:null==W?void 0:W.code},{children:t}))},learned:function(n){var o=n.children;return i(f,e({title:o,placement:"top"},{children:i(h,{size:16,className:m.learned})}))},generatedcode:function(e){e.node;var o=n(e,["node"]),t=(null==o?void 0:o.language)||"python",r=function(n){var e="";try{if(n["data-raw"])e=decodeURIComponent(atob(n["data-raw"]));else{var i=function(n){var e;return"string"==typeof n?n:Array.isArray(n)?n.map(i).join(""):(null===(e=null==n?void 0:n.props)||void 0===e?void 0:e.children)?i(n.props.children):""};e=i(n.children)}}catch(i){console.error("Error decoding generated code:",i),e=String(n.children)}return e}(o);return i(y,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==W?void 0:W.generatedCodePill,content:null==W?void 0:W.generatedCodeContent}})},updatedsegment:function(e){var o=e.node,t=e.children,r=n(e,["node","children"]);return i(T,{node:o,children:t,props:r,segmentComponentConfig:en,customStyles:W,customIcons:z,extractText:Tn,isUpdatedSegment:!0})},segment:function(e){var o=e.node,t=e.children,r=n(e,["node","children"]);return i(T,{node:o,children:t,props:r,segmentComponentConfig:en,customStyles:W,customIcons:z,extractText:Tn})}}},[jn,Y,cn,G,Sn,F,w,z,vn,gn,W]);return s(function(){if(on.current){if(vn.length){var n;if(0===gn.length||nn)requestAnimationFrame(function(){fn([vn[mn].replace(/\*/g,"")])});else{var e=on.current,i=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){fn([vn[mn].replace(/\*/g,"")])})},50)});i.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}Cn()}},[vn,gn,mn,nn]),i($.Provider,e({value:{expandedInfo:wn,setExpanded:Nn,reasonToRow:xn}},{children:o("div",e({ref:on,className:"".concat(m.container," ").concat("approving"!==E?m.wrapper:""," ").concat(q||""),style:null==W?void 0:W.container},{children:[i(v,e({components:En,rehypePlugins:[g]},{children:$n})),An>0&&i("div",e({className:m.confidenceScoreContainer,style:null==W?void 0:W.confidenceScoreContainer},{children:o("span",e({className:m.confidenceScore,style:null==W?void 0:W.confidenceScore},{children:[i(N,{size:14,color:(null==W?void 0:W.confidenceScoreIconColor)||"#166534"}),An,"%"]}))})),O&&i("div",e({className:m.citationLoader,style:null==W?void 0:W.citationLoaderContainer},{children:i(S,{customStyles:{container:null==W?void 0:W.citationLoadingContainer,icon:null==W?void 0:W.citationLoadingIcon,text:null==W?void 0:W.citationLoadingText}})})),j&&i("div",e({style:e({},null===(I=null==W?void 0:W.attachedContext)||void 0===I?void 0:I.wrapper),className:"flex mt-5"},{children:i(k,{customStyles:null==W?void 0:W.attachedContext})}))]}))}))};export{F as default};
1
+ import{__rest as n,__assign as e}from"tslib";import{jsx as i,jsxs as o}from"react/jsx-runtime";import t,{createContext as r,useRef as l,useState as a,useCallback as d,useMemo as c,useEffect as s,useContext as u}from"react";import v from"react-markdown";import g from"rehype-raw";import m from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as p}from"../../shared/useMarkdownSearch.js";import{Info as h}from"lucide-react";import{Tooltip as f}from"@mui/material";import C from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import S from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import w from"../../icons/CognitiveDecision.js";import I from"../../icons/BrainRed.js";import b,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as x}from"../ai-reasoning/AiReasoningCitation.js";import N from"../../icons/RelevanceScoreIcon.js";import A from"../RecommendationBlock/RecommendationBlock.js";import k from"../UserStoryCard/AttachedContext.js";import j from"../ai-reasoning/AiReasoningCitationContent.js";import U from"./components/InlineUpdatedComponent.js";import T from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as P}from"../../store/markdown-context.js";var $=r(!1),E=r({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),L=r({rowId:""}),M=function(n){var t,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=u(E),s=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,p=u(L).rowId,h=String(r.id);p&&g.current.set(h,p);var f=(null===(t=null==s?void 0:s.aiReason)||void 0===t?void 0:t.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||i(w,{}):(null==d?void 0:d.lowConfidence)||i(I,{});return o("button",e({className:m.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),v(f?null:p,f?null:r)}},{children:[C,i("i",f?{className:"pi pi-angle-up ".concat(l?m.aiReasoningIconHighConfidence:m.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?m.aiReasoningIconHighConfidence:m.aiReasoningIconLowConfidence)})]}))},_=function(n){var t,r,a=n.children,d=n.node,c=n.customStyles,s=n.customIcons,v=l(Math.random().toString(36).slice(2)).current,g=u(E).expandedInfo,p=(null==g?void 0:g.rowId)===v,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t.style)&&void 0!==r?r:void 0;return o(L.Provider,e({value:{rowId:v}},{children:[i("tr",e({style:f?{cssText:f}:void 0},{children:a})),p&&(null==g?void 0:g.aiReason)&&i("tr",e({style:{width:"100%"}},{children:i("td",e({colSpan:h||1,className:m.tableExpandedCell},{children:i("div",e({className:m.tableExpandedCellInner},{children:i("div",e({className:m.tableExpandedCellContent},{children:i(j,{aiReason:g.aiReason,customIcons:s,customStyles:{aiReasoningContent:null==c?void 0:c.aiReasoningContent,aiReasoningAccordion:null==c?void 0:c.aiReasoningAccordion,aiReasoningMarkdown:null==c?void 0:c.aiReasoningMarkdown,aiReasoningPill:null==c?void 0:c.aiReasoningPill,webCitation:null==c?void 0:c.webCitation,stormeeCitation:null==c?void 0:c.stormeeCitation,waveformCitation:null==c?void 0:c.waveformCitation,imageCitation:null==c?void 0:c.imageCitation,fileCitation:null==c?void 0:c.fileCitation,appModCitation:null==c?void 0:c.appModCitation,rcaCitation:null==c?void 0:c.rcaCitation,readFileCitation:null==c?void 0:c.readFileCitation,loadingCitations:null==c?void 0:c.loadingCitations,chatCitation:null==c?void 0:c.chatCitation}})}))}))}))}))]}))};var D=["del","ins"];function F(n){return function(n,e,i){var o=e.join("|");return n.replace(new RegExp("<(".concat(o,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(n,e,o){return"<".concat(e,">").concat(i(o),"</").concat(e,">")})}(n,D,function(n){return n.split(/(<[^>]+>)/g).map(function(n){return!n||/^<[^>]+>$/.test(n)?n:function(n){if(!n)return n;var e=[];return n.replace(/`([^`\n]+)`/g,function(n,i){var o=e.push(i)-1;return"@@CODE_SPAN_".concat(o,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(n,i){var o,t=null!==(o=e[Number(i)])&&void 0!==o?o:"";return"<code>".concat(t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(n)}).join("")})}var H=function(r){var w,I=r.message,j=r.isParent,L=r.scenario,D=r.showUserStoryDiff,H=void 0!==D&&D,B=r.aiReasoningsForBlock,O=r.isCitationLoadingDisplay,q=void 0!==O&&O,W=r.className;r.highConfidenceIcon,r.lowConfidenceIcon;var z=r.customStyles,V=r.customIcons,G=r.aiReasoningDiffView,Q=r.userStoryCitations,J=r.artifactId,K=r.isCraflow,X=r.onCraAccept,Y=r.onCraReject,Z=r.craFlowConfig,nn=r.isDisplayHighlightControl,en=void 0!==nn&&nn,on=l(null),tn=R(),rn=tn.userStory,ln=tn.inlineUpdateComponentConfig,an=tn.getAvgScoreForStory,dn=tn.setUserStory,cn=tn.aiReasoning,sn=tn.setAiReasoning,un=tn.customIcons,vn=tn.searchQueryList,gn=tn.searchQueryReasoningIdList,mn=tn.currentHighlightIndex,pn=tn.segmentComponentConfig,hn=null!=V?V:null==un?void 0:un.userStoryIcons;null==z||z.searchHighlight;var fn=p(on),Cn=fn.search,yn=fn.clear,Sn=a("1"),Rn=Sn[0],wn=Sn[1],In=a(null),bn=In[0],xn=In[1],Nn=l(new Map),An=d(function(n,e){xn(n&&e?{rowId:n,aiReason:e}:null)},[]),kn=J?an(J):0,jn=a([]),Un=jn[0],Tn=jn[1],Pn=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map(Pn).join(""):t.isValidElement(n)?Pn(n.props.children):""},$n=function(n){var e=n;return e=function(n){for(var e,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,o=[],t=new RegExp(i.source,i.flags);null!==(e=t.exec(n));){var r=e[0],l=r.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=r.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(n){return(n.match(/^\s*\d+\.\s/gm)||[]).length};o.push({index:e.index,endIndex:e.index+e[0].length,deletedItemCount:d((null==l?void 0:l[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===o.length)return n;for(var c=n,s=function(n){var e=o[n],i=e.changedItemCount-e.deletedItemCount;if(0===i)return"continue";for(var t=!1,r=0,l=c.substring(0,e.index).split("\n").reverse();r<l.length;r++){var a=l[r].trim();if(""!==a){/^\d+\.\s/.test(a)&&(t=!0);break}}if(!t)return"continue";var d=e.endIndex,s=n+1<o.length?o[n+1].index:c.length,u=c.substring(d,s);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(n,e,o){return"".concat(e).concat(parseInt(o,10)+i,". ")}),c=c.substring(0,d)+u+c.substring(s)},u=o.length-1;u>=0;u--)s(u);return c}(e=(e=(e=(e=(e=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/ai_reasoning\$(\d+)/g,function(n,e){return"ai_reasoning$".concat(e,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(n,e,i){var o=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(e,' data-raw="').concat(o,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(n,e,i,o,t){var r=o.match(/<table[\s\S]*?<\/table>/i);if(r){var l=btoa(encodeURIComponent(r[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,i,o,t){var r=e.substring(0,t),l=r.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(r.substring(l+1))||/^\s+\d+\.\s/.test(r.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(r.substring(l+1));if(a||d){var c=o;return c=(c=(c=(c=c.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(c,"</updated>")}return n})),e=function(n){var e=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==e}),"<deleted>".concat(i,"</deleted>")});return e.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==e,preview:e.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(e),e=F(e)},En=c(function(){return I?$n(I):I},[I]);s(function(){Tn(B||cn)},[B,cn]);var Ln=c(function(){return{upt:function(o){var t;o.node;var r=o.children,l=n(o,["node","children"]),a=null==l?void 0:l.id,d=a?null===(t=a.split("$"))||void 0===t?void 0:t[1]:null,c=cn.find(function(n){return n.id.toString()===d});return c?i(U,e({aiReason:c,customStyles:null==z?void 0:z.inlineUpdatedComponent,handleClickCognitiveDecision:null==ln?void 0:ln.handleClickCognitiveDecision,handleClickUpdatedPill:null==ln?void 0:ln.handleClickUpdatedPill,handleClickOutputValue:null==ln?void 0:ln.handleClickOutputValue,customIcons:null==ln?void 0:ln.customIcons},{children:r})):r},del:function(o){o.node;var t=o.children,r=n(o,["node","children"]);return i("span",e({className:m.deleted,style:null==z?void 0:z.deleted},r,{onClick:r.onclick},{children:t}))},ins:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:m.inserted,style:null==z?void 0:z.inserted},r,{onClick:r.onclick},{children:t}))},h1:function(o){o.node;var t=n(o,["node"]);return i("h1",e({className:m.heading1,style:null==z?void 0:z.heading1},{children:t.children}))},h2:function(o){o.node;var t=n(o,["node"]);return i("h2",e({className:m.heading2,style:null==z?void 0:z.heading2},{children:t.children}))},h3:function(o){o.node;var t=n(o,["node"]);return i("h3",e({className:m.heading3,style:null==z?void 0:z.heading3},{children:t.children}))},b:function(o){o.node;var t=n(o,["node"]);return i("b",e({className:m.bold,style:null==z?void 0:z.bold},{children:null==t?void 0:t.children}))},p:function(o){o.node;var t=n(o,["node"]);return i("p",e({},t,{className:m.paragraph,style:null==z?void 0:z.paragraph},{children:t.children}))},updated:function(o){var t=o.node,r=n(o,["node"]);return i(C,e({},r,{showUserStoryDiff:H,currentUpdatedTagId:Rn,setCurrentUpdatedTagId:wn,userStory:rn,setUserStory:dn,setAiReasoning:sn,node:t,isCraflow:K,onCraAccept:X,onCraReject:Y,customStyles:null==z?void 0:z.updatedContent,craFlowConfig:Z}))},ol:function(o){var t,r,l,a=o.node,d=n(o,["node"]),c=null!==(l=null!==(r=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==d?void 0:d.start)&&void 0!==l?l:void 0;return i("ol",e({className:m.orderedList,style:null==z?void 0:z.olist},c?{start:Number(c)}:{},{children:null==d?void 0:d.children}))},ul:function(o){o.node;var t=n(o,["node"]);return i("ul",e({className:m.unorderedList,style:null==z?void 0:z.ulist},{children:null==t?void 0:t.children}))},table:function(n){var o=n.children;return i("div",e({className:m.tableWrapper},{children:i("table",e({className:m.table,style:null==z?void 0:z.table},{children:o}))}))},tr:function(n){var e=n.node,o=n.children;return i(_,{node:e,children:o,customStyles:z})},td:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i($.Provider,e({value:!0},{children:i("td",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},th:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i($.Provider,e({value:!0},{children:i("th",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},recommendation:function(o){var t;o.node;var r=n(o,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==r?void 0:r.children)||void 0===t?void 0:t[0])||"");return i(A,e({},r,{customStyles:null==z?void 0:z.recommendationBlock,label:l}))},a:function(e){var o,t,r;e.inline,e.children,e.node;var l=n(e,["inline","children","node"]),a=u($)||"true"==(null==l?void 0:l.table),d="".concat(null==l?void 0:l.href),c=null===(o=d.split("$"))||void 0===o?void 0:o[0],s=null===(t=d.split("$"))||void 0===t?void 0:t[1];if("ai_reasoning"===c){var v=(null!==(r=H?G:cn)&&void 0!==r?r:[]).find(function(n){return n.id.toString()===decodeURIComponent(s)}),g=gn.includes(s);if(v)return a?i(M,{aiReason:v,customStyle:null==z?void 0:z.tableAiReasoning,customIcons:hn,isHighConfidence:v.relevance_score>=x}):i(b,{aiReason:v,isSourceHasHighlight:g,customIcons:hn,customStyles:{aiReasoningContent:null==z?void 0:z.aiReasoningContent,aiReasoningAccordion:null==z?void 0:z.aiReasoningAccordion,aiReasoningMarkdown:null==z?void 0:z.aiReasoningMarkdown,aiReasoningPill:null==z?void 0:z.aiReasoningPill,webCitation:null==z?void 0:z.webCitation,stormeeCitation:null==z?void 0:z.stormeeCitation,waveformCitation:null==z?void 0:z.waveformCitation,imageCitation:null==z?void 0:z.imageCitation,fileCitation:null==z?void 0:z.fileCitation,appModCitation:null==z?void 0:z.appModCitation,rcaCitation:null==z?void 0:z.rcaCitation,readFileCitation:null==z?void 0:z.readFileCitation,loadingCitations:null==z?void 0:z.loadingCitations,chatCitation:null==z?void 0:z.chatCitation,bigEnoughCitation:null==z?void 0:z.bigEnoughCitation}})}return null},code:function(o){o.inline;var t=o.children,r=o.className;return o.node,n(o,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?i("div",{children:i("code",e({className:m.blockCode,style:null==z?void 0:z.code},{children:t}))}):i("code",e({className:m.inlineCode,style:null==z?void 0:z.code},{children:t}))},learned:function(n){var o=n.children;return i(f,e({title:o,placement:"top"},{children:i(h,{size:16,className:m.learned})}))},generatedcode:function(e){e.node;var o=n(e,["node"]),t=(null==o?void 0:o.language)||"python",r=function(n){var e="";try{if(n["data-raw"])e=decodeURIComponent(atob(n["data-raw"]));else{var i=function(n){var e;return"string"==typeof n?n:Array.isArray(n)?n.map(i).join(""):(null===(e=null==n?void 0:n.props)||void 0===e?void 0:e.children)?i(n.props.children):""};e=i(n.children)}}catch(i){console.error("Error decoding generated code:",i),e=String(n.children)}return e}(o);return i(y,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==z?void 0:z.generatedCodePill,content:null==z?void 0:z.generatedCodeContent}})},updatedsegment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return i(T,{id:s,node:a,children:d,props:c,segmentComponentConfig:pn,customStyles:z,customIcons:V,extractText:Pn,isUpdatedSegment:!0})},segment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return i(T,{id:s,node:a,children:d,props:c,segmentComponentConfig:pn,customStyles:z,customIcons:V,extractText:Pn})}}},[Un,Z,cn,Q,Rn,H,I,V,vn,gn,z,pn]);return s(function(){if(on.current){if(vn.length){var n;if(0===gn.length||en)requestAnimationFrame(function(){Cn([vn[mn].replace(/\*/g,"")])});else{var e=on.current,i=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){Cn([vn[mn].replace(/\*/g,"")])})},50)});i.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}yn()}},[vn,gn,mn,en]),s(function(){return console.log("mounting userstorywithcitation"),function(){console.log("unmounting userstorywithcitation")}},[]),i(E.Provider,e({value:{expandedInfo:bn,setExpanded:An,reasonToRow:Nn}},{children:o("div",e({ref:on,className:"".concat(m.container," ").concat("approving"!==L?m.wrapper:""," ").concat(W||""),style:null==z?void 0:z.container},{children:[i(P,{children:i(v,e({components:Ln,rehypePlugins:[g]},{children:En}))}),kn>0&&i("div",e({className:m.confidenceScoreContainer,style:null==z?void 0:z.confidenceScoreContainer},{children:o("span",e({className:m.confidenceScore,style:null==z?void 0:z.confidenceScore},{children:[i(N,{size:14,color:(null==z?void 0:z.confidenceScoreIconColor)||"#166534"}),kn,"%"]}))})),q&&i("div",e({className:m.citationLoader,style:null==z?void 0:z.citationLoaderContainer},{children:i(S,{customStyles:{container:null==z?void 0:z.citationLoadingContainer,icon:null==z?void 0:z.citationLoadingIcon,text:null==z?void 0:z.citationLoadingText}})})),j&&i("div",e({style:e({},null===(w=null==z?void 0:z.attachedContext)||void 0===w?void 0:w.wrapper),className:"flex mt-5"},{children:i(k,{customStyles:null==z?void 0:z.attachedContext})}))]}))}))};export{H as default};
2
2
  //# sourceMappingURL=UserStoryWithCitation.js.map
@@ -0,0 +1,2 @@
1
+ import{__assign as t}from"tslib";import{jsx as a}from"react/jsx-runtime";import{createContext as e,useState as i}from"react";var n=e({citationsMetadata:new Map,setCitationsMetadata:function(){return new Map},updateCitationsMetadata:function(){}});function r(e){var r=e.children,o=i(new Map),d=o[0],s=o[1];return a(n.Provider,t({value:{citationsMetadata:d,setCitationsMetadata:s,updateCitationsMetadata:function(t,a){s(function(e){var i=void 0;e.has(t)&&(i=e.get(t));var n=a(i),r=new Map(e);return r.set(t,n),r})}}},{children:r}))}export{r as MarkdownContextProvider,n as MarkdownStateContext};
2
+ //# sourceMappingURL=markdown-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-context.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,7 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { IUserStory } from "../../interfaces/userstory.interface";
3
3
  import { UserStoryCitations } from "../../interfaces/citation.interface";
4
- import { TSegmentComponentConfig } from "../../types/segment.type";
5
4
  interface CardDisplayConfig {
6
5
  showShareButton?: boolean;
7
6
  showEditButton?: boolean;
@@ -47,12 +46,11 @@ interface StoryCardProps {
47
46
  elementDisplayConfig?: ElementDisplayConfig;
48
47
  _resolvedConfig?: CardDisplayConfig;
49
48
  showWrapper?: boolean;
50
- segmentComponentConfig?: TSegmentComponentConfig;
51
49
  actionItemsConfig?: ActionItemsConfig;
52
50
  onDelete?: () => void;
53
51
  }
54
52
  export declare function replaceLearnedTagsWithInfo(content: string): React.ReactNode[];
55
- export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, _resolvedConfig, showWrapper, segmentComponentConfig, actionItemsConfig, onDelete, }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
53
+ export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, _resolvedConfig, showWrapper, actionItemsConfig, onDelete, }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
56
54
  interface IProps {
57
55
  isUserStoryCurrentlyUpdated?: boolean;
58
56
  artifactId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":"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"}
@@ -4,6 +4,7 @@ import './segment-common.css';
4
4
  interface SegmentProps {
5
5
  id?: string;
6
6
  label?: string;
7
+ segmentUUID: string;
7
8
  originalValue?: string;
8
9
  decisionStrength?: number;
9
10
  aiReason?: TAIReasoning;
@@ -1 +1 @@
1
- {"version":3,"file":"Segment.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/segment/Segment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAOpH,OAAO,sBAAsB,CAAA;AAE7B,UAAU,YAAY;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,+BAA+B,CAAC,EAAE,uBAAuB,CAAC;IAC1D,uBAAuB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACtC,kBAAkB,CAAC,EAAC,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAC,OAAO,CAAA;IACzB,MAAM,CAAC,EAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5B;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA2InC,CAAA;AAED,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"Segment.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/segment/Segment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAOpH,OAAO,sBAAsB,CAAA;AAG7B,UAAU,YAAY;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAC,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,+BAA+B,CAAC,EAAE,uBAAuB,CAAC;IAC1D,uBAAuB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACtC,kBAAkB,CAAC,EAAC,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAC,OAAO,CAAA;IACzB,MAAM,CAAC,EAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5B;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAyLnC,CAAA;AAED,eAAe,OAAO,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TSegmentComponentConfig } from '../../types/segment.type';
3
3
  interface SegmentWrapperProps {
4
+ id: string;
4
5
  node: any;
5
6
  children: React.ReactNode;
6
7
  props: any;
@@ -10,6 +11,6 @@ interface SegmentWrapperProps {
10
11
  extractText: (node: React.ReactNode) => string;
11
12
  isUpdatedSegment?: boolean;
12
13
  }
13
- declare const SegmentWrapper: ({ children, props, segmentComponentConfig, customStyles, customIcons, extractText, isUpdatedSegment }: SegmentWrapperProps) => import("react/jsx-runtime").JSX.Element;
14
+ declare const SegmentWrapper: ({ id, children, props, segmentComponentConfig, customStyles, customIcons, extractText, isUpdatedSegment }: SegmentWrapperProps) => import("react/jsx-runtime").JSX.Element;
14
15
  export default SegmentWrapper;
15
16
  //# sourceMappingURL=SegmentWrapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentWrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/segment/SegmentWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,EAAY,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAI7E,UAAU,mBAAmB;IACzB,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,GAAG,CAAC;IACX,sBAAsB,CAAC,EAAE,uBAAuB,CAAC;IACjD,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC;IAC/C,gBAAgB,CAAC,EAAC,OAAO,CAAA;CAC5B;AAGD,QAAA,MAAM,cAAc,0GAQjB,mBAAmB,4CAoFrB,CAAA;AAED,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"SegmentWrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/segment/SegmentWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,EAAY,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAI7E,UAAU,mBAAmB;IACzB,EAAE,EAAC,MAAM,CAAC;IACV,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,GAAG,CAAC;IACX,sBAAsB,CAAC,EAAE,uBAAuB,CAAC;IACjD,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC;IAC/C,gBAAgB,CAAC,EAAC,OAAO,CAAA;CAC5B;AAGD,QAAA,MAAM,cAAc,8GASjB,mBAAmB,4CAsFrB,CAAA;AAED,eAAe,cAAc,CAAA"}
@@ -3,7 +3,6 @@ import { AiReasonAccordionStyles, AiReasoningContentStyles, AppModCitationStyleG
3
3
  import { UpdatedAnimatedContentIcons, UpdatedAnimatedContentStyles } from "../../shared/UpdatedAnimationContent";
4
4
  import { IContextItemStyles } from "../UserStoryCard/AttachedContext";
5
5
  import { IUserStory } from "../../interfaces/userstory.interface";
6
- import { TSegmentComponentConfig } from "../../types/segment.type";
7
6
  export interface UserStoryWithCitationCustomStyles {
8
7
  searchHighlight?: React.CSSProperties;
9
8
  container?: React.CSSProperties;
@@ -107,8 +106,7 @@ interface UserStoryWithCitationsProps {
107
106
  onCraFlowDiffAgentAction?: (action: "accept" | "reject", updatedData: IUserStory[]) => void;
108
107
  displayActionButtons: boolean;
109
108
  };
110
- segmentComponentConfig?: TSegmentComponentConfig;
111
109
  }
112
- declare const UserStoryWithCitations: ({ message, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, craFlowConfig, isDisplayHighlightControl, segmentComponentConfig, }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
110
+ declare const UserStoryWithCitations: ({ message, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, craFlowConfig, isDisplayHighlightControl, }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
113
111
  export default UserStoryWithCitations;
114
112
  //# sourceMappingURL=UserStoryWithCitation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ export type TCitationsContextMetadata = {
3
+ state: "loading" | "ready";
4
+ open: boolean;
5
+ };
6
+ export type TMarkdownStateContext = {
7
+ citationsMetadata: Map<string, TCitationsContextMetadata>;
8
+ setCitationsMetadata: React.Dispatch<React.SetStateAction<Map<string, TCitationsContextMetadata>>>;
9
+ updateCitationsMetadata: (segmentUUID: string, callback: (segmentData: TCitationsContextMetadata | undefined) => TCitationsContextMetadata) => void;
10
+ };
11
+ export declare const MarkdownStateContext: import("react").Context<TMarkdownStateContext>;
12
+ type MarkdownContextProviderProps = {
13
+ children?: React.ReactNode;
14
+ };
15
+ export declare function MarkdownContextProvider({ children }: MarkdownContextProviderProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=markdown-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-context.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/store/markdown-context.tsx"],"names":[],"mappings":";AAEA,MAAM,MAAM,yBAAyB,GAAG;IACpC,KAAK,EAAC,SAAS,GAAG,OAAO,CAAC;IAC1B,IAAI,EAAC,OAAO,CAAA;CACf,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,iBAAiB,EAAC,GAAG,CAAC,MAAM,EAAC,yBAAyB,CAAC,CAAC;IACxD,oBAAoB,EAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,EAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;IACjG,uBAAuB,EAAC,CAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,EAAC,CAAC,WAAW,EAAC,yBAAyB,GAAG,SAAS,KAAG,yBAAyB,KAAG,IAAI,CAAA;CAC7I,CAAA;AAGD,eAAO,MAAM,oBAAoB,gDAI/B,CAAA;AAEF,KAAK,4BAA4B,GAAG;IAChC,QAAQ,CAAC,EAAC,KAAK,CAAC,SAAS,CAAA;CAC5B,CAAA;AAED,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,EAAE,4BAA4B,2CAqBjF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/requirement-ai",
3
- "version": "0.0.173",
3
+ "version": "0.0.174",
4
4
  "author": "Saptyadeep Bhattacharjee",
5
5
  "description": "",
6
6
  "license": "MIT",