@viswa-test/test-citation 0.0.250 → 0.0.252
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/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/helper.js +2 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/helper.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/utils/helper.js +2 -0
- package/dist/features/CognitiveCompare/Guidelines/utils/helper.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/types/src/RedlineEditorTest2.d.ts +3 -0
- package/dist/types/src/RedlineEditorTest2.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/helper.d.ts +11 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/helper.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts +8 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts +3047 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/methodsToExpose.d.ts +1 -1
- package/dist/types/src/service/ProjectService.d.ts +2 -2
- package/dist/types/src/service/SavedDataSetService.d.ts +3 -3
- package/package.json +2 -2
- package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts +0 -23
- package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts.map +0 -1
- package/dist/types/src/Background.d.ts +0 -7
- package/dist/types/src/Background.d.ts.map +0 -1
- package/dist/types/src/constants/deviationData.d.ts +0 -887
- package/dist/types/src/constants/deviationData.d.ts.map +0 -1
- package/dist/types/src/constants/treeData.d.ts +0 -732
- package/dist/types/src/constants/treeData.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts +0 -8
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i,Fragment as a}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as e,jsx as i,Fragment as a}from"react/jsx-runtime";import t,{memo as n,useMemo as c}from"react";import l from"../Popups/PopupDefaults.js";import r from"react-markdown";import o from"rehype-raw";import s from"./CitationComponent.module.css.js";import{ChevronUp as d}from"lucide-react";import{ReactComponent as m}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as p}from"../icons/aiMagic.svg.js";import u from"./CitationAnchor.js";import{AiReasonMarkdownWrapper as h}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";import{resolveRedline as v}from"../../../../../service/redlineService.js";import{useRequirementAI as _}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import g from"../cws/CwsEvent.js";const y=(e="")=>e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"),N=(e,i)=>{const a=e.match(new RegExp(`${i}=(["'])(.*?)\\1`,"i"));return(null==a?void 0:a[2])||""},f=(e,i)=>{const a=[...e.matchAll(/<a\b((?:[^>"']|"[^"]*"|'[^']*')*)>([\s\S]*?)<\/a>/gi)].map(e=>{var i;return{fullMatch:e[0],attributes:e[1],label:e[2],index:null!==(i=e.index)&&void 0!==i?i:0}}),t=a.find(e=>{return i=e.attributes,N(i,"href").startsWith("pdf_citation$");var i}),n=a.find(e=>{return i=e.attributes,N(i,"href").includes("gpt_citation")||i.includes("phrase_to_highlight=");var i});if(!t||!n)return e;const c=((e,i,a,t,n)=>{const c=N(a,"href"),l=N(a,"type")||(c.includes("gpt_citation")?"gpt_citation":""),r=N(a,"reason"),o=c.split("?")[1]||"",s=o&&new URLSearchParams(o).get("phrase_to_highlight")||"",d=c.includes("gpt_citation")&&void 0!==n?` data-secondary-occurrence-index="${n}"`:"";return`<a${e} data-dual-citation="true" data-secondary-href="${y(c)}" data-secondary-type="${y(l)}" data-secondary-title="${y(t)}" data-secondary-reason="${y(r)}" data-secondary-phrase-to-highlight="${y(s)}"${d}>${i}</a>`})(t.attributes,t.label,n.attributes,n.label,N(n.attributes,"href").includes("gpt_citation")?i():void 0),l=(n.index>t.index?e.slice(t.index+t.fullMatch.length,n.index):e.slice(n.index+n.fullMatch.length,t.index)).trim()?n.label:"";return e.replace(t.fullMatch,c).replace(n.fullMatch,l)},b=(e,i)=>{var a,t;const n=i.replace(/-([a-z])/g,(e,i)=>i.toUpperCase());return null!==(t=null!==(a=null==e?void 0:e[i])&&void 0!==a?a:null==e?void 0:e[n])&&void 0!==t?t:""},x=({text:e,item:a})=>{const t=c(()=>(e=>{let i=0;const a=()=>i++;return e.split("\n").map(e=>f(e,a)).join("\n")})(e),[e]);return i(r,{rehypePlugins:[o],components:{ol:({children:e})=>i("ol",{className:s["md-ol"],children:e}),ul:({children:e})=>i("ul",{className:s["md-ul"],children:e}),li:({children:e})=>i("li",{className:s["md-li"],children:e}),a:({node:e,href:t,children:n})=>{const c=(null==e?void 0:e.properties)||{},l=b(c,"data-secondary-href");return i(u,{href:t,children:n,secondaryCitation:l?{href:l,title:b(c,"data-secondary-title"),type:b(c,"data-secondary-type"),reason:b(c,"data-secondary-reason"),phraseToHighlight:b(c,"data-secondary-phrase-to-highlight"),occurrenceIndex:Number(b(c,"data-secondary-occurrence-index")||0)}:void 0,metaData:{citations:a.citations,docData:a.docData,guidelinesData:a.guidelinesData,gptCitations:a.gptCitations}})}},children:t.replace(/<br\s*\/?>/gi,"\n")})},I=({text:e,markdownStyles:a,citationStyles:t,customIcons:n})=>i(h,{message:e.replace(/<br\s*\/?>/gi,"\n"),customStyles:a,citationStyles:t,customIcons:n});var C=n(function({item:n,title:r="Cognitive Decisioning AI",relevanceScore:o=0,showRelevanceScore:u=!0,reason:h="No reasoning provided.",impact:y="No Impact provided.",explaination:N="No explaination provided.",gap:f="None",onClose:b=()=>{},onActionTrigger:C,showResolveBtns:$=!1,sections:k,leftIcon:S,scoreIcon:A,className:w,customStyles:R={},markdownStyles:j,citationStyles:D,customIcons:H,actions:B,disableAllActions:T=!1,actionBtnDisabledStyle:M={},onBackClick:L,isImpactNeeded:P=!0,cognitiveTitle:E="Cognitive Integrity",labels:q={},chatHistory:U,openInFullscreenOnClick:W=!1,redlineId:F,aiReasonId:G}){const z=c(()=>{const e=Number(o);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[o]),O=c(()=>{const e=q&&q.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const i=e.trim().toLowerCase();return"none"===i||"no gap"===i||"no gaps"===i||"n/a"===i})(f)?e:f},[f]),J=q&&q.impact||"Impact",K=q&&q.explanation||"Explaination",Q=q&&q.decisionFactors||"Decision Making Factors",V=q&&q.gaps||"Gaps in Decision",X=q&&q.accept||"Accept",Y=q&&q.reject||"Reject",Z=q&&q.backAriaLabel||"Go back",{redlineDcoumentId:ee,redlineConfig:ie,updateRedlineDataParent:ae}=_(),te=async e=>{var i,a,t,n,c,l;null==C||C({status:"loading",action:e,metadata:{redlineId:F,aiReasonId:G}});try{const{updated_reqai:r}=await v({documentId:ee,userEmail:null==ie?void 0:ie.userEmail,userName:null==ie?void 0:ie.userName,redlineId:null!=F?F:"",action:e,baseApiUrl:null==ie?void 0:ie.baseApiUrl,redlineConfigId:null!==(i=null==ie?void 0:ie.redlineConfigId)&&void 0!==i?i:""},null!==(a=null==ie?void 0:ie.token)&&void 0!==a?a:"");await(null==ae?void 0:ae(r)),null===(t=g.emit)||void 0===t||t.call(g,`redline-edit:${ee}:${null===(l=null===(c=null===(n=null==r?void 0:r.artifactData)||void 0===n?void 0:n.userStorySnapshot)||void 0===c?void 0:c[0])||void 0===l?void 0:l.artifactId}`,{updatedBy:null==ie?void 0:ie.userName}),null==C||C({status:"success",action:e,metadata:{redlineId:F,aiReasonId:G}})}catch(i){null==C||C({status:"failed",action:e,metadata:{redlineId:F,aiReasonId:G}})}},ne=B||[{id:"reject",label:Y,onClick:()=>te("reject"),className:s["btn-reject"]},{id:"accept",label:X,onClick:()=>te("accept"),className:s["btn-accept"]}],ce=U&&U.length>0;return e("div",{className:`${s["cite-acc"]} ${w||""}`,style:{...l.CitationAccordionDefaults.container,...null==R?void 0:R.container},children:[L&&e("div",{className:s["cite-acc__backHeader"],children:[i("button",{type:"button",className:s["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),L&&L()},"aria-label":Z,children:"‹"}),i("span",{className:s["cite-acc__backTitle"],children:E})]}),i("div",{className:s["cite-body"],children:k&&k.length>0?k.map(a=>!1===a.show?null:e("div",{className:`${s["cite-acc__explain-body"]} ${a.bodyClassName||""}`,children:[e("div",{className:s["cite-acc__innerHeader"],style:{...l.CitationAccordionDefaults.innerHeader,...null==R?void 0:R.innerHeader},children:[i("div",{className:s["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:s["cite-acc__innerTitle"],children:a.title})})}),i("button",{type:"button",onClick:e=>{e.stopPropagation(),b&&b()},children:i(d,{})})]}),i("div",{className:`${s["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...l.CitationAccordionDefaults.innerBody,...null==R?void 0:R.innerBody},children:"string"==typeof a.content?i(x,{text:a.content,item:a.item||n||{}}):a.content})]},a.id||a.title)):e(a,{children:[P&&e("div",{className:s["cite-acc__explain-body"],children:[e("div",{className:s["cite-acc__innerHeader"],children:[i("div",{className:s["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:s["cite-acc__innerTitle"],children:J})})}),i("button",{type:"button",onClick:e=>{e.stopPropagation(),b&&b()},children:i(d,{})})]}),i("div",{className:`${s["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(x,{text:y||"",item:n||{}})})]}),N&&"No explaination provided."!==N&&e(a,{children:[e("div",{className:s["cite-acc__explain-body"],children:[i("div",{className:s["cite-acc__innerHeader"],children:i("div",{className:s["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:s["cite-acc__innerTitle"],children:K})})})}),i("div",{className:`${s["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(x,{text:N||"",item:{}})})]}),i("div",{style:{borderTop:"1px solid #e5e7eb",margin:"12px 0"}}),$&&i("div",{className:s["cite-acc__btn-container"],children:ne.map(e=>{const a=T||e.disabled;return i("button",{className:e.className,onClick:a?void 0:e.onClick,disabled:a,style:{...e.style,...a?{opacity:.5,cursor:"not-allowed",...M,...e.disabledStyle}:{}},children:e.label},e.id)})})]}),e("div",{className:s["cite-acc__header"],children:[e("div",{className:s["cite-acc__headerLeft"],children:[i("span",{className:s["cite-acc__titleIcon"],children:S?"function"==typeof S?t.createElement(S):S:i(m,{})}),i("div",{className:s["cite-acc__title"],children:r})]}),i("div",{className:s["cite-acc__headerRight"],children:u&&e("span",{className:s["cite-acc__scoreBadge"],children:[A?"function"==typeof A?t.createElement(A):A:i(p,{}),e("span",{className:s["cite-acc__scoreText"],children:[z,"%"]})]})})]}),e("div",{className:s["cite-acc__explain-body"],children:[i("div",{className:s["cite-acc__innerHeader"],children:i("div",{className:s["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:s["cite-acc__innerTitle"],children:Q})})})}),i("div",{className:`${s["cite-acc__innerBody"]} text-sm text-gray-600`,children:ce?i(I,{text:h||"",markdownStyles:j,citationStyles:D,customIcons:H}):i(x,{text:h||"",item:n||{}})})]}),e("div",{className:`${s["cite-acc__explain-body"]} ${s["cite-acc__explain-body_border"]}`,children:[i("div",{className:s["cite-acc__innerHeader"],children:i("div",{className:s["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:s["cite-acc__innerTitle"],children:V})})})}),i("div",{className:`${s["cite-acc__innerBody"]} text-sm text-gray-600`,children:ce?i(I,{text:O||"",markdownStyles:j,citationStyles:D,customIcons:H}):i(x,{text:O||"",item:n||{}})})]})]})})]})},(e,i)=>e.disableAllActions===i.disableAllActions&&(e.redlineId===i.redlineId&&(e.aiReasonId===i.aiReasonId&&(e.relevanceScore===i.relevanceScore&&(e.reason===i.reason&&(e.impact===i.impact&&(e.explaination===i.explaination&&e.gap===i.gap)))))));export{C as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
1
|
+
import{jsxs as e,jsx as n}from"react/jsx-runtime";import{X as r}from"lucide-react";function o({title:o,children:t,onRefresh:i,onCancel:d}){return e("div",{style:{width:360,background:"#fff",borderRadius:12,border:"1px solid #e5e7eb",boxShadow:"0 10px 30px rgba(0, 0, 0, 0.12)",padding:12,fontFamily:"Inter"},children:[d&&e("div",{style:{display:"flex",justifyContent:o?"space-between":"flex-end",alignItems:"center"},children:[o&&n("span",{style:{fontSize:14,color:"#374151"},children:o}),n("button",{onClick:d,style:{border:"none",background:"transparent",cursor:"pointer",fontSize:15,color:"#6b7280"},children:n(r,{})})]}),n("div",{style:{fontSize:14,color:"#374151",lineHeight:1.6,marginBottom:5},children:t}),n("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:i&&n("button",{onClick:i,style:{padding:"8px",borderRadius:8,border:"none",background:"#2563eb",color:"#fff",cursor:"pointer",fontSize:16},children:"Refresh"})})]})}export{o as default};
|
|
2
2
|
//# sourceMappingURL=RedlineToast.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as i}from"react";import{ChevronUp as a,ChevronDown as s,Users as r,ExternalLink as d,Download as u,Share2 as c,Copy as v,LoaderCircle as p,PencilIcon as m,RefreshCw as h,Plus as y,Trash2 as g,X as f,Ellipsis as C,Hourglass as S,Check as I,ChevronUpIcon as b,ChevronDownIcon as w,Info as N,Bookmark as E}from"lucide-react";import D from"showdown";import{Tooltip as B,Menu as A,MenuItem as T}from"@mui/material";import x from"../../icons/Illustration.svg.js";import{v4 as U}from"uuid";import k from"./UserStoryCard.module.css.js";import{formatMarkdown as P,indentMarkdown as R}from"../../utils/helpers.js";import{replaceTitleSection as _,postprocessUserStoryAfterEdit as M}from"../../utils/user-story.utils.js";import W from"../../shared/AtomicButton.js";import L from"../RichTextEditor/RichTextEditor.js";import j from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as $,useRequirementAI as O,ToasterId as z}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as V}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as G}from"./TitleEditor/TitleEditor.js";import{fetchRedlineDocumentSection as F,updateRedlineDocument as H,getRedlineDocumentId as q,createRedlineDocument as Y}from"../../../../service/redlineService.js";import Q from"./ClinicalTrialSection.js";import{CompletionPanel as Z}from"../story-screen/CompletionPanel.js";import J from"../../icons/CDIcon.js";import K from"./cws/CwsEvent.js";import X from"./cws/useCwsEvent.js";import ee from"react-hot-toast";import te from"./Popups/RedlineToast.js";const le={[$.WAITING]:"WAITING TO GENERATE",[$.IN_PROGRESS]:"IN PROGRESS",[$.GENERATED]:"GENERATED",[$.FAILED]:"FAILED",[$.GENERATE]:"GENERATE",[$.APPROVED]:"APPROVED"};function ne(e){const l=[],n=/<learned>(.*?)<\/learned>/g;let o,i=0,a=0;for(;null!==(o=n.exec(e));){const[,s]=o,r=o.index;r>i&&l.push(t("span",{children:e.slice(i,r)},"text-pre-"+a++)),l.push(t(B,{title:s,placement:"top",children:t(N,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${U()}`)),i=n.lastIndex}return i<(null==e?void 0:e.length)&&l.push(t("span",{children:e.slice(i)},"text-post-"+a++)),l}function oe(e,t,l){var n;if(!e)return{};if(t)return{...e.parentConfig};const o={...e.childConfig};return l&&(null===(n=e.subFeatureOverrides)||void 0===n?void 0:n[l])?{...o,...e.subFeatureOverrides[l]}:o}const ie=({displayName:l})=>{var n;const{customStyles:o}=O(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e("div",{className:k.displayName,style:null==i?void 0:i.wrapper,children:[t(E,{className:k.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e("span",{style:null==i?void 0:i.label,children:[l,":"]})]})},ae=({isUserStoryCurrentlyUpdated:b,artifactId:w,artifactTitleId:N,parentUserStory:E,currentUserStory:q,onUserStoryChange:Y,parentIndex:se,currentIndex:re,enableDownload:de,isDiffEditReviewMode:ue,showUserStoryDiff:ce,handleDownloadUserStory:ve,handleOpenSendDialog:pe,updateUserStoryArtifact:me,selectedArtifactId:he,isDisplayHighlightControl:ye,elementDisplayConfig:ge,_resolvedConfig:fe,showWrapper:Ce=!1,defaultExpanded:Se,actionItemsConfig:Ie,onDelete:be,contextVariant:we,expandedSubFeatures:Ne,showDisplayName:Ee=!0,allowTitleEdit:De=!0,showConfidenceScore:Be=!0,showBorderTop:Ae=!0,sectionStatusConfig:Te,showCompletionPanel:xe=!1,completionPanelConfig:Ue,showAddSectionButton:ke=!1,disableEditPlan:Pe=!1,useMuiTooltip:Re=!1,approveButtonConfig:_e,editButtonConfig:Me,CDNeededInChip:We,blockNumber:Le,showWaitingIconInChip:je,showAssignSection:$e=!1,disableAssignSection:Oe=!1,onAssignSectionClick:ze})=>{var Ve,Ge,Fe,He,qe,Ye,Qe,Ze,Je,Ke,Xe,et,tt,lt,nt,ot,it,at,st,rt,dt,ut,ct,vt;const{isLoadingSectionData:pt=!1,onLoadSectionData:mt,status:ht,onStatusClick:yt,completedCount:gt,totalCount:ft,isNoDataAvailable:Ct=!1}=null!=Te?Te:{},{searchQueryList:St,citations:It,customStyles:bt,onEditBlocked:wt,redlineDcoumentId:Nt,redlineConfig:Et,customSectionConfig:Dt,updateRedlineDataParent:Bt,aiReasoning:At,redlineCollaborativeConfig:Tt}=O(),xt=null==bt?void 0:bt.userStoryCardStyles,Ut=null==xt?void 0:xt.customSectionEditButton,kt=null==xt?void 0:xt.statusStyles,Pt=null===(Ve=null==bt?void 0:bt.userStoryCardStyles)||void 0===Ve?void 0:Ve.userStoryEditStyles,Rt=null===(Ge=null==bt?void 0:bt.userStoryScreenStyles)||void 0===Ge?void 0:Ge.userStoryContentStyles,_t=null==xt?void 0:xt.progressHeaderStyles,Mt=null==xt?void 0:xt.clinicalTrialSectionStyles,Wt=null==xt?void 0:xt.CompletionStyles,Lt=null==xt?void 0:xt.noDataStyles,jt=null==xt?void 0:xt.approveButtonStyles,$t=null!==(He=null===(Fe=null==Dt?void 0:Dt.shouldRender)||void 0===Fe?void 0:Fe.call(Dt,q))&&void 0!==He&&He,Ot=null===(qe=null==Dt?void 0:Dt.getValue)||void 0===qe?void 0:qe.call(Dt,q),zt=null!==(Qe=null===(Ye=null==Dt?void 0:Dt.getFields)||void 0===Ye?void 0:Ye.call(Dt,q))&&void 0!==Qe?Qe:[],Vt=null!==(Ze=null==Dt?void 0:Dt.isEditDisabled)&&void 0!==Ze&&Ze,Gt=null!==(Ke=null===(Je=null==Dt?void 0:Dt.isSaving)||void 0===Je?void 0:Je.call(Dt,q))&&void 0!==Ke&&Ke,Ft=((e,t)=>e>=80?null==t?void 0:t.highCompletion:e>=50?null==t?void 0:t.mediumCompletion:null==t?void 0:t.lowCompletion)(null!==(Xe=q.completion_percentage)&&void 0!==Xe?Xe:0,Wt),Ht={[$.WAITING]:null==kt?void 0:kt.waiting,[$.IN_PROGRESS]:null==kt?void 0:kt.inProgress,[$.GENERATED]:null==kt?void 0:kt.generated,[$.FAILED]:null==kt?void 0:kt.failed,[$.GENERATE]:null==kt?void 0:kt.generate,[$.APPROVED]:null==kt?void 0:kt.approved},[qt,Yt]=n({...structuredClone(q),value:P(q.value)||""}),[Qt,Zt]=n({userStory:!!q.isDefaultEdit}),[Jt,Kt]=n(!1),[Xt,el]=n(!1),[tl,ll]=n(null),[nl,ol]=n(null),{userStory:il,customIcons:al}=O(),[sl,rl]=n(null!=Se?Se:""===se||he===q.artifactId||!!q.isDefaultOpen),[dl,ul]=n(!1),[cl,vl]=n(null),[pl,ml]=n(null),[hl,yl]=n(!1),gl=o(null),fl=o(null),[Cl,Sl]=n(!1),[Il,bl]=n(!1),wl=o(null),[Nl,El]=n(!1),[Dl,Bl]=n(q.value);i(()=>{b&&rl(b)},[b]),i(()=>{Yt({...structuredClone(q),value:P(q.value)||""})},[q]),i(()=>{St.length>0?rl(!0):void 0===Se&&he&&rl(he===q.artifactId)},[St,he,q.artifactId]),i(()=>{Ne&&Ne.length>0&&rl(Ne.includes(q.artifactId)||""===se||he===q.artifactId||!!q.isDefaultOpen)},[Ne]);const Al=()=>{vl(null)},Tl=()=>{ml(null)},xl=()=>{sl&&Qt.userStory&&fl.current&&!fl.current.requestClose()||rl(e=>!e)},Ul=async()=>{var e,t;try{"userStory"==="userStory"&&(Y(qt),console.log("I am changing RTE editor values",qt)),await(null===(e=null==Me?void 0:Me.onSaveEditedSection)||void 0===e?void 0:e.call(Me,qt)),await me(It,il,w,null===(t=wl.current)||void 0===t?void 0:t.signal)}finally{}};const kl=null!=(null==q?void 0:q.big_enough)&&!Number.isNaN(q.big_enough)&&!!(null==q?void 0:q.big_enough_decision_factors),Pl=null!==(et=null==q?void 0:q.completion_percentage)&&void 0!==et?et:0,Rl=!!(null==q?void 0:q.completion_decision_factors),_l=""===se,Ml=null!=fe?fe:oe(ge,_l),Wl=!ue&&!ce;i(()=>{if(!nl)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${nl}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[nl]);const[Ll,jl]=n(0),[$l,Ol]=n(!1),zl=async()=>{var e,t;let l=!0;if(Ol(e=>(l=!e,!0)),l){let l;jl(e=>(l=e,e));try{const{updated_reqai:n}=await F({documentId:Nt,sectionId:q.artifactId,baseApiUrl:null==Et?void 0:Et.baseApiUrl,redlineConfigId:null!==(e=null==Et?void 0:Et.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Et?void 0:Et.token)&&void 0!==t?t:"");await(null==Bt?void 0:Bt(n)),jl(e=>l===e?0:1)}catch(e){}Ol(!1)}};i(()=>{q.isDefaultEdit&&Zt(e=>({...e,userStory:!0}))},[q.isDefaultEdit]),console.log("block number in userstory card ",Le),console.log("[TESTING-CURRENT-USER-STORY] \n",q,"\n[TESTING-USER-STORY] \n",il),X(`redline-edit:${Nt}:${q.artifactId}`,async({updatedBy:l})=>{var n;null===(n=wl.current)||void 0===n||n.abort(),jl(e=>e+1),Zt(n=>n.userStory?(ee.custom(n=>e(te,{onCancel:()=>ee.dismiss(n.id),onRefresh:()=>{ee.dismiss(n.id),zl()},children:["This ",t("span",{style:{fontWeight:600},children:q.title})," section has been updated by ",t("span",{style:{fontWeight:600},children:l})," while you were editing. Please refresh to view the latest version."]}),{duration:1e4,toasterId:z}),{...il,userStory:!1}):(zl().then(()=>{ee.custom(n=>e(te,{onCancel:()=>ee.dismiss(n.id),children:[t("span",{style:{fontWeight:600},children:q.title})," updated,",t("br",{}),l," saved changes. Your unsaved edits are untouched."]}),{duration:1e4,toasterId:z})}),n))});return i(()=>Bl(q.value),[q.value]),e("div",{className:k.card,"data-block-id":"user-story-card-wrapper-"+Le,style:null==xt?void 0:xt.cardStyle,id:`story-card-${q.title}`,"data-expanded":sl,children:[e("div",{className:k.titleSection,style:null==xt?void 0:xt.titleSection,children:[e("div",{className:k.titleRow,style:null==xt?void 0:xt.titleRow,onClick:xl,children:[e("div",{className:k.titleLeft,style:null==xt?void 0:xt.titleLeft,onMouseEnter:()=>Sl(!0),onMouseLeave:()=>Sl(!1),children:[Ee&&t(ie,{displayName:N}),Jt&&Wl?t(G,{title:q.title,onSave:e=>(async(e,t)=>{var l;try{let n={...q};q.artifactId===t?n.title=e:n.sub_features=(null===(l=q.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],Yt(n),Y(n),Kt(!1)}catch(e){console.error("Failed to save title",e)}})(e,q.artifactId),onCancel:()=>{Kt(!1)},inputStyle:null==Pt?void 0:Pt.inlineTitleInput,confirmButtonStyle:null==Pt?void 0:Pt.inlineTitleConfirm,cancelButtonStyle:null==Pt?void 0:Pt.inlineTitleCancel},"inline-title-editor"):e("div",{className:k.storyTitleWrapper,children:[t(B,{title:ne(q.title),arrow:!0,children:t("h2",{title:Re?void 0:q.title,className:k.storyTitle,style:null==xt?void 0:xt.storyTitle,children:ne(q.title)},q.artifactId)}),xe&&(Rl?t(Z,{customIcons:null==al?void 0:al.userStoryIcons,customStyles:null==xt?void 0:xt.aiReasoningCitaionStyles,currentUserStory:q,panelStyles:null==xt?void 0:xt.CompletionStyles,onToggleStateChange:bl,completionPanelConfig:Ue,children:e("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Wt?void 0:Wt.badge,...Ft},children:[e("span",{children:[Pl,"% Completed"]}),t("span",{style:{display:"flex",alignItems:"center"},children:t(J,{color:"currentColor"})}),t(Il?a:s,{size:14,style:null==Wt?void 0:Wt.chevronStyle})]})}):t("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Wt?void 0:Wt.badge,...Ft},children:e("span",{children:[Pl,"% Completed"]})})),De&&t("button",{type:"button",className:k.titleEditButton,style:null==Pt?void 0:Pt.titleEditButton,onClick:e=>{e.stopPropagation(),Kt(!0),sl||rl(!0)},"aria-label":"Edit title",title:"Edit title",children:t("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("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"})})})]})]}),(ht||void 0!==gt&&void 0!==ft)&&e("div",{className:k.statusContainer,children:[void 0!==gt&&void 0!==ft&&e("div",{className:k.completedBadge,children:["Completed: ",gt,"/",ft]}),ht&&t("button",{type:"button",onClick:e=>{e.stopPropagation(),null==yt||yt()},onMouseEnter:()=>El(!0),onMouseLeave:()=>El(!1),className:k.statusButton,style:{...null===(tt=Ht[ht])||void 0===tt?void 0:tt.default,...Nl&&(null===(lt=Ht[ht])||void 0===lt?void 0:lt.hover)},children:le[ht]})]}),e("div",{className:k.titleActions,style:null==xt?void 0:xt.titleActions,onClick:e=>e.stopPropagation(),children:[(Ml.showProgressPercentage||Ml.showGapBox)&&Ce&&e("div",{className:k.progressHeader,style:null==_t?void 0:_t.wrapper,children:[Ml.showProgressPercentage&&e("div",{className:k.progressPercentage,style:null==_t?void 0:_t.percentage,children:[null!==(ot=null!==(nt=null==q?void 0:q.confidenceScore)&&void 0!==nt?nt:null==Ml?void 0:Ml.confidenceValue)&&void 0!==ot?ot:"0","%"]}),Ml.showGapBox&&e("div",{className:k.gapBox,style:null==_t?void 0:_t.gapBox,children:[null!==(at=null!==(it=null==q?void 0:q.gapValue)&&void 0!==it?it:null==Ml?void 0:Ml.gapBoxValue)&&void 0!==at?at:"2"," ","Gaps"]})]}),kl&&t(V,{customIcons:null==al?void 0:al.userStoryIcons,customStyles:null==xt?void 0:xt.aiReasoningCitaionStyles,currentUserStory:q,panelStyles:null==xt?void 0:xt.BigEnoughStyles}),$e&&t("button",{type:"button",className:k.iconButton,style:null==xt?void 0:xt.iconButton,disabled:Oe,onClick:e=>{e.stopPropagation(),null==ze||ze(q)},"aria-label":"Assign section users",title:"Assign section users",children:t(r,{size:16})}),!Qt.userStory&&e(l,{children:[!1!==(null==Ml?void 0:Ml.showShareButton)&&t("button",{className:k.iconButton,style:null==xt?void 0:xt.iconButton,onClick:e=>{vl(e.currentTarget)},children:t(d,{size:16})}),e(A,{id:"user-story-share-menu",anchorEl:cl,open:!!cl,onClose:()=>vl(null),style:null==xt?void 0:xt.userStoryShareMenu,children:[de&&t(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:async()=>{ul(!0),ve&&(await Promise.all([ve("pdf"),ve("doc")]),ul(!1))},children:e("div",{ref:gl,className:k.menuItemContent,style:null==xt?void 0:xt.menuItemContent,children:[t(u,{size:16,color:null==xt?void 0:xt.menuIconColor}),t("p",{style:null==xt?void 0:xt.menuLabel,children:"Download"})]})}),t(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:async()=>{let e=q;E&&(e={...q,value:`${_(null==E?void 0:E.value,q.title)} \n${q.value}`}),null==pe||pe(!0,[e],q.artifactId),Al()},children:e("div",{style:null==xt?void 0:xt.menuItemContent,className:k.menuItemContentPadded,children:[t(c,{size:16,color:null==xt?void 0:xt.menuIconColor}),t("p",{style:null==xt?void 0:xt.menuLabel,children:"Send"})]})}),t(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:async()=>{const e=(new D.Converter).makeHtml(P(q.value)||q.value),t=function(e){const t=(new D.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(P(q.value)||q.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Al()}},children:e("div",{style:null==xt?void 0:xt.menuItemContent,className:k.menuItemContentPadded,children:[t(v,{size:16,color:null==xt?void 0:xt.menuIconColor}),t("p",{style:null==xt?void 0:xt.menuLabel,children:"Copy"})]})})]})]}),!hl&&Qt.userStory&&sl?t(W,{type:"outline",children:"Cancel",style:null==xt?void 0:xt.cancelButton,onClick:()=>{var e;null===(e=wl.current)||void 0===e||e.abort(),Zt(e=>({...e,userStory:!1}))}}):t(l,{}),Qt.userStory&&sl?t(W,{type:"fill",children:hl?e("span",{className:k.savingSpinner,style:null==xt?void 0:xt.savingSpinner,children:[t(p,{className:k.spinAnimation,style:null==xt?void 0:xt.spinAnimation}),t("span",{children:"Saving..."})]}):"Save",isDisable:hl,style:hl?null==xt?void 0:xt.savingButton:null==xt?void 0:xt.saveButton,onClick:async()=>{yl(!0),await Ul();let e=await(async()=>{var e,t,l,n,o,i,a,s;let r=qt.value;console.log("[V] valueToUpdate before",r),r=r.replace(/<invisible\s+id="([^"]+)"\s*><\/invisible>/gi,"\x3c!-- $1 --\x3e"),console.log("[V] valueToUpdate after",r);try{if(null==Et?void 0:Et.callUpdateDocument){const{updated_reqai:d}=await H({documentId:Nt,sectionId:q.artifactId,baseApiUrl:null==Et?void 0:Et.baseApiUrl,updatedContent:r,userEmail:Et.userEmail,userName:Et.userName,redlineConfigId:null!==(e=Et.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Et?void 0:Et.token)&&void 0!==t?t:"");r=null===(o=null===(n=null===(l=null==d?void 0:d.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===o?void 0:o.value,await(null==Bt?void 0:Bt(d)),K.emit(`redline-edit:${Nt}:${null===(s=null===(a=null===(i=null==d?void 0:d.artifactData)||void 0===i?void 0:i.userStorySnapshot)||void 0===a?void 0:a[0])||void 0===s?void 0:s.artifactId}`,{updatedBy:null==Et?void 0:Et.userName})}}catch(e){console.error("failed to update redline document",e),r=Dl}return r=r.replace(/<!--\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,'<invisible id="$1"></invisible>'),r})();const t={...qt,value:e};Y({...t,isDefaultEdit:!1}),Bl(t.value),Zt(e=>({...e,userStory:!1})),yl(!1)}}):!Ll&&!ue&&!ce&&!Pe&&sl&&!1!==(null==Ml?void 0:Ml.showEditButton)&&t("button",{className:k.iconButton,style:null==xt?void 0:xt.editButton,onClick:()=>Zt(e=>({...e,userStory:!0})),children:t(m,{color:null==xt?void 0:xt.pencilIconColor,size:16})}),(null==Tt?void 0:Tt.initiateCollaborativeFlow)&&!!Ll&&t(B,{title:"Fetch latest section",children:t(h,{color:$l?"#d3d3d3":"black",onClick:zl})}),ke&&_l&&sl&&!ue&&!ce&&!1!==(null==Ml?void 0:Ml.showEditButton)&&e("button",{type:"button",className:k.addSectionButton,style:null==Pt?void 0:Pt.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=q.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:U(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...q,sub_features:[...null!==(n=q.sub_features)&&void 0!==n?n:[],i]};Yt(a),Y(a),rl(!0),ol(i.title)},"aria-label":"Add section",title:"Add section",children:[t(y,{size:14}),t("span",{className:k.addSectionLabel,children:"Add Section"})]}),!_l&&!ue&&!Pe&&!ce&&t("button",{type:"button",onClick:e=>{e.stopPropagation(),null==be||be()},className:k.iconButton,style:null==Pt?void 0:Pt.deleteButton,"aria-label":"Delete section",title:"Delete section",children:t(g,{size:16})}),$t&&t("button",{type:"button",className:k.iconButton,style:null==Ut?void 0:Ut.button,disabled:Vt,onClick:e=>{if(e.stopPropagation(),Xt)return ll(null),void el(!1);ll(structuredClone(null!=Ot?Ot:{})),rl(!0),el(!0)},children:Xt?t(f,{size:16,color:null==xt?void 0:xt.pencilIconColor,style:null==Ut?void 0:Ut.cancelIcon}):t(m,{size:16,color:null==xt?void 0:xt.pencilIconColor,style:null==Ut?void 0:Ut.editIcon})}),(null==Ml?void 0:Ml.actionItemsButton)&&e(l,{children:[t("span",{className:k.actionItemBtn,style:null==xt?void 0:xt.actionItemBtn,onClick:e=>{e.stopPropagation(),ml(e.currentTarget)},children:t(C,{})}),t(A,{id:"user-story-action-menu",anchorEl:pl,open:!!pl,onClose:Tl,style:null==xt?void 0:xt.userStoryShareMenu,children:null==Ie?void 0:Ie.items.map((l,n)=>t(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:()=>{l.onclick(q),Tl()},children:e("div",{className:k.menuItemContent,style:{...null==xt?void 0:xt.menuItemContent,...!l.isActive&&{cursor:"not-allowed",opacity:.5}},children:[t("span",{className:k.menuItemIcon,style:null==xt?void 0:xt.menuItemIcon,children:l.icon}),t("p",{style:null==xt?void 0:xt.menuLabel,children:l.name}),t("span",{className:k.menuItemRight,style:null==xt?void 0:xt.menuItemRight})]})},`action-item-${n}-${l.name}`))})]}),t("button",{type:"button",onClick:e=>{e.stopPropagation(),xl()},style:null==xt?void 0:xt.chevronButton,className:k.chevronButton,children:t(sl?a:s,{className:k.chevronIcon,color:null==xt?void 0:xt.chevronIconColor})})]})]}),t("div",{className:k.divider,style:null==xt?void 0:xt.dividerStyle})]}),sl&&t("div",{className:k.cardContent,style:{...null==xt?void 0:xt.cardContentStyle,borderTop:Ae?"1px solid #E5E5E5":"none"},children:e("div",pt?{className:k.loadingContainer,children:[t("div",{className:k.loadingIconWrapper,children:t(S,{size:28,color:"#5B3DF5",className:k.spinAnimation})}),e("div",{children:[t("h3",{className:k.loadingTitle,children:"Section generation in progress.."}),t("p",{className:k.loadingSubtitle,children:"This may take a few minutes"})]}),t("button",{type:"button",onClick:()=>null==mt?void 0:mt(),className:k.viewStatusButton,children:"View Status"})]}:Ct?{className:k.noDataContainer,style:null==Lt?void 0:Lt.container,children:[t("img",{src:x,alt:"No data available",className:k.noDataIllustration,style:null==Lt?void 0:Lt.illustration}),t("h3",{className:k.noDataTitle,style:null==Lt?void 0:Lt.title,children:"No Data Available for This Section"}),t("p",{className:k.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."})]}:{className:k.contentInner,style:null==xt?void 0:xt.contentInner,children:[e("div",{className:k.descriptionSection,style:null==xt?void 0:xt.descriptionSection,children:[t("div",{className:k.justifyBetween,style:null==xt?void 0:xt.justifyBetween}),Qt.userStory?t(L,{ref:fl,minHeight:"100%",height:"100%",type:"string",value:P(Dl)||"",handleUpdateState:(e,t)=>{const l=M(R(t));Yt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:Qt.userStory?"edit":"readOnly",onEditBlocked:wt,onSaveUnsavedChanges:async()=>{await Ul(),rl(!1)},onDiscardUnsavedChanges:()=>{Yt({...structuredClone(q),value:P(q.value)||""}),Zt(e=>({...e,userStory:!1})),rl(!1)},isSavingUnsavedChanges:hl}):$t?t(Q,{styles:Mt,fields:zt,readonly:!Xt,isSaving:Gt,value:null!==(st=null!=tl?tl:Ot)&&void 0!==st?st:{},onChange:ll,onSave:async()=>{var e;tl&&(await(null===(e=null==Dt?void 0:Dt.onSave)||void 0===e?void 0:e.call(Dt,q,tl)),ll(null),el(!1))},onCancel:()=>{ll(null),el(!1)}}):e(l,{children:[t(j,{showUserStoryDiff:ce,isParent:""===se,message:P(q.value)||"",artifactId:q.artifactId,customStyles:Rt,isDisplayHighlightControl:ye,contextVariant:we,showConfidenceScore:Be,CDNeededInChip:We,blockId:Le,showWaitingIconInChip:je}),(_e||Me)&&e("div",{className:k.actionButtonsContainer,style:null==jt?void 0:jt.container,children:[Me&&!Qt.userStory&&e(l,{children:[t("button",{type:"button",className:k.actionButton,style:null==jt?void 0:jt.button,disabled:Me.disabled||Me.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Me.onClick)||void 0===t||t.call(Me),Zt(e=>({...e,userStory:!0})),rl(!0)},children:Me.isLoading?e(l,{children:[t(p,{size:16,className:k.actionButtonSpinner,style:null==jt?void 0:jt.icon}),t("span",{style:null==jt?void 0:jt.text,children:null!==(rt=Me.label)&&void 0!==rt?rt:"Edit"})]}):e(l,{children:[t(m,{size:16,style:null==jt?void 0:jt.icon}),t("span",{style:null==jt?void 0:jt.text,children:null!==(dt=Me.label)&&void 0!==dt?dt:"Edit"})]})}),_e&&t("span",{className:k.actionButtonDivider})]}),_e&&t("button",{type:"button",className:k.actionButton,style:null==jt?void 0:jt.button,disabled:_e.disabled||_e.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=_e.onClick)||void 0===t||t.call(_e)},children:_e.isLoading?e(l,{children:[t(p,{size:16,className:k.actionButtonSpinner,style:null==jt?void 0:jt.icon}),t("span",{style:null==jt?void 0:jt.text,children:null!==(ut=_e.label)&&void 0!==ut?ut:"Approve"})]}):e(l,{children:[t(I,{size:16,style:null==jt?void 0:jt.icon}),t("span",{style:null==jt?void 0:jt.text,children:null!==(ct=_e.label)&&void 0!==ct?ct:"Approve"})]})})]})]})]}),null===(vt=qt.sub_features)||void 0===vt?void 0:vt.map((e,l)=>{console.log("UserStoryCardWrapper: sub",e);const n=oe(ge,!1,e.artifactId);return t(ae,{artifactId:w,isUserStoryCurrentlyUpdated:b,artifactTitleId:`${N}-${String.fromCharCode(65+l)}`,parentUserStory:q,parentIndex:`${se}${se&&"."}${re}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:e,onUserStoryChange:e=>((e,t)=>{const l=[...q.sub_features||[]];l[e]=t,Y({...q,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:ue,showUserStoryDiff:ce,updateUserStoryArtifact:me,handleDownloadUserStory:ve,handleOpenSendDialog:pe,isDisplayHighlightControl:ye,elementDisplayConfig:ge,_resolvedConfig:n,actionItemsConfig:Ie,onDelete:()=>(e=>{const t=(q.sub_features||[]).filter((t,l)=>l!==e),l={...q,sub_features:t};Yt(l),Y(l)})(l),expandedSubFeatures:Ne,disableEditPlan:Pe,useMuiTooltip:Re,blockNumber:e.blockNumber,showAssignSection:$e,onAssignSectionClick:ze},e.artifactId)})]})})]})},se=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:h,showWrapper:y,actionItemsConfig:g,contextVariant:f,showDisplayName:C,allowTitleEdit:S,showConfidenceScore:I,showBorderTop:N,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:A=!1,disableEditPlan:T=!1,useMuiTooltip:x=!1,approveButtonConfig:U,editButtonConfig:P,CDNeededInChip:R,showWaitingIconInChip:_,setRedlineDocumentIdParent:M,showAssignSection:W,onAssignSectionClick:L,disableAssignSection:j})=>{const{userStory:$,setUserStory:z,customStyles:V,searchQueryList:G,currentHighlightIndex:F,setCurrentHighlightIndex:H,segmentComponentConfig:Q,sectionStatusConfig:Z,redlineConfig:J,setRedlineDocumentId:K}=O(),X=null==V?void 0:V.userStoryCardStyles,ee=0===F,te=F===G.length-1;return i(()=>{if(!(null==J?void 0:J.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await q({baseApiUrl:J.documentBaseApiUrl||"",comparisonId:J.documentComparisonId||""});if(t)K(t);else{const{document_id:t}=await Y({baseApiUrl:J.baseApiUrl,changelogConfigId:J.changelogConfigId,comparisonId:J.documentComparisonId,artifactId:J.artifactId,inputData:J.inputData,redlineConfigId:J.redlineConfigId,userEmail:J.userEmail,userName:J.userName},null!==(e=null==J?void 0:J.token)&&void 0!==e?e:"");t&&(K(t),null==M||M(t))}})()},[]),e("div",{className:k.userStoryCardWrapper,style:m?{...null==X?void 0:X.userStoryCardWrapper,position:"relative"}:null==X?void 0:X.userStoryCardWrapper,children:[m&&t(l,{children:G.length>0&&t("div",{className:k.wrapper,children:t("div",{className:k.highlightNavigation,children:e("div",{className:k.navigationContainer,children:[e("span",{className:k.navCounter,children:[F+1," of ",G.length]}),e("div",{className:k.navButtons,children:[t("button",{onClick:()=>{F>0&&H(e=>e-1)},className:k.navButton,disabled:ee,children:t(b,{size:20,className:k.navIcon})}),t("button",{onClick:()=>{F<G.length-1&&H(e=>e+1)},className:k.navButton,disabled:te,children:t(w,{size:20,className:k.navIcon})})]})]})})})}),$.map((e,l)=>{console.log("UserStoryCardWrapper: userstory",e);const i=oe(h,!0);return t(ae,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:e,onUserStoryChange:e=>{z(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:h,_resolvedConfig:i,showWrapper:y,defaultExpanded:E,actionItemsConfig:g,contextVariant:f,showDisplayName:C,allowTitleEdit:S,showConfidenceScore:I,showBorderTop:N,sectionStatusConfig:Z,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:A,disableEditPlan:T,useMuiTooltip:x,approveButtonConfig:U,CDNeededInChip:R,editButtonConfig:P,showWaitingIconInChip:_,showAssignSection:W,disableAssignSection:j,onAssignSectionClick:L},e.artifactId)})]})};export{ae as StoryCard,se as UserStoryCardWrapper,ae as default,ne as replaceLearnedTagsWithInfo};
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as l}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as i}from"react";import{ChevronUp as a,ChevronDown as s,Users as r,ExternalLink as d,Download as u,Share2 as c,Copy as v,LoaderCircle as p,PencilIcon as m,RefreshCw as h,Plus as y,Trash2 as g,X as f,Ellipsis as C,Hourglass as S,Check as I,ChevronUpIcon as b,ChevronDownIcon as w,Info as N,Bookmark as E}from"lucide-react";import D from"showdown";import{Tooltip as B,Menu as A,MenuItem as T}from"@mui/material";import x from"../../icons/Illustration.svg.js";import{v4 as U}from"uuid";import k from"./UserStoryCard.module.css.js";import{formatMarkdown as P,indentMarkdown as R}from"../../utils/helpers.js";import{replaceTitleSection as _,postprocessUserStoryAfterEdit as M}from"../../utils/user-story.utils.js";import W from"../../shared/AtomicButton.js";import L from"../RichTextEditor/RichTextEditor.js";import j from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as $,useRequirementAI as O,ToasterId as z}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as V}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as G}from"./TitleEditor/TitleEditor.js";import{fetchRedlineDocumentSection as F,updateRedlineDocument as H,getRedlineDocumentId as q,createRedlineDocument as Y}from"../../../../service/redlineService.js";import Q from"./ClinicalTrialSection.js";import{CompletionPanel as Z}from"../story-screen/CompletionPanel.js";import J from"../../icons/CDIcon.js";import K from"./cws/CwsEvent.js";import X from"./cws/useCwsEvent.js";import ee from"react-hot-toast";import te from"./Popups/RedlineToast.js";const le={[$.WAITING]:"WAITING TO GENERATE",[$.IN_PROGRESS]:"IN PROGRESS",[$.GENERATED]:"GENERATED",[$.FAILED]:"FAILED",[$.GENERATE]:"GENERATE",[$.APPROVED]:"APPROVED"};function ne(e){const t=[],n=/<learned>(.*?)<\/learned>/g;let o,i=0,a=0;for(;null!==(o=n.exec(e));){const[,s]=o,r=o.index;r>i&&t.push(l("span",{children:e.slice(i,r)},"text-pre-"+a++)),t.push(l(B,{title:s,placement:"top",children:l(N,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${U()}`)),i=n.lastIndex}return i<(null==e?void 0:e.length)&&t.push(l("span",{children:e.slice(i)},"text-post-"+a++)),t}function oe(e,t,l){var n;if(!e)return{};if(t)return{...e.parentConfig};const o={...e.childConfig};return l&&(null===(n=e.subFeatureOverrides)||void 0===n?void 0:n[l])?{...o,...e.subFeatureOverrides[l]}:o}const ie=({displayName:t})=>{var n;const{customStyles:o}=O(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e("div",{className:k.displayName,style:null==i?void 0:i.wrapper,children:[l(E,{className:k.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e("span",{style:null==i?void 0:i.label,children:[t,":"]})]})},ae=({isUserStoryCurrentlyUpdated:b,artifactId:w,artifactTitleId:N,parentUserStory:E,currentUserStory:q,onUserStoryChange:Y,parentIndex:se,currentIndex:re,enableDownload:de,isDiffEditReviewMode:ue,showUserStoryDiff:ce,handleDownloadUserStory:ve,handleOpenSendDialog:pe,updateUserStoryArtifact:me,selectedArtifactId:he,isDisplayHighlightControl:ye,elementDisplayConfig:ge,_resolvedConfig:fe,showWrapper:Ce=!1,defaultExpanded:Se,actionItemsConfig:Ie,onDelete:be,contextVariant:we,expandedSubFeatures:Ne,showDisplayName:Ee=!0,allowTitleEdit:De=!0,showConfidenceScore:Be=!0,showBorderTop:Ae=!0,sectionStatusConfig:Te,showCompletionPanel:xe=!1,completionPanelConfig:Ue,showAddSectionButton:ke=!1,disableEditPlan:Pe=!1,useMuiTooltip:Re=!1,approveButtonConfig:_e,editButtonConfig:Me,CDNeededInChip:We,blockNumber:Le,showWaitingIconInChip:je,showAssignSection:$e=!1,disableAssignSection:Oe=!1,onAssignSectionClick:ze})=>{var Ve,Ge,Fe,He,qe,Ye,Qe,Ze,Je,Ke,Xe,et,tt,lt,nt,ot,it,at,st,rt,dt,ut,ct,vt;const{isLoadingSectionData:pt=!1,onLoadSectionData:mt,status:ht,onStatusClick:yt,completedCount:gt,totalCount:ft,isNoDataAvailable:Ct=!1}=null!=Te?Te:{},{searchQueryList:St,citations:It,customStyles:bt,onEditBlocked:wt,redlineDcoumentId:Nt,redlineConfig:Et,customSectionConfig:Dt,updateRedlineDataParent:Bt,aiReasoning:At,redlineCollaborativeConfig:Tt}=O(),xt=null==bt?void 0:bt.userStoryCardStyles,Ut=null==xt?void 0:xt.customSectionEditButton,kt=null==xt?void 0:xt.statusStyles,Pt=null===(Ve=null==bt?void 0:bt.userStoryCardStyles)||void 0===Ve?void 0:Ve.userStoryEditStyles,Rt=null===(Ge=null==bt?void 0:bt.userStoryScreenStyles)||void 0===Ge?void 0:Ge.userStoryContentStyles,_t=null==xt?void 0:xt.progressHeaderStyles,Mt=null==xt?void 0:xt.clinicalTrialSectionStyles,Wt=null==xt?void 0:xt.CompletionStyles,Lt=null==xt?void 0:xt.noDataStyles,jt=null==xt?void 0:xt.approveButtonStyles,$t=null!==(He=null===(Fe=null==Dt?void 0:Dt.shouldRender)||void 0===Fe?void 0:Fe.call(Dt,q))&&void 0!==He&&He,Ot=null===(qe=null==Dt?void 0:Dt.getValue)||void 0===qe?void 0:qe.call(Dt,q),zt=null!==(Qe=null===(Ye=null==Dt?void 0:Dt.getFields)||void 0===Ye?void 0:Ye.call(Dt,q))&&void 0!==Qe?Qe:[],Vt=null!==(Ze=null==Dt?void 0:Dt.isEditDisabled)&&void 0!==Ze&&Ze,Gt=null!==(Ke=null===(Je=null==Dt?void 0:Dt.isSaving)||void 0===Je?void 0:Je.call(Dt,q))&&void 0!==Ke&&Ke,Ft=((e,t)=>e>=80?null==t?void 0:t.highCompletion:e>=50?null==t?void 0:t.mediumCompletion:null==t?void 0:t.lowCompletion)(null!==(Xe=q.completion_percentage)&&void 0!==Xe?Xe:0,Wt),Ht={[$.WAITING]:null==kt?void 0:kt.waiting,[$.IN_PROGRESS]:null==kt?void 0:kt.inProgress,[$.GENERATED]:null==kt?void 0:kt.generated,[$.FAILED]:null==kt?void 0:kt.failed,[$.GENERATE]:null==kt?void 0:kt.generate,[$.APPROVED]:null==kt?void 0:kt.approved},[qt,Yt]=n({...structuredClone(q),value:P(q.value)||""}),[Qt,Zt]=n({userStory:!!q.isDefaultEdit}),[Jt,Kt]=n(!1),[Xt,el]=n(!1),[tl,ll]=n(null),[nl,ol]=n(null),{userStory:il,customIcons:al}=O(),[sl,rl]=n(null!=Se?Se:""===se||he===q.artifactId||!!q.isDefaultOpen),[dl,ul]=n(!1),[cl,vl]=n(null),[pl,ml]=n(null),[hl,yl]=n(!1),gl=o(null),fl=o(null),[Cl,Sl]=n(!1),[Il,bl]=n(!1),wl=o(null),[Nl,El]=n(!1),[Dl,Bl]=n(q.value);i(()=>{b&&rl(b)},[b]),i(()=>{Yt({...structuredClone(q),value:P(q.value)||""})},[q]),i(()=>{St.length>0?rl(!0):void 0===Se&&he&&rl(he===q.artifactId)},[St,he,q.artifactId]),i(()=>{Ne&&Ne.length>0&&rl(Ne.includes(q.artifactId)||""===se||he===q.artifactId||!!q.isDefaultOpen)},[Ne]);const Al=()=>{vl(null)},Tl=()=>{ml(null)},xl=()=>{sl&&Qt.userStory&&fl.current&&!fl.current.requestClose()||rl(e=>!e)},Ul=async()=>{var e,t;try{"userStory"==="userStory"&&(Y(qt),console.log("I am changing RTE editor values",qt)),await(null===(e=null==Me?void 0:Me.onSaveEditedSection)||void 0===e?void 0:e.call(Me,qt)),await me(It,il,w,null===(t=wl.current)||void 0===t?void 0:t.signal)}finally{}};const kl=null!=(null==q?void 0:q.big_enough)&&!Number.isNaN(q.big_enough)&&!!(null==q?void 0:q.big_enough_decision_factors),Pl=null!==(et=null==q?void 0:q.completion_percentage)&&void 0!==et?et:0,Rl=!!(null==q?void 0:q.completion_decision_factors),_l=""===se,Ml=null!=fe?fe:oe(ge,_l),Wl=!ue&&!ce;i(()=>{if(!nl)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${nl}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[nl]);const[Ll,jl]=n(0),[$l,Ol]=n(!1),zl=async()=>{var e,t;let l=!0;if(Ol(e=>(l=!e,!0)),l){let l;jl(e=>(l=e,e));try{const{updated_reqai:n}=await F({documentId:Nt,sectionId:q.artifactId,baseApiUrl:null==Et?void 0:Et.baseApiUrl,redlineConfigId:null!==(e=null==Et?void 0:Et.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Et?void 0:Et.token)&&void 0!==t?t:"");await(null==Bt?void 0:Bt(n)),jl(e=>l===e?0:1)}catch(e){}Ol(!1)}};i(()=>{q.isDefaultEdit&&Zt(e=>({...e,userStory:!0}))},[q.isDefaultEdit]),console.log("block number in userstory card ",Le),console.log("[TESTING-CURRENT-USER-STORY] \n",q,"\n[TESTING-USER-STORY] \n",il),X(`redline-edit:${Nt}:${q.artifactId}`,async({updatedBy:n})=>{var o;null===(o=wl.current)||void 0===o||o.abort(),jl(e=>e+1),Zt(o=>o.userStory?(ee.custom(t=>e(te,{onCancel:()=>ee.dismiss(t.id),onRefresh:()=>{ee.dismiss(t.id),zl()},children:["This ",l("span",{style:{fontWeight:600},children:q.title})," section has been updated by ",l("span",{style:{fontWeight:600},children:n})," while you were editing. Please refresh to view the latest version."]}),{duration:1e4,toasterId:z}),{...il,userStory:!1}):(zl().then(()=>{ee.custom(o=>e(te,{onCancel:()=>ee.dismiss(o.id),title:e(t,{children:[l("span",{style:{fontWeight:600},children:q.title})," updated,",l("br",{})]}),children:[n," saved changes. Your unsaved edits are untouched."]}),{duration:1e4,toasterId:z})}),o))});return i(()=>Bl(q.value),[q.value]),e("div",{className:k.card,"data-block-id":"user-story-card-wrapper-"+Le,style:null==xt?void 0:xt.cardStyle,id:`story-card-${q.title}`,"data-expanded":sl,children:[e("div",{className:k.titleSection,style:null==xt?void 0:xt.titleSection,children:[e("div",{className:k.titleRow,style:null==xt?void 0:xt.titleRow,onClick:xl,children:[e("div",{className:k.titleLeft,style:null==xt?void 0:xt.titleLeft,onMouseEnter:()=>Sl(!0),onMouseLeave:()=>Sl(!1),children:[Ee&&l(ie,{displayName:N}),Jt&&Wl?l(G,{title:q.title,onSave:e=>(async(e,t)=>{var l;try{let n={...q};q.artifactId===t?n.title=e:n.sub_features=(null===(l=q.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],Yt(n),Y(n),Kt(!1)}catch(e){console.error("Failed to save title",e)}})(e,q.artifactId),onCancel:()=>{Kt(!1)},inputStyle:null==Pt?void 0:Pt.inlineTitleInput,confirmButtonStyle:null==Pt?void 0:Pt.inlineTitleConfirm,cancelButtonStyle:null==Pt?void 0:Pt.inlineTitleCancel},"inline-title-editor"):e("div",{className:k.storyTitleWrapper,children:[l(B,{title:ne(q.title),arrow:!0,children:l("h2",{title:Re?void 0:q.title,className:k.storyTitle,style:null==xt?void 0:xt.storyTitle,children:ne(q.title)},q.artifactId)}),xe&&(Rl?l(Z,{customIcons:null==al?void 0:al.userStoryIcons,customStyles:null==xt?void 0:xt.aiReasoningCitaionStyles,currentUserStory:q,panelStyles:null==xt?void 0:xt.CompletionStyles,onToggleStateChange:bl,completionPanelConfig:Ue,children:e("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Wt?void 0:Wt.badge,...Ft},children:[e("span",{children:[Pl,"% Completed"]}),l("span",{style:{display:"flex",alignItems:"center"},children:l(J,{color:"currentColor"})}),l(Il?a:s,{size:14,style:null==Wt?void 0:Wt.chevronStyle})]})}):l("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Wt?void 0:Wt.badge,...Ft},children:e("span",{children:[Pl,"% Completed"]})})),De&&l("button",{type:"button",className:k.titleEditButton,style:null==Pt?void 0:Pt.titleEditButton,onClick:e=>{e.stopPropagation(),Kt(!0),sl||rl(!0)},"aria-label":"Edit title",title:"Edit title",children:l("svg",{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"})})})]})]}),(ht||void 0!==gt&&void 0!==ft)&&e("div",{className:k.statusContainer,children:[void 0!==gt&&void 0!==ft&&e("div",{className:k.completedBadge,children:["Completed: ",gt,"/",ft]}),ht&&l("button",{type:"button",onClick:e=>{e.stopPropagation(),null==yt||yt()},onMouseEnter:()=>El(!0),onMouseLeave:()=>El(!1),className:k.statusButton,style:{...null===(tt=Ht[ht])||void 0===tt?void 0:tt.default,...Nl&&(null===(lt=Ht[ht])||void 0===lt?void 0:lt.hover)},children:le[ht]})]}),e("div",{className:k.titleActions,style:null==xt?void 0:xt.titleActions,onClick:e=>e.stopPropagation(),children:[(Ml.showProgressPercentage||Ml.showGapBox)&&Ce&&e("div",{className:k.progressHeader,style:null==_t?void 0:_t.wrapper,children:[Ml.showProgressPercentage&&e("div",{className:k.progressPercentage,style:null==_t?void 0:_t.percentage,children:[null!==(ot=null!==(nt=null==q?void 0:q.confidenceScore)&&void 0!==nt?nt:null==Ml?void 0:Ml.confidenceValue)&&void 0!==ot?ot:"0","%"]}),Ml.showGapBox&&e("div",{className:k.gapBox,style:null==_t?void 0:_t.gapBox,children:[null!==(at=null!==(it=null==q?void 0:q.gapValue)&&void 0!==it?it:null==Ml?void 0:Ml.gapBoxValue)&&void 0!==at?at:"2"," ","Gaps"]})]}),kl&&l(V,{customIcons:null==al?void 0:al.userStoryIcons,customStyles:null==xt?void 0:xt.aiReasoningCitaionStyles,currentUserStory:q,panelStyles:null==xt?void 0:xt.BigEnoughStyles}),$e&&l("button",{type:"button",className:k.iconButton,style:null==xt?void 0:xt.iconButton,disabled:Oe,onClick:e=>{e.stopPropagation(),null==ze||ze(q)},"aria-label":"Assign section users",title:"Assign section users",children:l(r,{size:16})}),!Qt.userStory&&e(t,{children:[!1!==(null==Ml?void 0:Ml.showShareButton)&&l("button",{className:k.iconButton,style:null==xt?void 0:xt.iconButton,onClick:e=>{vl(e.currentTarget)},children:l(d,{size:16})}),e(A,{id:"user-story-share-menu",anchorEl:cl,open:!!cl,onClose:()=>vl(null),style:null==xt?void 0:xt.userStoryShareMenu,children:[de&&l(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:async()=>{ul(!0),ve&&(await Promise.all([ve("pdf"),ve("doc")]),ul(!1))},children:e("div",{ref:gl,className:k.menuItemContent,style:null==xt?void 0:xt.menuItemContent,children:[l(u,{size:16,color:null==xt?void 0:xt.menuIconColor}),l("p",{style:null==xt?void 0:xt.menuLabel,children:"Download"})]})}),l(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:async()=>{let e=q;E&&(e={...q,value:`${_(null==E?void 0:E.value,q.title)} \n${q.value}`}),null==pe||pe(!0,[e],q.artifactId),Al()},children:e("div",{style:null==xt?void 0:xt.menuItemContent,className:k.menuItemContentPadded,children:[l(c,{size:16,color:null==xt?void 0:xt.menuIconColor}),l("p",{style:null==xt?void 0:xt.menuLabel,children:"Send"})]})}),l(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:async()=>{const e=(new D.Converter).makeHtml(P(q.value)||q.value),t=function(e){const t=(new D.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(P(q.value)||q.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Al()}},children:e("div",{style:null==xt?void 0:xt.menuItemContent,className:k.menuItemContentPadded,children:[l(v,{size:16,color:null==xt?void 0:xt.menuIconColor}),l("p",{style:null==xt?void 0:xt.menuLabel,children:"Copy"})]})})]})]}),!hl&&Qt.userStory&&sl?l(W,{type:"outline",children:"Cancel",style:null==xt?void 0:xt.cancelButton,onClick:()=>{var e;null===(e=wl.current)||void 0===e||e.abort(),Zt(e=>({...e,userStory:!1}))}}):l(t,{}),Qt.userStory&&sl?l(W,{type:"fill",children:hl?e("span",{className:k.savingSpinner,style:null==xt?void 0:xt.savingSpinner,children:[l(p,{className:k.spinAnimation,style:null==xt?void 0:xt.spinAnimation}),l("span",{children:"Saving..."})]}):"Save",isDisable:hl,style:hl?null==xt?void 0:xt.savingButton:null==xt?void 0:xt.saveButton,onClick:async()=>{yl(!0),await Ul();let e=await(async()=>{var e,t,l,n,o,i,a,s;let r=qt.value;console.log("[V] valueToUpdate before",r),r=r.replace(/<invisible\s+id="([^"]+)"\s*><\/invisible>/gi,"\x3c!-- $1 --\x3e"),console.log("[V] valueToUpdate after",r);try{if(null==Et?void 0:Et.callUpdateDocument){const{updated_reqai:d}=await H({documentId:Nt,sectionId:q.artifactId,baseApiUrl:null==Et?void 0:Et.baseApiUrl,updatedContent:r,userEmail:Et.userEmail,userName:Et.userName,redlineConfigId:null!==(e=Et.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Et?void 0:Et.token)&&void 0!==t?t:"");r=null===(o=null===(n=null===(l=null==d?void 0:d.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===o?void 0:o.value,await(null==Bt?void 0:Bt(d)),K.emit(`redline-edit:${Nt}:${null===(s=null===(a=null===(i=null==d?void 0:d.artifactData)||void 0===i?void 0:i.userStorySnapshot)||void 0===a?void 0:a[0])||void 0===s?void 0:s.artifactId}`,{updatedBy:null==Et?void 0:Et.userName})}}catch(e){console.error("failed to update redline document",e),r=Dl}return r=r.replace(/<!--\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,'<invisible id="$1"></invisible>'),r})();const t={...qt,value:e};Y({...t,isDefaultEdit:!1}),Bl(t.value),Zt(e=>({...e,userStory:!1})),yl(!1)}}):!Ll&&!ue&&!ce&&!Pe&&sl&&!1!==(null==Ml?void 0:Ml.showEditButton)&&l("button",{className:k.iconButton,style:null==xt?void 0:xt.editButton,onClick:()=>Zt(e=>({...e,userStory:!0})),children:l(m,{color:null==xt?void 0:xt.pencilIconColor,size:16})}),(null==Tt?void 0:Tt.initiateCollaborativeFlow)&&!!Ll&&l(B,{title:"Fetch latest section",children:l(h,{color:$l?"#d3d3d3":"black",onClick:zl})}),ke&&_l&&sl&&!ue&&!ce&&!1!==(null==Ml?void 0:Ml.showEditButton)&&e("button",{type:"button",className:k.addSectionButton,style:null==Pt?void 0:Pt.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=q.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:U(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...q,sub_features:[...null!==(n=q.sub_features)&&void 0!==n?n:[],i]};Yt(a),Y(a),rl(!0),ol(i.title)},"aria-label":"Add section",title:"Add section",children:[l(y,{size:14}),l("span",{className:k.addSectionLabel,children:"Add Section"})]}),!_l&&!ue&&!Pe&&!ce&&l("button",{type:"button",onClick:e=>{e.stopPropagation(),null==be||be()},className:k.iconButton,style:null==Pt?void 0:Pt.deleteButton,"aria-label":"Delete section",title:"Delete section",children:l(g,{size:16})}),$t&&l("button",{type:"button",className:k.iconButton,style:null==Ut?void 0:Ut.button,disabled:Vt,onClick:e=>{if(e.stopPropagation(),Xt)return ll(null),void el(!1);ll(structuredClone(null!=Ot?Ot:{})),rl(!0),el(!0)},children:Xt?l(f,{size:16,color:null==xt?void 0:xt.pencilIconColor,style:null==Ut?void 0:Ut.cancelIcon}):l(m,{size:16,color:null==xt?void 0:xt.pencilIconColor,style:null==Ut?void 0:Ut.editIcon})}),(null==Ml?void 0:Ml.actionItemsButton)&&e(t,{children:[l("span",{className:k.actionItemBtn,style:null==xt?void 0:xt.actionItemBtn,onClick:e=>{e.stopPropagation(),ml(e.currentTarget)},children:l(C,{})}),l(A,{id:"user-story-action-menu",anchorEl:pl,open:!!pl,onClose:Tl,style:null==xt?void 0:xt.userStoryShareMenu,children:null==Ie?void 0:Ie.items.map((t,n)=>l(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:()=>{t.onclick(q),Tl()},children:e("div",{className:k.menuItemContent,style:{...null==xt?void 0:xt.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[l("span",{className:k.menuItemIcon,style:null==xt?void 0:xt.menuItemIcon,children:t.icon}),l("p",{style:null==xt?void 0:xt.menuLabel,children:t.name}),l("span",{className:k.menuItemRight,style:null==xt?void 0:xt.menuItemRight})]})},`action-item-${n}-${t.name}`))})]}),l("button",{type:"button",onClick:e=>{e.stopPropagation(),xl()},style:null==xt?void 0:xt.chevronButton,className:k.chevronButton,children:l(sl?a:s,{className:k.chevronIcon,color:null==xt?void 0:xt.chevronIconColor})})]})]}),l("div",{className:k.divider,style:null==xt?void 0:xt.dividerStyle})]}),sl&&l("div",{className:k.cardContent,style:{...null==xt?void 0:xt.cardContentStyle,borderTop:Ae?"1px solid #E5E5E5":"none"},children:e("div",pt?{className:k.loadingContainer,children:[l("div",{className:k.loadingIconWrapper,children:l(S,{size:28,color:"#5B3DF5",className:k.spinAnimation})}),e("div",{children:[l("h3",{className:k.loadingTitle,children:"Section generation in progress.."}),l("p",{className:k.loadingSubtitle,children:"This may take a few minutes"})]}),l("button",{type:"button",onClick:()=>null==mt?void 0:mt(),className:k.viewStatusButton,children:"View Status"})]}:Ct?{className:k.noDataContainer,style:null==Lt?void 0:Lt.container,children:[l("img",{src:x,alt:"No data available",className:k.noDataIllustration,style:null==Lt?void 0:Lt.illustration}),l("h3",{className:k.noDataTitle,style:null==Lt?void 0:Lt.title,children:"No Data Available for This Section"}),l("p",{className:k.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."})]}:{className:k.contentInner,style:null==xt?void 0:xt.contentInner,children:[e("div",{className:k.descriptionSection,style:null==xt?void 0:xt.descriptionSection,children:[l("div",{className:k.justifyBetween,style:null==xt?void 0:xt.justifyBetween}),Qt.userStory?l(L,{ref:fl,minHeight:"100%",height:"100%",type:"string",value:P(Dl)||"",handleUpdateState:(e,t)=>{const l=M(R(t));Yt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:Qt.userStory?"edit":"readOnly",onEditBlocked:wt,onSaveUnsavedChanges:async()=>{await Ul(),rl(!1)},onDiscardUnsavedChanges:()=>{Yt({...structuredClone(q),value:P(q.value)||""}),Zt(e=>({...e,userStory:!1})),rl(!1)},isSavingUnsavedChanges:hl}):$t?l(Q,{styles:Mt,fields:zt,readonly:!Xt,isSaving:Gt,value:null!==(st=null!=tl?tl:Ot)&&void 0!==st?st:{},onChange:ll,onSave:async()=>{var e;tl&&(await(null===(e=null==Dt?void 0:Dt.onSave)||void 0===e?void 0:e.call(Dt,q,tl)),ll(null),el(!1))},onCancel:()=>{ll(null),el(!1)}}):e(t,{children:[l(j,{showUserStoryDiff:ce,isParent:""===se,message:P(q.value)||"",artifactId:q.artifactId,customStyles:Rt,isDisplayHighlightControl:ye,contextVariant:we,showConfidenceScore:Be,CDNeededInChip:We,blockId:Le,showWaitingIconInChip:je}),(_e||Me)&&e("div",{className:k.actionButtonsContainer,style:null==jt?void 0:jt.container,children:[Me&&!Qt.userStory&&e(t,{children:[l("button",{type:"button",className:k.actionButton,style:null==jt?void 0:jt.button,disabled:Me.disabled||Me.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Me.onClick)||void 0===t||t.call(Me),Zt(e=>({...e,userStory:!0})),rl(!0)},children:Me.isLoading?e(t,{children:[l(p,{size:16,className:k.actionButtonSpinner,style:null==jt?void 0:jt.icon}),l("span",{style:null==jt?void 0:jt.text,children:null!==(rt=Me.label)&&void 0!==rt?rt:"Edit"})]}):e(t,{children:[l(m,{size:16,style:null==jt?void 0:jt.icon}),l("span",{style:null==jt?void 0:jt.text,children:null!==(dt=Me.label)&&void 0!==dt?dt:"Edit"})]})}),_e&&l("span",{className:k.actionButtonDivider})]}),_e&&l("button",{type:"button",className:k.actionButton,style:null==jt?void 0:jt.button,disabled:_e.disabled||_e.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=_e.onClick)||void 0===t||t.call(_e)},children:_e.isLoading?e(t,{children:[l(p,{size:16,className:k.actionButtonSpinner,style:null==jt?void 0:jt.icon}),l("span",{style:null==jt?void 0:jt.text,children:null!==(ut=_e.label)&&void 0!==ut?ut:"Approve"})]}):e(t,{children:[l(I,{size:16,style:null==jt?void 0:jt.icon}),l("span",{style:null==jt?void 0:jt.text,children:null!==(ct=_e.label)&&void 0!==ct?ct:"Approve"})]})})]})]})]}),null===(vt=qt.sub_features)||void 0===vt?void 0:vt.map((e,t)=>{console.log("UserStoryCardWrapper: sub",e);const n=oe(ge,!1,e.artifactId);return l(ae,{artifactId:w,isUserStoryCurrentlyUpdated:b,artifactTitleId:`${N}-${String.fromCharCode(65+t)}`,parentUserStory:q,parentIndex:`${se}${se&&"."}${re}`,currentIndex:`${t+1}`,doNotShowBorderInViewMode:!1,currentUserStory:e,onUserStoryChange:e=>((e,t)=>{const l=[...q.sub_features||[]];l[e]=t,Y({...q,sub_features:l})})(t,e),enableDownload:!0,isDiffEditReviewMode:ue,showUserStoryDiff:ce,updateUserStoryArtifact:me,handleDownloadUserStory:ve,handleOpenSendDialog:pe,isDisplayHighlightControl:ye,elementDisplayConfig:ge,_resolvedConfig:n,actionItemsConfig:Ie,onDelete:()=>(e=>{const t=(q.sub_features||[]).filter((t,l)=>l!==e),l={...q,sub_features:t};Yt(l),Y(l)})(t),expandedSubFeatures:Ne,disableEditPlan:Pe,useMuiTooltip:Re,blockNumber:e.blockNumber,showAssignSection:$e,onAssignSectionClick:ze},e.artifactId)})]})})]})},se=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:h,showWrapper:y,actionItemsConfig:g,contextVariant:f,showDisplayName:C,allowTitleEdit:S,showConfidenceScore:I,showBorderTop:N,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:A=!1,disableEditPlan:T=!1,useMuiTooltip:x=!1,approveButtonConfig:U,editButtonConfig:P,CDNeededInChip:R,showWaitingIconInChip:_,setRedlineDocumentIdParent:M,showAssignSection:W,onAssignSectionClick:L,disableAssignSection:j})=>{const{userStory:$,setUserStory:z,customStyles:V,searchQueryList:G,currentHighlightIndex:F,setCurrentHighlightIndex:H,segmentComponentConfig:Q,sectionStatusConfig:Z,redlineConfig:J,setRedlineDocumentId:K}=O(),X=null==V?void 0:V.userStoryCardStyles,ee=0===F,te=F===G.length-1;return i(()=>{if(!(null==J?void 0:J.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await q({baseApiUrl:J.documentBaseApiUrl||"",comparisonId:J.documentComparisonId||""});if(t)K(t);else{const{document_id:t}=await Y({baseApiUrl:J.baseApiUrl,changelogConfigId:J.changelogConfigId,comparisonId:J.documentComparisonId,artifactId:J.artifactId,inputData:J.inputData,redlineConfigId:J.redlineConfigId,userEmail:J.userEmail,userName:J.userName},null!==(e=null==J?void 0:J.token)&&void 0!==e?e:"");t&&(K(t),null==M||M(t))}})()},[]),e("div",{className:k.userStoryCardWrapper,style:m?{...null==X?void 0:X.userStoryCardWrapper,position:"relative"}:null==X?void 0:X.userStoryCardWrapper,children:[m&&l(t,{children:G.length>0&&l("div",{className:k.wrapper,children:l("div",{className:k.highlightNavigation,children:e("div",{className:k.navigationContainer,children:[e("span",{className:k.navCounter,children:[F+1," of ",G.length]}),e("div",{className:k.navButtons,children:[l("button",{onClick:()=>{F>0&&H(e=>e-1)},className:k.navButton,disabled:ee,children:l(b,{size:20,className:k.navIcon})}),l("button",{onClick:()=>{F<G.length-1&&H(e=>e+1)},className:k.navButton,disabled:te,children:l(w,{size:20,className:k.navIcon})})]})]})})})}),$.map((e,t)=>{console.log("UserStoryCardWrapper: userstory",e);const i=oe(h,!0);return l(ae,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[t]||"",expandedSubFeatures:o,currentUserStory:e,onUserStoryChange:e=>{z(l=>(l[t]=e,[...l]))},parentIndex:"",currentIndex:`${t+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:h,_resolvedConfig:i,showWrapper:y,defaultExpanded:E,actionItemsConfig:g,contextVariant:f,showDisplayName:C,allowTitleEdit:S,showConfidenceScore:I,showBorderTop:N,sectionStatusConfig:Z,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:A,disableEditPlan:T,useMuiTooltip:x,approveButtonConfig:U,CDNeededInChip:R,editButtonConfig:P,showWaitingIconInChip:_,showAssignSection:W,disableAssignSection:j,onAssignSectionClick:L},e.artifactId)})]})};export{ae as StoryCard,se as UserStoryCardWrapper,ae as default,ne as replaceLearnedTagsWithInfo};
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedlineEditorTest2.d.ts","sourceRoot":"","sources":["../../../src/RedlineEditorTest2.tsx"],"names":[],"mappings":"AA6BA,iBAAS,kBAAkB,4CAi8D1B;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAcf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAcf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;AAuaD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA6MjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationRenderer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CitationRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationRenderer.tsx"],"names":[],"mappings":"AAOA,KAAK,KAAK,GAAG;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAC3C,IAAI,EAAE,OAAO,CAAA;CAChB,CAAA;AAkCD,iBAAS,gBAAgB,CAAC,EACtB,OAAY,EACZ,KAAU,EACV,SAAc,EACd,MAAW,EACX,OAAmC,EACnC,aAAoB,EACpB,IAAI,EACP,EAAE,KAAK,2CAkHP;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const mergeRulebookCitationsIntoMatchingLinks: (rawContent: string) => string;
|
|
2
|
+
export declare const processGuidelinesMarkdown: ({ guidelinesData, targetHighlights, labelColor, }: {
|
|
3
|
+
guidelinesData: any;
|
|
4
|
+
targetHighlights?: string[] | undefined;
|
|
5
|
+
labelColor?: string | undefined;
|
|
6
|
+
}) => string;
|
|
7
|
+
export declare const getCitationNumberFromHref: (url: string) => {
|
|
8
|
+
citationNumber: string | null;
|
|
9
|
+
phraseToHighlight: string | null;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/CognitiveCompare/Guidelines/utils/helper.ts"],"names":[],"mappings":"AA6FA,eAAO,MAAM,uCAAuC,eAAgB,MAAM,WAsFzE,CAAC;AAEF,eAAO,MAAM,yBAAyB;oBAKpB,GAAG;;;YAkDpB,CAAC;AAGF,eAAO,MAAM,yBAAyB,QAAS,MAAM,KAAG;IAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CAgBxH,CAAC"}
|
|
@@ -2,6 +2,14 @@ import React, { CSSProperties } from "react";
|
|
|
2
2
|
interface CitationAnchorProps {
|
|
3
3
|
href: string;
|
|
4
4
|
children: any;
|
|
5
|
+
secondaryCitation?: {
|
|
6
|
+
href?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
reason?: string;
|
|
10
|
+
phraseToHighlight?: string;
|
|
11
|
+
occurrenceIndex?: number;
|
|
12
|
+
};
|
|
5
13
|
chevronUpComponent?: React.ReactNode;
|
|
6
14
|
chevronDownComponent?: React.ReactNode;
|
|
7
15
|
customStyle?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EACV,aAAa,EAIhB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EACV,aAAa,EAIhB,MAAM,OAAO,CAAC;AAef,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,iBAAiB,CAAC,EAAE;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;AAoWD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiKjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveComponent.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.tsx"],"names":[],"mappings":"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
|
|
1
|
+
{"version":3,"file":"CognitiveComponent.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAU7C,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAKlH,KAAK,OAAO,GAAG;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAGF,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACvC;AAED,KAAK,KAAK,GAAG;IAET,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,CAAC,aAAa,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,GAAG,CAAA;KAAC,KAAK,IAAI,CAAC;IACnG,eAAe,CAAC,EAAE,OAAO,CAAC;IAG1B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC;IAC/C,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IACnD,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAC3C,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAG7C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,MAAM,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,WAAW,CAAC,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;;AAsaF,wBAAsD"}
|