@e-llm-studio/requirement-ai 0.0.62 → 0.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  2. package/dist/cjs/features/RequirementAI/components/UserStoryCard/AttachedContext.js +2 -0
  3. package/dist/cjs/features/RequirementAI/components/UserStoryCard/AttachedContext.js.map +1 -0
  4. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  5. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +2 -0
  6. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js.map +1 -0
  7. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.module.css.js +2 -0
  8. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.module.css.js.map +1 -0
  9. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationRenderer.js +1 -1
  10. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/icons/ExternalLinkIcon.js +2 -0
  11. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/icons/ExternalLinkIcon.js.map +1 -0
  12. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  13. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  14. package/dist/cjs/features/RequirementAI/icons/MeetingHighlightsIcon.js +2 -0
  15. package/dist/cjs/features/RequirementAI/icons/MeetingHighlightsIcon.js.map +1 -0
  16. package/dist/cjs/features/RequirementAI/shared/AtomicButton.js +1 -1
  17. package/dist/cjs/features/RequirementAI/shared/CodeViewer.js +2 -0
  18. package/dist/cjs/features/RequirementAI/shared/CodeViewer.js.map +1 -0
  19. package/dist/cjs/features/RequirementAI/shared/CodeViewer.module.css.js +2 -0
  20. package/dist/cjs/features/RequirementAI/shared/CodeViewer.module.css.js.map +1 -0
  21. package/dist/cjs/features/RequirementAI/shared/GeneratedCodeCitation.js +1 -1
  22. package/dist/cjs/features/RequirementAI/shared/useMarkdownSearch.js +1 -1
  23. package/dist/cjs/features/RequirementAI/utils/userStoryAttachedContext.utils.js +2 -0
  24. package/dist/cjs/features/RequirementAI/utils/userStoryAttachedContext.utils.js.map +1 -0
  25. package/dist/cjs/index.js +1 -1
  26. package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  27. package/dist/features/RequirementAI/components/UserStoryCard/AttachedContext.js +2 -0
  28. package/dist/features/RequirementAI/components/UserStoryCard/AttachedContext.js.map +1 -0
  29. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  30. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +2 -0
  31. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js.map +1 -0
  32. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.module.css.js +2 -0
  33. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.module.css.js.map +1 -0
  34. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationRenderer.js +1 -1
  35. package/dist/features/RequirementAI/components/citations/readfile-citation/icons/ExternalLinkIcon.js +2 -0
  36. package/dist/features/RequirementAI/components/citations/readfile-citation/icons/ExternalLinkIcon.js.map +1 -0
  37. package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  38. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  39. package/dist/features/RequirementAI/icons/MeetingHighlightsIcon.js +2 -0
  40. package/dist/features/RequirementAI/icons/MeetingHighlightsIcon.js.map +1 -0
  41. package/dist/features/RequirementAI/shared/AtomicButton.js +1 -1
  42. package/dist/features/RequirementAI/shared/CodeViewer.js +2 -0
  43. package/dist/features/RequirementAI/shared/CodeViewer.js.map +1 -0
  44. package/dist/features/RequirementAI/shared/CodeViewer.module.css.js +2 -0
  45. package/dist/features/RequirementAI/shared/CodeViewer.module.css.js.map +1 -0
  46. package/dist/features/RequirementAI/shared/GeneratedCodeCitation.js +1 -1
  47. package/dist/features/RequirementAI/shared/useMarkdownSearch.js +1 -1
  48. package/dist/features/RequirementAI/utils/userStoryAttachedContext.utils.js +2 -0
  49. package/dist/features/RequirementAI/utils/userStoryAttachedContext.utils.js.map +1 -0
  50. package/dist/index.js +1 -1
  51. package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
  52. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +6 -2
  53. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
  54. package/dist/types/src/features/RequirementAI/components/UserStoryCard/AttachedContext.d.ts +7 -0
  55. package/dist/types/src/features/RequirementAI/components/UserStoryCard/AttachedContext.d.ts.map +1 -0
  56. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  57. package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.d.ts +15 -0
  58. package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.d.ts.map +1 -0
  59. package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationRenderer.d.ts.map +1 -1
  60. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +1 -1
  61. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  62. package/dist/types/src/features/RequirementAI/icons/MeetingHighlightsIcon.d.ts +3 -0
  63. package/dist/types/src/features/RequirementAI/icons/MeetingHighlightsIcon.d.ts.map +1 -0
  64. package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts +12 -0
  65. package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts.map +1 -1
  66. package/dist/types/src/features/RequirementAI/shared/AtomicButton.d.ts.map +1 -1
  67. package/dist/types/src/features/RequirementAI/shared/CodeViewer.d.ts +11 -0
  68. package/dist/types/src/features/RequirementAI/shared/CodeViewer.d.ts.map +1 -0
  69. package/dist/types/src/features/RequirementAI/shared/useMarkdownSearch.d.ts +5 -1
  70. package/dist/types/src/features/RequirementAI/shared/useMarkdownSearch.d.ts.map +1 -1
  71. package/dist/types/src/features/RequirementAI/utils/userStoryAttachedContext.utils.d.ts +10 -0
  72. package/dist/types/src/features/RequirementAI/utils/userStoryAttachedContext.utils.d.ts.map +1 -0
  73. package/dist/types/src/index.d.ts +1 -0
  74. package/dist/types/src/index.d.ts.map +1 -1
  75. package/package.json +14 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("../../store/ref.context.js"),i=n.createContext(null);exports.default=function(o){var s=o.children,a=o.userStory,u=o.setUserStory,c=o.aiReasoning,f=o.setAiReasoning,l=o.citations,g=o.setCitations,d=o.apiCachingConfig,h=o.customStyles,v=o.customIcons,C=o.searchQueryList,y=o.searchQueryReasoningIdList,m=o.citationConfig,p=o.chatHistory,R=o.chatCitationConfigs,x=o.gptCitationConfigs,A=o.aiReasoningAccordionOpenStates,I=n.useMemo(function(){if(0===a.length||0===c.length)return Array(a.length).fill(0);var e=Array.from({length:a.length},function(){return[]});return c.forEach(function(t){var n=Number(t.relevance_score);if(!(isNaN(n)||n<=0)){var r="ai_reasoning$".concat(t.id),i=a.findIndex(function(e){var t;return e.value.includes(r)||(null===(t=e.sub_features)||void 0===t?void 0:t.some(function(e){return e.value.includes(r)}))});-1!==i&&e[i].push(n)}}),e.map(function(e){return 0===e.length?0:Math.round(e.reduce(function(e,t){return e+t},0)/e.length)})},[a,c]),S=n.useCallback(function(e){var t,n=a.findIndex(function(t){return t.artifactId===e});return-1===n?0:null!==(t=I[n])&&void 0!==t?t:0},[a,I]);return t.jsx(i.Provider,e.__assign({value:{chatHistory:p,userStory:a,setUserStory:u,aiReasoning:c,setAiReasoning:f,citations:l,setCitations:g,apiCachingConfig:d,customStyles:h,customIcons:v,searchQueryList:C,searchQueryReasoningIdList:y,citationConfig:m,getAvgScoreForStory:S,chatCitationConfigs:R,gptCitationConfigs:x,aiReasoningAccordionOpenStates:A}},{children:t.jsx(r.RefProvider,{children:s})}))},exports.useRequirementAI=function(){var e=n.useContext(i);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("../../store/ref.context.js"),i=n.createContext(null);exports.default=function(s){var o=s.children,a=s.userStory,u=s.setUserStory,c=s.aiReasoning,l=s.setAiReasoning,f=s.citations,g=s.setCitations,d=s.apiCachingConfig,h=s.customStyles,v=s.customIcons,C=s.searchQueryList,p=s.searchQueryReasoningIdList,y=s.citationConfig,m=s.chatHistory,R=s.chatCitationConfigs,x=s.gptCitationConfigs,A=s.aiReasoningAccordionOpenStates,I=s.persistedDataFiles,S=n.useMemo(function(){if(0===a.length||0===c.length)return Array(a.length).fill(0);var e=Array.from({length:a.length},function(){return[]});return c.forEach(function(t){var n=Number(t.relevance_score);if(!(isNaN(n)||n<=0)){var r="ai_reasoning$".concat(t.id),i=a.findIndex(function(e){var t;return e.value.includes(r)||(null===(t=e.sub_features)||void 0===t?void 0:t.some(function(e){return e.value.includes(r)}))});-1!==i&&e[i].push(n)}}),e.map(function(e){return 0===e.length?0:Math.round(e.reduce(function(e,t){return e+t},0)/e.length)})},[a,c]),q=n.useCallback(function(e){var t,n=a.findIndex(function(t){return t.artifactId===e});return-1===n?0:null!==(t=S[n])&&void 0!==t?t:0},[a,S]);return t.jsx(i.Provider,e.__assign({value:{chatHistory:m,userStory:a,setUserStory:u,aiReasoning:c,setAiReasoning:l,citations:f,setCitations:g,apiCachingConfig:d,customStyles:h,customIcons:v,searchQueryList:C,searchQueryReasoningIdList:p,citationConfig:y,getAvgScoreForStory:q,chatCitationConfigs:R,gptCitationConfigs:x,aiReasoningAccordionOpenStates:A,persistedDataFiles:I}},{children:t.jsx(r.RefProvider,{children:o})}))},exports.useRequirementAI=function(){var e=n.useContext(i);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};
2
2
  //# sourceMappingURL=RequirementAIWrapper.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),s=require("../RequirementAIWrapper/RequirementAIWrapper.js"),a=require("@mui/material"),i=require("../../utils/userStoryAttachedContext.utils.js"),o=function(e){return["mp4","mov","webm","mkv"].includes(e)?t.jsx(r.Video,{size:24}):["mp3","wav","ogg","m4a","aac"].includes(e)?t.jsx(r.Headphones,{size:24}):["png","jpg","jpeg","svg","webp","gif"].includes(e)?t.jsx(r.ImageIcon,{size:24}):["pdf","docx","doc","txt","rtf","pages"].includes(e)?t.jsx(r.FileText,{size:24}):t.jsx(r.FileCode,{size:24})},l=function(o){var l=o.item,c=o.isLast,u=o.getIconByExtension,d=s.useRequirementAI().apiCachingConfig,m=d.queryClient,g=d.useGetSignedUrlQuery,x=d.useGetSignedUrlMutation,p=d.getProjectFileUrl,h=n.useState(!1),f=h[0],v=h[1],b=n.useState(""),j=b[0],w=b[1],y=null==p?void 0:p(l.path),_=["getSignedUrl",y],k=g(y,_).data,N=x(y),C=N.mutate,E=N.isPending;n.useEffect(function(){if(!y)return w("Please provide valid gsUtilPath."),void v(!0);m.getQueryData(_)||k||C({gsUtilPath:y})},[y]);return t.jsxs("div",e.__assign({className:"\n group flex items-start gap-4 p-4 mx-2 rounded-[8px] transition-colors\n hover:bg-gray-50 border-b border-transparent\n ".concat(c?"":"border-gray-100","\n ")},{children:[t.jsx("div",e.__assign({className:"mt-1 p-2 bg-violet-50 rounded-[8px] text-violet-500"},{children:i.GetFileIcon(l.extension,l.title.toUpperCase())||u(l.extension)})),t.jsxs("div",e.__assign({className:"flex-1 min-w-0"},{children:[t.jsx("h3",e.__assign({className:"text-[15px] font-semibold text-gray-900 truncate group-hover:text-violet-600 transition-colors"},{children:l.title})),t.jsx("p",e.__assign({className:"text-sm text-gray-500 mt-0.5"},{children:l.metadata}))]})),t.jsx("div",e.__assign({onClick:function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,s,a,i,o,c;return e.__generator(this,function(e){switch(e.label){case 0:t.stopPropagation(),e.label=1;case 1:return e.trys.push([1,4,,5]),(n=k||m.getQueryData(_))?"json"!==l.extension.toLowerCase()?(window.open(n,"_blank"),[2]):[4,fetch(n)]:(E||C({gsUtilPath:y}),[2]);case 2:if(!(r=e.sent()).ok)throw new Error("Failed to fetch artifact JSON");return[4,r.json()];case 3:return s=e.sent(),a=s.id,i=s.modeName,a&&i?(o="".concat(window.location.origin,"/artifact/").concat(a,"/mode/").concat(i),window.open(o,"_blank"),[3,5]):(window.open(n,"_blank"),[2]);case 4:return c=e.sent(),console.error("Redirect failed:",c),window.open(k,"_blank"),[3,5];case 5:return[2]}})})},className:"text-gray-400 hover:text-violet-600 cursor-pointer self-center p-2 rounded-[4px] hover:bg-white transition-all"},{children:E?t.jsx(r.Loader2,{size:24,className:"animate-spin text-gray-500"}):t.jsx(r.ExternalLink,{size:24,className:k?"text-gray-500":""})})),t.jsx(a.Snackbar,e.__assign({open:f,autoHideDuration:3e3,onClose:function(){return v(!1)},anchorOrigin:{vertical:"bottom",horizontal:"right"}},{children:t.jsxs(a.Alert,e.__assign({onClose:function(){return v(!1)},severity:"error",sx:{width:"100%"}},{children:[t.jsx(a.AlertTitle,{children:"Error"}),j]}))}))]}))};exports.default=function(){var a=n.useState(!1),c=a[0],u=a[1],d=n.useRef(null),m=n.useRef(null),g=s.useRequirementAI().persistedDataFiles;n.useEffect(function(){var e=function(e){m.current&&!m.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var x=n.useMemo(function(){var e=[];return g?(Object.entries(g).forEach(function(t){var n=t[0],r=t[1];Array.isArray(r)&&r.forEach(function(t){var r,s=t.filesFromProject;if(s){var a,o=s.name,l=(null===(r=s.type)||void 0===r?void 0:r.toLowerCase())||"",c=(a=s.uploadTime)?new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"";e.push({id:s.url,category:n,title:o,extension:l,metadata:"".concat(c," • ").concat(i.getDisplayFileType(l,o)),path:s.url,uploadTime:s.uploadTime})}})}),e):e},[g]);return n.useEffect(function(){var e=function(e){d.current&&!d.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]),t.jsxs("div",e.__assign({className:"flex flex-col items-end"},{children:[t.jsxs("div",e.__assign({className:"relative inline-block text-left",ref:m},{children:[t.jsxs("button",e.__assign({onClick:function(e){e.stopPropagation(),u(!c)},className:"\n flex items-center gap-2 px-4 py-2 rounded-[8px] border transition-all duration-200\n bg-white border-gray-300 text-gray-700 hover:bg-gray-50 shadow-sm\n "},{children:[t.jsx(r.BookOpen,{size:18,className:"text-gray-600"}),t.jsxs("span",e.__assign({className:"font-medium"},{children:["Attached Context(",x.length,")"]})),c?t.jsx(r.ChevronUp,{size:18}):t.jsx(r.ChevronDown,{size:18})]})),c&&t.jsxs("div",e.__assign({className:"absolute left-0 mt-2 w-[420px] bg-white rounded-[12px] shadow-xl border border-gray-100 z-50 overflow-hidden",style:{animation:"slideIn 0.2s ease-out"}},{children:[t.jsx("div",e.__assign({className:"max-h-[300px] overflow-y-auto py-2 custom-scrollbar"},{children:x.length>0?x.map(function(e,n){return t.jsx(l,{item:e,isLast:n===x.length-1,getIconByExtension:o},e.id)}):t.jsx("div",e.__assign({className:"p-8 text-center text-gray-400 text-sm"},{children:"No attachments found"}))})),x.length>4&&t.jsx("div",{className:"h-4 bg-gradient-to-t from-gray-50/50 to-transparent pointer-events-none"})]}))]})),t.jsx("style",{children:"\n @keyframes slideIn {\n from { opacity: 0; transform: translateY(-10px) scale(0.98); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n .custom-scrollbar::-webkit-scrollbar {\n width: 6px;\n }\n .custom-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n .custom-scrollbar::-webkit-scrollbar-thumb {\n background: #e5e7eb;\n border-radius: 10px;\n }\n .custom-scrollbar::-webkit-scrollbar-thumb:hover {\n background: #d1d5db;\n }\n "})]}))};
2
+ //# sourceMappingURL=AttachedContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachedContext.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"),r=require("lucide-react"),s=require("showdown"),o=require("@mui/material"),i=require("uuid"),a=require("./UserStoryCard.module.css.js"),l=require("../../utils/helpers.js"),u=require("../../utils/user-story.utils.js"),d=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=y(s);function m(n){for(var s,a=[],l=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(s=l.exec(n));){var c=s[1],f=s.index;f>u&&a.push(t.jsx("span",{children:n.slice(u,f)},"text-pre-".concat(d++))),a.push(t.jsx(o.Tooltip,e.__assign({title:c,placement:"top"},{children:t.jsx(r.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(i.v4()))),u=l.lastIndex}return u<(null==n?void 0:n.length)&&a.push(t.jsx("span",{children:n.slice(u)},"text-post-".concat(d++))),a}var h=function(n){var s,o=n.displayName,i=v.useRequirementAI().customStyles,l=null===(s=null==i?void 0:i.userStoryCardStyles)||void 0===s?void 0:s.showDisplayName;return t.jsxs("div",e.__assign({className:a.default.displayName,style:null==l?void 0:l.wrapper},{children:[t.jsx(r.Bookmark,{className:a.default.displayNameIcon,style:null==l?void 0:l.displayNameIcon}),t.jsxs("span",e.__assign({style:null==l?void 0:l.label},{children:[o,":"]}))]}))},S=function(s){var i,y,p=s.isUserStoryCurrentlyUpdated,x=s.artifactId,g=s.artifactTitleId,I=s.parentUserStory,j=s.currentUserStory,C=s.onUserStoryChange,w=s.parentIndex,U=s.currentIndex,N=s.enableDownload,b=s.isDiffEditReviewMode,D=s.showUserStoryDiff,M=s.handleDownloadUserStory,k=s.handleOpenSendDialog,q=s.updateUserStoryArtifact,A=s.selectedArtifactId,B=v.useRequirementAI(),R=B.searchQueryList,T=B.citations,E=B.customStyles,L=null==E?void 0:E.userStoryCardStyles,P=null===(i=null==E?void 0:E.userStoryScreenStyles)||void 0===i?void 0:i.userStoryContentStyles,W=n.useState(e.__assign(e.__assign({},structuredClone(j)),{value:l.formatMarkdown(j.value)||""})),z=W[0],O=W[1],H=n.useState({userStory:!1}),F=H[0],V=H[1],Q=v.useRequirementAI().userStory,G=n.useState(""===w||A===j.artifactId),J=G[0],K=G[1],X=n.useState(!1);X[0];var Y=X[1],Z=n.useState(null),$=Z[0],ee=Z[1],te=n.useState(!1),ne=te[0],re=te[1],se=n.useRef(null),oe=n.useState(!1);oe[0];var ie=oe[1];n.useEffect(function(){p&&K(p)},[p]),n.useEffect(function(){O(e.__assign(e.__assign({},structuredClone(j)),{value:l.formatMarkdown(j.value)||""}))},[j]),n.useEffect(function(){R.length>0?K(!0):A&&K(A===j.artifactId)},[R,A,j.artifactId]);var ae=function(){ee(null)},le=function(){K(function(e){return!e})};return t.jsxs("div",e.__assign({className:a.default.card,style:null==L?void 0:L.cardStyle},{children:[t.jsxs("div",e.__assign({className:a.default.titleSection,style:null==L?void 0:L.titleSection},{children:[t.jsxs("div",e.__assign({className:a.default.titleRow,style:null==L?void 0:L.titleRow,onClick:le},{children:[t.jsxs("div",e.__assign({className:a.default.titleLeft,style:null==L?void 0:L.titleLeft,onMouseEnter:function(){return ie(!0)},onMouseLeave:function(){return ie(!1)}},{children:[t.jsx(h,{displayName:g}),t.jsx("h2",e.__assign({className:a.default.storyTitle,style:null==L?void 0:L.storyTitle},{children:m(j.title)}),j.artifactId)]})),t.jsxs("div",e.__assign({className:a.default.titleActions,style:null==L?void 0:L.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[!F.userStory&&t.jsxs(t.Fragment,{children:[t.jsx("button",e.__assign({className:a.default.iconButton,style:null==L?void 0:L.iconButton,onClick:function(e){ee(e.currentTarget)}},{children:t.jsx(r.ExternalLink,{size:16})})),t.jsxs(o.Menu,e.__assign({id:"user-story-share-menu",anchorEl:$,open:!!$,onClose:function(){return ee(null)},style:null==L?void 0:L.userStoryShareMenu},{children:[N&&t.jsx(o.MenuItem,e.__assign({style:null==L?void 0:L.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 Y(!0),M?[4,Promise.all([M("pdf"),M("doc")])]:[2];case 1:return e.sent(),Y(!1),[2]}})})}},{children:t.jsxs("div",e.__assign({ref:se,className:a.default.menuItemContent,style:null==L?void 0:L.menuItemContent},{children:[t.jsx(r.Download,{size:16,color:null==L?void 0:L.menuIconColor}),t.jsx("p",e.__assign({style:null==L?void 0:L.menuLabel},{children:"Download"}))]}))})),t.jsx(o.MenuItem,e.__assign({style:null==L?void 0:L.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){return t=j,I&&(t=e.__assign(e.__assign({},j),{value:"".concat(u.replaceTitleSection(null==I?void 0:I.value,j.title)," \n").concat(j.value)})),null==k||k(!0,[t],j.artifactId),ae(),[2]})})}},{children:t.jsxs("div",e.__assign({style:null==L?void 0:L.menuItemContent,className:a.default.menuItemContentPadded},{children:[t.jsx(r.Share2,{size:16,color:null==L?void 0:L.menuIconColor}),t.jsx("p",e.__assign({style:null==L?void 0:L.menuLabel},{children:"Send"}))]}))})),t.jsx(o.MenuItem,e.__assign({style:null==L?void 0:L.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,r,s,o;return e.__generator(this,function(e){switch(e.label){case 0:t=new _.default.Converter,n=t.makeHtml(l.formatMarkdown(j.value)||j.value),r=function(e){var t=(new _.default.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(l.formatMarkdown(j.value)||j.value),s=new ClipboardItem({"text/plain":new Blob([r],{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 o=e.sent(),console.error("Failed to copy user story:",o),[3,5];case 4:return ae(),[7];case 5:return[2]}})})}},{children:t.jsxs("div",e.__assign({style:null==L?void 0:L.menuItemContent,className:a.default.menuItemContentPadded},{children:[t.jsx(r.Copy,{size:16,color:null==L?void 0:L.menuIconColor}),t.jsx("p",e.__assign({style:null==L?void 0:L.menuLabel},{children:"Copy"}))]}))}))]}))]}),F.userStory&&J?t.jsx(d.default,{type:"outline",children:"Cancel",style:null==L?void 0:L.cancelButton,onClick:function(){V(function(t){return e.__assign(e.__assign({},t),{userStory:!1})})}}):t.jsx(t.Fragment,{}),F.userStory&&J?t.jsx(d.default,{type:"fill",children:ne?t.jsxs("span",e.__assign({className:a.default.savingSpinner},{children:[t.jsx(r.LoaderCircle,{className:a.default.spinAnimation}),t.jsx("span",{children:"Saving..."})]})):"Save",isDisable:ne,style:null==L?void 0:L.saveButton,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(t){switch(t.label){case 0:return re(!0),"userStory"==="userStory"&&(C(z),console.log("I am changing RTE editor values",z)),[4,q(T,Q,x)];case 1:return t.sent(),V(function(t){return e.__assign(e.__assign({},t),{userStory:!1})}),re(!1),[2]}})})}}):!b&&!D&&J&&t.jsx("button",e.__assign({className:a.default.iconButton,style:null==L?void 0:L.editButton,onClick:function(){return V(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})}},{children:t.jsx(r.PencilIcon,{color:null==L?void 0:L.pencilIconColor,size:16})})),t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),le()},style:null==L?void 0:L.chevronButton,className:a.default.chevronButton},{children:J?t.jsx(r.ChevronUp,{className:a.default.chevronIcon,color:null==L?void 0:L.chevronIconColor}):t.jsx(r.ChevronDown,{className:a.default.chevronIcon,color:null==L?void 0:L.chevronIconColor})}))]}))]})),t.jsx("div",{className:a.default.divider,style:null==L?void 0:L.dividerStyle})]})),J&&t.jsx("div",e.__assign({className:a.default.cardContent,style:null==L?void 0:L.cardContentStyle},{children:t.jsxs("div",e.__assign({className:a.default.contentInner,style:null==L?void 0:L.contentInner},{children:[t.jsxs("div",e.__assign({className:a.default.descriptionSection,style:null==L?void 0:L.descriptionSection},{children:[t.jsx("div",{className:a.default.justifyBetween,style:null==L?void 0:L.justifyBetween}),F.userStory?t.jsx(c.default,{minHeight:"100%",height:"100%",type:"string",value:l.formatMarkdown(j.value)||"",handleUpdateState:function(t,n){var r=l.indentMarkdown(n);O(function(t){return e.__assign(e.__assign({},t),{value:r||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:F.userStory?"edit":"readOnly"}):t.jsx(f.default,{showUserStoryDiff:D,isParent:""===w,message:l.formatMarkdown(j.value)||"",artifactId:j.artifactId,customStyles:P})]})),null===(y=z.sub_features)||void 0===y?void 0:y.map(function(n,r){return t.jsx(S,{artifactId:x,isUserStoryCurrentlyUpdated:p,artifactTitleId:"".concat(g,"-").concat(String.fromCharCode(65+r)),parentUserStory:j,parentIndex:"".concat(w).concat(w&&".").concat(U),currentIndex:"".concat(r+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(t){return function(t,n){var r=e.__spreadArray([],j.sub_features||[],!0);r[t]=n,C(e.__assign(e.__assign({},j),{sub_features:r}))}(r,t)},enableDownload:!0,isDiffEditReviewMode:b,showUserStoryDiff:D,updateUserStoryArtifact:q,handleDownloadUserStory:M,handleOpenSendDialog:k},n.artifactId)})]}))}))]}))};exports.StoryCard=S,exports.UserStoryCardWrapper=function(n){var r=n.artifactTitleIDs,s=n.isDiffEditReviewMode,o=n.showUserStoryDiff,i=n.updateUserStoryArtifact,l=n.isUserStoryCurrentlyUpdated,u=n.artifactId,d=n.handleOpenSendDialog,c=n.handleDownloadUserStory,f=n.selectedArtifactId,y=v.useRequirementAI(),_=y.userStory,m=y.setUserStory,h=y.customStyles,p=null==h?void 0:h.userStoryCardStyles;return t.jsx("div",e.__assign({className:a.default.userStoryCardWrapper,style:null==p?void 0:p.userStoryCardWrapper},{children:_.map(function(n,a){return t.jsx(S,{isUserStoryCurrentlyUpdated:l,artifactId:u,artifactTitleId:r[a]||"",currentUserStory:n,onUserStoryChange:function(t){m(function(n){return n[a]=t,e.__spreadArray([],n,!0)})},parentIndex:"",currentIndex:"".concat(a+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:s,showUserStoryDiff:o,updateUserStoryArtifact:i,handleOpenSendDialog:d,handleDownloadUserStory:c,selectedArtifactId:f},n.artifactId)})}))},exports.default=S,exports.replaceLearnedTagsWithInfo=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),s=require("showdown"),o=require("@mui/material"),i=require("uuid"),a=require("./UserStoryCard.module.css.js"),l=require("../../utils/helpers.js"),u=require("../../utils/user-story.utils.js"),d=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=y(s);function m(n){for(var s,a=[],l=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(s=l.exec(n));){var c=s[1],f=s.index;f>u&&a.push(t.jsx("span",{children:n.slice(u,f)},"text-pre-".concat(d++))),a.push(t.jsx(o.Tooltip,e.__assign({title:c,placement:"top"},{children:t.jsx(r.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(i.v4()))),u=l.lastIndex}return u<(null==n?void 0:n.length)&&a.push(t.jsx("span",{children:n.slice(u)},"text-post-".concat(d++))),a}var h=function(n){var s,o=n.displayName,i=v.useRequirementAI().customStyles,l=null===(s=null==i?void 0:i.userStoryCardStyles)||void 0===s?void 0:s.showDisplayName;return t.jsxs("div",e.__assign({className:a.default.displayName,style:null==l?void 0:l.wrapper},{children:[t.jsx(r.Bookmark,{className:a.default.displayNameIcon,style:null==l?void 0:l.displayNameIcon}),t.jsxs("span",e.__assign({style:null==l?void 0:l.label},{children:[o,":"]}))]}))},S=function(s){var i,y,p=s.isUserStoryCurrentlyUpdated,x=s.artifactId,g=s.artifactTitleId,I=s.parentUserStory,j=s.currentUserStory,C=s.onUserStoryChange,w=s.parentIndex,U=s.currentIndex,N=s.enableDownload,b=s.isDiffEditReviewMode,D=s.showUserStoryDiff,M=s.handleDownloadUserStory,k=s.handleOpenSendDialog,q=s.updateUserStoryArtifact,A=s.selectedArtifactId,B=v.useRequirementAI(),R=B.searchQueryList,T=B.citations,E=B.customStyles,L=null==E?void 0:E.userStoryCardStyles,P=null===(i=null==E?void 0:E.userStoryScreenStyles)||void 0===i?void 0:i.userStoryContentStyles,W=n.useState(e.__assign(e.__assign({},structuredClone(j)),{value:l.formatMarkdown(j.value)||""})),z=W[0],O=W[1],H=n.useState({userStory:!1}),F=H[0],V=H[1],Q=v.useRequirementAI().userStory,G=n.useState(""===w||A===j.artifactId),J=G[0],K=G[1],X=n.useState(!1);X[0];var Y=X[1],Z=n.useState(null),$=Z[0],ee=Z[1],te=n.useState(!1),ne=te[0],re=te[1],se=n.useRef(null),oe=n.useState(!1);oe[0];var ie=oe[1];n.useEffect(function(){p&&K(p)},[p]),n.useEffect(function(){O(e.__assign(e.__assign({},structuredClone(j)),{value:l.formatMarkdown(j.value)||""}))},[j]),n.useEffect(function(){R.length>0?K(!0):A&&K(A===j.artifactId)},[R,A,j.artifactId]);var ae=function(){ee(null)},le=function(){K(function(e){return!e})};return t.jsxs("div",e.__assign({className:a.default.card,style:null==L?void 0:L.cardStyle},{children:[t.jsxs("div",e.__assign({className:a.default.titleSection,style:null==L?void 0:L.titleSection},{children:[t.jsxs("div",e.__assign({className:a.default.titleRow,style:null==L?void 0:L.titleRow,onClick:le},{children:[t.jsxs("div",e.__assign({className:a.default.titleLeft,style:null==L?void 0:L.titleLeft,onMouseEnter:function(){return ie(!0)},onMouseLeave:function(){return ie(!1)}},{children:[t.jsx(h,{displayName:g}),t.jsx("h2",e.__assign({className:a.default.storyTitle,style:null==L?void 0:L.storyTitle},{children:m(j.title)}),j.artifactId)]})),t.jsxs("div",e.__assign({className:a.default.titleActions,style:null==L?void 0:L.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[!F.userStory&&t.jsxs(t.Fragment,{children:[t.jsx("button",e.__assign({className:a.default.iconButton,style:null==L?void 0:L.iconButton,onClick:function(e){ee(e.currentTarget)}},{children:t.jsx(r.ExternalLink,{size:16})})),t.jsxs(o.Menu,e.__assign({id:"user-story-share-menu",anchorEl:$,open:!!$,onClose:function(){return ee(null)},style:null==L?void 0:L.userStoryShareMenu},{children:[N&&t.jsx(o.MenuItem,e.__assign({style:null==L?void 0:L.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 Y(!0),M?[4,Promise.all([M("pdf"),M("doc")])]:[2];case 1:return e.sent(),Y(!1),[2]}})})}},{children:t.jsxs("div",e.__assign({ref:se,className:a.default.menuItemContent,style:null==L?void 0:L.menuItemContent},{children:[t.jsx(r.Download,{size:16,color:null==L?void 0:L.menuIconColor}),t.jsx("p",e.__assign({style:null==L?void 0:L.menuLabel},{children:"Download"}))]}))})),t.jsx(o.MenuItem,e.__assign({style:null==L?void 0:L.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){return t=j,I&&(t=e.__assign(e.__assign({},j),{value:"".concat(u.replaceTitleSection(null==I?void 0:I.value,j.title)," \n").concat(j.value)})),null==k||k(!0,[t],j.artifactId),ae(),[2]})})}},{children:t.jsxs("div",e.__assign({style:null==L?void 0:L.menuItemContent,className:a.default.menuItemContentPadded},{children:[t.jsx(r.Share2,{size:16,color:null==L?void 0:L.menuIconColor}),t.jsx("p",e.__assign({style:null==L?void 0:L.menuLabel},{children:"Send"}))]}))})),t.jsx(o.MenuItem,e.__assign({style:null==L?void 0:L.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,r,s,o;return e.__generator(this,function(e){switch(e.label){case 0:t=new _.default.Converter,n=t.makeHtml(l.formatMarkdown(j.value)||j.value),r=function(e){var t=(new _.default.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(l.formatMarkdown(j.value)||j.value),s=new ClipboardItem({"text/plain":new Blob([r],{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 o=e.sent(),console.error("Failed to copy user story:",o),[3,5];case 4:return ae(),[7];case 5:return[2]}})})}},{children:t.jsxs("div",e.__assign({style:null==L?void 0:L.menuItemContent,className:a.default.menuItemContentPadded},{children:[t.jsx(r.Copy,{size:16,color:null==L?void 0:L.menuIconColor}),t.jsx("p",e.__assign({style:null==L?void 0:L.menuLabel},{children:"Copy"}))]}))}))]}))]}),F.userStory&&J?t.jsx(d.default,{isDisable:ne,type:"outline",children:"Cancel",style:null==L?void 0:L.cancelButton,onClick:function(){V(function(t){return e.__assign(e.__assign({},t),{userStory:!1})})}}):t.jsx(t.Fragment,{}),F.userStory&&J?t.jsx(d.default,{type:"fill",children:ne?t.jsxs("span",e.__assign({className:a.default.savingSpinner},{children:[t.jsx(r.LoaderCircle,{className:a.default.spinAnimation}),t.jsx("span",{children:"Saving..."})]})):"Save",isDisable:ne,style:null==L?void 0:L.saveButton,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(t){switch(t.label){case 0:return re(!0),"userStory"==="userStory"&&(C(z),console.log("I am changing RTE editor values",z)),[4,q(T,Q,x)];case 1:return t.sent(),V(function(t){return e.__assign(e.__assign({},t),{userStory:!1})}),re(!1),[2]}})})}}):!b&&!D&&J&&t.jsx("button",e.__assign({className:a.default.iconButton,style:null==L?void 0:L.editButton,onClick:function(){return V(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})}},{children:t.jsx(r.PencilIcon,{color:null==L?void 0:L.pencilIconColor,size:16})})),t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),le()},style:null==L?void 0:L.chevronButton,className:a.default.chevronButton},{children:J?t.jsx(r.ChevronUp,{className:a.default.chevronIcon,color:null==L?void 0:L.chevronIconColor}):t.jsx(r.ChevronDown,{className:a.default.chevronIcon,color:null==L?void 0:L.chevronIconColor})}))]}))]})),t.jsx("div",{className:a.default.divider,style:null==L?void 0:L.dividerStyle})]})),J&&t.jsx("div",e.__assign({className:a.default.cardContent,style:null==L?void 0:L.cardContentStyle},{children:t.jsxs("div",e.__assign({className:a.default.contentInner,style:null==L?void 0:L.contentInner},{children:[t.jsxs("div",e.__assign({className:a.default.descriptionSection,style:null==L?void 0:L.descriptionSection},{children:[t.jsx("div",{className:a.default.justifyBetween,style:null==L?void 0:L.justifyBetween}),F.userStory?t.jsx(c.default,{minHeight:"100%",height:"100%",type:"string",value:l.formatMarkdown(j.value)||"",handleUpdateState:function(t,n){var r=l.indentMarkdown(n);O(function(t){return e.__assign(e.__assign({},t),{value:r||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:F.userStory?"edit":"readOnly"}):t.jsx(f.default,{showUserStoryDiff:D,isParent:""===w,message:l.formatMarkdown(j.value)||"",artifactId:j.artifactId,customStyles:P})]})),null===(y=z.sub_features)||void 0===y?void 0:y.map(function(n,r){return t.jsx(S,{artifactId:x,isUserStoryCurrentlyUpdated:p,artifactTitleId:"".concat(g,"-").concat(String.fromCharCode(65+r)),parentUserStory:j,parentIndex:"".concat(w).concat(w&&".").concat(U),currentIndex:"".concat(r+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(t){return function(t,n){var r=e.__spreadArray([],j.sub_features||[],!0);r[t]=n,C(e.__assign(e.__assign({},j),{sub_features:r}))}(r,t)},enableDownload:!0,isDiffEditReviewMode:b,showUserStoryDiff:D,updateUserStoryArtifact:q,handleDownloadUserStory:M,handleOpenSendDialog:k},n.artifactId)})]}))}))]}))};exports.StoryCard=S,exports.UserStoryCardWrapper=function(n){var r=n.artifactTitleIDs,s=n.isDiffEditReviewMode,o=n.showUserStoryDiff,i=n.updateUserStoryArtifact,l=n.isUserStoryCurrentlyUpdated,u=n.artifactId,d=n.handleOpenSendDialog,c=n.handleDownloadUserStory,f=n.selectedArtifactId,y=v.useRequirementAI(),_=y.userStory,m=y.setUserStory,h=y.customStyles,p=null==h?void 0:h.userStoryCardStyles;return t.jsx("div",e.__assign({className:a.default.userStoryCardWrapper,style:null==p?void 0:p.userStoryCardWrapper},{children:_.map(function(n,a){return t.jsx(S,{isUserStoryCurrentlyUpdated:l,artifactId:u,artifactTitleId:r[a]||"",currentUserStory:n,onUserStoryChange:function(t){m(function(n){return n[a]=t,e.__spreadArray([],n,!0)})},parentIndex:"",currentIndex:"".concat(a+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:s,showUserStoryDiff:o,updateUserStoryArtifact:i,handleOpenSendDialog:d,handleDownloadUserStory:c,selectedArtifactId:f},n.artifactId)})}))},exports.default=S,exports.replaceLearnedTagsWithInfo=m;
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("monaco-editor"),r=require("./ReadFileCitationContent.module.css.js"),o=require("./icons/ExternalLinkIcon.js");function a(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}}),n.default=e,Object.freeze(n)}var l=a(i);"undefined"!=typeof self&&(self.MonacoEnvironment=e.__assign(e.__assign({},self.MonacoEnvironment),{getWorker:function(){return{postMessage:function(){},terminate:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!0},onmessage:null,onerror:null,onmessageerror:null}}}));var s=!1,u=function(){if(!s&&"undefined"!=typeof document)try{var e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;overflow:hidden;visibility:hidden;pointer-events:none;",document.body.appendChild(e),l.editor.create(e,{value:"",language:"plaintext",automaticLayout:!1,minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden"},overviewRulerLanes:0,lineNumbers:"off",glyphMargin:!1,folding:!1,lineDecorationsWidth:0,lineNumbersMinChars:0}).dispose(),document.body.removeChild(e),s=!0}catch(e){s=!0}};u(),"undefined"!=typeof window&&(window.addEventListener("error",function(e){var n=e.message||"";if(n.includes("Worker")||n.includes("Monaco"))return e.preventDefault(),e.stopImmediatePropagation(),!1},!0),window.addEventListener("unhandledrejection",function(e){var n,t=(null===(n=e.reason)||void 0===n?void 0:n.message)||String(e.reason||"");(t.includes("Worker")||t.includes("Monaco"))&&(e.preventDefault(),e.stopImmediatePropagation())},!0));var c={border:"#3c3c3c",headerBg:"#252526",inactiveText:"#858585",background:"#1e1e1e",foreground:"#cccccc",highlightBg:"rgba(59, 130, 246, 0.15)",highlightGutter:"#3b82f6",hoverBg:"rgba(255, 255, 255, 0.1)"},d={theme:"vs-dark",fontSize:13,fontFamily:"Consolas, 'Courier New', monospace",maxHeight:300,minHeight:80},h={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",py:"python",rb:"ruby",java:"java",cpp:"cpp",c:"c",go:"go",rust:"rust",json:"json",html:"html",css:"css",scss:"scss",md:"markdown",sql:"sql",sh:"shell",bash:"shell",yaml:"yaml",yml:"yaml"},f=function(e){return h[e.toLowerCase()]||e},g=function(i){var o=i.code,a=i.language,s=i.theme,c=i.fontSize,d=i.fontFamily,h=i.height,g=i.highlightRanges,m=i.backgroundColor,v=i.editorWrapperStyle,p=t.useRef(null),b=t.useRef(null),y=t.useRef(!1);return t.useEffect(function(){y.current=!1,u();var e=setTimeout(function(){var e=p.current;if(e&&!y.current&&!b.current)try{l.editor.setTheme(s);var n=l.editor.create(e,{value:o,language:f(a),readOnly:!0,domReadOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:c,lineHeight:20,fontFamily:d,lineNumbers:"on",folding:!1,lineDecorationsWidth:10,lineNumbersMinChars:4,renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!1,alwaysConsumeMouseWheel:!1},automaticLayout:!0,wordWrap:"off",contextmenu:!1,selectOnLineNumbers:!0,glyphMargin:!1,padding:{top:8,bottom:8},overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,overviewRulerLanes:0,renderWhitespace:"none",guides:{indentation:!1},cursorStyle:"line",cursorBlinking:"solid",fixedOverflowWidgets:!0});if(b.current=n,g.length>0){var t=g.map(function(e){var n=e[0],t=e[1];return{range:new l.Range(n,1,t,1),options:{isWholeLine:!0,className:r.default.highlightedLine,linesDecorationsClassName:r.default.highlightedLineDecoration}}});n.createDecorationsCollection(t);var i=g[0];i&&requestAnimationFrame(function(){!y.current&&b.current&&n.revealLineInCenter(i[0])})}}catch(e){}},50);return function(){if(y.current=!0,clearTimeout(e),b.current){try{b.current.dispose()}catch(e){}b.current=null}}},[]),t.useEffect(function(){try{l.editor.setTheme(s)}catch(e){}},[s]),n.jsx("div",e.__assign({className:r.default.editorWrapper,style:e.__assign({height:"".concat(h,"px"),backgroundColor:m},v)},{children:n.jsx("div",{ref:p,style:{width:"100%",height:"100%"}})}))};exports.default=function(i){var a=i.citation,l=i.customStyles,s=i.customColors,u=i.customIcons,h=i.editorConfig,f=i.fileCallback,m=t.useMemo(function(){return e.__assign(e.__assign({},c),s)},[s]),v=t.useMemo(function(){return e.__assign(e.__assign({},d),h)},[h]),p=t.useRef(null),b=t.useRef(!1),y=a.customMetadata.content||"",_=a.customMetadata.highlighted_text,x=t.useMemo(function(){if(!_)return{};try{var e=_.trim();return e.startsWith("```")&&(e=(e=e.replace(/^```\w*\n?/,"")).replace(/\n?```\s*$/,"")),JSON.parse(e.trim())}catch(e){return console.error("Failed to parse highlight string:",e),{}}},[_]),j=t.useMemo(function(){for(var e,n=[],t=/```(\w+)?\s*<file_path>([\s\S]*?)<\/file_path>\s*<code>([\s\S]*?)<\/code>\s*```/g;null!==(e=t.exec(y));){var i=e[1]||"javascript",r=e[2].trim(),o=e[3].trim();r&&o&&n.push({filePath:r,code:o,language:i})}return n},[y]),C=t.useCallback(function(e){return(x[e]||[]).map(function(e){var n=e.split("-").map(Number),t=n[0];return[t,n.length>1?n[1]:t]})},[x]),w=t.useMemo(function(){for(var e=0;e<j.length;e++){if(C(j[e].filePath).length>0)return e}return-1},[j,C]),k=w>=0,M=t.useCallback(function(e,n){return C(e).map(function(e){var t=e[0],i=e[1];return t>n?[0,0]:[t,Math.min(i,n)]}).filter(function(e){var n=e[0],t=e[1];return n>0&&t>=n})},[C]),N=t.useCallback(function(e){var n=20*e.split("\n").length+16+4;return Math.min(Math.max(n,v.minHeight),v.maxHeight)},[v.minHeight,v.maxHeight]);t.useEffect(function(){if(k&&!b.current&&j.length>0&&(null==f?void 0:f.autoOpenFirstHighlighted)&&(null==f?void 0:f.onOpenFile)){var e=j[w],n=M(e.filePath,e.code.split("\n").length);b.current=!0;var t=setTimeout(function(){f.onOpenFile({filePath:e.filePath,ranges:n.length>0?n:null})},300);return function(){return clearTimeout(t)}}},[k,w,j,M,f]),t.useEffect(function(){b.current=!1},[y]),t.useEffect(function(){if(!(w<0)){var e=setTimeout(function(){var e;null===(e=p.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},350);return function(){return clearTimeout(e)}}},[w,_]);var L=t.useCallback(function(e,n){if(null==f?void 0:f.onOpenFile){var t=M(e,n);f.onOpenFile({filePath:e,ranges:t.length>0?t:null})}},[M,f]),O=!!(null==f?void 0:f.onOpenFile),S=(null==u?void 0:u.readFileCitationIcon)||n.jsx(o.default,{style:{width:"14px",height:"14px"}});return 0===j.length?n.jsx("div",e.__assign({className:r.default.emptyState,style:e.__assign({color:m.inactiveText},null==l?void 0:l.emptyState)},{children:"No code content available"})):n.jsx("div",e.__assign({className:r.default.container,style:null==l?void 0:l.container},{children:j.map(function(t,i){var o,a=C(t.filePath),s=a.length>0,u=i===w,c=N(t.code),d=t.filePath.split("/").pop(),h=t.code.split("\n").length,f=M(t.filePath,h);return n.jsxs("div",e.__assign({ref:u?p:void 0,"data-highlighted":s?"true":void 0,"data-first-highlighted":u?"true":void 0,className:r.default.blockContainer,style:e.__assign({border:"1px solid ".concat(m.border)},null==l?void 0:l.blockContainer)},{children:[n.jsxs("div",e.__assign({className:r.default.header,style:e.__assign({backgroundColor:s?m.highlightBg:m.headerBg,borderBottom:"1px solid ".concat(m.border),color:s?m.highlightGutter:m.foreground},s?null==l?void 0:l.headerHighlighted:null==l?void 0:l.header)},{children:[n.jsxs("div",e.__assign({className:r.default.headerLeft},{children:[n.jsx("span",e.__assign({className:r.default.fileName,title:t.filePath,style:null==l?void 0:l.fileName},{children:d})),O&&n.jsx("button",e.__assign({className:r.default.openFileButton,onClick:function(){return L(t.filePath,h)},title:"Open in editor","aria-label":"Open ".concat(d," in editor"),style:null==l?void 0:l.openFileButton},{children:S}))]})),s&&n.jsx("span",e.__assign({className:r.default.lineRanges,style:null==l?void 0:l.lineRanges},{children:(o=a,o.map(function(e){var n=e[0],t=e[1];return n===t?"L".concat(n):"L".concat(n,"-").concat(t)}).join(", "))}))]})),n.jsx(g,{code:t.code,language:t.language,theme:v.theme,fontSize:v.fontSize,fontFamily:v.fontFamily,height:c,highlightRanges:f,backgroundColor:m.background,editorWrapperStyle:null==l?void 0:l.editorWrapper})]}),i)})}))};
2
+ //# sourceMappingURL=ReadFileCitationContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadFileCitationContent.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 t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".ReadFileCitationContent-module_container__Oi3tV{display:flex;flex-direction:column;gap:12px;margin-top:4px}.ReadFileCitationContent-module_blockContainer__yGEX8{border-radius:4px;overflow:hidden}.ReadFileCitationContent-module_header__39-AD{align-items:center;display:flex;font-family:monospace;font-size:12px;gap:8px;justify-content:space-between;padding:6px 12px}.ReadFileCitationContent-module_headerLeft__WOyMV{align-items:center;display:flex;flex:1;gap:8px;min-width:0}.ReadFileCitationContent-module_fileName__ql9Qu{opacity:.9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ReadFileCitationContent-module_openFileButton__oqea1{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_openFileButton__oqea1:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_lineRanges__RIofb{flex-shrink:0;font-size:11px;max-width:300px;opacity:.7;overflow-x:auto;white-space:nowrap}.ReadFileCitationContent-module_editorWrapper__ab5Sg{overflow:hidden}.ReadFileCitationContent-module_highlightedLine__w6iv-{background-color:#3b82f626!important}.ReadFileCitationContent-module_highlightedLineDecoration__EykBL{background-color:#3b82f6;margin-left:0;width:3px!important}.ReadFileCitationContent-module_emptyState__34kcg{font-size:14px;padding:12px;text-align:center}.ReadFileCitationContent-module_loadingEditor__aOHYT{align-items:center;display:flex;font-size:14px;height:64px;justify-content:center}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={container:"ReadFileCitationContent-module_container__Oi3tV",blockContainer:"ReadFileCitationContent-module_blockContainer__yGEX8",header:"ReadFileCitationContent-module_header__39-AD",headerLeft:"ReadFileCitationContent-module_headerLeft__WOyMV",fileName:"ReadFileCitationContent-module_fileName__ql9Qu",openFileButton:"ReadFileCitationContent-module_openFileButton__oqea1",lineRanges:"ReadFileCitationContent-module_lineRanges__RIofb",editorWrapper:"ReadFileCitationContent-module_editorWrapper__ab5Sg",highlightedLine:"ReadFileCitationContent-module_highlightedLine__w6iv-",highlightedLineDecoration:"ReadFileCitationContent-module_highlightedLineDecoration__EykBL",emptyState:"ReadFileCitationContent-module_emptyState__34kcg",loadingEditor:"ReadFileCitationContent-module_loadingEditor__aOHYT"};
2
+ //# sourceMappingURL=ReadFileCitationContent.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadFileCitationContent.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("../../../../CitationRenderer/CitationRenderer.js"),i=require("./icons/FileCodeIcon.js");exports.default=function(o){var r=o.title;o.citation;var a=o.customStyles;o.customColors;var l=o.customIcons;o.editorConfig,o.fileCallback;var s=(null==l?void 0:l.readFileCitationIcon)||t.jsx(i.default,{className:"inline align-super mb-1 ml-1",style:{width:"12px",height:"12px"}}),c=r+"⁠";return t.jsx(n.default,{inLineCitation:!0,citationTitle:c,citationIcon:t.jsx(t.Fragment,{}),citationComponent:t.jsx(t.Fragment,{}),chevronDownComponent:s,chevronUpComponent:s,styles:{pillButton:e.__assign({fontSize:"13px",margin:"0px",padding:"0px 4px",color:"#3b82f6",cursor:"pointer",verticalAlign:"baseline",whiteSpace:"normal",wordBreak:"break-all",display:"inline-flex",alignItems:"unset",background:"transparent",border:"none"},null==a?void 0:a.pill),citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}}})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("../../../../CitationRenderer/CitationRenderer.js"),n=require("./icons/FileCodeIcon.js"),o=require("./ReadFileCitationContent.js");exports.default=function(r){var a=r.title,l=r.citation,s=r.customStyles,c=r.customColors,u=r.customIcons,d=r.editorConfig,p=r.fileCallback,m=(null==u?void 0:u.readFileCitationIcon)||t.jsx(n.default,{className:"inline align-super mb-1 ml-1",style:{width:"12px",height:"12px"}}),C=a+"⁠";return t.jsx(i.default,{inLineCitation:!0,citationTitle:C,citationIcon:t.jsx(t.Fragment,{}),citationComponent:t.jsx(o.default,{citation:l,customStyles:s,customColors:c,customIcons:u,editorConfig:d,fileCallback:p}),chevronDownComponent:m,chevronUpComponent:m,styles:{pillButton:e.__assign({fontSize:"13px",margin:"0px",padding:"0px 4px",color:"#3b82f6",cursor:"pointer",verticalAlign:"baseline",whiteSpace:"normal",wordBreak:"break-all",display:"inline-flex",alignItems:"unset",background:"transparent",border:"none"},null==s?void 0:s.pill),citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}}})};
2
2
  //# sourceMappingURL=ReadFileCitationRenderer.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime");exports.default=function(r){var t=r.className,i=r.style;return s.jsxs("svg",e.__assign({className:t,style:i,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg"},{children:[s.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),s.jsx("polyline",{points:"15 3 21 3 21 9"}),s.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}))};
2
+ //# sourceMappingURL=ExternalLinkIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalLinkIcon.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"),r=require("react"),a=require("../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../utils/userstory-approval-transform.utils.js"),o=require("../../utils/userstory-approval.utils.js"),i=require("../../hooks/useApprovalStatus.js"),s=require("./components/ContentSegment/ContentSegment.js"),l=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),c=require("../../icons/CheckIcon.js"),u=require("../../icons/BookmarkIcon.js"),v=require("./components/ApprovalSidebar/ApprovalSidebar.js"),p=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),f={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},g={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},h=Object.assign(function(s){var l,c=s.artifactTitleIds,u=s.config,v=void 0===u?{}:u,p=s.callbacks,h=void 0===p?{}:p,m=s.labels,_=void 0===m?{}:m,A=s.isDisabled,y=void 0!==A&&A,b=s.children,I=s.classNames,C=s.selectedArtifactId,x=a.useRequirementAI(),j=x.userStory,U=x.customStyles,w=e.__assign(e.__assign({},f),v),k=e.__assign(e.__assign({},g),_),E=r.useState([]),q=E[0],N=E[1],F=r.useState(""),T=F[0],D=F[1],R=r.useState(""),B=R[0],M=R[1],P=r.useState(!1),W=P[0],O=P[1],V=r.useState(!0),z=V[0],L=V[1],H=r.useRef(void 0),G=r.useCallback(function(e,t,r,a){h.onShowNotification?h.onShowNotification(e,t,r,a):console.log("[".concat(e.toUpperCase(),"] ").concat(t,": ").concat(r))},[h]),Y=r.useCallback(function(e){h.onScrollToElement?h.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[h]),J=r.useMemo(function(){var e=q.findIndex(function(e){return e.artifactId===T});return e>=0?e:0},[q,T]),K=q[J];r.useEffect(function(){H.current=K},[K]),r.useEffect(function(){var e;(null==j?void 0:j.length)&&(null===(e=h.onInitialize)||void 0===e||e.call(h),1===j.length&&L(!1),j.length>0&&!T&&D(C||j[0].artifactId))},[j,C]),r.useEffect(function(){C&&C!==T&&D(C)},[C,T]),r.useEffect(function(){var e=n.createUserStoriesForApproval(n.cloneUserStories(j));N(e)},[]),r.useEffect(function(){if(K){var e=o.getFirstNonApprovedSegmentId(K,"");M(e)}},[null==K?void 0:K.artifactId]);var Q=r.useCallback(function(t,r){N(function(a){var n=e.__spreadArray([],a,!0);if("APPROVED"===r.approval_status&&"APPROVED"!==a[t].approval_status){var i=o.getFirstUnapprovedStoryId(a,r.artifactId);i&&D(i)}return n[t]=r,n})},[]),X=r.useCallback(function(e){var t=H.current;if(t){var r=o.getFirstNonApprovedSegmentId(t,e);"NA"!==r&&(M(""),setTimeout(function(){M(r)},0))}},[]);i.useApprovalStatus({userStoryForApproval:q,selectedUserStoryForApproval:K,userStoryIndex:J,callbacks:h,labels:k,onSaveUserStory:Q});var Z=e.__assign({height:w.containerHeight},w.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),$={userStoryForApproval:q,setUserStoryForApproval:N,selectedStoryArtifactId:T,setSelectedStoryArtifactId:D,selectedUserStoryIndex:J,selectedUserStoryForApproval:K,currentContentId:B,setCurrentContentId:M,isEditingSegment:W,setIsEditingSegment:O,isSidebarExpanded:z,setIsSidebarExpanded:L,artifactTitleIds:c,config:w,labels:k,callbacks:h,isDisabled:y,handleSaveUserStory:Q,handleUpdateContentId:X,showNotification:G,scrollToElement:Y};return t.jsx(S.UserStoryApprovalScreenContext.Provider,e.__assign({value:$},{children:t.jsx("div",e.__assign({className:"".concat(d.default.container," ").concat((null==I?void 0:I.container)||""),style:e.__assign(e.__assign({},Z),null===(l=null==U?void 0:U.approvalScreen)||void 0===l?void 0:l.wrapperContainer)},{children:b}))}))},{Sidebar:function(e){var r=e.Component,a=e.config,n=e.className,o=S.useUserStoryApprovalScreen(),i=o.isSidebarExpanded,s=o.selectedStoryArtifactId,l=o.setSelectedStoryArtifactId,d=o.userStoryForApproval,c=o.isEditingSegment,u=o.artifactTitleIds;return r?t.jsx(r,{isSidebarExpanded:i,selectedStoryArtifactId:s,setSelectedStoryArtifactId:l,userStoryForApproval:d,isEditingAnUserStorySegment:c,artifactTitleIds:u}):t.jsx(v.ApprovalSidebar,{config:a,className:n})},SidebarToggle:function(r){var a=r.OpenIcon,n=r.CloseIcon,o=r.className,i=void 0===o?"":o,s=S.useUserStoryApprovalScreen(),l=s.isSidebarExpanded,c=s.setIsSidebarExpanded,u=a||p.SidebarOpenIcon,v=n||p.SidebarCloseIcon;return t.jsx("div",e.__assign({className:"".concat(d.default.sidebarToggleWrapper," ").concat(i)},{children:t.jsx("button",e.__assign({onClick:function(){return c(function(e){return!e})},className:d.default.sidebarToggleBtn,"aria-label":l?"Collapse sidebar":"Expand sidebar",type:"button"},{children:l?t.jsx(v,{}):t.jsx(u,{})}))}))},Content:function(n){var i,s,v,p,f,g,h,m,_,A,y,b,I,C,x,j,U,w,k,E,q,N=n.children,F=n.ButtonComponent,T=n.hideApproveAll,D=void 0!==T&&T,R=n.pageTitle,B=void 0===R?"Review Generated Requirements":R,M=n.pageDescription,P=void 0===M?"This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements.":M,W=S.useUserStoryApprovalScreen(),O=W.selectedUserStoryForApproval,V=W.selectedUserStoryIndex,z=W.artifactTitleIds,L=W.labels,H=W.config,G=W.isDisabled,Y=W.isEditingSegment,J=W.handleSaveUserStory,K=W.setCurrentContentId,Q=W.showNotification,X=a.useRequirementAI().customStyles,Z=r.useCallback(function(){if(O)if(Y)Q("warn","Warning!",L.unsavedChangesWarning,3e3);else{var e=o.approveAllSegments(O);J(V,e),K("")}},[O,V,Y,L,J,K,Q]);if(!O)return null;var $=z[V]||"",ee="APPROVED"===O.approval_status;return t.jsxs("div",e.__assign({className:d.default.content,style:e.__assign({},null===(s=null===(i=null==X?void 0:X.approvalScreen)||void 0===i?void 0:i.content)||void 0===s?void 0:s.content),"data-lsc-ui-page-title":B,"data-lsc-ui-page-description":P},{children:[t.jsxs("div",e.__assign({className:d.default.header,style:e.__assign({},null===(f=null===(p=null===(v=null==X?void 0:X.approvalScreen)||void 0===v?void 0:v.body)||void 0===p?void 0:p.contentSegment)||void 0===f?void 0:f.header)},{children:[t.jsxs("div",e.__assign({className:d.default.headerLeft,style:e.__assign({},null===(h=null===(g=null==X?void 0:X.approvalScreen)||void 0===g?void 0:g.content)||void 0===h?void 0:h.headerLeft)},{children:[t.jsxs("div",e.__assign({className:d.default.headerMeta,style:e.__assign({},null===(A=null===(_=null===(m=null==X?void 0:X.approvalScreen)||void 0===m?void 0:m.body)||void 0===_?void 0:_.contentSegment)||void 0===A?void 0:A.headerMeta)},{children:[t.jsx(u.BookmarkIcon,{size:16,color:(null===(I=null===(b=null===(y=null==X?void 0:X.approvalScreen)||void 0===y?void 0:y.body)||void 0===b?void 0:b.contentSegment)||void 0===I?void 0:I.bookMarkColor)||"#8C8C8C"}),t.jsx("h2",e.__assign({className:d.default.headerArtifactId,style:e.__assign({},null===(j=null===(x=null===(C=null==X?void 0:X.approvalScreen)||void 0===C?void 0:C.body)||void 0===x?void 0:x.contentSegment)||void 0===j?void 0:j.headerArtifactId)},{children:$}))]})),t.jsx("p",e.__assign({className:d.default.headerTitle,style:e.__assign({},null===(k=null===(w=null===(U=null==X?void 0:X.approvalScreen)||void 0===U?void 0:U.body)||void 0===w?void 0:w.contentSegment)||void 0===k?void 0:k.headerTitle)},{children:null==O?void 0:O.title}))]})),!D&&H.showApproveAllButton&&t.jsx("div",e.__assign({className:d.default.headerRight},{children:ee?t.jsx(l.ApprovalBadge,{status:"APPROVED",label:L.approved}):F?t.jsx(F,e.__assign({type:"fill",onClick:Z,isDisable:G,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:L.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."}},{children:t.jsxs("div",e.__assign({className:d.default.approveAllContent},{children:[t.jsx(c.CheckIcon,{size:16,color:"white"}),t.jsx("span",{children:L.approveAll})]}))})):t.jsxs("button",e.__assign({onClick:Z,disabled:G,className:d.default.approveAllButtonDefault,style:e.__assign({},null===(q=null===(E=null==X?void 0:X.approvalScreen)||void 0===E?void 0:E.content)||void 0===q?void 0:q.approveAllButtonDefault)},{children:[t.jsx(c.CheckIcon,{size:16,color:"white"}),t.jsx("span",{children:L.approveAll})]}))}))]})),N]}))},Body:function(n){var o,i,l,c=n.children,u=n.EditorComponent,v=n.ViewerComponent,p=S.useUserStoryApprovalScreen(),f=p.selectedUserStoryForApproval,g=p.selectedUserStoryIndex,h=p.artifactTitleIds,m=p.handleSaveUserStory,_=a.useRequirementAI().customStyles,A=r.useCallback(function(e){m(g,e)},[g,m]),y=r.useCallback(function(t,r){var a;if(f){var n=e.__assign(e.__assign({},f),{sub_features:null===(a=f.sub_features)||void 0===a?void 0:a.map(function(e,a){return a===t?r:e})});m(g,n)}},[f,g,m]),b=r.useCallback(function(t){var r;if(f){var a=e.__assign(e.__assign({},f),{sub_features:null===(r=f.sub_features)||void 0===r?void 0:r.filter(function(e,r){return r!==t})});m(g,a)}},[f,g,m]);if(!f)return null;var I=h[g]||"";return t.jsxs("div",e.__assign({className:d.default.body,style:e.__assign({},null===(i=null===(o=null==_?void 0:_.approvalScreen)||void 0===o?void 0:o.body)||void 0===i?void 0:i.container)},{children:[t.jsx(s.ContentSegment,{userStoryForApproval:f,artifactTitleId:I,onSaveMainStoryContent:A,EditorComponent:u,ViewerComponent:v}),null===(l=f.sub_features)||void 0===l?void 0:l.map(function(e,r){return t.jsx(s.ContentSegment,{userStoryForApproval:e,artifactTitleId:"".concat(I," - ").concat(String.fromCharCode(65+r)),isSubFeature:!0,subFeatureIndex:r,onSaveSubFeature:y,onDeleteSubFeature:b,EditorComponent:u,ViewerComponent:v},e.artifactId)}),c]}))}});exports.default=h;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),a=require("../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../utils/userstory-approval-transform.utils.js"),o=require("../../utils/userstory-approval.utils.js"),i=require("../../hooks/useApprovalStatus.js"),s=require("./components/ContentSegment/ContentSegment.js"),l=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),c=require("../../icons/CheckIcon.js"),u=require("../../icons/BookmarkIcon.js"),v=require("./components/ApprovalSidebar/ApprovalSidebar.js"),p=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),g={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},f={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},h=Object.assign(function(s){var l,c=s.artifactTitleIds,u=s.config,v=void 0===u?{}:u,p=s.callbacks,h=void 0===p?{}:p,m=s.labels,_=void 0===m?{}:m,A=s.isDisabled,y=void 0!==A&&A,b=s.children,I=s.classNames,C=s.selectedArtifactId,x=a.useRequirementAI(),j=x.userStory,U=x.customStyles,w=e.__assign(e.__assign({},g),v),k=e.__assign(e.__assign({},f),_),E=r.useState([]),q=E[0],N=E[1],F=r.useState(""),T=F[0],D=F[1],R=r.useState(""),B=R[0],M=R[1],P=r.useState(!1),W=P[0],O=P[1],V=r.useState(!0),z=V[0],L=V[1],H=r.useRef(void 0),G=r.useCallback(function(e,t,r,a){h.onShowNotification?h.onShowNotification(e,t,r,a):console.log("[".concat(e.toUpperCase(),"] ").concat(t,": ").concat(r))},[h]),Y=r.useCallback(function(e){h.onScrollToElement?h.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[h]),J=r.useMemo(function(){var e=q.findIndex(function(e){return e.artifactId===T});return e>=0?e:0},[q,T]),K=q[J];r.useEffect(function(){H.current=K},[K]),r.useEffect(function(){var e;if(null==j?void 0:j.length){null===(e=h.onInitialize)||void 0===e||e.call(h),1===j.length&&L(!1),j.length>0&&!T&&D(C||j[0].artifactId);var t=n.createUserStoriesForApproval(n.cloneUserStories(j));N(t)}},[j,C]),r.useEffect(function(){C&&C!==T&&D(C)},[C,T]),r.useEffect(function(){if(K){var e=o.getFirstNonApprovedSegmentId(K,"");M(e)}},[null==K?void 0:K.artifactId]);var Q=r.useCallback(function(t,r){N(function(a){var n=e.__spreadArray([],a,!0);if("APPROVED"===r.approval_status&&"APPROVED"!==a[t].approval_status){var i=o.getFirstUnapprovedStoryId(a,r.artifactId);i&&D(i)}return n[t]=r,n})},[]),X=r.useCallback(function(e){var t=H.current;if(t){var r=o.getFirstNonApprovedSegmentId(t,e);"NA"!==r&&(M(""),setTimeout(function(){M(r)},0))}},[]);i.useApprovalStatus({userStoryForApproval:q,selectedUserStoryForApproval:K,userStoryIndex:J,callbacks:h,labels:k,onSaveUserStory:Q});var Z=e.__assign({height:w.containerHeight},w.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),$={userStoryForApproval:q,setUserStoryForApproval:N,selectedStoryArtifactId:T,setSelectedStoryArtifactId:D,selectedUserStoryIndex:J,selectedUserStoryForApproval:K,currentContentId:B,setCurrentContentId:M,isEditingSegment:W,setIsEditingSegment:O,isSidebarExpanded:z,setIsSidebarExpanded:L,artifactTitleIds:c,config:w,labels:k,callbacks:h,isDisabled:y,handleSaveUserStory:Q,handleUpdateContentId:X,showNotification:G,scrollToElement:Y};return t.jsx(S.UserStoryApprovalScreenContext.Provider,e.__assign({value:$},{children:t.jsx("div",e.__assign({className:"".concat(d.default.container," ").concat((null==I?void 0:I.container)||""),style:e.__assign(e.__assign({},Z),null===(l=null==U?void 0:U.approvalScreen)||void 0===l?void 0:l.wrapperContainer)},{children:b}))}))},{Sidebar:function(e){var r=e.Component,a=e.config,n=e.className,o=S.useUserStoryApprovalScreen(),i=o.isSidebarExpanded,s=o.selectedStoryArtifactId,l=o.setSelectedStoryArtifactId,d=o.userStoryForApproval,c=o.isEditingSegment,u=o.artifactTitleIds;return r?t.jsx(r,{isSidebarExpanded:i,selectedStoryArtifactId:s,setSelectedStoryArtifactId:l,userStoryForApproval:d,isEditingAnUserStorySegment:c,artifactTitleIds:u}):t.jsx(v.ApprovalSidebar,{config:a,className:n})},SidebarToggle:function(r){var a=r.OpenIcon,n=r.CloseIcon,o=r.className,i=void 0===o?"":o,s=S.useUserStoryApprovalScreen(),l=s.isSidebarExpanded,c=s.setIsSidebarExpanded,u=a||p.SidebarOpenIcon,v=n||p.SidebarCloseIcon;return t.jsx("div",e.__assign({className:"".concat(d.default.sidebarToggleWrapper," ").concat(i)},{children:t.jsx("button",e.__assign({onClick:function(){return c(function(e){return!e})},className:d.default.sidebarToggleBtn,"aria-label":l?"Collapse sidebar":"Expand sidebar",type:"button"},{children:l?t.jsx(v,{}):t.jsx(u,{})}))}))},Content:function(n){var i,s,v,p,g,f,h,m,_,A,y,b,I,C,x,j,U,w,k,E,q,N=n.children,F=n.ButtonComponent,T=n.hideApproveAll,D=void 0!==T&&T,R=n.pageTitle,B=void 0===R?"Review Generated Requirements":R,M=n.pageDescription,P=void 0===M?"This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements.":M,W=S.useUserStoryApprovalScreen(),O=W.selectedUserStoryForApproval,V=W.selectedUserStoryIndex,z=W.artifactTitleIds,L=W.labels,H=W.config,G=W.isDisabled,Y=W.isEditingSegment,J=W.handleSaveUserStory,K=W.setCurrentContentId,Q=W.showNotification,X=a.useRequirementAI().customStyles,Z=r.useCallback(function(){if(O)if(Y)Q("warn","Warning!",L.unsavedChangesWarning,3e3);else{var e=o.approveAllSegments(O);J(V,e),K("")}},[O,V,Y,L,J,K,Q]);if(!O)return null;var $=z[V]||"",ee="APPROVED"===O.approval_status;return t.jsxs("div",e.__assign({className:d.default.content,style:e.__assign({},null===(s=null===(i=null==X?void 0:X.approvalScreen)||void 0===i?void 0:i.content)||void 0===s?void 0:s.content),"data-lsc-ui-page-title":B,"data-lsc-ui-page-description":P},{children:[t.jsxs("div",e.__assign({className:d.default.header,style:e.__assign({},null===(g=null===(p=null===(v=null==X?void 0:X.approvalScreen)||void 0===v?void 0:v.body)||void 0===p?void 0:p.contentSegment)||void 0===g?void 0:g.header)},{children:[t.jsxs("div",e.__assign({className:d.default.headerLeft,style:e.__assign({},null===(h=null===(f=null==X?void 0:X.approvalScreen)||void 0===f?void 0:f.content)||void 0===h?void 0:h.headerLeft)},{children:[t.jsxs("div",e.__assign({className:d.default.headerMeta,style:e.__assign({},null===(A=null===(_=null===(m=null==X?void 0:X.approvalScreen)||void 0===m?void 0:m.body)||void 0===_?void 0:_.contentSegment)||void 0===A?void 0:A.headerMeta)},{children:[t.jsx(u.BookmarkIcon,{size:16,color:(null===(I=null===(b=null===(y=null==X?void 0:X.approvalScreen)||void 0===y?void 0:y.body)||void 0===b?void 0:b.contentSegment)||void 0===I?void 0:I.bookMarkColor)||"#8C8C8C"}),t.jsx("h2",e.__assign({className:d.default.headerArtifactId,style:e.__assign({},null===(j=null===(x=null===(C=null==X?void 0:X.approvalScreen)||void 0===C?void 0:C.body)||void 0===x?void 0:x.contentSegment)||void 0===j?void 0:j.headerArtifactId)},{children:$}))]})),t.jsx("p",e.__assign({className:d.default.headerTitle,style:e.__assign({},null===(k=null===(w=null===(U=null==X?void 0:X.approvalScreen)||void 0===U?void 0:U.body)||void 0===w?void 0:w.contentSegment)||void 0===k?void 0:k.headerTitle)},{children:null==O?void 0:O.title}))]})),!D&&H.showApproveAllButton&&t.jsx("div",e.__assign({className:d.default.headerRight},{children:ee?t.jsx(l.ApprovalBadge,{status:"APPROVED",label:L.approved}):F?t.jsx(F,e.__assign({type:"fill",onClick:Z,isDisable:G,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:L.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."}},{children:t.jsxs("div",e.__assign({className:d.default.approveAllContent},{children:[t.jsx(c.CheckIcon,{size:16,color:"white"}),t.jsx("span",{children:L.approveAll})]}))})):t.jsxs("button",e.__assign({onClick:Z,disabled:G,className:d.default.approveAllButtonDefault,style:e.__assign({},null===(q=null===(E=null==X?void 0:X.approvalScreen)||void 0===E?void 0:E.content)||void 0===q?void 0:q.approveAllButtonDefault)},{children:[t.jsx(c.CheckIcon,{size:16,color:"white"}),t.jsx("span",{children:L.approveAll})]}))}))]})),N]}))},Body:function(n){var o,i,l,c=n.children,u=n.EditorComponent,v=n.ViewerComponent,p=S.useUserStoryApprovalScreen(),g=p.selectedUserStoryForApproval,f=p.selectedUserStoryIndex,h=p.artifactTitleIds,m=p.handleSaveUserStory,_=a.useRequirementAI().customStyles,A=r.useCallback(function(e){m(f,e)},[f,m]),y=r.useCallback(function(t,r){var a;if(g){var n=e.__assign(e.__assign({},g),{sub_features:null===(a=g.sub_features)||void 0===a?void 0:a.map(function(e,a){return a===t?r:e})});m(f,n)}},[g,f,m]),b=r.useCallback(function(t){var r;if(g){var a=e.__assign(e.__assign({},g),{sub_features:null===(r=g.sub_features)||void 0===r?void 0:r.filter(function(e,r){return r!==t})});m(f,a)}},[g,f,m]);if(!g)return null;var I=h[f]||"";return t.jsxs("div",e.__assign({className:d.default.body,style:e.__assign({},null===(i=null===(o=null==_?void 0:_.approvalScreen)||void 0===o?void 0:o.body)||void 0===i?void 0:i.container)},{children:[t.jsx(s.ContentSegment,{userStoryForApproval:g,artifactTitleId:I,onSaveMainStoryContent:A,EditorComponent:u,ViewerComponent:v}),null===(l=g.sub_features)||void 0===l?void 0:l.map(function(e,r){return t.jsx(s.ContentSegment,{userStoryForApproval:e,artifactTitleId:"".concat(I," - ").concat(String.fromCharCode(65+r)),isSubFeature:!0,subFeatureIndex:r,onSaveSubFeature:y,onDeleteSubFeature:b,EditorComponent:u,ViewerComponent:v},e.artifactId)}),c]}))}});exports.default=h;
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),a=require("./UserStoryWithCitation.module.css.js"),r=require("../../shared/useMarkdownSearch.js"),l=require("lucide-react"),d=require("@mui/material"),s=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../ai-reasoning/AiReasoningCitation.js"),g=require("../../icons/RelevanceScoreIcon.js"),h=require("../RecommendationBlock/RecommendationBlock.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=_(t),m=_(o),C=i.createContext(!1),x=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),y=i.createContext({rowId:""}),j=function(t){var o,r,l=t.children,d=t.node,s=i.useRef(Math.random().toString(36).slice(2)).current,c=i.useContext(x).expandedInfo,u=(null==c?void 0:c.rowId)===s,v=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(y.Provider,e.__assign({value:{rowId:s}},{children:[n.jsx("tr",e.__assign({style:f?{cssText:f}:void 0},{children:l})),u&&(null==c?void 0:c.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:v||1,className:a.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellInner},{children:n.jsx("div",{className:a.default.tableExpandedCellContent})}))}))}))]}))};exports.default=function(t){var o=t.message,_=t.scenario,y=t.showUserStoryDiff,S=void 0!==y&&y,R=t.aiReasoningsForBlock,w=t.isCitationLoadingDisplay,I=void 0!==w&&w,b=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var N=t.customStyles,q=t.customIcons,A=t.aiReasoningDiffView,M=t.userStoryCitations,T=t.artifactId,L=t.isCraflow,k=i.useRef(null),U=v.useRequirementAI(),E=U.userStory,P=U.getAvgScoreForStory,F=U.setUserStory,$=U.aiReasoning,B=U.setAiReasoning,D=U.customIcons,W=U.searchQueryList,H=U.searchQueryReasoningIdList,z=null!=q?q:null==D?void 0:D.userStoryIcons,G=null==N?void 0:N.searchHighlight,O=r.useMarkdownSearch(k,G),Q=O.search,V=O.clear,J=i.useState("1"),K=J[0],X=J[1],Y=i.useState(null),Z=Y[0],ee=Y[1],ne=i.useRef(new Map),ie=i.useCallback(function(e,n){ee(e&&n?{rowId:e,aiReason:n}:null)},[]),te=T?P(T):0,oe=i.useState([]),ae=oe[0],re=oe[1],le=function(e){var n=new RegExp("<(/?(".concat(["updated","deleted","changed"].join("|"),"))>"),"g"),i=e.replace(n,"\n\n<$1>\n\n");return i=(i=i.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')})};i.useMemo(function(){return o?le(o):o},[o]),i.useEffect(function(){re(R||$)},[R,$]);var de=i.useMemo(function(){return{h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:a.default.heading1,style:null==N?void 0:N.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:a.default.heading2,style:null==N?void 0:N.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:a.default.heading3,style:null==N?void 0:N.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:a.default.bold,style:null==N?void 0:N.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:a.default.paragraph,style:null==N?void 0:N.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(s.default,e.__assign({},o,{showUserStoryDiff:S,currentUpdatedTagId:K,setCurrentUpdatedTagId:X,userStory:E,setUserStory:F,setAiReasoning:B,node:t,isCraflow:L,customStyles:null==N?void 0:N.updatedContent}))},ol:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==N?void 0:N.olist},{children:null==t?void 0:t.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:a.default.unorderedList,style:null==N?void 0:N.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:a.default.tableWrapper},{children:n.jsx("table",e.__assign({className:a.default.table,style:null==N?void 0:N.table},{children:t}))}))},tr:j,td:function(i){var t,o=i.node,a=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},l=r.style,d=e.__rest(r,["style"]);return n.jsx(C.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},d,{style:l?{cssText:l}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},l=r.style,d=e.__rest(r,["style"]);return n.jsx(C.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},d,{style:l?{cssText:l}:void 0},{children:a}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),a="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(h.default,e.__assign({},o,{customStyles:null==N?void 0:N.recommendationBlock,label:a}))},a:function(t){var o,a,r;t.inline,t.children,t.node;var l=e.__rest(t,["inline","children","node"]);i.useContext(C)||null==l||l.table;var d="".concat(null==l?void 0:l.href),s=null===(o=d.split("$"))||void 0===o?void 0:o[0],c=null===(a=d.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===s){var u=(null!==(r=S?A:$)&&void 0!==r?r:[]).find(function(e){return e.id.toString()===decodeURIComponent(c)});if(u&&u.reason.length>0&&u.gap.length>0)return n.jsx(f.default,{aiReason:u,isSourceHasHighlight:!1,customIcons:z,customStyles:{aiReasoningContent:null==N?void 0:N.aiReasoningContent,aiReasoningAccordion:null==N?void 0:N.aiReasoningAccordion,aiReasoningMarkdown:null==N?void 0:N.aiReasoningMarkdown,aiReasoningPill:null==N?void 0:N.aiReasoningPill,webCitation:null==N?void 0:N.webCitation,stormeeCitation:null==N?void 0:N.stormeeCitation,waveformCitation:null==N?void 0:N.waveformCitation,imageCitation:null==N?void 0:N.imageCitation,fileCitation:null==N?void 0:N.fileCitation,appModCitation:null==N?void 0:N.appModCitation,rcaCitation:null==N?void 0:N.rcaCitation,readFileCitation:null==N?void 0:N.readFileCitation,loadingCitations:null==N?void 0:N.loadingCitations,chatCitation:null==N?void 0:N.chatCitation}})}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:a.default.blockCode,style:null==N?void 0:N.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==N?void 0:N.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(d.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(l.Info,{size:16,className:a.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",a=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(e){var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n}(t);return n.jsx(c.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==N?void 0:N.generatedCodePill,content:null==N?void 0:N.generatedCodeContent}})}}},[ae,$,M,K,S,o,q]);return i.useEffect(function(){if(k.current){if(null==W?void 0:W.length){var e;if(0===(null==H?void 0:H.length))requestAnimationFrame(function(){Q(W.map(function(e){return e.replace(/\*/g,"")}))});else{var n=k.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){Q(W.map(function(e){return e.replace(/\*/g,"")}))})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}V()}},[W,H]),n.jsx(x.Provider,e.__assign({value:{expandedInfo:Z,setExpanded:ie,reasonToRow:ne}},{children:n.jsxs("div",e.__assign({ref:k,className:"".concat(a.default.container," ").concat("approving"!==_?a.default.wrapper:""," ").concat(b||""),style:null==N?void 0:N.container},{children:[n.jsx(p.default,e.__assign({components:de,rehypePlugins:[m.default]},{children:le(o)})),te>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==N?void 0:N.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==N?void 0:N.confidenceScore},{children:[n.jsx(g.default,{size:14,color:(null==N?void 0:N.confidenceScoreIconColor)||"#166534"}),te,"%"]}))})),I&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==N?void 0:N.citationLoaderContainer},{children:n.jsx(u.default,{customStyles:{container:null==N?void 0:N.citationLoadingContainer,icon:null==N?void 0:N.citationLoadingIcon,text:null==N?void 0:N.citationLoadingText}})}))]}))}))};
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"),r=require("rehype-raw"),o=require("./UserStoryWithCitation.module.css.js"),a=require("../../shared/useMarkdownSearch.js"),l=require("lucide-react"),s=require("@mui/material"),d=require("../../shared/UpdatedAnimationContent.js"),u=require("../../shared/GeneratedCodeCitation.js"),c=require("../../shared/CitationLoadingIndicator.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../ai-reasoning/AiReasoningCitation.js"),g=require("../../icons/RelevanceScoreIcon.js"),h=require("../RecommendationBlock/RecommendationBlock.js"),_=require("../UserStoryCard/AttachedContext.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=m(t),C=m(r),x=i.createContext(!1),y=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),j=i.createContext({rowId:""}),R=function(t){var r,a,l=t.children,s=t.node,d=i.useRef(Math.random().toString(36).slice(2)).current,u=i.useContext(y).expandedInfo,c=(null==u?void 0:u.rowId)===d,v=Array.isArray(null==s?void 0:s.children)?s.children.filter(function(e){return"element"===e.type}).length:1,f=null!==(a=null===(r=null==s?void 0:s.properties)||void 0===r?void 0:r.style)&&void 0!==a?a:void 0;return n.jsxs(j.Provider,e.__assign({value:{rowId:d}},{children:[n.jsx("tr",e.__assign({style:f?{cssText:f}:void 0},{children:l})),c&&(null==u?void 0:u.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:v||1,className:o.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:o.default.tableExpandedCellInner},{children:n.jsx("div",{className:o.default.tableExpandedCellContent})}))}))}))]}))};exports.default=function(t){var r=t.message,m=t.isParent,j=t.scenario,S=t.showUserStoryDiff,w=void 0!==S&&S,I=t.aiReasoningsForBlock,b=t.isCitationLoadingDisplay,q=void 0!==b&&b,N=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var A=t.customStyles,M=t.customIcons,T=t.aiReasoningDiffView,L=t.userStoryCitations,U=t.artifactId,k=t.isCraflow,P=i.useRef(null),E=v.useRequirementAI(),F=E.userStory,$=E.getAvgScoreForStory,B=E.setUserStory,D=E.aiReasoning,W=E.setAiReasoning,H=E.customIcons,z=E.searchQueryList,G=E.searchQueryReasoningIdList,O=null!=M?M:null==H?void 0:H.userStoryIcons,Q=null==A?void 0:A.searchHighlight,V=a.useMarkdownSearch(P,Q),J=V.search,K=V.clear,X=V.isMutatingRef,Y=i.useState("1"),Z=Y[0],ee=Y[1],ne=i.useState(null),ie=ne[0],te=ne[1],re=i.useRef(new Map),oe=i.useCallback(function(e,n){te(e&&n?{rowId:e,aiReason:n}:null)},[]),ae=U?$(U):0,le=i.useState([]),se=le[0],de=le[1],ue=i.useMemo(function(){return r?(e=r,n=new RegExp("<(/?(".concat(["updated","deleted","changed"].join("|"),"))>"),"g"),e.replace(n,"\n\n<$1>\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')})):r;var e,n},[r]);i.useEffect(function(){de(I||D)},[I,D]);var ce=i.useMemo(function(){return{h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:o.default.heading1,style:null==A?void 0:A.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:o.default.heading2,style:null==A?void 0:A.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:o.default.heading3,style:null==A?void 0:A.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:o.default.bold,style:null==A?void 0:A.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:o.default.paragraph,style:null==A?void 0:A.paragraph},{children:t.children}))},updated:function(i){var t=i.node,r=e.__rest(i,["node"]);return n.jsx(d.default,e.__assign({},r,{showUserStoryDiff:w,currentUpdatedTagId:Z,setCurrentUpdatedTagId:ee,userStory:F,setUserStory:B,setAiReasoning:W,node:t,isCraflow:k,customStyles:null==A?void 0:A.updatedContent}))},ol:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ol",e.__assign({className:o.default.orderedList,style:null==A?void 0:A.olist},{children:null==t?void 0:t.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:o.default.unorderedList,style:null==A?void 0:A.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:o.default.tableWrapper},{children:n.jsx("table",e.__assign({className:o.default.table,style:null==A?void 0:A.table},{children:t}))}))},tr:R,td:function(i){var t,r=i.node,o=i.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},l=a.style,s=e.__rest(a,["style"]);return n.jsx(x.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},s,{style:l?{cssText:l}:void 0},{children:o}))}))},th:function(i){var t,r=i.node,o=i.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},l=a.style,s=e.__rest(a,["style"]);return n.jsx(x.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},s,{style:l?{cssText:l}:void 0},{children:o}))}))},recommendation:function(i){var t;i.node;var r=e.__rest(i,["node"]),o="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 n.jsx(h.default,e.__assign({},r,{customStyles:null==A?void 0:A.recommendationBlock,label:o}))},a:function(t){var r,o,a;t.inline,t.children,t.node;var l=e.__rest(t,["inline","children","node"]);i.useContext(x)||null==l||l.table;var s="".concat(null==l?void 0:l.href),d=null===(r=s.split("$"))||void 0===r?void 0:r[0],u=null===(o=s.split("$"))||void 0===o?void 0:o[1];if("ai_reasoning"===d){var c=(null!==(a=w?T:D)&&void 0!==a?a:[]).find(function(e){return e.id.toString()===decodeURIComponent(u)});if(c&&c.reason.length>0&&c.gap.length>0)return n.jsx(f.default,{aiReason:c,isSourceHasHighlight:!1,customIcons:O,customStyles:{aiReasoningContent:null==A?void 0:A.aiReasoningContent,aiReasoningAccordion:null==A?void 0:A.aiReasoningAccordion,aiReasoningMarkdown:null==A?void 0:A.aiReasoningMarkdown,aiReasoningPill:null==A?void 0:A.aiReasoningPill,webCitation:null==A?void 0:A.webCitation,stormeeCitation:null==A?void 0:A.stormeeCitation,waveformCitation:null==A?void 0:A.waveformCitation,imageCitation:null==A?void 0:A.imageCitation,fileCitation:null==A?void 0:A.fileCitation,appModCitation:null==A?void 0:A.appModCitation,rcaCitation:null==A?void 0:A.rcaCitation,readFileCitation:null==A?void 0:A.readFileCitation,loadingCitations:null==A?void 0:A.loadingCitations,chatCitation:null==A?void 0:A.chatCitation}})}return null},code:function(i){i.inline;var t=i.children,r=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:o.default.blockCode,style:null==A?void 0:A.code},{children:t}))}):n.jsx("code",e.__assign({className:o.default.inlineCode,style:null==A?void 0:A.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(s.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(l.Info,{size:16,className:o.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),r=(null==t?void 0:t.language)||"python",o=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:o,language:r,customStyles:{pill:null==A?void 0:A.generatedCodePill,content:null==A?void 0:A.generatedCodeContent}})}}},[se,D,L,Z,w,r,M]),ve=i.useRef([]),fe=i.useRef([]);return i.useEffect(function(){var n;if(P.current){if(!(null==z?void 0:z.length))return K(),ve.current=[],void(fe.current=[]);var i=z.length!==ve.current.length||z.some(function(e,n){return e!==ve.current[n]}),t=(null!==(n=null==G?void 0:G.length)&&void 0!==n?n:0)!==fe.current.length||(null!=G?G:[]).some(function(e,n){return e!==fe.current[n]});if(i||t){var r;ve.current=e.__spreadArray([],z,!0),fe.current=e.__spreadArray([],null!=G?G:[],!0);var o=null,a=function(){J(z.map(function(e){return e.replace(/\*/g,"")}))};if(0===(null==G?void 0:G.length))requestAnimationFrame(a);else{var l=P.current;(o=new MutationObserver(function(){X.current||(clearTimeout(r),r=setTimeout(function(){requestAnimationFrame(a)},50))})).observe(l,{childList:!0,subtree:!0}),requestAnimationFrame(a)}return function(){null==o||o.disconnect(),clearTimeout(r)}}}},[z,G]),n.jsx(y.Provider,e.__assign({value:{expandedInfo:ie,setExpanded:oe,reasonToRow:re}},{children:n.jsxs("div",e.__assign({ref:P,className:"".concat(o.default.container," ").concat("approving"!==j?o.default.wrapper:""," ").concat(N||""),style:null==A?void 0:A.container},{children:[n.jsx(p.default,e.__assign({components:ce,rehypePlugins:[C.default]},{children:ue})),ae>0&&n.jsx("div",e.__assign({className:o.default.confidenceScoreContainer,style:null==A?void 0:A.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:o.default.confidenceScore,style:null==A?void 0:A.confidenceScore},{children:[n.jsx(g.default,{size:14,color:(null==A?void 0:A.confidenceScoreIconColor)||"#166534"}),ae,"%"]}))})),q&&n.jsx("div",e.__assign({className:o.default.citationLoader,style:null==A?void 0:A.citationLoaderContainer},{children:n.jsx(c.default,{customStyles:{container:null==A?void 0:A.citationLoadingContainer,icon:null==A?void 0:A.citationLoadingIcon,text:null==A?void 0:A.citationLoadingText}})})),m&&n.jsx("div",e.__assign({className:"flex mt-5"},{children:n.jsx(_.default,{})}))]}))}))};
2
2
  //# sourceMappingURL=UserStoryWithCitation.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime");exports.default=function(t){return s.jsxs("svg",e.__assign({width:22,height:22,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t,{children:[s.jsx("path",{d:"M18.5998 18.0004C18.9598 16.897 19.3576 16.4989 20.3998 16.2004C19.3576 15.9019 18.9598 15.5038 18.5998 14.4004C18.2398 15.5038 17.842 15.9019 16.7998 16.2004C17.842 16.4989 18.2398 16.897 18.5998 18.0004Z",stroke:"#2546F0",strokeWidth:.6,strokeLinejoin:"round"}),s.jsx("line",{x1:12.3,y1:5.7,x2:17.7,y2:5.7,stroke:"#2546F0",strokeWidth:.6,strokeLinecap:"round"}),s.jsx("line",{x1:12.3,y1:8.10039,x2:17.7,y2:8.10039,stroke:"#2546F0",strokeWidth:.6,strokeLinecap:"round"}),s.jsx("line",{x1:12.3,y1:10.5008,x2:17.7,y2:10.5008,stroke:"#2546F0",strokeWidth:.6,strokeLinecap:"round"}),s.jsx("line",{x1:6.3,y1:12.9012,x2:12.9,y2:12.9012,stroke:"#2546F0",strokeWidth:.6,strokeLinecap:"round"}),s.jsx("line",{x1:6.3,y1:15.3016,x2:12.9,y2:15.3016,stroke:"#2546F0",strokeWidth:.6,strokeLinecap:"round"}),s.jsx("line",{x1:6.3,y1:17.702,x2:12.9,y2:17.702,stroke:"#2546F0",strokeWidth:.6,strokeLinecap:"round"}),s.jsxs("g",e.__assign({clipPath:"url(#clip0_696_41387)"},{children:[s.jsx("path",{d:"M8.33806 4.94727H3.66272C2.96666 4.94727 2.40039 5.51356 2.40039 6.20961V9.09338C2.40039 9.78944 2.96666 10.3557 3.66272 10.3557L6.64066 10.3557L8.06621 11.7813C8.11452 11.8296 8.17907 11.8552 8.24479 11.8552C8.27731 11.8552 8.31011 11.8489 8.34133 11.836C8.43568 11.7969 8.4972 11.7049 8.4972 11.6027V10.3457C9.11844 10.2673 9.60039 9.73555 9.60039 9.09338V6.20961C9.60039 5.51356 9.03412 4.94727 8.33806 4.94727ZM9.09546 9.0934C9.09546 9.51104 8.7557 9.8508 8.33806 9.8508H8.24473C8.10531 9.8508 7.99226 9.96386 7.99226 10.1033V10.9932L6.92377 9.92474C6.87643 9.87738 6.81224 9.8508 6.74525 9.8508H3.66272C3.24508 9.8508 2.90532 9.51104 2.90532 9.0934V6.20963C2.90532 5.792 3.24508 5.45224 3.66272 5.45224H8.33806C8.7557 5.45224 9.09546 5.792 9.09546 6.20963V9.0934Z",fill:"#2546F0"}),s.jsx("path",{d:"M7.85548 6.73438H4.13918C3.99976 6.73438 3.88672 6.8474 3.88672 6.98684C3.88672 7.12626 3.99976 7.23931 4.13918 7.23931H7.85548C7.9949 7.23931 8.10795 7.12626 8.10795 6.98684C8.10795 6.8474 7.99492 6.73438 7.85548 6.73438Z",fill:"#2546F0"}),s.jsx("path",{d:"M7.85548 8.14648H4.13918C3.99976 8.14648 3.88672 8.25951 3.88672 8.39895C3.88672 8.53839 3.99976 8.65142 4.13918 8.65142H7.85548C7.9949 8.65142 8.10795 8.53837 8.10795 8.39895C8.10795 8.25953 7.99492 8.14648 7.85548 8.14648Z",fill:"#2546F0"})]})),s.jsx("path",{d:"M18.2451 2.41309C19.4553 2.53606 20.3994 3.55819 20.3994 4.80078V14.4004H19.2002V18H20.3994V19.2002C20.399 20.4424 19.455 21.465 18.2451 21.5879L18 21.6006H6L5.75391 21.5879C4.54443 21.4645 3.6 20.4421 3.59961 19.2002V12H4.7998V19.2002C4.80023 19.8623 5.33788 20.4 6 20.4004H18C18.6623 20.4002 19.1988 19.8624 19.1992 19.2002V4.80078C19.1992 4.13817 18.6626 3.6008 18 3.60059H6C5.33781 3.60101 4.80012 4.13759 4.7998 4.7998H3.59961C3.59991 3.55784 4.54446 2.53652 5.75391 2.41309L6 2.40039H18L18.2451 2.41309Z",fill:"#2546F0"}),s.jsx("defs",{children:s.jsx("clipPath",e.__assign({id:"clip0_696_41387"},{children:s.jsx("rect",{width:7.2,height:7.2,fill:"white",transform:"translate(2.40039 4.80078)"})}))})]}))};
2
+ //# sourceMappingURL=MeetingHighlightsIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MeetingHighlightsIcon.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),i=require("./AtomicButton.module.css.js"),t=require("@mui/material"),l=require("../components/RequirementAIWrapper/RequirementAIWrapper.js");exports.default=function(a){var n=a.onClick,c=a.isDisable,r=void 0!==c&&c,o=a.children,u=a.type,d=void 0===u?"fill":u,I=a.className,_=void 0===I?"":I,p=a.overrideStyles,m=void 0!==p&&p,y=a.style,U=a.lscUIAgent,v="fill"===d?r?i.default.fillDisabled:i.default.fill:i.default.outline,f=l.useRequirementAI().customStyles,g=m?"".concat(_," ").concat(v).trim():"".concat(_," ").concat(i.default.base," ").concat(v).trim();return s.jsx(t.Button,e.__assign({className:g,onClick:n,disabled:r,style:e.__assign(e.__assign({},null==f?void 0:f.atomicButton),y)},U?e.__assign(e.__assign(e.__assign(e.__assign(e.__assign(e.__assign(e.__assign({},U.id?{id:U.id}:{}),U.lscUIType?{"data-lsc-ui-type":U.lscUIType}:{}),U.lscUILabel?{"data-lsc-ui-label":U.lscUILabel}:{}),U.lscUIDescription?{"data-lsc-ui-description":U.lscUIDescription}:{}),U.lscUIWhenToApply?{"data-lsc-ui-when-to-apply":U.lscUIWhenToApply}:{}),U.lscUIInteractionDelayInSeconds?{"data-lsc-ui-interaction-delay-in-seconds":U.lscUIInteractionDelayInSeconds}:{}),U.lscUIInteractBehaviorControl?{"data-lsc-ui-interact-behavior-control":U.lscUIInteractBehaviorControl}:{}):{},{children:o}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),i=require("./AtomicButton.module.css.js"),t=require("@mui/material"),l=require("../components/RequirementAIWrapper/RequirementAIWrapper.js");exports.default=function(a){var n,c=a.onClick,o=a.isDisable,r=void 0!==o&&o,d=a.children,u=a.type,I=void 0===u?"fill":u,_=a.className,p=void 0===_?"":_,y=a.overrideStyles,m=void 0!==y&&y,v=a.style,U=a.lscUIAgent,g=l.useRequirementAI().customStyles,b="fill"===I?r?null===(n=null==g?void 0:g.userStoryCardStyles)||void 0===n?void 0:n.fillDisabled:i.default.fill:i.default.outline,f=m?"".concat(p," ").concat(b).trim():"".concat(p," ").concat(i.default.base," ").concat(b).trim();return s.jsx(t.Button,e.__assign({className:f,onClick:c,disabled:r,style:e.__assign(e.__assign({},null==g?void 0:g.atomicButton),v)},U?e.__assign(e.__assign(e.__assign(e.__assign(e.__assign(e.__assign(e.__assign({},U.id?{id:U.id}:{}),U.lscUIType?{"data-lsc-ui-type":U.lscUIType}:{}),U.lscUILabel?{"data-lsc-ui-label":U.lscUILabel}:{}),U.lscUIDescription?{"data-lsc-ui-description":U.lscUIDescription}:{}),U.lscUIWhenToApply?{"data-lsc-ui-when-to-apply":U.lscUIWhenToApply}:{}),U.lscUIInteractionDelayInSeconds?{"data-lsc-ui-interaction-delay-in-seconds":U.lscUIInteractionDelayInSeconds}:{}),U.lscUIInteractBehaviorControl?{"data-lsc-ui-interact-behavior-control":U.lscUIInteractBehaviorControl}:{}):{},{children:d}))};
2
2
  //# sourceMappingURL=AtomicButton.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("@monaco-editor/react"),r=require("./CodeViewer.module.css.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(i);exports.default=function(i){var a=i.code,o=i.language,d=void 0===o?"typescript":o,l=i.readOnly,s=void 0!==l&&l,u=i.lineHeight,c=void 0===u?20:u,v=i.minHeight,g=void 0===v?60:v,h=i.maxHeight,m=void 0===h?600:h,p=a.split("\n").length,f=Math.min(m,Math.max(g,p*c+20));return t.jsx("div",e.__assign({className:r.default.container},{children:t.jsx(n.default,{height:"".concat(f,"px"),language:d,value:a,theme:"vs-dark",options:{readOnly:s,fontSize:14,lineHeight:c,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on"}})}))};
2
+ //# sourceMappingURL=CodeViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeViewer.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 t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".CodeViewer-module_container__n5W6V{background-color:#0d1117;border:1px solid #374151;border-radius:.75rem;overflow:hidden}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={container:"CodeViewer-module_container__n5W6V"};
2
+ //# sourceMappingURL=CodeViewer.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeViewer.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("./GeneratedCodeCitation.module.css.js"),i=require("lucide-react"),o=require("../../CitationRenderer/CitationRenderer.js");exports.default=function(r){var s,a;return t.jsx(o.default,{inLineCitation:!0,citationTitle:r.title,citationIcon:t.jsx(t.Fragment,{}),citationComponent:t.jsx(t.Fragment,{}),chevronDownComponent:t.jsx(i.ChevronDown,{}),chevronUpComponent:t.jsx(i.ChevronUp,{}),styles:{pillButton:e.__assign(e.__assign({},n.default.pillButton),null===(s=r.customStyles)||void 0===s?void 0:s.pill),citationContent:e.__assign(e.__assign({},n.default.citationContent),null===(a=r.customStyles)||void 0===a?void 0:a.content)}})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("./GeneratedCodeCitation.module.css.js"),i=require("lucide-react"),o=require("./CodeViewer.js"),r=require("../../CitationRenderer/CitationRenderer.js");exports.default=function(s){var a,l;return t.jsx(r.default,{inLineCitation:!0,citationTitle:s.title,citationIcon:t.jsx(t.Fragment,{}),citationComponent:t.jsx(o.default,{code:s.code,language:s.language,readOnly:!0}),chevronDownComponent:t.jsx(i.ChevronDown,{}),chevronUpComponent:t.jsx(i.ChevronUp,{}),styles:{pillButton:e.__assign(e.__assign({},n.default.pillButton),null===(a=s.customStyles)||void 0===a?void 0:a.pill),citationContent:e.__assign(e.__assign({},n.default.citationContent),null===(l=s.customStyles)||void 0===l?void 0:l.content)}})};
2
2
  //# sourceMappingURL=GeneratedCodeCitation.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r="[MarkdownSearch]";exports.useMarkdownSearch=function(t,n){var o=e.useRef([]),a=e.useCallback(function(){o.current.forEach(function(e){var r=e.mark,t=r.parentNode;if(t){for(;r.firstChild;)t.insertBefore(r.firstChild,r);t.removeChild(r)}}),o.current=[]},[]),l=function(e,r,t){var a=r+t;if(!e[r]||!e[a-1])return null;var l=e[r],c=e[a-1],s=document.createRange();try{s.setStart(l.node,l.offset),s.setEnd(c.node,c.offset+1)}catch(e){return null}var u=document.createElement("mark");u.className="markdown-search-highlight",n&&Object.assign(u.style,n);try{s.surroundContents(u)}catch(e){return null}return o.current.push({mark:u}),u},c=function(e){return e.toLowerCase().replace(/[^a-z0-9\s]/g,"")},s=function(e){for(var r=c(e),t=[],n=0;n<r.length-1;n++)t.push(r.slice(n,n+2));return t},u=function(e,r){var t=s(e),n=s(r),o=new Set(t),a=0;return n.forEach(function(e){o.has(e)&&a++}),2*a/(t.length+n.length)},i=function(e,r){var t=new Set(c(e).split(/\s+/).filter(Boolean)),n=new Set(c(r).split(/\s+/).filter(Boolean)),o=0;return t.forEach(function(e){return n.has(e)&&o++}),o/t.size},f=function(e,r){for(var t=Array(e.length+1).fill(null).map(function(){return Array(r.length+1).fill(0)}),n=0,o=0,a=1;a<=e.length;a++)for(var l=1;l<=r.length;l++)e[a-1]===r[l-1]&&(t[a][l]=t[a-1][l-1]+1,t[a][l]>n&&(n=t[a][l],o=a));return{substring:e.slice(o-n,o),startOffset:o-n,length:n}},h=e.useCallback(function(e,n){var o;if(void 0===n&&(n=1),t.current&&e.length&&(console.log(r,"Search started",e),a(),null===(o=t.current)||void 0===o?void 0:o.isConnected)){for(var c=function(e){for(var r,t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n="",o=[];r=t.nextNode();){for(var a=r,l=a.nodeValue||"",c=0;c<l.length;c++)o.push({node:a,offset:c});n+=l}return{fullText:n,map:o}}(t.current),s=c.fullText,h=c.map,g=s.toLowerCase(),d=0,v=null,m=!1,p=0,k=e;p<k.length;p++)for(var w=(z=k[p]).toLowerCase().trim(),b=0;-1!==(b=g.indexOf(w,b));){if(console.log(r,"Exact match found",b),(A=l(h,b,w.length))&&!v&&(v=A),m=!0,++d>=n)break;b+=w.length}if(m)return console.log(r,"Exact match phase complete, skipping fuzzy search"),void(null==v||v.scrollIntoView({behavior:"smooth",block:"center"}));console.log(r,"No exact matches, running strict fuzzy search");for(var C=0,y=e;C<y.length;C++){for(var z,x=(z=y[C]).length,S=0,E=-1,N=0;N<=s.length-x;N+=2){var O=s.slice(N,N+x),L=u(O,z),T=i(O,z);if(!(T<.8)){var B=.8*L+.2*T;B>S&&(S=B,E=N)}}if(console.log(r,"Best fuzzy score:",S),S>.82&&-1!==E){O=s.slice(E,E+x);var M=f(O.toLowerCase(),z.toLowerCase()),V=M.substring,_=M.startOffset,j=M.length;if(j>10){var A,F=E+_;console.log(r,"Fuzzy refined match",{refinedStart:F,length:j,substring:V}),(A=l(h,F,j))&&!v&&(v=A),d++}}}v?v.scrollIntoView({behavior:"smooth",block:"center"}):console.log(r,"No matches found")}},[a,t]);return e.useMemo(function(){return{search:h,clear:a}},[h,a])};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r="[MarkdownSearch]",n="markdown-search-highlight-active";exports.useMarkdownSearch=function(t,a){var l=e.useRef([]),u=e.useRef(-1),o=e.useRef(!1),c=e.useCallback(function(){o.current=!0,l.current.forEach(function(e){var r=e.mark,n=r.parentNode;if(n){for(;r.firstChild;)n.insertBefore(r.firstChild,r);n.removeChild(r)}}),l.current=[],u.current=-1,requestAnimationFrame(function(){setTimeout(function(){o.current=!1},0)})},[]),s=e.useCallback(function(e){for(var r,n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),t="",a=[];r=n.nextNode();){for(var l=r,u=l.nodeValue||"",o=0;o<u.length;o++)a.push({node:l,offset:o});t+=u}return{fullText:t,map:a}},[]),i=e.useCallback(function(e,n,t){var u=n+t;if(!e[n]||!e[u-1])return null;var o=document.createRange();try{o.setStart(e[n].node,e[n].offset),o.setEnd(e[u-1].node,e[u-1].offset+1)}catch(e){return null}var c=document.createElement("mark");c.className="markdown-search-highlight",a&&Object.assign(c.style,a);try{o.surroundContents(c)}catch(e){return console.warn(r,"surroundContents failed, falling back"),null}return l.current.push({mark:c}),c},[a]),f=e.useCallback(function(e){var r=l.current;if(r.length){u.current>=0&&r[u.current]&&r[u.current].mark.classList.remove(n);var t=(e%r.length+r.length)%r.length;u.current=t;var a=r[t].mark;a.classList.add(n),a.scrollIntoView({behavior:"smooth",block:"center"})}},[]),h=e.useCallback(function(){f(u.current+1)},[f]),g=e.useCallback(function(){f(u.current-1)},[f]),d=e.useCallback(function(e){return e.toLowerCase().replace(/[^a-z0-9\s]/g,"")},[]),v=e.useCallback(function(e){for(var r=d(e),n=[],t=0;t<r.length-1;t++)n.push(r.slice(t,t+2));return n},[d]),k=e.useCallback(function(e,r){var n=v(e),t=v(r),a=new Set(n),l=0;return t.forEach(function(e){a.has(e)&&l++}),2*l/(n.length+t.length)},[v]),m=e.useCallback(function(e,r){var n=new Set(d(e).split(/\s+/).filter(Boolean)),t=new Set(d(r).split(/\s+/).filter(Boolean)),a=0;return n.forEach(function(e){return t.has(e)&&a++}),a/n.size},[d]),C=e.useCallback(function(e,r){for(var n=Array(e.length+1).fill(null).map(function(){return Array(r.length+1).fill(0)}),t=0,a=0,l=1;l<=e.length;l++)for(var u=1;u<=r.length;u++)e[l-1]===r[u-1]&&(n[l][u]=n[l-1][u-1]+1,n[l][u]>t&&(t=n[l][u],a=l));return{substring:e.slice(a-t,a),startOffset:a-t,length:t}},[]),b=e.useCallback(function(e){var n;if((null===(n=t.current)||void 0===n?void 0:n.isConnected)&&e.length){console.warn(r,"surroundContents failed, falling back"),o.current=!0,c(),o.current=!0;for(var a=s(t.current),u=a.fullText,h=a.map,g=u.toLowerCase(),d=!1,v=0,b=e;v<b.length;v++){var w=(S=b[v]).toLowerCase().trim();if(w)for(var p=0;-1!==(p=g.indexOf(w,p));)console.warn(r,"surroundContents failed, falling back"),i(h,p,w.length),d=!0,p+=w.length}if(!d)for(var x=0,L=e;x<L.length;x++){for(var S,T=(S=L[x]).length,y=0,E=-1,O=0;O<=u.length-T;O+=2){var M=u.slice(O,O+T),R=k(M,S),A=m(M,S);if(!(A<.8)){var N=.8*R+.2*A;N>y&&(y=N,E=O)}}if(y>.82&&-1!==E){M=u.slice(E,E+T);var q=C(M.toLowerCase(),S.toLowerCase()),B=q.startOffset,F=q.length;F>10&&i(h,E+B,F)}}requestAnimationFrame(function(){setTimeout(function(){o.current=!1},0)}),l.current.length>0&&f(0)}},[c,t,s,i,k,m,C,f]),w=e.useCallback(function(){return l.current.length},[]);return e.useMemo(function(){return{search:b,clear:c,next:h,prev:g,matchCount:w,isMutatingRef:o}},[b,c,h,g,w])};
2
2
  //# sourceMappingURL=useMarkdownSearch.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("lucide-react"),t=require("../icons/MeetingHighlightsIcon.js"),i={thinkingBulbIcon:"https://storymod-assests.pages.dev/ThinkingBulbIcon.gif",brainStormIcon:"https://storymod-assests.pages.dev/brainstorm.gif",brainStormCropped:"https://storymod-assests.pages.dev/brainstorm-cropped.gif",stormeeCitationIcon:"https://storymod-assests.pages.dev/stormee_citation_icon.svg",rcaCitationIcon:"https://storymod-assests.pages.dev/appmod-icon.svg"};exports.GetFileIcon=function(a,r){switch(null==a?void 0:a.toLowerCase()){case"mp3":case"wav":case"audio":return e.jsx(s.AudioLines,{className:"h-5 w-5 text-indigo-600",size:24});case"png":case"jpg":case"jpeg":case"image":case"heic":case"heif":return e.jsx(s.Image,{className:"h-5 w-5 text-purple-500",size:24});case"mp4":case"avi":case"mov":case"video":return e.jsx(s.Clapperboard,{className:"h-5 w-5 text-rose-500",size:24});case"pdf":return e.jsx(s.FileText,{className:"h-5 w-5 text-red-500",size:24});case"doc":case"docx":return e.jsx(s.FileText,{className:"h-5 w-5 text-blue-600",size:24});case"txt":return e.jsx(s.FileText,{className:"h-5 w-5 text-gray-600",size:24});case"json":if(null==r?void 0:r.startsWith("ST_"))return e.jsx("img",{src:i.stormeeCitationIcon,style:{mixBlendMode:"multiply"},className:"w-7 h-7"});if(null==r?void 0:r.startsWith("MH_"))return e.jsx(t.default,{});break;default:return e.jsx(s.FileText,{className:"h-5 w-5 text-yellow-600",size:24})}},exports.assetList=i,exports.getDisplayFileType=function(e,s){if("json"===(null==e?void 0:e.toLowerCase())){if(null==s?void 0:s.startsWith("ST_"))return"Stormee";if(null==s?void 0:s.startsWith("MH_"))return"Meeting Highlights"}return e};
2
+ //# sourceMappingURL=userStoryAttachedContext.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userStoryAttachedContext.utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/RequirementAI/components/citations/readfile-citation/ReadFileCitationRenderer.js"),r=require("./features/RequirementAI/components/citations/rca-citation/RCACitationRenderer.js"),t=require("./features/RequirementAI/components/citations/rca-citation/RCACitationContent.js"),o=require("./features/RequirementAI/components/citations/appmod-citation/AppmodCitationRenderer.js"),s=require("./features/RequirementAI/components/citations/appmod-citation/AppmodCitationContent.js"),i=require("./features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js"),a=require("./features/RequirementAI/components/story-screen/UserStoryScreen.js"),n=require("./features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js"),p=require("./features/RequirementAI/components/RichTextEditor/RichTextEditor.js"),u=require("./features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js"),d=require("./features/RequirementAI/components/story-screen/SubfeatureBlock.js"),c=require("./features/RequirementAI/shared/AtomicButton.js"),m=require("./features/RequirementAI/icons/SidebarOpenIcon.js"),S=require("./features/RequirementAI/icons/SidebarCloseIcon.js"),l=require("./features/RequirementAI/components/story-screen/StreamingScreenSidebar.js"),f=require("./features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js"),q=require("./features/RequirementAI/hooks/useStreamContentHandler.js"),R=require("./features/RequirementAI/utils/proccess-stream.utils.js"),I=require("./features/RequirementAI/utils/diff-edit.utils.js"),y=require("./features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js"),j=require("./features/RequirementAI/hooks/useDiffEditReviewMode.js"),x=require("./features/RequirementAI/components/UserStoryCard/UserStoryCard.js"),A=require("./features/RequirementAI/components/citations/file-citation/FileCitationRender.js"),U=require("./features/RequirementAI/components/citations/web-citation/WebCitationWithImageRenderer.js"),C=require("./features/RequirementAI/components/citations/web-citation/WebCitationRenderer.js"),h=require("./features/RequirementAI/components/citations/stormee-citation/StormeeCitationRenderer.js"),b=require("./features/RequirementAI/components/citations/audio-citation/WaveformCitationRenderer.js"),k=require("./features/RequirementAI/components/citations/image-citation/ImageCitationRenderer.js"),g=require("./features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.js"),D=require("./features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithGap.js"),w=require("./features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithRisk.js"),B=require("./features/RequirementAI/utils/userstory-approval-transform.utils.js"),P=require("./features/UserStoryImport/UserStoryPicker.js"),v=require("./features/UserStoryImport/components/Header.js"),T=require("./features/UserStoryImport/components/Toolbar.js"),G=require("./features/UserStoryImport/components/SearchInput.js"),W=require("./features/UserStoryImport/components/BrowseProjectsButton.js"),F=require("./features/UserStoryImport/components/SectionHeading.js"),H=require("./features/UserStoryImport/components/CardGrid.js"),L=require("./features/UserStoryImport/components/UserStoryCard.js"),M=require("./features/UserStoryImport/components/ProjectCard.js"),z=require("./features/UserStoryImport/components/Badge.js"),E=require("./features/UserStoryImport/components/BackNav.js"),N=require("./features/UserStoryImport/components/SortDropdown.js"),O=require("./features/UserStoryImport/components/ShowMore.js"),V=require("./features/UserStoryImport/components/ProceedButton.js"),_=require("./features/UserStoryImport/components/Footer.js"),J=require("./features/UserStoryImport/components/SplitLayout.js"),K=require("./features/UserStoryImport/components/Sidebar.js"),Q=require("./features/UserStoryImport/components/SidebarSection.js"),X=require("./features/UserStoryImport/components/SidebarProjectList.js"),Y=require("./features/UserStoryImport/components/SidebarFavoritesList.js"),Z=require("./features/UserStoryImport/components/ContentArea.js"),$=require("./features/UserStoryImport/components/NavRow.js"),ee=require("./features/UserStoryImport/components/UserStoryImportDialog.js"),re=require("./features/UserStoryImport/components/ResizeHandle.js"),te=require("./features/UserStoryImport/components/ScopeDropdown.js"),oe=require("./features/UserStoryImport/components/TypeDropdown.js"),se=require("./features/UserStoryImport/UserStoryPicker.context.js"),ie=require("./features/UserStoryImport/hooks/useUSPData.js"),ae=require("./features/UserStoryImport/components/usePanelResize.js"),ne=require("./features/UserStoryImport/UserStoryPicker.theme.js"),pe=Object.assign(P.UserStoryPickerRoot,{Header:v.Header,Toolbar:T.Toolbar,SearchInput:G.SearchInput,BrowseProjectsButton:W.BrowseProjectsButton,SectionHeading:F.SectionHeading,CardGrid:H.CardGrid,UserStoryCard:L.UserStoryCard,ProjectCard:M.ProjectCard,Badge:z.Badge,BackNav:E.BackNav,SortDropdown:N.SortDropdown,ScopeDropdown:te.ScopeDropdown,TypeDropdown:oe.TypeDropdown,ShowMore:O.ShowMore,ProceedButton:V.ProceedButton,Footer:_.Footer,SplitLayout:J.SplitLayout,Sidebar:K.Sidebar,SidebarSection:Q.SidebarSection,SidebarProjectList:X.SidebarProjectList,SidebarFavoritesList:Y.SidebarFavoritesList,ContentArea:Z.ContentArea,NavRow:$.NavRow,UserStoryImportDialog:ee.UserStoryImportDialog,ResizeHandle:re.ResizeHandle});exports.ReadFileCitationRenderer=e.default,exports.RCACitationRenderer=r.default,exports.RCACitationContent=t.default,exports.AppModCitationRenderer=o.default,exports.AppModCitationContent=s.default,exports.RequirementAIWrapper=i.default,exports.useRequirementAI=i.useRequirementAI,exports.UserStoryScreen=a.default,exports.UserStoryApprovalScreen=n.default,exports.RichTextEditor=p.default,exports.UserStoryWithCitation=u.default,exports.SubFeatureBlock=d.default,exports.AtomicButton=c.default,exports.SidebarOpenIcon=m.SidebarOpenIcon,exports.SidebarCloseIcon=S.SidebarCloseIcon,exports.StreamingScreenSidebar=l.default,exports.AiReasoningCitationContent=f.default,exports.useStreamContentHandler=q.useStreamContentHandler,exports.extractBlockStreams=R.extractBlockStreams,exports.extractDescription=R.extractDescription,exports.processAIReasoningFromBlocks=R.processAIReasoningFromBlocks,exports.processUserStoryValue=R.processUserStoryValue,exports.handleAcceptAllChanges=I.handleAcceptAllChanges,exports.handleDiffEditApplied=I.handleDiffEditApplied,exports.handleDiscardAll=I.handleDiscardAll,exports.GapFilterBlock=y.GapFilterBlock,exports.hasAnyUpdatedTags=j.hasAnyUpdatedTags,exports.useDiffEditReviewMode=j.useDiffEditReviewMode,exports.UserStoryCardWrapper=x.UserStoryCardWrapper,exports.FileCitationRender=A.default,exports.WebCitationWithImageRenderer=U.default,exports.WebCitationRenderer=C.default,exports.StormeeCitationRenderer=h.default,exports.WaveformCitationRenderer=b.default,exports.ImageCitationRenderer=k.default,exports.GapRiskSidebar=g.default,exports.NoGapsFound=g.NoGapsFound,exports.useGapRiskSidebar=g.useGapRiskSidebar,exports.buildStoryWithGap=D.buildStoryWithGap,exports.updateGapInRawData=D.updateGapInRawData,exports.updateGapStory=D.updateGapStory,exports.buildStoryWithRisk=w.buildStoryWithRisk,exports.updateRiskInRawData=w.updateRiskInRawData,exports.updateStory=w.updateStory,exports.cloneUserStories=B.cloneUserStories,exports.createUserStoriesForApproval=B.createUserStoriesForApproval,exports.splitByHeaders=B.splitByHeaders,exports.transformApprovalToUserStory=B.transformApprovalToUserStory,exports.UserStoryImportDialog=ee.UserStoryImportDialog,exports.ResizeHandle=re.ResizeHandle,exports.useUSPContext=se.useUSPContext,exports.useUSPData=ie.useUSPData,exports.usePanelResize=ae.usePanelResize,exports.darkTheme=ne.darkTheme,exports.lightTheme=ne.lightTheme,exports.themeToStyle=ne.themeToStyle,exports.uspColorPalette=ne.uspColorPalette,exports.uspVSCodeLightTheme=ne.uspVSCodeLightTheme,exports.vscodeTheme=ne.vscodeTheme,exports.UserStoryPicker=pe;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/RequirementAI/components/citations/readfile-citation/ReadFileCitationRenderer.js"),r=require("./features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js"),t=require("./features/RequirementAI/components/citations/rca-citation/RCACitationRenderer.js"),o=require("./features/RequirementAI/components/citations/rca-citation/RCACitationContent.js"),s=require("./features/RequirementAI/components/citations/appmod-citation/AppmodCitationRenderer.js"),i=require("./features/RequirementAI/components/citations/appmod-citation/AppmodCitationContent.js"),a=require("./features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js"),n=require("./features/RequirementAI/components/story-screen/UserStoryScreen.js"),p=require("./features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js"),u=require("./features/RequirementAI/components/RichTextEditor/RichTextEditor.js"),d=require("./features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js"),c=require("./features/RequirementAI/components/story-screen/SubfeatureBlock.js"),m=require("./features/RequirementAI/shared/AtomicButton.js"),S=require("./features/RequirementAI/icons/SidebarOpenIcon.js"),l=require("./features/RequirementAI/icons/SidebarCloseIcon.js"),f=require("./features/RequirementAI/components/story-screen/StreamingScreenSidebar.js"),R=require("./features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js"),q=require("./features/RequirementAI/hooks/useStreamContentHandler.js"),I=require("./features/RequirementAI/utils/proccess-stream.utils.js"),y=require("./features/RequirementAI/utils/diff-edit.utils.js"),j=require("./features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js"),x=require("./features/RequirementAI/hooks/useDiffEditReviewMode.js"),A=require("./features/RequirementAI/components/UserStoryCard/UserStoryCard.js"),C=require("./features/RequirementAI/components/citations/file-citation/FileCitationRender.js"),U=require("./features/RequirementAI/components/citations/web-citation/WebCitationWithImageRenderer.js"),h=require("./features/RequirementAI/components/citations/web-citation/WebCitationRenderer.js"),b=require("./features/RequirementAI/components/citations/stormee-citation/StormeeCitationRenderer.js"),k=require("./features/RequirementAI/components/citations/audio-citation/WaveformCitationRenderer.js"),g=require("./features/RequirementAI/components/citations/image-citation/ImageCitationRenderer.js"),D=require("./features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.js"),w=require("./features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithGap.js"),B=require("./features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithRisk.js"),P=require("./features/RequirementAI/utils/userstory-approval-transform.utils.js"),v=require("./features/UserStoryImport/UserStoryPicker.js"),T=require("./features/UserStoryImport/components/Header.js"),F=require("./features/UserStoryImport/components/Toolbar.js"),G=require("./features/UserStoryImport/components/SearchInput.js"),W=require("./features/UserStoryImport/components/BrowseProjectsButton.js"),H=require("./features/UserStoryImport/components/SectionHeading.js"),L=require("./features/UserStoryImport/components/CardGrid.js"),M=require("./features/UserStoryImport/components/UserStoryCard.js"),z=require("./features/UserStoryImport/components/ProjectCard.js"),E=require("./features/UserStoryImport/components/Badge.js"),N=require("./features/UserStoryImport/components/BackNav.js"),O=require("./features/UserStoryImport/components/SortDropdown.js"),V=require("./features/UserStoryImport/components/ShowMore.js"),_=require("./features/UserStoryImport/components/ProceedButton.js"),J=require("./features/UserStoryImport/components/Footer.js"),K=require("./features/UserStoryImport/components/SplitLayout.js"),Q=require("./features/UserStoryImport/components/Sidebar.js"),X=require("./features/UserStoryImport/components/SidebarSection.js"),Y=require("./features/UserStoryImport/components/SidebarProjectList.js"),Z=require("./features/UserStoryImport/components/SidebarFavoritesList.js"),$=require("./features/UserStoryImport/components/ContentArea.js"),ee=require("./features/UserStoryImport/components/NavRow.js"),re=require("./features/UserStoryImport/components/UserStoryImportDialog.js"),te=require("./features/UserStoryImport/components/ResizeHandle.js"),oe=require("./features/UserStoryImport/components/ScopeDropdown.js"),se=require("./features/UserStoryImport/components/TypeDropdown.js"),ie=require("./features/UserStoryImport/UserStoryPicker.context.js"),ae=require("./features/UserStoryImport/hooks/useUSPData.js"),ne=require("./features/UserStoryImport/components/usePanelResize.js"),pe=require("./features/UserStoryImport/UserStoryPicker.theme.js"),ue=Object.assign(v.UserStoryPickerRoot,{Header:T.Header,Toolbar:F.Toolbar,SearchInput:G.SearchInput,BrowseProjectsButton:W.BrowseProjectsButton,SectionHeading:H.SectionHeading,CardGrid:L.CardGrid,UserStoryCard:M.UserStoryCard,ProjectCard:z.ProjectCard,Badge:E.Badge,BackNav:N.BackNav,SortDropdown:O.SortDropdown,ScopeDropdown:oe.ScopeDropdown,TypeDropdown:se.TypeDropdown,ShowMore:V.ShowMore,ProceedButton:_.ProceedButton,Footer:J.Footer,SplitLayout:K.SplitLayout,Sidebar:Q.Sidebar,SidebarSection:X.SidebarSection,SidebarProjectList:Y.SidebarProjectList,SidebarFavoritesList:Z.SidebarFavoritesList,ContentArea:$.ContentArea,NavRow:ee.NavRow,UserStoryImportDialog:re.UserStoryImportDialog,ResizeHandle:te.ResizeHandle});exports.ReadFileCitationRenderer=e.default,exports.ReadFileCitationContent=r.default,exports.RCACitationRenderer=t.default,exports.RCACitationContent=o.default,exports.AppModCitationRenderer=s.default,exports.AppModCitationContent=i.default,exports.RequirementAIWrapper=a.default,exports.useRequirementAI=a.useRequirementAI,exports.UserStoryScreen=n.default,exports.UserStoryApprovalScreen=p.default,exports.RichTextEditor=u.default,exports.UserStoryWithCitation=d.default,exports.SubFeatureBlock=c.default,exports.AtomicButton=m.default,exports.SidebarOpenIcon=S.SidebarOpenIcon,exports.SidebarCloseIcon=l.SidebarCloseIcon,exports.StreamingScreenSidebar=f.default,exports.AiReasoningCitationContent=R.default,exports.useStreamContentHandler=q.useStreamContentHandler,exports.extractBlockStreams=I.extractBlockStreams,exports.extractDescription=I.extractDescription,exports.processAIReasoningFromBlocks=I.processAIReasoningFromBlocks,exports.processUserStoryValue=I.processUserStoryValue,exports.handleAcceptAllChanges=y.handleAcceptAllChanges,exports.handleDiffEditApplied=y.handleDiffEditApplied,exports.handleDiscardAll=y.handleDiscardAll,exports.GapFilterBlock=j.GapFilterBlock,exports.hasAnyUpdatedTags=x.hasAnyUpdatedTags,exports.useDiffEditReviewMode=x.useDiffEditReviewMode,exports.UserStoryCardWrapper=A.UserStoryCardWrapper,exports.FileCitationRender=C.default,exports.WebCitationWithImageRenderer=U.default,exports.WebCitationRenderer=h.default,exports.StormeeCitationRenderer=b.default,exports.WaveformCitationRenderer=k.default,exports.ImageCitationRenderer=g.default,exports.GapRiskSidebar=D.default,exports.NoGapsFound=D.NoGapsFound,exports.useGapRiskSidebar=D.useGapRiskSidebar,exports.buildStoryWithGap=w.buildStoryWithGap,exports.updateGapInRawData=w.updateGapInRawData,exports.updateGapStory=w.updateGapStory,exports.buildStoryWithRisk=B.buildStoryWithRisk,exports.updateRiskInRawData=B.updateRiskInRawData,exports.updateStory=B.updateStory,exports.cloneUserStories=P.cloneUserStories,exports.createUserStoriesForApproval=P.createUserStoriesForApproval,exports.splitByHeaders=P.splitByHeaders,exports.transformApprovalToUserStory=P.transformApprovalToUserStory,exports.UserStoryImportDialog=re.UserStoryImportDialog,exports.ResizeHandle=te.ResizeHandle,exports.useUSPContext=ie.useUSPContext,exports.useUSPData=ae.useUSPData,exports.usePanelResize=ne.usePanelResize,exports.darkTheme=pe.darkTheme,exports.lightTheme=pe.lightTheme,exports.themeToStyle=pe.themeToStyle,exports.uspColorPalette=pe.uspColorPalette,exports.uspVSCodeLightTheme=pe.uspVSCodeLightTheme,exports.vscodeTheme=pe.vscodeTheme,exports.UserStoryPicker=ue;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as t}from"tslib";import{jsx as n}from"react/jsx-runtime";import{createContext as i,useMemo as r,useCallback as e,useContext as o}from"react";import{RefProvider as a}from"../../store/ref.context.js";var s=i(null),u=function(i){var o=i.children,u=i.userStory,c=i.setUserStory,f=i.aiReasoning,g=i.setAiReasoning,l=i.citations,h=i.setCitations,d=i.apiCachingConfig,m=i.customStyles,v=i.customIcons,C=i.searchQueryList,p=i.searchQueryReasoningIdList,y=i.citationConfig,R=i.chatHistory,S=i.chatCitationConfigs,A=i.gptCitationConfigs,I=i.aiReasoningAccordionOpenStates,x=r(function(){if(0===u.length||0===f.length)return Array(u.length).fill(0);var t=Array.from({length:u.length},function(){return[]});return f.forEach(function(n){var i=Number(n.relevance_score);if(!(isNaN(i)||i<=0)){var r="ai_reasoning$".concat(n.id),e=u.findIndex(function(t){var n;return t.value.includes(r)||(null===(n=t.sub_features)||void 0===n?void 0:n.some(function(t){return t.value.includes(r)}))});-1!==e&&t[e].push(i)}}),t.map(function(t){return 0===t.length?0:Math.round(t.reduce(function(t,n){return t+n},0)/t.length)})},[u,f]),b=e(function(t){var n,i=u.findIndex(function(n){return n.artifactId===t});return-1===i?0:null!==(n=x[i])&&void 0!==n?n:0},[u,x]);return n(s.Provider,t({value:{chatHistory:R,userStory:u,setUserStory:c,aiReasoning:f,setAiReasoning:g,citations:l,setCitations:h,apiCachingConfig:d,customStyles:m,customIcons:v,searchQueryList:C,searchQueryReasoningIdList:p,citationConfig:y,getAvgScoreForStory:b,chatCitationConfigs:S,gptCitationConfigs:A,aiReasoningAccordionOpenStates:I}},{children:n(a,{children:o})}))},c=function(){var t=o(s);if(!t)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return t};export{u as default,c as useRequirementAI};
1
+ import{__assign as t}from"tslib";import{jsx as n}from"react/jsx-runtime";import{createContext as e,useMemo as i,useCallback as r,useContext as o}from"react";import{RefProvider as a}from"../../store/ref.context.js";var s=e(null),u=function(e){var o=e.children,u=e.userStory,c=e.setUserStory,f=e.aiReasoning,g=e.setAiReasoning,l=e.citations,d=e.setCitations,h=e.apiCachingConfig,m=e.customStyles,p=e.customIcons,v=e.searchQueryList,C=e.searchQueryReasoningIdList,y=e.citationConfig,R=e.chatHistory,S=e.chatCitationConfigs,A=e.gptCitationConfigs,I=e.aiReasoningAccordionOpenStates,x=e.persistedDataFiles,b=i(function(){if(0===u.length||0===f.length)return Array(u.length).fill(0);var t=Array.from({length:u.length},function(){return[]});return f.forEach(function(n){var e=Number(n.relevance_score);if(!(isNaN(e)||e<=0)){var i="ai_reasoning$".concat(n.id),r=u.findIndex(function(t){var n;return t.value.includes(i)||(null===(n=t.sub_features)||void 0===n?void 0:n.some(function(t){return t.value.includes(i)}))});-1!==r&&t[r].push(e)}}),t.map(function(t){return 0===t.length?0:Math.round(t.reduce(function(t,n){return t+n},0)/t.length)})},[u,f]),L=r(function(t){var n,e=u.findIndex(function(n){return n.artifactId===t});return-1===e?0:null!==(n=b[e])&&void 0!==n?n:0},[u,b]);return n(s.Provider,t({value:{chatHistory:R,userStory:u,setUserStory:c,aiReasoning:f,setAiReasoning:g,citations:l,setCitations:d,apiCachingConfig:h,customStyles:m,customIcons:p,searchQueryList:v,searchQueryReasoningIdList:C,citationConfig:y,getAvgScoreForStory:L,chatCitationConfigs:S,gptCitationConfigs:A,aiReasoningAccordionOpenStates:I,persistedDataFiles:x}},{children:n(a,{children:o})}))},c=function(){var t=o(s);if(!t)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return t};export{u as default,c as useRequirementAI};
2
2
  //# sourceMappingURL=RequirementAIWrapper.js.map
@@ -0,0 +1,2 @@
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{useState as a,useRef as i,useEffect as s,useMemo as c}from"react";import{BookOpen as l,ChevronUp as d,ChevronDown as u,Video as m,Headphones as p,ImageIcon as g,FileText as h,FileCode as f,Loader2 as v,ExternalLink as b}from"lucide-react";import{useRequirementAI as x}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{Snackbar as w,Alert as y,AlertTitle as N}from"@mui/material";import{getDisplayFileType as k,GetFileIcon as C}from"../../utils/userStoryAttachedContext.utils.js";var z=function(e){return["mp4","mov","webm","mkv"].includes(e)?o(m,{size:24}):["mp3","wav","ogg","m4a","aac"].includes(e)?o(p,{size:24}):["png","jpg","jpeg","svg","webp","gif"].includes(e)?o(g,{size:24}):["pdf","docx","doc","txt","rtf","pages"].includes(e)?o(h,{size:24}):o(f,{size:24})},j=function(i){var c=i.item,l=i.isLast,d=i.getIconByExtension,u=x().apiCachingConfig,m=u.queryClient,p=u.useGetSignedUrlQuery,g=u.useGetSignedUrlMutation,h=u.getProjectFileUrl,f=a(!1),k=f[0],z=f[1],j=a(""),E=j[0],L=j[1],P=null==h?void 0:h(c.path),U=["getSignedUrl",P],A=p(P,U).data,D=g(P),I=D.mutate,S=D.isPending;s(function(){if(!P)return L("Please provide valid gsUtilPath."),void z(!0);m.getQueryData(U)||A||I({gsUtilPath:P})},[P]);return n("div",e({className:"\n group flex items-start gap-4 p-4 mx-2 rounded-[8px] transition-colors\n hover:bg-gray-50 border-b border-transparent\n ".concat(l?"":"border-gray-100","\n ")},{children:[o("div",e({className:"mt-1 p-2 bg-violet-50 rounded-[8px] text-violet-500"},{children:C(c.extension,c.title.toUpperCase())||d(c.extension)})),n("div",e({className:"flex-1 min-w-0"},{children:[o("h3",e({className:"text-[15px] font-semibold text-gray-900 truncate group-hover:text-violet-600 transition-colors"},{children:c.title})),o("p",e({className:"text-sm text-gray-500 mt-0.5"},{children:c.metadata}))]})),o("div",e({onClick:function(e){return t(void 0,void 0,void 0,function(){var t,n,o,a,i,s,l;return r(this,function(r){switch(r.label){case 0:e.stopPropagation(),r.label=1;case 1:return r.trys.push([1,4,,5]),(t=A||m.getQueryData(U))?"json"!==c.extension.toLowerCase()?(window.open(t,"_blank"),[2]):[4,fetch(t)]:(S||I({gsUtilPath:P}),[2]);case 2:if(!(n=r.sent()).ok)throw new Error("Failed to fetch artifact JSON");return[4,n.json()];case 3:return o=r.sent(),a=o.id,i=o.modeName,a&&i?(s="".concat(window.location.origin,"/artifact/").concat(a,"/mode/").concat(i),window.open(s,"_blank"),[3,5]):(window.open(t,"_blank"),[2]);case 4:return l=r.sent(),console.error("Redirect failed:",l),window.open(A,"_blank"),[3,5];case 5:return[2]}})})},className:"text-gray-400 hover:text-violet-600 cursor-pointer self-center p-2 rounded-[4px] hover:bg-white transition-all"},{children:S?o(v,{size:24,className:"animate-spin text-gray-500"}):o(b,{size:24,className:A?"text-gray-500":""})})),o(w,e({open:k,autoHideDuration:3e3,onClose:function(){return z(!1)},anchorOrigin:{vertical:"bottom",horizontal:"right"}},{children:n(y,e({onClose:function(){return z(!1)},severity:"error",sx:{width:"100%"}},{children:[o(N,{children:"Error"}),E]}))}))]}))},E=function(){var t=a(!1),r=t[0],m=t[1],p=i(null),g=i(null),h=x().persistedDataFiles;s(function(){var e=function(e){g.current&&!g.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var f=c(function(){var e=[];return h?(Object.entries(h).forEach(function(t){var r=t[0],n=t[1];Array.isArray(n)&&n.forEach(function(t){var n,o=t.filesFromProject;if(o){var a,i=o.name,s=(null===(n=o.type)||void 0===n?void 0:n.toLowerCase())||"",c=(a=o.uploadTime)?new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"";e.push({id:o.url,category:r,title:i,extension:s,metadata:"".concat(c," • ").concat(k(s,i)),path:o.url,uploadTime:o.uploadTime})}})}),e):e},[h]);return s(function(){var e=function(e){p.current&&!p.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]),n("div",e({className:"flex flex-col items-end"},{children:[n("div",e({className:"relative inline-block text-left",ref:g},{children:[n("button",e({onClick:function(e){e.stopPropagation(),m(!r)},className:"\n flex items-center gap-2 px-4 py-2 rounded-[8px] border transition-all duration-200\n bg-white border-gray-300 text-gray-700 hover:bg-gray-50 shadow-sm\n "},{children:[o(l,{size:18,className:"text-gray-600"}),n("span",e({className:"font-medium"},{children:["Attached Context(",f.length,")"]})),o(r?d:u,{size:18})]})),r&&n("div",e({className:"absolute left-0 mt-2 w-[420px] bg-white rounded-[12px] shadow-xl border border-gray-100 z-50 overflow-hidden",style:{animation:"slideIn 0.2s ease-out"}},{children:[o("div",e({className:"max-h-[300px] overflow-y-auto py-2 custom-scrollbar"},{children:f.length>0?f.map(function(e,t){return o(j,{item:e,isLast:t===f.length-1,getIconByExtension:z},e.id)}):o("div",e({className:"p-8 text-center text-gray-400 text-sm"},{children:"No attachments found"}))})),f.length>4&&o("div",{className:"h-4 bg-gradient-to-t from-gray-50/50 to-transparent pointer-events-none"})]}))]})),o("style",{children:"\n @keyframes slideIn {\n from { opacity: 0; transform: translateY(-10px) scale(0.98); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n .custom-scrollbar::-webkit-scrollbar {\n width: 6px;\n }\n .custom-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n .custom-scrollbar::-webkit-scrollbar-thumb {\n background: #e5e7eb;\n border-radius: 10px;\n }\n .custom-scrollbar::-webkit-scrollbar-thumb:hover {\n background: #d1d5db;\n }\n "})]}))};export{E as default};
2
+ //# sourceMappingURL=AttachedContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachedContext.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as t,__awaiter as n,__generator as r}from"tslib";import{jsx as o,jsxs as l,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as u}from"react";import{ExternalLink as c,Download as d,Share2 as v,Copy as y,LoaderCircle as f,PencilIcon as m,ChevronUp as p,ChevronDown as h,Info as S,Bookmark as I}from"lucide-react";import C from"showdown";import{Menu as w,MenuItem as U,Tooltip as N}from"@mui/material";import{v4 as b}from"uuid";import g from"./UserStoryCard.module.css.js";import{formatMarkdown as x,indentMarkdown as D}from"../../utils/helpers.js";import{replaceTitleSection as B}from"../../utils/user-story.utils.js";import M from"../../shared/AtomicButton.js";import k from"../RichTextEditor/RichTextEditor.js";import A from"../userstory-with-citation/UserStoryWithCitation.js";import{useRequirementAI as T}from"../RequirementAIWrapper/RequirementAIWrapper.js";function R(t){for(var n,r=[],l=/<learned>(.*?)<\/learned>/g,i=0,a=0;null!==(n=l.exec(t));){var s=n[1],u=n.index;u>i&&r.push(o("span",{children:t.slice(i,u)},"text-pre-".concat(a++))),r.push(o(N,e({title:s,placement:"top"},{children:o(S,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(b()))),i=l.lastIndex}return i<(null==t?void 0:t.length)&&r.push(o("span",{children:t.slice(i)},"text-post-".concat(a++))),r}var j=function(t){var n,r=t.displayName,i=T().customStyles,a=null===(n=null==i?void 0:i.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return l("div",e({className:g.displayName,style:null==a?void 0:a.wrapper},{children:[o(I,{className:g.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),l("span",e({style:null==a?void 0:a.label},{children:[r,":"]}))]}))},E=function(S){var I,N,b=S.isUserStoryCurrentlyUpdated,L=S.artifactId,z=S.artifactTitleId,P=S.parentUserStory,O=S.currentUserStory,W=S.onUserStoryChange,H=S.parentIndex,V=S.currentIndex,_=S.enableDownload,q=S.isDiffEditReviewMode,F=S.showUserStoryDiff,Q=S.handleDownloadUserStory,G=S.handleOpenSendDialog,J=S.updateUserStoryArtifact,K=S.selectedArtifactId,X=T(),Y=X.searchQueryList,Z=X.citations,$=X.customStyles,ee=null==$?void 0:$.userStoryCardStyles,te=null===(I=null==$?void 0:$.userStoryScreenStyles)||void 0===I?void 0:I.userStoryContentStyles,ne=a(e(e({},structuredClone(O)),{value:x(O.value)||""})),re=ne[0],oe=ne[1],le=a({userStory:!1}),ie=le[0],ae=le[1],se=T().userStory,ue=a(""===H||K===O.artifactId),ce=ue[0],de=ue[1],ve=a(!1);ve[0];var ye=ve[1],fe=a(null),me=fe[0],pe=fe[1],he=a(!1),Se=he[0],Ie=he[1],Ce=s(null),we=a(!1);we[0];var Ue=we[1];u(function(){b&&de(b)},[b]),u(function(){oe(e(e({},structuredClone(O)),{value:x(O.value)||""}))},[O]),u(function(){Y.length>0?de(!0):K&&de(K===O.artifactId)},[Y,K,O.artifactId]);var Ne=function(){pe(null)},be=function(){de(function(e){return!e})};return l("div",e({className:g.card,style:null==ee?void 0:ee.cardStyle},{children:[l("div",e({className:g.titleSection,style:null==ee?void 0:ee.titleSection},{children:[l("div",e({className:g.titleRow,style:null==ee?void 0:ee.titleRow,onClick:be},{children:[l("div",e({className:g.titleLeft,style:null==ee?void 0:ee.titleLeft,onMouseEnter:function(){return Ue(!0)},onMouseLeave:function(){return Ue(!1)}},{children:[o(j,{displayName:z}),o("h2",e({className:g.storyTitle,style:null==ee?void 0:ee.storyTitle},{children:R(O.title)}),O.artifactId)]})),l("div",e({className:g.titleActions,style:null==ee?void 0:ee.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[!ie.userStory&&l(i,{children:[o("button",e({className:g.iconButton,style:null==ee?void 0:ee.iconButton,onClick:function(e){pe(e.currentTarget)}},{children:o(c,{size:16})})),l(w,e({id:"user-story-share-menu",anchorEl:me,open:!!me,onClose:function(){return pe(null)},style:null==ee?void 0:ee.userStoryShareMenu},{children:[_&&o(U,e({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return ye(!0),Q?[4,Promise.all([Q("pdf"),Q("doc")])]:[2];case 1:return e.sent(),ye(!1),[2]}})})}},{children:l("div",e({ref:Ce,className:g.menuItemContent,style:null==ee?void 0:ee.menuItemContent},{children:[o(d,{size:16,color:null==ee?void 0:ee.menuIconColor}),o("p",e({style:null==ee?void 0:ee.menuLabel},{children:"Download"}))]}))})),o(U,e({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var t;return r(this,function(n){return t=O,P&&(t=e(e({},O),{value:"".concat(B(null==P?void 0:P.value,O.title)," \n").concat(O.value)})),null==G||G(!0,[t],O.artifactId),Ne(),[2]})})}},{children:l("div",e({style:null==ee?void 0:ee.menuItemContent,className:g.menuItemContentPadded},{children:[o(v,{size:16,color:null==ee?void 0:ee.menuIconColor}),o("p",e({style:null==ee?void 0:ee.menuLabel},{children:"Send"}))]}))})),o(U,e({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var e,t,n,o,l;return r(this,function(r){switch(r.label){case 0:e=new C.Converter,t=e.makeHtml(x(O.value)||O.value),n=function(e){var t=(new C.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(x(O.value)||O.value),o=new ClipboardItem({"text/plain":new Blob([n],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,navigator.clipboard.write([o])];case 2:return r.sent(),console.log("Copied User Story"),[3,5];case 3:return l=r.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return Ne(),[7];case 5:return[2]}})})}},{children:l("div",e({style:null==ee?void 0:ee.menuItemContent,className:g.menuItemContentPadded},{children:[o(y,{size:16,color:null==ee?void 0:ee.menuIconColor}),o("p",e({style:null==ee?void 0:ee.menuLabel},{children:"Copy"}))]}))}))]}))]}),ie.userStory&&ce?o(M,{type:"outline",children:"Cancel",style:null==ee?void 0:ee.cancelButton,onClick:function(){ae(function(t){return e(e({},t),{userStory:!1})})}}):o(i,{}),ie.userStory&&ce?o(M,{type:"fill",children:Se?l("span",e({className:g.savingSpinner},{children:[o(f,{className:g.spinAnimation}),o("span",{children:"Saving..."})]})):"Save",isDisable:Se,style:null==ee?void 0:ee.saveButton,onClick:function(){return n(void 0,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return Ie(!0),"userStory"==="userStory"&&(W(re),console.log("I am changing RTE editor values",re)),[4,J(Z,se,L)];case 1:return t.sent(),ae(function(t){return e(e({},t),{userStory:!1})}),Ie(!1),[2]}})})}}):!q&&!F&&ce&&o("button",e({className:g.iconButton,style:null==ee?void 0:ee.editButton,onClick:function(){return ae(function(t){return e(e({},t),{userStory:!0})})}},{children:o(m,{color:null==ee?void 0:ee.pencilIconColor,size:16})})),o("button",e({type:"button",onClick:function(e){e.stopPropagation(),be()},style:null==ee?void 0:ee.chevronButton,className:g.chevronButton},{children:o(ce?p:h,{className:g.chevronIcon,color:null==ee?void 0:ee.chevronIconColor})}))]}))]})),o("div",{className:g.divider,style:null==ee?void 0:ee.dividerStyle})]})),ce&&o("div",e({className:g.cardContent,style:null==ee?void 0:ee.cardContentStyle},{children:l("div",e({className:g.contentInner,style:null==ee?void 0:ee.contentInner},{children:[l("div",e({className:g.descriptionSection,style:null==ee?void 0:ee.descriptionSection},{children:[o("div",{className:g.justifyBetween,style:null==ee?void 0:ee.justifyBetween}),ie.userStory?o(k,{minHeight:"100%",height:"100%",type:"string",value:x(O.value)||"",handleUpdateState:function(t,n){var r=D(n);oe(function(t){return e(e({},t),{value:r||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:ie.userStory?"edit":"readOnly"}):o(A,{showUserStoryDiff:F,isParent:""===H,message:x(O.value)||"",artifactId:O.artifactId,customStyles:te})]})),null===(N=re.sub_features)||void 0===N?void 0:N.map(function(n,r){return o(E,{artifactId:L,isUserStoryCurrentlyUpdated:b,artifactTitleId:"".concat(z,"-").concat(String.fromCharCode(65+r)),parentUserStory:O,parentIndex:"".concat(H).concat(H&&".").concat(V),currentIndex:"".concat(r+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(n){return function(n,r){var o=t([],O.sub_features||[],!0);o[n]=r,W(e(e({},O),{sub_features:o}))}(r,n)},enableDownload:!0,isDiffEditReviewMode:q,showUserStoryDiff:F,updateUserStoryArtifact:J,handleDownloadUserStory:Q,handleOpenSendDialog:G},n.artifactId)})]}))}))]}))},L=function(n){var r=n.artifactTitleIDs,l=n.isDiffEditReviewMode,i=n.showUserStoryDiff,a=n.updateUserStoryArtifact,s=n.isUserStoryCurrentlyUpdated,u=n.artifactId,c=n.handleOpenSendDialog,d=n.handleDownloadUserStory,v=n.selectedArtifactId,y=T(),f=y.userStory,m=y.setUserStory,p=y.customStyles,h=null==p?void 0:p.userStoryCardStyles;return o("div",e({className:g.userStoryCardWrapper,style:null==h?void 0:h.userStoryCardWrapper},{children:f.map(function(e,n){return o(E,{isUserStoryCurrentlyUpdated:s,artifactId:u,artifactTitleId:r[n]||"",currentUserStory:e,onUserStoryChange:function(e){m(function(r){return r[n]=e,t([],r,!0)})},parentIndex:"",currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:l,showUserStoryDiff:i,updateUserStoryArtifact:a,handleOpenSendDialog:c,handleDownloadUserStory:d,selectedArtifactId:v},e.artifactId)})}))};export{E as StoryCard,L as UserStoryCardWrapper,E as default,R as replaceLearnedTagsWithInfo};
1
+ import{__assign as e,__spreadArray as t,__awaiter as n,__generator as r}from"tslib";import{jsx as o,jsxs as l,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as u}from"react";import{ExternalLink as c,Download as d,Share2 as v,Copy as y,LoaderCircle as f,PencilIcon as m,ChevronUp as p,ChevronDown as h,Info as S,Bookmark as I}from"lucide-react";import C from"showdown";import{Menu as w,MenuItem as U,Tooltip as N}from"@mui/material";import{v4 as b}from"uuid";import g from"./UserStoryCard.module.css.js";import{formatMarkdown as D,indentMarkdown as x}from"../../utils/helpers.js";import{replaceTitleSection as B}from"../../utils/user-story.utils.js";import M from"../../shared/AtomicButton.js";import k from"../RichTextEditor/RichTextEditor.js";import A from"../userstory-with-citation/UserStoryWithCitation.js";import{useRequirementAI as T}from"../RequirementAIWrapper/RequirementAIWrapper.js";function R(t){for(var n,r=[],l=/<learned>(.*?)<\/learned>/g,i=0,a=0;null!==(n=l.exec(t));){var s=n[1],u=n.index;u>i&&r.push(o("span",{children:t.slice(i,u)},"text-pre-".concat(a++))),r.push(o(N,e({title:s,placement:"top"},{children:o(S,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(b()))),i=l.lastIndex}return i<(null==t?void 0:t.length)&&r.push(o("span",{children:t.slice(i)},"text-post-".concat(a++))),r}var j=function(t){var n,r=t.displayName,i=T().customStyles,a=null===(n=null==i?void 0:i.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return l("div",e({className:g.displayName,style:null==a?void 0:a.wrapper},{children:[o(I,{className:g.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),l("span",e({style:null==a?void 0:a.label},{children:[r,":"]}))]}))},E=function(S){var I,N,b=S.isUserStoryCurrentlyUpdated,L=S.artifactId,z=S.artifactTitleId,P=S.parentUserStory,O=S.currentUserStory,W=S.onUserStoryChange,H=S.parentIndex,V=S.currentIndex,_=S.enableDownload,q=S.isDiffEditReviewMode,F=S.showUserStoryDiff,Q=S.handleDownloadUserStory,G=S.handleOpenSendDialog,J=S.updateUserStoryArtifact,K=S.selectedArtifactId,X=T(),Y=X.searchQueryList,Z=X.citations,$=X.customStyles,ee=null==$?void 0:$.userStoryCardStyles,te=null===(I=null==$?void 0:$.userStoryScreenStyles)||void 0===I?void 0:I.userStoryContentStyles,ne=a(e(e({},structuredClone(O)),{value:D(O.value)||""})),re=ne[0],oe=ne[1],le=a({userStory:!1}),ie=le[0],ae=le[1],se=T().userStory,ue=a(""===H||K===O.artifactId),ce=ue[0],de=ue[1],ve=a(!1);ve[0];var ye=ve[1],fe=a(null),me=fe[0],pe=fe[1],he=a(!1),Se=he[0],Ie=he[1],Ce=s(null),we=a(!1);we[0];var Ue=we[1];u(function(){b&&de(b)},[b]),u(function(){oe(e(e({},structuredClone(O)),{value:D(O.value)||""}))},[O]),u(function(){Y.length>0?de(!0):K&&de(K===O.artifactId)},[Y,K,O.artifactId]);var Ne=function(){pe(null)},be=function(){de(function(e){return!e})};return l("div",e({className:g.card,style:null==ee?void 0:ee.cardStyle},{children:[l("div",e({className:g.titleSection,style:null==ee?void 0:ee.titleSection},{children:[l("div",e({className:g.titleRow,style:null==ee?void 0:ee.titleRow,onClick:be},{children:[l("div",e({className:g.titleLeft,style:null==ee?void 0:ee.titleLeft,onMouseEnter:function(){return Ue(!0)},onMouseLeave:function(){return Ue(!1)}},{children:[o(j,{displayName:z}),o("h2",e({className:g.storyTitle,style:null==ee?void 0:ee.storyTitle},{children:R(O.title)}),O.artifactId)]})),l("div",e({className:g.titleActions,style:null==ee?void 0:ee.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[!ie.userStory&&l(i,{children:[o("button",e({className:g.iconButton,style:null==ee?void 0:ee.iconButton,onClick:function(e){pe(e.currentTarget)}},{children:o(c,{size:16})})),l(w,e({id:"user-story-share-menu",anchorEl:me,open:!!me,onClose:function(){return pe(null)},style:null==ee?void 0:ee.userStoryShareMenu},{children:[_&&o(U,e({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return ye(!0),Q?[4,Promise.all([Q("pdf"),Q("doc")])]:[2];case 1:return e.sent(),ye(!1),[2]}})})}},{children:l("div",e({ref:Ce,className:g.menuItemContent,style:null==ee?void 0:ee.menuItemContent},{children:[o(d,{size:16,color:null==ee?void 0:ee.menuIconColor}),o("p",e({style:null==ee?void 0:ee.menuLabel},{children:"Download"}))]}))})),o(U,e({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var t;return r(this,function(n){return t=O,P&&(t=e(e({},O),{value:"".concat(B(null==P?void 0:P.value,O.title)," \n").concat(O.value)})),null==G||G(!0,[t],O.artifactId),Ne(),[2]})})}},{children:l("div",e({style:null==ee?void 0:ee.menuItemContent,className:g.menuItemContentPadded},{children:[o(v,{size:16,color:null==ee?void 0:ee.menuIconColor}),o("p",e({style:null==ee?void 0:ee.menuLabel},{children:"Send"}))]}))})),o(U,e({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var e,t,n,o,l;return r(this,function(r){switch(r.label){case 0:e=new C.Converter,t=e.makeHtml(D(O.value)||O.value),n=function(e){var t=(new C.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(D(O.value)||O.value),o=new ClipboardItem({"text/plain":new Blob([n],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,navigator.clipboard.write([o])];case 2:return r.sent(),console.log("Copied User Story"),[3,5];case 3:return l=r.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return Ne(),[7];case 5:return[2]}})})}},{children:l("div",e({style:null==ee?void 0:ee.menuItemContent,className:g.menuItemContentPadded},{children:[o(y,{size:16,color:null==ee?void 0:ee.menuIconColor}),o("p",e({style:null==ee?void 0:ee.menuLabel},{children:"Copy"}))]}))}))]}))]}),ie.userStory&&ce?o(M,{isDisable:Se,type:"outline",children:"Cancel",style:null==ee?void 0:ee.cancelButton,onClick:function(){ae(function(t){return e(e({},t),{userStory:!1})})}}):o(i,{}),ie.userStory&&ce?o(M,{type:"fill",children:Se?l("span",e({className:g.savingSpinner},{children:[o(f,{className:g.spinAnimation}),o("span",{children:"Saving..."})]})):"Save",isDisable:Se,style:null==ee?void 0:ee.saveButton,onClick:function(){return n(void 0,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return Ie(!0),"userStory"==="userStory"&&(W(re),console.log("I am changing RTE editor values",re)),[4,J(Z,se,L)];case 1:return t.sent(),ae(function(t){return e(e({},t),{userStory:!1})}),Ie(!1),[2]}})})}}):!q&&!F&&ce&&o("button",e({className:g.iconButton,style:null==ee?void 0:ee.editButton,onClick:function(){return ae(function(t){return e(e({},t),{userStory:!0})})}},{children:o(m,{color:null==ee?void 0:ee.pencilIconColor,size:16})})),o("button",e({type:"button",onClick:function(e){e.stopPropagation(),be()},style:null==ee?void 0:ee.chevronButton,className:g.chevronButton},{children:o(ce?p:h,{className:g.chevronIcon,color:null==ee?void 0:ee.chevronIconColor})}))]}))]})),o("div",{className:g.divider,style:null==ee?void 0:ee.dividerStyle})]})),ce&&o("div",e({className:g.cardContent,style:null==ee?void 0:ee.cardContentStyle},{children:l("div",e({className:g.contentInner,style:null==ee?void 0:ee.contentInner},{children:[l("div",e({className:g.descriptionSection,style:null==ee?void 0:ee.descriptionSection},{children:[o("div",{className:g.justifyBetween,style:null==ee?void 0:ee.justifyBetween}),ie.userStory?o(k,{minHeight:"100%",height:"100%",type:"string",value:D(O.value)||"",handleUpdateState:function(t,n){var r=x(n);oe(function(t){return e(e({},t),{value:r||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:ie.userStory?"edit":"readOnly"}):o(A,{showUserStoryDiff:F,isParent:""===H,message:D(O.value)||"",artifactId:O.artifactId,customStyles:te})]})),null===(N=re.sub_features)||void 0===N?void 0:N.map(function(n,r){return o(E,{artifactId:L,isUserStoryCurrentlyUpdated:b,artifactTitleId:"".concat(z,"-").concat(String.fromCharCode(65+r)),parentUserStory:O,parentIndex:"".concat(H).concat(H&&".").concat(V),currentIndex:"".concat(r+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(n){return function(n,r){var o=t([],O.sub_features||[],!0);o[n]=r,W(e(e({},O),{sub_features:o}))}(r,n)},enableDownload:!0,isDiffEditReviewMode:q,showUserStoryDiff:F,updateUserStoryArtifact:J,handleDownloadUserStory:Q,handleOpenSendDialog:G},n.artifactId)})]}))}))]}))},L=function(n){var r=n.artifactTitleIDs,l=n.isDiffEditReviewMode,i=n.showUserStoryDiff,a=n.updateUserStoryArtifact,s=n.isUserStoryCurrentlyUpdated,u=n.artifactId,c=n.handleOpenSendDialog,d=n.handleDownloadUserStory,v=n.selectedArtifactId,y=T(),f=y.userStory,m=y.setUserStory,p=y.customStyles,h=null==p?void 0:p.userStoryCardStyles;return o("div",e({className:g.userStoryCardWrapper,style:null==h?void 0:h.userStoryCardWrapper},{children:f.map(function(e,n){return o(E,{isUserStoryCurrentlyUpdated:s,artifactId:u,artifactTitleId:r[n]||"",currentUserStory:e,onUserStoryChange:function(e){m(function(r){return r[n]=e,t([],r,!0)})},parentIndex:"",currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:l,showUserStoryDiff:i,updateUserStoryArtifact:a,handleOpenSendDialog:c,handleDownloadUserStory:d,selectedArtifactId:v},e.artifactId)})}))};export{E as StoryCard,L as UserStoryCardWrapper,E as default,R as replaceLearnedTagsWithInfo};
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -0,0 +1,2 @@
1
+ import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import{useMemo as i,useRef as r,useCallback as o,useEffect as a}from"react";import*as l from"monaco-editor";import c from"./ReadFileCitationContent.module.css.js";import s from"./icons/ExternalLinkIcon.js";"undefined"!=typeof self&&(self.MonacoEnvironment=e(e({},self.MonacoEnvironment),{getWorker:function(){return{postMessage:function(){},terminate:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!0},onmessage:null,onerror:null,onmessageerror:null}}}));var u=!1,d=function(){if(!u&&"undefined"!=typeof document)try{var e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;overflow:hidden;visibility:hidden;pointer-events:none;",document.body.appendChild(e),l.editor.create(e,{value:"",language:"plaintext",automaticLayout:!1,minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden"},overviewRulerLanes:0,lineNumbers:"off",glyphMargin:!1,folding:!1,lineDecorationsWidth:0,lineNumbersMinChars:0}).dispose(),document.body.removeChild(e),u=!0}catch(e){u=!0}};d(),"undefined"!=typeof window&&(window.addEventListener("error",function(e){var n=e.message||"";if(n.includes("Worker")||n.includes("Monaco"))return e.preventDefault(),e.stopImmediatePropagation(),!1},!0),window.addEventListener("unhandledrejection",function(e){var n,t=(null===(n=e.reason)||void 0===n?void 0:n.message)||String(e.reason||"");(t.includes("Worker")||t.includes("Monaco"))&&(e.preventDefault(),e.stopImmediatePropagation())},!0));var h={border:"#3c3c3c",headerBg:"#252526",inactiveText:"#858585",background:"#1e1e1e",foreground:"#cccccc",highlightBg:"rgba(59, 130, 246, 0.15)",highlightGutter:"#3b82f6",hoverBg:"rgba(255, 255, 255, 0.1)"},m={theme:"vs-dark",fontSize:13,fontFamily:"Consolas, 'Courier New', monospace",maxHeight:300,minHeight:80},f={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",py:"python",rb:"ruby",java:"java",cpp:"cpp",c:"c",go:"go",rust:"rust",json:"json",html:"html",css:"css",scss:"scss",md:"markdown",sql:"sql",sh:"shell",bash:"shell",yaml:"yaml",yml:"yaml"},g=function(e){return f[e.toLowerCase()]||e},p=function(t){var i=t.code,o=t.language,s=t.theme,u=t.fontSize,h=t.fontFamily,m=t.height,f=t.highlightRanges,p=t.backgroundColor,v=t.editorWrapperStyle,y=r(null),b=r(null),x=r(!1);return a(function(){x.current=!1,d();var e=setTimeout(function(){var e=y.current;if(e&&!x.current&&!b.current)try{l.editor.setTheme(s);var n=l.editor.create(e,{value:i,language:g(o),readOnly:!0,domReadOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:u,lineHeight:20,fontFamily:h,lineNumbers:"on",folding:!1,lineDecorationsWidth:10,lineNumbersMinChars:4,renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!1,alwaysConsumeMouseWheel:!1},automaticLayout:!0,wordWrap:"off",contextmenu:!1,selectOnLineNumbers:!0,glyphMargin:!1,padding:{top:8,bottom:8},overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,overviewRulerLanes:0,renderWhitespace:"none",guides:{indentation:!1},cursorStyle:"line",cursorBlinking:"solid",fixedOverflowWidgets:!0});if(b.current=n,f.length>0){var t=f.map(function(e){var n=e[0],t=e[1];return{range:new l.Range(n,1,t,1),options:{isWholeLine:!0,className:c.highlightedLine,linesDecorationsClassName:c.highlightedLineDecoration}}});n.createDecorationsCollection(t);var r=f[0];r&&requestAnimationFrame(function(){!x.current&&b.current&&n.revealLineInCenter(r[0])})}}catch(e){}},50);return function(){if(x.current=!0,clearTimeout(e),b.current){try{b.current.dispose()}catch(e){}b.current=null}}},[]),a(function(){try{l.editor.setTheme(s)}catch(e){}},[s]),n("div",e({className:c.editorWrapper,style:e({height:"".concat(m,"px"),backgroundColor:p},v)},{children:n("div",{ref:y,style:{width:"100%",height:"100%"}})}))},v=function(l){var u=l.citation,d=l.customStyles,f=l.customColors,g=l.customIcons,v=l.editorConfig,y=l.fileCallback,b=i(function(){return e(e({},h),f)},[f]),x=i(function(){return e(e({},m),v)},[v]),w=r(null),C=r(!1),N=u.customMetadata.content||"",L=u.customMetadata.highlighted_text,S=i(function(){if(!L)return{};try{var e=L.trim();return e.startsWith("```")&&(e=(e=e.replace(/^```\w*\n?/,"")).replace(/\n?```\s*$/,"")),JSON.parse(e.trim())}catch(e){return console.error("Failed to parse highlight string:",e),{}}},[L]),k=i(function(){for(var e,n=[],t=/```(\w+)?\s*<file_path>([\s\S]*?)<\/file_path>\s*<code>([\s\S]*?)<\/code>\s*```/g;null!==(e=t.exec(N));){var i=e[1]||"javascript",r=e[2].trim(),o=e[3].trim();r&&o&&n.push({filePath:r,code:o,language:i})}return n},[N]),F=o(function(e){return(S[e]||[]).map(function(e){var n=e.split("-").map(Number),t=n[0];return[t,n.length>1?n[1]:t]})},[S]),M=i(function(){for(var e=0;e<k.length;e++){if(F(k[e].filePath).length>0)return e}return-1},[k,F]),W=M>=0,j=o(function(e,n){return F(e).map(function(e){var t=e[0],i=e[1];return t>n?[0,0]:[t,Math.min(i,n)]}).filter(function(e){var n=e[0],t=e[1];return n>0&&t>=n})},[F]),O=o(function(e){var n=20*e.split("\n").length+16+4;return Math.min(Math.max(n,x.minHeight),x.maxHeight)},[x.minHeight,x.maxHeight]);a(function(){if(W&&!C.current&&k.length>0&&(null==y?void 0:y.autoOpenFirstHighlighted)&&(null==y?void 0:y.onOpenFile)){var e=k[M],n=j(e.filePath,e.code.split("\n").length);C.current=!0;var t=setTimeout(function(){y.onOpenFile({filePath:e.filePath,ranges:n.length>0?n:null})},300);return function(){return clearTimeout(t)}}},[W,M,k,j,y]),a(function(){C.current=!1},[N]),a(function(){if(!(M<0)){var e=setTimeout(function(){var e;null===(e=w.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},350);return function(){return clearTimeout(e)}}},[M,L]);var P=o(function(e,n){if(null==y?void 0:y.onOpenFile){var t=j(e,n);y.onOpenFile({filePath:e,ranges:t.length>0?t:null})}},[j,y]),B=!!(null==y?void 0:y.onOpenFile),R=(null==g?void 0:g.readFileCitationIcon)||n(s,{style:{width:"14px",height:"14px"}});return 0===k.length?n("div",e({className:c.emptyState,style:e({color:b.inactiveText},null==d?void 0:d.emptyState)},{children:"No code content available"})):n("div",e({className:c.container,style:null==d?void 0:d.container},{children:k.map(function(i,r){var o,a=F(i.filePath),l=a.length>0,s=r===M,u=O(i.code),h=i.filePath.split("/").pop(),m=i.code.split("\n").length,f=j(i.filePath,m);return t("div",e({ref:s?w:void 0,"data-highlighted":l?"true":void 0,"data-first-highlighted":s?"true":void 0,className:c.blockContainer,style:e({border:"1px solid ".concat(b.border)},null==d?void 0:d.blockContainer)},{children:[t("div",e({className:c.header,style:e({backgroundColor:l?b.highlightBg:b.headerBg,borderBottom:"1px solid ".concat(b.border),color:l?b.highlightGutter:b.foreground},l?null==d?void 0:d.headerHighlighted:null==d?void 0:d.header)},{children:[t("div",e({className:c.headerLeft},{children:[n("span",e({className:c.fileName,title:i.filePath,style:null==d?void 0:d.fileName},{children:h})),B&&n("button",e({className:c.openFileButton,onClick:function(){return P(i.filePath,m)},title:"Open in editor","aria-label":"Open ".concat(h," in editor"),style:null==d?void 0:d.openFileButton},{children:R}))]})),l&&n("span",e({className:c.lineRanges,style:null==d?void 0:d.lineRanges},{children:(o=a,o.map(function(e){var n=e[0],t=e[1];return n===t?"L".concat(n):"L".concat(n,"-").concat(t)}).join(", "))}))]})),n(p,{code:i.code,language:i.language,theme:x.theme,fontSize:x.fontSize,fontFamily:x.fontFamily,height:u,highlightRanges:f,backgroundColor:b.background,editorWrapperStyle:null==d?void 0:d.editorWrapper})]}),r)})}))};export{v as default};
2
+ //# sourceMappingURL=ReadFileCitationContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadFileCitationContent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ var e={container:"ReadFileCitationContent-module_container__Oi3tV",blockContainer:"ReadFileCitationContent-module_blockContainer__yGEX8",header:"ReadFileCitationContent-module_header__39-AD",headerLeft:"ReadFileCitationContent-module_headerLeft__WOyMV",fileName:"ReadFileCitationContent-module_fileName__ql9Qu",openFileButton:"ReadFileCitationContent-module_openFileButton__oqea1",lineRanges:"ReadFileCitationContent-module_lineRanges__RIofb",editorWrapper:"ReadFileCitationContent-module_editorWrapper__ab5Sg",highlightedLine:"ReadFileCitationContent-module_highlightedLine__w6iv-",highlightedLineDecoration:"ReadFileCitationContent-module_highlightedLineDecoration__EykBL",emptyState:"ReadFileCitationContent-module_emptyState__34kcg",loadingEditor:"ReadFileCitationContent-module_loadingEditor__aOHYT"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".ReadFileCitationContent-module_container__Oi3tV{display:flex;flex-direction:column;gap:12px;margin-top:4px}.ReadFileCitationContent-module_blockContainer__yGEX8{border-radius:4px;overflow:hidden}.ReadFileCitationContent-module_header__39-AD{align-items:center;display:flex;font-family:monospace;font-size:12px;gap:8px;justify-content:space-between;padding:6px 12px}.ReadFileCitationContent-module_headerLeft__WOyMV{align-items:center;display:flex;flex:1;gap:8px;min-width:0}.ReadFileCitationContent-module_fileName__ql9Qu{opacity:.9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ReadFileCitationContent-module_openFileButton__oqea1{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_openFileButton__oqea1:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_lineRanges__RIofb{flex-shrink:0;font-size:11px;max-width:300px;opacity:.7;overflow-x:auto;white-space:nowrap}.ReadFileCitationContent-module_editorWrapper__ab5Sg{overflow:hidden}.ReadFileCitationContent-module_highlightedLine__w6iv-{background-color:#3b82f626!important}.ReadFileCitationContent-module_highlightedLineDecoration__EykBL{background-color:#3b82f6;margin-left:0;width:3px!important}.ReadFileCitationContent-module_emptyState__34kcg{font-size:14px;padding:12px;text-align:center}.ReadFileCitationContent-module_loadingEditor__aOHYT{align-items:center;display:flex;font-size:14px;height:64px;justify-content:center}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
2
+ //# sourceMappingURL=ReadFileCitationContent.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadFileCitationContent.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}