@e-llm-studio/citation 0.0.231 → 0.0.232

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 (21) hide show
  1. package/README.md +47 -0
  2. package/dist/cjs/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
  3. package/dist/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
  4. package/dist/types/src/Spbanalysispaneltest.d.ts +3 -0
  5. package/dist/types/src/Spbanalysispaneltest.d.ts.map +1 -0
  6. package/dist/types/src/features/ChatCitation/InternalChatCitationRenderer.d.ts.map +1 -1
  7. package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +0 -1
  8. package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -1
  9. package/dist/types/src/features/SPBAnalysisPanel/Cognitivereasoningpanel.d.ts +22 -0
  10. package/dist/types/src/features/SPBAnalysisPanel/Cognitivereasoningpanel.d.ts.map +1 -0
  11. package/dist/types/src/features/SPBAnalysisPanel/DependencyGraph.d.ts +37 -0
  12. package/dist/types/src/features/SPBAnalysisPanel/DependencyGraph.d.ts.map +1 -0
  13. package/dist/types/src/features/SPBAnalysisPanel/Internaleditor.d.ts +11 -0
  14. package/dist/types/src/features/SPBAnalysisPanel/Internaleditor.d.ts.map +1 -0
  15. package/dist/types/src/features/SPBAnalysisPanel/Markdownrenderer.d.ts +10 -0
  16. package/dist/types/src/features/SPBAnalysisPanel/Markdownrenderer.d.ts.map +1 -0
  17. package/dist/types/src/features/SPBAnalysisPanel/Spbanalysispanel.d.ts +39 -0
  18. package/dist/types/src/features/SPBAnalysisPanel/Spbanalysispanel.d.ts.map +1 -0
  19. package/dist/types/src/features/SPBAnalysisPanel/index.d.ts +10 -0
  20. package/dist/types/src/features/SPBAnalysisPanel/index.d.ts.map +1 -0
  21. package/package.json +6 -1
