@e-llm-studio/citation 0.0.123 → 0.0.124

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 (108) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
  3. package/dist/cjs/features/Bookemon/BookPreview/BookPreview.js +1 -1
  4. package/dist/cjs/features/Bookemon/Bookemon.js +1 -1
  5. package/dist/cjs/features/Bookemon/BookemonContent.js +1 -1
  6. package/dist/cjs/features/ChatCitation/ChatCitationRenderer.js +1 -1
  7. package/dist/cjs/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
  8. package/dist/cjs/features/ChatCitation/components/AssistantChatItem.js +1 -1
  9. package/dist/cjs/features/ChatCitation/components/ChatCitation.js +1 -1
  10. package/dist/cjs/features/ChatCitation/components/InViewNavigation.js +1 -1
  11. package/dist/cjs/features/CodeCitation/_components/CodeCitationPopup.js +1 -1
  12. package/dist/cjs/features/CodeCitation/_components/Spinner.js +1 -1
  13. package/dist/cjs/features/CodeCitation/_components/TooltipComponent.js +1 -1
  14. package/dist/cjs/features/PaginatedTable/PaginatedTable.js +1 -1
  15. package/dist/cjs/features/PdfEditorCitation/PdfEditorCitation.js +1 -1
  16. package/dist/cjs/features/ProjectAccordion/ProjectAccordion.js +1 -1
  17. package/dist/cjs/features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js +1 -1
  18. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/AiReasonMarkdownWrapper.js +1 -1
  19. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationContent.js +1 -1
  20. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationPreview.js +1 -1
  21. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.js +2 -0
  22. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.js.map +1 -0
  23. package/dist/cjs/features/RequirementAiCitations/ImageCitation/ImageCitationContent.js +1 -1
  24. package/dist/cjs/features/RequirementAiCitations/VideoCitation/VideoCitationContent.js +1 -1
  25. package/dist/cjs/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js +1 -1
  26. package/dist/cjs/features/RequirementAiCitations/WebCitation/components/ImagePreviewDialog.js +1 -1
  27. package/dist/cjs/features/RequirementAiCitations/components/CitationAIConfidenceDisplay.js +1 -1
  28. package/dist/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
  29. package/dist/features/Bookemon/BookPreview/BookPreview.js +1 -1
  30. package/dist/features/Bookemon/Bookemon.js +1 -1
  31. package/dist/features/Bookemon/BookemonContent.js +1 -1
  32. package/dist/features/ChatCitation/ChatCitationRenderer.js +1 -1
  33. package/dist/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
  34. package/dist/features/ChatCitation/components/AssistantChatItem.js +1 -1
  35. package/dist/features/ChatCitation/components/ChatCitation.js +1 -1
  36. package/dist/features/ChatCitation/components/InViewNavigation.js +1 -1
  37. package/dist/features/CodeCitation/_components/CodeCitationPopup.js +1 -1
  38. package/dist/features/CodeCitation/_components/Spinner.js +1 -1
  39. package/dist/features/CodeCitation/_components/TooltipComponent.js +1 -1
  40. package/dist/features/PaginatedTable/PaginatedTable.js +1 -1
  41. package/dist/features/PdfEditorCitation/PdfEditorCitation.js +1 -1
  42. package/dist/features/ProjectAccordion/ProjectAccordion.js +1 -1
  43. package/dist/features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js +1 -1
  44. package/dist/features/RequirementAiCitations/AiReasoning/components/AiReasonMarkdownWrapper.js +1 -1
  45. package/dist/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationContent.js +1 -1
  46. package/dist/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationPreview.js +1 -1
  47. package/dist/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.js +2 -0
  48. package/dist/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.js.map +1 -0
  49. package/dist/features/RequirementAiCitations/ImageCitation/ImageCitationContent.js +1 -1
  50. package/dist/features/RequirementAiCitations/VideoCitation/VideoCitationContent.js +1 -1
  51. package/dist/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js +1 -1
  52. package/dist/features/RequirementAiCitations/WebCitation/components/ImagePreviewDialog.js +1 -1
  53. package/dist/features/RequirementAiCitations/components/CitationAIConfidenceDisplay.js +1 -1
  54. package/dist/types/src/AccordianHeadTest.d.ts.map +1 -1
  55. package/dist/types/src/ChatCitationTest.d.ts +6 -1
  56. package/dist/types/src/ChatCitationTest.d.ts.map +1 -1
  57. package/dist/types/src/CommonComponents/CustomDropdown.d.ts.map +1 -1
  58. package/dist/types/src/CommonComponents/NoTableData.d.ts.map +1 -1
  59. package/dist/types/src/CustomStylesProvider.d.ts.map +1 -1
  60. package/dist/types/src/RequirementAICitationTest.d.ts.map +1 -1
  61. package/dist/types/src/features/Bookemon/BookDetailsCard/BookDetailsCard.d.ts.map +1 -1
  62. package/dist/types/src/features/Bookemon/BookElementsCard/BookElementsCard.d.ts.map +1 -1
  63. package/dist/types/src/features/Bookemon/BookOverviewCard/BookOverviewCard.d.ts.map +1 -1
  64. package/dist/types/src/features/Bookemon/BookemonContent.d.ts.map +1 -1
  65. package/dist/types/src/features/ChatCitation/ChatCitationRenderer.d.ts +4 -0
  66. package/dist/types/src/features/ChatCitation/ChatCitationRenderer.d.ts.map +1 -1
  67. package/dist/types/src/features/ChatCitation/InternalChatCitationRenderer.d.ts +1 -1
  68. package/dist/types/src/features/ChatCitation/InternalChatCitationRenderer.d.ts.map +1 -1
  69. package/dist/types/src/features/ChatCitation/components/ChatCitation.d.ts.map +1 -1
  70. package/dist/types/src/features/ChatCitation/constants/icons.d.ts +3 -3
  71. package/dist/types/src/features/ChatCitation/constants/icons.d.ts.map +1 -1
  72. package/dist/types/src/features/ChatCitation/types/citations.types.d.ts +7 -0
  73. package/dist/types/src/features/ChatCitation/types/citations.types.d.ts.map +1 -1
  74. package/dist/types/src/features/CodeCitation/_components/CodeCitationPopup.d.ts.map +1 -1
  75. package/dist/types/src/features/CodeCitation/_components/DescriptionWithToggle.d.ts.map +1 -1
  76. package/dist/types/src/features/CodeCitation/_components/HighlightedCodeDetails.d.ts.map +1 -1
  77. package/dist/types/src/features/DataSelector/components/DataSelectionOptionsScreen.d.ts.map +1 -1
  78. package/dist/types/src/features/DataSelector/components/RlefDataTabsComponent.d.ts.map +1 -1
  79. package/dist/types/src/features/DataSelector/tables/ShowSelectedDataTable.d.ts.map +1 -1
  80. package/dist/types/src/features/DatagestMon/DynamicDataPreviiewer/DynamicDataPreviewer.d.ts.map +1 -1
  81. package/dist/types/src/features/RequirementAiCitations/AiReasoning/AiReasoningCitation.d.ts +7 -1
  82. package/dist/types/src/features/RequirementAiCitations/AiReasoning/AiReasoningCitation.d.ts.map +1 -1
  83. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasonMarkdownWrapper.d.ts +11 -2
  84. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasonMarkdownWrapper.d.ts.map +1 -1
  85. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationContent.d.ts +7 -1
  86. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationContent.d.ts.map +1 -1
  87. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationPreview.d.ts +7 -1
  88. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationPreview.d.ts.map +1 -1
  89. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.d.ts +7 -0
  90. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.d.ts.map +1 -0
  91. package/dist/types/src/features/RequirementAiCitations/AiReasoning/types/interface.d.ts +11 -3
  92. package/dist/types/src/features/RequirementAiCitations/AiReasoning/types/interface.d.ts.map +1 -1
  93. package/dist/types/src/features/UploadData/Components/SelectDataFromGoogleDrive/SelectDataFromGoogleDriveButton.d.ts.map +1 -1
  94. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/ProjectTaskSelect.d.ts.map +1 -1
  95. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/Tooltip.d.ts.map +1 -1
  96. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/ConfidenceScoreColumnMenu.d.ts.map +1 -1
  97. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/LabelColumnMenu.d.ts.map +1 -1
  98. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/TableColumnResetFilterButton.d.ts +5 -16
  99. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/TableColumnResetFilterButton.d.ts.map +1 -1
  100. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/TagColumnMenu.d.ts.map +1 -1
  101. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dropdown-with-radio.d.ts.map +1 -1
  102. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/input-label-with-info.d.ts.map +1 -1
  103. package/dist/types/src/features/UploadData/Components/SelectDataFromSavedDataSet/SelectDataFromSavedDataSetButton.d.ts.map +1 -1
  104. package/dist/types/src/features/UploadData/main.d.ts.map +1 -1
  105. package/dist/types/src/theme.d.ts +1 -1
  106. package/dist/types/src/theme.d.ts.map +1 -1
  107. package/dist/types/src/utils/CustomSkeleton.d.ts.map +1 -1
  108. package/package.json +15 -7
package/README.md CHANGED
@@ -623,8 +623,8 @@ import { AiReasoningCitation } from '@e-llm-studio/citation/AiReasoningCitation'
623
623
  aiReason={{
624
624
  id: "1",
625
625
  relevance_score: 95,
626
- reason: "The <a href='document_citation$1'>ADK.pdf</a> mentions the Agent Card...",
627
- gap: "Registry mechanism is undefined"
626
+ reason: ["The <a href='document_citation$1'>ADK.pdf</a> mentions the Agent Card..."],
627
+ gap: ["Registry mechanism is undefined"]
628
628
  }}
