@e-llm-studio/requirement-ai 0.0.211 → 0.0.213
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.
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.module.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.module.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.js +2 -0
- package/dist/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.js.map +1 -0
- package/dist/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.module.css.js +2 -0
- package/dist/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.module.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/store/ref.context.js +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts +8 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.d.ts +8 -0
- package/dist/types/src/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- 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"),r=require("react"),n=require("./Editor/constants/editorConfig.js"),o=require("./Editor/Editor.js"),i=require("../../store/ref.context.js"),a=require("@lexical/html"),u=require("turndown"),c=require("turndown-plugin-gfm");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=new(l(u).default)({headingStyle:"atx",codeBlockStyle:"fenced"});d.keep(["ins","del","mark"]),d.keep(function(e){var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r}),d.keep(function(e){return"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")}),d.addRule("md-table-passthrough",{filter:function(e){return"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table")},replacement:function(e,t){return t.textContent||""}}),d.use(c.tables);
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),n=require("./Editor/constants/editorConfig.js"),o=require("./Editor/Editor.js"),i=require("../../store/ref.context.js"),a=require("@lexical/html"),u=require("turndown"),c=require("turndown-plugin-gfm"),s=require("../UnsavedChangesPopup/UnsavedChangesPopup.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=new(l(u).default)({headingStyle:"atx",codeBlockStyle:"fenced"});d.keep(["ins","del","mark"]),d.keep(function(e){var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r}),d.keep(function(e){return"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")}),d.addRule("md-table-passthrough",{filter:function(e){return"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table")},replacement:function(e,t){return t.textContent||""}}),d.use(c.tables);var f=function(e){return(e||"").replace(/\r\n/g,"\n").trim()},h=r.forwardRef(function(u,c){var l=u.type,h=u.value,v=u.handleUpdateState,g=u.onBlur,p=u.placeholder,m=u.minHeight,E=u.height,A=u.mode,b=u.doNotShowBorderInViewMode,w=u.onSaveUnsavedChanges,y=u.onDiscardUnsavedChanges,S=u.isSavingUnsavedChanges,_=void 0!==S&&S,x=r.useRef(null),C=r.useState({type:l,value:h}),q=C[0],N=C[1],T=r.useState(0),R=T[0],L=T[1],j=r.useState(!1),H=j[0],B=j[1],M=r.useRef(h),U=r.useRef(h),W=r.useRef(Boolean(h)),O=i.useRefStore(),P=O.contentRef;O.setContentRef;r.useEffect(function(){N(function(t){return e.__assign(e.__assign({},t),{value:h})}),M.current=h,U.current=h,W.current=Boolean(h),B(!1)},[h]),r.useImperativeHandle(c,function(){return{requestClose:function(){return!("edit"===A&&f(M.current)!==f(U.current))||(B(!0),!1)}}},[A]);return r.useEffect(function(){var e=function(){P&&P.current&&L(P.current.clientHeight-60)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[P]),t.jsxs("div",e.__assign({style:{position:"relative",width:"100%",height:E,minHeight:m}},{children:[H&&t.jsx(s.UnsavedChangesPopup,{isSaving:_,onSave:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,null==w?void 0:w()];case 1:return e.sent(),M.current=U.current,B(!1),[2]}})})},onDiscard:function(){U.current=M.current,null==y||y(),B(!1)}}),t.jsx(o.default,{minHeight:m,height:E,placeholder:p||"Enter some text...",onChange:function(e,t){e.read(function(){var e=a.$generateHtmlFromNodes(t,null),r=(new DOMParser).parseFromString(e,"text/html");function n(e){return Array.from(e.childNodes).map(function(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent||"";if(e.nodeType===Node.ELEMENT_NODE){var t=e,r=t.tagName.toLowerCase(),o=n(t);if("strong"===r||"b"===r)return o.startsWith("<strong>")&&o.endsWith("</strong>")?o:"<strong>".concat(o,"</strong>");if("em"===r||"i"===r)return o.startsWith("<em>")&&o.endsWith("</em>")?o:"<em>".concat(o,"</em>");if("code"===r)return"<code>".concat(o,"</code>");if("u"===r)return"<u>".concat(o,"</u>");if("s"===r)return"<s>".concat(o,"</s>");if("a"===r){var i=t.getAttribute("href")||"";return'<a href="'.concat(i,'">').concat(o,"</a>")}return o}return""}).join("")}r.querySelectorAll("span").forEach(function(e){var t=e.getAttribute("style")||"";t.includes("background-color")&&t.includes("rgb(219, 234, 254)")&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("strong code").forEach(function(e){var t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(function(e){var t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(function(e){var t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(function(e){var t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))}),r.querySelectorAll("ins[data-review-id], del[data-review-id]").forEach(function(e){e.innerHTML=n(e)});var o=[];r.querySelectorAll("ins[data-review-id], del[data-review-id]").forEach(function(e,t){o.push(e.outerHTML);var n=r.createElement("span");n.textContent="%%REVIEW_".concat(t,"%%"),e.replaceWith(n)});var i=[];r.querySelectorAll("table").forEach(function(e,t){i.push(e.outerHTML);var n=r.createElement("p");n.textContent="%%TABLE_".concat(t,"%%"),e.replaceWith(n)});var u=d.turndown(r.body.innerHTML);o.forEach(function(e,t){u=u.replace("%%REVIEW\\_".concat(t,"%%"),e)}),i.forEach(function(e,t){u=u.replace("%%TABLE\\_".concat(t,"%%"),"\n\n".concat(e,"\n\n"))}),u=u.replace(/\*{4}([^*]+)\*{4}/g,"**$1**"),W.current&&(M.current=u,W.current=!1),U.current=u,function(e,t){v(e,t)}("prompt",u)})},toolbarConfig:n.DEFAULT_TOOLBAR_CONFIG,editorRef:x,mode:A,initialString:{type:q.type,value:q.value},dynamicHeight:R,onBlur:g,doNotShowBorderInViewMode:b||!1})]}))});h.displayName="RichTextEditor",exports.default=h;
|
|
2
2
|
//# sourceMappingURL=RichTextEditor.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),a=require("./UnsavedChangesPopup.module.css.js"),n=function(n){var i=n.isSaving,t=void 0!==i&&i,l=n.onSave,o=n.onDiscard;return s.jsx("div",e.__assign({className:a.default.overlay,onClick:function(e){return e.stopPropagation()},role:"presentation"},{children:s.jsxs("div",e.__assign({className:a.default.dialog,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-changes-title"},{children:[s.jsx("h3",e.__assign({id:"unsaved-changes-title",className:a.default.title},{children:"Unsaved changes"})),s.jsx("p",e.__assign({className:a.default.message},{children:"We see, you have unsaved changes, click on Yes to save your changes, else click on No."})),s.jsxs("div",e.__assign({className:a.default.actions},{children:[s.jsx("button",e.__assign({type:"button",className:a.default.noButton,onClick:o,disabled:t},{children:"No"})),s.jsx("button",e.__assign({type:"button",className:a.default.yesButton,onClick:l,disabled:t},{children:t?"Saving...":"Yes"}))]}))]}))}))};exports.UnsavedChangesPopup=n,exports.default=n;
|
|
2
|
+
//# sourceMappingURL=UnsavedChangesPopup.js.map
|
package/dist/cjs/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsavedChangesPopup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".UnsavedChangesPopup-module_overlay__hSGb2{align-items:flex-start;background:#0f172a47;display:flex;inset:0;justify-content:center;padding:24px 16px 16px;position:absolute;z-index:20}.UnsavedChangesPopup-module_dialog__TIloc{background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 18px 45px #0f172a2e;cursor:default;padding:20px;width:min(420px,100%)}.UnsavedChangesPopup-module_title__fWQ1u{color:#111827;font-size:18px;font-weight:600;line-height:26px;margin:0}.UnsavedChangesPopup-module_message__KWuvt{color:#4b5563;font-size:14px;line-height:20px;margin:8px 0 0}.UnsavedChangesPopup-module_actions__4C-2B{display:flex;gap:10px;justify-content:flex-end;margin-top:20px}.UnsavedChangesPopup-module_noButton__fP-Fy,.UnsavedChangesPopup-module_yesButton__2IG5l{border-radius:6px;cursor:pointer;font-size:14px;font-weight:600;min-width:72px;padding:8px 14px}.UnsavedChangesPopup-module_noButton__fP-Fy{background:#fff;border:1px solid #d1d5db;color:#374151}.UnsavedChangesPopup-module_yesButton__2IG5l{background:#5b3df5;border:1px solid #5b3df5;color:#fff}.UnsavedChangesPopup-module_noButton__fP-Fy:disabled,.UnsavedChangesPopup-module_yesButton__2IG5l:disabled{cursor:not-allowed;opacity:.6}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={overlay:"UnsavedChangesPopup-module_overlay__hSGb2",dialog:"UnsavedChangesPopup-module_dialog__TIloc",title:"UnsavedChangesPopup-module_title__fWQ1u",message:"UnsavedChangesPopup-module_message__KWuvt",actions:"UnsavedChangesPopup-module_actions__4C-2B",noButton:"UnsavedChangesPopup-module_noButton__fP-Fy",yesButton:"UnsavedChangesPopup-module_yesButton__2IG5l"};
|
|
2
|
+
//# sourceMappingURL=UnsavedChangesPopup.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsavedChangesPopup.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -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("showdown"),l=require("@mui/material"),o=require("../../icons/Illustration.svg.js"),a=require("uuid"),r=require("./UserStoryCard.module.css.js"),u=require("../../utils/helpers.js"),d=require("../../utils/user-story.utils.js"),c=require("../../shared/AtomicButton.js"),v=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),_=require("../RequirementAIWrapper/RequirementAIWrapper.js"),g=require("../story-screen/BigEnoughPanel.js"),p=require("./TitleEditor/TitleEditor.js"),h=require("./ClinicalTrialSection.js"),y=require("../story-screen/CompletionPanel.js"),m=require("../../icons/CDIcon.js");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x,C=S(s),j=((x={})[_.SectionStatus.WAITING]="WAITING TO GENERATE",x[_.SectionStatus.IN_PROGRESS]="IN PROGRESS",x[_.SectionStatus.GENERATED]="GENERATED",x[_.SectionStatus.FAILED]="FAILED",x[_.SectionStatus.GENERATE]="GENERATE",x[_.SectionStatus.APPROVED]="APPROVED",x);function I(n){for(var s,o=[],r=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(s=r.exec(n));){var c=s[1],v=s.index;v>u&&o.push(t.jsx("span",{children:n.slice(u,v)},"text-pre-".concat(d++))),o.push(t.jsx(l.Tooltip,e.__assign({title:c,placement:"top"},{children:t.jsx(i.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(a.v4()))),u=r.lastIndex}return u<(null==n?void 0:n.length)&&o.push(t.jsx("span",{children:n.slice(u)},"text-post-".concat(d++))),o}function w(t,n,i){var s;if(!t)return{};if(n)return e.__assign({},t.parentConfig);var l=e.__assign({},t.childConfig);return i&&(null===(s=t.subFeatureOverrides)||void 0===s?void 0:s[i])?e.__assign(e.__assign({},l),t.subFeatureOverrides[i]):l}var N=function(n){var s,l=n.displayName,o=_.useRequirementAI().customStyles,a=null===(s=null==o?void 0:o.userStoryCardStyles)||void 0===s?void 0:s.showDisplayName;return t.jsxs("div",e.__assign({className:r.default.displayName,style:null==a?void 0:a.wrapper},{children:[t.jsx(i.Bookmark,{className:r.default.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),t.jsxs("span",e.__assign({style:null==a?void 0:a.label},{children:[l,":"]}))]}))},b=function(s){var S,x,E,D,B,T,A,k,P,U,R,M,q,L,F,z,O,V,W,G,H,Q=s.isUserStoryCurrentlyUpdated,X=s.artifactId,Z=s.artifactTitleId,J=s.parentUserStory,K=s.currentUserStory,Y=s.onUserStoryChange,$=s.parentIndex,ee=s.currentIndex,te=s.enableDownload,ne=s.isDiffEditReviewMode,ie=s.showUserStoryDiff,se=s.handleDownloadUserStory,le=s.handleOpenSendDialog,oe=s.updateUserStoryArtifact,ae=s.selectedArtifactId,re=s.isDisplayHighlightControl,ue=s.elementDisplayConfig,de=s._resolvedConfig,ce=s.showWrapper,ve=void 0!==ce&&ce,fe=s.defaultExpanded,_e=s.actionItemsConfig,ge=s.onDelete,pe=s.contextVariant,he=s.expandedSubFeatures,ye=s.showDisplayName,me=void 0===ye||ye,Se=s.allowTitleEdit,xe=void 0===Se||Se,Ce=s.showConfidenceScore,je=void 0===Ce||Ce,Ie=s.showBorderTop,we=void 0===Ie||Ie,Ne=s.sectionStatusConfig,be=s.showCompletionPanel,Ee=void 0!==be&&be,De=s.showAddSectionButton,Be=void 0!==De&&De,Te=s.disableEditPlan,Ae=void 0!==Te&&Te,ke=s.useMuiTooltip,Pe=void 0!==ke&&ke,Ue=s.approveButtonConfig,Re=s.CDNeededInChip,Me=null!=Ne?Ne:{},qe=Me.isLoadingSectionData,Le=void 0!==qe&&qe,Fe=Me.onLoadSectionData,ze=Me.status,Oe=Me.onStatusClick,Ve=Me.completedCount,We=Me.totalCount,Ge=Me.isNoDataAvailable,He=void 0!==Ge&&Ge,Qe=_.useRequirementAI(),Xe=Qe.searchQueryList,Ze=Qe.citations,Je=Qe.customStyles,Ke=Qe.customSectionConfig,Ye=null==Je?void 0:Je.userStoryCardStyles,$e=null==Ye?void 0:Ye.statusStyles,et=null===(x=null==Je?void 0:Je.userStoryCardStyles)||void 0===x?void 0:x.userStoryEditStyles,tt=null===(E=null==Je?void 0:Je.userStoryScreenStyles)||void 0===E?void 0:E.userStoryContentStyles,nt=null==Ye?void 0:Ye.progressHeaderStyles,it=null==Ye?void 0:Ye.clinicalTrialSectionStyles,st=null==Ye?void 0:Ye.CompletionStyles,lt=null==Ye?void 0:Ye.noDataStyles,ot=null==Ye?void 0:Ye.approveButtonStyles,at=null!==(B=null===(D=null==Ke?void 0:Ke.shouldRender)||void 0===D?void 0:D.call(Ke,K))&&void 0!==B&&B,rt=null===(T=null==Ke?void 0:Ke.getValue)||void 0===T?void 0:T.call(Ke,K),ut=null!==(k=null===(A=null==Ke?void 0:Ke.getFields)||void 0===A?void 0:A.call(Ke,K))&&void 0!==k?k:[],dt=null!==(P=null==Ke?void 0:Ke.isEditDisabled)&&void 0!==P&&P,ct=null!==(R=null===(U=null==Ke?void 0:Ke.isSaving)||void 0===U?void 0:U.call(Ke,K))&&void 0!==R&&R,vt=(G=null!==(M=K.completion_percentage)&&void 0!==M?M:0,H=st,G>=80?null==H?void 0:H.highCompletion:G>=50?null==H?void 0:H.mediumCompletion:null==H?void 0:H.lowCompletion),ft=((S={})[_.SectionStatus.WAITING]=null==$e?void 0:$e.waiting,S[_.SectionStatus.IN_PROGRESS]=null==$e?void 0:$e.inProgress,S[_.SectionStatus.GENERATED]=null==$e?void 0:$e.generated,S[_.SectionStatus.FAILED]=null==$e?void 0:$e.failed,S[_.SectionStatus.GENERATE]=null==$e?void 0:$e.generate,S[_.SectionStatus.APPROVED]=null==$e?void 0:$e.approved,S),_t=n.useState(e.__assign(e.__assign({},structuredClone(K)),{value:u.formatMarkdown(K.value)||""})),gt=_t[0],pt=_t[1],ht=n.useState({userStory:!!K.isDefaultEdit}),yt=ht[0],mt=ht[1],St=n.useState(!1),xt=St[0],Ct=St[1],jt=n.useState(!1),It=jt[0],wt=jt[1],Nt=n.useState(null),bt=Nt[0],Et=Nt[1],Dt=n.useState(null),Bt=Dt[0],Tt=Dt[1],At=_.useRequirementAI(),kt=At.userStory,Pt=At.customIcons,Ut=n.useState(null!=fe?fe:""===$||ae===K.artifactId||!!K.isDefaultOpen),Rt=Ut[0],Mt=Ut[1],qt=n.useState(!1);qt[0];var Lt=qt[1],Ft=n.useState(null),zt=Ft[0],Ot=Ft[1],Vt=n.useState(null),Wt=Vt[0],Gt=Vt[1],Ht=n.useState(!1),Qt=Ht[0],Xt=Ht[1],Zt=n.useRef(null),Jt=n.useState(!1);Jt[0];var Kt=Jt[1],Yt=n.useState(!1),$t=Yt[0],en=Yt[1],tn=n.useRef(null);n.useEffect(function(){Q&&Mt(Q)},[Q]),n.useEffect(function(){pt(e.__assign(e.__assign({},structuredClone(K)),{value:u.formatMarkdown(K.value)||""}))},[K]),n.useEffect(function(){Xe.length>0?Mt(!0):void 0===fe&&(ae?Mt(ae===K.artifactId):he&&he.length>0&&Mt(he.includes(K.artifactId)))},[Xe,ae,K.artifactId,he]);var nn=function(){Ot(null)},sn=function(){Gt(null)},ln=function(){Mt(function(e){return!e})};var on=null!=(null==K?void 0:K.big_enough)&&!Number.isNaN(K.big_enough)&&!!(null==K?void 0:K.big_enough_decision_factors),an=null!==(q=null==K?void 0:K.completion_percentage)&&void 0!==q?q:0,rn=!!(null==K?void 0:K.completion_decision_factors),un=""===$,dn=null!=de?de:w(ue,un),cn=!ne&&!ie;return n.useEffect(function(){if(Bt){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(Bt));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[Bt]),n.useEffect(function(){K.isDefaultEdit&&mt(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})},[K.isDefaultEdit]),t.jsxs("div",e.__assign({className:r.default.card,style:null==Ye?void 0:Ye.cardStyle,id:"story-card-".concat(K.title),"data-expanded":Rt},{children:[t.jsxs("div",e.__assign({className:r.default.titleSection,style:null==Ye?void 0:Ye.titleSection},{children:[t.jsxs("div",e.__assign({className:r.default.titleRow,style:null==Ye?void 0:Ye.titleRow,onClick:ln},{children:[t.jsxs("div",e.__assign({className:r.default.titleLeft,style:null==Ye?void 0:Ye.titleLeft,onMouseEnter:function(){return Kt(!0)},onMouseLeave:function(){return Kt(!1)}},{children:[me&&t.jsx(N,{displayName:Z}),xt&&cn?t.jsx(p.InlineTitleEditor,{title:K.title,onSave:function(t){return function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var i,s;return e.__generator(this,function(l){try{i=e.__assign({},K),K.artifactId===n?i.title=t:i.sub_features=(null===(s=K.sub_features)||void 0===s?void 0:s.map(function(i){return i.artifactId===n?e.__assign(e.__assign({},i),{title:t}):i}))||[],pt(i),Y(i),Ct(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(t,K.artifactId)},onCancel:function(){Ct(!1)},inputStyle:null==et?void 0:et.inlineTitleInput,confirmButtonStyle:null==et?void 0:et.inlineTitleConfirm,cancelButtonStyle:null==et?void 0:et.inlineTitleCancel},"inline-title-editor"):t.jsxs("div",e.__assign({className:r.default.storyTitleWrapper},{children:[t.jsx(l.Tooltip,e.__assign({title:I(K.title),arrow:!0},{children:t.jsx("h2",e.__assign({title:Pe?void 0:K.title,className:r.default.storyTitle,style:null==Ye?void 0:Ye.storyTitle},{children:I(K.title)}),K.artifactId)})),Ee&&!at&&(rn?t.jsx(y.CompletionPanel,e.__assign({customIcons:null==Pt?void 0:Pt.userStoryIcons,customStyles:null==Ye?void 0:Ye.aiReasoningCitaionStyles,currentUserStory:K,panelStyles:null==Ye?void 0:Ye.CompletionStyles,onToggleStateChange:en},{children:t.jsxs("div",e.__assign({style:e.__assign(e.__assign({display:"inline-flex",alignItems:"center",gap:"4px"},null==st?void 0:st.badge),vt)},{children:[t.jsxs("span",{children:[an,"% Completed"]}),t.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:t.jsx(m.default,{color:"currentColor"})})),$t?t.jsx(i.ChevronUp,{size:14,style:null==st?void 0:st.chevronStyle}):t.jsx(i.ChevronDown,{size:14,style:null==st?void 0:st.chevronStyle})]}))})):t.jsx("div",e.__assign({style:e.__assign(e.__assign({display:"inline-flex",alignItems:"center",gap:"4px"},null==st?void 0:st.badge),vt)},{children:t.jsxs("span",{children:[an,"% Completed"]})}))),xe&&t.jsx("button",e.__assign({type:"button",className:r.default.titleEditButton,style:null==et?void 0:et.titleEditButton,onClick:function(e){e.stopPropagation(),Ct(!0),Rt||Mt(!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"})}))}))]}))]})),(ze||void 0!==Ve&&void 0!==We)&&t.jsxs("div",e.__assign({className:r.default.statusContainer},{children:[void 0!==Ve&&void 0!==We&&t.jsxs("div",e.__assign({className:r.default.completedBadge},{children:["Completed: ",Ve,"/",We]})),ze&&t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==Oe||Oe()},className:r.default.statusButton,style:ft[ze]},{children:j[ze]}))]})),t.jsxs("div",e.__assign({className:r.default.titleActions,style:null==Ye?void 0:Ye.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(dn.showProgressPercentage||dn.showGapBox)&&ve&&t.jsxs("div",e.__assign({className:r.default.progressHeader,style:null==nt?void 0:nt.wrapper},{children:[dn.showProgressPercentage&&t.jsxs("div",e.__assign({className:r.default.progressPercentage,style:null==nt?void 0:nt.percentage},{children:[null!==(F=null!==(L=null==K?void 0:K.confidenceScore)&&void 0!==L?L:null==dn?void 0:dn.confidenceValue)&&void 0!==F?F:"0","%"]})),dn.showGapBox&&t.jsxs("div",e.__assign({className:r.default.gapBox,style:null==nt?void 0:nt.gapBox},{children:[null!==(O=null!==(z=null==K?void 0:K.gapValue)&&void 0!==z?z:null==dn?void 0:dn.gapBoxValue)&&void 0!==O?O:"2"," ","Gaps"]}))]})),on&&t.jsx(g.BigEnoughPanel,{customIcons:null==Pt?void 0:Pt.userStoryIcons,customStyles:null==Ye?void 0:Ye.aiReasoningCitaionStyles,currentUserStory:K,panelStyles:null==Ye?void 0:Ye.BigEnoughStyles}),!yt.userStory&&t.jsxs(t.Fragment,{children:[!1!==(null==dn?void 0:dn.showShareButton)&&t.jsx("button",e.__assign({className:r.default.iconButton,style:null==Ye?void 0:Ye.iconButton,onClick:function(e){Ot(e.currentTarget)}},{children:t.jsx(i.ExternalLink,{size:16})})),t.jsxs(l.Menu,e.__assign({id:"user-story-share-menu",anchorEl:zt,open:!!zt,onClose:function(){return Ot(null)},style:null==Ye?void 0:Ye.userStoryShareMenu},{children:[te&&t.jsx(l.MenuItem,e.__assign({style:null==Ye?void 0:Ye.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 Lt(!0),se?[4,Promise.all([se("pdf"),se("doc")])]:[2];case 1:return e.sent(),Lt(!1),[2]}})})}},{children:t.jsxs("div",e.__assign({ref:Zt,className:r.default.menuItemContent,style:null==Ye?void 0:Ye.menuItemContent},{children:[t.jsx(i.Download,{size:16,color:null==Ye?void 0:Ye.menuIconColor}),t.jsx("p",e.__assign({style:null==Ye?void 0:Ye.menuLabel},{children:"Download"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==Ye?void 0:Ye.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){return t=K,J&&(t=e.__assign(e.__assign({},K),{value:"".concat(d.replaceTitleSection(null==J?void 0:J.value,K.title)," \n").concat(K.value)})),null==le||le(!0,[t],K.artifactId),nn(),[2]})})}},{children:t.jsxs("div",e.__assign({style:null==Ye?void 0:Ye.menuItemContent,className:r.default.menuItemContentPadded},{children:[t.jsx(i.Share2,{size:16,color:null==Ye?void 0:Ye.menuIconColor}),t.jsx("p",e.__assign({style:null==Ye?void 0:Ye.menuLabel},{children:"Send"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==Ye?void 0:Ye.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,i,s,l;return e.__generator(this,function(e){switch(e.label){case 0:t=new C.default.Converter,n=t.makeHtml(u.formatMarkdown(K.value)||K.value),i=function(e){var t=(new C.default.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(u.formatMarkdown(K.value)||K.value),s=new ClipboardItem({"text/plain":new Blob([i],{type:"text/plain"}),"text/html":new Blob([n],{type:"text/html"})}),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,navigator.clipboard.write([s])];case 2:return e.sent(),console.log("Copied User Story"),[3,5];case 3:return l=e.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return nn(),[7];case 5:return[2]}})})}},{children:t.jsxs("div",e.__assign({style:null==Ye?void 0:Ye.menuItemContent,className:r.default.menuItemContentPadded},{children:[t.jsx(i.Copy,{size:16,color:null==Ye?void 0:Ye.menuIconColor}),t.jsx("p",e.__assign({style:null==Ye?void 0:Ye.menuLabel},{children:"Copy"}))]}))}))]}))]}),yt.userStory&&Rt?t.jsx(c.default,{type:"outline",children:"Cancel",style:null==Ye?void 0:Ye.cancelButton,onClick:function(){var t;null===(t=tn.current)||void 0===t||t.abort(),mt(function(t){return e.__assign(e.__assign({},t),{userStory:!1})})}}):t.jsx(t.Fragment,{}),yt.userStory&&Rt?t.jsx(c.default,{type:"fill",children:Qt?t.jsxs("span",e.__assign({className:r.default.savingSpinner,style:null==Ye?void 0:Ye.savingSpinner},{children:[t.jsx(i.LoaderCircle,{className:r.default.spinAnimation,style:null==Ye?void 0:Ye.spinAnimation}),t.jsx("span",{children:"Saving..."})]})):"Save",isDisable:Qt,style:Qt?null==Ye?void 0:Ye.savingButton:null==Ye?void 0:Ye.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 Xt(!0),"userStory"==="userStory"&&(Y(gt),console.log("I am changing RTE editor values",gt)),[4,oe(Ze,kt,X,null===(t=tn.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),Y(e.__assign(e.__assign({},gt),{isDefaultEdit:!1})),mt(function(t){return e.__assign(e.__assign({},t),{userStory:!1})}),Xt(!1),[2]}})})}}):!ne&&!ie&&!Ae&&Rt&&!1!==(null==dn?void 0:dn.showEditButton)&&t.jsx("button",e.__assign({className:r.default.iconButton,style:null==Ye?void 0:Ye.editButton,onClick:function(){return mt(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})}},{children:t.jsx(i.PencilIcon,{color:null==Ye?void 0:Ye.pencilIconColor,size:16})})),Be&&un&&Rt&&!ne&&!ie&&!1!==(null==dn?void 0:dn.showEditButton)&&t.jsxs("button",e.__assign({type:"button",className:r.default.addSectionButton,style:null==et?void 0:et.addSectionButton,onClick:function(t){var n,i,s;t.stopPropagation();var l=(null!==(i=null===(n=K.sub_features)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+1,o={artifactId:a.v4(),title:"New Section ".concat(l),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},r=e.__assign(e.__assign({},K),{sub_features:e.__spreadArray(e.__spreadArray([],null!==(s=K.sub_features)&&void 0!==s?s:[],!0),[o],!1)});pt(r),Y(r),Mt(!0),Tt(o.title)},"aria-label":"Add section",title:"Add section"},{children:[t.jsx(i.Plus,{size:14}),t.jsx("span",e.__assign({className:r.default.addSectionLabel},{children:"Add Section"}))]})),!un&&!ne&&!Ae&&!ie&&t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==ge||ge()},className:r.default.iconButton,style:null==et?void 0:et.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:t.jsx(i.Trash2,{size:16})})),at&&t.jsx("button",e.__assign({type:"button",className:r.default.iconButton,disabled:dt,onClick:function(e){if(e.stopPropagation(),It)return Et(null),void wt(!1);Et(structuredClone(null!=rt?rt:{})),Mt(!0),wt(!0)}},{children:It?t.jsx(i.X,{size:16,color:null==Ye?void 0:Ye.pencilIconColor}):t.jsx(i.PencilIcon,{size:16,color:null==Ye?void 0:Ye.pencilIconColor})})),(null==dn?void 0:dn.actionItemsButton)&&t.jsxs(t.Fragment,{children:[t.jsx("span",e.__assign({className:r.default.actionItemBtn,style:null==Ye?void 0:Ye.actionItemBtn,onClick:function(e){e.stopPropagation(),Gt(e.currentTarget)}},{children:t.jsx(i.Ellipsis,{})})),t.jsx(l.Menu,e.__assign({id:"user-story-action-menu",anchorEl:Wt,open:!!Wt,onClose:sn,style:null==Ye?void 0:Ye.userStoryShareMenu},{children:null==_e?void 0:_e.items.map(function(n,i){return t.jsx(l.MenuItem,e.__assign({style:null==Ye?void 0:Ye.userStoryMenuItem,onClick:function(){n.onclick(K),sn()}},{children:t.jsxs("div",e.__assign({className:r.default.menuItemContent,style:e.__assign(e.__assign({},null==Ye?void 0:Ye.menuItemContent),!n.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[t.jsx("span",e.__assign({className:r.default.menuItemIcon,style:null==Ye?void 0:Ye.menuItemIcon},{children:n.icon})),t.jsx("p",e.__assign({style:null==Ye?void 0:Ye.menuLabel},{children:n.name})),t.jsx("span",{className:r.default.menuItemRight,style:null==Ye?void 0:Ye.menuItemRight})]}))}),"action-item-".concat(i,"-").concat(n.name))})}))]}),t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),ln()},style:null==Ye?void 0:Ye.chevronButton,className:r.default.chevronButton},{children:Rt?t.jsx(i.ChevronUp,{className:r.default.chevronIcon,color:null==Ye?void 0:Ye.chevronIconColor}):t.jsx(i.ChevronDown,{className:r.default.chevronIcon,color:null==Ye?void 0:Ye.chevronIconColor})}))]}))]})),t.jsx("div",{className:r.default.divider,style:null==Ye?void 0:Ye.dividerStyle})]})),Rt&&t.jsx("div",e.__assign({className:r.default.cardContent,style:e.__assign(e.__assign({},null==Ye?void 0:Ye.cardContentStyle),{borderTop:we?"1px solid #E5E5E5":"none"})},{children:Le?t.jsxs("div",e.__assign({className:r.default.loadingContainer},{children:[t.jsx("div",e.__assign({className:r.default.loadingIconWrapper},{children:t.jsx(i.Hourglass,{size:28,color:"#5B3DF5",className:r.default.spinAnimation})})),t.jsxs("div",{children:[t.jsx("h3",e.__assign({className:r.default.loadingTitle},{children:"Section generation in progress.."})),t.jsx("p",e.__assign({className:r.default.loadingSubtitle},{children:"This may take a few minutes"}))]}),t.jsx("button",e.__assign({type:"button",onClick:function(){return null==Fe?void 0:Fe()},className:r.default.viewStatusButton},{children:"View Status"}))]})):He?t.jsxs("div",e.__assign({className:r.default.noDataContainer,style:null==lt?void 0:lt.container},{children:[t.jsx("img",{src:o.default,alt:"No data available",className:r.default.noDataIllustration,style:null==lt?void 0:lt.illustration}),t.jsx("h3",e.__assign({className:r.default.noDataTitle,style:null==lt?void 0:lt.title},{children:"No Data Available for This Section"})),t.jsx("p",e.__assign({className:r.default.noDataSubtitle,style:null==lt?void 0:lt.subtitle},{children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."}))]})):t.jsxs("div",e.__assign({className:r.default.contentInner,style:null==Ye?void 0:Ye.contentInner},{children:[t.jsxs("div",e.__assign({className:r.default.descriptionSection,style:null==Ye?void 0:Ye.descriptionSection},{children:[t.jsx("div",{className:r.default.justifyBetween,style:null==Ye?void 0:Ye.justifyBetween}),yt.userStory?t.jsx(v.default,{minHeight:"100%",height:"100%",type:"string",value:u.formatMarkdown(K.value)||"",handleUpdateState:function(t,n){var i=u.indentMarkdown(n);pt(function(t){return e.__assign(e.__assign({},t),{value:i||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:yt.userStory?"edit":"readOnly"}):at?t.jsx(h.default,{styles:it,fields:ut,readonly:!It,isSaving:ct,value:null!==(V=null!=bt?bt:rt)&&void 0!==V?V:{},onChange:Et,onSave:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return bt?[4,null===(t=null==Ke?void 0:Ke.onSave)||void 0===t?void 0:t.call(Ke,K,bt)]:[2];case 1:return e.sent(),Et(null),wt(!1),[2]}})})},onCancel:function(){Et(null),wt(!1)}}):t.jsxs(t.Fragment,{children:[t.jsx(f.default,{showUserStoryDiff:ie,isParent:""===$,message:u.formatMarkdown(K.value)||"",artifactId:K.artifactId,customStyles:tt,isDisplayHighlightControl:re,contextVariant:pe,showConfidenceScore:je,CDNeededInChip:Re}),Ue&&t.jsx("div",e.__assign({className:r.default.approveButtonContainer,style:null==ot?void 0:ot.container},{children:t.jsx("button",e.__assign({type:"button",className:r.default.approveButton,style:null==ot?void 0:ot.button,disabled:Ue.disabled||Ue.isLoading,onClick:function(e){var t;e.stopPropagation(),null===(t=null==Ue?void 0:Ue.onClick)||void 0===t||t.call(Ue)}},{children:Ue.isLoading?t.jsxs(t.Fragment,{children:[t.jsx(i.LoaderCircle,{size:16,className:r.default.spinner,style:null==ot?void 0:ot.icon}),t.jsx("span",e.__assign({style:null==ot?void 0:ot.text},{children:Ue.label}))]}):t.jsxs(t.Fragment,{children:[t.jsx("span",e.__assign({style:null==ot?void 0:ot.text},{children:Ue.label})),t.jsx(i.Check,{size:16,style:null==ot?void 0:ot.icon})]})}))}))]})]})),null===(W=gt.sub_features)||void 0===W?void 0:W.map(function(n,i){var s=w(ue,!1,n.artifactId);return t.jsx(b,{artifactId:X,isUserStoryCurrentlyUpdated:Q,artifactTitleId:"".concat(Z,"-").concat(String.fromCharCode(65+i)),parentUserStory:K,parentIndex:"".concat($).concat($&&".").concat(ee),currentIndex:"".concat(i+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(t){return function(t,n){var i=e.__spreadArray([],K.sub_features||[],!0);i[t]=n,Y(e.__assign(e.__assign({},K),{sub_features:i}))}(i,t)},enableDownload:!0,isDiffEditReviewMode:ne,showUserStoryDiff:ie,updateUserStoryArtifact:oe,handleDownloadUserStory:se,handleOpenSendDialog:le,isDisplayHighlightControl:re,elementDisplayConfig:ue,_resolvedConfig:s,actionItemsConfig:_e,onDelete:function(){return function(t){var n=(K.sub_features||[]).filter(function(e,n){return n!==t}),i=e.__assign(e.__assign({},K),{sub_features:n});pt(i),Y(i)}(i)},expandedSubFeatures:he,disableEditPlan:Ae,useMuiTooltip:Pe},n.artifactId)})]}))}))]}))};exports.StoryCard=b,exports.UserStoryCardWrapper=function(n){var s=n.artifactTitleIDs,l=n.expandedSubFeatures,o=n.isDiffEditReviewMode,a=n.showUserStoryDiff,u=n.updateUserStoryArtifact,d=n.isUserStoryCurrentlyUpdated,c=n.artifactId,v=n.handleOpenSendDialog,f=n.handleDownloadUserStory,g=n.selectedArtifactId,p=n.isDisplayHighlightControl,h=n.elementDisplayConfig,y=n.showWrapper,m=n.actionItemsConfig,S=n.contextVariant,x=n.showDisplayName,C=n.allowTitleEdit,j=n.showConfidenceScore,I=n.showBorderTop,N=n.defaultExpanded,E=n.showCompletionPanel,D=void 0!==E&&E,B=n.showAddSectionButton,T=void 0!==B&&B,A=n.disableEditPlan,k=void 0!==A&&A,P=n.useMuiTooltip,U=void 0!==P&&P,R=n.approveButtonConfig,M=n.CDNeededInChip,q=_.useRequirementAI(),L=q.userStory,F=q.setUserStory,z=q.customStyles,O=q.searchQueryList,V=q.currentHighlightIndex,W=q.setCurrentHighlightIndex;q.segmentComponentConfig;var G=q.sectionStatusConfig,H=null==z?void 0:z.userStoryCardStyles,Q=0===V,X=V===O.length-1;return t.jsxs("div",e.__assign({className:r.default.userStoryCardWrapper,style:p?e.__assign(e.__assign({},null==H?void 0:H.userStoryCardWrapper),{position:"relative"}):null==H?void 0:H.userStoryCardWrapper},{children:[p&&t.jsx(t.Fragment,{children:O.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:[V+1," of ",O.length]})),t.jsxs("div",e.__assign({className:r.default.navButtons},{children:[t.jsx("button",e.__assign({onClick:function(){V>0&&W(function(e){return e-1})},className:r.default.navButton,disabled:Q},{children:t.jsx(i.ChevronUpIcon,{size:20,className:r.default.navIcon})})),t.jsx("button",e.__assign({onClick:function(){V<O.length-1&&W(function(e){return e+1})},className:r.default.navButton,disabled:X},{children:t.jsx(i.ChevronDownIcon,{size:20,className:r.default.navIcon})}))]}))]}))}))}))}),L.map(function(n,i){var r=w(h,!0);return t.jsx(b,{isUserStoryCurrentlyUpdated:d,artifactId:c,artifactTitleId:s[i]||"",expandedSubFeatures:l,currentUserStory:n,onUserStoryChange:function(t){F(function(n){return n[i]=t,e.__spreadArray([],n,!0)})},parentIndex:"",currentIndex:"".concat(i+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:o,showUserStoryDiff:a,updateUserStoryArtifact:u,handleOpenSendDialog:v,handleDownloadUserStory:f,selectedArtifactId:g,isDisplayHighlightControl:p,elementDisplayConfig:h,_resolvedConfig:r,showWrapper:y,defaultExpanded:N,actionItemsConfig:m,contextVariant:S,showDisplayName:x,allowTitleEdit:C,showConfidenceScore:j,showBorderTop:I,sectionStatusConfig:G,showCompletionPanel:D,showAddSectionButton:T,disableEditPlan:k,useMuiTooltip:U,approveButtonConfig:R,CDNeededInChip:M},n.artifactId)})]}))},exports.default=b,exports.replaceLearnedTagsWithInfo=I;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react"),s=require("showdown"),l=require("@mui/material"),o=require("../../icons/Illustration.svg.js"),a=require("uuid"),r=require("./UserStoryCard.module.css.js"),u=require("../../utils/helpers.js"),d=require("../../utils/user-story.utils.js"),c=require("../../shared/AtomicButton.js"),v=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),_=require("../RequirementAIWrapper/RequirementAIWrapper.js"),g=require("../story-screen/BigEnoughPanel.js"),p=require("./TitleEditor/TitleEditor.js"),h=require("./ClinicalTrialSection.js"),y=require("../story-screen/CompletionPanel.js"),m=require("../../icons/CDIcon.js");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x,C=S(s),j=((x={})[_.SectionStatus.WAITING]="WAITING TO GENERATE",x[_.SectionStatus.IN_PROGRESS]="IN PROGRESS",x[_.SectionStatus.GENERATED]="GENERATED",x[_.SectionStatus.FAILED]="FAILED",x[_.SectionStatus.GENERATE]="GENERATE",x[_.SectionStatus.APPROVED]="APPROVED",x);function I(t){for(var s,o=[],r=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(s=r.exec(t));){var c=s[1],v=s.index;v>u&&o.push(n.jsx("span",{children:t.slice(u,v)},"text-pre-".concat(d++))),o.push(n.jsx(l.Tooltip,e.__assign({title:c,placement:"top"},{children:n.jsx(i.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(a.v4()))),u=r.lastIndex}return u<(null==t?void 0:t.length)&&o.push(n.jsx("span",{children:t.slice(u)},"text-post-".concat(d++))),o}function w(n,t,i){var s;if(!n)return{};if(t)return e.__assign({},n.parentConfig);var l=e.__assign({},n.childConfig);return i&&(null===(s=n.subFeatureOverrides)||void 0===s?void 0:s[i])?e.__assign(e.__assign({},l),n.subFeatureOverrides[i]):l}var N=function(t){var s,l=t.displayName,o=_.useRequirementAI().customStyles,a=null===(s=null==o?void 0:o.userStoryCardStyles)||void 0===s?void 0:s.showDisplayName;return n.jsxs("div",e.__assign({className:r.default.displayName,style:null==a?void 0:a.wrapper},{children:[n.jsx(i.Bookmark,{className:r.default.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),n.jsxs("span",e.__assign({style:null==a?void 0:a.label},{children:[l,":"]}))]}))},b=function(s){var S,x,E,D,B,T,A,k,P,U,R,M,q,L,F,z,O,V,W,G,H,Q=s.isUserStoryCurrentlyUpdated,X=s.artifactId,Z=s.artifactTitleId,J=s.parentUserStory,K=s.currentUserStory,Y=s.onUserStoryChange,$=s.parentIndex,ee=s.currentIndex,ne=s.enableDownload,te=s.isDiffEditReviewMode,ie=s.showUserStoryDiff,se=s.handleDownloadUserStory,le=s.handleOpenSendDialog,oe=s.updateUserStoryArtifact,ae=s.selectedArtifactId,re=s.isDisplayHighlightControl,ue=s.elementDisplayConfig,de=s._resolvedConfig,ce=s.showWrapper,ve=void 0!==ce&&ce,fe=s.defaultExpanded,_e=s.actionItemsConfig,ge=s.onDelete,pe=s.contextVariant,he=s.expandedSubFeatures,ye=s.showDisplayName,me=void 0===ye||ye,Se=s.allowTitleEdit,xe=void 0===Se||Se,Ce=s.showConfidenceScore,je=void 0===Ce||Ce,Ie=s.showBorderTop,we=void 0===Ie||Ie,Ne=s.sectionStatusConfig,be=s.showCompletionPanel,Ee=void 0!==be&&be,De=s.showAddSectionButton,Be=void 0!==De&&De,Te=s.disableEditPlan,Ae=void 0!==Te&&Te,ke=s.useMuiTooltip,Pe=void 0!==ke&&ke,Ue=s.approveButtonConfig,Re=s.CDNeededInChip,Me=null!=Ne?Ne:{},qe=Me.isLoadingSectionData,Le=void 0!==qe&&qe,Fe=Me.onLoadSectionData,ze=Me.status,Oe=Me.onStatusClick,Ve=Me.completedCount,We=Me.totalCount,Ge=Me.isNoDataAvailable,He=void 0!==Ge&&Ge,Qe=_.useRequirementAI(),Xe=Qe.searchQueryList,Ze=Qe.citations,Je=Qe.customStyles,Ke=Qe.customSectionConfig,Ye=null==Je?void 0:Je.userStoryCardStyles,$e=null==Ye?void 0:Ye.statusStyles,en=null===(x=null==Je?void 0:Je.userStoryCardStyles)||void 0===x?void 0:x.userStoryEditStyles,nn=null===(E=null==Je?void 0:Je.userStoryScreenStyles)||void 0===E?void 0:E.userStoryContentStyles,tn=null==Ye?void 0:Ye.progressHeaderStyles,sn=null==Ye?void 0:Ye.clinicalTrialSectionStyles,ln=null==Ye?void 0:Ye.CompletionStyles,on=null==Ye?void 0:Ye.noDataStyles,an=null==Ye?void 0:Ye.approveButtonStyles,rn=null!==(B=null===(D=null==Ke?void 0:Ke.shouldRender)||void 0===D?void 0:D.call(Ke,K))&&void 0!==B&&B,un=null===(T=null==Ke?void 0:Ke.getValue)||void 0===T?void 0:T.call(Ke,K),dn=null!==(k=null===(A=null==Ke?void 0:Ke.getFields)||void 0===A?void 0:A.call(Ke,K))&&void 0!==k?k:[],cn=null!==(P=null==Ke?void 0:Ke.isEditDisabled)&&void 0!==P&&P,vn=null!==(R=null===(U=null==Ke?void 0:Ke.isSaving)||void 0===U?void 0:U.call(Ke,K))&&void 0!==R&&R,fn=(G=null!==(M=K.completion_percentage)&&void 0!==M?M:0,H=ln,G>=80?null==H?void 0:H.highCompletion:G>=50?null==H?void 0:H.mediumCompletion:null==H?void 0:H.lowCompletion),_n=((S={})[_.SectionStatus.WAITING]=null==$e?void 0:$e.waiting,S[_.SectionStatus.IN_PROGRESS]=null==$e?void 0:$e.inProgress,S[_.SectionStatus.GENERATED]=null==$e?void 0:$e.generated,S[_.SectionStatus.FAILED]=null==$e?void 0:$e.failed,S[_.SectionStatus.GENERATE]=null==$e?void 0:$e.generate,S[_.SectionStatus.APPROVED]=null==$e?void 0:$e.approved,S),gn=t.useState(e.__assign(e.__assign({},structuredClone(K)),{value:u.formatMarkdown(K.value)||""})),pn=gn[0],hn=gn[1],yn=t.useState({userStory:!!K.isDefaultEdit}),mn=yn[0],Sn=yn[1],xn=t.useState(!1),Cn=xn[0],jn=xn[1],In=t.useState(!1),wn=In[0],Nn=In[1],bn=t.useState(null),En=bn[0],Dn=bn[1],Bn=t.useState(null),Tn=Bn[0],An=Bn[1],kn=_.useRequirementAI(),Pn=kn.userStory,Un=kn.customIcons,Rn=t.useState(null!=fe?fe:""===$||ae===K.artifactId||!!K.isDefaultOpen),Mn=Rn[0],qn=Rn[1],Ln=t.useState(!1);Ln[0];var Fn=Ln[1],zn=t.useState(null),On=zn[0],Vn=zn[1],Wn=t.useState(null),Gn=Wn[0],Hn=Wn[1],Qn=t.useState(!1),Xn=Qn[0],Zn=Qn[1],Jn=t.useRef(null),Kn=t.useRef(null),Yn=t.useState(!1);Yn[0];var $n=Yn[1],et=t.useState(!1),nt=et[0],tt=et[1],it=t.useRef(null);t.useEffect(function(){Q&&qn(Q)},[Q]),t.useEffect(function(){hn(e.__assign(e.__assign({},structuredClone(K)),{value:u.formatMarkdown(K.value)||""}))},[K]),t.useEffect(function(){Xe.length>0?qn(!0):void 0===fe&&(ae?qn(ae===K.artifactId):he&&he.length>0&&qn(he.includes(K.artifactId)))},[Xe,ae,K.artifactId,he]);var st=function(){Vn(null)},lt=function(){Hn(null)},ot=function(){Mn&&mn.userStory&&Kn.current&&!Kn.current.requestClose()||qn(function(e){return!e})},at=function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(t){switch(t.label){case 0:Zn(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),"userStory"==="userStory"&&(Y(pn),console.log("I am changing RTE editor values",pn)),[4,oe(Ze,Pn,X,null===(n=it.current)||void 0===n?void 0:n.signal)];case 2:return t.sent(),Y(e.__assign(e.__assign({},pn),{isDefaultEdit:!1})),Sn(function(n){return e.__assign(e.__assign({},n),{userStory:!1})}),[3,4];case 3:return Zn(!1),[7];case 4:return[2]}})})};var rt=null!=(null==K?void 0:K.big_enough)&&!Number.isNaN(K.big_enough)&&!!(null==K?void 0:K.big_enough_decision_factors),ut=null!==(q=null==K?void 0:K.completion_percentage)&&void 0!==q?q:0,dt=!!(null==K?void 0:K.completion_decision_factors),ct=""===$,vt=null!=de?de:w(ue,ct),ft=!te&&!ie;return t.useEffect(function(){if(Tn){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(Tn));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[Tn]),t.useEffect(function(){K.isDefaultEdit&&Sn(function(n){return e.__assign(e.__assign({},n),{userStory:!0})})},[K.isDefaultEdit]),n.jsxs("div",e.__assign({className:r.default.card,style:null==Ye?void 0:Ye.cardStyle,id:"story-card-".concat(K.title),"data-expanded":Mn},{children:[n.jsxs("div",e.__assign({className:r.default.titleSection,style:null==Ye?void 0:Ye.titleSection},{children:[n.jsxs("div",e.__assign({className:r.default.titleRow,style:null==Ye?void 0:Ye.titleRow,onClick:ot},{children:[n.jsxs("div",e.__assign({className:r.default.titleLeft,style:null==Ye?void 0:Ye.titleLeft,onMouseEnter:function(){return $n(!0)},onMouseLeave:function(){return $n(!1)}},{children:[me&&n.jsx(N,{displayName:Z}),Cn&&ft?n.jsx(p.InlineTitleEditor,{title:K.title,onSave:function(n){return function(n,t){return e.__awaiter(void 0,void 0,void 0,function(){var i,s;return e.__generator(this,function(l){try{i=e.__assign({},K),K.artifactId===t?i.title=n:i.sub_features=(null===(s=K.sub_features)||void 0===s?void 0:s.map(function(i){return i.artifactId===t?e.__assign(e.__assign({},i),{title:n}):i}))||[],hn(i),Y(i),jn(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(n,K.artifactId)},onCancel:function(){jn(!1)},inputStyle:null==en?void 0:en.inlineTitleInput,confirmButtonStyle:null==en?void 0:en.inlineTitleConfirm,cancelButtonStyle:null==en?void 0:en.inlineTitleCancel},"inline-title-editor"):n.jsxs("div",e.__assign({className:r.default.storyTitleWrapper},{children:[n.jsx(l.Tooltip,e.__assign({title:I(K.title),arrow:!0},{children:n.jsx("h2",e.__assign({title:Pe?void 0:K.title,className:r.default.storyTitle,style:null==Ye?void 0:Ye.storyTitle},{children:I(K.title)}),K.artifactId)})),Ee&&!rn&&(dt?n.jsx(y.CompletionPanel,e.__assign({customIcons:null==Un?void 0:Un.userStoryIcons,customStyles:null==Ye?void 0:Ye.aiReasoningCitaionStyles,currentUserStory:K,panelStyles:null==Ye?void 0:Ye.CompletionStyles,onToggleStateChange:tt},{children:n.jsxs("div",e.__assign({style:e.__assign(e.__assign({display:"inline-flex",alignItems:"center",gap:"4px"},null==ln?void 0:ln.badge),fn)},{children:[n.jsxs("span",{children:[ut,"% Completed"]}),n.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:n.jsx(m.default,{color:"currentColor"})})),nt?n.jsx(i.ChevronUp,{size:14,style:null==ln?void 0:ln.chevronStyle}):n.jsx(i.ChevronDown,{size:14,style:null==ln?void 0:ln.chevronStyle})]}))})):n.jsx("div",e.__assign({style:e.__assign(e.__assign({display:"inline-flex",alignItems:"center",gap:"4px"},null==ln?void 0:ln.badge),fn)},{children:n.jsxs("span",{children:[ut,"% Completed"]})}))),xe&&n.jsx("button",e.__assign({type:"button",className:r.default.titleEditButton,style:null==en?void 0:en.titleEditButton,onClick:function(e){e.stopPropagation(),jn(!0),Mn||qn(!0)},"aria-label":"Edit title",title:"Edit title"},{children:n.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})}))}))]}))]})),(ze||void 0!==Ve&&void 0!==We)&&n.jsxs("div",e.__assign({className:r.default.statusContainer},{children:[void 0!==Ve&&void 0!==We&&n.jsxs("div",e.__assign({className:r.default.completedBadge},{children:["Completed: ",Ve,"/",We]})),ze&&n.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==Oe||Oe()},className:r.default.statusButton,style:_n[ze]},{children:j[ze]}))]})),n.jsxs("div",e.__assign({className:r.default.titleActions,style:null==Ye?void 0:Ye.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(vt.showProgressPercentage||vt.showGapBox)&&ve&&n.jsxs("div",e.__assign({className:r.default.progressHeader,style:null==tn?void 0:tn.wrapper},{children:[vt.showProgressPercentage&&n.jsxs("div",e.__assign({className:r.default.progressPercentage,style:null==tn?void 0:tn.percentage},{children:[null!==(F=null!==(L=null==K?void 0:K.confidenceScore)&&void 0!==L?L:null==vt?void 0:vt.confidenceValue)&&void 0!==F?F:"0","%"]})),vt.showGapBox&&n.jsxs("div",e.__assign({className:r.default.gapBox,style:null==tn?void 0:tn.gapBox},{children:[null!==(O=null!==(z=null==K?void 0:K.gapValue)&&void 0!==z?z:null==vt?void 0:vt.gapBoxValue)&&void 0!==O?O:"2"," ","Gaps"]}))]})),rt&&n.jsx(g.BigEnoughPanel,{customIcons:null==Un?void 0:Un.userStoryIcons,customStyles:null==Ye?void 0:Ye.aiReasoningCitaionStyles,currentUserStory:K,panelStyles:null==Ye?void 0:Ye.BigEnoughStyles}),!mn.userStory&&n.jsxs(n.Fragment,{children:[!1!==(null==vt?void 0:vt.showShareButton)&&n.jsx("button",e.__assign({className:r.default.iconButton,style:null==Ye?void 0:Ye.iconButton,onClick:function(e){Vn(e.currentTarget)}},{children:n.jsx(i.ExternalLink,{size:16})})),n.jsxs(l.Menu,e.__assign({id:"user-story-share-menu",anchorEl:On,open:!!On,onClose:function(){return Vn(null)},style:null==Ye?void 0:Ye.userStoryShareMenu},{children:[ne&&n.jsx(l.MenuItem,e.__assign({style:null==Ye?void 0:Ye.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 Fn(!0),se?[4,Promise.all([se("pdf"),se("doc")])]:[2];case 1:return e.sent(),Fn(!1),[2]}})})}},{children:n.jsxs("div",e.__assign({ref:Jn,className:r.default.menuItemContent,style:null==Ye?void 0:Ye.menuItemContent},{children:[n.jsx(i.Download,{size:16,color:null==Ye?void 0:Ye.menuIconColor}),n.jsx("p",e.__assign({style:null==Ye?void 0:Ye.menuLabel},{children:"Download"}))]}))})),n.jsx(l.MenuItem,e.__assign({style:null==Ye?void 0:Ye.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(t){return n=K,J&&(n=e.__assign(e.__assign({},K),{value:"".concat(d.replaceTitleSection(null==J?void 0:J.value,K.title)," \n").concat(K.value)})),null==le||le(!0,[n],K.artifactId),st(),[2]})})}},{children:n.jsxs("div",e.__assign({style:null==Ye?void 0:Ye.menuItemContent,className:r.default.menuItemContentPadded},{children:[n.jsx(i.Share2,{size:16,color:null==Ye?void 0:Ye.menuIconColor}),n.jsx("p",e.__assign({style:null==Ye?void 0:Ye.menuLabel},{children:"Send"}))]}))})),n.jsx(l.MenuItem,e.__assign({style:null==Ye?void 0:Ye.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,t,i,s,l;return e.__generator(this,function(e){switch(e.label){case 0:n=new C.default.Converter,t=n.makeHtml(u.formatMarkdown(K.value)||K.value),i=function(e){var n=(new C.default.Converter).makeHtml(e),t=document.createElement("div");return t.innerHTML=n,t.textContent||t.innerText||""}(u.formatMarkdown(K.value)||K.value),s=new ClipboardItem({"text/plain":new Blob([i],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,navigator.clipboard.write([s])];case 2:return e.sent(),console.log("Copied User Story"),[3,5];case 3:return l=e.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return st(),[7];case 5:return[2]}})})}},{children:n.jsxs("div",e.__assign({style:null==Ye?void 0:Ye.menuItemContent,className:r.default.menuItemContentPadded},{children:[n.jsx(i.Copy,{size:16,color:null==Ye?void 0:Ye.menuIconColor}),n.jsx("p",e.__assign({style:null==Ye?void 0:Ye.menuLabel},{children:"Copy"}))]}))}))]}))]}),mn.userStory&&Mn?n.jsx(c.default,{type:"outline",children:"Cancel",style:null==Ye?void 0:Ye.cancelButton,onClick:function(){var n;null===(n=it.current)||void 0===n||n.abort(),Sn(function(n){return e.__assign(e.__assign({},n),{userStory:!1})})}}):n.jsx(n.Fragment,{}),mn.userStory&&Mn?n.jsx(c.default,{type:"fill",children:Xn?n.jsxs("span",e.__assign({className:r.default.savingSpinner,style:null==Ye?void 0:Ye.savingSpinner},{children:[n.jsx(i.LoaderCircle,{className:r.default.spinAnimation,style:null==Ye?void 0:Ye.spinAnimation}),n.jsx("span",{children:"Saving..."})]})):"Save",isDisable:Xn,style:Xn?null==Ye?void 0:Ye.savingButton:null==Ye?void 0:Ye.saveButton,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,at()];case 1:return e.sent(),[2]}})})}}):!te&&!ie&&!Ae&&Mn&&!1!==(null==vt?void 0:vt.showEditButton)&&n.jsx("button",e.__assign({className:r.default.iconButton,style:null==Ye?void 0:Ye.editButton,onClick:function(){return Sn(function(n){return e.__assign(e.__assign({},n),{userStory:!0})})}},{children:n.jsx(i.PencilIcon,{color:null==Ye?void 0:Ye.pencilIconColor,size:16})})),Be&&ct&&Mn&&!te&&!ie&&!1!==(null==vt?void 0:vt.showEditButton)&&n.jsxs("button",e.__assign({type:"button",className:r.default.addSectionButton,style:null==en?void 0:en.addSectionButton,onClick:function(n){var t,i,s;n.stopPropagation();var l=(null!==(i=null===(t=K.sub_features)||void 0===t?void 0:t.length)&&void 0!==i?i:0)+1,o={artifactId:a.v4(),title:"New Section ".concat(l),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},r=e.__assign(e.__assign({},K),{sub_features:e.__spreadArray(e.__spreadArray([],null!==(s=K.sub_features)&&void 0!==s?s:[],!0),[o],!1)});hn(r),Y(r),qn(!0),An(o.title)},"aria-label":"Add section",title:"Add section"},{children:[n.jsx(i.Plus,{size:14}),n.jsx("span",e.__assign({className:r.default.addSectionLabel},{children:"Add Section"}))]})),!ct&&!te&&!Ae&&!ie&&n.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==ge||ge()},className:r.default.iconButton,style:null==en?void 0:en.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:n.jsx(i.Trash2,{size:16})})),rn&&n.jsx("button",e.__assign({type:"button",className:r.default.iconButton,disabled:cn,onClick:function(e){if(e.stopPropagation(),wn)return Dn(null),void Nn(!1);Dn(structuredClone(null!=un?un:{})),qn(!0),Nn(!0)}},{children:wn?n.jsx(i.X,{size:16,color:null==Ye?void 0:Ye.pencilIconColor}):n.jsx(i.PencilIcon,{size:16,color:null==Ye?void 0:Ye.pencilIconColor})})),(null==vt?void 0:vt.actionItemsButton)&&n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({className:r.default.actionItemBtn,style:null==Ye?void 0:Ye.actionItemBtn,onClick:function(e){e.stopPropagation(),Hn(e.currentTarget)}},{children:n.jsx(i.Ellipsis,{})})),n.jsx(l.Menu,e.__assign({id:"user-story-action-menu",anchorEl:Gn,open:!!Gn,onClose:lt,style:null==Ye?void 0:Ye.userStoryShareMenu},{children:null==_e?void 0:_e.items.map(function(t,i){return n.jsx(l.MenuItem,e.__assign({style:null==Ye?void 0:Ye.userStoryMenuItem,onClick:function(){t.onclick(K),lt()}},{children:n.jsxs("div",e.__assign({className:r.default.menuItemContent,style:e.__assign(e.__assign({},null==Ye?void 0:Ye.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[n.jsx("span",e.__assign({className:r.default.menuItemIcon,style:null==Ye?void 0:Ye.menuItemIcon},{children:t.icon})),n.jsx("p",e.__assign({style:null==Ye?void 0:Ye.menuLabel},{children:t.name})),n.jsx("span",{className:r.default.menuItemRight,style:null==Ye?void 0:Ye.menuItemRight})]}))}),"action-item-".concat(i,"-").concat(t.name))})}))]}),n.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),ot()},style:null==Ye?void 0:Ye.chevronButton,className:r.default.chevronButton},{children:Mn?n.jsx(i.ChevronUp,{className:r.default.chevronIcon,color:null==Ye?void 0:Ye.chevronIconColor}):n.jsx(i.ChevronDown,{className:r.default.chevronIcon,color:null==Ye?void 0:Ye.chevronIconColor})}))]}))]})),n.jsx("div",{className:r.default.divider,style:null==Ye?void 0:Ye.dividerStyle})]})),Mn&&n.jsx("div",e.__assign({className:r.default.cardContent,style:e.__assign(e.__assign({},null==Ye?void 0:Ye.cardContentStyle),{borderTop:we?"1px solid #E5E5E5":"none"})},{children:Le?n.jsxs("div",e.__assign({className:r.default.loadingContainer},{children:[n.jsx("div",e.__assign({className:r.default.loadingIconWrapper},{children:n.jsx(i.Hourglass,{size:28,color:"#5B3DF5",className:r.default.spinAnimation})})),n.jsxs("div",{children:[n.jsx("h3",e.__assign({className:r.default.loadingTitle},{children:"Section generation in progress.."})),n.jsx("p",e.__assign({className:r.default.loadingSubtitle},{children:"This may take a few minutes"}))]}),n.jsx("button",e.__assign({type:"button",onClick:function(){return null==Fe?void 0:Fe()},className:r.default.viewStatusButton},{children:"View Status"}))]})):He?n.jsxs("div",e.__assign({className:r.default.noDataContainer,style:null==on?void 0:on.container},{children:[n.jsx("img",{src:o.default,alt:"No data available",className:r.default.noDataIllustration,style:null==on?void 0:on.illustration}),n.jsx("h3",e.__assign({className:r.default.noDataTitle,style:null==on?void 0:on.title},{children:"No Data Available for This Section"})),n.jsx("p",e.__assign({className:r.default.noDataSubtitle,style:null==on?void 0:on.subtitle},{children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."}))]})):n.jsxs("div",e.__assign({className:r.default.contentInner,style:null==Ye?void 0:Ye.contentInner},{children:[n.jsxs("div",e.__assign({className:r.default.descriptionSection,style:null==Ye?void 0:Ye.descriptionSection},{children:[n.jsx("div",{className:r.default.justifyBetween,style:null==Ye?void 0:Ye.justifyBetween}),mn.userStory?n.jsx(v.default,{ref:Kn,minHeight:"100%",height:"100%",type:"string",value:u.formatMarkdown(K.value)||"",handleUpdateState:function(n,t){var i=u.indentMarkdown(t);hn(function(n){return e.__assign(e.__assign({},n),{value:i||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:mn.userStory?"edit":"readOnly",onSaveUnsavedChanges:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,at()];case 1:return e.sent(),qn(!1),[2]}})})},onDiscardUnsavedChanges:function(){hn(e.__assign(e.__assign({},structuredClone(K)),{value:u.formatMarkdown(K.value)||""})),Sn(function(n){return e.__assign(e.__assign({},n),{userStory:!1})}),qn(!1)},isSavingUnsavedChanges:Xn}):rn?n.jsx(h.default,{styles:sn,fields:dn,readonly:!wn,isSaving:vn,value:null!==(V=null!=En?En:un)&&void 0!==V?V:{},onChange:Dn,onSave:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return En?[4,null===(n=null==Ke?void 0:Ke.onSave)||void 0===n?void 0:n.call(Ke,K,En)]:[2];case 1:return e.sent(),Dn(null),Nn(!1),[2]}})})},onCancel:function(){Dn(null),Nn(!1)}}):n.jsxs(n.Fragment,{children:[n.jsx(f.default,{showUserStoryDiff:ie,isParent:""===$,message:u.formatMarkdown(K.value)||"",artifactId:K.artifactId,customStyles:nn,isDisplayHighlightControl:re,contextVariant:pe,showConfidenceScore:je,CDNeededInChip:Re}),Ue&&n.jsx("div",e.__assign({className:r.default.approveButtonContainer,style:null==an?void 0:an.container},{children:n.jsx("button",e.__assign({type:"button",className:r.default.approveButton,style:null==an?void 0:an.button,disabled:Ue.disabled||Ue.isLoading,onClick:function(e){var n;e.stopPropagation(),null===(n=null==Ue?void 0:Ue.onClick)||void 0===n||n.call(Ue)}},{children:Ue.isLoading?n.jsxs(n.Fragment,{children:[n.jsx(i.LoaderCircle,{size:16,className:r.default.spinner,style:null==an?void 0:an.icon}),n.jsx("span",e.__assign({style:null==an?void 0:an.text},{children:Ue.label}))]}):n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({style:null==an?void 0:an.text},{children:Ue.label})),n.jsx(i.Check,{size:16,style:null==an?void 0:an.icon})]})}))}))]})]})),null===(W=pn.sub_features)||void 0===W?void 0:W.map(function(t,i){var s=w(ue,!1,t.artifactId);return n.jsx(b,{artifactId:X,isUserStoryCurrentlyUpdated:Q,artifactTitleId:"".concat(Z,"-").concat(String.fromCharCode(65+i)),parentUserStory:K,parentIndex:"".concat($).concat($&&".").concat(ee),currentIndex:"".concat(i+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(n){return function(n,t){var i=e.__spreadArray([],K.sub_features||[],!0);i[n]=t,Y(e.__assign(e.__assign({},K),{sub_features:i}))}(i,n)},enableDownload:!0,isDiffEditReviewMode:te,showUserStoryDiff:ie,updateUserStoryArtifact:oe,handleDownloadUserStory:se,handleOpenSendDialog:le,isDisplayHighlightControl:re,elementDisplayConfig:ue,_resolvedConfig:s,actionItemsConfig:_e,onDelete:function(){return function(n){var t=(K.sub_features||[]).filter(function(e,t){return t!==n}),i=e.__assign(e.__assign({},K),{sub_features:t});hn(i),Y(i)}(i)},expandedSubFeatures:he,disableEditPlan:Ae,useMuiTooltip:Pe},t.artifactId)})]}))}))]}))};exports.StoryCard=b,exports.UserStoryCardWrapper=function(t){var s=t.artifactTitleIDs,l=t.expandedSubFeatures,o=t.isDiffEditReviewMode,a=t.showUserStoryDiff,u=t.updateUserStoryArtifact,d=t.isUserStoryCurrentlyUpdated,c=t.artifactId,v=t.handleOpenSendDialog,f=t.handleDownloadUserStory,g=t.selectedArtifactId,p=t.isDisplayHighlightControl,h=t.elementDisplayConfig,y=t.showWrapper,m=t.actionItemsConfig,S=t.contextVariant,x=t.showDisplayName,C=t.allowTitleEdit,j=t.showConfidenceScore,I=t.showBorderTop,N=t.defaultExpanded,E=t.showCompletionPanel,D=void 0!==E&&E,B=t.showAddSectionButton,T=void 0!==B&&B,A=t.disableEditPlan,k=void 0!==A&&A,P=t.useMuiTooltip,U=void 0!==P&&P,R=t.approveButtonConfig,M=t.CDNeededInChip,q=_.useRequirementAI(),L=q.userStory,F=q.setUserStory,z=q.customStyles,O=q.searchQueryList,V=q.currentHighlightIndex,W=q.setCurrentHighlightIndex;q.segmentComponentConfig;var G=q.sectionStatusConfig,H=null==z?void 0:z.userStoryCardStyles,Q=0===V,X=V===O.length-1;return n.jsxs("div",e.__assign({className:r.default.userStoryCardWrapper,style:p?e.__assign(e.__assign({},null==H?void 0:H.userStoryCardWrapper),{position:"relative"}):null==H?void 0:H.userStoryCardWrapper},{children:[p&&n.jsx(n.Fragment,{children:O.length>0&&n.jsx("div",e.__assign({className:r.default.wrapper},{children:n.jsx("div",e.__assign({className:r.default.highlightNavigation},{children:n.jsxs("div",e.__assign({className:r.default.navigationContainer},{children:[n.jsxs("span",e.__assign({className:r.default.navCounter},{children:[V+1," of ",O.length]})),n.jsxs("div",e.__assign({className:r.default.navButtons},{children:[n.jsx("button",e.__assign({onClick:function(){V>0&&W(function(e){return e-1})},className:r.default.navButton,disabled:Q},{children:n.jsx(i.ChevronUpIcon,{size:20,className:r.default.navIcon})})),n.jsx("button",e.__assign({onClick:function(){V<O.length-1&&W(function(e){return e+1})},className:r.default.navButton,disabled:X},{children:n.jsx(i.ChevronDownIcon,{size:20,className:r.default.navIcon})}))]}))]}))}))}))}),L.map(function(t,i){var r=w(h,!0);return n.jsx(b,{isUserStoryCurrentlyUpdated:d,artifactId:c,artifactTitleId:s[i]||"",expandedSubFeatures:l,currentUserStory:t,onUserStoryChange:function(n){F(function(t){return t[i]=n,e.__spreadArray([],t,!0)})},parentIndex:"",currentIndex:"".concat(i+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:o,showUserStoryDiff:a,updateUserStoryArtifact:u,handleOpenSendDialog:v,handleDownloadUserStory:f,selectedArtifactId:g,isDisplayHighlightControl:p,elementDisplayConfig:h,_resolvedConfig:r,showWrapper:y,defaultExpanded:N,actionItemsConfig:m,contextVariant:S,showDisplayName:x,allowTitleEdit:C,showConfidenceScore:j,showBorderTop:I,sectionStatusConfig:G,showCompletionPanel:D,showAddSectionButton:T,disableEditPlan:k,useMuiTooltip:U,approveButtonConfig:R,CDNeededInChip:M},t.artifactId)})]}))},exports.default=b,exports.replaceLearnedTagsWithInfo=I;
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js
CHANGED
|
@@ -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"),l=require("./UserStoryWithCitation.module.css.js"),a=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),d=require("@mui/material"),s=require("dompurify"),c=require("../../shared/UpdatedAnimationContent.js"),u=require("../../shared/GeneratedCodeCitation.js"),v=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),h=require("../../icons/CognitiveDecision.js"),f=require("../../icons/BrainRed.js"),p=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),C=require("../RecommendationBlock/RecommendationBlock.js"),_=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),j=require("./components/InlineUpdatedComponent.js"),y=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js"),I=require("./components/HighlightButtonComponent.js");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R=w(i),b=w(t),N=w(o),k=w(s),q=i.createContext(!1),A=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),E=i.createContext({rowId:""}),M=function(t){var o,a=t.aiReason,r=t.isHighConfidence,d=t.customStyle,s=t.customIcons,c=i.useContext(A),u=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,p=i.useContext(E).rowId,m=String(a.id);p&&g.current.set(m,p);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===a.id,_=r?(null==s?void 0:s.highConfidence)||n.jsx(h.default,{}):(null==s?void 0:s.lowConfidence)||n.jsx(f.default,{});return n.jsxs("button",e.__assign({className:l.default.aiReasoningButton,style:d,onClick:function(e){e.stopPropagation(),e.preventDefault(),v(C?null:p,C?null:a)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(r?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(r?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence)})]}))},U=function(t){var o,a,r=t.children,d=t.node,s=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,v=i.useContext(A).expandedInfo,g=(null==v?void 0:v.rowId)===u,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(e){return"element"===e.type}).length:1,f=null!==(a=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==a?a:void 0;return n.jsxs(E.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:f?{cssText:f}:void 0},{children:r})),g&&(null==v?void 0:v.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:h||1,className:l.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:l.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:l.default.tableExpandedCellContent},{children:n.jsx(x.default,{aiReason:v.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==s?void 0:s.aiReasoningContent,aiReasoningAccordion:null==s?void 0:s.aiReasoningAccordion,aiReasoningMarkdown:null==s?void 0:s.aiReasoningMarkdown,aiReasoningPill:null==s?void 0:s.aiReasoningPill,webCitation:null==s?void 0:s.webCitation,stormeeCitation:null==s?void 0:s.stormeeCitation,waveformCitation:null==s?void 0:s.waveformCitation,imageCitation:null==s?void 0:s.imageCitation,fileCitation:null==s?void 0:s.fileCitation,appModCitation:null==s?void 0:s.appModCitation,rcaCitation:null==s?void 0:s.rcaCitation,readFileCitation:null==s?void 0:s.readFileCitation,loadingCitations:null==s?void 0:s.loadingCitations,chatCitation:null==s?void 0:s.chatCitation}})}))}))}))}))]}))};var T=["del","ins"];function L(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,T,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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(e)}).join("")})}exports.default=function(t){var o,s=t.message,h=t.noMarkdownContent,f=t.useMarkdown,x=void 0===f||f,w=t.isParent,E=t.scenario,T=t.showUserStoryDiff,P=void 0!==T&&T,D=t.aiReasoningsForBlock,H=t.isCitationLoadingDisplay,$=void 0!==H&&H,F=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var O=t.customStyles,B=t.customIcons,W=t.contextVariant,z=t.aiReasoningDiffView,V=t.userStoryCitations,G=t.artifactId,Q=t.isCraflow,J=t.onCraAccept,K=t.onCraReject,X=t.craFlowConfig,Y=t.isDisplayHighlightControl,Z=void 0!==Y&&Y,ee=t.showConfidenceScore,ne=void 0===ee||ee,ie=t.CDNeededInChip,te=i.useRef(null),oe=g.useRequirementAI(),le=oe.userStory,ae=oe.inlineUpdateComponentConfig,re=oe.getAvgScoreForStory,de=oe.setUserStory,se=oe.aiReasoning,ce=oe.setAiReasoning,ue=oe.customIcons,ve=oe.searchQueryList,ge=oe.searchQueryReasoningIdList,he=oe.currentHighlightIndex,fe=oe.segmentComponentConfig,pe=oe.diffEditConfig,me=null!=B?B:null==ue?void 0:ue.userStoryIcons;null==O||O.searchHighlight;var Ce=a.useMarkdownSearch(te),_e=Ce.search,xe=Ce.clear,je=i.useState("1"),ye=je[0],Se=je[1],Ie=i.useState(null),we=Ie[0],Re=Ie[1],be=i.useRef(new Map),Ne=i.useState(new Set),ke=Ne[0],qe=Ne[1],Ae=i.useCallback(function(e,n){Re(e&&n?{rowId:e,aiReason:n}:null)},[]),Ee=G?re(G):0,Me=i.useState([]),Ue=Me[0],Te=Me[1],Le=i.useCallback(function(e){qe(function(n){var i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Pe=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Pe).join(""):R.default.isValidElement(e)?Pe(e.props.children):""},De=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 l=n[0],a=l.match(/<deleted>([\s\S]*?)<\/deleted>/i),r=l.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:d((null==a?void 0:a[1])||""),changedItemCount:d((null==r?void 0:r[1])||"")})}if(0===t.length)return e;for(var s=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,l=0,a=s.substring(0,n.index).split("\n").reverse();l<a.length;l++){var r=a[l].trim();if(""!==r){/^\d+\.\s/.test(r)&&(o=!0);break}}if(!o)return"continue";var d=n.endIndex,c=e+1<t.length?t[e+1].index:s.length,u=s.substring(d,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),s=s.substring(0,d)+u+s.substring(c)},u=t.length-1;u>=0;u--)c(u);return s}(n=(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 l=t.match(/<table[\s\S]*?<\/table>/i);if(l){var a=btoa(encodeURIComponent(l[0]));return"<segment".concat(i,' data-table="').concat(a,'"></segment>')}return e})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(e,n,i){if(/<table[\s>]/i.test(i)){var t=btoa(encodeURIComponent(i));return"<updatedsegment".concat(n,' data-raw="').concat(t,'"></updatedsegment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var l=n.substring(0,o),a=l.lastIndexOf("\n"),r=/^\s+[-*]\s/.test(l.substring(a+1))||/^\s+\d+\.\s/.test(l.substring(a+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(a+1));if(r||d){var s=t;return s=(s=(s=(s=s.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(s,"</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=L(n)},He=i.useMemo(function(){return s?De(s):s},[s]);i.useEffect(function(){Te(D||se)},[D,se]);var $e=i.useMemo(function(){return{span:function(i){var t,o,l,a,r,d=i.node,s=i.children,c=e.__rest(i,["node","children"]),u=null!==(o=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==o?o:null==c?void 0:c["highlight-id"],v="string"==typeof u&&ke.has(u),g=null!==(a=null===(l=null==d?void 0:d.properties)||void 0===l?void 0:l["highlight-color"])&&void 0!==a?a:null==c?void 0:c["highlight-color"];return n.jsx("span",e.__assign({style:e.__assign(e.__assign({},null!==(r=null==O?void 0:O.span)&&void 0!==r?r:{}),v?{backgroundColor:g||"#fef08a"}:{})},{children:s}))},button:function(i){var t,o,l,a,r,d,s=i.node;i.children;var c=e.__rest(i,["node","children"]),u=null!==(o=null===(t=null==s?void 0:s.properties)||void 0===t?void 0:t.action)&&void 0!==o?o:null==c?void 0:c.action,v=null!==(a=null===(l=null==s?void 0:s.properties)||void 0===l?void 0:l["highlight-id"])&&void 0!==a?a:null==c?void 0:c["highlight-id"],g=null!==(d=null===(r=null==s?void 0:s.properties)||void 0===r?void 0:r["highlight-type"])&&void 0!==d?d:null==c?void 0:c["highlight-type"];return"highlight"===u?n.jsx(I.default,{highlightId:v,handleHighlightSpan:Le,icon:"web"===g?null==me?void 0:me.webCitationIcon:"doc"===g?null==me?void 0:me.fileCitationIcon:n.jsx(n.Fragment,{}),customStyles:"web"===g?null==O?void 0:O.webButton:"doc"===g?null==O?void 0:O.docButton:{}}):null},upt:function(i){var t;i.node;var o=i.children,l=e.__rest(i,["node","children"]),a=null==l?void 0:l.id,r=a?null===(t=a.split("$"))||void 0===t?void 0:t[1]:null,d=se.find(function(e){return e.id.toString()===r});return d?n.jsx(n.Fragment,{children:n.jsx(j.default,e.__assign({aiReason:d,customStyles:null==O?void 0:O.inlineUpdatedComponent,handleClickCognitiveDecision:null==ae?void 0:ae.handleClickCognitiveDecision,handleClickUpdatedPill:null==ae?void 0:ae.handleClickUpdatedPill,handleClickOutputValue:null==ae?void 0:ae.handleClickOutputValue,customIcons:null==ae?void 0:ae.customIcons,CDNeededInChip:ie},{children:o}))}):o},del:function(i){var t,o,a,r;i.node;var d=i.children,s=e.__rest(i,["node","children"]),c=s.aireason,u=c&&(null===(t=c.deviation_details)||void 0===t?void 0:t.resolved)&&("rejected"===(null===(o=c.deviation_details)||void 0===o?void 0:o.resolved)||"reverted"===(null===(a=c.deviation_details)||void 0===a?void 0:a.resolved));return n.jsx("span",e.__assign({className:l.default.deleted,style:e.__assign(e.__assign({},null!==(r=null==O?void 0:O.deleted)&&void 0!==r?r:{}),{textDecoration:u?"none":"line-through"})},s,{onClick:s.onclick},{children:d}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:l.default.inserted,style:null==O?void 0:O.inserted},o,{onClick:o.onclick},{children:t}))},preserved:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:l.default.preserved,style:null==O?void 0:O.preserved},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:l.default.heading1,style:null==O?void 0:O.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:l.default.heading2,style:null==O?void 0:O.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:l.default.heading3,style:null==O?void 0:O.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:l.default.bold,style:null==O?void 0:O.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:l.default.paragraph,style:null==O?void 0:O.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(c.default,e.__assign({},o,{showUserStoryDiff:P,currentUpdatedTagId:ye,setCurrentUpdatedTagId:Se,userStory:le,setUserStory:de,setAiReasoning:ce,node:t,isCraflow:Q,onCraAccept:J,onCraReject:K,diffEditConfig:pe,customStyles:null==O?void 0:O.updatedContent,craFlowConfig:X}))},ol:function(i){var t,o,a,r=i.node,d=e.__rest(i,["node"]),s=null!==(a=null!==(o=null===(t=null==r?void 0:r.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==d?void 0:d.start)&&void 0!==a?a:void 0;return n.jsx("ol",e.__assign({className:l.default.orderedList,style:null==O?void 0:O.olist},s?{start:Number(s)}:{},{children:null==d?void 0:d.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:l.default.unorderedList,style:null==O?void 0:O.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:l.default.tableWrapper},{children:n.jsx("table",e.__assign({className:l.default.table,style:null==O?void 0:O.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(U,{node:i,children:t,customStyles:O})},td:function(i){var t,o=i.node,l=i.children,a=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=a.style,d=e.__rest(a,["style"]);return n.jsx(q.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},d,{style:r?{cssText:r}:void 0},{children:l}))}))},th:function(i){var t,o=i.node,l=i.children,a=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=a.style,d=e.__rest(a,["style"]);return n.jsx(q.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},d,{style:r?{cssText:r}:void 0},{children:l}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),l="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==O?void 0:O.recommendationBlock,label:l}))},a:function(t){var o,l,a;t.inline;var r=t.children;t.node;var d=e.__rest(t,["inline","children","node"]),s=i.useContext(q)||"true"==(null==d?void 0:d.table),c="".concat(null==d?void 0:d.href),u=null===(o=c.split("$"))||void 0===o?void 0:o[0],v=null===(l=c.split("$"))||void 0===l?void 0:l[1];if("ai_reasoning"===u){var g=(null!==(a=P?z:se)&&void 0!==a?a:[]).find(function(e){return e.id.toString()===decodeURIComponent(v)}),h=ge.includes(v);if(g){if(s)return n.jsx(M,{aiReason:g,customStyle:null==O?void 0:O.tableAiReasoning,customIcons:me,isHighConfidence:g.relevance_score>=p.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});var f=Pe(r),m="source"!==f.trim().toLowerCase();return n.jsx(p.default,{aiReason:g,isSourceHasHighlight:h,inlineLabel:f,isInlineCitation:m,customIcons:me,customStyles:{aiReasoningContent:null==O?void 0:O.aiReasoningContent,aiReasoningAccordion:null==O?void 0:O.aiReasoningAccordion,aiReasoningMarkdown:null==O?void 0:O.aiReasoningMarkdown,aiReasoningPill:null==O?void 0:O.aiReasoningPill,webCitation:null==O?void 0:O.webCitation,stormeeCitation:null==O?void 0:O.stormeeCitation,waveformCitation:null==O?void 0:O.waveformCitation,imageCitation:null==O?void 0:O.imageCitation,fileCitation:null==O?void 0:O.fileCitation,appModCitation:null==O?void 0:O.appModCitation,rcaCitation:null==O?void 0:O.rcaCitation,readFileCitation:null==O?void 0:O.readFileCitation,loadingCitations:null==O?void 0:O.loadingCitations,chatCitation:null==O?void 0:O.chatCitation,bigEnoughCitation:null==O?void 0:O.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:l.default.blockCode,style:null==O?void 0:O.code},{children:t}))}):n.jsx("code",e.__assign({className:l.default.inlineCode,style:null==O?void 0:O.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(d.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(r.Info,{size:16,className:l.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",l=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(u.default,{title:"Generated Code",code:l,language:o,customStyles:{pill:null==O?void 0:O.generatedCodePill,content:null==O?void 0:O.generatedCodeContent}})},updatedsegment:function(i){var t,o,l,a,r=i.node,d=i.children,s=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===(l=r.position)||void 0===l?void 0:l.end.line,"-").concat(null===(a=r.position)||void 0===a?void 0:a.end.column),u=function(e){if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}}(s),v=u?n.jsx("div",{dangerouslySetInnerHTML:{__html:k.default.sanitize(u)}}):n.jsx("div",{children:d});return n.jsx(y.default,{id:c,node:r,children:v,props:s,segmentComponentConfig:fe,customStyles:O,customIcons:B,extractText:Pe,isUpdatedSegment:!0})},segment:function(i){var t,o,l,a,r=i.node,d=i.children,s=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===(l=r.position)||void 0===l?void 0:l.end.line,"-").concat(null===(a=r.position)||void 0===a?void 0:a.end.column);return n.jsx(y.default,{id:c,node:r,children:d,props:s,segmentComponentConfig:fe,customStyles:O,customIcons:B,extractText:Pe})}}},[Ue,X,se,V,ye,P,s,B,ve,ge,O,fe,ke,Le]);return i.useEffect(function(){if(te.current){if(ve.length){var e;if(0===ge.length||Z)requestAnimationFrame(function(){_e([ve[he].replace(/\*/g,"")])});else{var n=te.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){_e([ve[he].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}xe()}},[ve,ge,he,Z]),n.jsx(A.Provider,e.__assign({value:{expandedInfo:we,setExpanded:Ae,reasonToRow:be}},{children:n.jsxs("div",e.__assign({ref:te,className:"".concat(l.default.container," ").concat("approving"!==E?l.default.wrapper:""," ").concat(F||""),style:null==O?void 0:O.container},{children:[x?n.jsx(S.MarkdownContextProvider,{children:n.jsx(b.default,e.__assign({components:$e,rehypePlugins:[N.default]},{children:He}))}):h,Ee>0&&ne&&n.jsx("div",e.__assign({className:l.default.confidenceScoreContainer,style:null==O?void 0:O.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:l.default.confidenceScore,style:null==O?void 0:O.confidenceScore},{children:[n.jsx(m.default,{size:14,color:(null==O?void 0:O.confidenceScoreIconColor)||"#166534"}),Ee,"%"]}))})),$&&n.jsx("div",e.__assign({className:l.default.citationLoader,style:null==O?void 0:O.citationLoaderContainer},{children:n.jsx(v.default,{customStyles:{container:null==O?void 0:O.citationLoadingContainer,icon:null==O?void 0:O.citationLoadingIcon,text:null==O?void 0:O.citationLoadingText}})})),w&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==O?void 0:O.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(_.default,{customStyles:null==O?void 0:O.attachedContext,variant:W})}))]}))}))};
|
|
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"),l=require("./UserStoryWithCitation.module.css.js"),r=require("../../shared/useMarkdownSearch.js"),a=require("lucide-react"),d=require("@mui/material"),s=require("dompurify"),c=require("../../shared/UpdatedAnimationContent.js"),u=require("../../shared/GeneratedCodeCitation.js"),v=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),h=require("../../icons/CognitiveDecision.js"),f=require("../../icons/BrainRed.js"),p=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),C=require("../RecommendationBlock/RecommendationBlock.js"),_=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),y=require("./components/InlineUpdatedComponent.js"),j=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js"),w=require("./components/HighlightButtonComponent.js");function I(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=I(i),R=I(t),N=I(o),A=I(s),k=i.createContext(!1),q=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),E=i.createContext({rowId:""}),M=function(t){var o,r=t.aiReason,a=t.isHighConfidence,d=t.customStyle,s=t.customIcons,c=i.useContext(q),u=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,p=i.useContext(E).rowId,m=String(r.id);p&&g.current.set(m,p);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===r.id,_=a?(null==s?void 0:s.highConfidence)||n.jsx(h.default,{}):(null==s?void 0:s.lowConfidence)||n.jsx(f.default,{});return n.jsxs("button",e.__assign({className:l.default.aiReasoningButton,style:d,onClick:function(e){e.stopPropagation(),e.preventDefault(),v(C?null:p,C?null:r)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(a?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(a?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence)})]}))},U=function(t){var o,r,a=t.children,d=t.node,s=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,v=i.useContext(q).expandedInfo,g=(null==v?void 0:v.rowId)===u,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(e){return"element"===e.type}).length:1,f=null!==(r=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==r?r:void 0;return n.jsxs(E.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:f?{cssText:f}:void 0},{children:a})),g&&(null==v?void 0:v.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:h||1,className:l.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:l.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:l.default.tableExpandedCellContent},{children:n.jsx(x.default,{aiReason:v.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==s?void 0:s.aiReasoningContent,aiReasoningAccordion:null==s?void 0:s.aiReasoningAccordion,aiReasoningMarkdown:null==s?void 0:s.aiReasoningMarkdown,aiReasoningPill:null==s?void 0:s.aiReasoningPill,webCitation:null==s?void 0:s.webCitation,stormeeCitation:null==s?void 0:s.stormeeCitation,waveformCitation:null==s?void 0:s.waveformCitation,imageCitation:null==s?void 0:s.imageCitation,fileCitation:null==s?void 0:s.fileCitation,appModCitation:null==s?void 0:s.appModCitation,rcaCitation:null==s?void 0:s.rcaCitation,readFileCitation:null==s?void 0:s.readFileCitation,loadingCitations:null==s?void 0:s.loadingCitations,chatCitation:null==s?void 0:s.chatCitation}})}))}))}))}))]}))};var L=["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,L,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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(e)}).join("")})}function P(e,n){var i=[],t=new Set(n.map(function(e){return e.toLowerCase()})),o=function(e){var n;if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.flatMap(function(e){var n=o(e);return null==n||!1===n?[]:Array.isArray(n)?n:[n]});if(!b.default.isValidElement(e))return e;var l="string"==typeof e.type?e.type.toLowerCase():"";if(t.has(l))return i.push(e),null;var r=b.default.Children.toArray(null===(n=e.props)||void 0===n?void 0:n.children).flatMap(function(e){var n=o(e);return null==n||!1===n?[]:Array.isArray(n)?n:[n]});return b.default.cloneElement(e,e.props,r)};return{cleanedChildren:o(e),extractedNodes:i}}exports.default=function(t){var o,s=t.message,h=t.noMarkdownContent,f=t.useMarkdown,x=void 0===f||f,I=t.isParent,E=t.scenario,L=t.showUserStoryDiff,D=void 0!==L&&L,F=t.aiReasoningsForBlock,H=t.isCitationLoadingDisplay,$=void 0!==H&&H,O=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var B=t.customStyles,V=t.customIcons,W=t.contextVariant,z=t.aiReasoningDiffView,G=t.userStoryCitations,Q=t.artifactId,J=t.isCraflow,K=t.onCraAccept,X=t.onCraReject,Y=t.craFlowConfig,Z=t.isDisplayHighlightControl,ee=void 0!==Z&&Z,ne=t.showConfidenceScore,ie=void 0===ne||ne,te=t.CDNeededInChip,oe=i.useRef(null),le=g.useRequirementAI(),re=le.userStory,ae=le.inlineUpdateComponentConfig,de=le.getAvgScoreForStory,se=le.setUserStory,ce=le.aiReasoning,ue=le.setAiReasoning,ve=le.customIcons,ge=le.searchQueryList,he=le.searchQueryReasoningIdList,fe=le.currentHighlightIndex,pe=le.segmentComponentConfig,me=le.diffEditConfig,Ce=null!=V?V:null==ve?void 0:ve.userStoryIcons;null==B||B.searchHighlight;var _e=r.useMarkdownSearch(oe),xe=_e.search,ye=_e.clear,je=i.useState("1"),Se=je[0],we=je[1],Ie=i.useState(null),be=Ie[0],Re=Ie[1],Ne=i.useRef(new Map),Ae=i.useState(new Set),ke=Ae[0],qe=Ae[1],Ee=i.useCallback(function(e,n){Re(e&&n?{rowId:e,aiReason:n}:null)},[]),Me=Q?de(Q):0,Ue=i.useState([]),Le=Ue[0],Te=Ue[1],Pe=i.useCallback(function(e){qe(function(n){var i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),De=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(De).join(""):b.default.isValidElement(e)?De(e.props.children):""},Fe=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 l=n[0],r=l.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=l.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:d((null==r?void 0:r[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===t.length)return e;for(var s=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,l=0,r=s.substring(0,n.index).split("\n").reverse();l<r.length;l++){var a=r[l].trim();if(""!==a){/^\d+\.\s/.test(a)&&(o=!0);break}}if(!o)return"continue";var d=n.endIndex,c=e+1<t.length?t[e+1].index:s.length,u=s.substring(d,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),s=s.substring(0,d)+u+s.substring(c)},u=t.length-1;u>=0;u--)c(u);return s}(n=(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 l=t.match(/<table[\s\S]*?<\/table>/i);if(l){var r=btoa(encodeURIComponent(l[0]));return"<segment".concat(i,' data-table="').concat(r,'"></segment>')}return e})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(e,n,i){if(/<table[\s>]/i.test(i)){var t=btoa(encodeURIComponent(i));return"<updatedsegment".concat(n,' data-raw="').concat(t,'"></updatedsegment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var l=n.substring(0,o),r=l.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(a||d){var s=t;return s=(s=(s=(s=s.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(s,"</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)},He=i.useMemo(function(){return s?Fe(s):s},[s]);i.useEffect(function(){Te(F||ce)},[F,ce]);var $e=i.useMemo(function(){return{span:function(i){var t,o,l,r,a,d=i.node,s=i.children,c=e.__rest(i,["node","children"]),u=null!==(o=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==o?o:null==c?void 0:c["highlight-id"],v="string"==typeof u&&ke.has(u),g=null!==(r=null===(l=null==d?void 0:d.properties)||void 0===l?void 0:l["highlight-color"])&&void 0!==r?r:null==c?void 0:c["highlight-color"];return n.jsx("span",e.__assign({style:e.__assign(e.__assign({},null!==(a=null==B?void 0:B.span)&&void 0!==a?a:{}),v?{backgroundColor:g||"#fef08a"}:{})},{children:s}))},button:function(i){var t,o,l,r,a,d,s=i.node;i.children;var c=e.__rest(i,["node","children"]),u=null!==(o=null===(t=null==s?void 0:s.properties)||void 0===t?void 0:t.action)&&void 0!==o?o:null==c?void 0:c.action,v=null!==(r=null===(l=null==s?void 0:s.properties)||void 0===l?void 0:l["highlight-id"])&&void 0!==r?r:null==c?void 0:c["highlight-id"],g=null!==(d=null===(a=null==s?void 0:s.properties)||void 0===a?void 0:a["highlight-type"])&&void 0!==d?d:null==c?void 0:c["highlight-type"];return"highlight"===u?n.jsx(w.default,{highlightId:v,handleHighlightSpan:Pe,icon:"web"===g?null==Ce?void 0:Ce.webCitationIcon:"doc"===g?null==Ce?void 0:Ce.fileCitationIcon:n.jsx(n.Fragment,{}),customStyles:"web"===g?null==B?void 0:B.webButton:"doc"===g?null==B?void 0:B.docButton:{}}):null},upt:function(i){var t;i.node;var o=i.children,l=e.__rest(i,["node","children"]),r=null==l?void 0:l.id,a=r?null===(t=r.split("$"))||void 0===t?void 0:t[1]:null,d=ce.find(function(e){return e.id.toString()===a});return d?n.jsx(n.Fragment,{children:n.jsx(y.default,e.__assign({aiReason:d,customStyles:null==B?void 0:B.inlineUpdatedComponent,handleClickCognitiveDecision:null==ae?void 0:ae.handleClickCognitiveDecision,handleClickUpdatedPill:null==ae?void 0:ae.handleClickUpdatedPill,handleClickOutputValue:null==ae?void 0:ae.handleClickOutputValue,customIcons:null==ae?void 0:ae.customIcons,CDNeededInChip:te},{children:o}))}):o},del:function(i){var t,o,r,a;i.node;var d=i.children,s=e.__rest(i,["node","children"]),c=s.aireason,u=c&&(null===(t=c.deviation_details)||void 0===t?void 0:t.resolved)&&("rejected"===(null===(o=c.deviation_details)||void 0===o?void 0:o.resolved)||"reverted"===(null===(r=c.deviation_details)||void 0===r?void 0:r.resolved)),v=P(d,["ins"]),g=v.cleanedChildren,h=v.extractedNodes;return n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({className:l.default.deleted,style:e.__assign(e.__assign({},null!==(a=null==B?void 0:B.deleted)&&void 0!==a?a:{}),{textDecoration:u?"none":"line-through"})},s,{onClick:s.onclick},{children:g})),h]})},ins:function(i){var t=i.children,o=e.__rest(i,["children"]),r=P(t,["del"]),a=r.cleanedChildren,d=r.extractedNodes;return n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({className:l.default.inserted,style:null==B?void 0:B.inserted},o,{onClick:o.onclick},{children:a})),d]})},preserved:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:l.default.preserved,style:null==B?void 0:B.preserved},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:l.default.heading1,style:null==B?void 0:B.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:l.default.heading2,style:null==B?void 0:B.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:l.default.heading3,style:null==B?void 0:B.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:l.default.bold,style:null==B?void 0:B.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:l.default.paragraph,style:null==B?void 0:B.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(c.default,e.__assign({},o,{showUserStoryDiff:D,currentUpdatedTagId:Se,setCurrentUpdatedTagId:we,userStory:re,setUserStory:se,setAiReasoning:ue,node:t,isCraflow:J,onCraAccept:K,onCraReject:X,diffEditConfig:me,customStyles:null==B?void 0:B.updatedContent,craFlowConfig:Y}))},ol:function(i){var t,o,r,a=i.node,d=e.__rest(i,["node"]),s=null!==(r=null!==(o=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==d?void 0:d.start)&&void 0!==r?r:void 0;return n.jsx("ol",e.__assign({className:l.default.orderedList,style:null==B?void 0:B.olist},s?{start:Number(s)}:{},{children:null==d?void 0:d.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:l.default.unorderedList,style:null==B?void 0:B.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:l.default.tableWrapper},{children:n.jsx("table",e.__assign({className:l.default.table,style:null==B?void 0:B.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(U,{node:i,children:t,customStyles:B})},td:function(i){var t,o=i.node,l=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},a=r.style,d=e.__rest(r,["style"]);return n.jsx(k.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},d,{style:a?{cssText:a}:void 0},{children:l}))}))},th:function(i){var t,o=i.node,l=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},a=r.style,d=e.__rest(r,["style"]);return n.jsx(k.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},d,{style:a?{cssText:a}:void 0},{children:l}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),l="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==B?void 0:B.recommendationBlock,label:l}))},a:function(t){var o,l,r;t.inline;var a=t.children;t.node;var d=e.__rest(t,["inline","children","node"]),s=i.useContext(k)||"true"==(null==d?void 0:d.table),c="".concat(null==d?void 0:d.href),u=null===(o=c.split("$"))||void 0===o?void 0:o[0],v=null===(l=c.split("$"))||void 0===l?void 0:l[1];if("ai_reasoning"===u){var g=(null!==(r=D?z:ce)&&void 0!==r?r:[]).find(function(e){return e.id.toString()===decodeURIComponent(v)}),h=he.includes(v);if(g){if(s)return n.jsx(M,{aiReason:g,customStyle:null==B?void 0:B.tableAiReasoning,customIcons:Ce,isHighConfidence:g.relevance_score>=p.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});var f=De(a),m="source"!==f.trim().toLowerCase();return n.jsx(p.default,{aiReason:g,isSourceHasHighlight:h,inlineLabel:f,isInlineCitation:m,customIcons:Ce,customStyles:{aiReasoningContent:null==B?void 0:B.aiReasoningContent,aiReasoningAccordion:null==B?void 0:B.aiReasoningAccordion,aiReasoningMarkdown:null==B?void 0:B.aiReasoningMarkdown,aiReasoningPill:null==B?void 0:B.aiReasoningPill,webCitation:null==B?void 0:B.webCitation,stormeeCitation:null==B?void 0:B.stormeeCitation,waveformCitation:null==B?void 0:B.waveformCitation,imageCitation:null==B?void 0:B.imageCitation,fileCitation:null==B?void 0:B.fileCitation,appModCitation:null==B?void 0:B.appModCitation,rcaCitation:null==B?void 0:B.rcaCitation,readFileCitation:null==B?void 0:B.readFileCitation,loadingCitations:null==B?void 0:B.loadingCitations,chatCitation:null==B?void 0:B.chatCitation,bigEnoughCitation:null==B?void 0:B.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:l.default.blockCode,style:null==B?void 0:B.code},{children:t}))}):n.jsx("code",e.__assign({className:l.default.inlineCode,style:null==B?void 0:B.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(d.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(a.Info,{size:16,className:l.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",l=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(u.default,{title:"Generated Code",code:l,language:o,customStyles:{pill:null==B?void 0:B.generatedCodePill,content:null==B?void 0:B.generatedCodeContent}})},updatedsegment:function(i){var t,o,l,r,a=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=a.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=a.position)||void 0===o?void 0:o.start.column,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.line,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.column),u=function(e){if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}}(s),v=u?n.jsx("div",{dangerouslySetInnerHTML:{__html:A.default.sanitize(u)}}):n.jsx("div",{children:d});return n.jsx(j.default,{id:c,node:a,children:v,props:s,segmentComponentConfig:pe,customStyles:B,customIcons:V,extractText:De,isUpdatedSegment:!0})},segment:function(i){var t,o,l,r,a=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=a.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=a.position)||void 0===o?void 0:o.start.column,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.line,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.column);return n.jsx(j.default,{id:c,node:a,children:d,props:s,segmentComponentConfig:pe,customStyles:B,customIcons:V,extractText:De})}}},[Le,Y,ce,G,Se,D,s,V,ge,he,B,pe,ke,Pe]);return i.useEffect(function(){if(oe.current){if(ge.length){var e;if(0===he.length||ee)requestAnimationFrame(function(){xe([ge[fe].replace(/\*/g,"")])});else{var n=oe.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){xe([ge[fe].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}ye()}},[ge,he,fe,ee]),n.jsx(q.Provider,e.__assign({value:{expandedInfo:be,setExpanded:Ee,reasonToRow:Ne}},{children:n.jsxs("div",e.__assign({ref:oe,className:"".concat(l.default.container," ").concat("approving"!==E?l.default.wrapper:""," ").concat(O||""),style:null==B?void 0:B.container},{children:[x?n.jsx(S.MarkdownContextProvider,{children:n.jsx(R.default,e.__assign({components:$e,rehypePlugins:[N.default]},{children:He}))}):h,Me>0&&ie&&n.jsx("div",e.__assign({className:l.default.confidenceScoreContainer,style:null==B?void 0:B.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:l.default.confidenceScore,style:null==B?void 0:B.confidenceScore},{children:[n.jsx(m.default,{size:14,color:(null==B?void 0:B.confidenceScoreIconColor)||"#166534"}),Me,"%"]}))})),$&&n.jsx("div",e.__assign({className:l.default.citationLoader,style:null==B?void 0:B.citationLoaderContainer},{children:n.jsx(v.default,{customStyles:{container:null==B?void 0:B.citationLoadingContainer,icon:null==B?void 0:B.citationLoadingIcon,text:null==B?void 0:B.citationLoadingText}})})),I&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==B?void 0:B.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(_.default,{customStyles:null==B?void 0:B.attachedContext,variant:W})}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as r}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import{forwardRef as i,useRef as a,useState as c,useEffect as u,useImperativeHandle as l}from"react";import{DEFAULT_TOOLBAR_CONFIG as d}from"./Editor/constants/editorConfig.js";import s from"./Editor/Editor.js";import{useRefStore as f}from"../../store/ref.context.js";import{$generateHtmlFromNodes as h}from"@lexical/html";import m from"turndown";import{tables as p}from"turndown-plugin-gfm";import{UnsavedChangesPopup as v}from"../UnsavedChangesPopup/UnsavedChangesPopup.js";var g=new m({headingStyle:"atx",codeBlockStyle:"fenced"});g.keep(["ins","del","mark"]),g.keep(function(e){var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r}),g.keep(function(e){return"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")}),g.addRule("md-table-passthrough",{filter:function(e){return"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table")},replacement:function(e,t){return t.textContent||""}}),g.use(p);var E=function(e){return(e||"").replace(/\r\n/g,"\n").trim()},A=i(function(i,m){var p=i.type,A=i.value,w=i.handleUpdateState,y=i.onBlur,b=i.placeholder,S=i.minHeight,C=i.height,x=i.mode,N=i.doNotShowBorderInViewMode,T=i.onSaveUnsavedChanges,L=i.onDiscardUnsavedChanges,q=i.isSavingUnsavedChanges,B=void 0!==q&&q,H=a(null),_=c({type:p,value:A}),M=_[0],R=_[1],W=c(0),j=W[0],k=W[1],U=c(!1),D=U[0],P=U[1],I=a(A),V=a(A),$=a(Boolean(A)),O=f(),z=O.contentRef;O.setContentRef;u(function(){R(function(t){return e(e({},t),{value:A})}),I.current=A,V.current=A,$.current=Boolean(A),P(!1)},[A]),l(m,function(){return{requestClose:function(){return!("edit"===x&&E(I.current)!==E(V.current))||(P(!0),!1)}}},[x]);return u(function(){var e=function(){z&&z.current&&k(z.current.clientHeight-60)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[z]),n("div",e({style:{position:"relative",width:"100%",height:C,minHeight:S}},{children:[D&&o(v,{isSaving:B,onSave:function(){return t(void 0,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,null==T?void 0:T()];case 1:return e.sent(),I.current=V.current,P(!1),[2]}})})},onDiscard:function(){V.current=I.current,null==L||L(),P(!1)}}),o(s,{minHeight:S,height:C,placeholder:b||"Enter some text...",onChange:function(e,t){e.read(function(){var e=h(t,null),r=(new DOMParser).parseFromString(e,"text/html");function n(e){return Array.from(e.childNodes).map(function(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent||"";if(e.nodeType===Node.ELEMENT_NODE){var t=e,r=t.tagName.toLowerCase(),o=n(t);if("strong"===r||"b"===r)return o.startsWith("<strong>")&&o.endsWith("</strong>")?o:"<strong>".concat(o,"</strong>");if("em"===r||"i"===r)return o.startsWith("<em>")&&o.endsWith("</em>")?o:"<em>".concat(o,"</em>");if("code"===r)return"<code>".concat(o,"</code>");if("u"===r)return"<u>".concat(o,"</u>");if("s"===r)return"<s>".concat(o,"</s>");if("a"===r){var i=t.getAttribute("href")||"";return'<a href="'.concat(i,'">').concat(o,"</a>")}return o}return""}).join("")}r.querySelectorAll("span").forEach(function(e){var t=e.getAttribute("style")||"";t.includes("background-color")&&t.includes("rgb(219, 234, 254)")&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("strong code").forEach(function(e){var t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(function(e){var t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(function(e){var t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(function(e){var t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))}),r.querySelectorAll("ins[data-review-id], del[data-review-id]").forEach(function(e){e.innerHTML=n(e)});var o=[];r.querySelectorAll("ins[data-review-id], del[data-review-id]").forEach(function(e,t){o.push(e.outerHTML);var n=r.createElement("span");n.textContent="%%REVIEW_".concat(t,"%%"),e.replaceWith(n)});var i=[];r.querySelectorAll("table").forEach(function(e,t){i.push(e.outerHTML);var n=r.createElement("p");n.textContent="%%TABLE_".concat(t,"%%"),e.replaceWith(n)});var a=g.turndown(r.body.innerHTML);o.forEach(function(e,t){a=a.replace("%%REVIEW\\_".concat(t,"%%"),e)}),i.forEach(function(e,t){a=a.replace("%%TABLE\\_".concat(t,"%%"),"\n\n".concat(e,"\n\n"))}),a=a.replace(/\*{4}([^*]+)\*{4}/g,"**$1**"),$.current&&(I.current=a,$.current=!1),V.current=a,function(e,t){w(e,t)}("prompt",a)})},toolbarConfig:d,editorRef:H,mode:x,initialString:{type:M.type,value:M.value},dynamicHeight:j,onBlur:y,doNotShowBorderInViewMode:N||!1})]}))});A.displayName="RichTextEditor";export{A as default};
|
|
2
2
|
//# sourceMappingURL=RichTextEditor.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as a,jsxs as s}from"react/jsx-runtime";import n from"./UnsavedChangesPopup.module.css.js";var o=function(o){var i=o.isSaving,t=void 0!==i&&i,l=o.onSave,c=o.onDiscard;return a("div",e({className:n.overlay,onClick:function(e){return e.stopPropagation()},role:"presentation"},{children:s("div",e({className:n.dialog,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-changes-title"},{children:[a("h3",e({id:"unsaved-changes-title",className:n.title},{children:"Unsaved changes"})),a("p",e({className:n.message},{children:"We see, you have unsaved changes, click on Yes to save your changes, else click on No."})),s("div",e({className:n.actions},{children:[a("button",e({type:"button",className:n.noButton,onClick:c,disabled:t},{children:"No"})),a("button",e({type:"button",className:n.yesButton,onClick:l,disabled:t},{children:t?"Saving...":"Yes"}))]}))]}))}))};export{o as UnsavedChangesPopup,o as default};
|
|
2
|
+
//# sourceMappingURL=UnsavedChangesPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsavedChangesPopup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.module.css.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={overlay:"UnsavedChangesPopup-module_overlay__hSGb2",dialog:"UnsavedChangesPopup-module_dialog__TIloc",title:"UnsavedChangesPopup-module_title__fWQ1u",message:"UnsavedChangesPopup-module_message__KWuvt",actions:"UnsavedChangesPopup-module_actions__4C-2B",noButton:"UnsavedChangesPopup-module_noButton__fP-Fy",yesButton:"UnsavedChangesPopup-module_yesButton__2IG5l"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".UnsavedChangesPopup-module_overlay__hSGb2{align-items:flex-start;background:#0f172a47;display:flex;inset:0;justify-content:center;padding:24px 16px 16px;position:absolute;z-index:20}.UnsavedChangesPopup-module_dialog__TIloc{background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 18px 45px #0f172a2e;cursor:default;padding:20px;width:min(420px,100%)}.UnsavedChangesPopup-module_title__fWQ1u{color:#111827;font-size:18px;font-weight:600;line-height:26px;margin:0}.UnsavedChangesPopup-module_message__KWuvt{color:#4b5563;font-size:14px;line-height:20px;margin:8px 0 0}.UnsavedChangesPopup-module_actions__4C-2B{display:flex;gap:10px;justify-content:flex-end;margin-top:20px}.UnsavedChangesPopup-module_noButton__fP-Fy,.UnsavedChangesPopup-module_yesButton__2IG5l{border-radius:6px;cursor:pointer;font-size:14px;font-weight:600;min-width:72px;padding:8px 14px}.UnsavedChangesPopup-module_noButton__fP-Fy{background:#fff;border:1px solid #d1d5db;color:#374151}.UnsavedChangesPopup-module_yesButton__2IG5l{background:#5b3df5;border:1px solid #5b3df5;color:#fff}.UnsavedChangesPopup-module_noButton__fP-Fy:disabled,.UnsavedChangesPopup-module_yesButton__2IG5l:disabled{cursor:not-allowed;opacity:.6}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
|
|
2
|
+
//# sourceMappingURL=UnsavedChangesPopup.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsavedChangesPopup.module.css.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 l,jsx as i,Fragment as r}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as d}from"react";import{ChevronUp as u,ChevronDown as c,ExternalLink as v,Download as p,Share2 as m,Copy as h,LoaderCircle as f,PencilIcon as y,Plus as S,Trash2 as g,X as C,Ellipsis as I,Hourglass as N,Check as b,ChevronUpIcon as w,ChevronDownIcon as D,Info as E,Bookmark as B}from"lucide-react";import x from"showdown";import{Tooltip as T,Menu as A,MenuItem as P}from"@mui/material";import U from"../../icons/Illustration.svg.js";import{v4 as k}from"uuid";import R from"./UserStoryCard.module.css.js";import{formatMarkdown as _,indentMarkdown as M}from"../../utils/helpers.js";import{replaceTitleSection as L}from"../../utils/user-story.utils.js";import j from"../../shared/AtomicButton.js";import V from"../RichTextEditor/RichTextEditor.js";import G from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as O,useRequirementAI as z}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as H}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as W}from"./TitleEditor/TitleEditor.js";import F from"./ClinicalTrialSection.js";import{CompletionPanel as q}from"../story-screen/CompletionPanel.js";import Q from"../../icons/CDIcon.js";var Z,J=((Z={})[O.WAITING]="WAITING TO GENERATE",Z[O.IN_PROGRESS]="IN PROGRESS",Z[O.GENERATED]="GENERATED",Z[O.FAILED]="FAILED",Z[O.GENERATE]="GENERATE",Z[O.APPROVED]="APPROVED",Z);function K(t){for(var n,o=[],l=/<learned>(.*?)<\/learned>/g,r=0,a=0;null!==(n=l.exec(t));){var s=n[1],d=n.index;d>r&&o.push(i("span",{children:t.slice(r,d)},"text-pre-".concat(a++))),o.push(i(T,e({title:s,placement:"top"},{children:i(E,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(k()))),r=l.lastIndex}return r<(null==t?void 0:t.length)&&o.push(i("span",{children:t.slice(r)},"text-post-".concat(a++))),o}function X(t,n,o){var l;if(!t)return{};if(n)return e({},t.parentConfig);var i=e({},t.childConfig);return o&&(null===(l=t.subFeatureOverrides)||void 0===l?void 0:l[o])?e(e({},i),t.subFeatureOverrides[o]):i}var Y=function(t){var n,o=t.displayName,r=z().customStyles,a=null===(n=null==r?void 0:r.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return l("div",e({className:R.displayName,style:null==a?void 0:a.wrapper},{children:[i(B,{className:R.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),l("span",e({style:null==a?void 0:a.label},{children:[o,":"]}))]}))},$=function(w){var D,E,B,Z,ee,te,ne,oe,le,ie,re,ae,se,de,ue,ce,ve,pe,me,he=w.isUserStoryCurrentlyUpdated,fe=w.artifactId,ye=w.artifactTitleId,Se=w.parentUserStory,ge=w.currentUserStory,Ce=w.onUserStoryChange,Ie=w.parentIndex,Ne=w.currentIndex,be=w.enableDownload,we=w.isDiffEditReviewMode,De=w.showUserStoryDiff,Ee=w.handleDownloadUserStory,Be=w.handleOpenSendDialog,xe=w.updateUserStoryArtifact,Te=w.selectedArtifactId,Ae=w.isDisplayHighlightControl,Pe=w.elementDisplayConfig,Ue=w._resolvedConfig,ke=w.showWrapper,Re=void 0!==ke&&ke,_e=w.defaultExpanded,Me=w.actionItemsConfig,Le=w.onDelete,je=w.contextVariant,Ve=w.expandedSubFeatures,Ge=w.showDisplayName,Oe=void 0===Ge||Ge,ze=w.allowTitleEdit,He=void 0===ze||ze,We=w.showConfidenceScore,Fe=void 0===We||We,qe=w.showBorderTop,Qe=void 0===qe||qe,Ze=w.sectionStatusConfig,Je=w.showCompletionPanel,Ke=void 0!==Je&&Je,Xe=w.showAddSectionButton,Ye=void 0!==Xe&&Xe,$e=w.disableEditPlan,et=void 0!==$e&&$e,tt=w.useMuiTooltip,nt=void 0!==tt&&tt,ot=w.approveButtonConfig,lt=w.CDNeededInChip,it=null!=Ze?Ze:{},rt=it.isLoadingSectionData,at=void 0!==rt&&rt,st=it.onLoadSectionData,dt=it.status,ut=it.onStatusClick,ct=it.completedCount,vt=it.totalCount,pt=it.isNoDataAvailable,mt=void 0!==pt&&pt,ht=z(),ft=ht.searchQueryList,yt=ht.citations,St=ht.customStyles,gt=ht.customSectionConfig,Ct=null==St?void 0:St.userStoryCardStyles,It=null==Ct?void 0:Ct.statusStyles,Nt=null===(E=null==St?void 0:St.userStoryCardStyles)||void 0===E?void 0:E.userStoryEditStyles,bt=null===(B=null==St?void 0:St.userStoryScreenStyles)||void 0===B?void 0:B.userStoryContentStyles,wt=null==Ct?void 0:Ct.progressHeaderStyles,Dt=null==Ct?void 0:Ct.clinicalTrialSectionStyles,Et=null==Ct?void 0:Ct.CompletionStyles,Bt=null==Ct?void 0:Ct.noDataStyles,xt=null==Ct?void 0:Ct.approveButtonStyles,Tt=null!==(ee=null===(Z=null==gt?void 0:gt.shouldRender)||void 0===Z?void 0:Z.call(gt,ge))&&void 0!==ee&&ee,At=null===(te=null==gt?void 0:gt.getValue)||void 0===te?void 0:te.call(gt,ge),Pt=null!==(oe=null===(ne=null==gt?void 0:gt.getFields)||void 0===ne?void 0:ne.call(gt,ge))&&void 0!==oe?oe:[],Ut=null!==(le=null==gt?void 0:gt.isEditDisabled)&&void 0!==le&&le,kt=null!==(re=null===(ie=null==gt?void 0:gt.isSaving)||void 0===ie?void 0:ie.call(gt,ge))&&void 0!==re&&re,Rt=function(e,t){return e>=80?null==t?void 0:t.highCompletion:e>=50?null==t?void 0:t.mediumCompletion:null==t?void 0:t.lowCompletion}(null!==(ae=ge.completion_percentage)&&void 0!==ae?ae:0,Et),_t=((D={})[O.WAITING]=null==It?void 0:It.waiting,D[O.IN_PROGRESS]=null==It?void 0:It.inProgress,D[O.GENERATED]=null==It?void 0:It.generated,D[O.FAILED]=null==It?void 0:It.failed,D[O.GENERATE]=null==It?void 0:It.generate,D[O.APPROVED]=null==It?void 0:It.approved,D),Mt=a(e(e({},structuredClone(ge)),{value:_(ge.value)||""})),Lt=Mt[0],jt=Mt[1],Vt=a({userStory:!!ge.isDefaultEdit}),Gt=Vt[0],Ot=Vt[1],zt=a(!1),Ht=zt[0],Wt=zt[1],Ft=a(!1),qt=Ft[0],Qt=Ft[1],Zt=a(null),Jt=Zt[0],Kt=Zt[1],Xt=a(null),Yt=Xt[0],$t=Xt[1],en=z(),tn=en.userStory,nn=en.customIcons,on=a(null!=_e?_e:""===Ie||Te===ge.artifactId||!!ge.isDefaultOpen),ln=on[0],rn=on[1],an=a(!1);an[0];var sn=an[1],dn=a(null),un=dn[0],cn=dn[1],vn=a(null),pn=vn[0],mn=vn[1],hn=a(!1),fn=hn[0],yn=hn[1],Sn=s(null),gn=a(!1);gn[0];var Cn=gn[1],In=a(!1),Nn=In[0],bn=In[1],wn=s(null);d(function(){he&&rn(he)},[he]),d(function(){jt(e(e({},structuredClone(ge)),{value:_(ge.value)||""}))},[ge]),d(function(){ft.length>0?rn(!0):void 0===_e&&(Te?rn(Te===ge.artifactId):Ve&&Ve.length>0&&rn(Ve.includes(ge.artifactId)))},[ft,Te,ge.artifactId,Ve]);var Dn=function(){cn(null)},En=function(){mn(null)},Bn=function(){rn(function(e){return!e})};var xn=null!=(null==ge?void 0:ge.big_enough)&&!Number.isNaN(ge.big_enough)&&!!(null==ge?void 0:ge.big_enough_decision_factors),Tn=null!==(se=null==ge?void 0:ge.completion_percentage)&&void 0!==se?se:0,An=!!(null==ge?void 0:ge.completion_decision_factors),Pn=""===Ie,Un=null!=Ue?Ue:X(Pe,Pn),kn=!we&&!De;return d(function(){if(Yt){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(Yt));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[Yt]),d(function(){ge.isDefaultEdit&&Ot(function(t){return e(e({},t),{userStory:!0})})},[ge.isDefaultEdit]),l("div",e({className:R.card,style:null==Ct?void 0:Ct.cardStyle,id:"story-card-".concat(ge.title),"data-expanded":ln},{children:[l("div",e({className:R.titleSection,style:null==Ct?void 0:Ct.titleSection},{children:[l("div",e({className:R.titleRow,style:null==Ct?void 0:Ct.titleRow,onClick:Bn},{children:[l("div",e({className:R.titleLeft,style:null==Ct?void 0:Ct.titleLeft,onMouseEnter:function(){return Cn(!0)},onMouseLeave:function(){return Cn(!1)}},{children:[Oe&&i(Y,{displayName:ye}),Ht&&kn?i(W,{title:ge.title,onSave:function(o){return function(o,l){return t(void 0,void 0,void 0,function(){var t,i;return n(this,function(n){try{t=e({},ge),ge.artifactId===l?t.title=o:t.sub_features=(null===(i=ge.sub_features)||void 0===i?void 0:i.map(function(t){return t.artifactId===l?e(e({},t),{title:o}):t}))||[],jt(t),Ce(t),Wt(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(o,ge.artifactId)},onCancel:function(){Wt(!1)},inputStyle:null==Nt?void 0:Nt.inlineTitleInput,confirmButtonStyle:null==Nt?void 0:Nt.inlineTitleConfirm,cancelButtonStyle:null==Nt?void 0:Nt.inlineTitleCancel},"inline-title-editor"):l("div",e({className:R.storyTitleWrapper},{children:[i(T,e({title:K(ge.title),arrow:!0},{children:i("h2",e({title:nt?void 0:ge.title,className:R.storyTitle,style:null==Ct?void 0:Ct.storyTitle},{children:K(ge.title)}),ge.artifactId)})),Ke&&!Tt&&(An?i(q,e({customIcons:null==nn?void 0:nn.userStoryIcons,customStyles:null==Ct?void 0:Ct.aiReasoningCitaionStyles,currentUserStory:ge,panelStyles:null==Ct?void 0:Ct.CompletionStyles,onToggleStateChange:bn},{children:l("div",e({style:e(e({display:"inline-flex",alignItems:"center",gap:"4px"},null==Et?void 0:Et.badge),Rt)},{children:[l("span",{children:[Tn,"% Completed"]}),i("span",e({style:{display:"flex",alignItems:"center"}},{children:i(Q,{color:"currentColor"})})),i(Nn?u:c,{size:14,style:null==Et?void 0:Et.chevronStyle})]}))})):i("div",e({style:e(e({display:"inline-flex",alignItems:"center",gap:"4px"},null==Et?void 0:Et.badge),Rt)},{children:l("span",{children:[Tn,"% Completed"]})}))),He&&i("button",e({type:"button",className:R.titleEditButton,style:null==Nt?void 0:Nt.titleEditButton,onClick:function(e){e.stopPropagation(),Wt(!0),ln||rn(!0)},"aria-label":"Edit title",title:"Edit title"},{children:i("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})}))}))]}))]})),(dt||void 0!==ct&&void 0!==vt)&&l("div",e({className:R.statusContainer},{children:[void 0!==ct&&void 0!==vt&&l("div",e({className:R.completedBadge},{children:["Completed: ",ct,"/",vt]})),dt&&i("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==ut||ut()},className:R.statusButton,style:_t[dt]},{children:J[dt]}))]})),l("div",e({className:R.titleActions,style:null==Ct?void 0:Ct.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(Un.showProgressPercentage||Un.showGapBox)&&Re&&l("div",e({className:R.progressHeader,style:null==wt?void 0:wt.wrapper},{children:[Un.showProgressPercentage&&l("div",e({className:R.progressPercentage,style:null==wt?void 0:wt.percentage},{children:[null!==(ue=null!==(de=null==ge?void 0:ge.confidenceScore)&&void 0!==de?de:null==Un?void 0:Un.confidenceValue)&&void 0!==ue?ue:"0","%"]})),Un.showGapBox&&l("div",e({className:R.gapBox,style:null==wt?void 0:wt.gapBox},{children:[null!==(ve=null!==(ce=null==ge?void 0:ge.gapValue)&&void 0!==ce?ce:null==Un?void 0:Un.gapBoxValue)&&void 0!==ve?ve:"2"," ","Gaps"]}))]})),xn&&i(H,{customIcons:null==nn?void 0:nn.userStoryIcons,customStyles:null==Ct?void 0:Ct.aiReasoningCitaionStyles,currentUserStory:ge,panelStyles:null==Ct?void 0:Ct.BigEnoughStyles}),!Gt.userStory&&l(r,{children:[!1!==(null==Un?void 0:Un.showShareButton)&&i("button",e({className:R.iconButton,style:null==Ct?void 0:Ct.iconButton,onClick:function(e){cn(e.currentTarget)}},{children:i(v,{size:16})})),l(A,e({id:"user-story-share-menu",anchorEl:un,open:!!un,onClose:function(){return cn(null)},style:null==Ct?void 0:Ct.userStoryShareMenu},{children:[be&&i(P,e({style:null==Ct?void 0:Ct.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return sn(!0),Ee?[4,Promise.all([Ee("pdf"),Ee("doc")])]:[2];case 1:return e.sent(),sn(!1),[2]}})})}},{children:l("div",e({ref:Sn,className:R.menuItemContent,style:null==Ct?void 0:Ct.menuItemContent},{children:[i(p,{size:16,color:null==Ct?void 0:Ct.menuIconColor}),i("p",e({style:null==Ct?void 0:Ct.menuLabel},{children:"Download"}))]}))})),i(P,e({style:null==Ct?void 0:Ct.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){return t=ge,Se&&(t=e(e({},ge),{value:"".concat(L(null==Se?void 0:Se.value,ge.title)," \n").concat(ge.value)})),null==Be||Be(!0,[t],ge.artifactId),Dn(),[2]})})}},{children:l("div",e({style:null==Ct?void 0:Ct.menuItemContent,className:R.menuItemContentPadded},{children:[i(m,{size:16,color:null==Ct?void 0:Ct.menuIconColor}),i("p",e({style:null==Ct?void 0:Ct.menuLabel},{children:"Send"}))]}))})),i(P,e({style:null==Ct?void 0:Ct.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var e,t,o,l,i;return n(this,function(n){switch(n.label){case 0:e=new x.Converter,t=e.makeHtml(_(ge.value)||ge.value),o=function(e){var t=(new x.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(_(ge.value)||ge.value),l=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,navigator.clipboard.write([l])];case 2:return n.sent(),console.log("Copied User Story"),[3,5];case 3:return i=n.sent(),console.error("Failed to copy user story:",i),[3,5];case 4:return Dn(),[7];case 5:return[2]}})})}},{children:l("div",e({style:null==Ct?void 0:Ct.menuItemContent,className:R.menuItemContentPadded},{children:[i(h,{size:16,color:null==Ct?void 0:Ct.menuIconColor}),i("p",e({style:null==Ct?void 0:Ct.menuLabel},{children:"Copy"}))]}))}))]}))]}),Gt.userStory&&ln?i(j,{type:"outline",children:"Cancel",style:null==Ct?void 0:Ct.cancelButton,onClick:function(){var t;null===(t=wn.current)||void 0===t||t.abort(),Ot(function(t){return e(e({},t),{userStory:!1})})}}):i(r,{}),Gt.userStory&&ln?i(j,{type:"fill",children:fn?l("span",e({className:R.savingSpinner,style:null==Ct?void 0:Ct.savingSpinner},{children:[i(f,{className:R.spinAnimation,style:null==Ct?void 0:Ct.spinAnimation}),i("span",{children:"Saving..."})]})):"Save",isDisable:fn,style:fn?null==Ct?void 0:Ct.savingButton:null==Ct?void 0:Ct.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 yn(!0),"userStory"==="userStory"&&(Ce(Lt),console.log("I am changing RTE editor values",Lt)),[4,xe(yt,tn,fe,null===(t=wn.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),Ce(e(e({},Lt),{isDefaultEdit:!1})),Ot(function(t){return e(e({},t),{userStory:!1})}),yn(!1),[2]}})})}}):!we&&!De&&!et&&ln&&!1!==(null==Un?void 0:Un.showEditButton)&&i("button",e({className:R.iconButton,style:null==Ct?void 0:Ct.editButton,onClick:function(){return Ot(function(t){return e(e({},t),{userStory:!0})})}},{children:i(y,{color:null==Ct?void 0:Ct.pencilIconColor,size:16})})),Ye&&Pn&&ln&&!we&&!De&&!1!==(null==Un?void 0:Un.showEditButton)&&l("button",e({type:"button",className:R.addSectionButton,style:null==Nt?void 0:Nt.addSectionButton,onClick:function(t){var n,l,i;t.stopPropagation();var r=(null!==(l=null===(n=ge.sub_features)||void 0===n?void 0:n.length)&&void 0!==l?l:0)+1,a={artifactId:k(),title:"New Section ".concat(r),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},s=e(e({},ge),{sub_features:o(o([],null!==(i=ge.sub_features)&&void 0!==i?i:[],!0),[a],!1)});jt(s),Ce(s),rn(!0),$t(a.title)},"aria-label":"Add section",title:"Add section"},{children:[i(S,{size:14}),i("span",e({className:R.addSectionLabel},{children:"Add Section"}))]})),!Pn&&!we&&!et&&!De&&i("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==Le||Le()},className:R.iconButton,style:null==Nt?void 0:Nt.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:i(g,{size:16})})),Tt&&i("button",e({type:"button",className:R.iconButton,disabled:Ut,onClick:function(e){if(e.stopPropagation(),qt)return Kt(null),void Qt(!1);Kt(structuredClone(null!=At?At:{})),rn(!0),Qt(!0)}},{children:i(qt?C:y,{size:16,color:null==Ct?void 0:Ct.pencilIconColor})})),(null==Un?void 0:Un.actionItemsButton)&&l(r,{children:[i("span",e({className:R.actionItemBtn,style:null==Ct?void 0:Ct.actionItemBtn,onClick:function(e){e.stopPropagation(),mn(e.currentTarget)}},{children:i(I,{})})),i(A,e({id:"user-story-action-menu",anchorEl:pn,open:!!pn,onClose:En,style:null==Ct?void 0:Ct.userStoryShareMenu},{children:null==Me?void 0:Me.items.map(function(t,n){return i(P,e({style:null==Ct?void 0:Ct.userStoryMenuItem,onClick:function(){t.onclick(ge),En()}},{children:l("div",e({className:R.menuItemContent,style:e(e({},null==Ct?void 0:Ct.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[i("span",e({className:R.menuItemIcon,style:null==Ct?void 0:Ct.menuItemIcon},{children:t.icon})),i("p",e({style:null==Ct?void 0:Ct.menuLabel},{children:t.name})),i("span",{className:R.menuItemRight,style:null==Ct?void 0:Ct.menuItemRight})]}))}),"action-item-".concat(n,"-").concat(t.name))})}))]}),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),Bn()},style:null==Ct?void 0:Ct.chevronButton,className:R.chevronButton},{children:i(ln?u:c,{className:R.chevronIcon,color:null==Ct?void 0:Ct.chevronIconColor})}))]}))]})),i("div",{className:R.divider,style:null==Ct?void 0:Ct.dividerStyle})]})),ln&&i("div",e({className:R.cardContent,style:e(e({},null==Ct?void 0:Ct.cardContentStyle),{borderTop:Qe?"1px solid #E5E5E5":"none"})},{children:l("div",at?e({className:R.loadingContainer},{children:[i("div",e({className:R.loadingIconWrapper},{children:i(N,{size:28,color:"#5B3DF5",className:R.spinAnimation})})),l("div",{children:[i("h3",e({className:R.loadingTitle},{children:"Section generation in progress.."})),i("p",e({className:R.loadingSubtitle},{children:"This may take a few minutes"}))]}),i("button",e({type:"button",onClick:function(){return null==st?void 0:st()},className:R.viewStatusButton},{children:"View Status"}))]}):mt?e({className:R.noDataContainer,style:null==Bt?void 0:Bt.container},{children:[i("img",{src:U,alt:"No data available",className:R.noDataIllustration,style:null==Bt?void 0:Bt.illustration}),i("h3",e({className:R.noDataTitle,style:null==Bt?void 0:Bt.title},{children:"No Data Available for This Section"})),i("p",e({className:R.noDataSubtitle,style:null==Bt?void 0:Bt.subtitle},{children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."}))]}):e({className:R.contentInner,style:null==Ct?void 0:Ct.contentInner},{children:[l("div",e({className:R.descriptionSection,style:null==Ct?void 0:Ct.descriptionSection},{children:[i("div",{className:R.justifyBetween,style:null==Ct?void 0:Ct.justifyBetween}),Gt.userStory?i(V,{minHeight:"100%",height:"100%",type:"string",value:_(ge.value)||"",handleUpdateState:function(t,n){var o=M(n);jt(function(t){return e(e({},t),{value:o||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:Gt.userStory?"edit":"readOnly"}):Tt?i(F,{styles:Dt,fields:Pt,readonly:!qt,isSaving:kt,value:null!==(pe=null!=Jt?Jt:At)&&void 0!==pe?pe:{},onChange:Kt,onSave:function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return Jt?[4,null===(e=null==gt?void 0:gt.onSave)||void 0===e?void 0:e.call(gt,ge,Jt)]:[2];case 1:return t.sent(),Kt(null),Qt(!1),[2]}})})},onCancel:function(){Kt(null),Qt(!1)}}):l(r,{children:[i(G,{showUserStoryDiff:De,isParent:""===Ie,message:_(ge.value)||"",artifactId:ge.artifactId,customStyles:bt,isDisplayHighlightControl:Ae,contextVariant:je,showConfidenceScore:Fe,CDNeededInChip:lt}),ot&&i("div",e({className:R.approveButtonContainer,style:null==xt?void 0:xt.container},{children:i("button",e({type:"button",className:R.approveButton,style:null==xt?void 0:xt.button,disabled:ot.disabled||ot.isLoading,onClick:function(e){var t;e.stopPropagation(),null===(t=null==ot?void 0:ot.onClick)||void 0===t||t.call(ot)}},{children:ot.isLoading?l(r,{children:[i(f,{size:16,className:R.spinner,style:null==xt?void 0:xt.icon}),i("span",e({style:null==xt?void 0:xt.text},{children:ot.label}))]}):l(r,{children:[i("span",e({style:null==xt?void 0:xt.text},{children:ot.label})),i(b,{size:16,style:null==xt?void 0:xt.icon})]})}))}))]})]})),null===(me=Lt.sub_features)||void 0===me?void 0:me.map(function(t,n){var l=X(Pe,!1,t.artifactId);return i($,{artifactId:fe,isUserStoryCurrentlyUpdated:he,artifactTitleId:"".concat(ye,"-").concat(String.fromCharCode(65+n)),parentUserStory:ge,parentIndex:"".concat(Ie).concat(Ie&&".").concat(Ne),currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(t){return function(t,n){var l=o([],ge.sub_features||[],!0);l[t]=n,Ce(e(e({},ge),{sub_features:l}))}(n,t)},enableDownload:!0,isDiffEditReviewMode:we,showUserStoryDiff:De,updateUserStoryArtifact:xe,handleDownloadUserStory:Ee,handleOpenSendDialog:Be,isDisplayHighlightControl:Ae,elementDisplayConfig:Pe,_resolvedConfig:l,actionItemsConfig:Me,onDelete:function(){return function(t){var n=(ge.sub_features||[]).filter(function(e,n){return n!==t}),o=e(e({},ge),{sub_features:n});jt(o),Ce(o)}(n)},expandedSubFeatures:Ve,disableEditPlan:et,useMuiTooltip:nt},t.artifactId)})]}))}))]}))},ee=function(t){var n=t.artifactTitleIDs,a=t.expandedSubFeatures,s=t.isDiffEditReviewMode,d=t.showUserStoryDiff,u=t.updateUserStoryArtifact,c=t.isUserStoryCurrentlyUpdated,v=t.artifactId,p=t.handleOpenSendDialog,m=t.handleDownloadUserStory,h=t.selectedArtifactId,f=t.isDisplayHighlightControl,y=t.elementDisplayConfig,S=t.showWrapper,g=t.actionItemsConfig,C=t.contextVariant,I=t.showDisplayName,N=t.allowTitleEdit,b=t.showConfidenceScore,E=t.showBorderTop,B=t.defaultExpanded,x=t.showCompletionPanel,T=void 0!==x&&x,A=t.showAddSectionButton,P=void 0!==A&&A,U=t.disableEditPlan,k=void 0!==U&&U,_=t.useMuiTooltip,M=void 0!==_&&_,L=t.approveButtonConfig,j=t.CDNeededInChip,V=z(),G=V.userStory,O=V.setUserStory,H=V.customStyles,W=V.searchQueryList,F=V.currentHighlightIndex,q=V.setCurrentHighlightIndex;V.segmentComponentConfig;var Q=V.sectionStatusConfig,Z=null==H?void 0:H.userStoryCardStyles,J=0===F,K=F===W.length-1;return l("div",e({className:R.userStoryCardWrapper,style:f?e(e({},null==Z?void 0:Z.userStoryCardWrapper),{position:"relative"}):null==Z?void 0:Z.userStoryCardWrapper},{children:[f&&i(r,{children:W.length>0&&i("div",e({className:R.wrapper},{children:i("div",e({className:R.highlightNavigation},{children:l("div",e({className:R.navigationContainer},{children:[l("span",e({className:R.navCounter},{children:[F+1," of ",W.length]})),l("div",e({className:R.navButtons},{children:[i("button",e({onClick:function(){F>0&&q(function(e){return e-1})},className:R.navButton,disabled:J},{children:i(w,{size:20,className:R.navIcon})})),i("button",e({onClick:function(){F<W.length-1&&q(function(e){return e+1})},className:R.navButton,disabled:K},{children:i(D,{size:20,className:R.navIcon})}))]}))]}))}))}))}),G.map(function(e,t){var l=X(y,!0);return i($,{isUserStoryCurrentlyUpdated:c,artifactId:v,artifactTitleId:n[t]||"",expandedSubFeatures:a,currentUserStory:e,onUserStoryChange:function(e){O(function(n){return n[t]=e,o([],n,!0)})},parentIndex:"",currentIndex:"".concat(t+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:s,showUserStoryDiff:d,updateUserStoryArtifact:u,handleOpenSendDialog:p,handleDownloadUserStory:m,selectedArtifactId:h,isDisplayHighlightControl:f,elementDisplayConfig:y,_resolvedConfig:l,showWrapper:S,defaultExpanded:B,actionItemsConfig:g,contextVariant:C,showDisplayName:I,allowTitleEdit:N,showConfidenceScore:b,showBorderTop:E,sectionStatusConfig:Q,showCompletionPanel:T,showAddSectionButton:P,disableEditPlan:k,useMuiTooltip:M,approveButtonConfig:L,CDNeededInChip:j},e.artifactId)})]}))};export{$ as StoryCard,ee as UserStoryCardWrapper,$ as default,K as replaceLearnedTagsWithInfo};
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as n,__spreadArray as o}from"tslib";import{jsxs as i,jsx as l,Fragment as r}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as u}from"react";import{ChevronUp as d,ChevronDown as c,ExternalLink as v,Download as p,Share2 as m,Copy as h,LoaderCircle as f,PencilIcon as y,Plus as S,Trash2 as C,X as g,Ellipsis as I,Hourglass as N,Check as b,ChevronUpIcon as w,ChevronDownIcon as D,Info as E,Bookmark as B}from"lucide-react";import x from"showdown";import{Tooltip as T,Menu as A,MenuItem as U}from"@mui/material";import P from"../../icons/Illustration.svg.js";import{v4 as k}from"uuid";import R from"./UserStoryCard.module.css.js";import{formatMarkdown as _,indentMarkdown as M}from"../../utils/helpers.js";import{replaceTitleSection as L}from"../../utils/user-story.utils.js";import j from"../../shared/AtomicButton.js";import V from"../RichTextEditor/RichTextEditor.js";import G from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as O,useRequirementAI as z}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as H}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as W}from"./TitleEditor/TitleEditor.js";import F from"./ClinicalTrialSection.js";import{CompletionPanel as q}from"../story-screen/CompletionPanel.js";import Q from"../../icons/CDIcon.js";var Z,J=((Z={})[O.WAITING]="WAITING TO GENERATE",Z[O.IN_PROGRESS]="IN PROGRESS",Z[O.GENERATED]="GENERATED",Z[O.FAILED]="FAILED",Z[O.GENERATE]="GENERATE",Z[O.APPROVED]="APPROVED",Z);function K(t){for(var n,o=[],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(T,e({title:s,placement:"top"},{children:l(E,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(k()))),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 X(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 Y=function(t){var n,o=t.displayName,r=z().customStyles,a=null===(n=null==r?void 0:r.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return i("div",e({className:R.displayName,style:null==a?void 0:a.wrapper},{children:[l(B,{className:R.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),i("span",e({style:null==a?void 0:a.label},{children:[o,":"]}))]}))},$=function(w){var D,E,B,Z,ee,te,ne,oe,ie,le,re,ae,se,ue,de,ce,ve,pe,me,he=w.isUserStoryCurrentlyUpdated,fe=w.artifactId,ye=w.artifactTitleId,Se=w.parentUserStory,Ce=w.currentUserStory,ge=w.onUserStoryChange,Ie=w.parentIndex,Ne=w.currentIndex,be=w.enableDownload,we=w.isDiffEditReviewMode,De=w.showUserStoryDiff,Ee=w.handleDownloadUserStory,Be=w.handleOpenSendDialog,xe=w.updateUserStoryArtifact,Te=w.selectedArtifactId,Ae=w.isDisplayHighlightControl,Ue=w.elementDisplayConfig,Pe=w._resolvedConfig,ke=w.showWrapper,Re=void 0!==ke&&ke,_e=w.defaultExpanded,Me=w.actionItemsConfig,Le=w.onDelete,je=w.contextVariant,Ve=w.expandedSubFeatures,Ge=w.showDisplayName,Oe=void 0===Ge||Ge,ze=w.allowTitleEdit,He=void 0===ze||ze,We=w.showConfidenceScore,Fe=void 0===We||We,qe=w.showBorderTop,Qe=void 0===qe||qe,Ze=w.sectionStatusConfig,Je=w.showCompletionPanel,Ke=void 0!==Je&&Je,Xe=w.showAddSectionButton,Ye=void 0!==Xe&&Xe,$e=w.disableEditPlan,et=void 0!==$e&&$e,tt=w.useMuiTooltip,nt=void 0!==tt&&tt,ot=w.approveButtonConfig,it=w.CDNeededInChip,lt=null!=Ze?Ze:{},rt=lt.isLoadingSectionData,at=void 0!==rt&&rt,st=lt.onLoadSectionData,ut=lt.status,dt=lt.onStatusClick,ct=lt.completedCount,vt=lt.totalCount,pt=lt.isNoDataAvailable,mt=void 0!==pt&&pt,ht=z(),ft=ht.searchQueryList,yt=ht.citations,St=ht.customStyles,Ct=ht.customSectionConfig,gt=null==St?void 0:St.userStoryCardStyles,It=null==gt?void 0:gt.statusStyles,Nt=null===(E=null==St?void 0:St.userStoryCardStyles)||void 0===E?void 0:E.userStoryEditStyles,bt=null===(B=null==St?void 0:St.userStoryScreenStyles)||void 0===B?void 0:B.userStoryContentStyles,wt=null==gt?void 0:gt.progressHeaderStyles,Dt=null==gt?void 0:gt.clinicalTrialSectionStyles,Et=null==gt?void 0:gt.CompletionStyles,Bt=null==gt?void 0:gt.noDataStyles,xt=null==gt?void 0:gt.approveButtonStyles,Tt=null!==(ee=null===(Z=null==Ct?void 0:Ct.shouldRender)||void 0===Z?void 0:Z.call(Ct,Ce))&&void 0!==ee&&ee,At=null===(te=null==Ct?void 0:Ct.getValue)||void 0===te?void 0:te.call(Ct,Ce),Ut=null!==(oe=null===(ne=null==Ct?void 0:Ct.getFields)||void 0===ne?void 0:ne.call(Ct,Ce))&&void 0!==oe?oe:[],Pt=null!==(ie=null==Ct?void 0:Ct.isEditDisabled)&&void 0!==ie&&ie,kt=null!==(re=null===(le=null==Ct?void 0:Ct.isSaving)||void 0===le?void 0:le.call(Ct,Ce))&&void 0!==re&&re,Rt=function(e,t){return e>=80?null==t?void 0:t.highCompletion:e>=50?null==t?void 0:t.mediumCompletion:null==t?void 0:t.lowCompletion}(null!==(ae=Ce.completion_percentage)&&void 0!==ae?ae:0,Et),_t=((D={})[O.WAITING]=null==It?void 0:It.waiting,D[O.IN_PROGRESS]=null==It?void 0:It.inProgress,D[O.GENERATED]=null==It?void 0:It.generated,D[O.FAILED]=null==It?void 0:It.failed,D[O.GENERATE]=null==It?void 0:It.generate,D[O.APPROVED]=null==It?void 0:It.approved,D),Mt=a(e(e({},structuredClone(Ce)),{value:_(Ce.value)||""})),Lt=Mt[0],jt=Mt[1],Vt=a({userStory:!!Ce.isDefaultEdit}),Gt=Vt[0],Ot=Vt[1],zt=a(!1),Ht=zt[0],Wt=zt[1],Ft=a(!1),qt=Ft[0],Qt=Ft[1],Zt=a(null),Jt=Zt[0],Kt=Zt[1],Xt=a(null),Yt=Xt[0],$t=Xt[1],en=z(),tn=en.userStory,nn=en.customIcons,on=a(null!=_e?_e:""===Ie||Te===Ce.artifactId||!!Ce.isDefaultOpen),ln=on[0],rn=on[1],an=a(!1);an[0];var sn=an[1],un=a(null),dn=un[0],cn=un[1],vn=a(null),pn=vn[0],mn=vn[1],hn=a(!1),fn=hn[0],yn=hn[1],Sn=s(null),Cn=s(null),gn=a(!1);gn[0];var In=gn[1],Nn=a(!1),bn=Nn[0],wn=Nn[1],Dn=s(null);u(function(){he&&rn(he)},[he]),u(function(){jt(e(e({},structuredClone(Ce)),{value:_(Ce.value)||""}))},[Ce]),u(function(){ft.length>0?rn(!0):void 0===_e&&(Te?rn(Te===Ce.artifactId):Ve&&Ve.length>0&&rn(Ve.includes(Ce.artifactId)))},[ft,Te,Ce.artifactId,Ve]);var En=function(){cn(null)},Bn=function(){mn(null)},xn=function(){ln&&Gt.userStory&&Cn.current&&!Cn.current.requestClose()||rn(function(e){return!e})},Tn=function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:yn(!0),n.label=1;case 1:return n.trys.push([1,,3,4]),"userStory"==="userStory"&&(ge(Lt),console.log("I am changing RTE editor values",Lt)),[4,xe(yt,tn,fe,null===(t=Dn.current)||void 0===t?void 0:t.signal)];case 2:return n.sent(),ge(e(e({},Lt),{isDefaultEdit:!1})),Ot(function(t){return e(e({},t),{userStory:!1})}),[3,4];case 3:return yn(!1),[7];case 4:return[2]}})})};var An=null!=(null==Ce?void 0:Ce.big_enough)&&!Number.isNaN(Ce.big_enough)&&!!(null==Ce?void 0:Ce.big_enough_decision_factors),Un=null!==(se=null==Ce?void 0:Ce.completion_percentage)&&void 0!==se?se:0,Pn=!!(null==Ce?void 0:Ce.completion_decision_factors),kn=""===Ie,Rn=null!=Pe?Pe:X(Ue,kn),_n=!we&&!De;return u(function(){if(Yt){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(Yt));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[Yt]),u(function(){Ce.isDefaultEdit&&Ot(function(t){return e(e({},t),{userStory:!0})})},[Ce.isDefaultEdit]),i("div",e({className:R.card,style:null==gt?void 0:gt.cardStyle,id:"story-card-".concat(Ce.title),"data-expanded":ln},{children:[i("div",e({className:R.titleSection,style:null==gt?void 0:gt.titleSection},{children:[i("div",e({className:R.titleRow,style:null==gt?void 0:gt.titleRow,onClick:xn},{children:[i("div",e({className:R.titleLeft,style:null==gt?void 0:gt.titleLeft,onMouseEnter:function(){return In(!0)},onMouseLeave:function(){return In(!1)}},{children:[Oe&&l(Y,{displayName:ye}),Ht&&_n?l(W,{title:Ce.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({},Ce),Ce.artifactId===i?t.title=o:t.sub_features=(null===(l=Ce.sub_features)||void 0===l?void 0:l.map(function(t){return t.artifactId===i?e(e({},t),{title:o}):t}))||[],jt(t),ge(t),Wt(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(o,Ce.artifactId)},onCancel:function(){Wt(!1)},inputStyle:null==Nt?void 0:Nt.inlineTitleInput,confirmButtonStyle:null==Nt?void 0:Nt.inlineTitleConfirm,cancelButtonStyle:null==Nt?void 0:Nt.inlineTitleCancel},"inline-title-editor"):i("div",e({className:R.storyTitleWrapper},{children:[l(T,e({title:K(Ce.title),arrow:!0},{children:l("h2",e({title:nt?void 0:Ce.title,className:R.storyTitle,style:null==gt?void 0:gt.storyTitle},{children:K(Ce.title)}),Ce.artifactId)})),Ke&&!Tt&&(Pn?l(q,e({customIcons:null==nn?void 0:nn.userStoryIcons,customStyles:null==gt?void 0:gt.aiReasoningCitaionStyles,currentUserStory:Ce,panelStyles:null==gt?void 0:gt.CompletionStyles,onToggleStateChange:wn},{children:i("div",e({style:e(e({display:"inline-flex",alignItems:"center",gap:"4px"},null==Et?void 0:Et.badge),Rt)},{children:[i("span",{children:[Un,"% Completed"]}),l("span",e({style:{display:"flex",alignItems:"center"}},{children:l(Q,{color:"currentColor"})})),l(bn?d:c,{size:14,style:null==Et?void 0:Et.chevronStyle})]}))})):l("div",e({style:e(e({display:"inline-flex",alignItems:"center",gap:"4px"},null==Et?void 0:Et.badge),Rt)},{children:i("span",{children:[Un,"% Completed"]})}))),He&&l("button",e({type:"button",className:R.titleEditButton,style:null==Nt?void 0:Nt.titleEditButton,onClick:function(e){e.stopPropagation(),Wt(!0),ln||rn(!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"})}))}))]}))]})),(ut||void 0!==ct&&void 0!==vt)&&i("div",e({className:R.statusContainer},{children:[void 0!==ct&&void 0!==vt&&i("div",e({className:R.completedBadge},{children:["Completed: ",ct,"/",vt]})),ut&&l("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==dt||dt()},className:R.statusButton,style:_t[ut]},{children:J[ut]}))]})),i("div",e({className:R.titleActions,style:null==gt?void 0:gt.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(Rn.showProgressPercentage||Rn.showGapBox)&&Re&&i("div",e({className:R.progressHeader,style:null==wt?void 0:wt.wrapper},{children:[Rn.showProgressPercentage&&i("div",e({className:R.progressPercentage,style:null==wt?void 0:wt.percentage},{children:[null!==(de=null!==(ue=null==Ce?void 0:Ce.confidenceScore)&&void 0!==ue?ue:null==Rn?void 0:Rn.confidenceValue)&&void 0!==de?de:"0","%"]})),Rn.showGapBox&&i("div",e({className:R.gapBox,style:null==wt?void 0:wt.gapBox},{children:[null!==(ve=null!==(ce=null==Ce?void 0:Ce.gapValue)&&void 0!==ce?ce:null==Rn?void 0:Rn.gapBoxValue)&&void 0!==ve?ve:"2"," ","Gaps"]}))]})),An&&l(H,{customIcons:null==nn?void 0:nn.userStoryIcons,customStyles:null==gt?void 0:gt.aiReasoningCitaionStyles,currentUserStory:Ce,panelStyles:null==gt?void 0:gt.BigEnoughStyles}),!Gt.userStory&&i(r,{children:[!1!==(null==Rn?void 0:Rn.showShareButton)&&l("button",e({className:R.iconButton,style:null==gt?void 0:gt.iconButton,onClick:function(e){cn(e.currentTarget)}},{children:l(v,{size:16})})),i(A,e({id:"user-story-share-menu",anchorEl:dn,open:!!dn,onClose:function(){return cn(null)},style:null==gt?void 0:gt.userStoryShareMenu},{children:[be&&l(U,e({style:null==gt?void 0:gt.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return sn(!0),Ee?[4,Promise.all([Ee("pdf"),Ee("doc")])]:[2];case 1:return e.sent(),sn(!1),[2]}})})}},{children:i("div",e({ref:Sn,className:R.menuItemContent,style:null==gt?void 0:gt.menuItemContent},{children:[l(p,{size:16,color:null==gt?void 0:gt.menuIconColor}),l("p",e({style:null==gt?void 0:gt.menuLabel},{children:"Download"}))]}))})),l(U,e({style:null==gt?void 0:gt.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){return t=Ce,Se&&(t=e(e({},Ce),{value:"".concat(L(null==Se?void 0:Se.value,Ce.title)," \n").concat(Ce.value)})),null==Be||Be(!0,[t],Ce.artifactId),En(),[2]})})}},{children:i("div",e({style:null==gt?void 0:gt.menuItemContent,className:R.menuItemContentPadded},{children:[l(m,{size:16,color:null==gt?void 0:gt.menuIconColor}),l("p",e({style:null==gt?void 0:gt.menuLabel},{children:"Send"}))]}))})),l(U,e({style:null==gt?void 0:gt.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 x.Converter,t=e.makeHtml(_(Ce.value)||Ce.value),o=function(e){var t=(new x.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(_(Ce.value)||Ce.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 En(),[7];case 5:return[2]}})})}},{children:i("div",e({style:null==gt?void 0:gt.menuItemContent,className:R.menuItemContentPadded},{children:[l(h,{size:16,color:null==gt?void 0:gt.menuIconColor}),l("p",e({style:null==gt?void 0:gt.menuLabel},{children:"Copy"}))]}))}))]}))]}),Gt.userStory&&ln?l(j,{type:"outline",children:"Cancel",style:null==gt?void 0:gt.cancelButton,onClick:function(){var t;null===(t=Dn.current)||void 0===t||t.abort(),Ot(function(t){return e(e({},t),{userStory:!1})})}}):l(r,{}),Gt.userStory&&ln?l(j,{type:"fill",children:fn?i("span",e({className:R.savingSpinner,style:null==gt?void 0:gt.savingSpinner},{children:[l(f,{className:R.spinAnimation,style:null==gt?void 0:gt.spinAnimation}),l("span",{children:"Saving..."})]})):"Save",isDisable:fn,style:fn?null==gt?void 0:gt.savingButton:null==gt?void 0:gt.saveButton,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Tn()];case 1:return e.sent(),[2]}})})}}):!we&&!De&&!et&&ln&&!1!==(null==Rn?void 0:Rn.showEditButton)&&l("button",e({className:R.iconButton,style:null==gt?void 0:gt.editButton,onClick:function(){return Ot(function(t){return e(e({},t),{userStory:!0})})}},{children:l(y,{color:null==gt?void 0:gt.pencilIconColor,size:16})})),Ye&&kn&&ln&&!we&&!De&&!1!==(null==Rn?void 0:Rn.showEditButton)&&i("button",e({type:"button",className:R.addSectionButton,style:null==Nt?void 0:Nt.addSectionButton,onClick:function(t){var n,i,l;t.stopPropagation();var r=(null!==(i=null===(n=Ce.sub_features)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+1,a={artifactId:k(),title:"New Section ".concat(r),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},s=e(e({},Ce),{sub_features:o(o([],null!==(l=Ce.sub_features)&&void 0!==l?l:[],!0),[a],!1)});jt(s),ge(s),rn(!0),$t(a.title)},"aria-label":"Add section",title:"Add section"},{children:[l(S,{size:14}),l("span",e({className:R.addSectionLabel},{children:"Add Section"}))]})),!kn&&!we&&!et&&!De&&l("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==Le||Le()},className:R.iconButton,style:null==Nt?void 0:Nt.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:l(C,{size:16})})),Tt&&l("button",e({type:"button",className:R.iconButton,disabled:Pt,onClick:function(e){if(e.stopPropagation(),qt)return Kt(null),void Qt(!1);Kt(structuredClone(null!=At?At:{})),rn(!0),Qt(!0)}},{children:l(qt?g:y,{size:16,color:null==gt?void 0:gt.pencilIconColor})})),(null==Rn?void 0:Rn.actionItemsButton)&&i(r,{children:[l("span",e({className:R.actionItemBtn,style:null==gt?void 0:gt.actionItemBtn,onClick:function(e){e.stopPropagation(),mn(e.currentTarget)}},{children:l(I,{})})),l(A,e({id:"user-story-action-menu",anchorEl:pn,open:!!pn,onClose:Bn,style:null==gt?void 0:gt.userStoryShareMenu},{children:null==Me?void 0:Me.items.map(function(t,n){return l(U,e({style:null==gt?void 0:gt.userStoryMenuItem,onClick:function(){t.onclick(Ce),Bn()}},{children:i("div",e({className:R.menuItemContent,style:e(e({},null==gt?void 0:gt.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[l("span",e({className:R.menuItemIcon,style:null==gt?void 0:gt.menuItemIcon},{children:t.icon})),l("p",e({style:null==gt?void 0:gt.menuLabel},{children:t.name})),l("span",{className:R.menuItemRight,style:null==gt?void 0:gt.menuItemRight})]}))}),"action-item-".concat(n,"-").concat(t.name))})}))]}),l("button",e({type:"button",onClick:function(e){e.stopPropagation(),xn()},style:null==gt?void 0:gt.chevronButton,className:R.chevronButton},{children:l(ln?d:c,{className:R.chevronIcon,color:null==gt?void 0:gt.chevronIconColor})}))]}))]})),l("div",{className:R.divider,style:null==gt?void 0:gt.dividerStyle})]})),ln&&l("div",e({className:R.cardContent,style:e(e({},null==gt?void 0:gt.cardContentStyle),{borderTop:Qe?"1px solid #E5E5E5":"none"})},{children:i("div",at?e({className:R.loadingContainer},{children:[l("div",e({className:R.loadingIconWrapper},{children:l(N,{size:28,color:"#5B3DF5",className:R.spinAnimation})})),i("div",{children:[l("h3",e({className:R.loadingTitle},{children:"Section generation in progress.."})),l("p",e({className:R.loadingSubtitle},{children:"This may take a few minutes"}))]}),l("button",e({type:"button",onClick:function(){return null==st?void 0:st()},className:R.viewStatusButton},{children:"View Status"}))]}):mt?e({className:R.noDataContainer,style:null==Bt?void 0:Bt.container},{children:[l("img",{src:P,alt:"No data available",className:R.noDataIllustration,style:null==Bt?void 0:Bt.illustration}),l("h3",e({className:R.noDataTitle,style:null==Bt?void 0:Bt.title},{children:"No Data Available for This Section"})),l("p",e({className:R.noDataSubtitle,style:null==Bt?void 0:Bt.subtitle},{children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."}))]}):e({className:R.contentInner,style:null==gt?void 0:gt.contentInner},{children:[i("div",e({className:R.descriptionSection,style:null==gt?void 0:gt.descriptionSection},{children:[l("div",{className:R.justifyBetween,style:null==gt?void 0:gt.justifyBetween}),Gt.userStory?l(V,{ref:Cn,minHeight:"100%",height:"100%",type:"string",value:_(Ce.value)||"",handleUpdateState:function(t,n){var o=M(n);jt(function(t){return e(e({},t),{value:o||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:Gt.userStory?"edit":"readOnly",onSaveUnsavedChanges:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Tn()];case 1:return e.sent(),rn(!1),[2]}})})},onDiscardUnsavedChanges:function(){jt(e(e({},structuredClone(Ce)),{value:_(Ce.value)||""})),Ot(function(t){return e(e({},t),{userStory:!1})}),rn(!1)},isSavingUnsavedChanges:fn}):Tt?l(F,{styles:Dt,fields:Ut,readonly:!qt,isSaving:kt,value:null!==(pe=null!=Jt?Jt:At)&&void 0!==pe?pe:{},onChange:Kt,onSave:function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return Jt?[4,null===(e=null==Ct?void 0:Ct.onSave)||void 0===e?void 0:e.call(Ct,Ce,Jt)]:[2];case 1:return t.sent(),Kt(null),Qt(!1),[2]}})})},onCancel:function(){Kt(null),Qt(!1)}}):i(r,{children:[l(G,{showUserStoryDiff:De,isParent:""===Ie,message:_(Ce.value)||"",artifactId:Ce.artifactId,customStyles:bt,isDisplayHighlightControl:Ae,contextVariant:je,showConfidenceScore:Fe,CDNeededInChip:it}),ot&&l("div",e({className:R.approveButtonContainer,style:null==xt?void 0:xt.container},{children:l("button",e({type:"button",className:R.approveButton,style:null==xt?void 0:xt.button,disabled:ot.disabled||ot.isLoading,onClick:function(e){var t;e.stopPropagation(),null===(t=null==ot?void 0:ot.onClick)||void 0===t||t.call(ot)}},{children:ot.isLoading?i(r,{children:[l(f,{size:16,className:R.spinner,style:null==xt?void 0:xt.icon}),l("span",e({style:null==xt?void 0:xt.text},{children:ot.label}))]}):i(r,{children:[l("span",e({style:null==xt?void 0:xt.text},{children:ot.label})),l(b,{size:16,style:null==xt?void 0:xt.icon})]})}))}))]})]})),null===(me=Lt.sub_features)||void 0===me?void 0:me.map(function(t,n){var i=X(Ue,!1,t.artifactId);return l($,{artifactId:fe,isUserStoryCurrentlyUpdated:he,artifactTitleId:"".concat(ye,"-").concat(String.fromCharCode(65+n)),parentUserStory:Ce,parentIndex:"".concat(Ie).concat(Ie&&".").concat(Ne),currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(t){return function(t,n){var i=o([],Ce.sub_features||[],!0);i[t]=n,ge(e(e({},Ce),{sub_features:i}))}(n,t)},enableDownload:!0,isDiffEditReviewMode:we,showUserStoryDiff:De,updateUserStoryArtifact:xe,handleDownloadUserStory:Ee,handleOpenSendDialog:Be,isDisplayHighlightControl:Ae,elementDisplayConfig:Ue,_resolvedConfig:i,actionItemsConfig:Me,onDelete:function(){return function(t){var n=(Ce.sub_features||[]).filter(function(e,n){return n!==t}),o=e(e({},Ce),{sub_features:n});jt(o),ge(o)}(n)},expandedSubFeatures:Ve,disableEditPlan:et,useMuiTooltip:nt},t.artifactId)})]}))}))]}))},ee=function(t){var n=t.artifactTitleIDs,a=t.expandedSubFeatures,s=t.isDiffEditReviewMode,u=t.showUserStoryDiff,d=t.updateUserStoryArtifact,c=t.isUserStoryCurrentlyUpdated,v=t.artifactId,p=t.handleOpenSendDialog,m=t.handleDownloadUserStory,h=t.selectedArtifactId,f=t.isDisplayHighlightControl,y=t.elementDisplayConfig,S=t.showWrapper,C=t.actionItemsConfig,g=t.contextVariant,I=t.showDisplayName,N=t.allowTitleEdit,b=t.showConfidenceScore,E=t.showBorderTop,B=t.defaultExpanded,x=t.showCompletionPanel,T=void 0!==x&&x,A=t.showAddSectionButton,U=void 0!==A&&A,P=t.disableEditPlan,k=void 0!==P&&P,_=t.useMuiTooltip,M=void 0!==_&&_,L=t.approveButtonConfig,j=t.CDNeededInChip,V=z(),G=V.userStory,O=V.setUserStory,H=V.customStyles,W=V.searchQueryList,F=V.currentHighlightIndex,q=V.setCurrentHighlightIndex;V.segmentComponentConfig;var Q=V.sectionStatusConfig,Z=null==H?void 0:H.userStoryCardStyles,J=0===F,K=F===W.length-1;return i("div",e({className:R.userStoryCardWrapper,style:f?e(e({},null==Z?void 0:Z.userStoryCardWrapper),{position:"relative"}):null==Z?void 0:Z.userStoryCardWrapper},{children:[f&&l(r,{children:W.length>0&&l("div",e({className:R.wrapper},{children:l("div",e({className:R.highlightNavigation},{children:i("div",e({className:R.navigationContainer},{children:[i("span",e({className:R.navCounter},{children:[F+1," of ",W.length]})),i("div",e({className:R.navButtons},{children:[l("button",e({onClick:function(){F>0&&q(function(e){return e-1})},className:R.navButton,disabled:J},{children:l(w,{size:20,className:R.navIcon})})),l("button",e({onClick:function(){F<W.length-1&&q(function(e){return e+1})},className:R.navButton,disabled:K},{children:l(D,{size:20,className:R.navIcon})}))]}))]}))}))}))}),G.map(function(e,t){var i=X(y,!0);return l($,{isUserStoryCurrentlyUpdated:c,artifactId:v,artifactTitleId:n[t]||"",expandedSubFeatures:a,currentUserStory:e,onUserStoryChange:function(e){O(function(n){return n[t]=e,o([],n,!0)})},parentIndex:"",currentIndex:"".concat(t+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:s,showUserStoryDiff:u,updateUserStoryArtifact:d,handleOpenSendDialog:p,handleDownloadUserStory:m,selectedArtifactId:h,isDisplayHighlightControl:f,elementDisplayConfig:y,_resolvedConfig:i,showWrapper:S,defaultExpanded:B,actionItemsConfig:C,contextVariant:g,showDisplayName:I,allowTitleEdit:N,showConfidenceScore:b,showBorderTop:E,sectionStatusConfig:Q,showCompletionPanel:T,showAddSectionButton:U,disableEditPlan:k,useMuiTooltip:M,approveButtonConfig:L,CDNeededInChip:j},e.artifactId)})]}))};export{$ as StoryCard,ee as UserStoryCardWrapper,$ as default,K as replaceLearnedTagsWithInfo};
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as n,__assign as e}from"tslib";import{jsx as i,Fragment as o,jsxs as t}from"react/jsx-runtime";import l,{createContext as r,useRef as a,useState as d,useCallback as c,useMemo as s,useEffect as u,useContext as v}from"react";import g from"react-markdown";import p from"rehype-raw";import h from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as m}from"../../shared/useMarkdownSearch.js";import{Info as f}from"lucide-react";import{Tooltip as C}from"@mui/material";import y from"dompurify";import S from"../../shared/UpdatedAnimationContent.js";import w from"../../shared/GeneratedCodeCitation.js";import I from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as b}from"../RequirementAIWrapper/RequirementAIWrapper.js";import R from"../../icons/CognitiveDecision.js";import x from"../../icons/BrainRed.js";import N,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as k}from"../ai-reasoning/AiReasoningCitation.js";import A from"../../icons/RelevanceScoreIcon.js";import j from"../RecommendationBlock/RecommendationBlock.js";import U from"../UserStoryCard/AttachedContext.js";import T from"../ai-reasoning/AiReasoningCitationContent.js";import E from"./components/InlineUpdatedComponent.js";import L from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as _}from"../../store/markdown-context.js";import M from"./components/HighlightButtonComponent.js";var P=r(!1),$=r({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),D=r({rowId:""}),H=function(n){var o,l=n.aiReason,r=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=v($),s=c.expandedInfo,u=c.setExpanded,g=c.reasonToRow,p=v(D).rowId,m=String(l.id);p&&g.current.set(m,p);var f=(null===(o=null==s?void 0:s.aiReason)||void 0===o?void 0:o.id)===l.id,C=r?(null==d?void 0:d.highConfidence)||i(R,{}):(null==d?void 0:d.lowConfidence)||i(x,{});return t("button",e({className:h.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),u(f?null:p,f?null:l)}},{children:[C,i("i",f?{className:"pi pi-angle-up ".concat(r?h.aiReasoningIconHighConfidence:h.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(r?h.aiReasoningIconHighConfidence:h.aiReasoningIconLowConfidence)})]}))},F=function(n){var o,l,r=n.children,d=n.node,c=n.customStyles,s=n.customIcons,u=a(Math.random().toString(36).slice(2)).current,g=v($).expandedInfo,p=(null==g?void 0:g.rowId)===u,m=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(l=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==l?l:void 0;return t(D.Provider,e({value:{rowId:u}},{children:[i("tr",e({style:f?{cssText:f}:void 0},{children:r})),p&&(null==g?void 0:g.aiReason)&&i("tr",e({style:{width:"100%"}},{children:i("td",e({colSpan:m||1,className:h.tableExpandedCell},{children:i("div",e({className:h.tableExpandedCellInner},{children:i("div",e({className:h.tableExpandedCellContent},{children:i(T,{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 B=["del","ins"];function O(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,B,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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(n)}).join("")})}var q=function(r){var R,x=r.message,T=r.noMarkdownContent,D=r.useMarkdown,B=void 0===D||D,q=r.isParent,z=r.scenario,V=r.showUserStoryDiff,W=void 0!==V&&V,G=r.aiReasoningsForBlock,Q=r.isCitationLoadingDisplay,J=void 0!==Q&&Q,K=r.className;r.highConfidenceIcon,r.lowConfidenceIcon;var X=r.customStyles,Y=r.customIcons,Z=r.contextVariant,nn=r.aiReasoningDiffView,en=r.userStoryCitations,on=r.artifactId,tn=r.isCraflow,ln=r.onCraAccept,rn=r.onCraReject,an=r.craFlowConfig,dn=r.isDisplayHighlightControl,cn=void 0!==dn&&dn,sn=r.showConfidenceScore,un=void 0===sn||sn,vn=r.CDNeededInChip,gn=a(null),pn=b(),hn=pn.userStory,mn=pn.inlineUpdateComponentConfig,fn=pn.getAvgScoreForStory,Cn=pn.setUserStory,yn=pn.aiReasoning,Sn=pn.setAiReasoning,wn=pn.customIcons,In=pn.searchQueryList,bn=pn.searchQueryReasoningIdList,Rn=pn.currentHighlightIndex,xn=pn.segmentComponentConfig,Nn=pn.diffEditConfig,kn=null!=Y?Y:null==wn?void 0:wn.userStoryIcons;null==X||X.searchHighlight;var An=m(gn),jn=An.search,Un=An.clear,Tn=d("1"),En=Tn[0],Ln=Tn[1],_n=d(null),Mn=_n[0],Pn=_n[1],$n=a(new Map),Dn=d(new Set),Hn=Dn[0],Fn=Dn[1],Bn=c(function(n,e){Pn(n&&e?{rowId:n,aiReason:e}:null)},[]),On=on?fn(on):0,qn=d([]),zn=qn[0],Vn=qn[1],Wn=c(function(n){Fn(function(e){var i=new Set(e);return i.has(n)?i.delete(n):i.add(n),i})},[]),Gn=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map(Gn).join(""):l.isValidElement(n)?Gn(n.props.children):""},Qn=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 l=e[0],r=l.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=l.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==r?void 0:r[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,l=0,r=c.substring(0,e.index).split("\n").reverse();l<r.length;l++){var a=r[l].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=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 l=o.match(/<table[\s\S]*?<\/table>/i);if(l){var r=btoa(encodeURIComponent(l[0]));return"<segment".concat(i,' data-table="').concat(r,'"></segment>')}return n})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(n,e,i){if(/<table[\s>]/i.test(i)){var o=btoa(encodeURIComponent(i));return"<updatedsegment".concat(e,' data-raw="').concat(o,'"></updatedsegment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,i,o,t){var l=e.substring(0,t),r=l.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+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=O(e)},Jn=s(function(){return x?Qn(x):x},[x]);u(function(){Vn(G||yn)},[G,yn]);var Kn=s(function(){return{span:function(o){var t,l,r,a,d,c=o.node,s=o.children,u=n(o,["node","children"]),v=null!==(l=null===(t=null==c?void 0:c.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==l?l:null==u?void 0:u["highlight-id"],g="string"==typeof v&&Hn.has(v),p=null!==(a=null===(r=null==c?void 0:c.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==a?a:null==u?void 0:u["highlight-color"];return i("span",e({style:e(e({},null!==(d=null==X?void 0:X.span)&&void 0!==d?d:{}),g?{backgroundColor:p||"#fef08a"}:{})},{children:s}))},button:function(e){var t,l,r,a,d,c,s=e.node;e.children;var u=n(e,["node","children"]),v=null!==(l=null===(t=null==s?void 0:s.properties)||void 0===t?void 0:t.action)&&void 0!==l?l:null==u?void 0:u.action,g=null!==(a=null===(r=null==s?void 0:s.properties)||void 0===r?void 0:r["highlight-id"])&&void 0!==a?a:null==u?void 0:u["highlight-id"],p=null!==(c=null===(d=null==s?void 0:s.properties)||void 0===d?void 0:d["highlight-type"])&&void 0!==c?c:null==u?void 0:u["highlight-type"];return"highlight"===v?i(M,{highlightId:g,handleHighlightSpan:Wn,icon:"web"===p?null==kn?void 0:kn.webCitationIcon:"doc"===p?null==kn?void 0:kn.fileCitationIcon:i(o,{}),customStyles:"web"===p?null==X?void 0:X.webButton:"doc"===p?null==X?void 0:X.docButton:{}}):null},upt:function(t){var l;t.node;var r=t.children,a=n(t,["node","children"]),d=null==a?void 0:a.id,c=d?null===(l=d.split("$"))||void 0===l?void 0:l[1]:null,s=yn.find(function(n){return n.id.toString()===c});return s?i(o,{children:i(E,e({aiReason:s,customStyles:null==X?void 0:X.inlineUpdatedComponent,handleClickCognitiveDecision:null==mn?void 0:mn.handleClickCognitiveDecision,handleClickUpdatedPill:null==mn?void 0:mn.handleClickUpdatedPill,handleClickOutputValue:null==mn?void 0:mn.handleClickOutputValue,customIcons:null==mn?void 0:mn.customIcons,CDNeededInChip:vn},{children:r}))}):r},del:function(o){var t,l,r,a;o.node;var d=o.children,c=n(o,["node","children"]),s=c.aireason,u=s&&(null===(t=s.deviation_details)||void 0===t?void 0:t.resolved)&&("rejected"===(null===(l=s.deviation_details)||void 0===l?void 0:l.resolved)||"reverted"===(null===(r=s.deviation_details)||void 0===r?void 0:r.resolved));return i("span",e({className:h.deleted,style:e(e({},null!==(a=null==X?void 0:X.deleted)&&void 0!==a?a:{}),{textDecoration:u?"none":"line-through"})},c,{onClick:c.onclick},{children:d}))},ins:function(o){var t=o.children,l=n(o,["children"]);return i("span",e({className:h.inserted,style:null==X?void 0:X.inserted},l,{onClick:l.onclick},{children:t}))},preserved:function(o){var t=o.children,l=n(o,["children"]);return i("span",e({className:h.preserved,style:null==X?void 0:X.preserved},l,{onClick:l.onclick},{children:t}))},h1:function(o){o.node;var t=n(o,["node"]);return i("h1",e({className:h.heading1,style:null==X?void 0:X.heading1},{children:t.children}))},h2:function(o){o.node;var t=n(o,["node"]);return i("h2",e({className:h.heading2,style:null==X?void 0:X.heading2},{children:t.children}))},h3:function(o){o.node;var t=n(o,["node"]);return i("h3",e({className:h.heading3,style:null==X?void 0:X.heading3},{children:t.children}))},b:function(o){o.node;var t=n(o,["node"]);return i("b",e({className:h.bold,style:null==X?void 0:X.bold},{children:null==t?void 0:t.children}))},p:function(o){o.node;var t=n(o,["node"]);return i("p",e({},t,{className:h.paragraph,style:null==X?void 0:X.paragraph},{children:t.children}))},updated:function(o){var t=o.node,l=n(o,["node"]);return i(S,e({},l,{showUserStoryDiff:W,currentUpdatedTagId:En,setCurrentUpdatedTagId:Ln,userStory:hn,setUserStory:Cn,setAiReasoning:Sn,node:t,isCraflow:tn,onCraAccept:ln,onCraReject:rn,diffEditConfig:Nn,customStyles:null==X?void 0:X.updatedContent,craFlowConfig:an}))},ol:function(o){var t,l,r,a=o.node,d=n(o,["node"]),c=null!==(r=null!==(l=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==l?l:null==d?void 0:d.start)&&void 0!==r?r:void 0;return i("ol",e({className:h.orderedList,style:null==X?void 0:X.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:h.unorderedList,style:null==X?void 0:X.ulist},{children:null==t?void 0:t.children}))},table:function(n){var o=n.children;return i("div",e({className:h.tableWrapper},{children:i("table",e({className:h.table,style:null==X?void 0:X.table},{children:o}))}))},tr:function(n){var e=n.node,o=n.children;return i(F,{node:e,children:o,customStyles:X})},td:function(o){var t,l=o.node,r=o.children,a=null!==(t=null==l?void 0:l.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:r}))}))},th:function(o){var t,l=o.node,r=o.children,a=null!==(t=null==l?void 0:l.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:r}))}))},recommendation:function(o){var t;o.node;var l=n(o,["node"]),r="The AI has selected this content based on: ".concat((null===(t=null==l?void 0:l.children)||void 0===t?void 0:t[0])||"");return i(j,e({},l,{customStyles:null==X?void 0:X.recommendationBlock,label:r}))},a:function(e){var o,t,l;e.inline;var r=e.children;e.node;var a=n(e,["inline","children","node"]),d=v(P)||"true"==(null==a?void 0:a.table),c="".concat(null==a?void 0:a.href),s=null===(o=c.split("$"))||void 0===o?void 0:o[0],u=null===(t=c.split("$"))||void 0===t?void 0:t[1];if("ai_reasoning"===s){var g=(null!==(l=W?nn:yn)&&void 0!==l?l:[]).find(function(n){return n.id.toString()===decodeURIComponent(u)}),p=bn.includes(u);if(g){if(d)return i(H,{aiReason:g,customStyle:null==X?void 0:X.tableAiReasoning,customIcons:kn,isHighConfidence:g.relevance_score>=k});var h=Gn(r),m="source"!==h.trim().toLowerCase();return i(N,{aiReason:g,isSourceHasHighlight:p,inlineLabel:h,isInlineCitation:m,customIcons:kn,customStyles:{aiReasoningContent:null==X?void 0:X.aiReasoningContent,aiReasoningAccordion:null==X?void 0:X.aiReasoningAccordion,aiReasoningMarkdown:null==X?void 0:X.aiReasoningMarkdown,aiReasoningPill:null==X?void 0:X.aiReasoningPill,webCitation:null==X?void 0:X.webCitation,stormeeCitation:null==X?void 0:X.stormeeCitation,waveformCitation:null==X?void 0:X.waveformCitation,imageCitation:null==X?void 0:X.imageCitation,fileCitation:null==X?void 0:X.fileCitation,appModCitation:null==X?void 0:X.appModCitation,rcaCitation:null==X?void 0:X.rcaCitation,readFileCitation:null==X?void 0:X.readFileCitation,loadingCitations:null==X?void 0:X.loadingCitations,chatCitation:null==X?void 0:X.chatCitation,bigEnoughCitation:null==X?void 0:X.bigEnoughCitation}})}}return null},code:function(o){o.inline;var t=o.children,l=o.className;return o.node,n(o,["inline","children","className","node"]),/language-(\w+)/.exec(l||"")||(null==l?void 0:l.includes("language-"))?i("div",{children:i("code",e({className:h.blockCode,style:null==X?void 0:X.code},{children:t}))}):i("code",e({className:h.inlineCode,style:null==X?void 0:X.code},{children:t}))},learned:function(n){var o=n.children;return i(C,e({title:o,placement:"top"},{children:i(f,{size:16,className:h.learned})}))},generatedcode:function(e){e.node;var o=n(e,["node"]),t=(null==o?void 0:o.language)||"python",l=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(w,{title:"Generated Code",code:l,language:t,customStyles:{pill:null==X?void 0:X.generatedCodePill,content:null==X?void 0:X.generatedCodeContent}})},updatedsegment:function(e){var o,t,l,r,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===(l=a.position)||void 0===l?void 0:l.end.line,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.column),u=function(n){if(!n["data-raw"])return null;try{return decodeURIComponent(atob(n["data-raw"]))}catch(n){return console.error("Error decoding segment raw content:",n),null}}(c),v=i("div",u?{dangerouslySetInnerHTML:{__html:y.sanitize(u)}}:{children:d});return i(L,{id:s,node:a,children:v,props:c,segmentComponentConfig:xn,customStyles:X,customIcons:Y,extractText:Gn,isUpdatedSegment:!0})},segment:function(e){var o,t,l,r,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===(l=a.position)||void 0===l?void 0:l.end.line,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.column);return i(L,{id:s,node:a,children:d,props:c,segmentComponentConfig:xn,customStyles:X,customIcons:Y,extractText:Gn})}}},[zn,an,yn,en,En,W,x,Y,In,bn,X,xn,Hn,Wn]);return u(function(){if(gn.current){if(In.length){var n;if(0===bn.length||cn)requestAnimationFrame(function(){jn([In[Rn].replace(/\*/g,"")])});else{var e=gn.current,i=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){jn([In[Rn].replace(/\*/g,"")])})},50)});i.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}Un()}},[In,bn,Rn,cn]),i($.Provider,e({value:{expandedInfo:Mn,setExpanded:Bn,reasonToRow:$n}},{children:t("div",e({ref:gn,className:"".concat(h.container," ").concat("approving"!==z?h.wrapper:""," ").concat(K||""),style:null==X?void 0:X.container},{children:[B?i(_,{children:i(g,e({components:Kn,rehypePlugins:[p]},{children:Jn}))}):T,On>0&&un&&i("div",e({className:h.confidenceScoreContainer,style:null==X?void 0:X.confidenceScoreContainer},{children:t("span",e({className:h.confidenceScore,style:null==X?void 0:X.confidenceScore},{children:[i(A,{size:14,color:(null==X?void 0:X.confidenceScoreIconColor)||"#166534"}),On,"%"]}))})),J&&i("div",e({className:h.citationLoader,style:null==X?void 0:X.citationLoaderContainer},{children:i(I,{customStyles:{container:null==X?void 0:X.citationLoadingContainer,icon:null==X?void 0:X.citationLoadingIcon,text:null==X?void 0:X.citationLoadingText}})})),q&&i("div",e({style:e({},null===(R=null==X?void 0:X.attachedContext)||void 0===R?void 0:R.wrapper),className:"flex mt-5"},{children:i(U,{customStyles:null==X?void 0:X.attachedContext,variant:Z})}))]}))}))};export{q as default};
|
|
1
|
+
import{__rest as n,__assign as e}from"tslib";import{jsx as i,Fragment as o,jsxs as t}from"react/jsx-runtime";import r,{createContext as l,useRef as a,useState as d,useCallback as c,useMemo as s,useEffect as u,useContext as v}from"react";import g from"react-markdown";import p from"rehype-raw";import h from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as m}from"../../shared/useMarkdownSearch.js";import{Info as f}from"lucide-react";import{Tooltip as C}from"@mui/material";import y from"dompurify";import w from"../../shared/UpdatedAnimationContent.js";import S from"../../shared/GeneratedCodeCitation.js";import I from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as b}from"../RequirementAIWrapper/RequirementAIWrapper.js";import R from"../../icons/CognitiveDecision.js";import x from"../../icons/BrainRed.js";import N,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as A}from"../ai-reasoning/AiReasoningCitation.js";import k from"../../icons/RelevanceScoreIcon.js";import j from"../RecommendationBlock/RecommendationBlock.js";import U from"../UserStoryCard/AttachedContext.js";import E from"../ai-reasoning/AiReasoningCitationContent.js";import L from"./components/InlineUpdatedComponent.js";import M from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as T}from"../../store/markdown-context.js";import _ from"./components/HighlightButtonComponent.js";var P=l(!1),$=l({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),D=l({rowId:""}),H=function(n){var o,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=v($),s=c.expandedInfo,u=c.setExpanded,g=c.reasonToRow,p=v(D).rowId,m=String(r.id);p&&g.current.set(m,p);var f=(null===(o=null==s?void 0:s.aiReason)||void 0===o?void 0:o.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||i(R,{}):(null==d?void 0:d.lowConfidence)||i(x,{});return t("button",e({className:h.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),u(f?null:p,f?null:r)}},{children:[C,i("i",f?{className:"pi pi-angle-up ".concat(l?h.aiReasoningIconHighConfidence:h.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?h.aiReasoningIconHighConfidence:h.aiReasoningIconLowConfidence)})]}))},F=function(n){var o,r,l=n.children,d=n.node,c=n.customStyles,s=n.customIcons,u=a(Math.random().toString(36).slice(2)).current,g=v($).expandedInfo,p=(null==g?void 0:g.rowId)===u,m=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==r?r:void 0;return t(D.Provider,e({value:{rowId:u}},{children:[i("tr",e({style:f?{cssText:f}:void 0},{children:l})),p&&(null==g?void 0:g.aiReason)&&i("tr",e({style:{width:"100%"}},{children:i("td",e({colSpan:m||1,className:h.tableExpandedCell},{children:i("div",e({className:h.tableExpandedCellInner},{children:i("div",e({className:h.tableExpandedCellContent},{children:i(E,{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 B=["del","ins"];function O(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,B,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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(n)}).join("")})}function V(n,e){var i=[],o=new Set(e.map(function(n){return n.toLowerCase()})),t=function(n){var e;if(null==n||"boolean"==typeof n)return null;if("string"==typeof n||"number"==typeof n)return n;if(Array.isArray(n))return n.flatMap(function(n){var e=t(n);return null==e||!1===e?[]:Array.isArray(e)?e:[e]});if(!r.isValidElement(n))return n;var l="string"==typeof n.type?n.type.toLowerCase():"";if(o.has(l))return i.push(n),null;var a=r.Children.toArray(null===(e=n.props)||void 0===e?void 0:e.children).flatMap(function(n){var e=t(n);return null==e||!1===e?[]:Array.isArray(e)?e:[e]});return r.cloneElement(n,n.props,a)};return{cleanedChildren:t(n),extractedNodes:i}}var q=function(l){var R,x=l.message,E=l.noMarkdownContent,D=l.useMarkdown,B=void 0===D||D,q=l.isParent,z=l.scenario,W=l.showUserStoryDiff,G=void 0!==W&&W,Q=l.aiReasoningsForBlock,J=l.isCitationLoadingDisplay,K=void 0!==J&&J,X=l.className;l.highConfidenceIcon,l.lowConfidenceIcon;var Y=l.customStyles,Z=l.customIcons,nn=l.contextVariant,en=l.aiReasoningDiffView,on=l.userStoryCitations,tn=l.artifactId,rn=l.isCraflow,ln=l.onCraAccept,an=l.onCraReject,dn=l.craFlowConfig,cn=l.isDisplayHighlightControl,sn=void 0!==cn&&cn,un=l.showConfidenceScore,vn=void 0===un||un,gn=l.CDNeededInChip,pn=a(null),hn=b(),mn=hn.userStory,fn=hn.inlineUpdateComponentConfig,Cn=hn.getAvgScoreForStory,yn=hn.setUserStory,wn=hn.aiReasoning,Sn=hn.setAiReasoning,In=hn.customIcons,bn=hn.searchQueryList,Rn=hn.searchQueryReasoningIdList,xn=hn.currentHighlightIndex,Nn=hn.segmentComponentConfig,An=hn.diffEditConfig,kn=null!=Z?Z:null==In?void 0:In.userStoryIcons;null==Y||Y.searchHighlight;var jn=m(pn),Un=jn.search,En=jn.clear,Ln=d("1"),Mn=Ln[0],Tn=Ln[1],_n=d(null),Pn=_n[0],$n=_n[1],Dn=a(new Map),Hn=d(new Set),Fn=Hn[0],Bn=Hn[1],On=c(function(n,e){$n(n&&e?{rowId:n,aiReason:e}:null)},[]),Vn=tn?Cn(tn):0,qn=d([]),zn=qn[0],Wn=qn[1],Gn=c(function(n){Bn(function(e){var i=new Set(e);return i.has(n)?i.delete(n):i.add(n),i})},[]),Qn=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map(Qn).join(""):r.isValidElement(n)?Qn(n.props.children):""},Jn=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=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(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(n,e,i){if(/<table[\s>]/i.test(i)){var o=btoa(encodeURIComponent(i));return"<updatedsegment".concat(e,' data-raw="').concat(o,'"></updatedsegment>')}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=O(e)},Kn=s(function(){return x?Jn(x):x},[x]);u(function(){Wn(Q||wn)},[Q,wn]);var Xn=s(function(){return{span:function(o){var t,r,l,a,d,c=o.node,s=o.children,u=n(o,["node","children"]),v=null!==(r=null===(t=null==c?void 0:c.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==r?r:null==u?void 0:u["highlight-id"],g="string"==typeof v&&Fn.has(v),p=null!==(a=null===(l=null==c?void 0:c.properties)||void 0===l?void 0:l["highlight-color"])&&void 0!==a?a:null==u?void 0:u["highlight-color"];return i("span",e({style:e(e({},null!==(d=null==Y?void 0:Y.span)&&void 0!==d?d:{}),g?{backgroundColor:p||"#fef08a"}:{})},{children:s}))},button:function(e){var t,r,l,a,d,c,s=e.node;e.children;var u=n(e,["node","children"]),v=null!==(r=null===(t=null==s?void 0:s.properties)||void 0===t?void 0:t.action)&&void 0!==r?r:null==u?void 0:u.action,g=null!==(a=null===(l=null==s?void 0:s.properties)||void 0===l?void 0:l["highlight-id"])&&void 0!==a?a:null==u?void 0:u["highlight-id"],p=null!==(c=null===(d=null==s?void 0:s.properties)||void 0===d?void 0:d["highlight-type"])&&void 0!==c?c:null==u?void 0:u["highlight-type"];return"highlight"===v?i(_,{highlightId:g,handleHighlightSpan:Gn,icon:"web"===p?null==kn?void 0:kn.webCitationIcon:"doc"===p?null==kn?void 0:kn.fileCitationIcon:i(o,{}),customStyles:"web"===p?null==Y?void 0:Y.webButton:"doc"===p?null==Y?void 0:Y.docButton:{}}):null},upt:function(t){var r;t.node;var l=t.children,a=n(t,["node","children"]),d=null==a?void 0:a.id,c=d?null===(r=d.split("$"))||void 0===r?void 0:r[1]:null,s=wn.find(function(n){return n.id.toString()===c});return s?i(o,{children:i(L,e({aiReason:s,customStyles:null==Y?void 0:Y.inlineUpdatedComponent,handleClickCognitiveDecision:null==fn?void 0:fn.handleClickCognitiveDecision,handleClickUpdatedPill:null==fn?void 0:fn.handleClickUpdatedPill,handleClickOutputValue:null==fn?void 0:fn.handleClickOutputValue,customIcons:null==fn?void 0:fn.customIcons,CDNeededInChip:gn},{children:l}))}):l},del:function(r){var l,a,d,c;r.node;var s=r.children,u=n(r,["node","children"]),v=u.aireason,g=v&&(null===(l=v.deviation_details)||void 0===l?void 0:l.resolved)&&("rejected"===(null===(a=v.deviation_details)||void 0===a?void 0:a.resolved)||"reverted"===(null===(d=v.deviation_details)||void 0===d?void 0:d.resolved)),p=V(s,["ins"]),m=p.cleanedChildren,f=p.extractedNodes;return t(o,{children:[i("span",e({className:h.deleted,style:e(e({},null!==(c=null==Y?void 0:Y.deleted)&&void 0!==c?c:{}),{textDecoration:g?"none":"line-through"})},u,{onClick:u.onclick},{children:m})),f]})},ins:function(r){var l=r.children,a=n(r,["children"]),d=V(l,["del"]),c=d.cleanedChildren,s=d.extractedNodes;return t(o,{children:[i("span",e({className:h.inserted,style:null==Y?void 0:Y.inserted},a,{onClick:a.onclick},{children:c})),s]})},preserved:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:h.preserved,style:null==Y?void 0:Y.preserved},r,{onClick:r.onclick},{children:t}))},h1:function(o){o.node;var t=n(o,["node"]);return i("h1",e({className:h.heading1,style:null==Y?void 0:Y.heading1},{children:t.children}))},h2:function(o){o.node;var t=n(o,["node"]);return i("h2",e({className:h.heading2,style:null==Y?void 0:Y.heading2},{children:t.children}))},h3:function(o){o.node;var t=n(o,["node"]);return i("h3",e({className:h.heading3,style:null==Y?void 0:Y.heading3},{children:t.children}))},b:function(o){o.node;var t=n(o,["node"]);return i("b",e({className:h.bold,style:null==Y?void 0:Y.bold},{children:null==t?void 0:t.children}))},p:function(o){o.node;var t=n(o,["node"]);return i("p",e({},t,{className:h.paragraph,style:null==Y?void 0:Y.paragraph},{children:t.children}))},updated:function(o){var t=o.node,r=n(o,["node"]);return i(w,e({},r,{showUserStoryDiff:G,currentUpdatedTagId:Mn,setCurrentUpdatedTagId:Tn,userStory:mn,setUserStory:yn,setAiReasoning:Sn,node:t,isCraflow:rn,onCraAccept:ln,onCraReject:an,diffEditConfig:An,customStyles:null==Y?void 0:Y.updatedContent,craFlowConfig:dn}))},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:h.orderedList,style:null==Y?void 0:Y.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:h.unorderedList,style:null==Y?void 0:Y.ulist},{children:null==t?void 0:t.children}))},table:function(n){var o=n.children;return i("div",e({className:h.tableWrapper},{children:i("table",e({className:h.table,style:null==Y?void 0:Y.table},{children:o}))}))},tr:function(n){var e=n.node,o=n.children;return i(F,{node:e,children:o,customStyles:Y})},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(j,e({},r,{customStyles:null==Y?void 0:Y.recommendationBlock,label:l}))},a:function(e){var o,t,r;e.inline;var l=e.children;e.node;var a=n(e,["inline","children","node"]),d=v(P)||"true"==(null==a?void 0:a.table),c="".concat(null==a?void 0:a.href),s=null===(o=c.split("$"))||void 0===o?void 0:o[0],u=null===(t=c.split("$"))||void 0===t?void 0:t[1];if("ai_reasoning"===s){var g=(null!==(r=G?en:wn)&&void 0!==r?r:[]).find(function(n){return n.id.toString()===decodeURIComponent(u)}),p=Rn.includes(u);if(g){if(d)return i(H,{aiReason:g,customStyle:null==Y?void 0:Y.tableAiReasoning,customIcons:kn,isHighConfidence:g.relevance_score>=A});var h=Qn(l),m="source"!==h.trim().toLowerCase();return i(N,{aiReason:g,isSourceHasHighlight:p,inlineLabel:h,isInlineCitation:m,customIcons:kn,customStyles:{aiReasoningContent:null==Y?void 0:Y.aiReasoningContent,aiReasoningAccordion:null==Y?void 0:Y.aiReasoningAccordion,aiReasoningMarkdown:null==Y?void 0:Y.aiReasoningMarkdown,aiReasoningPill:null==Y?void 0:Y.aiReasoningPill,webCitation:null==Y?void 0:Y.webCitation,stormeeCitation:null==Y?void 0:Y.stormeeCitation,waveformCitation:null==Y?void 0:Y.waveformCitation,imageCitation:null==Y?void 0:Y.imageCitation,fileCitation:null==Y?void 0:Y.fileCitation,appModCitation:null==Y?void 0:Y.appModCitation,rcaCitation:null==Y?void 0:Y.rcaCitation,readFileCitation:null==Y?void 0:Y.readFileCitation,loadingCitations:null==Y?void 0:Y.loadingCitations,chatCitation:null==Y?void 0:Y.chatCitation,bigEnoughCitation:null==Y?void 0:Y.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:h.blockCode,style:null==Y?void 0:Y.code},{children:t}))}):i("code",e({className:h.inlineCode,style:null==Y?void 0:Y.code},{children:t}))},learned:function(n){var o=n.children;return i(C,e({title:o,placement:"top"},{children:i(f,{size:16,className:h.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(S,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==Y?void 0:Y.generatedCodePill,content:null==Y?void 0:Y.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),u=function(n){if(!n["data-raw"])return null;try{return decodeURIComponent(atob(n["data-raw"]))}catch(n){return console.error("Error decoding segment raw content:",n),null}}(c),v=i("div",u?{dangerouslySetInnerHTML:{__html:y.sanitize(u)}}:{children:d});return i(M,{id:s,node:a,children:v,props:c,segmentComponentConfig:Nn,customStyles:Y,customIcons:Z,extractText:Qn,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(M,{id:s,node:a,children:d,props:c,segmentComponentConfig:Nn,customStyles:Y,customIcons:Z,extractText:Qn})}}},[zn,dn,wn,on,Mn,G,x,Z,bn,Rn,Y,Nn,Fn,Gn]);return u(function(){if(pn.current){if(bn.length){var n;if(0===Rn.length||sn)requestAnimationFrame(function(){Un([bn[xn].replace(/\*/g,"")])});else{var e=pn.current,i=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){Un([bn[xn].replace(/\*/g,"")])})},50)});i.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}En()}},[bn,Rn,xn,sn]),i($.Provider,e({value:{expandedInfo:Pn,setExpanded:On,reasonToRow:Dn}},{children:t("div",e({ref:pn,className:"".concat(h.container," ").concat("approving"!==z?h.wrapper:""," ").concat(X||""),style:null==Y?void 0:Y.container},{children:[B?i(T,{children:i(g,e({components:Xn,rehypePlugins:[p]},{children:Kn}))}):E,Vn>0&&vn&&i("div",e({className:h.confidenceScoreContainer,style:null==Y?void 0:Y.confidenceScoreContainer},{children:t("span",e({className:h.confidenceScore,style:null==Y?void 0:Y.confidenceScore},{children:[i(k,{size:14,color:(null==Y?void 0:Y.confidenceScoreIconColor)||"#166534"}),Vn,"%"]}))})),K&&i("div",e({className:h.citationLoader,style:null==Y?void 0:Y.citationLoaderContainer},{children:i(I,{customStyles:{container:null==Y?void 0:Y.citationLoadingContainer,icon:null==Y?void 0:Y.citationLoadingIcon,text:null==Y?void 0:Y.citationLoadingText}})})),q&&i("div",e({style:e({},null===(R=null==Y?void 0:Y.attachedContext)||void 0===R?void 0:R.wrapper),className:"flex mt-5"},{children:i(U,{customStyles:null==Y?void 0:Y.attachedContext,variant:nn})}))]}))}))};export{q as default};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import{createContext as t,
|
|
1
|
+
import{__assign as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import{createContext as t,useContext as o,useState as n}from"react";var i=t(void 0),f=function(t){var o=t.children,f=n(null),u=f[0],m=f[1];return e(i.Provider,r({value:{contentRef:u,setContentRef:m}},{children:o}))},u=function(){var r=o(i);if(!r)throw new Error("useRefStore must be used inside RefProvider");return r};export{f as RefProvider,u as useRefStore};
|
|
2
2
|
//# sourceMappingURL=ref.context.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
interface TextEditorProps {
|
|
2
3
|
type: "string" | "html";
|
|
3
4
|
value: string;
|
|
@@ -8,8 +9,14 @@ interface TextEditorProps {
|
|
|
8
9
|
height: string;
|
|
9
10
|
mode: TMode;
|
|
10
11
|
doNotShowBorderInViewMode?: boolean;
|
|
12
|
+
onSaveUnsavedChanges?: () => void | Promise<void>;
|
|
13
|
+
onDiscardUnsavedChanges?: () => void;
|
|
14
|
+
isSavingUnsavedChanges?: boolean;
|
|
11
15
|
}
|
|
12
16
|
export type TMode = "readOnly" | "edit";
|
|
13
|
-
|
|
17
|
+
export interface RichTextEditorHandle {
|
|
18
|
+
requestClose: () => boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const RichTextEditor: import("react").ForwardRefExoticComponent<TextEditorProps & import("react").RefAttributes<RichTextEditorHandle>>;
|
|
14
21
|
export default RichTextEditor;
|
|
15
22
|
//# sourceMappingURL=RichTextEditor.d.ts.map
|
package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/RichTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/RichTextEditor/RichTextEditor.tsx"],"names":[],"mappings":";AAoCA,UAAU,eAAe;IACvB,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,KAAK,CAAC;IACZ,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,oBAAoB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,MAAM,KAAK,GAAG,UAAU,GAAG,MAAM,CAAA;AAEvC,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,OAAO,CAAC;CAC7B;AAKD,QAAA,MAAM,cAAc,kHAoQlB,CAAC;AAIH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface UnsavedChangesPopupProps {
|
|
2
|
+
isSaving?: boolean;
|
|
3
|
+
onSave: () => void | Promise<void>;
|
|
4
|
+
onDiscard: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const UnsavedChangesPopup: ({ isSaving, onSave, onDiscard, }: UnsavedChangesPopupProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default UnsavedChangesPopup;
|
|
8
|
+
//# sourceMappingURL=UnsavedChangesPopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsavedChangesPopup.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UnsavedChangesPopup/UnsavedChangesPopup.tsx"],"names":[],"mappings":"AAGA,UAAU,wBAAwB;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,SAAS,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,mBAAmB,qCAI7B,wBAAwB,4CAwC1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map
CHANGED
|
@@ -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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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"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"}
|