package/README.md CHANGED
@@ -39,6 +39,7 @@
39
39
  -[ManageReminders](#ManageReminders) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ManageRemainders/README.md)
40
40
  - [PromptemonBlockViewer](#promptemonblockviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PromptemonBlockViewer/PromptemonBlockViewerReadme.md)
41
41
  - [PromptemonViewer](#promptemonviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PromptemonViewer/PromptemonViewerReadme.md)
42
+ - [SPBAnalysisPanel](#spbanalysispanel) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/SPBAnalysisPanel/SPBAnalysisPanel.md)
42
43
  4. [Common Use Cases](#common-use-cases)
43
44
  5. [Development & Contribution](#development--contribution)
44
45
  6. [License](#license)
@@ -3222,6 +3223,52 @@ import PromptemonViewer from '@e-llm-studio/citation/PromptemonViewer'
3222
3223
  | `showEditMode` | `boolean` | ❌ | `true` | Show/hide the edit pencil icon and edit mode |
3223
3224
  | `showExtractSegments` | `boolean` | ❌ | `true` | Show/hide the Extract Segments button and Show Segments toggle |
3224
3225
 
3226
+
3227
+ ## SPBAnalysisPanel
3228
+
3229
+ ### Overview
3230
+
3231
+ A full-featured interface for reviewing the analysis of a System Prompt Block (SPB). Combines a scrollable left panel — Overview, Functionality, Applicability, Specifications, and Dependency Graph — with an optional persistent Monaco-based right panel for viewing the underlying prompt content. Consumer-controlled — all analysis/data fetching is handled by the consumer.
3232
+
3233
+ ### Features
3234
+
3235
+ - **Overview summary** — Collapsible high-level + detailed summary
3236
+ - **Functionality breakdown** — Nested accordions listing functional areas and their APB references
3237
+ - **Jump-to-code navigation** — Clicking an APB reference highlights that section in the persistent right-side editor
3238
+ - **Applicability** — Side-by-side "When to apply" / "When NOT to apply" panels
3239
+ - **Specifications** — Strict Rules / Input / Output, with automatic `<code>` block extraction in Output
3240
+ - **Dependency Graph** — Interactive, pannable/zoomable graph of APB relationships
3241
+ - **Persistent code panel (optional)** — Dark/light toggle and fullscreen expand, togglable via `showCodePanel`
3242
+ - **Markdown + cognitive decisioning** — Text fields render through a shared markdown renderer supporting citations and expandable "cognitive reasoning" panels
3243
+
3244
+ ### Usage
3245
+
3246
+ ```tsx
3247
+ import SPBAnalysisPanel from '@e-llm-studio/citation/SPBAnalysisPanel'
3248
+
3249
+ <SPBAnalysisPanel
3250
+ promptContent={mySystemPrompt}
3251
+ promptTitle="Persona & Guardrails SPB"
3252
+ isLoading={isLoading}
3253
+ overviewSummary={overviewSummary}
3254
+ functionalityOfSPB={functionalityOfSPB}
3255
+ spbAdditionalInfo={spbAdditionalInfo}
3256
+ showCodePanel={true}
3257
+ />
3258
+ ```
3259
+
3260
+ ### Props
3261
+
3262
+ | Prop Name | Type | Required | Default | Description |
3263
+ |-----------|------|----------|---------|-------------|
3264
+ | `promptContent` | `string` | ✅ | — | Full system prompt text, rendered in the persistent/fullscreen editor |
3265
+ | `promptTitle` | `string` | ❌ | `"SPB Analysis"` | Title shown in the header and code panel top bar |
3266
+ | `isLoading` | `boolean` | ❌ | `false` | Shows skeletons for any section whose data prop is still empty |
3267
+ | `overviewSummary` | `SPBOverviewSummary \| null` | ❌ | — | Overview section content |
3268
+ | `functionalityOfSPB` | `SPBFunctionalityItem[]` | ❌ | `[]` | Functional areas and their APB references |
3269
+ | `spbAdditionalInfo` | `SPBAdditionalInfo \| null` | ❌ | — | Applicability, Specifications, and Dependency Graph content |
3270
+ | `showCodePanel` | `boolean` | ❌ | `true` | Show/hide the persistent right-side editor panel |
3271
+
3225
3272
  ## EmailCitation
3226
3273
 
3227
3274
  A composable React UI component for rendering email-style citations with rich formatting, attachments, and highlight/quote handling. Part of the `@e-llm-studio/citation` package, this component is designed to display email content (subject, sender, recipients, body, attachments, timestamps) in an expandable, accessible, and customizable way.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),i=require("./components/ChatCitation.js"),o=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"),d=require("./components/DetailedView.js"),s=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 p=g(require("@mui/icons-material/CloseOutlined")),b=function(e,l,i){if(void 0===i&&(i="smooth"),l){for(var o=e.parentElement;o;){var n=window.getComputedStyle(o).overflowY;if(("auto"===n||"scroll"===n)&&o.scrollHeight>o.clientHeight)break;if(o===l){o=null;break}o=o.parentElement}var t=null!=o?o:l,r=e.getBoundingClientRect(),d=t.getBoundingClientRect(),s=t.scrollTop+r.top-d.top-(t.clientHeight-r.height)/2;t.scrollTo({top:Math.max(0,s),behavior:i})}};exports.default=function(g){var x,m,y,_,C,w,S,j,k,q,A,T,D,R,F,z,B,E,I,P,H,V,M,N,W,Y,O,K,Q,U,G,J,L,X,Z,$,ee,le,ie,oe,ne,te,re,de,se,ae,ue,ve,ce=g.rootContainer,he=g.chatContainer,fe=void 0===he?{chatData:[]}:he,ge=g.ruleBookContainer,pe=g.renderer,be=g.additionalData,xe=g.tableComponent,me=g.closePreview,ye=g.isRenderedCustomComponent,_e=void 0!==ye&&ye,Ce=g.showRootContainer,we=void 0===Ce||Ce,Se=g.reversePanels,je=void 0!==Se&&Se,ke=u.useState(0),qe=ke[0],Ae=ke[1],Te=u.useState(0),De=Te[0],Re=Te[1],Fe=u.useState(0),ze=Fe[0],Be=Fe[1],Ee=u.useState(0),Ie=Ee[0],Pe=Ee[1],He=u.useRef(null),Ve=u.useRef(null),Me=u.useRef(null),Ne=u.useMemo(function(){return e.__assign(e.__assign({},v.defaultRenderer),pe)},[pe]),We=u.useMemo(function(){return!!((null==xe?void 0:xe.rows)&&Object.keys(xe.rows).length>0)},[xe]),Ye=u.useMemo(function(){var e;return null!==(e=null==be?void 0:be.RuleBookDetailedViewVerticallyStacked)&&void 0!==e&&e},[null==be?void 0:be.RuleBookDetailedViewVerticallyStacked]);u.useEffect(function(){var e,l;if((null==ge?void 0:ge.show)&&He.current){var i=null===(e=He.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(Ae((null==i?void 0:i.length)||0),Re(0),i&&i.length>0){var o=i[0];o.style.backgroundColor="#ffff5c",b(o,He.current)}}if((null==fe?void 0:fe.show)&&(null==Ve?void 0:Ve.current)){var n=null===(l=Ve.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Be((null==n?void 0:n.length)||0),Pe(0),n&&n.length>0){var t=n[0];t.style.backgroundColor="#ffff5c";var r=requestAnimationFrame(function(){b(t,Me.current)});return function(){return cancelAnimationFrame(r)}}}},[null==fe?void 0:fe.show,null==ge?void 0:ge.show,null==ge?void 0:ge.data,null==fe?void 0:fe.chatData]);var Oe=u.useCallback(function(){var e;if(De+1<qe){var l=null===(e=He.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(!l)return;l[De].style.backgroundColor="#ffffb8";var i=De+1;Re(i);var o=l[i];o.style.backgroundColor="#ffff5c",b(o,He.current)}},[De,qe]),Ke=u.useCallback(function(){var e;if(!(De-1<0)){var l=null===(e=He.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(l){l[De].style.backgroundColor="#ffffb8";var i=De-1,o=l[i];o.style.backgroundColor="#ffff5c",Re(i),b(o,He.current)}}},[De]),Qe=u.useCallback(function(){var e;if(Ie+1<ze){var l=null===(e=Ve.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(!l)return;l[Ie].style.backgroundColor="#ffffb8";var i=Ie+1,o=l[i];o.style.backgroundColor="#ffff5c",Pe(i),b(o,Me.current)}},[Ie,ze]),Ue=u.useCallback(function(){var e;if(!(Ie-1<0)){var l=null===(e=Ve.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(l){l[Ie].style.backgroundColor="#ffffb8";var i=Ie-1,o=l[i];o.style.backgroundColor="#ffff5c",Pe(i),b(o,Me.current)}}},[Ie]),Ge=o.getColorCode((null==ce?void 0:ce.relevanceScore)||0),Je=u.useMemo(function(){var i,o=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:Ge.border,backgroundColor:Ge.background,color:Ge.text},null===(i=null==ce?void 0:ce.slotStyles)||void 0===i?void 0:i.relevanceScore)},{children:[(null==ce?void 0:ce.relevanceTitle)||"Decision Strength",":"," ",(null==ce?void 0:ce.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:me},{children:l.jsx(p.default,{})}),"close-preview");return _e&&!(null==be?void 0:be.isExpanded)?[o,n]:[o]},[_e,Ge.background,Ge.border,Ge.text,null==ce?void 0:ce.relevanceScore,null===(x=null==ce?void 0:ce.slotStyles)||void 0===x?void 0:x.relevanceScore,null==ce?void 0:ce.relevanceTitle]),Le=u.useMemo(function(){return[qe>0&&l.jsx(r.default,{currentItemNumber:De+1,totalItems:qe,disableNext:De+1>=qe,onNext:Oe,onPrevious:Ke,disablePrevious:De<=0},"rulebook-nav")]},[De,Oe,Ke,qe]),Xe=u.useMemo(function(){return(null==be?void 0:be.RuleBookContainerHeight)?be.RuleBookContainerHeight:!(!Ye||(null==be?void 0:be.isExpanded))&&"600px"},[null==be?void 0:be.RuleBookContainerHeight,Ye]),Ze=u.useMemo(function(){var e,i;return[(null===(i=null===(e=null==fe?void 0:fe.detailedTab)||void 0===e?void 0:e.chip)||void 0===i?void 0:i.isActive)&&ze>0&&l.jsx(r.default,{currentItemNumber:Ie+1,totalItems:ze,onNext:Qe,onPrevious:Ue,disableNext:Ie+1>=ze,disablePrevious:Ie<=0},"chat-nav")]},[null===(y=null===(m=null==fe?void 0:fe.detailedTab)||void 0===m?void 0:m.chip)||void 0===y?void 0:y.isActive,Ie,Qe,Ue,ze]),$e=l.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:je?Ye?"column-reverse":"row-reverse":Ye?"column":"row",gap:[(null==fe?void 0:fe.chatData)&&fe.chatData.length>0&&(fe.show||void 0===fe.show),(null==ge?void 0:ge.data)&&(ge.show||void 0===ge.show),We].filter(Boolean).length>1?"12px":"0",height:Xe||"100%",minHeight:0},null===(_=null==ce?void 0:ce.slotStyles)||void 0===_?void 0:_.container)},{children:[We&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(C=null==fe?void 0:fe.slotStyles)||void 0===C?void 0:C.outerContainer)},{children:l.jsx(i.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==be?void 0:be.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==xe?void 0:xe.rows)&&l.jsx(f.BigQueryTable,{rows:xe.rows,columns:xe.columns||[]})}))}))})),(null==ge?void 0:ge.data)&&(ge.show||void 0===ge.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(w=null==ge?void 0:ge.slotStyles)||void 0===w?void 0:w.outerContainer)},{children:l.jsx(i.default,e.__assign({title:null!==(S=null==ge?void 0:ge.title)&&void 0!==S?S:"Rule book",icon:null==ge?void 0:ge.ruleBookIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(j=null==ge?void 0:ge.slotStyles)||void 0===j?void 0:j.title),body:null===(k=null==ge?void 0:ge.slotStyles)||void 0===k?void 0:k.body},secondaryActions:(null==ge?void 0:ge.secondaryActions)?ge.secondaryActions(Le):Le},{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===(q=null==ge?void 0:ge.slotStyles)||void 0===q?void 0:q.dataContainer)},{children:l.jsx("div",e.__assign({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:He},{children:l.jsx(a.default,{data:ge.data,renderers:null!==(A=null==ge?void 0:ge.renderer)&&void 0!==A?A:Ne})}))}))}))})),(null==fe?void 0:fe.chatData)&&fe.chatData.length>0&&(fe.show||void 0===fe.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(T=null==fe?void 0:fe.slotStyles)||void 0===T?void 0:T.outerContainer)},{children:l.jsx(i.default,e.__assign({title:null!==(D=null==fe?void 0:fe.title)&&void 0!==D?D:"Chat",icon:null==fe?void 0:fe.chatIcon,containerStyles:null===(R=null==fe?void 0:fe.slotStyles)||void 0===R?void 0:R.container,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(F=null==fe?void 0:fe.slotStyles)||void 0===F?void 0:F.title),body:null===(z=null==fe?void 0:fe.slotStyles)||void 0===z?void 0:z.body},primaryActions:[((null===(E=null===(B=null==fe?void 0:fe.summarizedTab)||void 0===B?void 0:B.chip)||void 0===E?void 0:E.show)||void 0===(null===(P=null===(I=null==fe?void 0:fe.summarizedTab)||void 0===I?void 0:I.chip)||void 0===P?void 0:P.show))&&l.jsx(n.default,e.__assign({label:"Summarized"},null===(H=null==fe?void 0:fe.summarizedTab)||void 0===H?void 0:H.chip)),l.jsx(n.default,e.__assign({label:"Detailed"},null===(V=null==fe?void 0:fe.detailedTab)||void 0===V?void 0:V.chip))],secondaryActions:fe.secondaryActions?null==fe?void 0:fe.secondaryActions(Ze):Ze},{children:l.jsxs("div",e.__assign({ref:Me,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===(M=null==fe?void 0:fe.slotStyles)||void 0===M?void 0:M.chatDataContainer)},{children:[(null===(W=null===(N=null==fe?void 0:fe.detailedTab)||void 0===N?void 0:N.chip)||void 0===W?void 0:W.isActive)&&l.jsx("div",e.__assign({ref:Ve,style:{position:(null==be?void 0:be.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:l.jsx(d.default,{chatData:null!==(Y=fe.chatData)&&void 0!==Y?Y:[],assistantChatProps:e.__assign(e.__assign({},null===(K=null===(O=null==fe?void 0:fe.detailedTab)||void 0===O?void 0:O.view)||void 0===K?void 0:K.assistantChatProps),{renderers:null!==(G=null===(U=null===(Q=null==fe?void 0:fe.detailedTab)||void 0===Q?void 0:Q.detailedViewRenderer)||void 0===U?void 0:U.assistantText)&&void 0!==G?G:Ne}),userChatItemProps:e.__assign(e.__assign({},null===(L=null===(J=null==fe?void 0:fe.detailedTab)||void 0===J?void 0:J.view)||void 0===L?void 0:L.userChatItemProps),{renderers:null!==($=null===(Z=null===(X=null==fe?void 0:fe.detailedTab)||void 0===X?void 0:X.detailedViewRenderer)||void 0===Z?void 0:Z.userText)&&void 0!==$?$:Ne})})})),(null===(le=null===(ee=null==fe?void 0:fe.summarizedTab)||void 0===ee?void 0:ee.chip)||void 0===le?void 0:le.show)&&(null===(oe=null===(ie=null==fe?void 0:fe.summarizedTab)||void 0===ie?void 0:ie.chip)||void 0===oe?void 0:oe.isActive)&&l.jsx(s.default,e.__assign({chatData:null!==(ne=fe.chatData)&&void 0!==ne?ne:[]},null===(te=null==fe?void 0:fe.summarizedTab)||void 0===te?void 0:te.view,{renderer:null!==(de=null===(re=null==fe?void 0:fe.summarizedTab)||void 0===re?void 0:re.summarizedViewRenderer)&&void 0!==de?de:Ne}))]}))}))}))]}));return we?l.jsx(i.default,e.__assign({title:null==ce?void 0:ce.title,slotStyles:{title:null===(se=null==ce?void 0:ce.slotStyles)||void 0===se?void 0:se.title,body:null===(ae=null==ce?void 0:ce.slotStyles)||void 0===ae?void 0:ae.body},containerStyles:null===(ue=null==ce?void 0:ce.slotStyles)||void 0===ue?void 0:ue.container,icon:null!==(ve=null==ce?void 0:ce.icon)&&void 0!==ve?ve:l.jsx(c.default,{children:l.jsx("img",{src:t.default,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==ce?void 0:ce.secondaryActions)?ce.secondaryActions(Je):Je},{children:$e})):$e};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),i=require("./components/ChatCitation.js"),o=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"),d=require("./components/DetailedView.js"),s=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 p=g(require("@mui/icons-material/CloseOutlined")),b=function(e,l,i){if(void 0===i&&(i="smooth"),l){for(var o=e.parentElement;o;){var n=window.getComputedStyle(o).overflowY;if(("auto"===n||"scroll"===n)&&o.scrollHeight>o.clientHeight)break;if(o===l){o=null;break}o=o.parentElement}var t=null!=o?o:l,r=e.getBoundingClientRect(),d=t.getBoundingClientRect(),s=t.scrollTop+r.top-d.top-(t.clientHeight-r.height)/2;t.scrollTo({top:Math.max(0,s),behavior:i})}},x={chatData:[]};exports.default=function(g){var m,y,_,C,w,S,j,k,q,A,T,D,R,F,z,B,E,I,P,H,V,M,N,W,Y,O,K,Q,U,G,J,L,X,Z,$,ee,le,ie,oe,ne,te,re,de,se,ae,ue,ve,ce,he=g.rootContainer,fe=g.chatContainer,ge=void 0===fe?x:fe,pe=g.ruleBookContainer,be=g.renderer,xe=g.additionalData,me=g.tableComponent,ye=g.closePreview,_e=g.isRenderedCustomComponent,Ce=void 0!==_e&&_e,we=g.showRootContainer,Se=void 0===we||we,je=g.reversePanels,ke=void 0!==je&&je,qe=u.useState(0),Ae=qe[0],Te=qe[1],De=u.useState(0),Re=De[0],Fe=De[1],ze=u.useState(0),Be=ze[0],Ee=ze[1],Ie=u.useState(0),Pe=Ie[0],He=Ie[1],Ve=u.useRef(null),Me=u.useRef(null),Ne=u.useRef(null),We=u.useMemo(function(){return e.__assign(e.__assign({},v.defaultRenderer),be)},[be]),Ye=u.useMemo(function(){return!!((null==me?void 0:me.rows)&&Object.keys(me.rows).length>0)},[me]),Oe=u.useMemo(function(){var e;return null!==(e=null==xe?void 0:xe.RuleBookDetailedViewVerticallyStacked)&&void 0!==e&&e},[null==xe?void 0:xe.RuleBookDetailedViewVerticallyStacked]);u.useEffect(function(){var e,l;if((null==pe?void 0:pe.show)&&Ve.current){var i=null===(e=Ve.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(Te((null==i?void 0:i.length)||0),Fe(0),i&&i.length>0){var o=i[0];o.style.backgroundColor="#ffff5c",b(o,Ve.current)}}if((null==ge?void 0:ge.show)&&(null==Me?void 0:Me.current)){var n=null===(l=Me.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Ee((null==n?void 0:n.length)||0),He(0),n&&n.length>0){var t=n[0];t.style.backgroundColor="#ffff5c";var r=requestAnimationFrame(function(){b(t,Ne.current)});return function(){return cancelAnimationFrame(r)}}}},[null==ge?void 0:ge.show,null==pe?void 0:pe.show,null==pe?void 0:pe.data,null==ge?void 0:ge.chatData]);var Ke=u.useCallback(function(){var e;if(Re+1<Ae){var l=null===(e=Ve.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(!l)return;l[Re].style.backgroundColor="#ffffb8";var i=Re+1;Fe(i);var o=l[i];o.style.backgroundColor="#ffff5c",b(o,Ve.current)}},[Re,Ae]),Qe=u.useCallback(function(){var e;if(!(Re-1<0)){var l=null===(e=Ve.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(l){l[Re].style.backgroundColor="#ffffb8";var i=Re-1,o=l[i];o.style.backgroundColor="#ffff5c",Fe(i),b(o,Ve.current)}}},[Re]),Ue=u.useCallback(function(){var e;if(Pe+1<Be){var l=null===(e=Me.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(!l)return;l[Pe].style.backgroundColor="#ffffb8";var i=Pe+1,o=l[i];o.style.backgroundColor="#ffff5c",He(i),b(o,Ne.current)}},[Pe,Be]),Ge=u.useCallback(function(){var e;if(!(Pe-1<0)){var l=null===(e=Me.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(l){l[Pe].style.backgroundColor="#ffffb8";var i=Pe-1,o=l[i];o.style.backgroundColor="#ffff5c",He(i),b(o,Ne.current)}}},[Pe]),Je=o.getColorCode((null==he?void 0:he.relevanceScore)||0),Le=u.useMemo(function(){var i,o=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:Je.border,backgroundColor:Je.background,color:Je.text},null===(i=null==he?void 0:he.slotStyles)||void 0===i?void 0:i.relevanceScore)},{children:[(null==he?void 0:he.relevanceTitle)||"Decision Strength",":"," ",(null==he?void 0:he.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:ye},{children:l.jsx(p.default,{})}),"close-preview");return Ce&&!(null==xe?void 0:xe.isExpanded)?[o,n]:[o]},[Ce,Je.background,Je.border,Je.text,null==he?void 0:he.relevanceScore,null===(m=null==he?void 0:he.slotStyles)||void 0===m?void 0:m.relevanceScore,null==he?void 0:he.relevanceTitle]),Xe=u.useMemo(function(){return[Ae>0&&l.jsx(r.default,{currentItemNumber:Re+1,totalItems:Ae,disableNext:Re+1>=Ae,onNext:Ke,onPrevious:Qe,disablePrevious:Re<=0},"rulebook-nav")]},[Re,Ke,Qe,Ae]),Ze=u.useMemo(function(){return(null==xe?void 0:xe.RuleBookContainerHeight)?xe.RuleBookContainerHeight:!(!Oe||(null==xe?void 0:xe.isExpanded))&&"600px"},[null==xe?void 0:xe.RuleBookContainerHeight,Oe]),$e=u.useMemo(function(){var e,i;return[(null===(i=null===(e=null==ge?void 0:ge.detailedTab)||void 0===e?void 0:e.chip)||void 0===i?void 0:i.isActive)&&Be>0&&l.jsx(r.default,{currentItemNumber:Pe+1,totalItems:Be,onNext:Ue,onPrevious:Ge,disableNext:Pe+1>=Be,disablePrevious:Pe<=0},"chat-nav")]},[null===(_=null===(y=null==ge?void 0:ge.detailedTab)||void 0===y?void 0:y.chip)||void 0===_?void 0:_.isActive,Pe,Ue,Ge,Be]),el=l.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:ke?Oe?"column-reverse":"row-reverse":Oe?"column":"row",gap:[(null==ge?void 0:ge.chatData)&&ge.chatData.length>0&&(ge.show||void 0===ge.show),(null==pe?void 0:pe.data)&&(pe.show||void 0===pe.show),Ye].filter(Boolean).length>1?"12px":"0",height:Ze||"100%",minHeight:0},null===(C=null==he?void 0:he.slotStyles)||void 0===C?void 0:C.container)},{children:[Ye&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(w=null==ge?void 0:ge.slotStyles)||void 0===w?void 0:w.outerContainer)},{children:l.jsx(i.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==xe?void 0:xe.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==me?void 0:me.rows)&&l.jsx(f.BigQueryTable,{rows:me.rows,columns:me.columns||[]})}))}))})),(null==pe?void 0:pe.data)&&(pe.show||void 0===pe.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(S=null==pe?void 0:pe.slotStyles)||void 0===S?void 0:S.outerContainer)},{children:l.jsx(i.default,e.__assign({title:null!==(j=null==pe?void 0:pe.title)&&void 0!==j?j:"Rule book",icon:null==pe?void 0:pe.ruleBookIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(k=null==pe?void 0:pe.slotStyles)||void 0===k?void 0:k.title),body:null===(q=null==pe?void 0:pe.slotStyles)||void 0===q?void 0:q.body},secondaryActions:(null==pe?void 0:pe.secondaryActions)?pe.secondaryActions(Xe):Xe},{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===(A=null==pe?void 0:pe.slotStyles)||void 0===A?void 0:A.dataContainer)},{children:l.jsx("div",e.__assign({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Ve},{children:l.jsx(a.default,{data:pe.data,renderers:null!==(T=null==pe?void 0:pe.renderer)&&void 0!==T?T:We})}))}))}))})),(null==ge?void 0:ge.chatData)&&ge.chatData.length>0&&(ge.show||void 0===ge.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(D=null==ge?void 0:ge.slotStyles)||void 0===D?void 0:D.outerContainer)},{children:l.jsx(i.default,e.__assign({title:null!==(R=null==ge?void 0:ge.title)&&void 0!==R?R:"Chat",icon:null==ge?void 0:ge.chatIcon,containerStyles:null===(F=null==ge?void 0:ge.slotStyles)||void 0===F?void 0:F.container,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(z=null==ge?void 0:ge.slotStyles)||void 0===z?void 0:z.title),body:null===(B=null==ge?void 0:ge.slotStyles)||void 0===B?void 0:B.body},primaryActions:[((null===(I=null===(E=null==ge?void 0:ge.summarizedTab)||void 0===E?void 0:E.chip)||void 0===I?void 0:I.show)||void 0===(null===(H=null===(P=null==ge?void 0:ge.summarizedTab)||void 0===P?void 0:P.chip)||void 0===H?void 0:H.show))&&l.jsx(n.default,e.__assign({label:"Summarized"},null===(V=null==ge?void 0:ge.summarizedTab)||void 0===V?void 0:V.chip)),l.jsx(n.default,e.__assign({label:"Detailed"},null===(M=null==ge?void 0:ge.detailedTab)||void 0===M?void 0:M.chip))],secondaryActions:ge.secondaryActions?null==ge?void 0:ge.secondaryActions($e):$e},{children:l.jsxs("div",e.__assign({ref:Ne,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===(N=null==ge?void 0:ge.slotStyles)||void 0===N?void 0:N.chatDataContainer)},{children:[(null===(Y=null===(W=null==ge?void 0:ge.detailedTab)||void 0===W?void 0:W.chip)||void 0===Y?void 0:Y.isActive)&&l.jsx("div",e.__assign({ref:Me,style:{position:(null==xe?void 0:xe.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:l.jsx(d.default,{chatData:null!==(O=ge.chatData)&&void 0!==O?O:[],assistantChatProps:e.__assign(e.__assign({},null===(Q=null===(K=null==ge?void 0:ge.detailedTab)||void 0===K?void 0:K.view)||void 0===Q?void 0:Q.assistantChatProps),{renderers:null!==(J=null===(G=null===(U=null==ge?void 0:ge.detailedTab)||void 0===U?void 0:U.detailedViewRenderer)||void 0===G?void 0:G.assistantText)&&void 0!==J?J:We}),userChatItemProps:e.__assign(e.__assign({},null===(X=null===(L=null==ge?void 0:ge.detailedTab)||void 0===L?void 0:L.view)||void 0===X?void 0:X.userChatItemProps),{renderers:null!==(ee=null===($=null===(Z=null==ge?void 0:ge.detailedTab)||void 0===Z?void 0:Z.detailedViewRenderer)||void 0===$?void 0:$.userText)&&void 0!==ee?ee:We})})})),(null===(ie=null===(le=null==ge?void 0:ge.summarizedTab)||void 0===le?void 0:le.chip)||void 0===ie?void 0:ie.show)&&(null===(ne=null===(oe=null==ge?void 0:ge.summarizedTab)||void 0===oe?void 0:oe.chip)||void 0===ne?void 0:ne.isActive)&&l.jsx(s.default,e.__assign({chatData:null!==(te=ge.chatData)&&void 0!==te?te:[]},null===(re=null==ge?void 0:ge.summarizedTab)||void 0===re?void 0:re.view,{renderer:null!==(se=null===(de=null==ge?void 0:ge.summarizedTab)||void 0===de?void 0:de.summarizedViewRenderer)&&void 0!==se?se:We}))]}))}))}))]}));return Se?l.jsx(i.default,e.__assign({title:null==he?void 0:he.title,slotStyles:{title:null===(ae=null==he?void 0:he.slotStyles)||void 0===ae?void 0:ae.title,body:null===(ue=null==he?void 0:he.slotStyles)||void 0===ue?void 0:ue.body},containerStyles:null===(ve=null==he?void 0:he.slotStyles)||void 0===ve?void 0:ve.container,icon:null!==(ce=null==he?void 0:he.icon)&&void 0!==ce?ce:l.jsx(c.default,{children:l.jsx("img",{src:t.default,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==he?void 0:he.secondaryActions)?he.secondaryActions(Le):Le},{children:el})):el};
2
2
  //# sourceMappingURL=InternalChatCitationRenderer.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as o}from"tslib";import{jsxs as l,jsx as i}from"react/jsx-runtime";import e from"./components/ChatCitation.js";import{getColorCode as n}from"./utils/helpers.js";import t from"./components/Chip.js";import r from"./assets/message-chat-square.svg.js";import"@mui/icons-material/KeyboardArrowDown";import"@mui/icons-material/KeyboardArrowUp";import"@mui/icons-material/Clear";import d from"./components/InViewNavigation.js";import a from"./components/DetailedView.js";import u from"./components/SummarizedView.js";import v from"./components/RuleBook.js";import{useState as s,useRef as c,useMemo as h,useEffect as f,useCallback as m}from"react";import{defaultRenderer as p}from"./constants/renderer.js";import g from"./components/IconContainer.js";import{Table as y}from"lucide-react";import{BigQueryTable as b}from"./BigQueryTable.js";import x from"@mui/icons-material/CloseOutlined";var w=function(o,l,i){if(void 0===i&&(i="smooth"),l){for(var e=o.parentElement;e;){var n=window.getComputedStyle(e).overflowY;if(("auto"===n||"scroll"===n)&&e.scrollHeight>e.clientHeight)break;if(e===l){e=null;break}e=e.parentElement}var t=null!=e?e:l,r=o.getBoundingClientRect(),d=t.getBoundingClientRect(),a=t.scrollTop+r.top-d.top-(t.clientHeight-r.height)/2;t.scrollTo({top:Math.max(0,a),behavior:i})}};function C(C){var S,k,A,D,T,R,F,j,z,I,B,E,H,P,V,q,N,W,Y,K,O,M,Q,U,G,J,L,X,Z,$,_,oo,lo,io,eo,no,to,ro,ao,uo,vo,so,co,ho,fo,mo,po,go,yo=C.rootContainer,bo=C.chatContainer,xo=void 0===bo?{chatData:[]}:bo,wo=C.ruleBookContainer,Co=C.renderer,So=C.additionalData,ko=C.tableComponent,Ao=C.closePreview,Do=C.isRenderedCustomComponent,To=void 0!==Do&&Do,Ro=C.showRootContainer,Fo=void 0===Ro||Ro,jo=C.reversePanels,zo=void 0!==jo&&jo,Io=s(0),Bo=Io[0],Eo=Io[1],Ho=s(0),Po=Ho[0],Vo=Ho[1],qo=s(0),No=qo[0],Wo=qo[1],Yo=s(0),Ko=Yo[0],Oo=Yo[1],Mo=c(null),Qo=c(null),Uo=c(null),Go=h(function(){return o(o({},p),Co)},[Co]),Jo=h(function(){return!!((null==ko?void 0:ko.rows)&&Object.keys(ko.rows).length>0)},[ko]),Lo=h(function(){var o;return null!==(o=null==So?void 0:So.RuleBookDetailedViewVerticallyStacked)&&void 0!==o&&o},[null==So?void 0:So.RuleBookDetailedViewVerticallyStacked]);f(function(){var o,l;if((null==wo?void 0:wo.show)&&Mo.current){var i=null===(o=Mo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(Eo((null==i?void 0:i.length)||0),Vo(0),i&&i.length>0){var e=i[0];e.style.backgroundColor="#ffff5c",w(e,Mo.current)}}if((null==xo?void 0:xo.show)&&(null==Qo?void 0:Qo.current)){var n=null===(l=Qo.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Wo((null==n?void 0:n.length)||0),Oo(0),n&&n.length>0){var t=n[0];t.style.backgroundColor="#ffff5c";var r=requestAnimationFrame(function(){w(t,Uo.current)});return function(){return cancelAnimationFrame(r)}}}},[null==xo?void 0:xo.show,null==wo?void 0:wo.show,null==wo?void 0:wo.data,null==xo?void 0:xo.chatData]);var Xo=m(function(){var o;if(Po+1<Bo){var l=null===(o=Mo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(!l)return;l[Po].style.backgroundColor="#ffffb8";var i=Po+1;Vo(i);var e=l[i];e.style.backgroundColor="#ffff5c",w(e,Mo.current)}},[Po,Bo]),Zo=m(function(){var o;if(!(Po-1<0)){var l=null===(o=Mo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(l){l[Po].style.backgroundColor="#ffffb8";var i=Po-1,e=l[i];e.style.backgroundColor="#ffff5c",Vo(i),w(e,Mo.current)}}},[Po]),$o=m(function(){var o;if(Ko+1<No){var l=null===(o=Qo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(!l)return;l[Ko].style.backgroundColor="#ffffb8";var i=Ko+1,e=l[i];e.style.backgroundColor="#ffff5c",Oo(i),w(e,Uo.current)}},[Ko,No]),_o=m(function(){var o;if(!(Ko-1<0)){var l=null===(o=Qo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(l){l[Ko].style.backgroundColor="#ffffb8";var i=Ko-1,e=l[i];e.style.backgroundColor="#ffff5c",Oo(i),w(e,Uo.current)}}},[Ko]),ol=n((null==yo?void 0:yo.relevanceScore)||0),ll=h(function(){var e,n=l("span",o({style:o({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:ol.border,backgroundColor:ol.background,color:ol.text},null===(e=null==yo?void 0:yo.slotStyles)||void 0===e?void 0:e.relevanceScore)},{children:[(null==yo?void 0:yo.relevanceTitle)||"Decision Strength",":"," ",(null==yo?void 0:yo.relevanceScore)||0,"%"]}),"relevance-score"),t=i("span",o({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:Ao},{children:i(x,{})}),"close-preview");return To&&!(null==So?void 0:So.isExpanded)?[n,t]:[n]},[To,ol.background,ol.border,ol.text,null==yo?void 0:yo.relevanceScore,null===(S=null==yo?void 0:yo.slotStyles)||void 0===S?void 0:S.relevanceScore,null==yo?void 0:yo.relevanceTitle]),il=h(function(){return[Bo>0&&i(d,{currentItemNumber:Po+1,totalItems:Bo,disableNext:Po+1>=Bo,onNext:Xo,onPrevious:Zo,disablePrevious:Po<=0},"rulebook-nav")]},[Po,Xo,Zo,Bo]),el=h(function(){return(null==So?void 0:So.RuleBookContainerHeight)?So.RuleBookContainerHeight:!(!Lo||(null==So?void 0:So.isExpanded))&&"600px"},[null==So?void 0:So.RuleBookContainerHeight,Lo]),nl=h(function(){var o,l;return[(null===(l=null===(o=null==xo?void 0:xo.detailedTab)||void 0===o?void 0:o.chip)||void 0===l?void 0:l.isActive)&&No>0&&i(d,{currentItemNumber:Ko+1,totalItems:No,onNext:$o,onPrevious:_o,disableNext:Ko+1>=No,disablePrevious:Ko<=0},"chat-nav")]},[null===(A=null===(k=null==xo?void 0:xo.detailedTab)||void 0===k?void 0:k.chip)||void 0===A?void 0:A.isActive,Ko,$o,_o,No]),tl=l("div",o({style:o({display:"flex",flexDirection:zo?Lo?"column-reverse":"row-reverse":Lo?"column":"row",gap:[(null==xo?void 0:xo.chatData)&&xo.chatData.length>0&&(xo.show||void 0===xo.show),(null==wo?void 0:wo.data)&&(wo.show||void 0===wo.show),Jo].filter(Boolean).length>1?"12px":"0",height:el||"100%",minHeight:0},null===(D=null==yo?void 0:yo.slotStyles)||void 0===D?void 0:D.container)},{children:[Jo&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(T=null==xo?void 0:xo.slotStyles)||void 0===T?void 0:T.outerContainer)},{children:i(e,o({title:"Invoice Data Preview",icon:i(g,{children:i(y,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:i("div",o({style:{height:"100%",maxHeight:(null==So?void 0:So.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==ko?void 0:ko.rows)&&i(b,{rows:ko.rows,columns:ko.columns||[]})}))}))})),(null==wo?void 0:wo.data)&&(wo.show||void 0===wo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(R=null==wo?void 0:wo.slotStyles)||void 0===R?void 0:R.outerContainer)},{children:i(e,o({title:null!==(F=null==wo?void 0:wo.title)&&void 0!==F?F:"Rule book",icon:null==wo?void 0:wo.ruleBookIcon,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(j=null==wo?void 0:wo.slotStyles)||void 0===j?void 0:j.title),body:null===(z=null==wo?void 0:wo.slotStyles)||void 0===z?void 0:z.body},secondaryActions:(null==wo?void 0:wo.secondaryActions)?wo.secondaryActions(il):il},{children:i("div",o({style:o({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===(I=null==wo?void 0:wo.slotStyles)||void 0===I?void 0:I.dataContainer)},{children:i("div",o({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Mo},{children:i(v,{data:wo.data,renderers:null!==(B=null==wo?void 0:wo.renderer)&&void 0!==B?B:Go})}))}))}))})),(null==xo?void 0:xo.chatData)&&xo.chatData.length>0&&(xo.show||void 0===xo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(E=null==xo?void 0:xo.slotStyles)||void 0===E?void 0:E.outerContainer)},{children:i(e,o({title:null!==(H=null==xo?void 0:xo.title)&&void 0!==H?H:"Chat",icon:null==xo?void 0:xo.chatIcon,containerStyles:null===(P=null==xo?void 0:xo.slotStyles)||void 0===P?void 0:P.container,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(V=null==xo?void 0:xo.slotStyles)||void 0===V?void 0:V.title),body:null===(q=null==xo?void 0:xo.slotStyles)||void 0===q?void 0:q.body},primaryActions:[((null===(W=null===(N=null==xo?void 0:xo.summarizedTab)||void 0===N?void 0:N.chip)||void 0===W?void 0:W.show)||void 0===(null===(K=null===(Y=null==xo?void 0:xo.summarizedTab)||void 0===Y?void 0:Y.chip)||void 0===K?void 0:K.show))&&i(t,o({label:"Summarized"},null===(O=null==xo?void 0:xo.summarizedTab)||void 0===O?void 0:O.chip)),i(t,o({label:"Detailed"},null===(M=null==xo?void 0:xo.detailedTab)||void 0===M?void 0:M.chip))],secondaryActions:xo.secondaryActions?null==xo?void 0:xo.secondaryActions(nl):nl},{children:l("div",o({ref:Uo,style:o({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(Q=null==xo?void 0:xo.slotStyles)||void 0===Q?void 0:Q.chatDataContainer)},{children:[(null===(G=null===(U=null==xo?void 0:xo.detailedTab)||void 0===U?void 0:U.chip)||void 0===G?void 0:G.isActive)&&i("div",o({ref:Qo,style:{position:(null==So?void 0:So.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:i(a,{chatData:null!==(J=xo.chatData)&&void 0!==J?J:[],assistantChatProps:o(o({},null===(X=null===(L=null==xo?void 0:xo.detailedTab)||void 0===L?void 0:L.view)||void 0===X?void 0:X.assistantChatProps),{renderers:null!==(_=null===($=null===(Z=null==xo?void 0:xo.detailedTab)||void 0===Z?void 0:Z.detailedViewRenderer)||void 0===$?void 0:$.assistantText)&&void 0!==_?_:Go}),userChatItemProps:o(o({},null===(lo=null===(oo=null==xo?void 0:xo.detailedTab)||void 0===oo?void 0:oo.view)||void 0===lo?void 0:lo.userChatItemProps),{renderers:null!==(no=null===(eo=null===(io=null==xo?void 0:xo.detailedTab)||void 0===io?void 0:io.detailedViewRenderer)||void 0===eo?void 0:eo.userText)&&void 0!==no?no:Go})})})),(null===(ro=null===(to=null==xo?void 0:xo.summarizedTab)||void 0===to?void 0:to.chip)||void 0===ro?void 0:ro.show)&&(null===(uo=null===(ao=null==xo?void 0:xo.summarizedTab)||void 0===ao?void 0:ao.chip)||void 0===uo?void 0:uo.isActive)&&i(u,o({chatData:null!==(vo=xo.chatData)&&void 0!==vo?vo:[]},null===(so=null==xo?void 0:xo.summarizedTab)||void 0===so?void 0:so.view,{renderer:null!==(ho=null===(co=null==xo?void 0:xo.summarizedTab)||void 0===co?void 0:co.summarizedViewRenderer)&&void 0!==ho?ho:Go}))]}))}))}))]}));return Fo?i(e,o({title:null==yo?void 0:yo.title,slotStyles:{title:null===(fo=null==yo?void 0:yo.slotStyles)||void 0===fo?void 0:fo.title,body:null===(mo=null==yo?void 0:yo.slotStyles)||void 0===mo?void 0:mo.body},containerStyles:null===(po=null==yo?void 0:yo.slotStyles)||void 0===po?void 0:po.container,icon:null!==(go=null==yo?void 0:yo.icon)&&void 0!==go?go:i(g,{children:i("img",{src:r,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==yo?void 0:yo.secondaryActions)?yo.secondaryActions(ll):ll},{children:tl})):tl}export{C as default};
1
+ import{__assign as o}from"tslib";import{jsxs as l,jsx as i}from"react/jsx-runtime";import e from"./components/ChatCitation.js";import{getColorCode as n}from"./utils/helpers.js";import t from"./components/Chip.js";import r from"./assets/message-chat-square.svg.js";import"@mui/icons-material/KeyboardArrowDown";import"@mui/icons-material/KeyboardArrowUp";import"@mui/icons-material/Clear";import d from"./components/InViewNavigation.js";import a from"./components/DetailedView.js";import u from"./components/SummarizedView.js";import v from"./components/RuleBook.js";import{useState as s,useRef as c,useMemo as h,useEffect as f,useCallback as m}from"react";import{defaultRenderer as p}from"./constants/renderer.js";import g from"./components/IconContainer.js";import{Table as y}from"lucide-react";import{BigQueryTable as b}from"./BigQueryTable.js";import x from"@mui/icons-material/CloseOutlined";var w=function(o,l,i){if(void 0===i&&(i="smooth"),l){for(var e=o.parentElement;e;){var n=window.getComputedStyle(e).overflowY;if(("auto"===n||"scroll"===n)&&e.scrollHeight>e.clientHeight)break;if(e===l){e=null;break}e=e.parentElement}var t=null!=e?e:l,r=o.getBoundingClientRect(),d=t.getBoundingClientRect(),a=t.scrollTop+r.top-d.top-(t.clientHeight-r.height)/2;t.scrollTo({top:Math.max(0,a),behavior:i})}},C={chatData:[]};function S(S){var k,A,D,T,R,F,j,z,I,B,E,H,P,V,q,N,W,Y,K,O,M,Q,U,G,J,L,X,Z,$,_,oo,lo,io,eo,no,to,ro,ao,uo,vo,so,co,ho,fo,mo,po,go,yo,bo=S.rootContainer,xo=S.chatContainer,wo=void 0===xo?C:xo,Co=S.ruleBookContainer,So=S.renderer,ko=S.additionalData,Ao=S.tableComponent,Do=S.closePreview,To=S.isRenderedCustomComponent,Ro=void 0!==To&&To,Fo=S.showRootContainer,jo=void 0===Fo||Fo,zo=S.reversePanels,Io=void 0!==zo&&zo,Bo=s(0),Eo=Bo[0],Ho=Bo[1],Po=s(0),Vo=Po[0],qo=Po[1],No=s(0),Wo=No[0],Yo=No[1],Ko=s(0),Oo=Ko[0],Mo=Ko[1],Qo=c(null),Uo=c(null),Go=c(null),Jo=h(function(){return o(o({},p),So)},[So]),Lo=h(function(){return!!((null==Ao?void 0:Ao.rows)&&Object.keys(Ao.rows).length>0)},[Ao]),Xo=h(function(){var o;return null!==(o=null==ko?void 0:ko.RuleBookDetailedViewVerticallyStacked)&&void 0!==o&&o},[null==ko?void 0:ko.RuleBookDetailedViewVerticallyStacked]);f(function(){var o,l;if((null==Co?void 0:Co.show)&&Qo.current){var i=null===(o=Qo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(Ho((null==i?void 0:i.length)||0),qo(0),i&&i.length>0){var e=i[0];e.style.backgroundColor="#ffff5c",w(e,Qo.current)}}if((null==wo?void 0:wo.show)&&(null==Uo?void 0:Uo.current)){var n=null===(l=Uo.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Yo((null==n?void 0:n.length)||0),Mo(0),n&&n.length>0){var t=n[0];t.style.backgroundColor="#ffff5c";var r=requestAnimationFrame(function(){w(t,Go.current)});return function(){return cancelAnimationFrame(r)}}}},[null==wo?void 0:wo.show,null==Co?void 0:Co.show,null==Co?void 0:Co.data,null==wo?void 0:wo.chatData]);var Zo=m(function(){var o;if(Vo+1<Eo){var l=null===(o=Qo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(!l)return;l[Vo].style.backgroundColor="#ffffb8";var i=Vo+1;qo(i);var e=l[i];e.style.backgroundColor="#ffff5c",w(e,Qo.current)}},[Vo,Eo]),$o=m(function(){var o;if(!(Vo-1<0)){var l=null===(o=Qo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(l){l[Vo].style.backgroundColor="#ffffb8";var i=Vo-1,e=l[i];e.style.backgroundColor="#ffff5c",qo(i),w(e,Qo.current)}}},[Vo]),_o=m(function(){var o;if(Oo+1<Wo){var l=null===(o=Uo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(!l)return;l[Oo].style.backgroundColor="#ffffb8";var i=Oo+1,e=l[i];e.style.backgroundColor="#ffff5c",Mo(i),w(e,Go.current)}},[Oo,Wo]),ol=m(function(){var o;if(!(Oo-1<0)){var l=null===(o=Uo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(l){l[Oo].style.backgroundColor="#ffffb8";var i=Oo-1,e=l[i];e.style.backgroundColor="#ffff5c",Mo(i),w(e,Go.current)}}},[Oo]),ll=n((null==bo?void 0:bo.relevanceScore)||0),il=h(function(){var e,n=l("span",o({style:o({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:ll.border,backgroundColor:ll.background,color:ll.text},null===(e=null==bo?void 0:bo.slotStyles)||void 0===e?void 0:e.relevanceScore)},{children:[(null==bo?void 0:bo.relevanceTitle)||"Decision Strength",":"," ",(null==bo?void 0:bo.relevanceScore)||0,"%"]}),"relevance-score"),t=i("span",o({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:Do},{children:i(x,{})}),"close-preview");return Ro&&!(null==ko?void 0:ko.isExpanded)?[n,t]:[n]},[Ro,ll.background,ll.border,ll.text,null==bo?void 0:bo.relevanceScore,null===(k=null==bo?void 0:bo.slotStyles)||void 0===k?void 0:k.relevanceScore,null==bo?void 0:bo.relevanceTitle]),el=h(function(){return[Eo>0&&i(d,{currentItemNumber:Vo+1,totalItems:Eo,disableNext:Vo+1>=Eo,onNext:Zo,onPrevious:$o,disablePrevious:Vo<=0},"rulebook-nav")]},[Vo,Zo,$o,Eo]),nl=h(function(){return(null==ko?void 0:ko.RuleBookContainerHeight)?ko.RuleBookContainerHeight:!(!Xo||(null==ko?void 0:ko.isExpanded))&&"600px"},[null==ko?void 0:ko.RuleBookContainerHeight,Xo]),tl=h(function(){var o,l;return[(null===(l=null===(o=null==wo?void 0:wo.detailedTab)||void 0===o?void 0:o.chip)||void 0===l?void 0:l.isActive)&&Wo>0&&i(d,{currentItemNumber:Oo+1,totalItems:Wo,onNext:_o,onPrevious:ol,disableNext:Oo+1>=Wo,disablePrevious:Oo<=0},"chat-nav")]},[null===(D=null===(A=null==wo?void 0:wo.detailedTab)||void 0===A?void 0:A.chip)||void 0===D?void 0:D.isActive,Oo,_o,ol,Wo]),rl=l("div",o({style:o({display:"flex",flexDirection:Io?Xo?"column-reverse":"row-reverse":Xo?"column":"row",gap:[(null==wo?void 0:wo.chatData)&&wo.chatData.length>0&&(wo.show||void 0===wo.show),(null==Co?void 0:Co.data)&&(Co.show||void 0===Co.show),Lo].filter(Boolean).length>1?"12px":"0",height:nl||"100%",minHeight:0},null===(T=null==bo?void 0:bo.slotStyles)||void 0===T?void 0:T.container)},{children:[Lo&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(R=null==wo?void 0:wo.slotStyles)||void 0===R?void 0:R.outerContainer)},{children:i(e,o({title:"Invoice Data Preview",icon:i(g,{children:i(y,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:i("div",o({style:{height:"100%",maxHeight:(null==ko?void 0:ko.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==Ao?void 0:Ao.rows)&&i(b,{rows:Ao.rows,columns:Ao.columns||[]})}))}))})),(null==Co?void 0:Co.data)&&(Co.show||void 0===Co.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(F=null==Co?void 0:Co.slotStyles)||void 0===F?void 0:F.outerContainer)},{children:i(e,o({title:null!==(j=null==Co?void 0:Co.title)&&void 0!==j?j:"Rule book",icon:null==Co?void 0:Co.ruleBookIcon,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(z=null==Co?void 0:Co.slotStyles)||void 0===z?void 0:z.title),body:null===(I=null==Co?void 0:Co.slotStyles)||void 0===I?void 0:I.body},secondaryActions:(null==Co?void 0:Co.secondaryActions)?Co.secondaryActions(el):el},{children:i("div",o({style:o({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===(B=null==Co?void 0:Co.slotStyles)||void 0===B?void 0:B.dataContainer)},{children:i("div",o({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Qo},{children:i(v,{data:Co.data,renderers:null!==(E=null==Co?void 0:Co.renderer)&&void 0!==E?E:Jo})}))}))}))})),(null==wo?void 0:wo.chatData)&&wo.chatData.length>0&&(wo.show||void 0===wo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(H=null==wo?void 0:wo.slotStyles)||void 0===H?void 0:H.outerContainer)},{children:i(e,o({title:null!==(P=null==wo?void 0:wo.title)&&void 0!==P?P:"Chat",icon:null==wo?void 0:wo.chatIcon,containerStyles:null===(V=null==wo?void 0:wo.slotStyles)||void 0===V?void 0:V.container,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(q=null==wo?void 0:wo.slotStyles)||void 0===q?void 0:q.title),body:null===(N=null==wo?void 0:wo.slotStyles)||void 0===N?void 0:N.body},primaryActions:[((null===(Y=null===(W=null==wo?void 0:wo.summarizedTab)||void 0===W?void 0:W.chip)||void 0===Y?void 0:Y.show)||void 0===(null===(O=null===(K=null==wo?void 0:wo.summarizedTab)||void 0===K?void 0:K.chip)||void 0===O?void 0:O.show))&&i(t,o({label:"Summarized"},null===(M=null==wo?void 0:wo.summarizedTab)||void 0===M?void 0:M.chip)),i(t,o({label:"Detailed"},null===(Q=null==wo?void 0:wo.detailedTab)||void 0===Q?void 0:Q.chip))],secondaryActions:wo.secondaryActions?null==wo?void 0:wo.secondaryActions(tl):tl},{children:l("div",o({ref:Go,style:o({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(U=null==wo?void 0:wo.slotStyles)||void 0===U?void 0:U.chatDataContainer)},{children:[(null===(J=null===(G=null==wo?void 0:wo.detailedTab)||void 0===G?void 0:G.chip)||void 0===J?void 0:J.isActive)&&i("div",o({ref:Uo,style:{position:(null==ko?void 0:ko.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:i(a,{chatData:null!==(L=wo.chatData)&&void 0!==L?L:[],assistantChatProps:o(o({},null===(Z=null===(X=null==wo?void 0:wo.detailedTab)||void 0===X?void 0:X.view)||void 0===Z?void 0:Z.assistantChatProps),{renderers:null!==(oo=null===(_=null===($=null==wo?void 0:wo.detailedTab)||void 0===$?void 0:$.detailedViewRenderer)||void 0===_?void 0:_.assistantText)&&void 0!==oo?oo:Jo}),userChatItemProps:o(o({},null===(io=null===(lo=null==wo?void 0:wo.detailedTab)||void 0===lo?void 0:lo.view)||void 0===io?void 0:io.userChatItemProps),{renderers:null!==(to=null===(no=null===(eo=null==wo?void 0:wo.detailedTab)||void 0===eo?void 0:eo.detailedViewRenderer)||void 0===no?void 0:no.userText)&&void 0!==to?to:Jo})})})),(null===(ao=null===(ro=null==wo?void 0:wo.summarizedTab)||void 0===ro?void 0:ro.chip)||void 0===ao?void 0:ao.show)&&(null===(vo=null===(uo=null==wo?void 0:wo.summarizedTab)||void 0===uo?void 0:uo.chip)||void 0===vo?void 0:vo.isActive)&&i(u,o({chatData:null!==(so=wo.chatData)&&void 0!==so?so:[]},null===(co=null==wo?void 0:wo.summarizedTab)||void 0===co?void 0:co.view,{renderer:null!==(fo=null===(ho=null==wo?void 0:wo.summarizedTab)||void 0===ho?void 0:ho.summarizedViewRenderer)&&void 0!==fo?fo:Jo}))]}))}))}))]}));return jo?i(e,o({title:null==bo?void 0:bo.title,slotStyles:{title:null===(mo=null==bo?void 0:bo.slotStyles)||void 0===mo?void 0:mo.title,body:null===(po=null==bo?void 0:bo.slotStyles)||void 0===po?void 0:po.body},containerStyles:null===(go=null==bo?void 0:bo.slotStyles)||void 0===go?void 0:go.container,icon:null!==(yo=null==bo?void 0:bo.icon)&&void 0!==yo?yo:i(g,{children:i("img",{src:r,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==bo?void 0:bo.secondaryActions)?bo.secondaryActions(il):il},{children:rl})):rl}export{S as default};
2
2
  //# sourceMappingURL=InternalChatCitationRenderer.js.map
@@ -0,0 +1,3 @@
1
+ declare const SPBAnalysisPanelTest: () => import("react/jsx-runtime").JSX.Element;
2
+ export default SPBAnalysisPanelTest;
3
+ //# sourceMappingURL=Spbanalysispaneltest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spbanalysispaneltest.d.ts","sourceRoot":"","sources":["../../../src/Spbanalysispaneltest.tsx"],"names":[],"mappings":"AAiHA,QAAA,MAAM,oBAAoB,+CA4FzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"InternalChatCitationRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatCitation/InternalChatCitationRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAU5D,OAAO,qBAAqB,CAAC;AAM7B,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AA8CD,KAAK,iCAAiC,GAAG,iBAAiB,GAAG;IAC3D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,iBAAiB,CAAC;CACpC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,EACnD,aAAa,EACb,aAAgC,EAChC,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,yBAAiC,EACjC,iBAAwB,EACxB,aAAmB,EACpB,EAAE,iCAAiC,2CAsgBnC"}
1
+ {"version":3,"file":"InternalChatCitationRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatCitation/InternalChatCitationRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAU5D,OAAO,qBAAqB,CAAC;AAM7B,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AA8CD,KAAK,iCAAiC,GAAG,iBAAiB,GAAG;IAC3D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,iBAAiB,CAAC;CACpC,CAAC;AAIF,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,EACnD,aAAa,EACb,aAAoC,EACpC,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,yBAAiC,EACjC,iBAAwB,EACxB,aAAmB,EACpB,EAAE,iCAAiC,2CAsgBnC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const useCompareLayout: (initialMaintainOrder: boolean, scrollContainerRef: React.RefObject<HTMLDivElement>, lhsBadgeRefs: any, rhsBadgeRefs: any, proposedSections: any[], existingSections: any[]) => {
3
2
  maintainRelativeOrder: boolean;
4
3
  setMaintainRelativeOrder: import("react").Dispatch<import("react").SetStateAction<boolean>>;
@@ -1 +1 @@
1
- {"version":3,"file":"useCompareLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/useCompareLayout.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,gBAAgB,yBACL,OAAO,sBACT,MAAM,SAAS,CAAC,cAAc,CAAC,gBACrC,GAAG,gBACH,GAAG,oBACC,GAAG,EAAE,oBACL,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;CAkFxB,CAAC"}
1
+ {"version":3,"file":"useCompareLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/useCompareLayout.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,yBACL,OAAO,sBACT,MAAM,SAAS,CAAC,cAAc,CAAC,gBACrC,GAAG,gBACH,GAAG,oBACC,GAAG,EAAE,oBACL,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;CAkFxB,CAAC"}
@@ -0,0 +1,22 @@
1
+ export type BlockCognitiveCitation = {
2
+ citation_number: number;
3
+ title?: string;
4
+ section_ref?: string;
5
+ content?: string;
6
+ paraphrase?: string;
7
+ highlight: string | string[];
8
+ };
9
+ export type CognitiveReasoningData = {
10
+ block_cognitive_reasoning_html: string;
11
+ block_cognitive_gap_html: string;
12
+ block_cognitive_confidence: number;
13
+ block_cognitive_citations: BlockCognitiveCitation[];
14
+ };
15
+ export interface CognitiveReasoningPanelProps {
16
+ open: boolean;
17
+ onClose: () => void;
18
+ data: CognitiveReasoningData | null;
19
+ }
20
+ declare const CognitiveReasoningPanel: ({ open, onClose, data }: CognitiveReasoningPanelProps) => import("react/jsx-runtime").JSX.Element | null;
21
+ export default CognitiveReasoningPanel;
22
+ //# sourceMappingURL=Cognitivereasoningpanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cognitivereasoningpanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Cognitivereasoningpanel.tsx"],"names":[],"mappings":"AAwBA,MAAM,MAAM,sBAAsB,GAAG;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACjC,8BAA8B,EAAE,MAAM,CAAC;IACvC,wBAAwB,EAAE,MAAM,CAAC;IACjC,0BAA0B,EAAE,MAAM,CAAC;IACnC,yBAAyB,EAAE,sBAAsB,EAAE,CAAC;CACvD,CAAC;AAEF,MAAM,WAAW,4BAA4B;IACzC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACvC;AAoBD,QAAA,MAAM,uBAAuB,4BAA6B,4BAA4B,mDA2KrF,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ interface Cluster {
3
+ id: string;
4
+ label: string;
5
+ }
6
+ interface RawNode {
7
+ id: string;
8
+ label: string;
9
+ cluster_id: string;
10
+ x: number;
11
+ y: number;
12
+ description: string;
13
+ }
14
+ interface Edge {
15
+ id: string;
16
+ source: string;
17
+ target: string;
18
+ reasoning: string;
19
+ score: number;
20
+ gap: string;
21
+ dependency_type: string;
22
+ }
23
+ interface ApiData {
24
+ graph_id: string;
25
+ prompt_id: string;
26
+ last_analyzed_at: string;
27
+ clusters: Cluster[];
28
+ nodes: RawNode[];
29
+ edges: Edge[];
30
+ }
31
+ interface DependencyGraphProps {
32
+ data: ApiData;
33
+ }
34
+ declare function DependencyGraph({ data }: DependencyGraphProps): React.ReactElement;
35
+ declare const _default: React.MemoExoticComponent<typeof DependencyGraph>;
36
+ export default _default;
37
+ //# sourceMappingURL=DependencyGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DependencyGraph.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/DependencyGraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,IAAI;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,OAAO;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AA8CD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,OAAO,CAAC;CACf;AAmsBD,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CAqC3E;;AAED,wBAA2C"}
@@ -0,0 +1,11 @@
1
+ export interface InternalEditorProps {
2
+ content: string;
3
+ selectedTag?: string;
4
+ highlightVariable?: string;
5
+ isDarkMode: boolean;
6
+ height?: number | string;
7
+ fontSize?: number;
8
+ }
9
+ export declare const InternalEditor: ({ content, selectedTag, highlightVariable, isDarkMode, height, fontSize, }: InternalEditorProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default InternalEditor;
11
+ //# sourceMappingURL=Internaleditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Internaleditor.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Internaleditor.tsx"],"names":[],"mappings":"AAsDA,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,+EAOxB,mBAAmB,4CAqKrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ export interface MarkdownRendererProps {
3
+ message: string | undefined;
4
+ fontSize?: React.CSSProperties["fontSize"];
5
+ /** Keyed by the id referenced in `<a data-cognitive-reasoning="key">` anchors */
6
+ extraMetaData?: Record<string, any> | null;
7
+ }
8
+ export declare const MarkdownRenderer: ({ message, fontSize, extraMetaData }: MarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default MarkdownRenderer;
10
+ //# sourceMappingURL=Markdownrenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Markdownrenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Markdownrenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAiMpE,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,gBAAgB,yCAA0C,qBAAqB,4CAgO3F,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,39 @@
1
+ export interface SPBApbReference {
2
+ apb_name: string;
3
+ description?: string;
4
+ context?: string;
5
+ }
6
+ export interface SPBFunctionalityItem {
7
+ name?: string;
8
+ section_name?: string;
9
+ description?: string;
10
+ reason_for_inclusion?: string;
11
+ apb_references: (string | SPBApbReference)[];
12
+ }
13
+ export interface SPBOverviewSummary {
14
+ overallSummary: string;
15
+ detailedSummary?: string;
16
+ extraMetaData?: Record<string, any> | null;
17
+ }
18
+ export interface SPBAdditionalInfo {
19
+ when_to_apply?: string;
20
+ when_not_to_apply?: string;
21
+ constraints_and_rules?: string;
22
+ input_analysis?: string;
23
+ output_analysis?: string;
24
+ dependency_graph?: any;
25
+ }
26
+ export interface SPBAnalysisPanelProps {
27
+ /** Full text of the system prompt this SPB analysis is derived from — used for the persistent/fullscreen preview editor */
28
+ promptContent: string;
29
+ promptTitle?: string;
30
+ isLoading?: boolean;
31
+ overviewSummary?: SPBOverviewSummary | null;
32
+ functionalityOfSPB?: SPBFunctionalityItem[];
33
+ spbAdditionalInfo?: SPBAdditionalInfo | null;
34
+ /** Show the persistent right-side code editor panel. Defaults to true. */
35
+ showCodePanel?: boolean;
36
+ }
37
+ declare const SPBAnalysisPanel: ({ promptContent, promptTitle, isLoading, overviewSummary, functionalityOfSPB, spbAdditionalInfo, showCodePanel, }: SPBAnalysisPanelProps) => import("react/jsx-runtime").JSX.Element;
38
+ export default SPBAnalysisPanel;
39
+ //# sourceMappingURL=Spbanalysispanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spbanalysispanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Spbanalysispanel.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,EAAE,CAAC,MAAM,GAAG,eAAe,CAAC,EAAE,CAAC;CAChD;AAED,MAAM,WAAW,kBAAkB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,iBAAiB;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,GAAG,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IAClC,2HAA2H;IAC3H,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,eAAe,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC5C,kBAAkB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC5C,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAE7C,0EAA0E;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAkGD,QAAA,MAAM,gBAAgB,sHAQnB,qBAAqB,4CAkYvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,10 @@
1
+ export { default as SPBAnalysisPanel } from "./Spbanalysispanel";
2
+ export type { SPBAnalysisPanelProps, SPBApbReference, SPBFunctionalityItem, SPBOverviewSummary, SPBAdditionalInfo, } from "./Spbanalysispanel";
3
+ export { default as MarkdownRenderer } from "./Markdownrenderer";
4
+ export type { MarkdownRendererProps } from "./Markdownrenderer";
5
+ export { default as DependencyGraph } from "./DependencyGraph";
6
+ export { default as CognitiveReasoningPanel } from "./Cognitivereasoningpanel";
7
+ export type { CognitiveReasoningData, BlockCognitiveCitation, CognitiveReasoningPanelProps } from "./Cognitivereasoningpanel";
8
+ export { default as InternalEditor } from "./Internaleditor";
9
+ export type { InternalEditorProps } from "./Internaleditor";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,YAAY,EACR,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAK9H,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/citation",
3
- "version": "0.0.231",
3
+ "version": "0.0.232",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",
@@ -186,6 +186,11 @@
186
186
  "import": "./dist/features/PromptemonBlockViewer/PromptemonBlockViewer.js",
187
187
  "require": "./dist/cjs/features/PromptemonBlockViewer/PromptemonBlockViewer.js",
188
188
  "types": "./dist/types/src/features/PromptemonBlockViewer/PromptemonBlockViewer.d.ts"
189
+ },
190
+ "./SPBAnalysisPanel": {
191
+ "import": "./dist/features/SPBAnalysisPanel/Spbanalysispanel.js",
192
+ "require": "./dist/cjs/features/SPBAnalysisPanel/Spbanalysispanel.js",
193
+ "types": "./dist/types/src/features/SPBAnalysisPanel/Spbanalysispanel.d.ts"
189
194
  }
190
195
  },
191
196
  "repository": {