629
629
  citationList={{
630
630
  file_citations: [{
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@material-ui/lab/Pagination"),a=require("@material-ui/lab/Skeleton"),s=require("react"),i=require("react-markdown"),r=require("../utils/highlight.js"),o=require("../../../utils/sanitizeHtml.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(n),d=l(a),c=l(i),g={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}};exports.default=function(n){n.data;var a=n.updateQuotesToHighLight,i=n.handleFetchManuscriptElements,l=n.BookIsbn,x=n.title,p=n.highlightTerms,h=n.onHighlightMatch,f=s.useRef(!0);s.useEffect(function(){return function(){f.current=!1}},[]);var _=s.useState([]),y=_[0],v=_[1],m=s.useState(1),b=m[0],j=m[1],S=s.useState(!1),T=S[0],C=S[1],w=s.useState(!0),k=w[0],L=w[1],q=s.useState(0),B=q[0],M=q[1],D=s.useState([]),F=D[0],E=D[1],H=s.useState(1),z=H[0],I=H[1],P=s.useState(!1),W=P[0],R=P[1],N=s.useState(!0),A=N[0],G=N[1],K=s.useState(0),Y=K[0],O=K[1],Q=s.useState([]),J=Q[0],U=Q[1],V=s.useState(1),X=V[0],Z=V[1],$=s.useState(!1),ee=$[0],te=$[1],ne=s.useState(!0),ae=ne[0],se=ne[1],ie=s.useState(0),re=ie[0],oe=ie[1],le=s.useState({list:"",index:-1,page:1}),ue=le[0],de=le[1],ce=s.useRef(!1);s.useEffect(function(){var t,n,a;p&&0!==p.length&&(ce.current||e.__spreadArray(e.__spreadArray(e.__spreadArray([],null!==(t=null==y?void 0:y.map(function(e){return e.text}))&&void 0!==t?t:[],!0),null!==(n=null==J?void 0:J.map(function(e){return e.name}))&&void 0!==n?n:[],!0),null!==(a=null==F?void 0:F.flatMap(function(e){return[e.name,e.description]}))&&void 0!==a?a:[],!0).some(function(e){return!!e&&p.some(function(t){return e.toLowerCase().includes(t.toLowerCase())})})&&(null==h||h(!0),ce.current=!0))},[p]),s.useEffect(function(){ce.current=!1},[p]);var ge=function(t){var n=t.endpoint,a=t.page,s=t.isbn,r=t.setData,o=t.setLoading,l=t.setHasMore,u=t.setTotalPage,d=t.title;return e.__awaiter(void 0,void 0,void 0,function(){var t,c,g,x;return e.__generator(this,function(e){switch(e.label){case 0:o(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,i({endpoint:n,page:a,pageSize:10,isbn:s,title:d})];case 2:return t=e.sent(),f.current?(r((null==t?void 0:t.data)||[]),u((null===(c=null==t?void 0:t.pagination)||void 0===c?void 0:c.totalPages)||0),l(!(null===(g=null==t?void 0:t.pagination)||void 0===g?void 0:g.hasNext)&&!(null===(x=null==t?void 0:t.pagination)||void 0===x?void 0:x.hasPrevious)),[3,4]):[2];case 3:return f.current&&o(!1),[7];case 4:return[2]}})})};return s.useEffect(function(){ge({endpoint:"notable-quotes",page:b,isbn:l,setData:v,setLoading:C,setHasMore:L,setTotalPage:M,title:x})},[b]),s.useEffect(function(){ge({endpoint:"notable-characters",page:z,isbn:l,setData:E,setLoading:R,setHasMore:G,setTotalPage:O,title:x})},[z]),s.useEffect(function(){ge({endpoint:"geo-locations",page:X,isbn:l,setData:U,setLoading:te,setHasMore:se,setTotalPage:oe,title:x})},[X]),t.jsxs("div",{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:g.sectionTitle},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:g.quotesPadding},{children:[T?t.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({style:g.quoteCard},{children:[t.jsx(d.default,{variant:"text",width:"60%",height:28}),t.jsx(d.default,{variant:"text",width:"40%",height:20}),t.jsx(d.default,{variant:"text",width:"25%",height:20}),t.jsx(d.default,{variant:"text",width:"30%",height:20})]}),n)})})):0===y.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:g.retryButton,onClick:function(){return ge({endpoint:"notable-quotes",page:b,isbn:l,setData:v,setLoading:C,setHasMore:L,setTotalPage:M,title:x})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:y.map(function(n,s){var i="notable"===ue.list&&ue.page===b&&ue.index===s;return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g.quoteCard),{borderColor:i?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),de({list:"notable",page:b,index:s}),(null===(i=null==n?void 0:n.chunkIds)||void 0===i?void 0:i.length)>0?[4,a(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}})})}},{children:[p&&p.length>0?t.jsx("p",{style:g.quoteText,dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(null==n?void 0:n.text,p))}}):t.jsx("p",e.__assign({style:g.quoteText},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:g.quoteMeta},{children:[n.chapter," ",t.jsx("br",{})," ",n.page]})),t.jsxs("p",e.__assign({style:g.quoteAuthor},{children:["— ",null==n?void 0:n.author]}))]}),s)})}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!k&&t.jsx(u.default,{disabled:T,count:B,page:b,onChange:function(e,t){return j(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:g.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:g.sectionTitle},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g.quotesPadding),{marginBottom:"8px"})},{children:[ee?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return t.jsx(d.default,{variant:"rect",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===J.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",t.jsx("button",e.__assign({style:g.retryButton,onClick:function(){return ge({endpoint:"geo-locations",page:X,isbn:l,setData:U,setLoading:te,setHasMore:se,setTotalPage:oe,title:x})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:J.map(function(n,s){var i="geo_location"===ue.list&&ue.page===X&&ue.index===s;return t.jsxs("span",e.__assign({style:g.geoLocationFlex},{children:[t.jsx("span",e.__assign({style:e.__assign(e.__assign({},g.geoText),{fontWeight:i?"700":"",textDecoration:i?"underline":""}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),de({list:"geo_location",page:X,index:s}),(null===(i=null==n?void 0:n.chunkIds)||void 0===i?void 0:i.length)>0?[4,a(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:p&&p.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(null==n?void 0:n.name,p))}}):null==n?void 0:n.name})),s<J.length-1&&t.jsx("span",{style:g.geoDivider})]}),s)})}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ae&&t.jsx(u.default,{disabled:ee,count:re,page:X,onChange:function(e,t){return Z(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:g.charactersContainer},{children:[t.jsx("p",e.__assign({style:g.sectionTitle},{children:"Key Characters"})),W?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g.characterCard),{flexBasis:"40%"})},{children:[t.jsx(d.default,{variant:"circle",style:e.__assign(e.__assign({},g.avatar),{flexShrink:0})}),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t.jsx(d.default,{variant:"text",style:{flex:"1",flexShrink:0}}),t.jsx(d.default,{variant:"text",style:{flex:"1"}}),t.jsx(d.default,{variant:"text",style:{flex:"1"}}),t.jsx(d.default,{variant:"text",style:{flex:"1"}})]}))]}),n)})})):0===F.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:g.retryButton,onClick:function(){return ge({endpoint:"notable-characters",page:z,isbn:l,setData:E,setLoading:R,setHasMore:G,setTotalPage:O,title:x})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({style:g.charactersGrid},{children:F.map(function(n,s){var i=e.__assign(e.__assign({},g.avatar),{backgroundColor:n.bg,color:n.color}),l="key_character"===ue.list&&ue.page===z&&ue.index===s;return t.jsxs("div",e.__assign({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},style:e.__assign(e.__assign({},g.characterCard),{borderColor:l?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,i;return e.__generator(this,function(e){switch(e.label){case 0:de({list:"key_character",page:z,index:s}),e.label=1;case 1:return e.trys.push([1,4,,5]),(null===(i=null==n?void 0:n.chunkIds)||void 0===i?void 0:i.length)>0?[4,a(n.name,"Key Characters",n.chunkIds,0)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return t=e.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}})})}},{children:[t.jsx("div",e.__assign({style:i},{children:n.initials})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[t.jsx("p",e.__assign({style:e.__assign(e.__assign({},g.charName),{margin:0})},{children:p&&p.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(n.name,p))}}):n.name})),t.jsx("p",e.__assign({style:e.__assign(e.__assign({},g.charDesc),{margin:0,marginTop:"4px"})},{children:p&&p.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(null==n?void 0:n.description,p))}}):t.jsx(c.default,e.__assign({components:{p:function(n){n.node;var a=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:"0"}},a))}}},{children:null==n?void 0:n.description}))}))]}))]}),s)})}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!A&&t.jsx(u.default,{count:Y,disabled:W,page:z,onChange:function(e,t){return I(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@mui/material/Pagination"),a=require("@mui/material/Skeleton"),s=require("react"),i=require("react-markdown"),r=require("../utils/highlight.js"),o=require("../../../utils/sanitizeHtml.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(n),d=l(a),c=l(i),g={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}};exports.default=function(n){n.data;var a=n.updateQuotesToHighLight,i=n.handleFetchManuscriptElements,l=n.BookIsbn,x=n.title,p=n.highlightTerms,h=n.onHighlightMatch,f=s.useRef(!0);s.useEffect(function(){return function(){f.current=!1}},[]);var _=s.useState([]),y=_[0],v=_[1],m=s.useState(1),b=m[0],j=m[1],S=s.useState(!1),T=S[0],C=S[1],w=s.useState(!0),k=w[0],L=w[1],q=s.useState(0),B=q[0],M=q[1],D=s.useState([]),F=D[0],E=D[1],H=s.useState(1),z=H[0],I=H[1],P=s.useState(!1),W=P[0],R=P[1],N=s.useState(!0),A=N[0],G=N[1],K=s.useState(0),Y=K[0],O=K[1],Q=s.useState([]),J=Q[0],U=Q[1],V=s.useState(1),X=V[0],Z=V[1],$=s.useState(!1),ee=$[0],te=$[1],ne=s.useState(!0),ae=ne[0],se=ne[1],ie=s.useState(0),re=ie[0],oe=ie[1],le=s.useState({list:"",index:-1,page:1}),ue=le[0],de=le[1],ce=s.useRef(!1);s.useEffect(function(){var t,n,a;p&&0!==p.length&&(ce.current||e.__spreadArray(e.__spreadArray(e.__spreadArray([],null!==(t=null==y?void 0:y.map(function(e){return e.text}))&&void 0!==t?t:[],!0),null!==(n=null==J?void 0:J.map(function(e){return e.name}))&&void 0!==n?n:[],!0),null!==(a=null==F?void 0:F.flatMap(function(e){return[e.name,e.description]}))&&void 0!==a?a:[],!0).some(function(e){return!!e&&p.some(function(t){return e.toLowerCase().includes(t.toLowerCase())})})&&(null==h||h(!0),ce.current=!0))},[p]),s.useEffect(function(){ce.current=!1},[p]);var ge=function(t){var n=t.endpoint,a=t.page,s=t.isbn,r=t.setData,o=t.setLoading,l=t.setHasMore,u=t.setTotalPage,d=t.title;return e.__awaiter(void 0,void 0,void 0,function(){var t,c,g,x;return e.__generator(this,function(e){switch(e.label){case 0:o(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,i({endpoint:n,page:a,pageSize:10,isbn:s,title:d})];case 2:return t=e.sent(),f.current?(r((null==t?void 0:t.data)||[]),u((null===(c=null==t?void 0:t.pagination)||void 0===c?void 0:c.totalPages)||0),l(!(null===(g=null==t?void 0:t.pagination)||void 0===g?void 0:g.hasNext)&&!(null===(x=null==t?void 0:t.pagination)||void 0===x?void 0:x.hasPrevious)),[3,4]):[2];case 3:return f.current&&o(!1),[7];case 4:return[2]}})})};return s.useEffect(function(){ge({endpoint:"notable-quotes",page:b,isbn:l,setData:v,setLoading:C,setHasMore:L,setTotalPage:M,title:x})},[b]),s.useEffect(function(){ge({endpoint:"notable-characters",page:z,isbn:l,setData:E,setLoading:R,setHasMore:G,setTotalPage:O,title:x})},[z]),s.useEffect(function(){ge({endpoint:"geo-locations",page:X,isbn:l,setData:U,setLoading:te,setHasMore:se,setTotalPage:oe,title:x})},[X]),t.jsxs("div",{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:g.sectionTitle},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:g.quotesPadding},{children:[T?t.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({style:g.quoteCard},{children:[t.jsx(d.default,{variant:"text",width:"60%",height:28}),t.jsx(d.default,{variant:"text",width:"40%",height:20}),t.jsx(d.default,{variant:"text",width:"25%",height:20}),t.jsx(d.default,{variant:"text",width:"30%",height:20})]}),n)})})):0===y.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:g.retryButton,onClick:function(){return ge({endpoint:"notable-quotes",page:b,isbn:l,setData:v,setLoading:C,setHasMore:L,setTotalPage:M,title:x})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:y.map(function(n,s){var i="notable"===ue.list&&ue.page===b&&ue.index===s;return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g.quoteCard),{borderColor:i?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),de({list:"notable",page:b,index:s}),(null===(i=null==n?void 0:n.chunkIds)||void 0===i?void 0:i.length)>0?[4,a(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}})})}},{children:[p&&p.length>0?t.jsx("p",{style:g.quoteText,dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(null==n?void 0:n.text,p))}}):t.jsx("p",e.__assign({style:g.quoteText},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:g.quoteMeta},{children:[n.chapter," ",t.jsx("br",{})," ",n.page]})),t.jsxs("p",e.__assign({style:g.quoteAuthor},{children:["— ",null==n?void 0:n.author]}))]}),s)})}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!k&&t.jsx(u.default,{disabled:T,count:B,page:b,onChange:function(e,t){return j(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:g.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:g.sectionTitle},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g.quotesPadding),{marginBottom:"8px"})},{children:[ee?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return t.jsx(d.default,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===J.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",t.jsx("button",e.__assign({style:g.retryButton,onClick:function(){return ge({endpoint:"geo-locations",page:X,isbn:l,setData:U,setLoading:te,setHasMore:se,setTotalPage:oe,title:x})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:J.map(function(n,s){var i="geo_location"===ue.list&&ue.page===X&&ue.index===s;return t.jsxs("span",e.__assign({style:g.geoLocationFlex},{children:[t.jsx("span",e.__assign({style:e.__assign(e.__assign({},g.geoText),{fontWeight:i?"700":"",textDecoration:i?"underline":""}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),de({list:"geo_location",page:X,index:s}),(null===(i=null==n?void 0:n.chunkIds)||void 0===i?void 0:i.length)>0?[4,a(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:p&&p.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(null==n?void 0:n.name,p))}}):null==n?void 0:n.name})),s<J.length-1&&t.jsx("span",{style:g.geoDivider})]}),s)})}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ae&&t.jsx(u.default,{disabled:ee,count:re,page:X,onChange:function(e,t){return Z(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:g.charactersContainer},{children:[t.jsx("p",e.__assign({style:g.sectionTitle},{children:"Key Characters"})),W?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g.characterCard),{flexBasis:"40%"})},{children:[t.jsx(d.default,{variant:"circular",style:e.__assign(e.__assign({},g.avatar),{flexShrink:0})}),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t.jsx(d.default,{variant:"text",style:{flex:"1",flexShrink:0}}),t.jsx(d.default,{variant:"text",style:{flex:"1"}}),t.jsx(d.default,{variant:"text",style:{flex:"1"}}),t.jsx(d.default,{variant:"text",style:{flex:"1"}})]}))]}),n)})})):0===F.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:g.retryButton,onClick:function(){return ge({endpoint:"notable-characters",page:z,isbn:l,setData:E,setLoading:R,setHasMore:G,setTotalPage:O,title:x})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({style:g.charactersGrid},{children:F.map(function(n,s){var i=e.__assign(e.__assign({},g.avatar),{backgroundColor:n.bg,color:n.color}),l="key_character"===ue.list&&ue.page===z&&ue.index===s;return t.jsxs("div",e.__assign({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},style:e.__assign(e.__assign({},g.characterCard),{borderColor:l?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,i;return e.__generator(this,function(e){switch(e.label){case 0:de({list:"key_character",page:z,index:s}),e.label=1;case 1:return e.trys.push([1,4,,5]),(null===(i=null==n?void 0:n.chunkIds)||void 0===i?void 0:i.length)>0?[4,a(n.name,"Key Characters",n.chunkIds,0)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return t=e.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}})})}},{children:[t.jsx("div",e.__assign({style:i},{children:n.initials})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[t.jsx("p",e.__assign({style:e.__assign(e.__assign({},g.charName),{margin:0})},{children:p&&p.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(n.name,p))}}):n.name})),t.jsx("p",e.__assign({style:e.__assign(e.__assign({},g.charDesc),{margin:0,marginTop:"4px"})},{children:p&&p.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:o.sanitizeHtml(r.highlightTermsFunc(null==n?void 0:n.description,p))}}):t.jsx(c.default,e.__assign({components:{p:function(n){n.node;var a=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:"0"}},a))}}},{children:null==n?void 0:n.description}))}))]}))]}),s)})}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!A&&t.jsx(u.default,{count:Y,disabled:W,page:z,onChange:function(e,t){return I(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};
2
2
  //# sourceMappingURL=BookElementsCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("@material-ui/icons/Close"),o=require("@material-ui/icons/ArrowBack"),r=require("../../BookCitation/BookCitation.js"),l=require("../Bookemon.js"),a=require("@material-ui/core/Switch"),s=require("@material-ui/core/Tooltip");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(n),g=d(o),u=d(a),h=d(s);exports.default=function(n){var o=n.bookOverView,a=n.bookCoverImage,s=n.onClose,d=n.customStyle,p=n.quotesToHighLightData,x=n.updateQuotesToHighLight,f=n.citationLoad,y=n.clickableElementCategory,v=void 0===y?"":y,_=n.comingSoonData,m=n.isNonHighlightedBlur,b=void 0!==m&&m,k=n.isBlurToggleVisible,C=void 0!==k&&k,j=n.noHtmlContent,w=void 0!==j&&j,S=n.isBookemon,B=void 0===S||S,I=i.useState(!1),T=I[0],W=I[1],L=i.useState(!0),P=L[0],q=L[1],H=!!p.content,F={header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"},headerLeft:{display:"flex",alignItems:"center",gap:"8px"},closeButton:{padding:"4px",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},flexCenter:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},coverContainer:{width:"100%",maxWidth:"300px",borderRadius:"12px",padding:"4px",background:"linear-gradient(135deg, #34D399, #3B82F6, #10B981)",position:"relative",overflow:"hidden",boxShadow:"0 10px 25px rgba(0,0,0,0.3)",marginBottom:"24px"},bookCoverStyle:{width:"100%",height:"auto",objectFit:"contain",borderRadius:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)"},loadingStyle:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},rightPanel:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},clickableElementCategory:{fontSize:"20px",fontWeight:600},previewWrapper:{flex:1,width:"80%",margin:"0 auto",display:"flex",flexDirection:"column",overflow:"hidden",justifyContent:"flex-start",alignItems:"center"},coverImagePreview:{display:"flex",justifyContent:"center",alignItems:"center",aspectRatio:"7 / 10",background:"",padding:0},toggleBlurContainer:{display:"flex",alignItems:"center",gap:"20px"},bookCoverPlaceholder:{width:"100%",height:"calc(100% - 8px)",background:"linear-gradient(to bottom, #22c55e, #14532d)",borderRadius:"4px",padding:"4px",color:"white",fontSize:"10px",display:"flex",justifyContent:"center",alignItems:"center"},bookCoverInner:{border:"1px solid white",padding:"4px",width:"calc(100% - 26px)",height:"calc(100% - 26px)",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",justifyContent:"space-around"},bookTitle:{fontWeight:800,fontSize:"1.5rem",textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1.2,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",padding:"0 8px"},bookAuthor:{fontSize:"1rem",fontWeight:500,opacity:.9,marginTop:"8px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"}};return i.useEffect(function(){q(!0),console.log(f,"citationLoad")},[f]),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},F.rightPanel),(null==d?void 0:d.rightPanel)||{})},{children:[t.jsxs("div",e.__assign({style:F.header},{children:[t.jsxs("div",e.__assign({style:F.headerLeft},{children:[(H||w)&&t.jsx("button",e.__assign({style:F.closeButton,onClick:function(){return x("","Book Preview")},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F3F4F6"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="transparent"}},{children:t.jsx(g.default,{})})),t.jsx("h2",e.__assign({style:F.clickableElementCategory},{children:v}))]})),t.jsxs("div",e.__assign({style:F.toggleBlurContainer},{children:[H&&C&&t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"2px"}},{children:[t.jsx(u.default,{checked:P,onChange:function(e){q(e.target.checked),console.log(e.target.checked,"event.target.checked")},color:"primary",size:"small"}),t.jsxs("span",e.__assign({style:{fontSize:"0.75rem",display:"flex",alignItems:"center",gap:"4px"}},{children:["Blur",t.jsx(h.default,e.__assign({title:"Blur Text is enabled by default. Non-highlighted parts of the text will appear blurred to help you focus on the highlighted content. You can turn this off if you want to see all text clearly."},{children:t.jsx("span",e.__assign({style:{display:"inline-flex",justifyContent:"center",alignItems:"center",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"#485468",color:"#fff",fontSize:"10px",fontWeight:"bold",cursor:"pointer",lineHeight:"14px",userSelect:"none"}},{children:"i"}))}))]}))]})),t.jsx("button",e.__assign({style:F.closeButton,onClick:function(){s(),x("","Book Preview")},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F3F4F6"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="transparent"}},{children:t.jsx(c.default,{})}))]}))]})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},F.previewWrapper),null==d?void 0:d.previewWrapper)},{children:H?t.jsx(r.default,{citationNumber:1,defaultState:!0,partialMatch:!0,fixedWidth:!1,citationTitle:"Sample Citation",title:"Sample Title",paragraphs:[null==p?void 0:p.content],textToHighlight:[null==p?void 0:p.textToHighLight],externalLinkComponent:"",bookCoverImage:a,customStyle:null==d?void 0:d.citationCustomStyle,isNonHighlightedBlur:b,isBookemon:B,toggleBlur:P}):f||w?t.jsxs("div",e.__assign({style:F.loadingStyle},{children:[t.jsx("div",e.__assign({style:l.comingSoonStyles.iconWrapper},{children:(null==_?void 0:_.icon)||l.defaultIcon})),w?t.jsxs("p",e.__assign({style:l.comingSoonStyles.text},{children:["No data found matching the selected ",v.toLowerCase()]})):t.jsxs("p",e.__assign({style:l.comingSoonStyles.text},{children:["fetching ",v.toLowerCase(),"...."]}))]})):t.jsx("div",e.__assign({style:F.flexCenter},{children:t.jsx("div",e.__assign({style:e.__assign(e.__assign({},F.coverContainer),T||!a?e.__assign(e.__assign({},F.coverImagePreview),null==d?void 0:d.coverImagePreview):{})},{children:a&&!T?t.jsx("img",{onError:function(){return W(!0)},style:F.bookCoverStyle,src:a,alt:"Book Cover Image"}):t.jsx("div",e.__assign({style:F.bookCoverPlaceholder},{children:t.jsxs("div",e.__assign({style:F.bookCoverInner},{children:[t.jsx("div",e.__assign({style:F.bookTitle},{children:(null==o?void 0:o.title)||"Unknown Title"})),t.jsx("div",e.__assign({style:F.bookAuthor},{children:(null==o?void 0:o.author)||"Unknown Author"}))]}))}))}))}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("@mui/icons-material/Close"),o=require("@mui/icons-material/ArrowBack"),r=require("../../BookCitation/BookCitation.js"),l=require("../Bookemon.js"),a=require("@mui/material/Switch"),s=require("@mui/material/Tooltip");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(n),g=d(o),u=d(a),h=d(s);exports.default=function(n){var o=n.bookOverView,a=n.bookCoverImage,s=n.onClose,d=n.customStyle,p=n.quotesToHighLightData,x=n.updateQuotesToHighLight,f=n.citationLoad,y=n.clickableElementCategory,v=void 0===y?"":y,m=n.comingSoonData,_=n.isNonHighlightedBlur,b=void 0!==_&&_,k=n.isBlurToggleVisible,C=void 0!==k&&k,j=n.noHtmlContent,w=void 0!==j&&j,S=n.isBookemon,B=void 0===S||S,I=i.useState(!1),T=I[0],W=I[1],L=i.useState(!0),P=L[0],q=L[1],H=!!p.content,F={header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"},headerLeft:{display:"flex",alignItems:"center",gap:"8px"},closeButton:{padding:"4px",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},flexCenter:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},coverContainer:{width:"100%",maxWidth:"300px",borderRadius:"12px",padding:"4px",background:"linear-gradient(135deg, #34D399, #3B82F6, #10B981)",position:"relative",overflow:"hidden",boxShadow:"0 10px 25px rgba(0,0,0,0.3)",marginBottom:"24px"},bookCoverStyle:{width:"100%",height:"auto",objectFit:"contain",borderRadius:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)"},loadingStyle:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},rightPanel:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},clickableElementCategory:{fontSize:"20px",fontWeight:600},previewWrapper:{flex:1,width:"80%",margin:"0 auto",display:"flex",flexDirection:"column",overflow:"hidden",justifyContent:"flex-start",alignItems:"center"},coverImagePreview:{display:"flex",justifyContent:"center",alignItems:"center",aspectRatio:"7 / 10",background:"",padding:0},toggleBlurContainer:{display:"flex",alignItems:"center",gap:"20px"},bookCoverPlaceholder:{width:"100%",height:"calc(100% - 8px)",background:"linear-gradient(to bottom, #22c55e, #14532d)",borderRadius:"4px",padding:"4px",color:"white",fontSize:"10px",display:"flex",justifyContent:"center",alignItems:"center"},bookCoverInner:{border:"1px solid white",padding:"4px",width:"calc(100% - 26px)",height:"calc(100% - 26px)",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",justifyContent:"space-around"},bookTitle:{fontWeight:800,fontSize:"1.5rem",textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1.2,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",padding:"0 8px"},bookAuthor:{fontSize:"1rem",fontWeight:500,opacity:.9,marginTop:"8px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"}};return i.useEffect(function(){q(!0),console.log(f,"citationLoad")},[f]),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},F.rightPanel),(null==d?void 0:d.rightPanel)||{})},{children:[t.jsxs("div",e.__assign({style:F.header},{children:[t.jsxs("div",e.__assign({style:F.headerLeft},{children:[(H||w)&&t.jsx("button",e.__assign({style:F.closeButton,onClick:function(){return x("","Book Preview")},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F3F4F6"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="transparent"}},{children:t.jsx(g.default,{})})),t.jsx("h2",e.__assign({style:F.clickableElementCategory},{children:v}))]})),t.jsxs("div",e.__assign({style:F.toggleBlurContainer},{children:[H&&C&&t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"2px"}},{children:[t.jsx(u.default,{checked:P,onChange:function(e){q(e.target.checked),console.log(e.target.checked,"event.target.checked")},color:"primary",size:"small"}),t.jsxs("span",e.__assign({style:{fontSize:"0.75rem",display:"flex",alignItems:"center",gap:"4px"}},{children:["Blur",t.jsx(h.default,e.__assign({title:"Blur Text is enabled by default. Non-highlighted parts of the text will appear blurred to help you focus on the highlighted content. You can turn this off if you want to see all text clearly."},{children:t.jsx("span",e.__assign({style:{display:"inline-flex",justifyContent:"center",alignItems:"center",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"#485468",color:"#fff",fontSize:"10px",fontWeight:"bold",cursor:"pointer",lineHeight:"14px",userSelect:"none"}},{children:"i"}))}))]}))]})),t.jsx("button",e.__assign({style:F.closeButton,onClick:function(){s(),x("","Book Preview")},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F3F4F6"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="transparent"}},{children:t.jsx(c.default,{})}))]}))]})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},F.previewWrapper),null==d?void 0:d.previewWrapper)},{children:H?t.jsx(r.default,{citationNumber:1,defaultState:!0,partialMatch:!0,fixedWidth:!1,citationTitle:"Sample Citation",title:"Sample Title",paragraphs:[null==p?void 0:p.content],textToHighlight:[null==p?void 0:p.textToHighLight],externalLinkComponent:"",bookCoverImage:a,customStyle:null==d?void 0:d.citationCustomStyle,isNonHighlightedBlur:b,isBookemon:B,toggleBlur:P}):f||w?t.jsxs("div",e.__assign({style:F.loadingStyle},{children:[t.jsx("div",e.__assign({style:l.comingSoonStyles.iconWrapper},{children:(null==m?void 0:m.icon)||l.defaultIcon})),w?t.jsxs("p",e.__assign({style:l.comingSoonStyles.text},{children:["No data found matching the selected ",v.toLowerCase()]})):t.jsxs("p",e.__assign({style:l.comingSoonStyles.text},{children:["fetching ",v.toLowerCase(),"...."]}))]})):t.jsx("div",e.__assign({style:F.flexCenter},{children:t.jsx("div",e.__assign({style:e.__assign(e.__assign({},F.coverContainer),T||!a?e.__assign(e.__assign({},F.coverImagePreview),null==d?void 0:d.coverImagePreview):{})},{children:a&&!T?t.jsx("img",{onError:function(){return W(!0)},style:F.bookCoverStyle,src:a,alt:"Book Cover Image"}):t.jsx("div",e.__assign({style:F.bookCoverPlaceholder},{children:t.jsxs("div",e.__assign({style:F.bookCoverInner},{children:[t.jsx("div",e.__assign({style:F.bookTitle},{children:(null==o?void 0:o.title)||"Unknown Title"})),t.jsx("div",e.__assign({style:F.bookAuthor},{children:(null==o?void 0:o.author)||"Unknown Author"}))]}))}))}))}))}))]}))};
2
2
  //# sourceMappingURL=BookPreview.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),o=require("react/jsx-runtime"),i=require("@material-ui/core/Dialog"),t=require("@material-ui/core/DialogContent"),n=require("./BookemonContent.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(i),l=r(t),a={maxWidth:"none",fontFamily:"Inter, sans-serif"},g={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},h=o.jsx("svg",e.__assign({style:g.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}));exports.comingSoonStyles=g,exports.default=function(i){var t=i.open,r=i.onClose,g=i.isDialog,d=void 0===g||g,u=i.isBookPreview,c=void 0===u||u,m=i.isNonHighlightedBlur,p=i.isBookemon,x=i.getHighlightContent,f=i.handleFetchManuscriptElements,B=i.data,C=i.showComingSoon,v=void 0!==C&&C,y=i.comingSoonData,k=void 0===y?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:h}:y,S=i.customStyle,j=void 0===S?{}:S,w=i.isBlurToggleVisible,_=void 0!==w&&w,F=i.highlightTerms,b=null!=t&&t,D=null!=r?r:function(){};return d?o.jsx(s.default,e.__assign({open:b,fullWidth:!0,PaperProps:{style:e.__assign(e.__assign({},a),null==j?void 0:j.dialogDimension)}},{children:o.jsx(l.default,e.__assign({style:{padding:0}},{children:o.jsx(n.BookemonContent,{data:B,customStyle:j,comingSoonData:k,showComingSoon:v,isNonHighlightedBlur:m,isBlurToggleVisible:_,isBookemon:p,highlightTerms:F,getHighlightContent:x,handleFetchManuscriptElements:f,isBookPreview:c,isDialog:d,onClose:D})}))})):o.jsx("div",e.__assign({style:{width:"100%",height:"100%"}},{children:o.jsx(n.BookemonContent,{data:B,customStyle:j,comingSoonData:k,showComingSoon:v,isNonHighlightedBlur:m,isBlurToggleVisible:_,isBookemon:p,highlightTerms:F,getHighlightContent:x,handleFetchManuscriptElements:f,isBookPreview:c,isDialog:d,onClose:D})}))},exports.defaultIcon=h;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),o=require("react/jsx-runtime"),i=require("@mui/material/Dialog"),t=require("@mui/material/DialogContent"),n=require("./BookemonContent.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(i),l=r(t),a={maxWidth:"none",fontFamily:"Inter, sans-serif"},g={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},h=o.jsx("svg",e.__assign({style:g.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}));exports.comingSoonStyles=g,exports.default=function(i){var t=i.open,r=i.onClose,g=i.isDialog,d=void 0===g||g,u=i.isBookPreview,c=void 0===u||u,m=i.isNonHighlightedBlur,p=i.isBookemon,x=i.getHighlightContent,f=i.handleFetchManuscriptElements,B=i.data,C=i.showComingSoon,v=void 0!==C&&C,y=i.comingSoonData,k=void 0===y?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:h}:y,S=i.customStyle,j=void 0===S?{}:S,w=i.isBlurToggleVisible,_=void 0!==w&&w,F=i.highlightTerms,b=null!=t&&t,D=null!=r?r:function(){};return d?o.jsx(s.default,e.__assign({open:b,fullWidth:!0,PaperProps:{style:e.__assign(e.__assign({},a),null==j?void 0:j.dialogDimension)}},{children:o.jsx(l.default,e.__assign({style:{padding:0}},{children:o.jsx(n.BookemonContent,{data:B,customStyle:j,comingSoonData:k,showComingSoon:v,isNonHighlightedBlur:m,isBlurToggleVisible:_,isBookemon:p,highlightTerms:F,getHighlightContent:x,handleFetchManuscriptElements:f,isBookPreview:c,isDialog:d,onClose:D})}))})):o.jsx("div",e.__assign({style:{width:"100%",height:"100%"}},{children:o.jsx(n.BookemonContent,{data:B,customStyle:j,comingSoonData:k,showComingSoon:v,isNonHighlightedBlur:m,isBlurToggleVisible:_,isBookemon:p,highlightTerms:F,getHighlightContent:x,handleFetchManuscriptElements:f,isBookPreview:c,isDialog:d,onClose:D})}))},exports.defaultIcon=h;
2
2
  //# sourceMappingURL=Bookemon.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("react-resizable-panels"),o=require("@material-ui/core/Accordion"),a=require("@material-ui/core/AccordionSummary"),r=require("@material-ui/core/Typography"),s=require("@material-ui/core/AccordionDetails"),l=require("@material-ui/core/IconButton"),d=require("./BookDetailsCard/BookDetailsCard.js"),u=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),g=require("./BookCopyrightsCard/BookCopyrightsCard.js"),h=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),x=require("./BookPreview/BookPreview.js"),p=require("@material-ui/icons/ExpandMore"),f=require("@material-ui/icons/Close");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=_(o),y=_(a),v=_(r),j=_(s),b=_(l),C=_(p),k=_(f),w={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},B={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},S=function(i){var n=i.header,o=i.subheader,a=i.icon;return t.jsx("div",e.__assign({style:B.wrapper},{children:t.jsxs("div",e.__assign({style:B.inner},{children:[t.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:t.jsx("div",e.__assign({style:B.iconWrapper},{children:a}))})),t.jsxs("div",{children:[t.jsx("h1",e.__assign({style:B.heading},{children:n})),t.jsx("p",e.__assign({style:B.text},{children:o}))]})]}))}))};exports.BookemonContent=function(o){var a=o.showComingSoon,r=o.onClose,s=o.highlightTerms,l=o.data,p=o.customStyle,f=o.comingSoonData,_=o.isNonHighlightedBlur,B=o.isBlurToggleVisible,D=o.isBookemon,F=o.getHighlightContent,H=o.handleFetchManuscriptElements,P=o.isBookPreview,z=o.isDialog,q=i.useState({textToHighLight:"",content:""}),M=q[0],I=q[1],T=i.useState(1),A=T[0],E=T[1],O=i.useState(!1),R=O[0],L=O[1],W=i.useState("Book Preview"),N=W[0],V=W[1],Q=i.useState(70),Y=Q[0],G=Q[1],J=i.useRef(null),K=i.useState(!1),U=K[0],X=K[1],Z=function(t,i,n,o){return void 0===o&&(o=0),e.__awaiter(void 0,void 0,void 0,function(){var a,r,s,l,d,u,c,g,h,x,p,f,_,m,y,v;return e.__generator(this,function(e){switch(e.label){case 0:I({textToHighLight:"",content:""}),X(!1),L(!0),V(i),e.label=1;case 1:return e.trys.push([1,5,6,7]),n&&0!==n.length?[4,null==F?void 0:F([n[o]])]:(L(!1),G(70),null===(y=J.current)||void 0===y||y.resize(70),[2]);case 2:if(a=e.sent(),r=(null==a?void 0:a.data)||a||[],!Array.isArray(r)||0===r.length)return X(!0),L(!1),[2];for(l=(s=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/&nbsp;/g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(t),d=null,u=0,c=r;u<c.length;u++)if(f=c[u],s(f.normalizedContent||f.htmlContent).includes(l)){d=f;break}if(!d)for(g=l.split(" ").filter(Boolean);g.length>0;){for(h=g.join(" "),x=0,p=r;x<p.length;x++)if(f=p[x],s(f.normalizedContent||f.htmlContent).includes(h)){d=f;break}if(d)break;g.pop()}return _=r.map(function(e){return e.htmlContent}).join("\n"),I({textToHighLight:d?d.htmlContent:"",content:_}),G(50),null===(v=J.current)||void 0===v||v.resize(50),!d&&o+1<n.length?[4,Z(t,i,n,o+1)]:[3,4];case 3:return[2,e.sent()];case 4:return[2];case 5:return m=e.sent(),console.error("Highlight error:",m),X(!0),[3,7];case 6:return L(!1),[7];case 7:return[2]}})})},$=i.useState(!1),ee=$[0],te=$[1],ie=i.useState(!1),ne=ie[0],oe=ie[1],ae=i.useState(!1),re=ae[0],se=ae[1],le=i.useState(!1),de=le[0],ue=le[1],ce=i.useState(!1),ge=ce[0],he=ce[1],xe=i.useState(!1),pe=xe[0],fe=xe[1],_e=i.useState(!1),me=_e[0],ye=_e[1],ve=i.useState(!1),je=ve[0],be=ve[1],Ce=i.useState(!1),ke=Ce[0],we=Ce[1],Be=i.useState(!1),Se=Be[0],De=Be[1];i.useEffect(function(){ee&&fe(!0),ne&&ye(!0),re&&be(!0),de&&we(!0),ge&&De(!0)},[ee,ne,re,de,ge]);var Fe=l.bookAwards,He=l.bookCopyRight,Pe=l.bookDetails,ze=l.bookElements,qe=l.bookOverView,Me=l.bookCoverImage,Ie=null==Pe?void 0:Pe.isbn,Te=null!=r?r:function(){};return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},w.dialogContent),z?w.dialogHeight:{})},{children:[!a&&t.jsx("div",e.__assign({style:w.container},{children:t.jsxs(n.PanelGroup,e.__assign({direction:"horizontal"},{children:[t.jsx(n.Panel,e.__assign({order:1,ref:J,defaultSize:Y||70},{children:t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==w?void 0:w.leftPanel),null==p?void 0:p.leftPanel)},{children:[t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({expanded:pe,onChange:function(e,t){return fe(t)},elevation:0,style:w.accordion},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Book Overview"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:qe&&Object.keys(qe).length>0?t.jsx(u.default,{data:qe,highlightTerms:s,onHighlightMatch:te}):t.jsx("div",e.__assign({style:w.errorState},{children:"No overview data available."}))}))]}))})),t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({elevation:0,style:w.accordion,expanded:me,onChange:function(e,t){return ye(t)}},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Book Manuscript Elements"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:t.jsx(c.default,{data:ze,title:(null==qe?void 0:qe.title)||"",handleFetchManuscriptElements:H,BookIsbn:Ie,updateQuotesToHighLight:Z,highlightTerms:s,onHighlightMatch:oe})}))]}))})),t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({expanded:je,onChange:function(e,t){return be(t)},elevation:0,style:w.accordion},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Book Metadata Details"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:Pe&&Object.keys(Pe).length>0?t.jsx(d.default,{data:Pe,highlightTerms:s,onHighlightMatch:se}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Book Metadata data available."}))}))]}))})),t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({elevation:0,style:w.accordion,expanded:ke,onChange:function(e,t){return we(t)}},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Copyrights & Marketing"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:He&&Object.keys(He).length>0?t.jsx(g.default,{data:He,highlightTerms:s,onHighlightMatch:ue}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),t.jsx("div",{children:t.jsxs(m.default,e.__assign({elevation:0,style:w.accordion,expanded:Se,onChange:function(e,t){return De(t)}},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"People & Awards"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:Fe&&Object.keys(Fe).length>0?t.jsx(h.default,{data:Fe,highlightTerms:s,onHighlightMatch:he}):t.jsx("div",e.__assign({style:w.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),P&&t.jsx(n.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),P&&t.jsx(n.Panel,e.__assign({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:t.jsx(x.default,{bookOverView:qe,bookCoverImage:Me,onClose:Te,clickableElementCategory:N,quotesToHighLightData:M,updateQuotesToHighLight:Z,citationLoad:R,previewPage:A,setPreviewPage:E,customStyle:p,comingSoonData:f,isNonHighlightedBlur:_,isBlurToggleVisible:B,isBookemon:D,noHtmlContent:U})}))]}))})),a&&t.jsxs("div",e.__assign({style:w.blurOverlay},{children:[t.jsx(b.default,e.__assign({style:w.closeButton,onClick:r},{children:t.jsx(k.default,{})})),t.jsx(S,{header:null==f?void 0:f.header,subheader:null==f?void 0:f.subheader,icon:null==f?void 0:f.icon})]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("react-resizable-panels"),a=require("@mui/material/Accordion"),o=require("@mui/material/AccordionSummary"),r=require("@mui/material/Typography"),s=require("@mui/material/AccordionDetails"),l=require("@mui/material/IconButton"),d=require("./BookDetailsCard/BookDetailsCard.js"),u=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),g=require("./BookCopyrightsCard/BookCopyrightsCard.js"),h=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),x=require("./BookPreview/BookPreview.js"),p=require("@mui/icons-material/ExpandMore"),f=require("@mui/icons-material/Close");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=_(a),y=_(o),v=_(r),j=_(s),b=_(l),C=_(p),k=_(f),w={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},B={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},S=function(i){var n=i.header,a=i.subheader,o=i.icon;return t.jsx("div",e.__assign({style:B.wrapper},{children:t.jsxs("div",e.__assign({style:B.inner},{children:[t.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:t.jsx("div",e.__assign({style:B.iconWrapper},{children:o}))})),t.jsxs("div",{children:[t.jsx("h1",e.__assign({style:B.heading},{children:n})),t.jsx("p",e.__assign({style:B.text},{children:a}))]})]}))}))};exports.BookemonContent=function(a){var o=a.showComingSoon,r=a.onClose,s=a.highlightTerms,l=a.data,p=a.customStyle,f=a.comingSoonData,_=a.isNonHighlightedBlur,B=a.isBlurToggleVisible,D=a.isBookemon,F=a.getHighlightContent,H=a.handleFetchManuscriptElements,z=a.isBookPreview,P=a.isDialog,q=i.useState({textToHighLight:"",content:""}),M=q[0],I=q[1],T=i.useState(1),A=T[0],E=T[1],O=i.useState(!1),R=O[0],L=O[1],W=i.useState("Book Preview"),N=W[0],V=W[1],Q=i.useState(70),Y=Q[0],G=Q[1],J=i.useRef(null),K=i.useState(!1),U=K[0],X=K[1],Z=function(t,i,n,a){return void 0===a&&(a=0),e.__awaiter(void 0,void 0,void 0,function(){var o,r,s,l,d,u,c,g,h,x,p,f,_,m,y,v;return e.__generator(this,function(e){switch(e.label){case 0:I({textToHighLight:"",content:""}),X(!1),L(!0),V(i),e.label=1;case 1:return e.trys.push([1,5,6,7]),n&&0!==n.length?[4,null==F?void 0:F([n[a]])]:(L(!1),G(70),null===(y=J.current)||void 0===y||y.resize(70),[2]);case 2:if(o=e.sent(),r=(null==o?void 0:o.data)||o||[],!Array.isArray(r)||0===r.length)return X(!0),L(!1),[2];for(l=(s=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/&nbsp;/g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(t),d=null,u=0,c=r;u<c.length;u++)if(f=c[u],s(f.normalizedContent||f.htmlContent).includes(l)){d=f;break}if(!d)for(g=l.split(" ").filter(Boolean);g.length>0;){for(h=g.join(" "),x=0,p=r;x<p.length;x++)if(f=p[x],s(f.normalizedContent||f.htmlContent).includes(h)){d=f;break}if(d)break;g.pop()}return _=r.map(function(e){return e.htmlContent}).join("\n"),I({textToHighLight:d?d.htmlContent:"",content:_}),G(50),null===(v=J.current)||void 0===v||v.resize(50),!d&&a+1<n.length?[4,Z(t,i,n,a+1)]:[3,4];case 3:return[2,e.sent()];case 4:return[2];case 5:return m=e.sent(),console.error("Highlight error:",m),X(!0),[3,7];case 6:return L(!1),[7];case 7:return[2]}})})},$=i.useState(!1),ee=$[0],te=$[1],ie=i.useState(!1),ne=ie[0],ae=ie[1],oe=i.useState(!1),re=oe[0],se=oe[1],le=i.useState(!1),de=le[0],ue=le[1],ce=i.useState(!1),ge=ce[0],he=ce[1],xe=i.useState(!1),pe=xe[0],fe=xe[1],_e=i.useState(!1),me=_e[0],ye=_e[1],ve=i.useState(!1),je=ve[0],be=ve[1],Ce=i.useState(!1),ke=Ce[0],we=Ce[1],Be=i.useState(!1),Se=Be[0],De=Be[1];i.useEffect(function(){ee&&fe(!0),ne&&ye(!0),re&&be(!0),de&&we(!0),ge&&De(!0)},[ee,ne,re,de,ge]);var Fe=l.bookAwards,He=l.bookCopyRight,ze=l.bookDetails,Pe=l.bookElements,qe=l.bookOverView,Me=l.bookCoverImage,Ie=null==ze?void 0:ze.isbn,Te=null!=r?r:function(){};return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},w.dialogContent),P?w.dialogHeight:{})},{children:[!o&&t.jsx("div",e.__assign({style:w.container},{children:t.jsxs(n.PanelGroup,e.__assign({direction:"horizontal"},{children:[t.jsx(n.Panel,e.__assign({order:1,ref:J,defaultSize:Y||70},{children:t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==w?void 0:w.leftPanel),null==p?void 0:p.leftPanel)},{children:[t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({expanded:pe,onChange:function(e,t){return fe(t)},elevation:0,style:w.accordion},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Book Overview"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:qe&&Object.keys(qe).length>0?t.jsx(u.default,{data:qe,highlightTerms:s,onHighlightMatch:te}):t.jsx("div",e.__assign({style:w.errorState},{children:"No overview data available."}))}))]}))})),t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({elevation:0,style:w.accordion,expanded:me,onChange:function(e,t){return ye(t)}},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Book Manuscript Elements"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:t.jsx(c.default,{data:Pe,title:(null==qe?void 0:qe.title)||"",handleFetchManuscriptElements:H,BookIsbn:Ie,updateQuotesToHighLight:Z,highlightTerms:s,onHighlightMatch:ae})}))]}))})),t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({expanded:je,onChange:function(e,t){return be(t)},elevation:0,style:w.accordion},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Book Metadata Details"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:ze&&Object.keys(ze).length>0?t.jsx(d.default,{data:ze,highlightTerms:s,onHighlightMatch:se}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Book Metadata data available."}))}))]}))})),t.jsx("div",e.__assign({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(m.default,e.__assign({elevation:0,style:w.accordion,expanded:ke,onChange:function(e,t){return we(t)}},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"Copyrights & Marketing"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:He&&Object.keys(He).length>0?t.jsx(g.default,{data:He,highlightTerms:s,onHighlightMatch:ue}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),t.jsx("div",{children:t.jsxs(m.default,e.__assign({elevation:0,style:w.accordion,expanded:Se,onChange:function(e,t){return De(t)}},{children:[t.jsx(y.default,e.__assign({expandIcon:t.jsx(C.default,{}),style:w.accordionSummary},{children:t.jsx(v.default,e.__assign({style:w.heading},{children:"People & Awards"}))})),t.jsx(j.default,e.__assign({style:w.accordionDetails},{children:Fe&&Object.keys(Fe).length>0?t.jsx(h.default,{data:Fe,highlightTerms:s,onHighlightMatch:he}):t.jsx("div",e.__assign({style:w.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),z&&t.jsx(n.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),z&&t.jsx(n.Panel,e.__assign({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:t.jsx(x.default,{bookOverView:qe,bookCoverImage:Me,onClose:Te,clickableElementCategory:N,quotesToHighLightData:M,updateQuotesToHighLight:Z,citationLoad:R,previewPage:A,setPreviewPage:E,customStyle:p,comingSoonData:f,isNonHighlightedBlur:_,isBlurToggleVisible:B,isBookemon:D,noHtmlContent:U})}))]}))})),o&&t.jsxs("div",e.__assign({style:w.blurOverlay},{children:[t.jsx(b.default,e.__assign({style:w.closeButton,onClick:r,size:"large"},{children:t.jsx(k.default,{})})),t.jsx(S,{header:null==f?void 0:f.header,subheader:null==f?void 0:f.subheader,icon:null==f?void 0:f.icon})]}))]}))};
2
2
  //# sourceMappingURL=BookemonContent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("tslib"),n=require("react/jsx-runtime"),e=require("react"),t=require("./InternalChatCitationRenderer.js"),i=require("./components/wrappers/Modal.js"),r=require("./components/IconContainer.js"),a=require("lucide-react");exports.default=function(s){var l,d,c,u,_,p=e.useState(!1),C=p[0],v=p[1],h=e.useState(),g=h[0],x=h[1];function y(o){v(!0),x(o)}function f(){v(!1),x(void 0)}function j(o){x(o)}var b=e.useMemo(function(){var o;return!!(null===(o=s.ruleBookContainer)||void 0===o?void 0:o.data)},[null===(l=s.ruleBookContainer)||void 0===l?void 0:l.data]),m=e.useMemo(function(){var o;return!!((null===(o=s.tableComponent)||void 0===o?void 0:o.rows)&&Object.keys(s.tableComponent.rows).length>0)},[s.tableComponent]);return console.log("tableComponent data:",s.tableComponent),console.log("isTableDataPresent:",m),console.log("rootContainer",s.rootContainer),console.log("chatCitation",s.chatContainer),n.jsxs(n.Fragment,{children:[n.jsx(t.default,o.__assign({},s,{showRootContainer:s.showRootContainer,tableComponent:s.tableComponent,additionalData:{isExpanded:!1},chatContainer:o.__assign(o.__assign({},s.chatContainer),{show:!0,secondaryActions:function(e){var t,i,l;return o.__spreadArray(o.__spreadArray([],e,!0),[(null===(l=null===(i=null===(t=s.chatContainer)||void 0===t?void 0:t.detailedTab)||void 0===i?void 0:i.chip)||void 0===l?void 0:l.isActive)&&n.jsx("span",{style:{width:"1px",height:"100%",border:"1px solid #E2E8F0"}}),n.jsx(r.default,o.__assign({onClick:function(){return y("chat")},style:{cursor:"pointer"}},{children:n.jsx(a.Maximize2,{size:16,color:"#64748B"})}))],!1)}}),ruleBookContainer:b?o.__assign(o.__assign({},s.ruleBookContainer),{show:!0,secondaryActions:function(e){return o.__spreadArray(o.__spreadArray([],e,!0),[n.jsx("span",{style:{width:"1px",border:"1px solid #E2E8F0"}}),n.jsx(r.default,o.__assign({onClick:function(){return y("rulebook")},style:{cursor:"pointer"}},{children:n.jsx(a.Maximize2,{size:16,color:"#64748B"})}))],!1)}}):void 0})),n.jsx(i.Modal,o.__assign({isOpen:C,onClose:f},{children:n.jsx(t.default,o.__assign({},s,{showRootContainer:s.showRootContainer,tableComponent:s.tableComponent,additionalData:{isExpanded:!0},rootContainer:o.__assign(o.__assign({},s.rootContainer),{secondaryActions:function(e){return o.__spreadArray(o.__spreadArray([],e,!0),[n.jsx(r.default,o.__assign({onClick:f,style:{cursor:"pointer"}},{children:n.jsx(a.X,{size:20,color:"#64748B"})}))],!1)}}),chatContainer:o.__assign(o.__assign({},s.chatContainer),{show:void 0===g?void 0:"chat"===g,secondaryActions:function(e){var t,i,l;return o.__spreadArray(o.__spreadArray([],e,!0),[(null===(l=null===(i=null===(t=s.chatContainer)||void 0===t?void 0:t.detailedTab)||void 0===i?void 0:i.chip)||void 0===l?void 0:l.isActive)&&(b||m)&&n.jsx("span",{style:{width:"1px",height:"100%",border:"1px solid #E2E8F0"}}),(b||m)&&n.jsxs(r.default,o.__assign({style:{cursor:"pointer"}},{children:["onClick=",function(){return j("rulebook")},n.jsx(a.Minimize2,{size:16,color:"#64748B"})]}))],!1)},slotStyles:o.__assign(o.__assign({},s.chatContainer.slotStyles),{chatDataContainer:o.__assign(o.__assign({},null===(d=s.chatContainer.slotStyles)||void 0===d?void 0:d.chatDataContainer),{maxHeight:void 0})})}),ruleBookContainer:b?o.__assign(o.__assign({},s.ruleBookContainer),{show:void 0===g?void 0:"rulebook"===g,secondaryActions:function(e){return o.__spreadArray(o.__spreadArray([],e,!0),[n.jsx("span",{style:{width:"1px",border:"1px solid #E2E8F0"}}),n.jsx(r.default,o.__assign({style:{cursor:"pointer"},onClick:function(){return j("chat")}},{children:n.jsx(a.Minimize2,{size:16,color:"#64748B"})}))],!1)},slotStyles:o.__assign(o.__assign({},null===(c=s.ruleBookContainer)||void 0===c?void 0:c.slotStyles),{dataContainer:o.__assign(o.__assign({},null===(_=null===(u=s.ruleBookContainer)||void 0===u?void 0:u.slotStyles)||void 0===_?void 0:_.dataContainer),{maxHeight:void 0})})}):void 0}))}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("tslib"),n=require("react/jsx-runtime"),e=require("react"),t=require("./InternalChatCitationRenderer.js"),i=require("./components/wrappers/Modal.js"),a=require("./components/IconContainer.js"),r=require("lucide-react");function s(o){return o&&"object"==typeof o&&"default"in o?o:{default:o}}var l=s(require("@mui/icons-material/SwapHoriz"));exports.default=function(s){var d,u,c,_,p,C=e.useState(!1),v=C[0],h=C[1],g=e.useState(),y=g[0],x=g[1];function f(o){h(!0),x(o)}function j(){h(!1),x(void 0)}function m(o){x(o)}var b=e.useMemo(function(){var o;return!!(null===(o=s.ruleBookContainer)||void 0===o?void 0:o.data)},[null===(d=s.ruleBookContainer)||void 0===d?void 0:d.data]),w=e.useMemo(function(){var o;return!!((null===(o=s.tableComponent)||void 0===o?void 0:o.rows)&&Object.keys(s.tableComponent.rows).length>0)},[s.tableComponent]);return console.log("tableComponent data:",s.tableComponent),console.log("isTableDataPresent:",w),console.log("rootContainer",s.rootContainer),console.log("chatCitation",s.chatContainer),n.jsxs(n.Fragment,{children:[n.jsx(t.default,o.__assign({},s,{showRootContainer:s.showRootContainer,tableComponent:s.tableComponent,additionalData:o.__assign(o.__assign({},s.additionalData),{isExpanded:!1}),isRenderedCustomComponent:s.isRenderedCustomComponent||!1,closePreview:s.closePreview,chatContainer:o.__assign(o.__assign({},s.chatContainer),{show:!0,secondaryActions:function(e){var t,i,l;return o.__spreadArray(o.__spreadArray([],e,!0),[(null===(l=null===(i=null===(t=s.chatContainer)||void 0===t?void 0:t.detailedTab)||void 0===i?void 0:i.chip)||void 0===l?void 0:l.isActive)&&n.jsx("span",{style:{width:"1px",height:"100%",border:"1px solid #E2E8F0"}}),n.jsx(a.default,o.__assign({onClick:function(){return f("chat")},style:{cursor:"pointer"}},{children:n.jsx(r.Maximize2,{size:16,color:"#64748B"})}))],!1)}}),ruleBookContainer:b?o.__assign(o.__assign({},s.ruleBookContainer),{show:!0,secondaryActions:function(e){return o.__spreadArray(o.__spreadArray([],e,!0),[n.jsx("span",{style:{width:"1px",border:"1px solid #E2E8F0"}}),n.jsx(a.default,o.__assign({onClick:function(){return f("rulebook")},style:{cursor:"pointer"}},{children:n.jsx(r.Maximize2,{size:16,color:"#64748B"})}))],!1)}}):void 0})),n.jsx(i.Modal,o.__assign({isOpen:v,onClose:j},{children:n.jsx(t.default,o.__assign({},s,{showRootContainer:s.showRootContainer,tableComponent:s.tableComponent,additionalData:o.__assign(o.__assign({},s.additionalData),{isExpanded:!0}),rootContainer:o.__assign(o.__assign({},s.rootContainer),{secondaryActions:function(e){return o.__spreadArray(o.__spreadArray([],e,!0),[n.jsx(a.default,o.__assign({onClick:j,style:{cursor:"pointer"}},{children:n.jsx(r.X,{size:20,color:"#64748B"})}))],!1)}}),chatContainer:o.__assign(o.__assign({},s.chatContainer),{show:void 0===y?void 0:"chat"===y,secondaryActions:function(e){var t,i,r;return o.__spreadArray(o.__spreadArray([],e,!0),[(null===(r=null===(i=null===(t=s.chatContainer)||void 0===t?void 0:t.detailedTab)||void 0===i?void 0:i.chip)||void 0===r?void 0:r.isActive)&&(b||w)&&n.jsx("span",{style:{width:"1px",height:"100%",border:"1px solid #E2E8F0"}}),(b||w)&&n.jsx(a.default,o.__assign({style:{cursor:"pointer"},onClick:function(){return m("rulebook")}},{children:n.jsx(l.default,{style:{color:"gray",fontSize:22}})}))],!1)},slotStyles:o.__assign(o.__assign({},s.chatContainer.slotStyles),{chatDataContainer:o.__assign(o.__assign({},null===(u=s.chatContainer.slotStyles)||void 0===u?void 0:u.chatDataContainer),{maxHeight:void 0})})}),ruleBookContainer:b?o.__assign(o.__assign({},s.ruleBookContainer),{show:void 0===y?void 0:"rulebook"===y,secondaryActions:function(e){return o.__spreadArray(o.__spreadArray([],e,!0),[n.jsx("span",{style:{width:"1px",border:"1px solid #E2E8F0"}}),n.jsx(a.default,o.__assign({style:{cursor:"pointer"},onClick:function(){return m("chat")}},{children:n.jsx(l.default,{style:{color:"gray",fontSize:22}})}))],!1)},slotStyles:o.__assign(o.__assign({},null===(c=s.ruleBookContainer)||void 0===c?void 0:c.slotStyles),{dataContainer:o.__assign(o.__assign({},null===(p=null===(_=s.ruleBookContainer)||void 0===_?void 0:_.slotStyles)||void 0===p?void 0:p.dataContainer),{maxHeight:void 0})})}):void 0}))}))]})};
2
2
  //# sourceMappingURL=ChatCitationRenderer.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),o=require("./components/ChatCitation.js"),i=require("./utils/helpers.js"),n=require("./components/Chip.js"),t=require("./assets/message-chat-square.svg.js");require("@material-ui/icons/KeyboardArrowDown"),require("@material-ui/icons/KeyboardArrowUp"),require("@material-ui/icons/Clear");var r=require("./components/InViewNavigation.js"),s=require("./components/DetailedView.js"),d=require("./components/SummarizedView.js"),a=require("./components/RuleBook.js"),u=require("react"),v=require("./constants/renderer.js"),c=require("./components/IconContainer.js"),h=require("lucide-react"),f=require("./BigQueryTable.js");exports.default=function(g){var b,x,p,m,_,y,w,C,j,k,S,q,A,T,I,D,F,R,z,V,P,E,N,M,W,B,Y,H,K,O,Q,U,G,J,L,X,Z,$,ee,le,oe,ie=g.rootContainer,ne=g.chatContainer,te=g.ruleBookContainer,re=g.renderer,se=g.additionalData,de=g.tableComponent,ae=g.showRootContainer,ue=void 0===ae||ae,ve=u.useState(0),ce=ve[0],he=ve[1],fe=u.useState(0),ge=fe[0],be=fe[1],xe=u.useState(0),pe=xe[0],me=xe[1],_e=u.useState(0),ye=_e[0],we=_e[1],Ce=u.useRef(null),je=u.useRef(null),ke=u.useMemo(function(){return e.__assign(e.__assign({},v.defaultRenderer),re)},[re]),Se=u.useMemo(function(){return!!((null==de?void 0:de.rows)&&Object.keys(de.rows).length>0)},[de]);u.useEffect(function(){var e,l;if((null==te?void 0:te.show)&&Ce.current){var o=null===(e=Ce.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(he((null==o?void 0:o.length)||0),be(0),o&&o.length>0)(i=o[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}if(ne.show&&je.current){var i,n=null===(l=je.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(me((null==n?void 0:n.length)||0),we(0),n&&n.length>0)(i=n[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}},[ne.show,null==te?void 0:te.show,null==te?void 0:te.data,null==ne?void 0:ne.chatData]);var qe=u.useCallback(function(){var e;if(ge+1<ce){var l=null===(e=Ce.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(!l)return;l[ge].style.backgroundColor="#ffffb8";var o=ge+1;be(o);var i=l[o];i.style.backgroundColor="#ffff5c",null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[ge,ce]),Ae=u.useCallback(function(){var e;if(!(ge-1<0)){var l=null===(e=Ce.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(l){l[ge].style.backgroundColor="#ffffb8";var o=ge-1,i=l[o];i.style.backgroundColor="#ffff5c",be(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[ge]),Te=u.useCallback(function(){var e;if(ye+1<pe){var l=null===(e=je.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(!l)return;l[ye].style.backgroundColor="#ffffb8";var o=ye+1,i=l[o];i.style.backgroundColor="#ffff5c",we(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[ye,pe]),Ie=u.useCallback(function(){var e;if(!(ye-1<0)){var l=null===(e=je.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(l){l[ye].style.backgroundColor="#ffffb8";var o=ye-1,i=l[o];i.style.backgroundColor="#ffff5c",we(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[ye]),De=i.getColorCode((null==ie?void 0:ie.relevanceScore)||0),Fe=u.useMemo(function(){var o;return[l.jsxs("span",e.__assign({style:e.__assign({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:De.border,backgroundColor:De.background,color:De.text},null===(o=null==ie?void 0:ie.slotStyles)||void 0===o?void 0:o.relevanceScore)},{children:[(null==ie?void 0:ie.relevanceTitle)||"Decision Strength",":"," ",(null==ie?void 0:ie.relevanceScore)||0,"%"]}),"relevance-score")]},[De.background,De.border,De.text,null==ie?void 0:ie.relevanceScore,null===(b=null==ie?void 0:ie.slotStyles)||void 0===b?void 0:b.relevanceScore,null==ie?void 0:ie.relevanceTitle]),Re=u.useMemo(function(){return[ce>0&&l.jsx(r.default,{currentItemNumber:ge+1,totalItems:ce,disableNext:ge+1>=ce,onNext:qe,onPrevious:Ae,disablePrevious:ge<=0},"rulebook-nav")]},[ge,qe,Ae,ce]),ze=u.useMemo(function(){var e,o;return[(null===(o=null===(e=null==ne?void 0:ne.detailedTab)||void 0===e?void 0:e.chip)||void 0===o?void 0:o.isActive)&&pe>0&&l.jsx(r.default,{currentItemNumber:ye+1,totalItems:pe,onNext:Te,onPrevious:Ie,disableNext:ye+1>=pe,disablePrevious:ye<=0},"chat-nav")]},[null===(p=null===(x=null==ne?void 0:ne.detailedTab)||void 0===x?void 0:x.chip)||void 0===p?void 0:p.isActive,ye,Te,Ie,pe]),Ve=l.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:"row",gap:"12px",height:"100%"},null===(m=null==ie?void 0:ie.slotStyles)||void 0===m?void 0:m.container)},{children:[Se&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(_=null==ne?void 0:ne.slotStyles)||void 0===_?void 0:_.outerContainer)},{children:l.jsx(o.default,e.__assign({title:"Invoice Data Preview",icon:l.jsx(c.default,{children:l.jsx(h.Table,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:l.jsx("div",e.__assign({style:{height:"100%",maxHeight:(null==se?void 0:se.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==de?void 0:de.rows)&&l.jsx(f.BigQueryTable,{rows:de.rows,columns:de.columns||[]})}))}))})),(null==te?void 0:te.data)&&(te.show||void 0===te.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(y=null==te?void 0:te.slotStyles)||void 0===y?void 0:y.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(w=null==te?void 0:te.title)&&void 0!==w?w:"Rule book",icon:null==te?void 0:te.ruleBookIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(C=null==te?void 0:te.slotStyles)||void 0===C?void 0:C.title)},secondaryActions:(null==te?void 0:te.secondaryActions)?te.secondaryActions(Re):Re},{children:l.jsx("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(j=null==te?void 0:te.slotStyles)||void 0===j?void 0:j.dataContainer)},{children:l.jsx("div",e.__assign({style:{position:"absolute",padding:"12px",inset:0,overflowY:"auto"},ref:Ce},{children:l.jsx(a.default,{data:te.data,renderers:null!==(k=null==te?void 0:te.renderer)&&void 0!==k?k:ke})}))}))}))})),(ne.show||void 0===ne.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(S=null==ne?void 0:ne.slotStyles)||void 0===S?void 0:S.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(q=null==ne?void 0:ne.title)&&void 0!==q?q:"Chat",icon:null==ne?void 0:ne.chatIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(A=null==ne?void 0:ne.slotStyles)||void 0===A?void 0:A.title)},primaryActions:[((null===(I=null===(T=null==ne?void 0:ne.summarizedTab)||void 0===T?void 0:T.chip)||void 0===I?void 0:I.show)||void 0===(null===(F=null===(D=null==ne?void 0:ne.summarizedTab)||void 0===D?void 0:D.chip)||void 0===F?void 0:F.show))&&l.jsx(n.default,e.__assign({label:"Summarized"},null===(R=null==ne?void 0:ne.summarizedTab)||void 0===R?void 0:R.chip)),l.jsx(n.default,e.__assign({label:"Detailed"},null===(z=null==ne?void 0:ne.detailedTab)||void 0===z?void 0:z.chip))],secondaryActions:ne.secondaryActions?null==ne?void 0:ne.secondaryActions(ze):ze},{children:l.jsxs("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(V=null==ne?void 0:ne.slotStyles)||void 0===V?void 0:V.chatDataContainer)},{children:[(null===(E=null===(P=null==ne?void 0:ne.detailedTab)||void 0===P?void 0:P.chip)||void 0===E?void 0:E.isActive)&&l.jsx("div",e.__assign({ref:je,style:{position:(null==se?void 0:se.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:l.jsx(s.default,{chatData:ne.chatData,assistantChatProps:e.__assign(e.__assign({},null===(M=null===(N=null==ne?void 0:ne.detailedTab)||void 0===N?void 0:N.view)||void 0===M?void 0:M.assistantChatProps),{renderers:null!==(Y=null===(B=null===(W=null==ne?void 0:ne.detailedTab)||void 0===W?void 0:W.detailedViewRenderer)||void 0===B?void 0:B.assistantText)&&void 0!==Y?Y:ke}),userChatItemProps:e.__assign(e.__assign({},null===(K=null===(H=null==ne?void 0:ne.detailedTab)||void 0===H?void 0:H.view)||void 0===K?void 0:K.userChatItemProps),{renderers:null!==(U=null===(Q=null===(O=null==ne?void 0:ne.detailedTab)||void 0===O?void 0:O.detailedViewRenderer)||void 0===Q?void 0:Q.userText)&&void 0!==U?U:ke})})})),(null===(J=null===(G=null==ne?void 0:ne.summarizedTab)||void 0===G?void 0:G.chip)||void 0===J?void 0:J.show)&&(null===(X=null===(L=null==ne?void 0:ne.summarizedTab)||void 0===L?void 0:L.chip)||void 0===X?void 0:X.isActive)&&l.jsx(d.default,e.__assign({chatData:ne.chatData},null===(Z=null==ne?void 0:ne.summarizedTab)||void 0===Z?void 0:Z.view,{renderer:null!==(ee=null===($=null==ne?void 0:ne.summarizedTab)||void 0===$?void 0:$.summarizedViewRenderer)&&void 0!==ee?ee:ke}))]}))}))}))]}));return ue?l.jsx(o.default,e.__assign({title:null==ie?void 0:ie.title,slotStyles:{title:null===(le=null==ie?void 0:ie.slotStyles)||void 0===le?void 0:le.title},icon:null!==(oe=null==ie?void 0:ie.icon)&&void 0!==oe?oe:l.jsx(c.default,{children:l.jsx("img",{src:t.default,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==ie?void 0:ie.secondaryActions)?ie.secondaryActions(Fe):Fe},{children:Ve})):Ve};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),o=require("./components/ChatCitation.js"),i=require("./utils/helpers.js"),n=require("./components/Chip.js"),t=require("./assets/message-chat-square.svg.js");require("@mui/icons-material/KeyboardArrowDown"),require("@mui/icons-material/KeyboardArrowUp"),require("@mui/icons-material/Clear");var r=require("./components/InViewNavigation.js"),s=require("./components/DetailedView.js"),d=require("./components/SummarizedView.js"),a=require("./components/RuleBook.js"),u=require("react"),v=require("./constants/renderer.js"),c=require("./components/IconContainer.js"),h=require("lucide-react"),f=require("./BigQueryTable.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=g(require("@mui/icons-material/CloseOutlined"));exports.default=function(g){var p,x,m,y,_,C,w,k,j,S,q,A,T,R,I,D,V,F,z,P,E,B,H,M,N,W,Y,O,K,Q,U,G,J,L,X,Z,$,ee,le,oe,ie,ne=g.rootContainer,te=g.chatContainer,re=g.ruleBookContainer,se=g.renderer,de=g.additionalData,ae=g.tableComponent,ue=g.closePreview,ve=g.isRenderedCustomComponent,ce=void 0!==ve&&ve,he=g.showRootContainer,fe=void 0===he||he,ge=g.reversePanels,be=void 0!==ge&&ge,pe=u.useState(0),xe=pe[0],me=pe[1],ye=u.useState(0),_e=ye[0],Ce=ye[1],we=u.useState(0),ke=we[0],je=we[1],Se=u.useState(0),qe=Se[0],Ae=Se[1],Te=u.useRef(null),Re=u.useRef(null),Ie=u.useMemo(function(){return e.__assign(e.__assign({},v.defaultRenderer),se)},[se]),De=u.useMemo(function(){return!!((null==ae?void 0:ae.rows)&&Object.keys(ae.rows).length>0)},[ae]),Ve=u.useMemo(function(){var e;return null!==(e=null==de?void 0:de.RuleBookDetailedViewVerticallyStacked)&&void 0!==e&&e},[null==de?void 0:de.RuleBookDetailedViewVerticallyStacked]);u.useEffect(function(){var e,l;if((null==re?void 0:re.show)&&Te.current){var o=null===(e=Te.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(me((null==o?void 0:o.length)||0),Ce(0),o&&o.length>0)(i=o[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}if(te.show&&Re.current){var i,n=null===(l=Re.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(je((null==n?void 0:n.length)||0),Ae(0),n&&n.length>0)(i=n[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}},[te.show,null==re?void 0:re.show,null==re?void 0:re.data,null==te?void 0:te.chatData]);var Fe=u.useCallback(function(){var e;if(_e+1<xe){var l=null===(e=Te.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(!l)return;l[_e].style.backgroundColor="#ffffb8";var o=_e+1;Ce(o);var i=l[o];i.style.backgroundColor="#ffff5c",null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[_e,xe]),ze=u.useCallback(function(){var e;if(!(_e-1<0)){var l=null===(e=Te.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(l){l[_e].style.backgroundColor="#ffffb8";var o=_e-1,i=l[o];i.style.backgroundColor="#ffff5c",Ce(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[_e]),Pe=u.useCallback(function(){var e;if(qe+1<ke){var l=null===(e=Re.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(!l)return;l[qe].style.backgroundColor="#ffffb8";var o=qe+1,i=l[o];i.style.backgroundColor="#ffff5c",Ae(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[qe,ke]),Ee=u.useCallback(function(){var e;if(!(qe-1<0)){var l=null===(e=Re.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(l){l[qe].style.backgroundColor="#ffffb8";var o=qe-1,i=l[o];i.style.backgroundColor="#ffff5c",Ae(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[qe]),Be=i.getColorCode((null==ne?void 0:ne.relevanceScore)||0),He=u.useMemo(function(){var o,i=l.jsxs("span",e.__assign({style:e.__assign({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Be.border,backgroundColor:Be.background,color:Be.text},null===(o=null==ne?void 0:ne.slotStyles)||void 0===o?void 0:o.relevanceScore)},{children:[(null==ne?void 0:ne.relevanceTitle)||"Decision Strength",":"," ",(null==ne?void 0:ne.relevanceScore)||0,"%"]}),"relevance-score"),n=l.jsx("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:ue},{children:l.jsx(b.default,{})}),"close-preview");return ce&&!(null==de?void 0:de.isExpanded)?[i,n]:[i]},[ce,Be.background,Be.border,Be.text,null==ne?void 0:ne.relevanceScore,null===(p=null==ne?void 0:ne.slotStyles)||void 0===p?void 0:p.relevanceScore,null==ne?void 0:ne.relevanceTitle]),Me=u.useMemo(function(){return[xe>0&&l.jsx(r.default,{currentItemNumber:_e+1,totalItems:xe,disableNext:_e+1>=xe,onNext:Fe,onPrevious:ze,disablePrevious:_e<=0},"rulebook-nav")]},[_e,Fe,ze,xe]),Ne=u.useMemo(function(){return(null==de?void 0:de.RuleBookContainerHeight)?de.RuleBookContainerHeight:!(!Ve||(null==de?void 0:de.isExpanded))&&"600px"},[null==de?void 0:de.RuleBookContainerHeight,Ve]),We=u.useMemo(function(){var e,o;return[(null===(o=null===(e=null==te?void 0:te.detailedTab)||void 0===e?void 0:e.chip)||void 0===o?void 0:o.isActive)&&ke>0&&l.jsx(r.default,{currentItemNumber:qe+1,totalItems:ke,onNext:Pe,onPrevious:Ee,disableNext:qe+1>=ke,disablePrevious:qe<=0},"chat-nav")]},[null===(m=null===(x=null==te?void 0:te.detailedTab)||void 0===x?void 0:x.chip)||void 0===m?void 0:m.isActive,qe,Pe,Ee,ke]),Ye=l.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:be?Ve?"column-reverse":"row-reverse":Ve?"column":"row",gap:"12px",height:Ne||"100%",minHeight:0},null===(y=null==ne?void 0:ne.slotStyles)||void 0===y?void 0:y.container)},{children:[De&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(_=null==te?void 0:te.slotStyles)||void 0===_?void 0:_.outerContainer)},{children:l.jsx(o.default,e.__assign({title:"Invoice Data Preview",icon:l.jsx(c.default,{children:l.jsx(h.Table,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:l.jsx("div",e.__assign({style:{height:"100%",maxHeight:(null==de?void 0:de.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==ae?void 0:ae.rows)&&l.jsx(f.BigQueryTable,{rows:ae.rows,columns:ae.columns||[]})}))}))})),(null==re?void 0:re.data)&&(re.show||void 0===re.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(C=null==re?void 0:re.slotStyles)||void 0===C?void 0:C.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(w=null==re?void 0:re.title)&&void 0!==w?w:"Rule book",icon:null==re?void 0:re.ruleBookIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(k=null==re?void 0:re.slotStyles)||void 0===k?void 0:k.title)},secondaryActions:(null==re?void 0:re.secondaryActions)?re.secondaryActions(Me):Me},{children:l.jsx("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(j=null==re?void 0:re.slotStyles)||void 0===j?void 0:j.dataContainer)},{children:l.jsx("div",e.__assign({style:{position:"absolute",padding:"12px",inset:0,overflowY:"auto"},ref:Te},{children:l.jsx(a.default,{data:re.data,renderers:null!==(S=null==re?void 0:re.renderer)&&void 0!==S?S:Ie})}))}))}))})),(te.show||void 0===te.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(q=null==te?void 0:te.slotStyles)||void 0===q?void 0:q.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(A=null==te?void 0:te.title)&&void 0!==A?A:"Chat",icon:null==te?void 0:te.chatIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(T=null==te?void 0:te.slotStyles)||void 0===T?void 0:T.title)},primaryActions:[((null===(I=null===(R=null==te?void 0:te.summarizedTab)||void 0===R?void 0:R.chip)||void 0===I?void 0:I.show)||void 0===(null===(V=null===(D=null==te?void 0:te.summarizedTab)||void 0===D?void 0:D.chip)||void 0===V?void 0:V.show))&&l.jsx(n.default,e.__assign({label:"Summarized"},null===(F=null==te?void 0:te.summarizedTab)||void 0===F?void 0:F.chip)),l.jsx(n.default,e.__assign({label:"Detailed"},null===(z=null==te?void 0:te.detailedTab)||void 0===z?void 0:z.chip))],secondaryActions:te.secondaryActions?null==te?void 0:te.secondaryActions(We):We},{children:l.jsxs("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(P=null==te?void 0:te.slotStyles)||void 0===P?void 0:P.chatDataContainer)},{children:[(null===(B=null===(E=null==te?void 0:te.detailedTab)||void 0===E?void 0:E.chip)||void 0===B?void 0:B.isActive)&&l.jsx("div",e.__assign({ref:Re,style:{position:(null==de?void 0:de.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:l.jsx(s.default,{chatData:te.chatData,assistantChatProps:e.__assign(e.__assign({},null===(M=null===(H=null==te?void 0:te.detailedTab)||void 0===H?void 0:H.view)||void 0===M?void 0:M.assistantChatProps),{renderers:null!==(Y=null===(W=null===(N=null==te?void 0:te.detailedTab)||void 0===N?void 0:N.detailedViewRenderer)||void 0===W?void 0:W.assistantText)&&void 0!==Y?Y:Ie}),userChatItemProps:e.__assign(e.__assign({},null===(K=null===(O=null==te?void 0:te.detailedTab)||void 0===O?void 0:O.view)||void 0===K?void 0:K.userChatItemProps),{renderers:null!==(G=null===(U=null===(Q=null==te?void 0:te.detailedTab)||void 0===Q?void 0:Q.detailedViewRenderer)||void 0===U?void 0:U.userText)&&void 0!==G?G:Ie})})})),(null===(L=null===(J=null==te?void 0:te.summarizedTab)||void 0===J?void 0:J.chip)||void 0===L?void 0:L.show)&&(null===(Z=null===(X=null==te?void 0:te.summarizedTab)||void 0===X?void 0:X.chip)||void 0===Z?void 0:Z.isActive)&&l.jsx(d.default,e.__assign({chatData:te.chatData},null===($=null==te?void 0:te.summarizedTab)||void 0===$?void 0:$.view,{renderer:null!==(le=null===(ee=null==te?void 0:te.summarizedTab)||void 0===ee?void 0:ee.summarizedViewRenderer)&&void 0!==le?le:Ie}))]}))}))}))]}));return fe?l.jsx(o.default,e.__assign({title:null==ne?void 0:ne.title,slotStyles:{title:null===(oe=null==ne?void 0:ne.slotStyles)||void 0===oe?void 0:oe.title},icon:null!==(ie=null==ne?void 0:ne.icon)&&void 0!==ie?ie:l.jsx(c.default,{children:l.jsx("img",{src:t.default,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==ne?void 0:ne.secondaryActions)?ne.secondaryActions(He):He},{children:Ye})):Ye};
2
2
  //# sourceMappingURL=InternalChatCitationRenderer.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),t=require("../assets/cw_chat.svg.js");require("@material-ui/icons/KeyboardArrowDown"),require("@material-ui/icons/KeyboardArrowUp"),require("@material-ui/icons/Clear");var r=require("../utils/helpers.js"),i=require("./MarkdownRenderer.js"),a={rootRow:{display:"flex",gap:4},avatar:{width:24,height:24,flexShrink:0},contentColumn:{display:"flex",flexDirection:"column",gap:4},messageText:{fontSize:14,fontWeight:400},footerText:{fontSize:10,fontWeight:400,color:"#94A3B8"}};exports.default=function(n){var o=n.chatDetails,l=n.image,d=n.timestampFormat,u=void 0===d?"h:mm A | D MMM YYYY":d,g=n.maxWidthOfTextInPercent,h=void 0===g?60:g;n.slotClassname;var c=n.slotProps,m=n.slotStyles,x=n.renderers,_=r.highlightContent(o.message,[o.highlighted_text],"user-chat-highlight");return s.jsx("div",e.__assign({style:{maxWidth:"".concat(h,"%")}},{children:s.jsxs("div",e.__assign({style:a.rootRow},{children:[null!=l?l:s.jsx("span",e.__assign({style:a.avatar},{children:s.jsx("img",{src:t.default,alt:"CW Chat"})})),s.jsxs("div",e.__assign({style:a.contentColumn},{children:[s.jsx("p",e.__assign({style:e.__assign(e.__assign({},a.messageText),null==m?void 0:m.message)},null==c?void 0:c.message,{children:s.jsx(i.default,{content:_,renderers:x})})),s.jsxs("p",e.__assign({style:e.__assign(e.__assign({},a.footerText),null==m?void 0:m.footerText)},null==c?void 0:c.footerText,{children:[o.userName," |"," ",o.timeStamp.format(u)]}))]}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),t=require("../assets/cw_chat.svg.js");require("@mui/icons-material/KeyboardArrowDown"),require("@mui/icons-material/KeyboardArrowUp"),require("@mui/icons-material/Clear");var r=require("../utils/helpers.js"),i=require("./MarkdownRenderer.js"),a={rootRow:{display:"flex",gap:4},avatar:{width:24,height:24,flexShrink:0},contentColumn:{display:"flex",flexDirection:"column",gap:4},messageText:{fontSize:14,fontWeight:400},footerText:{fontSize:10,fontWeight:400,color:"#94A3B8"}};exports.default=function(n){var o=n.chatDetails,l=n.image,d=n.timestampFormat,u=void 0===d?"h:mm A | D MMM YYYY":d,g=n.maxWidthOfTextInPercent,h=void 0===g?60:g;n.slotClassname;var m=n.slotProps,c=n.slotStyles,x=n.renderers,_=r.highlightContent(o.message,[o.highlighted_text],"user-chat-highlight");return s.jsx("div",e.__assign({style:{maxWidth:"".concat(h,"%")}},{children:s.jsxs("div",e.__assign({style:a.rootRow},{children:[null!=l?l:s.jsx("span",e.__assign({style:a.avatar},{children:s.jsx("img",{src:t.default,alt:"CW Chat"})})),s.jsxs("div",e.__assign({style:a.contentColumn},{children:[s.jsx("p",e.__assign({style:e.__assign(e.__assign({},a.messageText),null==c?void 0:c.message)},null==m?void 0:m.message,{children:s.jsx(i.default,{content:_,renderers:x})})),s.jsxs("p",e.__assign({style:e.__assign(e.__assign({},a.footerText),null==c?void 0:c.footerText)},null==m?void 0:m.footerText,{children:[o.userName," |"," ",o.timeStamp.format(u)]}))]}))]}))}))};
2
2
  //# sourceMappingURL=AssistantChatItem.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n={container:{border:"1px solid #E2E8F0",padding:12,paddingBottom:0,borderRadius:8,height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column"},headerRow:{display:"flex",flexDirection:"row",gap:16,justifyContent:"space-between",alignItems:"center",height:18},leftRow:{display:"flex",flexDirection:"row",gap:12,alignItems:"center"},iconTitleRow:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},titleText:{fontSize:14,fontWeight:700,color:"#5928ED"},actionsRow:{display:"flex",flexDirection:"row",gap:6,alignItems:"center"},body:{paddingTop:12,paddingBottom:12,flex:1}};exports.default=function(t){var s=t.title,l=void 0===s?"User Chat":s,r=t.icon,o=t.slotStyles,a=t.primaryActions,d=t.secondaryActions,c=t.children;return i.jsxs("div",e.__assign({style:n.container},{children:[i.jsxs("div",e.__assign({style:n.headerRow},{children:[i.jsxs("div",e.__assign({style:n.leftRow},{children:[i.jsxs("div",e.__assign({style:n.iconTitleRow},{children:[i.jsx("span",{children:r}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},n.titleText),null==o?void 0:o.title)},{children:l}))]})),i.jsx("div",e.__assign({style:n.actionsRow},{children:null==a?void 0:a.filter(function(e){return void 0!==e}).map(function(e,n){return i.jsx("span",{children:e},n)})}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},n.actionsRow),{gap:16,alignItems:"center"})},{children:null==d?void 0:d.filter(function(e){return void 0!==e}).map(function(e,n){return i.jsx("span",{children:e},n)})}))]})),i.jsx("div",e.__assign({style:n.body,id:"body"},{children:c}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n={container:{border:"1px solid #E2E8F0",padding:12,paddingBottom:0,borderRadius:8,height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column"},headerRow:{display:"flex",flexDirection:"row",gap:16,justifyContent:"space-between",alignItems:"center",height:18},leftRow:{display:"flex",flexDirection:"row",gap:12,alignItems:"center"},iconTitleRow:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},titleText:{fontSize:14,fontWeight:700,color:"#5928ED"},actionsRow:{display:"flex",flexDirection:"row",gap:6,alignItems:"center"},body:{paddingTop:12,paddingBottom:12,flex:1}};exports.default=function(s){var t=s.title,o=void 0===t?"User Chat":t,r=s.icon,l=s.slotStyles,a=s.primaryActions,d=s.secondaryActions,c=s.children;return i.jsxs("div",e.__assign({style:n.container},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},n.headerRow),{overflowX:"auto",minHeight:"2.18rem",overflowY:"hidden",scrollbarWidth:"thin"})},{children:[i.jsxs("div",e.__assign({style:n.leftRow},{children:[i.jsxs("div",e.__assign({style:n.iconTitleRow},{children:[i.jsx("span",{children:r}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},n.titleText),null==l?void 0:l.title)},{children:o}))]})),i.jsx("div",e.__assign({style:n.actionsRow},{children:null==a?void 0:a.filter(function(e){return void 0!==e}).map(function(e,n){return i.jsx("span",{children:e},n)})}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},n.actionsRow),{gap:16,alignItems:"center"})},{children:null==d?void 0:d.filter(function(e){return void 0!==e}).map(function(e,n){return i.jsx("span",{children:e},n)})}))]})),i.jsx("div",e.__assign({style:n.body,id:"body"},{children:c}))]}))};
2
2
  //# sourceMappingURL=ChatCitation.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("@material-ui/icons/KeyboardArrowDown"),i=require("@material-ui/icons/KeyboardArrowUp");require("@material-ui/icons/Clear");var n=require("./IconContainer.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(t),a=o(i),u={container:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},counterText:{fontSize:12,fontWeight:500},icon:function(e){return{cursor:"pointer",color:e?"gray":"inherit",fontSize:"18px"}}};exports.default=function(t){var i=t.currentItemNumber,o=t.onNext,l=t.onPrevious,c=t.totalItems,d=t.disableNext,f=t.disablePrevious;return r.jsxs("span",e.__assign({style:u.container},{children:[r.jsxs("span",e.__assign({style:u.counterText},{children:[i," of ",c]})),r.jsx(n.default,e.__assign({onClick:l},{children:r.jsx(a.default,{style:u.icon(!!f)})})),r.jsx(n.default,e.__assign({onClick:o},{children:r.jsx(s.default,{style:u.icon(!!d)})}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("@mui/icons-material/KeyboardArrowDown"),i=require("@mui/icons-material/KeyboardArrowUp");require("@mui/icons-material/Clear");var n=require("./IconContainer.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(t),a=o(i),u={container:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},counterText:{fontSize:12,fontWeight:500},icon:function(e){return{cursor:"pointer",color:e?"gray":"inherit",fontSize:"18px"}}};exports.default=function(t){var i=t.currentItemNumber,o=t.onNext,l=t.onPrevious,c=t.totalItems,d=t.disableNext,f=t.disablePrevious;return r.jsxs("span",e.__assign({style:u.container},{children:[r.jsxs("span",e.__assign({style:u.counterText},{children:[i," of ",c]})),r.jsx(n.default,e.__assign({onClick:l},{children:r.jsx(a.default,{style:u.icon(!!f)})})),r.jsx(n.default,e.__assign({onClick:o},{children:r.jsx(s.default,{style:u.icon(!!d)})}))]}))};
2
2
  //# sourceMappingURL=InViewNavigation.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("@material-ui/icons"),s=require("./CodeCitationsStats.js"),l=require("../../../utils/codeCitations.utils.js"),a=require("@material-ui/core/Dialog"),n=require("@material-ui/core/IconButton"),o=require("@material-ui/core/DialogContent"),r=require("@material-ui/core/DialogTitle");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=d(a),g=d(n),h=d(o),u=d(r),c={body:{backgroundColor:"#fff",display:"flex",gap:"1rem",flexDirection:"row",paddingTop:"1rem",paddingRight:"1rem",paddingLeft:"1rem",minHeight:"60vh",maxWidth:"100%",overflow:"hidden"},leftSection:{display:"flex",flexDirection:"column",width:"50%",background:"#f6f6f6",borderRadius:"0.375rem",fontFamily:"Plus Jakarta Sans, sans-serif",overflowY:"scroll"},topLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},bottomLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},rightSection:{width:"50%",minHeight:"70vh",paddingLeft:"10px",backgroundColor:"#fff",zIndex:30}};exports.default=function(a){var n=a.open,o=a.onClose,r=a.title,d=a.customStyles,p=a.editorChildren,x=a.fileDetails,_=a.setHighlightIndexes,m=a.highlightCodeStatsLine,y=a.setHighlightCodeStatsLine,b=a.highlightCodeStatsVariable,v=a.setHighlightCodeStatsVariable,C=a.filepath,S=a.datasource,j=void 0===S?"codebase":S;return i.jsxs(f.default,e.__assign({open:n,onClose:o,maxWidth:"xl",fullWidth:!0,PaperProps:{style:e.__assign({},null==d?void 0:d.popupContainer)}},{children:[i.jsxs(u.default,e.__assign({style:(null==d?void 0:d.popupTitleContainer)||{fontFamily:"Plus Jakarta Sans, sans-serif",position:"relative",textAlign:"left",fontWeight:"bold"}},{children:[i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[i.jsx("span",e.__assign({style:{fontWeight:"bold",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:r})),i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"row",gap:"5px",fontSize:"0.875rem",color:"#666",marginTop:"0.25rem"}},{children:[i.jsx("span",e.__assign({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:"File path: "})),i.jsxs("span",e.__assign({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[" ",l.returnCitationTitle(C,j)]}))]}))]})),i.jsx(g.default,e.__assign({edge:"end",onClick:o,"aria-label":"close",style:{position:"absolute",top:5,right:16}},{children:i.jsx(t.Close,{})}))]})),i.jsxs(h.default,e.__assign({style:e.__assign(e.__assign({},c.body),null==d?void 0:d.body)},{children:[i.jsx("div",e.__assign({style:(null==d?void 0:d.leftSection)||c.leftSection},{children:i.jsx(s.default,{datasource:j,fileDetails:x,setHighlightIndexes:_,highlightCodeStatsLine:m,setHighlightCodeStatsLine:y,highlightCodeStatsVariable:b,setHighlightCodeStatsVariable:v})})),i.jsxs("div",e.__assign({style:c.rightSection},{children:[i.jsx("div",e.__assign({style:{minHeight:"4vh",fontWeight:"700",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:l.returnCodeTitle(j)})),i.jsx("div",e.__assign({style:{width:"100%",height:"100%"}},{children:p}))]}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("@mui/icons-material"),s=require("./CodeCitationsStats.js"),l=require("../../../utils/codeCitations.utils.js"),a=require("@mui/material/Dialog"),n=require("@mui/material/IconButton"),o=require("@mui/material/DialogContent"),r=require("@mui/material/DialogTitle");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=d(a),g=d(n),h=d(o),u=d(r),c={body:{backgroundColor:"#fff",display:"flex",gap:"1rem",flexDirection:"row",paddingTop:"1rem",paddingRight:"1rem",paddingLeft:"1rem",minHeight:"60vh",maxWidth:"100%",overflow:"hidden"},leftSection:{display:"flex",flexDirection:"column",width:"50%",background:"#f6f6f6",borderRadius:"0.375rem",fontFamily:"Plus Jakarta Sans, sans-serif",overflowY:"scroll"},topLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},bottomLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},rightSection:{width:"50%",minHeight:"70vh",paddingLeft:"10px",backgroundColor:"#fff",zIndex:30}};exports.default=function(a){var n=a.open,o=a.onClose,r=a.title,d=a.customStyles,p=a.editorChildren,x=a.fileDetails,m=a.setHighlightIndexes,_=a.highlightCodeStatsLine,y=a.setHighlightCodeStatsLine,b=a.highlightCodeStatsVariable,v=a.setHighlightCodeStatsVariable,C=a.filepath,S=a.datasource,j=void 0===S?"codebase":S;return i.jsxs(f.default,e.__assign({open:n,onClose:o,maxWidth:"xl",fullWidth:!0,PaperProps:{style:e.__assign({},null==d?void 0:d.popupContainer)}},{children:[i.jsxs(u.default,e.__assign({style:(null==d?void 0:d.popupTitleContainer)||{fontFamily:"Plus Jakarta Sans, sans-serif",position:"relative",textAlign:"left",fontWeight:"bold"}},{children:[i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[i.jsx("span",e.__assign({style:{fontWeight:"bold",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:r})),i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"row",gap:"5px",fontSize:"0.875rem",color:"#666",marginTop:"0.25rem"}},{children:[i.jsx("span",e.__assign({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:"File path: "})),i.jsxs("span",e.__assign({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[" ",l.returnCitationTitle(C,j)]}))]}))]})),i.jsx(g.default,e.__assign({edge:"end",onClick:o,"aria-label":"close",style:{position:"absolute",top:5,right:16},size:"large"},{children:i.jsx(t.Close,{})}))]})),i.jsxs(h.default,e.__assign({style:e.__assign(e.__assign({},c.body),null==d?void 0:d.body)},{children:[i.jsx("div",e.__assign({style:(null==d?void 0:d.leftSection)||c.leftSection},{children:i.jsx(s.default,{datasource:j,fileDetails:x,setHighlightIndexes:m,highlightCodeStatsLine:_,setHighlightCodeStatsLine:y,highlightCodeStatsVariable:b,setHighlightCodeStatsVariable:v})})),i.jsxs("div",e.__assign({style:c.rightSection},{children:[i.jsx("div",e.__assign({style:{minHeight:"4vh",fontWeight:"700",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:l.returnCodeTitle(j)})),i.jsx("div",e.__assign({style:{width:"100%",height:"100%"}},{children:p}))]}))]}))]}))};
2
2
  //# sourceMappingURL=CodeCitationPopup.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(require("@material-ui/core/CircularProgress"));exports.default=function(){return t.jsxs("div",e.__assign({role:"alert","aria-busy":"true","aria-label":"Loading content",style:{color:"#242424",display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem",height:"100vh",fontSize:"1rem",padding:"0 1rem",textAlign:"center"}},{children:[t.jsx(i.default,{size:24}),t.jsx("div",e.__assign({"aria-live":"polite"},{children:"Curating code and file statistics, please wait..."}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(require("@mui/material/CircularProgress"));exports.default=function(){return t.jsxs("div",e.__assign({role:"alert","aria-busy":"true","aria-label":"Loading content",style:{color:"#242424",display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem",height:"100vh",fontSize:"1rem",padding:"0 1rem",textAlign:"center"}},{children:[t.jsx(i.default,{size:24}),t.jsx("div",e.__assign({"aria-live":"polite"},{children:"Curating code and file statistics, please wait..."}))]}))};
2
2
  //# sourceMappingURL=Spinner.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("@material-ui/core/Tooltip"),i=require("@material-ui/core/styles");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=a(t),l=i.makeStyles(function(){return{tooltip:{fontFamily:"Plus Jakarta Sans, sans-serif",backgroundColor:"#555",color:"#fff",fontSize:12,padding:"5px 8px",borderRadius:6,maxWidth:250,textAlign:"center",whiteSpace:"normal",wordWrap:"break-word",lineHeight:1.4},arrow:{color:"#555"}}});exports.default=function(t){var i=t.description,a=t.children,n=l();return r.jsx(o.default,e.__assign({title:r.jsx("span",{children:i}),classes:{tooltip:n.tooltip,arrow:n.arrow},arrow:!0,placement:"top"},{children:r.jsx("span",e.__assign({style:{display:"inline-block"}},{children:a}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("@mui/material/Tooltip"),i=require("@mui/styles/makeStyles");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=a(t),l=a(i).default(function(){return{tooltip:{fontFamily:"Plus Jakarta Sans, sans-serif",backgroundColor:"#555",color:"#fff",fontSize:12,padding:"5px 8px",borderRadius:6,maxWidth:250,textAlign:"center",whiteSpace:"normal",wordWrap:"break-word",lineHeight:1.4},arrow:{color:"#555"}}});exports.default=function(t){var i=t.description,a=t.children,n=l();return r.jsx(o.default,e.__assign({title:r.jsx("span",{children:i}),classes:{tooltip:n.tooltip,arrow:n.arrow},arrow:!0,placement:"top"},{children:r.jsx("span",e.__assign({style:{display:"inline-block"}},{children:a}))}))};
2
2
  //# sourceMappingURL=TooltipComponent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react-virtualized-auto-sizer"),n=require("react-window"),r=require("@material-ui/core"),o=require("@material-ui/lab/Skeleton"),a=require("./paginatedTable.module.css.js"),s=require("react");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(t),c=l(o),f=l(s);exports.default=function(t){var o=t.headers,s=t.tableData,l=t.onNextPage,h=t.loadingMore,u=void 0!==h&&h,g=t.headerRefs,x=t.totalFileRecords,p=t.columnWidth,b=void 0===p?250:p,v=t.rowHeight,_=void 0===v?45:v,m=t.style,w=t.className,y=void 0===w?"":w,j=t.styleOverrides,R=void 0===j?{}:j,S=f.default.useRef(null),z=f.default.useCallback(function(e){var i=e.visibleStopIndex;x&&s.length>=x||!u&&i>=s.length-10&&l()},[u,s.length,l,x]),q=e.__assign({color:"#111827",fontFamily:"Inter, sans-serif",fontSize:"14px",cursor:"default",padding:"12px 24px",borderBottom:"1px solid #e5e7eb",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},R.dataRow),k=e.__assign({padding:"12px 24px",borderBottom:"1px solid #e5e7eb",fontWeight:"bold",color:"#374151",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},R.headerRow),C=f.default.useCallback(function(t){var n=t.index,r=t.style;if(u&&n===s.length)return i.jsx("div",e.__assign({style:e.__assign(e.__assign({},r),{display:"flex",width:"".concat(o.length*b,"px"),backgroundColor:n%2==0?"#ffffff":"#f9fafb"})},{children:o.map(function(t,n){var r=n===o.length-1;return i.jsx("div",e.__assign({style:{flex:"0 0 ".concat(b,"px"),padding:"12px 24px",borderBottom:"1px solid #e5e7eb",borderRight:r?"none":"1px solid #e5e7eb",boxSizing:"border-box"}},{children:i.jsx(c.default,{variant:"rect",width:"100%",height:20,className:"rounded-[0.25rem]",animation:"wave"})}),"loading-".concat(n))})}));var a=s[n],l=n%2==0;return i.jsx("div",e.__assign({style:e.__assign(e.__assign({},r),{display:"flex",width:"".concat(o.length*b,"px"),backgroundColor:l?"#ffffff":"#f9fafb"})},{children:o.map(function(t,r){var s=r===o.length-1;return function(t,n,r,o){return i.jsx("div",e.__assign({title:n[t],style:e.__assign({flex:"0 0 ".concat(b,"px"),position:"relative",borderRight:o?"none":"1px solid #e5e7eb",boxSizing:"border-box"},q)},{children:n[t]}),"".concat(t,"-").concat(r))}(t,a,n,s)})}))},[o,s,u]);return i.jsx(r.Paper,e.__assign({elevation:0,style:e.__assign({border:"1px solid #e5e7eb",borderRadius:"0",height:"65vh",minHeight:"425px",overflowY:"hidden",position:"relative"},m),className:"".concat(a.default.custom_scrollbar," ").concat(y)},{children:i.jsxs("div",e.__assign({style:{minWidth:"".concat(o.length*b,"px"),height:"100%"}},{children:[i.jsx("div",e.__assign({style:{display:"flex",backgroundColor:"#f9fafb",position:"sticky",top:0,zIndex:1,width:"".concat(o.length*b,"px")}},{children:o.map(function(t,n){var r=n===o.length-1;return i.jsx("div",e.__assign({ref:function(e){g.current[t]=e},style:e.__assign({borderRight:r?"none":"1px solid #e5e7eb",flex:"0 0 ".concat(b,"px"),boxSizing:"border-box"},k)},{children:t}),t)})})),i.jsx("div",e.__assign({style:{minHeight:"380px",height:"calc(60vh)",width:"100%"}},{children:i.jsx(d.default,{children:function(t){var r=t.height,o=t.width;return i.jsx(n.FixedSizeList,e.__assign({ref:S,height:r,width:o,itemCount:u?s.length+1:s.length,itemSize:_,onItemsRendered:z,overscanCount:20,style:{overflowX:"hidden"}},{children:C}))}})}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react-virtualized-auto-sizer"),n=require("react-window"),r=require("@mui/material"),o=require("@mui/material/Skeleton"),a=require("./paginatedTable.module.css.js"),s=require("react");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(t),c=l(o),f=l(s);exports.default=function(t){var o=t.headers,s=t.tableData,l=t.onNextPage,h=t.loadingMore,u=void 0!==h&&h,g=t.headerRefs,x=t.totalFileRecords,p=t.columnWidth,v=void 0===p?250:p,_=t.rowHeight,b=void 0===_?45:_,m=t.style,w=t.className,y=void 0===w?"":w,j=t.styleOverrides,R=void 0===j?{}:j,S=f.default.useRef(null),z=f.default.useCallback(function(e){var i=e.visibleStopIndex;x&&s.length>=x||!u&&i>=s.length-10&&l()},[u,s.length,l,x]),q=e.__assign({color:"#111827",fontFamily:"Inter, sans-serif",fontSize:"14px",cursor:"default",padding:"12px 24px",borderBottom:"1px solid #e5e7eb",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},R.dataRow),k=e.__assign({padding:"12px 24px",borderBottom:"1px solid #e5e7eb",fontWeight:"bold",color:"#374151",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},R.headerRow),C=f.default.useCallback(function(t){var n=t.index,r=t.style;if(u&&n===s.length)return i.jsx("div",e.__assign({style:e.__assign(e.__assign({},r),{display:"flex",width:"".concat(o.length*v,"px"),backgroundColor:n%2==0?"#ffffff":"#f9fafb"})},{children:o.map(function(t,n){var r=n===o.length-1;return i.jsx("div",e.__assign({style:{flex:"0 0 ".concat(v,"px"),padding:"12px 24px",borderBottom:"1px solid #e5e7eb",borderRight:r?"none":"1px solid #e5e7eb",boxSizing:"border-box"}},{children:i.jsx(c.default,{variant:"rectangular",width:"100%",height:20,className:"rounded-[0.25rem]",animation:"wave"})}),"loading-".concat(n))})}));var a=s[n],l=n%2==0;return i.jsx("div",e.__assign({style:e.__assign(e.__assign({},r),{display:"flex",width:"".concat(o.length*v,"px"),backgroundColor:l?"#ffffff":"#f9fafb"})},{children:o.map(function(t,r){var s=r===o.length-1;return function(t,n,r,o){return i.jsx("div",e.__assign({title:n[t],style:e.__assign({flex:"0 0 ".concat(v,"px"),position:"relative",borderRight:o?"none":"1px solid #e5e7eb",boxSizing:"border-box"},q)},{children:n[t]}),"".concat(t,"-").concat(r))}(t,a,n,s)})}))},[o,s,u]);return i.jsx(r.Paper,e.__assign({elevation:0,style:e.__assign({border:"1px solid #e5e7eb",borderRadius:"0",height:"65vh",minHeight:"425px",overflowY:"hidden",position:"relative"},m),className:"".concat(a.default.custom_scrollbar," ").concat(y)},{children:i.jsxs("div",e.__assign({style:{minWidth:"".concat(o.length*v,"px"),height:"100%"}},{children:[i.jsx("div",e.__assign({style:{display:"flex",backgroundColor:"#f9fafb",position:"sticky",top:0,zIndex:1,width:"".concat(o.length*v,"px")}},{children:o.map(function(t,n){var r=n===o.length-1;return i.jsx("div",e.__assign({ref:function(e){g.current[t]=e},style:e.__assign({borderRight:r?"none":"1px solid #e5e7eb",flex:"0 0 ".concat(v,"px"),boxSizing:"border-box"},k)},{children:t}),t)})})),i.jsx("div",e.__assign({style:{minHeight:"380px",height:"calc(60vh)",width:"100%"}},{children:i.jsx(d.default,{children:function(t){var r=t.height,o=t.width;return i.jsx(n.FixedSizeList,e.__assign({ref:S,height:r,width:o,itemCount:u?s.length+1:s.length,itemSize:b,onItemsRendered:z,overscanCount:20,style:{overflowX:"hidden"}},{children:C}))}})}))]}))}))};
2
2
  //# sourceMappingURL=PaginatedTable.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),a=require("react"),i=require("./PdfEditorCitation.module.css.js"),n=require("@material-ui/icons/ExpandLess"),s=require("@material-ui/icons/ExpandMore"),o=require("pdf-collaborative-tool");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=l(n),c=l(s);exports.PdfEditorCitation=function(n){var s=a.useState("collapsed"),l=s[0],d=s[1];return t.jsxs("div",e.__assign({className:"\n ".concat(i.default.citationRoot,"\n ").concat(n.citationRootClassName?n.citationRootClassName:"","\n ")},{children:[t.jsxs("div",e.__assign({className:"\n ".concat(i.default.citationTitle,"\n ").concat(n.citationTitleClassName?n.citationTitleClassName:"","\n "),onClick:function(){d("collapsed"===l?"expanded":"collapsed")}},{children:[n.citationTitleElement,"collapsed"===l?t.jsx(r.default,{}):t.jsx(c.default,{})]})),t.jsx("div",e.__assign({className:"\n ".concat(i.default.citationBody,"\n ").concat(n.citationBodyClassName?n.citationBodyClassName:"","\n ").concat("collapsed"===l?i.default.citationBodyWhenCollapsed:"","\n ").concat(n.citationBodyWhenCollapsedClassName?n.citationBodyWhenCollapsedClassName:"","\n ")},{children:t.jsx(o.PdfEditorContextProvider,e.__assign({backendBaseUrl:n.pdfEditorBackendBaseUrl,rlefEventServiceBaseUrl:n.rlefEventServiceBaseUrl,currentUserId:n.currentUserId,areAnnotationsVisibleByDefault:!0},{children:t.jsx(o.WakeupServersContextProvider,e.__assign({frontendHealthCheckUrl:""},{children:t.jsx(o.PdfEditor,{sentenceHighlightDetails:n.sentenceHighlightDetails,pdfDownloadUrl:n.pdfUrl})}))}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),a=require("react"),i=require("./PdfEditorCitation.module.css.js"),n=require("@mui/icons-material/ExpandLess"),s=require("@mui/icons-material/ExpandMore"),o=require("pdf-collaborative-tool");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=l(n),c=l(s);exports.PdfEditorCitation=function(n){var s=a.useState("collapsed"),l=s[0],d=s[1];return t.jsxs("div",e.__assign({className:"\n ".concat(i.default.citationRoot,"\n ").concat(n.citationRootClassName?n.citationRootClassName:"","\n ")},{children:[t.jsxs("div",e.__assign({className:"\n ".concat(i.default.citationTitle,"\n ").concat(n.citationTitleClassName?n.citationTitleClassName:"","\n "),onClick:function(){d("collapsed"===l?"expanded":"collapsed")}},{children:[n.citationTitleElement,"collapsed"===l?t.jsx(r.default,{}):t.jsx(c.default,{})]})),t.jsx("div",e.__assign({className:"\n ".concat(i.default.citationBody,"\n ").concat(n.citationBodyClassName?n.citationBodyClassName:"","\n ").concat("collapsed"===l?i.default.citationBodyWhenCollapsed:"","\n ").concat(n.citationBodyWhenCollapsedClassName?n.citationBodyWhenCollapsedClassName:"","\n ")},{children:t.jsx(o.PdfEditorContextProvider,e.__assign({backendBaseUrl:n.pdfEditorBackendBaseUrl,rlefEventServiceBaseUrl:n.rlefEventServiceBaseUrl,currentUserId:n.currentUserId,areAnnotationsVisibleByDefault:!0},{children:t.jsx(o.WakeupServersContextProvider,e.__assign({frontendHealthCheckUrl:""},{children:t.jsx(o.PdfEditor,{sentenceHighlightDetails:n.sentenceHighlightDetails,pdfDownloadUrl:n.pdfUrl})}))}))}))]}))};
2
2
  //# sourceMappingURL=PdfEditorCitation.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("./ProjectAccordion.module.css.js"),s=require("axios"),r=require("./_components/Markdown.js"),o=require("../CodeCitation/_components/TooltipComponent.js"),a=require("@material-ui/core/CircularProgress");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=l(s),u=l(a);exports.default=function(s){var a=s.baseUrl,l=s.taskId,d=s.execSummary,p=s.citationTitle,f=s.isDisabled,h=void 0!==f&&f,g=s.disabledText,v=void 0===g?"":g,m=s.isChecked,x=s.onCheckChange,_=s.customClickHandler,y=s.chevronDownComponent,j=s.chevronUpComponent,C=s.styles,k=n.useState(""),b=k[0],w=k[1],S=n.useState(!1),P=S[0],q=S[1],D=n.useState(!1),E=D[0],I=D[1],T=n.useState(!1),F=T[0],N=T[1],O=n.useState(!1),W=O[0],z=O[1],B=n.useState(""),H=B[0],M=B[1],R=n.useState(""),U=R[0],V=R[1],$=n.useRef(null),A=n.useState("0px"),G=A[0],J=A[1],K=null!=m?m:E,L=300,Q=function(e){x?x(e):I(e)};n.useEffect(function(){if(d){var t=d||"";M(t);var n=(null==t?void 0:t.match(/(\*\*Overview\*\*\s*[\s\S]*?)(?=\n\*\*|$)/))||[],i=(null==n?void 0:n.length)>=1?n[1].trim():null;V(i||t.slice(0,L)+"..."),w(t)}else e.__awaiter(void 0,void 0,void 0,function(){var t,n,i,s,r,o;return e.__generator(this,function(e){switch(e.label){case 0:N(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.default.get("".concat(a,"/analyzer/get_executive_summary?task_id=").concat(l))];case 2:return t=e.sent(),n=(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.summary)||"",M(n),i=null==n?void 0:n.match(/(\*\*Overview\*\*\s*[\s\S]*?)(?=\n\*\*|$)/),s=(null==i?void 0:i.length)>=1?i[1].trim():null,V(s||n.slice(0,L)+"..."),w(n),[3,4];case 3:return r=e.sent(),console.error("Error retrieving summary: ",r),w(""),[3,4];case 4:return N(!1),[2]}})})},[a,l]),n.useEffect(function(){P&&$.current?J("".concat($.current.scrollHeight,"px")):J("0px")},[P,b,W]);return t.jsxs(t.Fragment,{children:[t.jsx("div",e.__assign({className:i.default.pillButton,style:null==C?void 0:C.pillButton},{children:t.jsxs("div",e.__assign({style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",cursor:"pointer",gap:"0.5rem"},onClick:function(e){!function(e){e.preventDefault(),e.stopPropagation(),_&&_(e),q(!P)}(e)}},{children:[t.jsxs("label",e.__assign({style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"}},{children:[h?t.jsx(o.default,e.__assign({description:v},{children:t.jsx("input",{type:"checkbox",disabled:h,checked:K,onChange:function(e){return Q(e.target.checked)},style:null==C?void 0:C.checkbox,onClick:function(e){return e.stopPropagation()}})})):t.jsx("input",{type:"checkbox",disabled:h,checked:K,onChange:function(e){return Q(e.target.checked)},style:null==C?void 0:C.checkbox,onClick:function(e){return e.stopPropagation()}}),t.jsx("span",e.__assign({style:null==C?void 0:C.citationTitle},{children:p}))]})),P?j:y]}))})),P?t.jsx("div",e.__assign({className:i.default.citationWrapper,style:e.__assign({overflow:"hidden",transition:"height 0.3s ease",height:G},null==C?void 0:C.citationWrapper)},{children:t.jsx("div",e.__assign({ref:$,className:i.default.citationContent,style:null==C?void 0:C.citationContent,onClick:function(e){return e.stopPropagation()}},{children:F?t.jsxs("div",e.__assign({style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem"}},{children:[t.jsx(u.default,{size:24}),t.jsx("span",{children:" Retrieving project's executive summary..."})]})):t.jsxs(t.Fragment,{children:[t.jsx(r.default,{text:H?W||b.length<=L?b:""!==U?U:b.slice(0,L)+"...":"Executive summary not found."}),H&&b.length>L&&t.jsx("span",e.__assign({style:{color:"#4f46e5",cursor:"pointer",fontWeight:500},onClick:function(e){e.stopPropagation(),function(e){e.stopPropagation(),z(function(e){return!e})}(e)}},{children:W?"View less":"View more"}))]})}))})):t.jsx(t.Fragment,{})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("./ProjectAccordion.module.css.js"),s=require("axios"),r=require("./_components/Markdown.js"),o=require("../CodeCitation/_components/TooltipComponent.js"),a=require("@mui/material/CircularProgress");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=l(s),u=l(a);exports.default=function(s){var a=s.baseUrl,l=s.taskId,d=s.execSummary,p=s.citationTitle,f=s.isDisabled,h=void 0!==f&&f,g=s.disabledText,v=void 0===g?"":g,m=s.isChecked,x=s.onCheckChange,_=s.customClickHandler,y=s.chevronDownComponent,j=s.chevronUpComponent,C=s.styles,k=n.useState(""),b=k[0],w=k[1],S=n.useState(!1),P=S[0],q=S[1],D=n.useState(!1),E=D[0],I=D[1],T=n.useState(!1),F=T[0],N=T[1],O=n.useState(!1),W=O[0],z=O[1],B=n.useState(""),H=B[0],M=B[1],R=n.useState(""),U=R[0],V=R[1],$=n.useRef(null),A=n.useState("0px"),G=A[0],J=A[1],K=null!=m?m:E,L=300,Q=function(e){x?x(e):I(e)};n.useEffect(function(){if(d){var t=d||"";M(t);var n=(null==t?void 0:t.match(/(\*\*Overview\*\*\s*[\s\S]*?)(?=\n\*\*|$)/))||[],i=(null==n?void 0:n.length)>=1?n[1].trim():null;V(i||t.slice(0,L)+"..."),w(t)}else e.__awaiter(void 0,void 0,void 0,function(){var t,n,i,s,r,o;return e.__generator(this,function(e){switch(e.label){case 0:N(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.default.get("".concat(a,"/analyzer/get_executive_summary?task_id=").concat(l))];case 2:return t=e.sent(),n=(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.summary)||"",M(n),i=null==n?void 0:n.match(/(\*\*Overview\*\*\s*[\s\S]*?)(?=\n\*\*|$)/),s=(null==i?void 0:i.length)>=1?i[1].trim():null,V(s||n.slice(0,L)+"..."),w(n),[3,4];case 3:return r=e.sent(),console.error("Error retrieving summary: ",r),w(""),[3,4];case 4:return N(!1),[2]}})})},[a,l]),n.useEffect(function(){P&&$.current?J("".concat($.current.scrollHeight,"px")):J("0px")},[P,b,W]);return t.jsxs(t.Fragment,{children:[t.jsx("div",e.__assign({className:i.default.pillButton,style:null==C?void 0:C.pillButton},{children:t.jsxs("div",e.__assign({style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",cursor:"pointer",gap:"0.5rem"},onClick:function(e){!function(e){e.preventDefault(),e.stopPropagation(),_&&_(e),q(!P)}(e)}},{children:[t.jsxs("label",e.__assign({style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"}},{children:[h?t.jsx(o.default,e.__assign({description:v},{children:t.jsx("input",{type:"checkbox",disabled:h,checked:K,onChange:function(e){return Q(e.target.checked)},style:null==C?void 0:C.checkbox,onClick:function(e){return e.stopPropagation()}})})):t.jsx("input",{type:"checkbox",disabled:h,checked:K,onChange:function(e){return Q(e.target.checked)},style:null==C?void 0:C.checkbox,onClick:function(e){return e.stopPropagation()}}),t.jsx("span",e.__assign({style:null==C?void 0:C.citationTitle},{children:p}))]})),P?j:y]}))})),P?t.jsx("div",e.__assign({className:i.default.citationWrapper,style:e.__assign({overflow:"hidden",transition:"height 0.3s ease",height:G},null==C?void 0:C.citationWrapper)},{children:t.jsx("div",e.__assign({ref:$,className:i.default.citationContent,style:null==C?void 0:C.citationContent,onClick:function(e){return e.stopPropagation()}},{children:F?t.jsxs("div",e.__assign({style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem"}},{children:[t.jsx(u.default,{size:24}),t.jsx("span",{children:" Retrieving project's executive summary..."})]})):t.jsxs(t.Fragment,{children:[t.jsx(r.default,{text:H?W||b.length<=L?b:""!==U?U:b.slice(0,L)+"...":"Executive summary not found."}),H&&b.length>L&&t.jsx("span",e.__assign({style:{color:"#4f46e5",cursor:"pointer",fontWeight:500},onClick:function(e){e.stopPropagation(),function(e){e.stopPropagation(),z(function(e){return!e})}(e)}},{children:W?"View less":"View more"}))]})}))})):t.jsx(t.Fragment,{})]})};
2
2
  //# sourceMappingURL=ProjectAccordion.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("react/jsx-runtime"),n=require("../../CitationRenderer/CitationRenderer.js"),t=require("./components/AiReasoningCitationContent.js");exports.default=function(e){var o=e.title,a=e.aiReason,r=e.citationList,s=e.aiReasoningAccordionProps,c=e.projectDetails,l=e.cachingConfig,p=e.titleConfig,f=e.iconConfig,g=e.styles,u=e.citationStyles;return i.jsx(n.default,{inLineCitation:!0,citationTitle:o,citationIcon:i.jsx(i.Fragment,{}),citationComponent:i.jsx(t.default,{aiReason:a,citationsList:r,projectDetails:c,aiReasoningAccordionProps:s,cachingConfig:l,titleConfig:p,iconConfig:f,styles:g,citationStyles:u}),chevronDownComponent:i.jsx(function(){return i.jsx("i",{className:"pi pi-angle-down",style:{color:"#4B5563"}})},{}),chevronUpComponent:i.jsx(function(){return i.jsx("i",{className:"pi pi-angle-up",style:{color:"#4B5563"}})},{}),styles:{pillButton:{margin:"0px",padding:"2px 6px",fontSize:"15px",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",background:"#ffffffff",fontWeight:"700",border:"none"},citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}}})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react/jsx-runtime"),n=require("../../CitationRenderer/CitationRenderer.js"),e=require("./components/AiReasoningCitationContent.js"),i=require("./components/ChatCitationTestForAiReasoning.js");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=o(require("@mui/icons-material/ChatBubbleOutlineOutlined"));exports.default=function(o){var a=o.title,s=o.aiReason,c=o.citationList,l=o.aiReasoningAccordionProps,u=o.projectDetails,f=o.cachingConfig,p=o.titleConfig,d=o.iconConfig,g=o.styles,C=o.citationStyles;return t.jsx(n.default,{inLineCitation:!0,citationTitle:a,citationIcon:t.jsx(t.Fragment,{}),citationComponent:t.jsx(e.default,{renderCustomComponent:function(n){var e=n.close;return t.jsx(i.default,{closePreview:e})},CustomComponentIcon:function(){return t.jsx(r.default,{style:{fontSize:15}})},isCustomComponent:!0,aiReason:s,citationsList:c,projectDetails:u,aiReasoningAccordionProps:l,cachingConfig:f,titleConfig:p,iconConfig:d,styles:g,citationStyles:C}),chevronDownComponent:t.jsx(function(){return t.jsx("i",{className:"pi pi-angle-down",style:{color:"#4B5563"}})},{}),chevronUpComponent:t.jsx(function(){return t.jsx("i",{className:"pi pi-angle-up",style:{color:"#4B5563"}})},{}),styles:{pillButton:{margin:"0px",padding:"2px 6px",fontSize:"15px",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",background:"#ffffffff",fontWeight:"700",border:"none"},citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}}})};
2
2
  //# sourceMappingURL=AiReasoningCitation.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("react-markdown"),a=require("rehype-raw"),o=require("./AiReasonMarkdownWrapper.module.css.js"),s=require("./citationRenderers/ImageCitation.js"),l=require("./citationRenderers/FileCitation.js"),r=require("./citationRenderers/WebCitationWithImage.js"),d=require("../../../Bookemon/BookemonCitationLayer.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(n),_=c(a);exports.AiReasonMarkdownWrapper=function(n){var a=n.message,c=n.setOpenCitationType,h=n.setOpenCitationDetails,m=n.citationsList,v=n.projectDetails,f=n.citationIconConfig,p=t.useRef(null),g=t.useMemo(function(){return{h1:function(t){t.node;var n=e.__rest(t,["node"]);return i.jsx("h1",e.__assign({className:o.default.h1},{children:n.children}))},h2:function(t){t.node;var n=e.__rest(t,["node"]);return i.jsx("h2",e.__assign({className:o.default.h2},{children:n.children}))},h3:function(t){t.node;var n=e.__rest(t,["node"]);return i.jsx("h3",e.__assign({className:o.default.h3},{children:n.children}))},b:function(t){t.node;var n=e.__rest(t,["node"]);return i.jsx("b",e.__assign({className:o.default.bold},{children:n.children}))},p:function(t){t.node;var n=e.__rest(t,["node"]);return i.jsx("p",e.__assign({},n,{className:o.default.paragraph},{children:n.children}))},ol:function(t){t.node;var n=e.__rest(t,["node"]);return i.jsx("ol",e.__assign({className:o.default.orderedList},{children:n.children}))},ul:function(t){t.node;var n=e.__rest(t,["node"]);return i.jsx("ul",e.__assign({className:o.default.unorderedList},{children:n.children}))},a:function(n){var a,o,u,_,v,p,g,j;n.inline;var x=n.children;n.node;var b=e.__rest(n,["inline","children","node"]),k="".concat(null==b?void 0:b.href),y=null===(a=k.split("$"))||void 0===a?void 0:a[0],C=null===(o=k.split("$"))||void 0===o?void 0:o[1],M=("appmode_citation"===y?(null==m?void 0:m.appmod_citations)||[]:"image_citation"===y?(null==m?void 0:m.image_citations)||[]:"audio_citation"===y?(null==m?void 0:m.audio_citations)||[]:"document_citation"===y?(null==m?void 0:m.file_citations)||[]:"rca_citation"===y?(null==m?void 0:m.rca_citations)||[]:"web_citation"===y?(null==m?void 0:m.web_citations)||[]:"bookemon_citation"===y&&(null==m?void 0:m.bookemon_citations)||[]).find(function(e){return e.citation_number===C});if("image_citation"===(null==M?void 0:M.customMetadata.type))return i.jsx(t.Suspense,e.__assign({fallback:i.jsx(i.Fragment,{})},{children:i.jsx(s.default,{title:"".concat(x),citation:M,setOpenCitationType:c,setOpenCitationDetails:h,citationIcon:null==f?void 0:f.imageIcon})}));if("book_citation_doc"===(null===(u=null==M?void 0:M.customMetadata)||void 0===u?void 0:u.type)||"book_citation_pdf"===(null==M?void 0:M.customMetadata.type))return i.jsx(t.Suspense,e.__assign({fallback:i.jsx(i.Fragment,{})},{children:i.jsx(l.default,{title:"".concat(x),citation:M,setOpenCitationType:c,setOpenCitationDetails:h,citationIcon:null==f?void 0:f.fileIcon})}));if("web_citation"===(null===(_=null==M?void 0:M.customMetadata)||void 0===_?void 0:_.type)){if(null===(v=M.customMetadata)||void 0===v?void 0:v.screenshot_url)return i.jsx(r.default,{title:x,citation:M,setOpenCitationDetails:h,setOpenCitationType:c,citationIcon:null==f?void 0:f.webIcon})}else if("bookemon_citation"===(null===(p=null==M?void 0:M.customMetadata)||void 0===p?void 0:p.type))return i.jsx(t.Suspense,e.__assign({fallback:i.jsx(i.Fragment,{})},{children:i.jsx(d.default,{title:x,bookemonPayload:e.__assign(e.__assign({},M.customMetadata.bookemonPayload),{highlightTerms:(null===(g=M.customMetadata)||void 0===g?void 0:g.highlighted_text)?[null===(j=M.customMetadata)||void 0===j?void 0:j.highlighted_text]:M.customMetadata.bookemonPayload.highlightTerms})})}));return i.jsx(i.Fragment,{})},code:function(t){t.inline;var n=t.children,a=t.className;return/language-(\w+)/.exec(a||"")||(null==a?void 0:a.includes("language-"))?i.jsx("div",{children:i.jsx("code",e.__assign({className:o.default.blockCode},{children:n}))}):i.jsx("code",e.__assign({className:o.default.inlineCode},{children:n}))}}},[v,m]);return i.jsx("div",e.__assign({ref:p,className:o.default.wrapper},{children:i.jsx(u.default,e.__assign({components:g,rehypePlugins:[_.default]},{children:a}))}))};
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"),a=require("rehype-raw"),o=require("./AiReasonMarkdownWrapper.module.css.js"),s=require("./citationRenderers/ImageCitation.js"),l=require("./citationRenderers/FileCitation.js"),r=require("./citationRenderers/WebCitationWithImage.js"),c=require("../../../Bookemon/BookemonCitationLayer.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(t),_=d(a);exports.AiReasonMarkdownWrapper=function(t){var a=t.message,d=t.gap,p=t.setOpenCitationType,f=t.setOpenCitationDetails,m=t.citationsList,h=t.projectDetails,v=t.citationIconConfig,g=t.setSelectedIdFromReason;t.isCustomComponent;var x=t.relevance_score,j=t.CustomComponentIcon,b=i.useRef(null),y=function(e,n){return e<100?"The relevance score is ".concat(e,"% because:\n").concat(n):n},k=i.useMemo(function(){return{h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:o.default.h1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:o.default.h2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:o.default.h3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:o.default.bold},{children:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:o.default.paragraph},{children:t.children}))},ol:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ol",e.__assign({className:o.default.orderedList},{children:t.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:o.default.unorderedList},{children:t.children}))},a:function(t){var a,o,d,u,_,h,x,b,y;t.inline;var k=t.children;t.node;var C=e.__rest(t,["inline","children","node"]);if(!C.href)return n.jsx(n.Fragment,{children:k});var M="".concat(null==C?void 0:C.href),I=null===(a=M.split("$"))||void 0===a?void 0:a[0],N=null===(o=M.split("$"))||void 0===o?void 0:o[1],T=("appmode_citation"===I?(null==m?void 0:m.appmod_citations)||[]:"image_citation"===I?(null==m?void 0:m.image_citations)||[]:"audio_citation"===I?(null==m?void 0:m.audio_citations)||[]:"document_citation"===I?(null==m?void 0:m.file_citations)||[]:"rca_citation"===I?(null==m?void 0:m.rca_citations)||[]:"web_citation"===I?(null==m?void 0:m.web_citations)||[]:"bookemon_citation"===I?(null==m?void 0:m.bookemon_citations)||[]:"custom_citations"===I&&(null==m?void 0:m.custom_citations)||[]).find(function(e){return e.citation_number===N});if("image_citation"===(null==T?void 0:T.customMetadata.type))return n.jsx(i.Suspense,e.__assign({fallback:n.jsx(n.Fragment,{})},{children:n.jsx(s.default,{title:"".concat(k),citation:T,setOpenCitationType:p,setOpenCitationDetails:f,citationIcon:null==v?void 0:v.imageIcon})}));if("book_citation_doc"===(null===(d=null==T?void 0:T.customMetadata)||void 0===d?void 0:d.type)||"book_citation_pdf"===(null==T?void 0:T.customMetadata.type))return n.jsx(i.Suspense,e.__assign({fallback:n.jsx(n.Fragment,{})},{children:n.jsx(l.default,{title:"".concat(k),citation:T,setOpenCitationType:p,setOpenCitationDetails:f,citationIcon:null==v?void 0:v.fileIcon})}));if("web_citation"===(null===(u=null==T?void 0:T.customMetadata)||void 0===u?void 0:u.type)){if(null===(_=T.customMetadata)||void 0===_?void 0:_.screenshot_url)return n.jsx(r.default,{title:k,citation:T,setOpenCitationDetails:f,setOpenCitationType:p,citationIcon:null==v?void 0:v.webIcon})}else{if("bookemon_citation"===(null===(h=null==T?void 0:T.customMetadata)||void 0===h?void 0:h.type))return n.jsx(i.Suspense,e.__assign({fallback:n.jsx(n.Fragment,{})},{children:n.jsx(c.default,{title:k,bookemonPayload:e.__assign(e.__assign({},T.customMetadata.bookemonPayload),{highlightTerms:(null===(x=T.customMetadata)||void 0===x?void 0:x.highlighted_text)?[null===(b=T.customMetadata)||void 0===b?void 0:b.highlighted_text]:T.customMetadata.bookemonPayload.highlightTerms})})}));if("custom_citations"===(null===(y=null==T?void 0:T.customMetadata)||void 0===y?void 0:y.type))return n.jsxs("a",e.__assign({style:{textDecoration:"none",color:"#526eff",display:"inline-flex",alignItems:"center",gap:"4px"},href:C.href.startsWith("javascript:")?"#":C.href,onClick:function(e){e.preventDefault(),null==g||g(C.href),null==p||p("custom"),null==f||f(T)}},{children:[k,j&&n.jsx(j,{})]}))}return n.jsx(n.Fragment,{})},code:function(i){i.inline;var t=i.children,a=i.className;return/language-(\w+)/.exec(a||"")||(null==a?void 0:a.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:o.default.blockCode},{children:t}))}):n.jsx("code",e.__assign({className:o.default.inlineCode},{children:t}))}}},[h,m]);return n.jsxs("div",e.__assign({ref:b,className:o.default.wrapper},{children:[null==a?void 0:a.map(function(i,t){var a,s;return n.jsxs("div",e.__assign({style:{display:"flex",gap:"8px",alignItems:"flex-start",marginTop:2}},{children:[n.jsxs("span",e.__assign({style:{fontWeight:400,color:null!==(s=null===(a=o.default.paragraph)||void 0===a?void 0:a.color)&&void 0!==s?s:"black",marginTop:"2px",fontSize:"0.9rem"}},{children:[t+1,"."]})),n.jsx(u.default,e.__assign({components:k,rehypePlugins:[_.default]},{children:i}))]}),t)}),d&&d.map(function(i,t){var a,s;return n.jsxs("div",e.__assign({style:{display:"flex",gap:"8px",alignItems:"flex-start",marginTop:"16px"}},{children:[n.jsxs("span",e.__assign({style:{fontWeight:400,color:null!==(s=null===(a=o.default.paragraph)||void 0===a?void 0:a.color)&&void 0!==s?s:"black",marginTop:"2px",fontSize:"0.9rem"}},{children:[t+1,"."]})),n.jsx("div",{children:n.jsx("p",e.__assign({className:o.default.paragraph},{children:y(x||0,i)}))})]}),t)})]}))};
2
2
  //# sourceMappingURL=AiReasonMarkdownWrapper.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("./AiReasonMarkdownWrapper.js"),a=require("./AiReasoningCitationPreview.js"),t=require("./icons/AiReasoningIcon.js"),s=require("./AIConfidenceDisplay.js"),l=require("./AiReasonAccordion.js"),r=require("./icons/AiGapIcon.js"),c=require("./icons/ReasoningBulbIcon.js"),d=require("./AiReasoningCitationContent.module.css.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=u(n);exports.default=function(u){var p,g,f,j,x,y,C,h,_,A,R,m=u.aiReason,T=u.citationsList,I=u.projectDetails,W=u.aiReasoningAccordionProps,b=u.cachingConfig,q=u.iconConfig,D=u.titleConfig,P=u.styles,N=u.citationStyles,w=n.useState("noCitation"),L=w[0],M=w[1],O=n.useState(null),k=O[0],S=O[1],E="noCitation"!==L&&null!==k;return i.jsxs("div",e.__assign({className:d.default.container,style:null==P?void 0:P.container},{children:[i.jsxs("div",e.__assign({className:d.default.header,style:null==P?void 0:P.header},{children:[i.jsxs("div",e.__assign({className:d.default.headerLeft,style:null==P?void 0:P.headerLeft},{children:[(null==q?void 0:q.citationIcon)?v.default.createElement(q.citationIcon):i.jsx(t.default,{}),i.jsx("p",{children:null!==(p=null==D?void 0:D.titleText)&&void 0!==p?p:"Cognitive Decisioning AI"})]})),!isNaN(null==m?void 0:m.relevance_score)&&s.renderAIConfidenceDisplay(m.relevance_score,null==P?void 0:P.aiConfidenceDisplayPill)]})),i.jsxs("div",e.__assign({className:d.default.body,style:null==P?void 0:P.body},{children:[i.jsxs("div",e.__assign({className:"".concat(d.default.accordionWrapper," ").concat(E?d.default.withPreview:""),style:null==P?void 0:P.accordionWrapper},{children:[i.jsx(l.default,{icon:(null==q?void 0:q.reasoningIcon)?v.default.createElement(q.reasoningIcon):i.jsx("div",e.__assign({className:d.default.iconWrapper,style:null==P?void 0:P.iconWrapper},{children:i.jsx(c.default,{})})),title:null!==(f=null===(g=null==D?void 0:D.reason)||void 0===g?void 0:g.titleText)&&void 0!==f?f:"Reasoning",subTitle:null!==(x=null===(j=null==D?void 0:D.reason)||void 0===j?void 0:j.subTitleText)&&void 0!==x?x:"Why This Was Picked",content:i.jsx(o.AiReasonMarkdownWrapper,{message:m.reason,setOpenCitationType:M,setOpenCitationDetails:S,projectDetails:I,citationsList:T}),aiReasoningAccordionProps:W,styles:null==P?void 0:P.aiReasoningAccordian}),i.jsx(l.default,{icon:(null==q?void 0:q.gapIcon)?v.default.createElement(q.gapIcon):i.jsx("div",e.__assign({className:d.default.iconWrapper,style:null==P?void 0:P.iconWrapper},{children:i.jsx(r.default,{})})),title:null!==(C=null===(y=null==D?void 0:D.gap)||void 0===y?void 0:y.titleText)&&void 0!==C?C:"Gap",subTitle:null!==(_=null===(h=null==D?void 0:D.gap)||void 0===h?void 0:h.subTitleText)&&void 0!==_?_:"What's Missing or Unclear",content:i.jsx(o.AiReasonMarkdownWrapper,{message:(A=m.relevance_score,R=m.gap,A<100?"The relevance score is ".concat(A,"% because:\n").concat(R):R),setOpenCitationType:M,setOpenCitationDetails:S,projectDetails:I,citationsList:T}),aiReasoningAccordionProps:W,styles:null==P?void 0:P.aiReasoningAccordian})]})),E&&i.jsx(a.default,{openCitationType:L,openCitationDetails:k,handleCloseCitationPreview:function(){M("noCitation"),S(null)},cachingConfig:b,styles:null==P?void 0:P.citationPreview,citationStyles:N})]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("./AiReasonMarkdownWrapper.js"),t=require("./AiReasoningCitationPreview.js"),s=require("./icons/AiReasoningIcon.js"),a=require("./AIConfidenceDisplay.js"),l=require("./AiReasonAccordion.js"),r=require("./icons/AiGapIcon.js"),c=require("./icons/ReasoningBulbIcon.js"),d=require("./AiReasoningCitationContent.module.css.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=u(n);exports.default=function(u){var v,C,g,f,j,m,x,y,_,h=u.aiReason,A=u.citationsList,R=u.projectDetails,I=u.aiReasoningAccordionProps,T=u.cachingConfig,W=u.iconConfig,q=u.titleConfig,b=u.styles,D=u.citationStyles,P=u.renderCustomComponent,N=u.isCustomComponent,w=u.CustomComponentIcon,S=n.useState("noCitation"),L=S[0],M=S[1],O=n.useState(null),k=O[0],E=O[1],F=n.useState(null),G=F[0],B=F[1],U="noCitation"!==L&&null!==k;return i.jsxs("div",e.__assign({className:d.default.container,style:null==b?void 0:b.container},{children:[i.jsxs("div",e.__assign({className:d.default.header,style:null==b?void 0:b.header},{children:[i.jsxs("div",e.__assign({className:d.default.headerLeft,style:null==b?void 0:b.headerLeft},{children:[(null==W?void 0:W.citationIcon)?p.default.createElement(W.citationIcon):i.jsx(s.default,{}),i.jsx("p",{children:null!==(v=null==q?void 0:q.titleText)&&void 0!==v?v:"Cognitive Decisioning AI"})]})),!isNaN(null==h?void 0:h.relevance_score)&&a.renderAIConfidenceDisplay(h.relevance_score,null==b?void 0:b.aiConfidenceDisplayPill)]})),i.jsxs("div",e.__assign({className:d.default.body,style:null==b?void 0:b.body},{children:[i.jsxs("div",e.__assign({className:"".concat(d.default.accordionWrapper," ").concat(U?d.default.withPreview:""),style:null==b?void 0:b.accordionWrapper},{children:[i.jsx(l.default,{icon:(null==W?void 0:W.reasoningIcon)?p.default.createElement(W.reasoningIcon):i.jsx("div",e.__assign({className:d.default.iconWrapper,style:null==b?void 0:b.iconWrapper},{children:i.jsx(c.default,{})})),title:null!==(g=null===(C=null==q?void 0:q.reason)||void 0===C?void 0:C.titleText)&&void 0!==g?g:"Reasoning",subTitle:null!==(j=null===(f=null==q?void 0:q.reason)||void 0===f?void 0:f.subTitleText)&&void 0!==j?j:"Why This Was Picked",content:i.jsx(o.AiReasonMarkdownWrapper,{CustomComponentIcon:w,isCustomComponent:N||!1,setSelectedIdFromReason:B,message:h.reason,setOpenCitationType:M,setOpenCitationDetails:E,projectDetails:R,citationsList:A}),aiReasoningAccordionProps:I,styles:null==b?void 0:b.aiReasoningAccordian}),i.jsx(l.default,{icon:(null==W?void 0:W.gapIcon)?p.default.createElement(W.gapIcon):i.jsx("div",e.__assign({className:d.default.iconWrapper,style:null==b?void 0:b.iconWrapper},{children:i.jsx(r.default,{})})),title:null!==(x=null===(m=null==q?void 0:q.gap)||void 0===m?void 0:m.titleText)&&void 0!==x?x:"Gap",subTitle:null!==(_=null===(y=null==q?void 0:q.gap)||void 0===y?void 0:y.subTitleText)&&void 0!==_?_:"What's Missing or Unclear",content:i.jsx(o.AiReasonMarkdownWrapper,{relevance_score:h.relevance_score,gap:h.gap,setOpenCitationType:M,setOpenCitationDetails:E,projectDetails:R,citationsList:A}),aiReasoningAccordionProps:I,styles:null==b?void 0:b.aiReasoningAccordian})]})),U&&i.jsx(t.default,{isCustomComponent:N,selectedIdFromReason:G,renderCustomComponent:P,openCitationType:L,openCitationDetails:k,handleCloseCitationPreview:function(){M("noCitation"),E(null)},cachingConfig:T,styles:null==b?void 0:b.citationPreview,citationStyles:D})]}))]}))};
2
2
  //# sourceMappingURL=AiReasoningCitationContent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),i=require("react/jsx-runtime"),e=require("../../FileCitation/FileCitationContent.js"),o=require("../../ImageCitation/ImageCitationContent.js"),a=require("../../WebCitation/WebCitationWithImageContent.js"),n=require("./icons/CloseIcon.js"),l=require("./AiReasoningCitationPreview.module.css.js"),c=require("../../VideoCitation/VideoCitationContent.js");exports.default=function(s){var u,d,r,v,C,g,m,f,_,h,M,y=s.openCitationType,p=s.openCitationDetails,j=s.handleCloseCitationPreview,x=s.cachingConfig,P=s.styles,b=s.citationStyles;return i.jsx("div",t.__assign({className:l.default.container,style:null==P?void 0:P.container},{children:"file"===y?i.jsx(e.default,{title:"book_citation_doc"===p.citation.customMetadata.type||"book_citation_pdf"===p.citation.customMetadata.type?"".concat(null===(u=p.citation.customMetadata)||void 0===u?void 0:u.file_name):"",gsUtilPath:"book_citation_doc"===p.citation.customMetadata.type||"book_citation_pdf"===p.citation.customMetadata.type?(null===(d=p.citation.customMetadata)||void 0===d?void 0:d.gcs_upload_url)||(null===(r=p.citation.customMetadata)||void 0===r?void 0:r.highlighted_pdf_gsutil_url):"",relevanceScore:null===(v=p.citation.customMetadata)||void 0===v?void 0:v.relevance_score,cachingConfig:x,closeCitationConfig:{handleCloseCitationPreview:j,CloseIcon:function(){return i.jsx(n.default,{})}},styles:null==b?void 0:b.fileCitationStyles}):"image"===y?i.jsx(o.default,{gsUtilPath:"image_citation"===p.citation.customMetadata.type?p.citation.customMetadata.gs_util_url||p.citation.customMetadata.highlighted_image_gsutil_url:"",relevanceScore:null===(C=p.citation.customMetadata)||void 0===C?void 0:C.relevance_score,cachingConfig:x,closeCitationConfig:{handleCloseCitationPreview:j,CloseIcon:function(){return i.jsx(n.default,{})}},styles:null==b?void 0:b.imageCitationStyles}):"video"===y?i.jsx(c.default,{videoUrl:"video_citation"===p.citation.customMetadata.type?p.citation.customMetadata.video_url:"",gsUtilPath:"video_citation"===p.citation.customMetadata.type?p.citation.customMetadata.gs_util_url||p.citation.customMetadata.video_gsutil_url:"",citationTitle:(null===(g=p.citation.customMetadata)||void 0===g?void 0:g.file_name)||(null===(m=p.citation.customMetadata)||void 0===m?void 0:m.title)||"Video Reference",relevanceScore:null===(f=p.citation.customMetadata)||void 0===f?void 0:f.relevance_score,cachingConfig:x,closeCitationConfig:{handleCloseCitationPreview:j,CloseIcon:function(){return i.jsx(n.default,{})}},playerConfig:{controls:!0,playing:!1,loop:!1,muted:!1,volume:.8,width:"100%",height:"400px"},styles:null==b?void 0:b.videoCitationStyles}):"web"===y?i.jsx(a.default,{gsUtilPath:(null===(_=p.citation.customMetadata)||void 0===_?void 0:_.screenshot_url)||"",relevanceScore:(null===(h=p.citation.customMetadata)||void 0===h?void 0:h.relevance_score)||0,closeCitationConfig:{handleCloseCitationPreview:j,CloseIcon:function(){return i.jsx(n.default,{})}},url:(null===(M=p.citation.customMetadata)||void 0===M?void 0:M.link)||"",label:null==p?void 0:p.title,cachingConfig:x,visitIcon:function(){return i.jsx(i.Fragment,{})},PreviewDialogCloseIcon:function(){return i.jsx(n.default,{})},styles:null==b?void 0:b.webCitationStyles}):i.jsx(i.Fragment,{})}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),i=require("react/jsx-runtime"),e=require("../../FileCitation/FileCitationContent.js"),o=require("../../ImageCitation/ImageCitationContent.js"),a=require("../../WebCitation/WebCitationWithImageContent.js"),n=require("./icons/CloseIcon.js"),l=require("./AiReasoningCitationPreview.module.css.js"),c=require("../../VideoCitation/VideoCitationContent.js");exports.default=function(s){var d,u,r,v,C,m,g,_,f,h,M,p=s.openCitationType,y=s.openCitationDetails,j=s.handleCloseCitationPreview,x=s.cachingConfig,I=s.styles,P=s.citationStyles,b=s.renderCustomComponent,w=s.selectedIdFromReason;return s.isCustomComponent,i.jsx("div",t.__assign({className:l.default.container,style:null==I?void 0:I.container},{children:"file"===p?i.jsx(e.default,{title:"book_citation_doc"===y.citation.customMetadata.type||"book_citation_pdf"===y.citation.customMetadata.type?"".concat(null===(d=y.citation.customMetadata)||void 0===d?void 0:d.file_name):"",gsUtilPath:"book_citation_doc"===y.citation.customMetadata.type||"book_citation_pdf"===y.citation.customMetadata.type?(null===(u=y.citation.customMetadata)||void 0===u?void 0:u.gcs_upload_url)||(null===(r=y.citation.customMetadata)||void 0===r?void 0:r.highlighted_pdf_gsutil_url):"",relevanceScore:null===(v=y.citation.customMetadata)||void 0===v?void 0:v.relevance_score,cachingConfig:x,closeCitationConfig:{handleCloseCitationPreview:j,CloseIcon:function(){return i.jsx(n.default,{})}},styles:null==P?void 0:P.fileCitationStyles}):"image"===p?i.jsx(o.default,{gsUtilPath:"image_citation"===y.citation.customMetadata.type?y.citation.customMetadata.gs_util_url||y.citation.customMetadata.highlighted_image_gsutil_url:"",relevanceScore:null===(C=y.citation.customMetadata)||void 0===C?void 0:C.relevance_score,cachingConfig:x,closeCitationConfig:{handleCloseCitationPreview:j,CloseIcon:function(){return i.jsx(n.default,{})}},styles:null==P?void 0:P.imageCitationStyles}):"video"===p?i.jsx(c.default,{videoUrl:"video_citation"===y.citation.customMetadata.type?y.citation.customMetadata.video_url:"",gsUtilPath:"video_citation"===y.citation.customMetadata.type?y.citation.customMetadata.gs_util_url||y.citation.customMetadata.video_gsutil_url:"",citationTitle:(null===(m=y.citation.customMetadata)||void 0===m?void 0:m.file_name)||(null===(g=y.citation.customMetadata)||void 0===g?void 0:g.title)||"Video Reference",relevanceScore:null===(_=y.citation.customMetadata)||void 0===_?void 0:_.relevance_score,cachingConfig:x,closeCitationConfig:{handleCloseCitationPreview:j,CloseIcon:function(){return i.jsx(n.default,{})}},playerConfig:{controls:!0,playing:!1,loop:!1,muted:!1,volume:.8,width:"100%",height:"400px"},styles:null==P?void 0:P.videoCitationStyles}):"web"===p?i.jsx(a.default,{gsUtilPath:(null===(f=y.citation.customMetadata)||void 0===f?void 0:f.screenshot_url)||"",relevanceScore:(null===(h=y.citation.customMetadata)||void 0===h?void 0:h.relevance_score)||0,closeCitationConfig:{handleCloseCitationPreview:j,CloseIcon:function(){return i.jsx(n.default,{})}},url:(null===(M=y.citation.customMetadata)||void 0===M?void 0:M.link)||"",label:null==y?void 0:y.title,cachingConfig:x,visitIcon:function(){return i.jsx(i.Fragment,{})},PreviewDialogCloseIcon:function(){return i.jsx(n.default,{})},styles:null==P?void 0:P.webCitationStyles}):"custom"===p?i.jsx("div",t.__assign({className:l.default.container,style:null==I?void 0:I.container},{children:b&&(null==b?void 0:b({close:j,selectedIdFromReason:w}))})):i.jsx(i.Fragment,{})}))};
2
2
  //# sourceMappingURL=AiReasoningCitationPreview.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("../../../ChatCitation/ChatCitationRenderer.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(require("dayjs"));exports.default=function(i){var s=i.closePreview;return t.jsx("div",{children:t.jsx("div",e.__assign({style:{padding:16}},{children:t.jsx(r.default,{showRootContainer:!0,rootContainer:{relevanceScore:100,slotStyles:{container:{border:"",padding:"",color:"black"}}},chatContainer:{detailedTab:{chip:{isActive:!1,onClick:function(){return console.log("Detailed Tab Clicked")},styles:{cursor:"pointer",color:"black"}}},summarizedTab:{chip:{isActive:!0,show:!0}},chatData:[{role:"assistant",message:"Could you specify which types of rewards or benefits are relevant?",highlighted_text:"",timeStamp:a.default(),userName:"Creative Workspace"},{role:"user",message:"Redeeming points for available discounts",highlighted_text:"Redeeming points",timeStamp:a.default(),userName:"Sagnik Saha"},{role:"assistant",message:"Could you specify which types of rewards or benefits are relevant?",highlighted_text:"",timeStamp:a.default(),userName:"Creative Workspace"},{role:"user",message:"Redeeming points for available discounts",highlighted_text:"Redeeming points",timeStamp:a.default(),userName:"Sagnik Saha"},{role:"assistant",message:"Could you specify which types of rewards or benefits are relevant?",highlighted_text:"",timeStamp:a.default(),userName:"Creative Workspace"},{role:"user",message:"Redeeming points for available discounts",highlighted_text:"Redeeming points",timeStamp:a.default(),userName:"Sagnik Saha"}]},isRenderedCustomComponent:!0,ruleBookContainer:{data:{content:"#### Core Services <br> <br>\n- Towing services to the nearest repair facility based on member preference. <br> <br>\n- Fuel delivery when a member runs out of gas. <br> <br>\n- On-the-spot minor mechanical repairs to get members back on the road quickly. <br> <br>\n- Lockout services for members who accidentally lock their keys inside their vehicles. <br> <br>\n- Tire changes for flat tires using the member's spare tire. <br> <br>\n- Battery services, including jump-starts and replacements. <br> <br>",highlighted_texts:["Towing services","Fuel delivery","On-the-spot minor mechanical repairs","Lockout services","Tire changes","Battery services"]},slotStyles:{outerContainer:{margin:"0",color:"black"}}},reversePanels:!0,additionalData:{RuleBookDetailedViewVerticallyStacked:!0},closePreview:s})}))})};
2
+ //# sourceMappingURL=ChatCitationTestForAiReasoning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatCitationTestForAiReasoning.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}