@e-llm-studio/citation 0.0.239 → 0.0.241

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),o=require("@mui/system"),t=require("@mui/material"),r=require("@mui/icons-material/Close"),s=require("@mui/icons-material/ExpandMore"),a=require("@mui/icons-material"),l=require("@mui/icons-material/AutoAwesome"),c=require("../ChatCitation/ChatCitationRenderer.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=d(r),u=d(s),g=d(l),h=function(e){var n=document.createElement("div");return n.innerHTML=e,Array.from(n.querySelectorAll("li")).map(function(e){return e.innerHTML})},f=function(){return n.jsx(o.Box,e.__assign({component:"svg",viewBox:"0 0 24 24",sx:{width:14,height:14,fill:"#5928ed"}},{children:n.jsx("path",{d:"M12 2a7 7 0 0 0-4 12.74V17a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-2.26A7 7 0 0 0 12 2zm-1 19h2v1h-2v-1z"})}))};exports.default=function(r){var s,l=r.open,d=r.onClose,p=r.data,_=i.useState(null),m=_[0],y=_[1],j=i.useMemo(function(){var e;return m&&p&&null!==(e=p.block_cognitive_citations.find(function(e){return String(e.citation_number)===m}))&&void 0!==e?e:null},[m,p]),v=i.useMemo(function(){return(null==p?void 0:p.block_cognitive_reasoning_html)?h(p.block_cognitive_reasoning_html):[]},[null==p?void 0:p.block_cognitive_reasoning_html]),b=i.useMemo(function(){return(null==p?void 0:p.block_cognitive_gap_html)?h(p.block_cognitive_gap_html):[]},[null==p?void 0:p.block_cognitive_gap_html]),S=function(i,t){for(var r,s,l=[],d=/<a[^>]*href="([^"]+)"[^>]*>(.*?)<\/a>/g,x=0,u=0,g=function(){var g=s[1].replace(/^.*\$/,""),h=s[2],f=m===g;s.index>x&&l.push(n.jsx("span",{children:i.substring(x,s.index)},"txt-".concat(t,"-").concat(u++))),l.push(n.jsxs("span",{children:[n.jsxs("span",e.__assign({onClick:function(){return y(function(e){return e===g?null:g})},style:{color:"#2563EB",fontWeight:500,cursor:"pointer",textDecoration:"underline"}},{children:[h,n.jsx(a.ChatBubbleOutlineOutlined,{sx:{fontSize:"12px",ml:.2}})]})),f&&j&&n.jsx(o.Box,e.__assign({sx:{maxHeight:"35vh",padding:"6px",overflow:"auto",backgroundColor:"#ffffff",mt:1}},{children:n.jsx(c.default,{showRootContainer:!1,rootContainer:{relevanceScore:null!==(r=null==p?void 0:p.block_cognitive_confidence)&&void 0!==r?r:0,slotStyles:{container:{border:"",paddingLeft:"-20px",color:"black"}}},ruleBookContainer:{title:j.title||j.section_ref||"Rule Book",data:{content:j.content||j.paraphrase||"",highlighted_texts:Array.isArray(j.highlight)?j.highlight:j.highlight?[j.highlight]:[]},slotStyles:{outerContainer:{margin:"0",color:"black",minHeight:"350px"}}},additionalData:{RuleBookDetailedViewVerticallyStacked:!0},reversePanels:!0})}))]},"anchor-".concat(t,"-").concat(g))),x=d.lastIndex};null!==(s=d.exec(i));)g();return x<i.length&&l.push(n.jsx("span",{children:i.substring(x)},"txt-end-".concat(t,"-").concat(u++))),l};return l?n.jsxs(o.Box,e.__assign({sx:{width:"min(500px, calc(100vw - 16px))",maxWidth:"calc(100vw - 16px)",maxHeight:"80vh",borderRadius:3,display:"flex",flexDirection:"column",overflow:"hidden",border:"1px solid #e0e0e0",backgroundColor:"#fff"}},{children:[n.jsxs(o.Box,e.__assign({sx:{px:2,py:1,borderBottom:"1px solid #e0e0e0",display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0,backgroundColor:"#e9ecfd"}},{children:[n.jsxs(o.Box,e.__assign({display:"flex",alignItems:"center",gap:1},{children:[n.jsx(f,{}),n.jsx(t.Typography,e.__assign({fontWeight:500,sx:{fontSize:"0.72rem"}},{children:"Cognitive Decisioning AI"}))]})),n.jsxs(o.Box,e.__assign({display:"flex",alignItems:"center",gap:1},{children:[n.jsx(t.Chip,{icon:n.jsx(g.default,{sx:{fontSize:12}}),label:"AI Relevance: ".concat(null!==(s=null==p?void 0:p.block_cognitive_confidence)&&void 0!==s?s:0,"%"),size:"small",sx:{fontWeight:500,fontSize:"0.68rem",backgroundColor:"#ffffff",color:"#000000",border:"1px solid #ac93f6",height:20,"& .MuiChip-label":{fontSize:"0.68rem",px:.75}}}),n.jsx(t.IconButton,e.__assign({size:"small",onClick:d},{children:n.jsx(x.default,{fontSize:"small"})}))]}))]})),n.jsxs(o.Box,e.__assign({sx:{flex:1,overflowY:"auto",p:.5}},{children:[n.jsxs(t.Accordion,e.__assign({defaultExpanded:!0,disableGutters:!0,elevation:0},{children:[n.jsx(t.AccordionSummary,e.__assign({expandIcon:n.jsx(u.default,{})},{children:n.jsxs(t.Typography,e.__assign({sx:{display:"flex",alignItems:"center",gap:.8,fontSize:"0.78rem"},fontWeight:600},{children:[n.jsx(o.Box,e.__assign({sx:{width:24,height:24,borderRadius:"50%",backgroundColor:"#e9ecfd",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:n.jsx(a.LightbulbOutlined,{sx:{fontSize:14,color:"#5928ed"}})})),"Decision Making Factors"]}))})),n.jsx(t.AccordionDetails,{children:n.jsx(o.Box,e.__assign({sx:{padding:0,margin:0}},{children:v.length>0?v.map(function(i,r){return n.jsxs(o.Box,e.__assign({sx:{marginBottom:"6px",display:"flex",gap:1}},{children:[n.jsxs(t.Typography,e.__assign({variant:"body2",sx:{fontWeight:500,fontSize:"0.75rem"}},{children:[r+1,"."]})),n.jsx(o.Box,e.__assign({sx:{flex:1}},{children:n.jsx(t.Typography,e.__assign({variant:"body2",component:"span",sx:{fontSize:"0.75rem"}},{children:S(i,r)}))}))]}),r)}):n.jsx(t.Typography,e.__assign({variant:"body2",color:"gray",sx:{mb:.5,pl:3,fontSize:"0.72rem"}},{children:"No Reasons Found"}))}))})]})),n.jsx(t.Divider,{}),n.jsxs(t.Accordion,e.__assign({disableGutters:!0,elevation:0},{children:[n.jsx(t.AccordionSummary,e.__assign({expandIcon:n.jsx(u.default,{})},{children:n.jsxs(t.Typography,e.__assign({sx:{display:"flex",alignItems:"center",gap:.8,fontSize:"0.78rem"},fontWeight:600},{children:[n.jsx(o.Box,e.__assign({sx:{width:24,height:24,borderRadius:"50%",backgroundColor:"#e9ecfd",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:n.jsx(a.ManageSearchOutlined,{sx:{fontSize:14,color:"#5928ed"}})})),"Gaps in Decision"]}))})),n.jsx(t.AccordionDetails,{children:n.jsx(o.Box,e.__assign({sx:{padding:0,margin:0}},{children:b.length>0?b.map(function(i,r){return n.jsxs(o.Box,e.__assign({sx:{marginBottom:"6px",display:"flex",gap:1}},{children:[n.jsxs(t.Typography,e.__assign({variant:"body2",sx:{fontWeight:500,fontSize:"0.75rem"}},{children:[r+1,"."]})),n.jsx(t.Typography,{variant:"body2",component:"span",sx:{fontSize:"0.75rem"},dangerouslySetInnerHTML:{__html:i}})]}),r)}):n.jsx(t.Typography,e.__assign({variant:"body2",color:"gray",sx:{mb:.5,pl:3,fontSize:"0.72rem"}},{children:"No Gaps Found"}))}))})]}))]}))]})):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),i=require("react/jsx-runtime"),e=require("react"),o=require("@mui/system"),t=require("@mui/material"),s=require("@mui/icons-material/Close"),l=require("@mui/icons-material/ExpandMore"),a=require("@mui/icons-material"),r=require("@mui/icons-material/AutoAwesome"),c=require("../ChatCitation/ChatCitationRenderer.js");function d(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=d(s),x=d(l),g=d(r),_=function(n){var i=document.createElement("div");return i.innerHTML=n,Array.from(i.querySelectorAll("li")).map(function(n){return n.innerHTML})},h=function(e){var t=e.style;return i.jsx(o.Box,n.__assign({component:"svg",viewBox:"0 0 24 24",sx:n.__assign({width:14,height:14,fill:"#5928ed"},t)},{children:i.jsx("path",{d:"M12 2a7 7 0 0 0-4 12.74V17a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-2.26A7 7 0 0 0 12 2zm-1 19h2v1h-2v-1z"})}))};exports.default=function(s){var l,r=s.open,d=s.onClose,p=s.data,f=s.styles,v=e.useState(null),m=v[0],y=v[1],j=e.useMemo(function(){var n;return m&&p&&null!==(n=p.block_cognitive_citations.find(function(n){return String(n.citation_number)===m}))&&void 0!==n?n:null},[m,p]),b=e.useMemo(function(){return(null==p?void 0:p.block_cognitive_reasoning_html)?_(p.block_cognitive_reasoning_html):[]},[null==p?void 0:p.block_cognitive_reasoning_html]),C=e.useMemo(function(){return(null==p?void 0:p.block_cognitive_gap_html)?_(p.block_cognitive_gap_html):[]},[null==p?void 0:p.block_cognitive_gap_html]),S=function(e,t){for(var s,l,r,d,u,x,g,_=[],h=/<a[^>]*href="([^"]+)"[^>]*>(.*?)<\/a>/g,v=0,b=0,C=function(){var C=g[1].replace(/^.*\$/,""),S=g[2],k=m===C;g.index>v&&_.push(i.jsx("span",{children:e.substring(v,g.index)},"txt-".concat(t,"-").concat(b++))),_.push(i.jsxs("span",{children:[i.jsxs("span",n.__assign({onClick:function(){return y(function(n){return n===C?null:C})},style:n.__assign({color:"#2563EB",fontWeight:500,cursor:"pointer",textDecoration:"underline"},null==f?void 0:f.citationLink)},{children:[S,i.jsx(a.ChatBubbleOutlineOutlined,{sx:{fontSize:"12px",ml:.2}})]})),k&&j&&i.jsx(o.Box,n.__assign({sx:n.__assign({maxHeight:"35vh",padding:"6px",overflow:"auto",backgroundColor:"#ffffff",mt:1},null==f?void 0:f.citationContainer)},{children:i.jsx(c.default,{showRootContainer:!1,modalContainerStyle:null==f?void 0:f.citationModalContainer,rootContainer:{relevanceScore:null!==(s=null==p?void 0:p.block_cognitive_confidence)&&void 0!==s?s:0,slotStyles:{container:n.__assign({border:"",paddingLeft:"-20px",color:null!==(r=null===(l=null==f?void 0:f.textContent)||void 0===l?void 0:l.color)&&void 0!==r?r:"black"},null==f?void 0:f.citationRootContainer)}},ruleBookContainer:{title:j.training_data_title||j.title||j.section_ref||"Rule Book",data:{content:(null===(d=j.data_sources)||void 0===d?void 0:d.join("\n\n"))||j.content||j.paraphrase||"",highlighted_texts:j.paraphrase?Array.isArray(j.paraphrase)?j.paraphrase:[j.paraphrase]:Array.isArray(j.highlight)?j.highlight:j.highlight?[j.highlight]:[]},slotStyles:{title:null==f?void 0:f.citationTitle,body:null==f?void 0:f.citationBody,dataContainer:null==f?void 0:f.citationDataContainer,outerContainer:n.__assign({margin:"0",color:null!==(x=null===(u=null==f?void 0:f.textContent)||void 0===u?void 0:u.color)&&void 0!==x?x:"black",minHeight:"350px"},null==f?void 0:f.citationRuleBookContainer)}},additionalData:{RuleBookDetailedViewVerticallyStacked:!0},reversePanels:!0})}))]},"anchor-".concat(t,"-").concat(C))),v=h.lastIndex};null!==(g=h.exec(e));)C();return v<e.length&&_.push(i.jsx("span",{children:e.substring(v)},"txt-end-".concat(t,"-").concat(b++))),_};return r?i.jsxs(o.Box,n.__assign({sx:n.__assign({width:"min(500px, calc(100vw - 16px))",maxWidth:"calc(100vw - 16px)",maxHeight:"80vh",borderRadius:3,display:"flex",flexDirection:"column",overflow:"hidden",border:"1px solid #e0e0e0",backgroundColor:"#fff",color:"#111827"},null==f?void 0:f.container)},{children:[i.jsxs(o.Box,n.__assign({sx:n.__assign({px:2,py:1,borderBottom:"1px solid #e0e0e0",display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0,backgroundColor:"#e9ecfd"},null==f?void 0:f.header)},{children:[i.jsxs(o.Box,n.__assign({display:"flex",alignItems:"center",gap:1},{children:[i.jsx(h,{style:null==f?void 0:f.headerIcon}),i.jsx(t.Typography,n.__assign({fontWeight:500,sx:n.__assign({fontSize:"0.72rem"},null==f?void 0:f.headerTitleText)},{children:"Cognitive Decisioning AI"}))]})),i.jsxs(o.Box,n.__assign({display:"flex",alignItems:"center",gap:1},{children:[i.jsx(t.Chip,{icon:i.jsx(g.default,{sx:{fontSize:12}}),label:"AI Relevance: ".concat(null!==(l=null==p?void 0:p.block_cognitive_confidence)&&void 0!==l?l:0,"%"),size:"small",sx:n.__assign({fontWeight:500,fontSize:"0.68rem",backgroundColor:"#ffffff",color:"#000000",border:"1px solid #ac93f6",height:20,"& .MuiChip-label":{fontSize:"0.68rem",px:.75}},null==f?void 0:f.badge)}),i.jsx(t.IconButton,n.__assign({size:"small",onClick:d,sx:null==f?void 0:f.closeButton},{children:i.jsx(u.default,{fontSize:"small"})}))]}))]})),i.jsxs(o.Box,n.__assign({sx:n.__assign({flex:1,overflowY:"auto",p:.5},null==f?void 0:f.body)},{children:[i.jsxs(t.Accordion,n.__assign({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:null==f?void 0:f.accordion},{children:[i.jsx(t.AccordionSummary,n.__assign({expandIcon:i.jsx(x.default,{}),sx:null==f?void 0:f.accordionSummary},{children:i.jsxs(t.Typography,n.__assign({sx:n.__assign({display:"flex",alignItems:"center",gap:.8,fontSize:"0.78rem"},null==f?void 0:f.sectionTitle),fontWeight:600},{children:[i.jsx(o.Box,n.__assign({sx:n.__assign({width:24,height:24,borderRadius:"50%",backgroundColor:"#e9ecfd",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},null==f?void 0:f.sectionIcon)},{children:i.jsx(a.LightbulbOutlined,{sx:{fontSize:14,color:"#5928ed"}})})),"Decision Making Factors"]}))})),i.jsx(t.AccordionDetails,n.__assign({sx:null==f?void 0:f.accordionDetails},{children:i.jsx(o.Box,n.__assign({sx:{padding:0,margin:0}},{children:b.length>0?b.map(function(e,s){return i.jsxs(o.Box,n.__assign({sx:n.__assign({marginBottom:"6px",display:"flex",gap:1},null==f?void 0:f.sectionItem)},{children:[i.jsxs(t.Typography,n.__assign({variant:"body2",sx:n.__assign({fontWeight:500,fontSize:"0.75rem"},null==f?void 0:f.indexText)},{children:[s+1,"."]})),i.jsx(o.Box,n.__assign({sx:{flex:1}},{children:i.jsx(t.Typography,n.__assign({variant:"body2",component:"span",sx:n.__assign({fontSize:"0.75rem"},null==f?void 0:f.textContent)},{children:S(e,s)}))}))]}),s)}):i.jsx(t.Typography,n.__assign({variant:"body2",color:"gray",sx:n.__assign({mb:.5,pl:3,fontSize:"0.72rem"},null==f?void 0:f.sectionSubtitle)},{children:"No Reasons Found"}))}))}))]})),i.jsx(t.Divider,{}),i.jsxs(t.Accordion,n.__assign({disableGutters:!0,elevation:0,sx:null==f?void 0:f.accordion},{children:[i.jsx(t.AccordionSummary,n.__assign({expandIcon:i.jsx(x.default,{}),sx:null==f?void 0:f.accordionSummary},{children:i.jsxs(t.Typography,n.__assign({sx:n.__assign({display:"flex",alignItems:"center",gap:.8,fontSize:"0.78rem"},null==f?void 0:f.sectionTitle),fontWeight:600},{children:[i.jsx(o.Box,n.__assign({sx:n.__assign({width:24,height:24,borderRadius:"50%",backgroundColor:"#e9ecfd",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},null==f?void 0:f.sectionIcon)},{children:i.jsx(a.ManageSearchOutlined,{sx:{fontSize:14,color:"#5928ed"}})})),"Gaps in Decision"]}))})),i.jsx(t.AccordionDetails,n.__assign({sx:null==f?void 0:f.accordionDetails},{children:i.jsx(o.Box,n.__assign({sx:{padding:0,margin:0}},{children:C.length>0?C.map(function(e,s){return i.jsxs(o.Box,n.__assign({sx:n.__assign({marginBottom:"6px",display:"flex",gap:1},null==f?void 0:f.sectionItem)},{children:[i.jsxs(t.Typography,n.__assign({variant:"body2",sx:n.__assign({fontWeight:500,fontSize:"0.75rem"},null==f?void 0:f.indexText)},{children:[s+1,"."]})),i.jsx(t.Typography,{variant:"body2",component:"span",sx:n.__assign({fontSize:"0.75rem"},null==f?void 0:f.textContent),dangerouslySetInnerHTML:{__html:e}})]}),s)}):i.jsx(t.Typography,n.__assign({variant:"body2",color:"gray",sx:n.__assign({mb:.5,pl:3,fontSize:"0.72rem"},null==f?void 0:f.sectionSubtitle)},{children:"No Gaps Found"}))}))}))]}))]}))]})):null};
2
2
  //# sourceMappingURL=Cognitivereasoningpanel.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material/Dialog"),i=require("@mui/icons-material/Fullscreen"),a=require("@mui/icons-material/CloseFullscreen");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=s(t),l=s(r),c=s(i),d=s(a),u=170,f=48,g=["#ede9fe","#e0f2fe","#fef3c7","#dcfce7","#ffe4e6","#f0fdf4","#fef9c3","#e0e7ff","#fce7f3","#f1f5f9"],h=["#7c3aed","#0284c7","#b45309","#16a34a","#e11d48","#15803d","#a16207","#4338ca","#db2777","#475569"],p=["⚙","◈","⟐","✦","◎","⬡","◇","⊕","✶","◉"],x=["#a78bfa","#7dd3fc","#fbbf24","#86efac","#fda4af","#6ee7b7","#fde047","#a5b4fc","#f9a8d4","#94a3b8"],y=["linear-gradient(135deg,#7c3aed,#a78bfa)","linear-gradient(135deg,#0284c7,#38bdf8)","linear-gradient(135deg,#b45309,#fbbf24)","linear-gradient(135deg,#16a34a,#86efac)","linear-gradient(135deg,#e11d48,#fda4af)","linear-gradient(135deg,#15803d,#6ee7b7)","linear-gradient(135deg,#a16207,#fde047)","linear-gradient(135deg,#4338ca,#a5b4fc)","linear-gradient(135deg,#db2777,#f9a8d4)","linear-gradient(135deg,#475569,#94a3b8)"];function v(n){var t=Array.isArray(null==n?void 0:n.clusters)?n.clusters:[],r=Array.isArray(null==n?void 0:n.nodes)?n.nodes:[],i=Array.isArray(null==n?void 0:n.edges)?n.edges:[],a=function(n,t,r){var i;void 0===n&&(n=[]),void 0===t&&(t=[]),void 0===r&&(r=[]);var a=Array.isArray(n)?n:[],s=Array.isArray(t)?t:[],o=Array.isArray(r)?r:[],l=a.length;if(0===l)return new Map;var c={};a.forEach(function(e,n){c[e.id]=n});var d={},u={};a.forEach(function(e){d[e.id]=[],u[e.id]=[]}),s.forEach(function(e){d[e.source]&&d[e.source].push(e.target),u[e.target]&&u[e.target].push(e.source)});var f={};a.forEach(function(e){f[e.id]=0});for(var g=0;g<l;g++){for(var h=!1,p=0,x=s;p<x.length;p++){var y=x[p],v=(f[y.source]||0)+1;v>(f[y.target]||0)&&v<l&&(f[y.target]=v,h=!0)}if(!h)break}var b={};o.forEach(function(e,n){b[e.id]=n});var _={};o.forEach(function(e){_[e.id]=[]}),a.forEach(function(e){var n;null===(n=_[e.cluster_id])||void 0===n||n.push(e)}),Object.values(_).forEach(function(e){return e.sort(function(e,n){return(f[e.id]||0)-(f[n.id]||0)})});for(var m=new Float64Array(l),j=new Float64Array(l),w=new Float64Array(l),M=new Float64Array(l),k=function(e){var n=null!==(i=b[e.id])&&void 0!==i?i:0;(_[e.id]||[]).forEach(function(e,t){var r=c[e.id];m[r]=520*n+280,j[r]=200*t+120})},S=0,C=o;S<C.length;S++)k(V=C[S]);for(var z=.0015,A=Math.max.apply(Math,e.__spreadArray(e.__spreadArray([],a.map(function(e){return f[e.id]||0}),!1),[1],!1)),E=new Float64Array(l),F=0;F<l;F++)E[F]=(f[a[F].id]||0)/A*(200*l*.6)+120;for(var R=0;R<350;R++){var I=Math.max(.015,1-R/350),W=new Float64Array(l),D=new Float64Array(l);for(F=0;F<l;F++)for(var Y=F+1;Y<l;Y++){var P=(Q=m[F]-m[Y])*Q+(U=j[F]-j[Y])*U;P<400&&(P=(Q=12*(F-Y))*Q+(U=8*(F+Y))*U);var q=Q/(O=Math.sqrt(P))*(H=48e4/P),B=U/O*H;W[F]+=q,D[F]+=B,W[Y]-=q,D[Y]-=B}for(var L=0,X=s;L<X.length;L++){y=X[L];var N=c[y.source],T=c[y.target];if(void 0!==N&&void 0!==T){var O,H,Q=m[T]-m[N],U=j[T]-j[N];if(!((O=Math.sqrt(Q*Q+U*U))<1))q=Q/O*(H=.004*(O-380)),B=U/O*H,W[N]+=q,D[N]+=B,W[T]-=q,D[T]-=B}}var G={},J={},K={};for(F=0;F<l;F++)G[V=a[F].cluster_id]=(G[V]||0)+m[F],J[V]=(J[V]||0)+j[F],K[V]=(K[V]||0)+1;for(F=0;F<l;F++){var V=a[F].cluster_id;W[F]+=(G[V]/K[V]-m[F])*z,D[F]+=(J[V]/K[V]-j[F])*z}for(F=0;F<l;F++)D[F]+=.002*(E[F]-j[F]);for(F=0;F<l;F++)w[F]=.84*(w[F]+W[F])*I,M[F]=.84*(M[F]+D[F])*I,m[F]+=w[F],j[F]+=M[F]}for(g=0;g<40;g++){var Z=!1;for(F=0;F<l;F++)for(Y=F+1;Y<l;Y++){Q=m[F]-m[Y],U=j[F]-j[Y];var $=270-Math.abs(Q),ee=128-Math.abs(U);if($>0&&ee>0)if(Z=!0,$<ee){var ne=$/2+5;m[F]+=Q>0?ne:-ne,m[Y]-=Q>0?ne:-ne}else ne=ee/2+5,j[F]+=U>0?ne:-ne,j[Y]-=U>0?ne:-ne}if(!Z)break}var te=1/0,re=1/0;for(F=0;F<l;F++)te=Math.min(te,m[F]),re=Math.min(re,j[F]);var ie=new Map;for(F=0;F<l;F++)ie.set(a[F].id,{x:Math.round(m[F]-te+80),y:Math.round(j[F]-re+80)});return ie}(r,i,t),s=r.map(function(n){var t=a.get(n.id)||{x:0,y:0};return e.__assign(e.__assign({},n),{x:t.x,y:t.y})}),o={};t.forEach(function(e,n){o[e.id]=n});var l={};t.forEach(function(e){l[e.id]=[]}),s.forEach(function(e){var n;null===(n=l[e.cluster_id])||void 0===n||n.push(e)});var c=36,d=t.map(function(e){var n=l[e.id];if(!n.length)return null;var t=Math.min.apply(Math,n.map(function(e){return e.x})),r=Math.min.apply(Math,n.map(function(e){return e.y})),i=Math.max.apply(Math,n.map(function(e){return e.x+u})),a=Math.max.apply(Math,n.map(function(e){return e.y+f}));return{id:e.id,label:e.label,idx:o[e.id],x:t-c,y:r-c,width:i-t+72,height:a-r+72+22}}).filter(function(e){return null!==e});return{nodes:s.map(function(n){var t;return e.__assign(e.__assign({},n),{cluster:null!==(t=o[n.cluster_id])&&void 0!==t?t:0})}),edges:i,clusterBounds:d,canvasW:Math.max.apply(Math,s.map(function(e){return e.x+u}))+72,canvasH:Math.max.apply(Math,s.map(function(e){return e.y+f}))+72}}function b(e,n,t){var r=n[e.source],i=n[e.target];if(!r||!i)return"";var a=function(e,n){var t=e.x+85,r=e.y+24,i=n.x+85,a=n.y+24;function s(e,n,t,r){var i=t-e,a=r-n;return Math.abs(a)>.4*Math.abs(i)?a>0?{x:e,y:n+24}:{x:e,y:n-24}:i>0?{x:e+85,y:n}:{x:e-85,y:n}}return{source:s(t,r,i,a),target:s(i,a,t,r)}}(r,i),s=a.source,o=a.target,l=o.x-s.x,c=o.y-s.y,d=Math.sqrt(l*l+c*c);if(d<5)return"M ".concat(s.x," ").concat(s.y," L ").concat(o.x," ").concat(o.y);if(i.y+150<r.y&&i.y<r.y-f){var u=Math.min(r.x,i.x)-110;return"M ".concat(s.x," ").concat(s.y," C ").concat(u," ").concat(s.y,", ").concat(u," ").concat(o.y,", ").concat(o.x," ").concat(o.y)}var g=-c/d,h=l/d;if(t.some(function(n){return n.source===e.target&&n.target===e.source})){var p=e.source<e.target?1:-1,x=Math.max(.18*d,40)*p,y=(s.x+o.x)/2+g*x,v=(s.y+o.y)/2+h*x;return"M ".concat(s.x," ").concat(s.y," Q ").concat(y," ").concat(v," ").concat(o.x," ").concat(o.y)}var b=Math.min(.12*d,55),_=(s.x+o.x)/2+g*b,m=(s.y+o.y)/2+h*b;return"M ".concat(s.x," ").concat(s.y," Q ").concat(_," ").concat(m," ").concat(o.x," ").concat(o.y)}function _(r){var i,a,s=r.data,o=r.onFullscreen,l=r.isFullscreen,_=r.isDarkMode,m=void 0!==_&&_,j=t.useRef(null),w=t.useState({x:0,y:0}),M=w[0],k=w[1],S=t.useState(.5),C=S[0],z=S[1],A=t.useState(!1),E=A[0],F=A[1],R=t.useRef({x:0,y:0}),I=t.useRef({x:0,y:0}),W=t.useState(null),D=W[0],Y=W[1],P=t.useState(null),q=P[0],B=P[1],L=t.useState(null),X=L[0],N=L[1],T=t.useState(null),O=T[0],H=T[1],Q=t.useMemo(function(){return v(s)},[s]),U=t.useMemo(function(){var e={};return Q.nodes.forEach(function(n){e[n.id]=n}),e},[Q]),G=t.useMemo(function(){var e={};return s.clusters.forEach(function(n,t){e[n.id]=t}),e},[s]),J=t.useMemo(function(){return O?new Set(Q.edges.filter(function(e){return e.source===O||e.target===O}).map(function(e){return e.id})):new Set},[O,Q.edges]),K=t.useMemo(function(){if(!O)return new Set;var e=new Set([O]);return Q.edges.forEach(function(n){n.source===O&&e.add(n.target),n.target===O&&e.add(n.source)}),e},[O,Q.edges]),V=t.useMemo(function(){return new Date(s.last_analyzed_at).toLocaleString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,day:"numeric",month:"short",year:"numeric"})},[s.last_analyzed_at]),Z=t.useCallback(function(n){n.target.closest("[data-edge-hit]")||n.target.closest("[data-node]")||(F(!0),R.current={x:n.clientX,y:n.clientY},I.current=e.__assign({},M),n.currentTarget.style.cursor="grabbing")},[M]),$=t.useCallback(function(e){E&&k({x:I.current.x+(e.clientX-R.current.x),y:I.current.y+(e.clientY-R.current.y)})},[E]),ee=t.useCallback(function(){F(!1),j.current&&(j.current.style.cursor="grab")},[]),ne=t.useCallback(function(e){e.preventDefault(),z(function(n){return Math.min(2.5,Math.max(.2,n-.001*e.deltaY))})},[]);t.useEffect(function(){var e=j.current;return e&&e.addEventListener("wheel",ne,{passive:!1}),function(){return null==e?void 0:e.removeEventListener("wheel",ne)}},[ne]);var te={width:32,height:32,border:"none",background:"transparent",borderRadius:8,cursor:"pointer",fontSize:16,color:m?"#cbd5e1":"#475569",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500};return n.jsxs("div",e.__assign({style:{width:"100%",height:"100%",background:m?"#090d16":"#ffffff",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",position:"relative",overflow:"hidden"}},{children:[n.jsxs("div",e.__assign({style:{position:"absolute",top:0,left:0,right:0,zIndex:20,borderBottom:l?m?"1px solid #1e293b":"1px solid #f1f5f9":"none",background:m?"#090d16":l?"#fff":"transparent"}},{children:[n.jsxs("div",e.__assign({style:{padding:"10px 14px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[n.jsxs("div",{children:[l&&n.jsx("h2",e.__assign({style:{margin:0,fontSize:17,fontWeight:700,color:m?"#f8fafc":"#1e293b"}},{children:"Dependency Graph"})),n.jsxs("p",e.__assign({style:{margin:"2px 0 0",fontSize:12,color:"#94a3b8"}},{children:["Last analyzed: ".concat(V||""," · "),"Click a node or connection to explore details and dependencies."]}))]}),n.jsxs("div",e.__assign({style:{display:"flex",gap:6,alignItems:"center"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",gap:2,background:m?"#1e293b":"#fff",borderRadius:10,padding:3,boxShadow:m?"0 1px 4px rgba(0,0,0,0.4)":"0 1px 4px rgba(0,0,0,0.08)"}},{children:[n.jsx("button",e.__assign({onClick:function(){return z(function(e){return Math.max(.2,e-.15)})},style:te},{children:"−"})),n.jsxs("button",e.__assign({onClick:function(){z(.5),k({x:0,y:0})},style:e.__assign(e.__assign({},te),{fontSize:11,width:52,fontWeight:600})},{children:[Math.round(100*C)||0,"%"]})),n.jsx("button",e.__assign({onClick:function(){return z(function(e){return Math.min(2.5,e+.15)})},style:te},{children:"+"}))]})),o&&n.jsx("div",e.__assign({style:{display:"flex",background:m?"#1e293b":"#fff",borderRadius:10,padding:3,boxShadow:m?"0 1px 4px rgba(0,0,0,0.4)":"0 1px 4px rgba(0,0,0,0.08)"}},{children:n.jsx("button",e.__assign({onClick:o,style:te},{children:l?n.jsx(d.default,{style:{fontSize:16}}):n.jsx(c.default,{style:{fontSize:16}})}))}))]}))]})),q&&n.jsx("div",e.__assign({style:{margin:"0 20px 14px",width:"30%",minWidth:280,borderRadius:12,overflow:"hidden",boxShadow:"0 2px 12px rgba(0,0,0,0.07)",border:"1px solid #e2e8f0",animation:"slideDown 0.2s ease-out"}},{children:function(){var t,r,i=q.node,a=null!==(t=G[i.cluster_id])&&void 0!==t?t:0;return Q.edges.filter(function(e){return e.source===i.id}).length,Q.edges.filter(function(e){return e.target===i.id}).length,n.jsxs("div",{children:[n.jsxs("div",e.__assign({style:{padding:"10px 14px",background:y[a%y.length||0],color:"#fff",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[n.jsx("span",e.__assign({style:{width:28,height:28,borderRadius:8,background:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14}},{children:p[a%p.length||0]})),n.jsxs("div",{children:[n.jsx("div",e.__assign({style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",opacity:.75}},{children:(null===(r=s.clusters[a])||void 0===r?void 0:r.label)||"Cluster Name"})),n.jsx("div",e.__assign({style:{fontSize:14,fontWeight:700,marginTop:1}},{children:i.label||"Cluster Name"}))]})]})),n.jsx("button",e.__assign({onClick:function(){B(null),H(null)},style:{background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",borderRadius:6,width:24,height:24,cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:"×"}))]})),n.jsx("div",e.__assign({style:{padding:"10px 14px",fontSize:13,lineHeight:1.6,color:m?"#cbd5e1":"#475569",background:m?"#1e293b":"#fff"}},{children:i.description||"No description available..."}))]})}()}))]})),n.jsxs("div",e.__assign({ref:j,onPointerDown:Z,onPointerMove:$,onPointerUp:ee,onPointerLeave:ee,onClick:function(){Y(null),B(null),H(null)},style:{width:"100%",height:"100%",cursor:E?"grabbing":"grab",position:"relative"}},{children:[n.jsx("div",e.__assign({style:{transform:"translate(".concat(M.x,"px, ").concat(M.y,"px) scale(").concat(C,")"),transformOrigin:"top left",position:"absolute",top:l?70:50,left:20,transition:E?"none":"transform 0.08s ease-out"}},{children:n.jsxs("svg",e.__assign({width:Q.canvasW,height:Q.canvasH,style:{overflow:"visible"}},{children:[Q.clusterBounds.map(function(t){return n.jsxs("g",{children:[n.jsx("rect",{x:t.x,y:t.y,width:t.width,height:t.height,rx:"16",fill:m?"rgba(30, 41, 59, 0.35)":"none",stroke:m?"#334155":"#e2e8f0",strokeWidth:"1.5",strokeDasharray:"8 4"}),n.jsx("text",e.__assign({x:t.x+14,y:t.y+t.height-10,fontSize:"11",fill:"#94a3b8",fontFamily:"Inter, sans-serif",fontWeight:"500"},{children:t.label||"Cluster Name"}))]},t.id)}),Q.edges.map(function(t){var r=b(t,U,Q.edges);if(!r)return null;var i=J.has(t.id),a=(null==D?void 0:D.edge.id)===t.id,s=X===t.id,o=!!O&&!i,l=i||a?"#6366f1":s?"#818cf8":m?"#475569":"#cbd5e1",c=i||a?2.5:s?2:1.5;return n.jsxs("g",e.__assign({style:{opacity:o?.1:1,transition:"opacity 0.25s"}},{children:[n.jsx("path",{"data-edge-hit":"true",d:r,fill:"none",stroke:"transparent",strokeWidth:18,style:{cursor:"pointer"},onClick:function(e){return function(e,n){e.stopPropagation();var t=j.current.getBoundingClientRect();Y({edge:n,screenX:e.clientX-t.left,screenY:e.clientY-t.top}),B(null),H(null)}(e,t)},onMouseEnter:function(){return N(t.id)},onMouseLeave:function(){return N(null)}}),n.jsx("path",{d:r,fill:"none",stroke:l,strokeWidth:c,style:{transition:"stroke 0.2s, stroke-width 0.2s",pointerEvents:"none"}}),(i||a)&&n.jsxs(n.Fragment,{children:[n.jsx("circle",e.__assign({r:4,fill:"#6366f1"},{children:n.jsx("animateMotion",{dur:"1.8s",repeatCount:"indefinite",path:r})})),n.jsx("circle",e.__assign({r:6,fill:"#6366f1",opacity:.2},{children:n.jsx("animateMotion",{dur:"1.8s",repeatCount:"indefinite",path:r})}))]})]}),t.id)}),Q.nodes.map(function(t){var r,i=O===t.id,a=K.has(t.id),s=!!O&&!a,o=(null!==(r=G[t.cluster_id])&&void 0!==r?r:0)%x.length,l=x[o||0];return n.jsx("g",e.__assign({"data-node":"true",onClick:function(e){return function(e,n){e.stopPropagation();var t=j.current.getBoundingClientRect();O===n.id?(H(null),B(null)):(H(n.id),B({node:n,screenX:e.clientX-t.left,screenY:e.clientY-t.top}),Y(null))}(e,t)},style:{cursor:"pointer",opacity:s?.15:1,transition:"opacity 0.25s"}},{children:n.jsx("foreignObject",e.__assign({x:t.x,y:t.y,width:u,height:f},{children:n.jsxs("div",e.__assign({style:{background:m?"#1e293b":"#fff",border:i?"2.5px solid ".concat(l):m?"1.5px solid #334155":"1.5px solid #e2e8f0",borderRadius:10,padding:"8px 14px",fontSize:13,fontWeight:600,color:m?"#f1f5f9":"#334155",fontFamily:"'Inter', sans-serif",display:"flex",alignItems:"center",gap:8,boxShadow:i?"0 0 0 3px ".concat(l,"33, 0 2px 8px rgba(0,0,0,0.4)"):m?"0 2px 6px rgba(0,0,0,0.3)":"0 1px 3px rgba(0,0,0,0.05)",whiteSpace:"nowrap",userSelect:"none",height:46,boxSizing:"border-box",transition:"border 0.2s, box-shadow 0.2s"}},{children:[n.jsx("span",e.__assign({style:{width:22,height:22,borderRadius:6,background:g[o],display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,flexShrink:0,color:h[o]}},{children:p[o]})),n.jsx("span",e.__assign({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:t.label||"Node name"}))]}))}))}),t.id)})]}))})),D&&n.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign({position:"absolute"},function(e,n,t,r){if(!j.current)return{};var i=j.current.getBoundingClientRect(),a=e+14,s=n-r/2;return a+t>i.width&&(a=e-t-14),s<8&&(s=8),s+r>i.height&&(s=i.height-r-8),{left:a,top:s}}(D.screenX,D.screenY,320,180)),{width:320,background:"#fff",borderRadius:14,boxShadow:"0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06)",border:"1px solid #e2e8f0",zIndex:30,animation:"popIn 0.18s ease-out",overflow:"hidden"})},{children:[n.jsxs("div",e.__assign({style:{padding:"12px 16px 10px",background:"linear-gradient(135deg, #6366f1, #8b5cf6)",color:"#fff"}},{children:[n.jsx("div",e.__assign({style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",opacity:.8}},{children:"Edge Reasoning"})),n.jsxs("div",e.__assign({style:{fontSize:13,fontWeight:600,marginTop:4}},{children:[(null===(i=U[D.edge.source])||void 0===i?void 0:i.label)||"Source",n.jsx("span",e.__assign({style:{opacity:.6,margin:"0 6px"}},{children:"→"})),(null===(a=U[D.edge.target])||void 0===a?void 0:a.label)||"Target"]}))]})),n.jsx("div",e.__assign({style:{padding:"12px 16px 14px",fontSize:13,lineHeight:1.6,color:"#475569",whiteSpace:"pre-line"}},{children:D.edge.reasoning||"No Reasoning available..."})),n.jsx("button",e.__assign({onClick:function(){return Y(null)},style:{position:"absolute",top:8,right:10,background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",borderRadius:6,width:24,height:24,cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center"}},{children:"×"}))]}))]})),n.jsx("style",{children:"\n @keyframes popIn { from { opacity:0; transform:scale(0.95) translateY(4px); } to { opacity:1; transform:scale(1) translateY(0); } }\n @keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }\n "})]}))}var m=o.default.memo(function(r){var i=r.data,a=r.isDarkMode,s=void 0!==a&&a,o=r.style,c=t.useState(!1),d=c[0],u=c[1],f=t.useCallback(function(){u(!0)},[]),g=t.useCallback(function(){u(!1)},[]);return n.jsxs(n.Fragment,{children:[n.jsx("div",e.__assign({style:e.__assign({position:"relative",width:"100%",height:"500px"},o)},{children:n.jsx(_,{data:i,onFullscreen:f,isDarkMode:s})})),n.jsx(l.default,e.__assign({open:d,onClose:g,maxWidth:!1,PaperProps:{style:{width:"95vw",height:"92vh",maxWidth:"none",borderRadius:12,overflow:"hidden",background:s?"#090d16":"#ffffff"}}},{children:n.jsx("div",e.__assign({style:{width:"100%",height:"100%",position:"relative"}},{children:n.jsx(_,{data:i,onFullscreen:g,isFullscreen:!0,isDarkMode:s})}))}))]})});exports.default=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material/Dialog"),i=require("@mui/icons-material/Fullscreen"),o=require("@mui/icons-material/CloseFullscreen");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(t),s=a(r),d=a(i),c=a(o),u=170,f=48,g=["#ede9fe","#e0f2fe","#fef3c7","#dcfce7","#ffe4e6","#f0fdf4","#fef9c3","#e0e7ff","#fce7f3","#f1f5f9"],v=["#7c3aed","#0284c7","#b45309","#16a34a","#e11d48","#15803d","#a16207","#4338ca","#db2777","#475569"],p=["⚙","◈","⟐","✦","◎","⬡","◇","⊕","✶","◉"],h=["#a78bfa","#7dd3fc","#fbbf24","#86efac","#fda4af","#6ee7b7","#fde047","#a5b4fc","#f9a8d4","#94a3b8"],x=["linear-gradient(135deg,#7c3aed,#a78bfa)","linear-gradient(135deg,#0284c7,#38bdf8)","linear-gradient(135deg,#b45309,#fbbf24)","linear-gradient(135deg,#16a34a,#86efac)","linear-gradient(135deg,#e11d48,#fda4af)","linear-gradient(135deg,#15803d,#6ee7b7)","linear-gradient(135deg,#a16207,#fde047)","linear-gradient(135deg,#4338ca,#a5b4fc)","linear-gradient(135deg,#db2777,#f9a8d4)","linear-gradient(135deg,#475569,#94a3b8)"];function y(n){var t=Array.isArray(null==n?void 0:n.clusters)?n.clusters:[],r=Array.isArray(null==n?void 0:n.nodes)?n.nodes:[],i=Array.isArray(null==n?void 0:n.edges)?n.edges:[],o=function(n,t,r){var i;void 0===n&&(n=[]),void 0===t&&(t=[]),void 0===r&&(r=[]);var o=Array.isArray(n)?n:[],a=Array.isArray(t)?t:[],l=Array.isArray(r)?r:[],s=o.length;if(0===s)return new Map;var d={};o.forEach(function(e,n){d[e.id]=n});var c={},u={};o.forEach(function(e){c[e.id]=[],u[e.id]=[]}),a.forEach(function(e){c[e.source]&&c[e.source].push(e.target),u[e.target]&&u[e.target].push(e.source)});var f={};o.forEach(function(e){f[e.id]=0});for(var g=0;g<s;g++){for(var v=!1,p=0,h=a;p<h.length;p++){var x=h[p],y=(f[x.source]||0)+1;y>(f[x.target]||0)&&y<s&&(f[x.target]=y,v=!0)}if(!v)break}var b={};l.forEach(function(e,n){b[e.id]=n});var _={};l.forEach(function(e){_[e.id]=[]}),o.forEach(function(e){var n;null===(n=_[e.cluster_id])||void 0===n||n.push(e)}),Object.values(_).forEach(function(e){return e.sort(function(e,n){return(f[e.id]||0)-(f[n.id]||0)})});for(var m=new Float64Array(s),j=new Float64Array(s),k=new Float64Array(s),w=new Float64Array(s),M=function(e){var n=null!==(i=b[e.id])&&void 0!==i?i:0;(_[e.id]||[]).forEach(function(e,t){var r=d[e.id];m[r]=520*n+280,j[r]=200*t+120})},S=0,C=l;S<C.length;S++)M(V=C[S]);for(var E=.0015,z=Math.max.apply(Math,e.__spreadArray(e.__spreadArray([],o.map(function(e){return f[e.id]||0}),!1),[1],!1)),P=new Float64Array(s),A=0;A<s;A++)P[A]=(f[o[A].id]||0)/z*(200*s*.6)+120;for(var F=0;F<350;F++){var R=Math.max(.015,1-F/350),I=new Float64Array(s),W=new Float64Array(s);for(A=0;A<s;A++)for(var B=A+1;B<s;B++){var D=(Q=m[A]-m[B])*Q+(U=j[A]-j[B])*U;D<400&&(D=(Q=12*(A-B))*Q+(U=8*(A+B))*U);var Y=Q/(T=Math.sqrt(D))*(O=48e4/D),N=U/T*O;I[A]+=Y,W[A]+=N,I[B]-=Y,W[B]-=N}for(var q=0,L=a;q<L.length;q++){x=L[q];var X=d[x.source],H=d[x.target];if(void 0!==X&&void 0!==H){var T,O,Q=m[H]-m[X],U=j[H]-j[X];if(!((T=Math.sqrt(Q*Q+U*U))<1))Y=Q/T*(O=.004*(T-380)),N=U/T*O,I[X]+=Y,W[X]+=N,I[H]-=Y,W[H]-=N}}var G={},J={},K={};for(A=0;A<s;A++)G[V=o[A].cluster_id]=(G[V]||0)+m[A],J[V]=(J[V]||0)+j[A],K[V]=(K[V]||0)+1;for(A=0;A<s;A++){var V=o[A].cluster_id;I[A]+=(G[V]/K[V]-m[A])*E,W[A]+=(J[V]/K[V]-j[A])*E}for(A=0;A<s;A++)W[A]+=.002*(P[A]-j[A]);for(A=0;A<s;A++)k[A]=.84*(k[A]+I[A])*R,w[A]=.84*(w[A]+W[A])*R,m[A]+=k[A],j[A]+=w[A]}for(g=0;g<40;g++){var Z=!1;for(A=0;A<s;A++)for(B=A+1;B<s;B++){Q=m[A]-m[B],U=j[A]-j[B];var $=270-Math.abs(Q),ee=128-Math.abs(U);if($>0&&ee>0)if(Z=!0,$<ee){var ne=$/2+5;m[A]+=Q>0?ne:-ne,m[B]-=Q>0?ne:-ne}else ne=ee/2+5,j[A]+=U>0?ne:-ne,j[B]-=U>0?ne:-ne}if(!Z)break}var te=1/0,re=1/0;for(A=0;A<s;A++)te=Math.min(te,m[A]),re=Math.min(re,j[A]);var ie=new Map;for(A=0;A<s;A++)ie.set(o[A].id,{x:Math.round(m[A]-te+80),y:Math.round(j[A]-re+80)});return ie}(r,i,t),a=r.map(function(n){var t=o.get(n.id)||{x:0,y:0};return e.__assign(e.__assign({},n),{x:t.x,y:t.y})}),l={};t.forEach(function(e,n){l[e.id]=n});var s={};t.forEach(function(e){s[e.id]=[]}),a.forEach(function(e){var n;null===(n=s[e.cluster_id])||void 0===n||n.push(e)});var d=36,c=t.map(function(e){var n=s[e.id];if(!n.length)return null;var t=Math.min.apply(Math,n.map(function(e){return e.x})),r=Math.min.apply(Math,n.map(function(e){return e.y})),i=Math.max.apply(Math,n.map(function(e){return e.x+u})),o=Math.max.apply(Math,n.map(function(e){return e.y+f}));return{id:e.id,label:e.label,idx:l[e.id],x:t-d,y:r-d,width:i-t+72,height:o-r+72+22}}).filter(function(e){return null!==e});return{nodes:a.map(function(n){var t;return e.__assign(e.__assign({},n),{cluster:null!==(t=l[n.cluster_id])&&void 0!==t?t:0})}),edges:i,clusterBounds:c,canvasW:Math.max.apply(Math,a.map(function(e){return e.x+u}))+72,canvasH:Math.max.apply(Math,a.map(function(e){return e.y+f}))+72}}function b(e,n,t){var r=n[e.source],i=n[e.target];if(!r||!i)return"";var o=function(e,n){var t=e.x+85,r=e.y+24,i=n.x+85,o=n.y+24;function a(e,n,t,r){var i=t-e,o=r-n;return Math.abs(o)>.4*Math.abs(i)?o>0?{x:e,y:n+24}:{x:e,y:n-24}:i>0?{x:e+85,y:n}:{x:e-85,y:n}}return{source:a(t,r,i,o),target:a(i,o,t,r)}}(r,i),a=o.source,l=o.target,s=l.x-a.x,d=l.y-a.y,c=Math.sqrt(s*s+d*d);if(c<5)return"M ".concat(a.x," ").concat(a.y," L ").concat(l.x," ").concat(l.y);if(i.y+150<r.y&&i.y<r.y-f){var u=Math.min(r.x,i.x)-110;return"M ".concat(a.x," ").concat(a.y," C ").concat(u," ").concat(a.y,", ").concat(u," ").concat(l.y,", ").concat(l.x," ").concat(l.y)}var g=-d/c,v=s/c;if(t.some(function(n){return n.source===e.target&&n.target===e.source})){var p=e.source<e.target?1:-1,h=Math.max(.18*c,40)*p,x=(a.x+l.x)/2+g*h,y=(a.y+l.y)/2+v*h;return"M ".concat(a.x," ").concat(a.y," Q ").concat(x," ").concat(y," ").concat(l.x," ").concat(l.y)}var b=Math.min(.12*c,55),_=(a.x+l.x)/2+g*b,m=(a.y+l.y)/2+v*b;return"M ".concat(a.x," ").concat(a.y," Q ").concat(_," ").concat(m," ").concat(l.x," ").concat(l.y)}function _(r){var i,o,a,l=r.data,s=r.onFullscreen,_=r.isFullscreen,m=r.isDarkMode,j=void 0!==m&&m,k=r.style,w=t.useRef(null),M=t.useState({x:0,y:0}),S=M[0],C=M[1],E=t.useState(.5),z=E[0],P=E[1],A=t.useState(!1),F=A[0],R=A[1],I=t.useRef({x:0,y:0}),W=t.useRef({x:0,y:0}),B=t.useState(null),D=B[0],Y=B[1],N=t.useState(null),q=N[0],L=N[1],X=t.useState(null),H=X[0],T=X[1],O=t.useState(null),Q=O[0],U=O[1],G=t.useMemo(function(){return y(l)},[l]),J=t.useMemo(function(){var e={};return G.nodes.forEach(function(n){e[n.id]=n}),e},[G]),K=t.useMemo(function(){var e={};return l.clusters.forEach(function(n,t){e[n.id]=t}),e},[l]),V=t.useMemo(function(){return Q?new Set(G.edges.filter(function(e){return e.source===Q||e.target===Q}).map(function(e){return e.id})):new Set},[Q,G.edges]),Z=t.useMemo(function(){if(!Q)return new Set;var e=new Set([Q]);return G.edges.forEach(function(n){n.source===Q&&e.add(n.target),n.target===Q&&e.add(n.source)}),e},[Q,G.edges]),$=t.useMemo(function(){return new Date(l.last_analyzed_at).toLocaleString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,day:"numeric",month:"short",year:"numeric"})},[l.last_analyzed_at]),ee=t.useCallback(function(n){n.target.closest("[data-edge-hit]")||n.target.closest("[data-node]")||(R(!0),I.current={x:n.clientX,y:n.clientY},W.current=e.__assign({},S),n.currentTarget.style.cursor="grabbing")},[S]),ne=t.useCallback(function(e){F&&C({x:W.current.x+(e.clientX-I.current.x),y:W.current.y+(e.clientY-I.current.y)})},[F]),te=t.useCallback(function(){R(!1),w.current&&(w.current.style.cursor="grab")},[]),re=t.useCallback(function(e){e.preventDefault(),P(function(n){return Math.min(2.5,Math.max(.2,n-.001*e.deltaY))})},[]);t.useEffect(function(){var e=w.current;return e&&e.addEventListener("wheel",re,{passive:!1}),function(){return null==e?void 0:e.removeEventListener("wheel",re)}},[re]);var ie=(null==k?void 0:k.backgroundColor)||(null==k?void 0:k.background)||(j?"#090d16":"#ffffff"),oe=(null==k?void 0:k.color)||(j?"#f8fafc":"#1e293b"),ae=(null===(i=null==k?void 0:k.subtitle)||void 0===i?void 0:i.color)||"#94a3b8",le=function(e,n){return"string"==typeof e?e:n},se=e.__assign({width:32,height:32,border:"none",background:"transparent",borderRadius:8,cursor:"pointer",fontSize:16,color:j?"#cbd5e1":"#475569",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500},null==k?void 0:k.controlButton);return n.jsxs("div",e.__assign({style:e.__assign({width:"100%",height:"100%",background:ie,color:oe,fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",position:"relative",overflow:"hidden"},null==k?void 0:k.root)},{children:[n.jsxs("div",e.__assign({style:e.__assign({position:"absolute",top:0,left:0,right:0,zIndex:20,borderBottom:_?j?"1px solid #1e293b":"1px solid #f1f5f9":"none",background:_?ie:"transparent"},null==k?void 0:k.header)},{children:[n.jsxs("div",e.__assign({style:{padding:"10px 14px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[n.jsxs("div",{children:[_&&n.jsx("h2",e.__assign({style:e.__assign({margin:0,fontSize:17,fontWeight:700,color:oe},null==k?void 0:k.title)},{children:"Dependency Graph"})),n.jsxs("p",e.__assign({style:e.__assign({margin:"2px 0 0",fontSize:12,color:ae},null==k?void 0:k.subtitle)},{children:["Last analyzed: ".concat($||""," · "),"Click a node or connection to explore details and dependencies."]}))]}),n.jsxs("div",e.__assign({style:{display:"flex",gap:6,alignItems:"center"}},{children:[n.jsxs("div",e.__assign({style:e.__assign({display:"flex",gap:2,background:j?"#1e293b":"#fff",borderRadius:10,padding:3,boxShadow:j?"0 1px 4px rgba(0,0,0,0.4)":"0 1px 4px rgba(0,0,0,0.08)"},null==k?void 0:k.controls)},{children:[n.jsx("button",e.__assign({onClick:function(){return P(function(e){return Math.max(.2,e-.15)})},style:se},{children:"−"})),n.jsxs("button",e.__assign({onClick:function(){P(.5),C({x:0,y:0})},style:e.__assign(e.__assign({},se),{fontSize:11,width:52,fontWeight:600})},{children:[Math.round(100*z)||0,"%"]})),n.jsx("button",e.__assign({onClick:function(){return P(function(e){return Math.min(2.5,e+.15)})},style:se},{children:"+"}))]})),s&&n.jsx("div",e.__assign({style:e.__assign({display:"flex",background:j?"#1e293b":"#fff",borderRadius:10,padding:3,boxShadow:j?"0 1px 4px rgba(0,0,0,0.4)":"0 1px 4px rgba(0,0,0,0.08)"},null==k?void 0:k.controls)},{children:n.jsx("button",e.__assign({onClick:s,style:se},{children:_?n.jsx(c.default,{style:{fontSize:16}}):n.jsx(d.default,{style:{fontSize:16}})}))}))]}))]})),q&&n.jsx("div",e.__assign({style:e.__assign({margin:"0 20px 14px",width:"30%",minWidth:280,borderRadius:12,overflow:"hidden",boxShadow:"0 2px 12px rgba(0,0,0,0.07)",border:"1px solid #e2e8f0",animation:"slideDown 0.2s ease-out"},null==k?void 0:k.nodePopup)},{children:function(){var t,r,i=q.node,o=null!==(t=K[i.cluster_id])&&void 0!==t?t:0;return G.edges.filter(function(e){return e.source===i.id}).length,G.edges.filter(function(e){return e.target===i.id}).length,n.jsxs("div",{children:[n.jsxs("div",e.__assign({style:e.__assign({padding:"10px 14px",background:x[o%x.length||0],color:"#fff",display:"flex",alignItems:"center",justifyContent:"space-between"},null==k?void 0:k.nodePopupHeader)},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[n.jsx("span",e.__assign({style:{width:28,height:28,borderRadius:8,background:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14}},{children:p[o%p.length||0]})),n.jsxs("div",{children:[n.jsx("div",e.__assign({style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",opacity:.75}},{children:(null===(r=l.clusters[o])||void 0===r?void 0:r.label)||"Cluster Name"})),n.jsx("div",e.__assign({style:{fontSize:14,fontWeight:700,marginTop:1}},{children:i.label||"Cluster Name"}))]})]})),n.jsx("button",e.__assign({onClick:function(){L(null),U(null)},style:e.__assign({background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",borderRadius:6,width:24,height:24,cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},null==k?void 0:k.popupCloseButton)},{children:"×"}))]})),n.jsx("div",e.__assign({style:e.__assign({padding:"10px 14px",fontSize:13,lineHeight:1.6,color:j?"#cbd5e1":"#475569",background:j?"#1e293b":"#fff"},null==k?void 0:k.nodePopupBody)},{children:i.description||"No description available..."}))]})}()}))]})),n.jsxs("div",e.__assign({ref:w,onPointerDown:ee,onPointerMove:ne,onPointerUp:te,onPointerLeave:te,onClick:function(){Y(null),L(null),U(null)},style:{width:"100%",height:"100%",cursor:F?"grabbing":"grab",position:"relative"}},{children:[n.jsx("div",e.__assign({style:{transform:"translate(".concat(S.x,"px, ").concat(S.y,"px) scale(").concat(z,")"),transformOrigin:"top left",position:"absolute",top:_?70:50,left:20,transition:F?"none":"transform 0.08s ease-out"}},{children:n.jsxs("svg",e.__assign({width:G.canvasW,height:G.canvasH,style:{overflow:"visible"}},{children:[G.clusterBounds.map(function(t){var r,i,o,a,l;return n.jsxs("g",{children:[n.jsx("rect",{x:t.x,y:t.y,width:t.width,height:t.height,rx:"16",fill:le((null===(r=null==k?void 0:k.cluster)||void 0===r?void 0:r.backgroundColor)||(null===(i=null==k?void 0:k.cluster)||void 0===i?void 0:i.background),j?"rgba(30, 41, 59, 0.35)":"none"),stroke:le((null===(o=null==k?void 0:k.cluster)||void 0===o?void 0:o.borderColor)||(null===(a=null==k?void 0:k.cluster)||void 0===a?void 0:a.border),j?"#334155":"#e2e8f0"),strokeWidth:"1.5",strokeDasharray:"8 4"}),n.jsx("text",e.__assign({x:t.x+14,y:t.y+t.height-10,fontSize:"11",fill:le(null===(l=null==k?void 0:k.clusterLabel)||void 0===l?void 0:l.color,"#94a3b8"),fontFamily:"Inter, sans-serif",fontWeight:"500"},{children:t.label||"Cluster Name"}))]},t.id)}),G.edges.map(function(t){var r,i,o,a,l,s,d,c,u,f=b(t,J,G.edges);if(!f)return null;var g=V.has(t.id),v=(null==D?void 0:D.edge.id)===t.id,p=H===t.id,h=!!Q&&!g,x=g||v?(null===(r=null==k?void 0:k.activeEdge)||void 0===r?void 0:r.color)||(null===(i=null==k?void 0:k.activeEdge)||void 0===i?void 0:i.borderColor)||"#6366f1":p?(null===(o=null==k?void 0:k.edge)||void 0===o?void 0:o.color)||"#818cf8":(null===(a=null==k?void 0:k.edge)||void 0===a?void 0:a.borderColor)||(null===(l=null==k?void 0:k.edge)||void 0===l?void 0:l.color)||(j?"#475569":"#cbd5e1"),y=g||v?2.5:p?2:1.5;return n.jsxs("g",e.__assign({style:{opacity:h?.1:1,transition:"opacity 0.25s"}},{children:[n.jsx("path",{"data-edge-hit":"true",d:f,fill:"none",stroke:"transparent",strokeWidth:18,style:{cursor:"pointer"},onClick:function(e){return function(e,n){e.stopPropagation();var t=w.current.getBoundingClientRect();Y({edge:n,screenX:e.clientX-t.left,screenY:e.clientY-t.top}),L(null),U(null)}(e,t)},onMouseEnter:function(){return T(t.id)},onMouseLeave:function(){return T(null)}}),n.jsx("path",{d:f,fill:"none",stroke:x,strokeWidth:y,style:{transition:"stroke 0.2s, stroke-width 0.2s",pointerEvents:"none"}}),(g||v)&&n.jsxs(n.Fragment,{children:[n.jsx("circle",e.__assign({r:4,fill:(null===(s=null==k?void 0:k.edgeMarker)||void 0===s?void 0:s.color)||(null===(d=null==k?void 0:k.activeEdge)||void 0===d?void 0:d.color)||"#6366f1"},{children:n.jsx("animateMotion",{dur:"1.8s",repeatCount:"indefinite",path:f})})),n.jsx("circle",e.__assign({r:6,fill:(null===(c=null==k?void 0:k.edgeMarker)||void 0===c?void 0:c.color)||(null===(u=null==k?void 0:k.activeEdge)||void 0===u?void 0:u.color)||"#6366f1",opacity:.2},{children:n.jsx("animateMotion",{dur:"1.8s",repeatCount:"indefinite",path:f})}))]})]}),t.id)}),G.nodes.map(function(t){var r,i,o,a,l,s,d,c,x,y=Q===t.id,b=Z.has(t.id),_=!!Q&&!b,m=(null!==(r=K[t.cluster_id])&&void 0!==r?r:0)%h.length,M=h[m||0];return n.jsx("g",e.__assign({"data-node":"true",onClick:function(e){return function(e,n){e.stopPropagation();var t=w.current.getBoundingClientRect();Q===n.id?(U(null),L(null)):(U(n.id),L({node:n,screenX:e.clientX-t.left,screenY:e.clientY-t.top}),Y(null))}(e,t)},style:{cursor:"pointer",opacity:_?.15:1,transition:"opacity 0.25s"}},{children:n.jsx("foreignObject",e.__assign({x:t.x,y:t.y,width:u,height:f},{children:n.jsxs("div",e.__assign({style:e.__assign(e.__assign({background:(null===(i=null==k?void 0:k.node)||void 0===i?void 0:i.backgroundColor)||(null===(o=null==k?void 0:k.node)||void 0===o?void 0:o.background)||(j?"#1e293b":"#fff"),border:y?(null===(a=null==k?void 0:k.selectedNode)||void 0===a?void 0:a.border)||"2.5px solid ".concat((null===(l=null==k?void 0:k.selectedNode)||void 0===l?void 0:l.borderColor)||M):(null===(s=null==k?void 0:k.node)||void 0===s?void 0:s.border)||"1.5px solid ".concat((null===(d=null==k?void 0:k.node)||void 0===d?void 0:d.borderColor)||(j?"#334155":"#e2e8f0")),borderRadius:10,padding:"8px 14px",fontSize:13,fontWeight:600,color:j?"#f1f5f9":"#334155",fontFamily:"'Inter', sans-serif",display:"flex",alignItems:"center",gap:8,boxShadow:y?(null===(c=null==k?void 0:k.selectedNode)||void 0===c?void 0:c.boxShadow)||"0 0 0 3px ".concat(M,"33, 0 2px 8px rgba(0,0,0,0.4)"):(null===(x=null==k?void 0:k.node)||void 0===x?void 0:x.boxShadow)||(j?"0 2px 6px rgba(0,0,0,0.3)":"0 1px 3px rgba(0,0,0,0.05)"),whiteSpace:"nowrap",userSelect:"none",height:46,boxSizing:"border-box",transition:"border 0.2s, box-shadow 0.2s"},null==k?void 0:k.node),y?null==k?void 0:k.selectedNode:{})},{children:[n.jsx("span",e.__assign({style:e.__assign({width:22,height:22,borderRadius:6,background:g[m],display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,flexShrink:0,color:v[m]},null==k?void 0:k.nodeIcon)},{children:p[m]})),n.jsx("span",e.__assign({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:t.label||"Node name"}))]}))}))}),t.id)})]}))})),D&&n.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign(e.__assign({position:"absolute"},function(e,n,t,r){if(!w.current)return{};var i=w.current.getBoundingClientRect(),o=e+14,a=n-r/2;return o+t>i.width&&(o=e-t-14),a<8&&(a=8),a+r>i.height&&(a=i.height-r-8),{left:o,top:a}}(D.screenX,D.screenY,320,180)),{width:320,background:j?"#1e293b":"#fff",borderRadius:14,boxShadow:"0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06)",border:"1px solid #e2e8f0",zIndex:30,animation:"popIn 0.18s ease-out",overflow:"hidden"}),null==k?void 0:k.edgePopup)},{children:[n.jsxs("div",e.__assign({style:e.__assign({padding:"12px 16px 10px",background:"linear-gradient(135deg, #6366f1, #8b5cf6)",color:"#fff"},null==k?void 0:k.edgePopupHeader)},{children:[n.jsx("div",e.__assign({style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",opacity:.8}},{children:"Edge Reasoning"})),n.jsxs("div",e.__assign({style:{fontSize:13,fontWeight:600,marginTop:4}},{children:[(null===(o=J[D.edge.source])||void 0===o?void 0:o.label)||"Source",n.jsx("span",e.__assign({style:{opacity:.6,margin:"0 6px"}},{children:"→"})),(null===(a=J[D.edge.target])||void 0===a?void 0:a.label)||"Target"]}))]})),n.jsx("div",e.__assign({style:e.__assign({padding:"12px 16px 14px",fontSize:13,lineHeight:1.6,color:j?"#cbd5e1":"#475569",whiteSpace:"pre-line"},null==k?void 0:k.edgePopupBody)},{children:D.edge.reasoning||"No Reasoning available..."})),n.jsx("button",e.__assign({onClick:function(){return Y(null)},style:e.__assign({position:"absolute",top:8,right:10,background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",borderRadius:6,width:24,height:24,cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center"},null==k?void 0:k.popupCloseButton)},{children:"×"}))]}))]})),n.jsx("style",{children:"\n @keyframes popIn { from { opacity:0; transform:scale(0.95) translateY(4px); } to { opacity:1; transform:scale(1) translateY(0); } }\n @keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }\n "})]}))}var m=l.default.memo(function(r){var i=r.data,o=r.isDarkMode,a=void 0!==o&&o,l=r.style,d=t.useState(!1),c=d[0],u=d[1],f=l||{};f.fullscreenPaper,f.root,f.header,f.title,f.subtitle,f.controls,f.controlButton,f.nodePopup,f.edgePopup;var g=e.__rest(f,["fullscreenPaper","root","header","title","subtitle","controls","controlButton","nodePopup","edgePopup"]),v=l||{},p=t.useCallback(function(){u(!0)},[]),h=t.useCallback(function(){u(!1)},[]);return n.jsxs(n.Fragment,{children:[n.jsx("div",e.__assign({style:e.__assign({position:"relative",width:"100%",height:"500px"},g)},{children:n.jsx(_,{data:i,onFullscreen:p,isDarkMode:a,style:v})})),n.jsx(s.default,e.__assign({open:c,onClose:h,maxWidth:!1,PaperProps:{style:e.__assign({width:"95vw",height:"92vh",maxWidth:"none",borderRadius:12,overflow:"hidden",background:v.backgroundColor||v.background||(a?"#090d16":"#ffffff"),color:v.color||(a?"#f8fafc":"#1e293b")},v.fullscreenPaper)}},{children:n.jsx("div",e.__assign({style:{width:"100%",height:"100%",position:"relative",background:v.backgroundColor||v.background||(a?"#090d16":"#ffffff")}},{children:n.jsx(_,{data:i,onFullscreen:h,isFullscreen:!0,isDarkMode:a,style:v})}))}))]})});exports.default=m;
2
2
  //# sourceMappingURL=DependencyGraph.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),r=require("react"),i=require("react-markdown"),t=require("rehype-raw"),o=require("@mui/material"),a=require("react-syntax-highlighter"),l=require("react-syntax-highlighter/dist/esm/styles/prism"),s=require("@mui/icons-material"),d=require("@mui/icons-material/ExpandMoreOutlined"),c=require("./Cognitivereasoningpanel.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=u(r),f=u(i),g=u(t),h=u(d),v=function(e){var n,r,i;void 0===e&&(e="");var t=null==e?void 0:e.replace(/\\`/g,"`");return t=null==(t=null==(t=null===(i=null==(t=null===(r=null===(n=null==(t=null==t?void 0:t.replace(/```json\s*([\s\S]*?)```/g,function(e,n){return"<codebasename>".concat(n.trim(),"</codebasename>")}))?void 0:t.replace(/^```.*\n?/,""))||void 0===n?void 0:n.replace(/\n?```$/,""))||void 0===r?void 0:r.trim())?void 0:t.replace(/^```/,""))||void 0===i?void 0:i.replace(/```$/,""))?void 0:t.replace(/<\/summary>/g,"</summary>\n"))?void 0:t.replace(/<details>/g,"\n<details>")},_=function(i){var t=i.text,o=r.useState(!1),a=o[0],l=o[1];return n.jsxs("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.clipboard.writeText(t)];case 1:return e.sent(),l(!0),setTimeout(function(){return l(!1)},2e3),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}})})},"aria-label":"Copy code",style:{position:"absolute",top:8,right:8,display:"inline-flex",alignItems:"center",gap:4,padding:"3px 8px",fontSize:"0.68rem",fontWeight:500,fontFamily:"inherit",color:a?"#16a34a":"#6B7280",background:a?"#f0fdf4":"#f3f4f6",border:"1px solid ".concat(a?"#bbf7d0":"#e5e7eb"),borderRadius:6,cursor:"pointer",transition:"all 0.2s",opacity:.85},onMouseEnter:function(e){e.currentTarget.style.opacity="1"},onMouseLeave:function(e){e.currentTarget.style.opacity="0.85"}},{children:[a?n.jsx(s.Check,{style:{fontSize:13}}):n.jsx(s.ContentCopy,{style:{fontSize:13}}),a?"Copied":"Copy"]}))},x=function(i){i.node;var t=e.__rest(i,["node"]),o=r.useState(!1),a=o[0],l=o[1],d=r.useRef(null),c=p.default.Children.toArray(t.children),u=c.find(function(e){var n;return null===(n=null==e?void 0:e.props)||void 0===n?void 0:n["data-codebase-name"]}),f=!!u,g=f?u.props["data-codebase-name"]:"",h=c.map(function(e){var n;return"string"==typeof e?e:(null===(n=e.props)||void 0===n?void 0:n.children)||""}).join("").replace(/\*\*/g,"").trim(),v=f?"From ".concat(g," codebase"):h||"Accordion title not found";return r.useEffect(function(){var e,n=null===(e=d.current)||void 0===e?void 0:e.parentElement;if(n){var r=function(){return l(n.open)};return r(),n.addEventListener("toggle",r),function(){return n.removeEventListener("toggle",r)}}},[]),n.jsxs("summary",e.__assign({ref:d,style:{padding:"8px 12px",listStyleType:"none",cursor:"pointer",fontWeight:600,fontSize:"0.82rem",color:"#6932E2",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,borderRadius:8,background:a?"#f5f3ff":"transparent",transition:"background 0.2s"}},{children:[n.jsx("span",{children:v}),n.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",flexShrink:0,color:"#6932E2"}},{children:a?n.jsx(s.ExpandLess,{sx:{fontSize:"1.1rem"}}):n.jsx(s.ExpandMore,{sx:{fontSize:"1.1rem"}})}))]}))},m=function(i){var t=i.message,s=i.fontSize,d=i.extraMetaData,u=i.isDarkMode,m=void 0!==u&&u,b=i.style,y=i.sx,j=null!=s?s:"0.88rem",S=m?"#e2e8f0":"#1f2937",k=m?"#f8fafc":"#111827",w=r.useState({open:!1,data:null,activeKey:null}),M=w[0],C=w[1],z=function(){return C({open:!1,data:null,activeKey:null})},R=r.useMemo(function(){var e=function(e){var n={};return{processed:e.replace(/<!--\s*<ai_reasoning>\s*([\s\S]*?)\s*<\/ai_reasoning>\s*-->/g,function(e,r){try{var i=JSON.parse(r.trim()),t=i.id||"reasoning_".concat(Object.keys(n).length);return n[t]=i,'<aireasoning data-reasoning-key="'.concat(t,'">').concat(t,"</aireasoning>")}catch(e){return console.warn("[ai_reasoning] Failed to parse block:",e),""}}),reasoningMap:n}}(t||"");return{processedMessage:e.processed,inlineReasoningMap:e.reasoningMap}},[t]),W=R.processedMessage,E=R.inlineReasoningMap,q=r.useMemo(function(){return{aireasoning:function(r){r.node;var i=e.__rest(r,["node"])["data-reasoning-key"],t=E[i];if(!t)return null;var a=M.open&&M.activeKey===i;return n.jsxs("div",e.__assign({style:{margin:"6px 0"}},{children:[n.jsxs("span",e.__assign({onClick:function(e){e.stopPropagation();var n=function(e){var n,r,i,t,o,a=[];return(null!==(r=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==r?r:[]).forEach(function(e){var n,r,i,t,o,l,s,d,c,u,p=null!==(r=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==r?r:[],f=null!==(t=null===(i=e.customMetadata)||void 0===i?void 0:i.training_data_title)&&void 0!==t?t:[],g=null!==(l=null===(o=e.customMetadata)||void 0===o?void 0:o.paraphrase)&&void 0!==l?l:[],h=null===(s=p[0])||void 0===s?void 0:s.match(/<highlight>([\s\S]*?)<\/highlight>/),v=h?h[1].trim():null!==(d=p[0])&&void 0!==d?d:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(c=f[0])&&void 0!==c?c:"",paraphrase:null!==(u=g[0])&&void 0!==u?u:"",highlight:v})}),{block_cognitive_reasoning_html:null!==(i=e.reasoning)&&void 0!==i?i:"",block_cognitive_gap_html:null!==(t=e.Gap)&&void 0!==t?t:"",block_cognitive_confidence:Number(null!==(o=e.decision_strength)&&void 0!==o?o:0),block_cognitive_citations:a}}(t);C(function(e){return e.open&&e.activeKey===i?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:i}})},style:{display:"inline-flex",alignItems:"center",gap:6,cursor:"pointer",color:m?"#a78bfa":"#6932E2",fontWeight:500,fontSize:j,transition:"all 0.2s",padding:"2px 0"}},{children:[n.jsx("span",{children:i}),n.jsx("span",e.__assign({style:{display:"inline-flex",alignItems:"center",gap:2,border:m?"1px solid #334155":"1px solid #e2e8f0",borderRadius:5,padding:"4px 2px"}},{children:n.jsx(h.default,{sx:{fontSize:"1rem",color:m?"#94a3b8":"#475569",transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})}))]})),a&&M.data&&n.jsx(o.Box,e.__assign({component:"div",onClick:function(e){return e.stopPropagation()},sx:{display:"block",width:"fit-content",maxWidth:"100%",mt:1,mb:1,ml:0}},{children:n.jsx(c.default,{open:!0,onClose:z,data:M.data})}))]}))},codebasename:function(r){var i=r.children,t=("string"==typeof i[0]?i[0]:"").trim();return""!==t?n.jsxs("div",e.__assign({"data-codebase-name":t,style:{position:"relative",margin:"12px 0"}},{children:[n.jsx(_,{text:String(i).replace(/\n$/,"")}),n.jsx(a.Prism,e.__assign({style:l.oneLight,language:"json",PreTag:"div",customStyle:{borderRadius:8,padding:"1rem",fontSize:"0.8rem",border:m?"1px solid #334155":"1px solid #e5e7eb",margin:0,lineHeight:1.6}},{children:String(i).replace(/\n$/,"")}))]})):n.jsx(n.Fragment,{})},details:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("details",e.__assign({},i,{style:{borderRadius:8,border:m?"1px solid #334155":"1px solid #e9e5f5",backgroundColor:"transparent",margin:"8px 0",overflow:"hidden"}},{children:i.children}))},summary:x,p:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("p",e.__assign({style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"block",maxWidth:"100%",fontSize:j,lineHeight:1.7,margin:"4px 0",color:S}},{children:null==i?void 0:i.children}))},strong:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("strong",e.__assign({style:{fontWeight:650,color:k}},{children:null==i?void 0:i.children}))},h1:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("h1",e.__assign({style:{fontSize:"1.35rem",fontWeight:700,color:k,margin:"20px 0 8px",lineHeight:1.3,letterSpacing:"-0.01em"}},{children:i.children}))},h2:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("h2",e.__assign({style:{fontSize:"1.15rem",fontWeight:650,color:k,margin:"16px 0 6px",lineHeight:1.35}},{children:i.children}))},h3:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("h3",e.__assign({style:{fontSize:"1rem",fontWeight:600,color:k,margin:"14px 0 4px",lineHeight:1.4}},{children:i.children}))},h4:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("h4",e.__assign({style:{fontSize:"0.92rem",fontWeight:600,color:S,margin:"12px 0 4px",lineHeight:1.4}},{children:i.children}))},ol:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("ol",e.__assign({style:{listStyleType:"decimal",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==i?void 0:i.children}))},ul:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("ul",e.__assign({style:{listStyleType:"disc",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==i?void 0:i.children}))},li:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("li",e.__assign({style:{fontSize:j,lineHeight:1.7,color:S,paddingLeft:4}},{children:i.children}))},blockquote:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("blockquote",e.__assign({style:{margin:"12px 0",padding:"8px 16px",borderLeft:"3px solid #8b5cf6",background:m?"#1e1b4b":"#faf5ff",borderRadius:"0 6px 6px 0",color:m?"#cbd5e1":"#4b5563",fontStyle:"italic",fontSize:j,lineHeight:1.65}},{children:i.children}))},hr:function(){return n.jsx("hr",{style:{border:"none",height:1,background:m?"linear-gradient(to right, transparent, #334155, transparent)":"linear-gradient(to right, transparent, #d1d5db, transparent)",margin:"16px 0"}})},table:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("div",e.__assign({style:{overflowX:"auto",margin:"12px 0",borderRadius:8,border:m?"1px solid #334155":"1px solid #e5e7eb"}},{children:n.jsx("table",e.__assign({style:{width:"100%",borderCollapse:"collapse",fontSize:"0.8rem",lineHeight:1.5}},{children:i.children}))}))},thead:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("thead",e.__assign({style:{background:m?"#1e293b":"#f9fafb",borderBottom:m?"2px solid #334155":"2px solid #e5e7eb"}},{children:i.children}))},th:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("th",e.__assign({style:{padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:"0.76rem",color:m?"#cbd5e1":"#374151",whiteSpace:"nowrap"}},{children:i.children}))},td:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("td",e.__assign({style:{padding:"8px 12px",borderTop:m?"1px solid #334155":"1px solid #f3f4f6",color:m?"#94a3b8":"#4b5563",fontSize:"0.8rem"}},{children:i.children}))},a:function(r){var i=r.children;r.node;var t=e.__rest(r,["children","node"]),a=t["data-cognitive-reasoning"];if(a&&(null==d?void 0:d[a]))return n.jsxs(n.Fragment,{children:[n.jsxs("span",e.__assign({onClick:function(e){e.stopPropagation();var n=function(e){var n,r,i,t,o;if(!e)return null;var a=[];return(null!==(r=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==r?r:[]).forEach(function(e){var n,r,i,t,o,l,s,d,c,u,p=null!==(r=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==r?r:[],f=null!==(t=null===(i=e.customMetadata)||void 0===i?void 0:i.training_data_title)&&void 0!==t?t:[],g=null!==(l=null===(o=e.customMetadata)||void 0===o?void 0:o.paraphrase)&&void 0!==l?l:[],h=null===(s=p[0])||void 0===s?void 0:s.match(/<highlight>([\s\S]*?)<\/highlight>/),v=h?h[1].trim():null!==(d=p[0])&&void 0!==d?d:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(c=f[0])&&void 0!==c?c:"",paraphrase:null!==(u=g[0])&&void 0!==u?u:"",highlight:v})}),{block_cognitive_reasoning_html:null!==(i=e.Reasoning)&&void 0!==i?i:"",block_cognitive_gap_html:null!==(t=e.Gap)&&void 0!==t?t:"",block_cognitive_confidence:Number(null!==(o=e.Confidence_score)&&void 0!==o?o:0),block_cognitive_citations:a}}(d[a]);C(function(e){return e.open&&e.activeKey===a?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:a}})},style:{color:m?"#a78bfa":"#6932E2",fontWeight:500,cursor:"pointer",transition:"all 0.2s",padding:"0 2px",position:"relative",display:"flex",alignItems:"center",gap:6,width:"fit-content"}},{children:[i||"",n.jsx("span",e.__assign({style:{cursor:"pointer",padding:"4px 2px",display:"flex",alignItems:"center",gap:2,border:m?"1px solid #334155":"1px solid #e2e8f0",borderRadius:"5px",width:"fit-content"}},{children:n.jsx(h.default,{sx:{fontSize:"1rem",color:m?"#94a3b8":"#475569",transition:"transform 0.2s"}})}))]})),M.open&&M.activeKey===a&&M.data&&n.jsx(o.Box,e.__assign({component:"div",onClick:function(e){return e.stopPropagation()},sx:{display:"block",width:"fit-content",maxWidth:"100%",mt:1,mb:1,ml:0}},{children:n.jsx(c.default,{open:!0,onClose:z,data:M.data})}))]});var l=!1;try{l=new URL(null==t?void 0:t.href).protocol.startsWith("http")}catch(e){l=!1}return l?n.jsx("a",e.__assign({href:null==t?void 0:t.href,style:{color:m?"#a78bfa":"#6932E2",textDecoration:"none",fontWeight:500,borderBottom:m?"1px solid #7c3aed":"1px solid #c4b5fd",transition:"border-color 0.2s, color 0.2s"},target:"_blank",rel:"noopener noreferrer",onMouseEnter:function(e){e.currentTarget.style.borderBottomColor=m?"#a78bfa":"#6932E2"},onMouseLeave:function(e){e.currentTarget.style.borderBottomColor=m?"#7c3aed":"#c4b5fd"}},{children:i})):n.jsx("span",{children:i})},sup:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx(o.Tooltip,e.__assign({title:i.children,placement:"top",arrow:!0},{children:n.jsx(o.Box,e.__assign({component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:16,borderRadius:"50%",background:m?"#3730a3":"#ede9fe",color:m?"#c084fc":"#7c3aed",fontSize:"0.6rem",fontWeight:700,verticalAlign:"super",cursor:"pointer",userSelect:"none",lineHeight:1,transition:"all 0.2s","&:hover":{background:m?"#6d28d9":"#7c3aed",color:"#fff"}},"aria-label":"Info",role:"button"},{children:"i"}))}))},code:function(r){var i=r.children;return n.jsx("code",e.__assign({style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.82em",color:m?"#e9d5ff":"#9333ea",background:m?"#2e1065":"#faf5ff",padding:"1.5px 5px",borderRadius:4,border:m?"1px solid #581c87":"1px solid #f3e8ff",fontWeight:500}},{children:i}))},pre:function(r){var i=r.children,t=function(e){var n;return"string"==typeof e?e:(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?(Array.isArray(e.props.children)?e.props.children:[e.props.children]).map(t).join(""):""},o=p.default.Children.toArray(i).map(t).join("");return n.jsxs("div",e.__assign({style:{position:"relative",margin:"12px 0"}},{children:[n.jsx(_,{text:o}),n.jsx("pre",e.__assign({style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.8rem",lineHeight:1.6,color:S,background:m?"#0f172a":"#f9fafb",border:m?"1px solid #334155":"1px solid #e5e7eb",borderRadius:8,padding:"14px 16px",margin:0,overflowX:"auto",whiteSpace:"pre"}},{children:i}))]}))},img:function(r){r.node;var i=e.__rest(r,["node"]);return n.jsx("img",e.__assign({},i,{style:{maxWidth:"100%",height:"auto",borderRadius:8,margin:"8px 0",border:m?"1px solid #334155":"1px solid #e5e7eb"},loading:"lazy"}))}}},[t,j,d,M.activeKey,M.open,E,m,S,k]);return n.jsx(o.Box,e.__assign({className:"pg-markdown-renderer",style:b,sx:e.__assign(e.__assign({fontSize:j,lineHeight:1.7,color:S,wordBreak:"break-word",position:"relative"},y),{"& span[style*='color'], & font[color]":m?{color:"#60a5fa !important"}:{},"& a":{color:m?"#a78bfa !important":"#6932E2 !important"},"& strong":{color:m?"#f8fafc !important":"#111827 !important"},"& h1, & h2, & h3, & h4, & h5, & h6":{color:m?"#f1f5f9 !important":"#111827 !important"}})},{children:n.jsx(f.default,e.__assign({components:q,rehypePlugins:[g.default],className:"react-markdown-renderer-with-overrides"},{children:v(W)}))}))};exports.MarkdownRenderer=m,exports.default=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),r=require("react-markdown"),t=require("rehype-raw"),o=require("@mui/material"),a=require("react-syntax-highlighter"),l=require("react-syntax-highlighter/dist/esm/styles/prism"),s=require("@mui/icons-material"),d=require("@mui/icons-material/ExpandMoreOutlined"),c=require("./Cognitivereasoningpanel.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=u(i),g=u(r),f=u(t),h=u(d),v=function(e){var n,i,r;void 0===e&&(e="");var t=null==e?void 0:e.replace(/\\`/g,"`");return t=null==(t=null==(t=null===(r=null==(t=null===(i=null===(n=null==(t=null==t?void 0:t.replace(/```json\s*([\s\S]*?)```/g,function(e,n){return"<codebasename>".concat(n.trim(),"</codebasename>")}))?void 0:t.replace(/^```.*\n?/,""))||void 0===n?void 0:n.replace(/\n?```$/,""))||void 0===i?void 0:i.trim())?void 0:t.replace(/^```/,""))||void 0===r?void 0:r.replace(/```$/,""))?void 0:t.replace(/<\/summary>/g,"</summary>\n"))?void 0:t.replace(/<details>/g,"\n<details>")},_=function(r){var t=r.text,o=i.useState(!1),a=o[0],l=o[1];return n.jsxs("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.clipboard.writeText(t)];case 1:return e.sent(),l(!0),setTimeout(function(){return l(!1)},2e3),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}})})},"aria-label":"Copy code",style:{position:"absolute",top:8,right:8,display:"inline-flex",alignItems:"center",gap:4,padding:"3px 8px",fontSize:"0.68rem",fontWeight:500,fontFamily:"inherit",color:a?"#16a34a":"#6B7280",background:a?"#f0fdf4":"#f3f4f6",border:"1px solid ".concat(a?"#bbf7d0":"#e5e7eb"),borderRadius:6,cursor:"pointer",transition:"all 0.2s",opacity:.85},onMouseEnter:function(e){e.currentTarget.style.opacity="1"},onMouseLeave:function(e){e.currentTarget.style.opacity="0.85"}},{children:[a?n.jsx(s.Check,{style:{fontSize:13}}):n.jsx(s.ContentCopy,{style:{fontSize:13}}),a?"Copied":"Copy"]}))},x=function(r){r.node;var t=e.__rest(r,["node"]),o=i.useState(!1),a=o[0],l=o[1],d=i.useRef(null),c=p.default.Children.toArray(t.children),u=c.find(function(e){var n;return null===(n=null==e?void 0:e.props)||void 0===n?void 0:n["data-codebase-name"]}),g=!!u,f=g?u.props["data-codebase-name"]:"",h=c.map(function(e){var n;return"string"==typeof e?e:(null===(n=e.props)||void 0===n?void 0:n.children)||""}).join("").replace(/\*\*/g,"").trim(),v=g?"From ".concat(f," codebase"):h||"Accordion title not found";return i.useEffect(function(){var e,n=null===(e=d.current)||void 0===e?void 0:e.parentElement;if(n){var i=function(){return l(n.open)};return i(),n.addEventListener("toggle",i),function(){return n.removeEventListener("toggle",i)}}},[]),n.jsxs("summary",e.__assign({ref:d,style:{padding:"8px 12px",listStyleType:"none",cursor:"pointer",fontWeight:600,fontSize:"0.82rem",color:"#6932E2",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,borderRadius:8,background:a?"#f5f3ff":"transparent",transition:"background 0.2s"}},{children:[n.jsx("span",{children:v}),n.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",flexShrink:0,color:"#6932E2"}},{children:a?n.jsx(s.ExpandLess,{sx:{fontSize:"1.1rem"}}):n.jsx(s.ExpandMore,{sx:{fontSize:"1.1rem"}})}))]}))},m=function(r){var t=r.message,s=r.fontSize,d=r.extraMetaData,u=r.isDarkMode,m=void 0!==u&&u,b=r.cognitiveDecisioningStyles,y=r.style,j=r.sx,S=null!=s?s:"0.88rem",k=m?"#e2e8f0":"#1f2937",w=m?"#f8fafc":"#111827",M=i.useState({open:!1,data:null,activeKey:null}),C=M[0],z=M[1],R=function(){return z({open:!1,data:null,activeKey:null})},W=i.useMemo(function(){var e=function(e){var n={};return{processed:e.replace(/<!--\s*<ai_reasoning>\s*([\s\S]*?)\s*<\/ai_reasoning>\s*-->/g,function(e,i){try{var r=JSON.parse(i.trim()),t=r.id||"reasoning_".concat(Object.keys(n).length);return n[t]=r,'<aireasoning data-reasoning-key="'.concat(t,'">').concat(t,"</aireasoning>")}catch(e){return console.warn("[ai_reasoning] Failed to parse block:",e),""}}),reasoningMap:n}}(t||"");return{processedMessage:e.processed,inlineReasoningMap:e.reasoningMap}},[t]),E=W.processedMessage,q=W.inlineReasoningMap,B=i.useMemo(function(){return{aireasoning:function(i){i.node;var r=e.__rest(i,["node"])["data-reasoning-key"],t=q[r];if(!t)return null;var a=C.open&&C.activeKey===r;return n.jsxs("div",e.__assign({style:{margin:"6px 0"}},{children:[n.jsxs("span",e.__assign({onClick:function(e){e.stopPropagation();var n=function(e){var n,i,r,t,o,a=[];return(null!==(i=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==i?i:[]).forEach(function(e){var n,i,r,t,o,l,s,d,c,u,p=null!==(i=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==i?i:[],g=null!==(t=null===(r=e.customMetadata)||void 0===r?void 0:r.training_data_title)&&void 0!==t?t:[],f=null!==(l=null===(o=e.customMetadata)||void 0===o?void 0:o.paraphrase)&&void 0!==l?l:[],h=null===(s=p[0])||void 0===s?void 0:s.match(/<highlight>([\s\S]*?)<\/highlight>/),v=h?h[1].trim():null!==(d=p[0])&&void 0!==d?d:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(c=g[0])&&void 0!==c?c:"",paraphrase:null!==(u=f[0])&&void 0!==u?u:"",highlight:v})}),{block_cognitive_reasoning_html:null!==(r=e.reasoning)&&void 0!==r?r:"",block_cognitive_gap_html:null!==(t=e.Gap)&&void 0!==t?t:"",block_cognitive_confidence:Number(null!==(o=e.decision_strength)&&void 0!==o?o:0),block_cognitive_citations:a}}(t);z(function(e){return e.open&&e.activeKey===r?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:r}})},style:{display:"inline-flex",alignItems:"center",gap:6,cursor:"pointer",color:m?"#a78bfa":"#6932E2",fontWeight:500,fontSize:S,transition:"all 0.2s",padding:"2px 0"}},{children:[n.jsx("span",{children:r}),n.jsx("span",e.__assign({style:{display:"inline-flex",alignItems:"center",gap:2,border:m?"1px solid #334155":"1px solid #e2e8f0",borderRadius:5,padding:"4px 2px"}},{children:n.jsx(h.default,{sx:{fontSize:"1rem",color:m?"#94a3b8":"#475569",transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})}))]})),a&&C.data&&n.jsx(o.Box,e.__assign({component:"div",onClick:function(e){return e.stopPropagation()},sx:{display:"block",width:"fit-content",maxWidth:"100%",mt:1,mb:1,ml:0}},{children:n.jsx(c.default,{open:!0,onClose:R,data:C.data,styles:b})}))]}))},codebasename:function(i){var r=i.children,t=("string"==typeof r[0]?r[0]:"").trim();return""!==t?n.jsxs("div",e.__assign({"data-codebase-name":t,style:{position:"relative",margin:"12px 0"}},{children:[n.jsx(_,{text:String(r).replace(/\n$/,"")}),n.jsx(a.Prism,e.__assign({style:l.oneLight,language:"json",PreTag:"div",customStyle:{borderRadius:8,padding:"1rem",fontSize:"0.8rem",border:m?"1px solid #334155":"1px solid #e5e7eb",margin:0,lineHeight:1.6}},{children:String(r).replace(/\n$/,"")}))]})):n.jsx(n.Fragment,{})},details:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("details",e.__assign({},r,{style:{borderRadius:8,border:m?"1px solid #334155":"1px solid #e9e5f5",backgroundColor:"transparent",margin:"8px 0",overflow:"hidden"}},{children:r.children}))},summary:x,p:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("p",e.__assign({style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"block",maxWidth:"100%",fontSize:S,lineHeight:1.7,margin:"4px 0",color:k}},{children:null==r?void 0:r.children}))},strong:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("strong",e.__assign({style:{fontWeight:650,color:w}},{children:null==r?void 0:r.children}))},h1:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({style:{fontSize:"1.35rem",fontWeight:700,color:w,margin:"20px 0 8px",lineHeight:1.3,letterSpacing:"-0.01em"}},{children:r.children}))},h2:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({style:{fontSize:"1.15rem",fontWeight:650,color:w,margin:"16px 0 6px",lineHeight:1.35}},{children:r.children}))},h3:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({style:{fontSize:"1rem",fontWeight:600,color:w,margin:"14px 0 4px",lineHeight:1.4}},{children:r.children}))},h4:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("h4",e.__assign({style:{fontSize:"0.92rem",fontWeight:600,color:k,margin:"12px 0 4px",lineHeight:1.4}},{children:r.children}))},ol:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("ol",e.__assign({style:{listStyleType:"decimal",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==r?void 0:r.children}))},ul:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({style:{listStyleType:"disc",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==r?void 0:r.children}))},li:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("li",e.__assign({style:{fontSize:S,lineHeight:1.7,color:k,paddingLeft:4}},{children:r.children}))},blockquote:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("blockquote",e.__assign({style:{margin:"12px 0",padding:"8px 16px",borderLeft:"3px solid #8b5cf6",background:m?"#1e1b4b":"#faf5ff",borderRadius:"0 6px 6px 0",color:m?"#cbd5e1":"#4b5563",fontStyle:"italic",fontSize:S,lineHeight:1.65}},{children:r.children}))},hr:function(){return n.jsx("hr",{style:{border:"none",height:1,background:m?"linear-gradient(to right, transparent, #334155, transparent)":"linear-gradient(to right, transparent, #d1d5db, transparent)",margin:"16px 0"}})},table:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("div",e.__assign({style:{overflowX:"auto",margin:"12px 0",borderRadius:8,border:m?"1px solid #334155":"1px solid #e5e7eb"}},{children:n.jsx("table",e.__assign({style:{width:"100%",borderCollapse:"collapse",fontSize:"0.8rem",lineHeight:1.5}},{children:r.children}))}))},thead:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("thead",e.__assign({style:{background:m?"#1e293b":"#f9fafb",borderBottom:m?"2px solid #334155":"2px solid #e5e7eb"}},{children:r.children}))},th:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("th",e.__assign({style:{padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:"0.76rem",color:m?"#cbd5e1":"#374151",whiteSpace:"nowrap"}},{children:r.children}))},td:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("td",e.__assign({style:{padding:"8px 12px",borderTop:m?"1px solid #334155":"1px solid #f3f4f6",color:m?"#94a3b8":"#4b5563",fontSize:"0.8rem"}},{children:r.children}))},a:function(i){var r=i.children;i.node;var t=e.__rest(i,["children","node"]),a=t["data-cognitive-reasoning"];if(a&&(null==d?void 0:d[a]))return n.jsxs(n.Fragment,{children:[n.jsxs("span",e.__assign({onClick:function(e){e.stopPropagation();var n=function(e){var n,i,r,t,o;if(!e)return null;var a=[];return(null!==(i=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==i?i:[]).forEach(function(e){var n,i,r,t,o,l,s,d,c,u,p=null!==(i=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==i?i:[],g=null!==(t=null===(r=e.customMetadata)||void 0===r?void 0:r.training_data_title)&&void 0!==t?t:[],f=null!==(l=null===(o=e.customMetadata)||void 0===o?void 0:o.paraphrase)&&void 0!==l?l:[],h=null===(s=p[0])||void 0===s?void 0:s.match(/<highlight>([\s\S]*?)<\/highlight>/),v=h?h[1].trim():null!==(d=p[0])&&void 0!==d?d:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(c=g[0])&&void 0!==c?c:"",paraphrase:null!==(u=f[0])&&void 0!==u?u:"",highlight:v})}),{block_cognitive_reasoning_html:null!==(r=e.Reasoning)&&void 0!==r?r:"",block_cognitive_gap_html:null!==(t=e.Gap)&&void 0!==t?t:"",block_cognitive_confidence:Number(null!==(o=e.Confidence_score)&&void 0!==o?o:0),block_cognitive_citations:a}}(d[a]);z(function(e){return e.open&&e.activeKey===a?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:a}})},style:{color:m?"#a78bfa":"#6932E2",fontWeight:500,cursor:"pointer",transition:"all 0.2s",padding:"0 2px",position:"relative",display:"flex",alignItems:"center",gap:6,width:"fit-content"}},{children:[r||"",n.jsx("span",e.__assign({style:{cursor:"pointer",padding:"4px 2px",display:"flex",alignItems:"center",gap:2,border:m?"1px solid #334155":"1px solid #e2e8f0",borderRadius:"5px",width:"fit-content"}},{children:n.jsx(h.default,{sx:{fontSize:"1rem",color:m?"#94a3b8":"#475569",transition:"transform 0.2s"}})}))]})),C.open&&C.activeKey===a&&C.data&&n.jsx(o.Box,e.__assign({component:"div",onClick:function(e){return e.stopPropagation()},sx:{display:"block",width:"fit-content",maxWidth:"100%",mt:1,mb:1,ml:0}},{children:n.jsx(c.default,{open:!0,onClose:R,data:C.data,styles:b})}))]});var l=!1;try{l=new URL(null==t?void 0:t.href).protocol.startsWith("http")}catch(e){l=!1}return l?n.jsx("a",e.__assign({href:null==t?void 0:t.href,style:{color:m?"#a78bfa":"#6932E2",textDecoration:"none",fontWeight:500,borderBottom:m?"1px solid #7c3aed":"1px solid #c4b5fd",transition:"border-color 0.2s, color 0.2s"},target:"_blank",rel:"noopener noreferrer",onMouseEnter:function(e){e.currentTarget.style.borderBottomColor=m?"#a78bfa":"#6932E2"},onMouseLeave:function(e){e.currentTarget.style.borderBottomColor=m?"#7c3aed":"#c4b5fd"}},{children:r})):n.jsx("span",{children:r})},sup:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx(o.Tooltip,e.__assign({title:r.children,placement:"top",arrow:!0},{children:n.jsx(o.Box,e.__assign({component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:16,borderRadius:"50%",background:m?"#3730a3":"#ede9fe",color:m?"#c084fc":"#7c3aed",fontSize:"0.6rem",fontWeight:700,verticalAlign:"super",cursor:"pointer",userSelect:"none",lineHeight:1,transition:"all 0.2s","&:hover":{background:m?"#6d28d9":"#7c3aed",color:"#fff"}},"aria-label":"Info",role:"button"},{children:"i"}))}))},code:function(i){var r=i.children;return n.jsx("code",e.__assign({style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.82em",color:m?"#e9d5ff":"#9333ea",background:m?"#2e1065":"#faf5ff",padding:"1.5px 5px",borderRadius:4,border:m?"1px solid #581c87":"1px solid #f3e8ff",fontWeight:500}},{children:r}))},pre:function(i){var r=i.children,t=function(e){var n;return"string"==typeof e?e:(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?(Array.isArray(e.props.children)?e.props.children:[e.props.children]).map(t).join(""):""},o=p.default.Children.toArray(r).map(t).join("");return n.jsxs("div",e.__assign({style:{position:"relative",margin:"12px 0"}},{children:[n.jsx(_,{text:o}),n.jsx("pre",e.__assign({style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.8rem",lineHeight:1.6,color:k,background:m?"#0f172a":"#f9fafb",border:m?"1px solid #334155":"1px solid #e5e7eb",borderRadius:8,padding:"14px 16px",margin:0,overflowX:"auto",whiteSpace:"pre"}},{children:r}))]}))},img:function(i){i.node;var r=e.__rest(i,["node"]);return n.jsx("img",e.__assign({},r,{style:{maxWidth:"100%",height:"auto",borderRadius:8,margin:"8px 0",border:m?"1px solid #334155":"1px solid #e5e7eb"},loading:"lazy"}))}}},[t,S,d,C.activeKey,C.open,b,q,m,k,w]);return n.jsx(o.Box,e.__assign({className:"pg-markdown-renderer",style:y,sx:e.__assign(e.__assign({fontSize:S,lineHeight:1.7,color:k,wordBreak:"break-word",position:"relative"},j),{"& span[style*='color'], & font[color]":m?{color:"#60a5fa !important"}:{},"& a":{color:m?"#a78bfa !important":"#6932E2 !important"},"& strong":{color:m?"#f8fafc !important":"#111827 !important"},"& h1, & h2, & h3, & h4, & h5, & h6":{color:m?"#f1f5f9 !important":"#111827 !important"}})},{children:n.jsx(g.default,e.__assign({components:B,rehypePlugins:[f.default],className:"react-markdown-renderer-with-overrides"},{children:v(E)}))}))};exports.MarkdownRenderer=m,exports.default=m;
2
2
  //# sourceMappingURL=Markdownrenderer.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("@mui/material"),t=require("@mui/icons-material/ExpandMore"),s=require("@mui/icons-material/Fullscreen"),r=require("@mui/icons-material/Close"),l=require("@mui/icons-material/NearMeOutlined"),a=require("@mui/icons-material/ChevronLeft"),d=require("@mui/icons-material/ChevronRight"),c=require("./DependencyGraph.js"),x=require("./Markdownrenderer.js"),p=require("./Internaleditor.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=h(t),g=h(s),f=h(r),_=h(l),m=h(a),y=h(d),j=function(t){var s=t.text,r=t.detailedSummary,l=t.extraMetaData,a=t.isDarkMode,d=void 0!==a&&a,c=t.markdownRendererStyle,p=n.useState(!1),h=p[0],u=p[1],g=function(e,i){void 0===i&&(i=220);var n=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(n.length<=i)return{preview:n,truncated:!1};var o=n.slice(0,i),t=o.lastIndexOf(" ");return{preview:(t>0?o.slice(0,t):o).trim(),truncated:!0}}(s),f=g.preview,_=g.truncated;return i.jsx(o.Box,{children:h?i.jsxs(o.Box,{children:[i.jsx(x.MarkdownRenderer,{message:s,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,style:c}),(null==r?void 0:r.trim())&&i.jsx(x.MarkdownRenderer,{message:r,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,style:c}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:d?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[f,_&&"…"]})),(_||(null==r?void 0:r.trim()))&&i.jsx(o.Box,e.__assign({sx:{display:"flex",justifyContent:"flex-end"}},{children:i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},v=function(t){var s=t.text,r=t.extraMetaData,l=n.useState(!1),a=l[0],d=l[1],c=n.useState(!1),p=c[0],h=c[1],u=n.useRef(null);return n.useEffect(function(){var e=u.current;e&&h(e.scrollWidth>e.clientWidth)},[s]),i.jsx(o.Box,e.__assign({sx:{pl:1}},{children:a?i.jsxs(o.Box,e.__assign({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[i.jsx(x.MarkdownRenderer,{message:s,fontSize:"0.68rem",extraMetaData:r}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return d(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]})):i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({ref:u,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:s})),p&&i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return d(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))};exports.default=function(t){var s,r=t.promptContent,l=t.promptTitle,a=t.isLoading,d=void 0!==a&&a,h=t.overviewSummary,b=t.functionalityOfSPB,S=void 0===b?[]:b,w=t.spbAdditionalInfo,B=t.extraMetaData,k=t.showCodePanel,E=void 0===k||k,D=t.showInlineApbEditor,z=void 0===D||D,M=t.showCollapseStrip,T=void 0===M||M,A=t.showFullscreenButton,R=void 0===A||A,C=t.showFullscreenModal,I=void 0===C||C,F=t.showThemeToggle,W=void 0===F||F,P=t.isDarkMode,H=void 0===P||P,L=t.styles,q=t.className,O=t.style,G=t.sx,N=n.useState(null),X=N[0],Y=N[1],J=n.useState(null),K=J[0],Q=J[1],U=n.useState(""),V=U[0],Z=U[1],$=void 0!==(null==L?void 0:L.isDarkMode)?L.isDarkMode:H,ee=n.useState($),ie=ee[0],ne=ee[1],oe=n.useState(null),te=oe[0],se=oe[1];n.useEffect(function(){void 0!==(null==L?void 0:L.isDarkMode)&&ne(L.isDarkMode)},[null==L?void 0:L.isDarkMode]);var re=n.useState(!1),le=re[0],ae=re[1],de=n.useState(480),ce=de[0],xe=de[1],pe=n.useRef(!1),he=n.useRef(null);n.useEffect(function(){var e,i,n;S.length>0&&Y((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),n=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(n||"")))},[S]),n.useEffect(function(){d&&Y(null)},[d]),n.useEffect(function(){te&&(Z(""),setTimeout(function(){return Z(te.ref)},500))},[te]);return i.jsxs(o.Box,e.__assign({className:q,style:e.__assign(e.__assign({},null==L?void 0:L.root),O),sx:e.__assign({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},G)},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==L?void 0:L.header)},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==L?void 0:L.headerTitle)},{children:l||"SPB Analysis"})),i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:"0.7rem",color:"#9CA3AF"},null==L?void 0:L.headerSubtitle)},{children:X?"Last Analyzed at ".concat(X):""}))]}))})),i.jsxs(o.Box,e.__assign({ref:he,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({width:E?le&&T?0:ce:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:pe.current?"none":"width 0.15s",borderRight:!E||le&&T?"none":"1px solid #e5e7eb"},null==L?void 0:L.leftPanel)},{children:i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==L?void 0:L.overviewSection)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==L?void 0:L.overviewTitle)},{children:"Overview"})),i.jsx(o.Box,e.__assign({sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==L?void 0:L.overviewContent)},{children:(null===(s=null==h?void 0:h.overallSummary)||void 0===s?void 0:s.trim())?i.jsx(j,{text:h.overallSummary,detailedSummary:h.detailedSummary,extraMetaData:B,isDarkMode:ie,markdownRendererStyle:null==L?void 0:L.markdownRenderer}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"95%",height:14})]}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==L?void 0:L.functionalitySection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==L?void 0:L.functionalityTitle)},{children:"Functionality of SPB"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:S.length>0?S.map(function(n,t){return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:0===t,sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==L?void 0:L.functionalityItem)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i.jsxs(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[t+1,". ",n.name||n.section_name]}))})),i.jsxs(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[i.jsx(x.MarkdownRenderer,{fontSize:"0.74rem",message:n.description||n.reason_for_inclusion||"",extraMetaData:B}),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:n.apb_references.map(function(n,t){var s="string"==typeof n?n:n.apb_name,l=K===s;return i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i.jsxs(o.Box,e.__assign({onClick:function(){return function(e){K===e?(Q(null),Z("")):(Q(e),Z(""),setTimeout(function(){return Z(e)},50))}(s)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:"pointer"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.78rem",color:l?"#5928ed":"#DB2877",fontWeight:500}},{children:[t+1,". ",s]})),i.jsx(_.default,{sx:{fontSize:"0.75rem",color:l?"#5928ed":"#DB2877"}})]})),"string"!=typeof n&&(n.description||n.context)&&i.jsx(v,{text:n.description||n.context||"",extraMetaData:B}),z&&l&&i.jsx(o.Box,e.__assign({sx:{mt:1,height:260,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:V,isDarkMode:ie,height:"100%",fontSize:12})}))]}),t)})}))]}))]}),t)}):i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(n){return i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"40%",height:16}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"30%",height:14})]}),n)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==L?void 0:L.applicabilitySection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==L?void 0:L.applicabilityTitle)},{children:"Applicability"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:i.jsx(o.Box,e.__assign({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==w?void 0:w.when_to_apply},{label:"When NOT to apply",content:null==w?void 0:w.when_not_to_apply}].map(function(n){var t=n.label,s=n.content;return i.jsxs(o.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:t})),s?i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:s,isDarkMode:ie,style:null==L?void 0:L.markdownRenderer,extraMetaData:B}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),t)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==L?void 0:L.specificationsSection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==L?void 0:L.specificationsTitle)},{children:"Specifications"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==w?void 0:w.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==w?void 0:w.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==w?void 0:w.output_analysis}].map(function(n){var t=n.label,s=n.tooltip,r=n.content,l="Output"===t,a=l&&r?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,n){return i.push(n.trim()),""}).trim(),code:i.join("\n\n")}}(r):null,c=a?a.text:r,h=a?a.code:"";return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===t,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:t})),s&&i.jsx(o.Tooltip,e.__assign({title:s,placement:"top"},{children:i.jsx(o.Box,e.__assign({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.25,pb:1.25,pt:0}},{children:r?i.jsxs(i.Fragment,{children:[c&&i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:c,isDarkMode:ie,style:null==L?void 0:L.markdownRenderer,extraMetaData:B}),l&&h&&i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i.jsxs(o.Box,e.__assign({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[i.jsx(o.Typography,e.__assign({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),i.jsx(o.Tooltip,e.__assign({title:"Copy Code to clipboard"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return e=h,navigator.clipboard.writeText(e);var e}},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),i.jsx(o.Box,e.__assign({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:i.jsx(p.InternalEditor,{content:h,isDarkMode:ie,height:"100%",fontSize:10})}))]}))]}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"75%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),t)})}))]})),i.jsxs(o.Accordion,e.__assign({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==L?void 0:L.dependencyGraphSection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(u.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==L?void 0:L.dependencyGraphTitle)},{children:"Dependency Graph"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:0,pb:0,pt:0}},{children:(null==w?void 0:w.dependency_graph)?i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[i.jsx(o.Box,e.__assign({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:i.jsx(c.default,{data:w.dependency_graph,isDarkMode:ie,style:null==L?void 0:L.dependencyGraph})})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[i.jsx(o.Skeleton,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),E&&T&&i.jsx(o.Box,e.__assign({onClick:function(){return ae(function(e){return!e})},sx:e.__assign({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==L?void 0:L.collapseStrip)},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),E&&T&&i.jsx(o.Box,e.__assign({onClick:function(){return ae(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),pe.current=!0;var i=function(e){if(pe.current&&he.current){var o=he.current.getBoundingClientRect(),t=o.left,s=o.width,r=e.clientX-t;if(r<200)return ae(!0),pe.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",n);r>.7*s||(ae(!1),xe(r))}},n=function(){pe.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)},sx:e.__assign({position:"absolute",left:le?20:ce+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==L?void 0:L.dragHandle)},{children:le?i.jsx(y.default,{sx:{fontSize:12,color:"#6b7280"}}):i.jsx(m.default,{sx:{fontSize:12,color:"#6b7280"}})})),E&&i.jsxs(o.Box,e.__assign({sx:e.__assign({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==L?void 0:L.codePanel)},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==L?void 0:L.codePanelHeader)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:13,fontWeight:600,color:"#374151"},null==L?void 0:L.codePanelTitle)},{children:l||"SPB Analysis"})),i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[W&&i.jsx(o.Switch,{checked:ie,onChange:function(e){return ne(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),R&&I&&i.jsx(o.Tooltip,e.__assign({title:"Fullscreen",placement:"top"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return se({ref:V||"",description:""})},sx:{color:"#6b7280"}},{children:i.jsx(g.default,{sx:{fontSize:16}})}))}))]}))]})),i.jsx(o.Box,e.__assign({sx:e.__assign({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==L?void 0:L.editorContainer)},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:V,isDarkMode:ie,height:"100%",fontSize:13})}))]}))]})),I&&i.jsxs(o.Dialog,e.__assign({open:!!te,onClose:function(){return se(null)},maxWidth:!1,PaperProps:{sx:e.__assign({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==L?void 0:L.fullscreenModal)}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return se(null)}},{children:i.jsx(f.default,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i.jsxs(o.Box,e.__assign({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[i.jsx(o.Tooltip,e.__assign({title:"Atomic Prompt Block",placement:"top"},{children:i.jsx(o.Chip,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==te?void 0:te.ref}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==te?void 0:te.description}))]})),i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:r.split("\n").length}))]}))]}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),i.jsx(o.Switch,{checked:ie,onChange:function(e){return ne(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),i.jsx(o.Box,e.__assign({sx:{flex:1,minHeight:0,p:1.5}},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:V,isDarkMode:ie,height:"100%",fontSize:13})}))]}))]}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("@mui/material"),t=require("@mui/icons-material/ExpandMore"),s=require("@mui/icons-material/Fullscreen"),r=require("@mui/icons-material/Close"),l=require("@mui/icons-material/NearMeOutlined"),a=require("@mui/icons-material/ChevronLeft"),d=require("@mui/icons-material/ChevronRight"),c=require("./DependencyGraph.js"),x=require("./Markdownrenderer.js"),p=require("./Internaleditor.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=g(t),u=g(s),f=g(r),_=g(l),m=g(a),y=g(d),v=function(t){var s=t.text,r=t.detailedSummary,l=t.extraMetaData,a=t.isDarkMode,d=void 0!==a&&a,c=t.markdownRendererStyle,p=t.cognitiveDecisioningStyles,g=n.useState(!1),h=g[0],u=g[1],f=function(e,i){void 0===i&&(i=220);var n=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(n.length<=i)return{preview:n,truncated:!1};var o=n.slice(0,i),t=o.lastIndexOf(" ");return{preview:(t>0?o.slice(0,t):o).trim(),truncated:!0}}(s),_=f.preview,m=f.truncated;return i.jsx(o.Box,{children:h?i.jsxs(o.Box,{children:[i.jsx(x.MarkdownRenderer,{message:s,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,cognitiveDecisioningStyles:p,style:c}),(null==r?void 0:r.trim())&&i.jsx(x.MarkdownRenderer,{message:r,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,cognitiveDecisioningStyles:p,style:c}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:d?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[_,m&&"…"]})),(m||(null==r?void 0:r.trim()))&&i.jsx(o.Box,e.__assign({sx:{display:"flex",justifyContent:"flex-end"}},{children:i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},j=function(t){var s=t.text,r=t.extraMetaData,l=t.cognitiveDecisioningStyles,a=n.useState(!1),d=a[0],c=a[1],p=n.useState(!1),g=p[0],h=p[1],u=n.useRef(null);return n.useEffect(function(){var e=u.current;e&&h(e.scrollWidth>e.clientWidth)},[s]),i.jsx(o.Box,e.__assign({sx:{pl:1}},{children:d?i.jsxs(o.Box,e.__assign({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[i.jsx(x.MarkdownRenderer,{message:s,fontSize:"0.68rem",extraMetaData:r,cognitiveDecisioningStyles:l}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return c(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]})):i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({ref:u,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:s})),g&&i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return c(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))};exports.default=function(t){var s,r=t.promptContent,l=t.promptTitle,a=t.isLoading,d=void 0!==a&&a,g=t.overviewSummary,b=t.functionalityOfSPB,S=void 0===b?[]:b,w=t.spbAdditionalInfo,B=t.extraMetaData,D=t.showCodePanel,k=void 0===D||D,E=t.showInlineApbEditor,z=void 0===E||E,M=t.disableApbNavigation,T=void 0!==M&&M,A=t.showCollapseStrip,R=void 0===A||A,C=t.showFullscreenButton,I=void 0===C||C,F=t.showFullscreenModal,W=void 0===F||F,P=t.showThemeToggle,H=void 0===P||P,L=t.isDarkMode,q=void 0===L||L,O=t.styles,G=t.className,N=t.style,X=t.sx,Y=n.useState(null),J=Y[0],K=Y[1],Q=n.useState(null),U=Q[0],V=Q[1],Z=n.useState(""),$=Z[0],ee=Z[1],ie=void 0!==(null==O?void 0:O.isDarkMode)?O.isDarkMode:q,ne=n.useState(ie),oe=ne[0],te=ne[1],se=n.useState(null),re=se[0],le=se[1];n.useEffect(function(){void 0!==(null==O?void 0:O.isDarkMode)&&te(O.isDarkMode)},[null==O?void 0:O.isDarkMode]);var ae=n.useState(!1),de=ae[0],ce=ae[1],xe=n.useState(480),pe=xe[0],ge=xe[1],he=n.useRef(!1),ue=n.useRef(null);n.useEffect(function(){var e,i,n;S.length>0&&K((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),n=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(n||"")))},[S]),n.useEffect(function(){d&&K(null)},[d]),n.useEffect(function(){re&&(ee(""),setTimeout(function(){return ee(re.ref)},500))},[re]);return i.jsxs(o.Box,e.__assign({className:G,style:e.__assign(e.__assign({},null==O?void 0:O.root),N),sx:e.__assign({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},X)},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==O?void 0:O.header)},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==O?void 0:O.headerTitle)},{children:l||"SPB Analysis"})),i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:"0.7rem",color:"#9CA3AF"},null==O?void 0:O.headerSubtitle)},{children:J?"Last Analyzed at ".concat(J):""}))]}))})),i.jsxs(o.Box,e.__assign({ref:ue,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({width:k?de&&R?0:pe:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:he.current?"none":"width 0.15s",borderRight:!k||de&&R?"none":"1px solid #e5e7eb"},null==O?void 0:O.leftPanel)},{children:i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==O?void 0:O.overviewSection)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==O?void 0:O.overviewTitle)},{children:"Overview"})),i.jsx(o.Box,e.__assign({sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==O?void 0:O.overviewContent)},{children:(null===(s=null==g?void 0:g.overallSummary)||void 0===s?void 0:s.trim())?i.jsx(v,{text:g.overallSummary,detailedSummary:g.detailedSummary,extraMetaData:B,isDarkMode:oe,markdownRendererStyle:null==O?void 0:O.markdownRenderer,cognitiveDecisioningStyles:null==O?void 0:O.cognitiveDecisioning}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"95%",height:14})]}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==O?void 0:O.functionalitySection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==O?void 0:O.functionalityTitle)},{children:"Functionality of SPB"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:S.length>0?S.map(function(n,t){return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:0===t,sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==O?void 0:O.functionalityItem)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i.jsxs(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[t+1,". ",n.name||n.section_name]}))})),i.jsxs(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[i.jsx(x.MarkdownRenderer,{fontSize:"0.74rem",message:n.description||n.reason_for_inclusion||"",extraMetaData:B,cognitiveDecisioningStyles:null==O?void 0:O.cognitiveDecisioning}),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:n.apb_references.map(function(n,t){var s="string"==typeof n?n:n.apb_name,l=U===s;return i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i.jsxs(o.Box,e.__assign({onClick:T?void 0:function(){return function(e){U===e?(V(null),ee("")):(V(e),ee(""),setTimeout(function(){return ee(e)},50))}(s)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:T?"default":"pointer"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.78rem",color:l?"#5928ed":"#DB2877",fontWeight:500}},{children:[t+1,". ",s]})),!T&&i.jsx(_.default,{sx:{fontSize:"0.75rem",color:l?"#5928ed":"#DB2877"}})]})),"string"!=typeof n&&(n.description||n.context)&&i.jsx(j,{text:n.description||n.context||"",extraMetaData:B,cognitiveDecisioningStyles:null==O?void 0:O.cognitiveDecisioning}),z&&l&&i.jsx(o.Box,e.__assign({sx:{mt:1,height:260,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:$,isDarkMode:oe,height:"100%",fontSize:12})}))]}),t)})}))]}))]}),t)}):i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(n){return i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"40%",height:16}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"30%",height:14})]}),n)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==O?void 0:O.applicabilitySection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==O?void 0:O.applicabilityTitle)},{children:"Applicability"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:i.jsx(o.Box,e.__assign({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==w?void 0:w.when_to_apply},{label:"When NOT to apply",content:null==w?void 0:w.when_not_to_apply}].map(function(n){var t=n.label,s=n.content;return i.jsxs(o.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:t})),s?i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:s,isDarkMode:oe,style:null==O?void 0:O.markdownRenderer,extraMetaData:B,cognitiveDecisioningStyles:null==O?void 0:O.cognitiveDecisioning}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),t)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==O?void 0:O.specificationsSection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==O?void 0:O.specificationsTitle)},{children:"Specifications"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==w?void 0:w.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==w?void 0:w.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==w?void 0:w.output_analysis}].map(function(n){var t=n.label,s=n.tooltip,r=n.content,l="Output"===t,a=l&&r?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,n){return i.push(n.trim()),""}).trim(),code:i.join("\n\n")}}(r):null,c=a?a.text:r,g=a?a.code:"";return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===t,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:t})),s&&i.jsx(o.Tooltip,e.__assign({title:s,placement:"top"},{children:i.jsx(o.Box,e.__assign({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.25,pb:1.25,pt:0}},{children:r?i.jsxs(i.Fragment,{children:[c&&i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:c,isDarkMode:oe,style:null==O?void 0:O.markdownRenderer,extraMetaData:B,cognitiveDecisioningStyles:null==O?void 0:O.cognitiveDecisioning}),l&&g&&i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i.jsxs(o.Box,e.__assign({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[i.jsx(o.Typography,e.__assign({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),i.jsx(o.Tooltip,e.__assign({title:"Copy Code to clipboard"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return e=g,navigator.clipboard.writeText(e);var e}},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),i.jsx(o.Box,e.__assign({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:i.jsx(p.InternalEditor,{content:g,isDarkMode:oe,height:"100%",fontSize:10})}))]}))]}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"75%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),t)})}))]})),i.jsxs(o.Accordion,e.__assign({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==O?void 0:O.dependencyGraphSection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==O?void 0:O.dependencyGraphTitle)},{children:"Dependency Graph"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:0,pb:0,pt:0}},{children:(null==w?void 0:w.dependency_graph)?i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[i.jsx(o.Box,e.__assign({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:i.jsx(c.default,{data:w.dependency_graph,isDarkMode:oe,style:null==O?void 0:O.dependencyGraph})})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[i.jsx(o.Skeleton,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),k&&R&&i.jsx(o.Box,e.__assign({onClick:function(){return ce(function(e){return!e})},sx:e.__assign({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==O?void 0:O.collapseStrip)},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),k&&R&&i.jsx(o.Box,e.__assign({onClick:function(){return ce(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),he.current=!0;var i=function(e){if(he.current&&ue.current){var o=ue.current.getBoundingClientRect(),t=o.left,s=o.width,r=e.clientX-t;if(r<200)return ce(!0),he.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",n);r>.7*s||(ce(!1),ge(r))}},n=function(){he.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)},sx:e.__assign({position:"absolute",left:de?20:pe+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==O?void 0:O.dragHandle)},{children:de?i.jsx(y.default,{sx:{fontSize:12,color:"#6b7280"}}):i.jsx(m.default,{sx:{fontSize:12,color:"#6b7280"}})})),k&&i.jsxs(o.Box,e.__assign({sx:e.__assign({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==O?void 0:O.codePanel)},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==O?void 0:O.codePanelHeader)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:13,fontWeight:600,color:"#374151"},null==O?void 0:O.codePanelTitle)},{children:l||"SPB Analysis"})),i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[H&&i.jsx(o.Switch,{checked:oe,onChange:function(e){return te(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),I&&W&&i.jsx(o.Tooltip,e.__assign({title:"Fullscreen",placement:"top"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return le({ref:$||"",description:""})},sx:{color:"#6b7280"}},{children:i.jsx(u.default,{sx:{fontSize:16}})}))}))]}))]})),i.jsx(o.Box,e.__assign({sx:e.__assign({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==O?void 0:O.editorContainer)},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:$,isDarkMode:oe,height:"100%",fontSize:13})}))]}))]})),W&&i.jsxs(o.Dialog,e.__assign({open:!!re,onClose:function(){return le(null)},maxWidth:!1,PaperProps:{sx:e.__assign({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==O?void 0:O.fullscreenModal)}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return le(null)}},{children:i.jsx(f.default,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i.jsxs(o.Box,e.__assign({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[i.jsx(o.Tooltip,e.__assign({title:"Atomic Prompt Block",placement:"top"},{children:i.jsx(o.Chip,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==re?void 0:re.ref}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==re?void 0:re.description}))]})),i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:r.split("\n").length}))]}))]}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),i.jsx(o.Switch,{checked:oe,onChange:function(e){return te(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),i.jsx(o.Box,e.__assign({sx:{flex:1,minHeight:0,p:1.5}},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:$,isDarkMode:oe,height:"100%",fontSize:13})}))]}))]}))]}))]}))};
2
2
  //# sourceMappingURL=Spbanalysispanel.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as n,jsx as i}from"react/jsx-runtime";import{useState as o,useMemo as t}from"react";import{Box as r}from"@mui/system";import{Typography as l,Chip as a,IconButton as c,Accordion as d,AccordionSummary as s,AccordionDetails as h,Divider as f}from"@mui/material";import m from"@mui/icons-material/Close";import u from"@mui/icons-material/ExpandMore";import{LightbulbOutlined as g,ManageSearchOutlined as p,ChatBubbleOutlineOutlined as x}from"@mui/icons-material";import v from"@mui/icons-material/AutoAwesome";import b from"../ChatCitation/ChatCitationRenderer.js";var y=function(e){var n=document.createElement("div");return n.innerHTML=e,Array.from(n.querySelectorAll("li")).map(function(e){return e.innerHTML})},_=function(){return i(r,e({component:"svg",viewBox:"0 0 24 24",sx:{width:14,height:14,fill:"#5928ed"}},{children:i("path",{d:"M12 2a7 7 0 0 0-4 12.74V17a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-2.26A7 7 0 0 0 12 2zm-1 19h2v1h-2v-1z"})}))},k=function(k){var S,C=k.open,z=k.onClose,w=k.data,I=o(null),A=I[0],R=I[1],B=t(function(){var e;return A&&w&&null!==(e=w.block_cognitive_citations.find(function(e){return String(e.citation_number)===A}))&&void 0!==e?e:null},[A,w]),W=t(function(){return(null==w?void 0:w.block_cognitive_reasoning_html)?y(w.block_cognitive_reasoning_html):[]},[null==w?void 0:w.block_cognitive_reasoning_html]),D=t(function(){return(null==w?void 0:w.block_cognitive_gap_html)?y(w.block_cognitive_gap_html):[]},[null==w?void 0:w.block_cognitive_gap_html]),M=function(o,t){for(var l,a,c=[],d=/<a[^>]*href="([^"]+)"[^>]*>(.*?)<\/a>/g,s=0,h=0,f=function(){var f=a[1].replace(/^.*\$/,""),m=a[2],u=A===f;a.index>s&&c.push(i("span",{children:o.substring(s,a.index)},"txt-".concat(t,"-").concat(h++))),c.push(n("span",{children:[n("span",e({onClick:function(){return R(function(e){return e===f?null:f})},style:{color:"#2563EB",fontWeight:500,cursor:"pointer",textDecoration:"underline"}},{children:[m,i(x,{sx:{fontSize:"12px",ml:.2}})]})),u&&B&&i(r,e({sx:{maxHeight:"35vh",padding:"6px",overflow:"auto",backgroundColor:"#ffffff",mt:1}},{children:i(b,{showRootContainer:!1,rootContainer:{relevanceScore:null!==(l=null==w?void 0:w.block_cognitive_confidence)&&void 0!==l?l:0,slotStyles:{container:{border:"",paddingLeft:"-20px",color:"black"}}},ruleBookContainer:{title:B.title||B.section_ref||"Rule Book",data:{content:B.content||B.paraphrase||"",highlighted_texts:Array.isArray(B.highlight)?B.highlight:B.highlight?[B.highlight]:[]},slotStyles:{outerContainer:{margin:"0",color:"black",minHeight:"350px"}}},additionalData:{RuleBookDetailedViewVerticallyStacked:!0},reversePanels:!0})}))]},"anchor-".concat(t,"-").concat(f))),s=d.lastIndex};null!==(a=d.exec(o));)f();return s<o.length&&c.push(i("span",{children:o.substring(s)},"txt-end-".concat(t,"-").concat(h++))),c};return C?n(r,e({sx:{width:"min(500px, calc(100vw - 16px))",maxWidth:"calc(100vw - 16px)",maxHeight:"80vh",borderRadius:3,display:"flex",flexDirection:"column",overflow:"hidden",border:"1px solid #e0e0e0",backgroundColor:"#fff"}},{children:[n(r,e({sx:{px:2,py:1,borderBottom:"1px solid #e0e0e0",display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0,backgroundColor:"#e9ecfd"}},{children:[n(r,e({display:"flex",alignItems:"center",gap:1},{children:[i(_,{}),i(l,e({fontWeight:500,sx:{fontSize:"0.72rem"}},{children:"Cognitive Decisioning AI"}))]})),n(r,e({display:"flex",alignItems:"center",gap:1},{children:[i(a,{icon:i(v,{sx:{fontSize:12}}),label:"AI Relevance: ".concat(null!==(S=null==w?void 0:w.block_cognitive_confidence)&&void 0!==S?S:0,"%"),size:"small",sx:{fontWeight:500,fontSize:"0.68rem",backgroundColor:"#ffffff",color:"#000000",border:"1px solid #ac93f6",height:20,"& .MuiChip-label":{fontSize:"0.68rem",px:.75}}}),i(c,e({size:"small",onClick:z},{children:i(m,{fontSize:"small"})}))]}))]})),n(r,e({sx:{flex:1,overflowY:"auto",p:.5}},{children:[n(d,e({defaultExpanded:!0,disableGutters:!0,elevation:0},{children:[i(s,e({expandIcon:i(u,{})},{children:n(l,e({sx:{display:"flex",alignItems:"center",gap:.8,fontSize:"0.78rem"},fontWeight:600},{children:[i(r,e({sx:{width:24,height:24,borderRadius:"50%",backgroundColor:"#e9ecfd",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:i(g,{sx:{fontSize:14,color:"#5928ed"}})})),"Decision Making Factors"]}))})),i(h,{children:i(r,e({sx:{padding:0,margin:0}},{children:W.length>0?W.map(function(o,t){return n(r,e({sx:{marginBottom:"6px",display:"flex",gap:1}},{children:[n(l,e({variant:"body2",sx:{fontWeight:500,fontSize:"0.75rem"}},{children:[t+1,"."]})),i(r,e({sx:{flex:1}},{children:i(l,e({variant:"body2",component:"span",sx:{fontSize:"0.75rem"}},{children:M(o,t)}))}))]}),t)}):i(l,e({variant:"body2",color:"gray",sx:{mb:.5,pl:3,fontSize:"0.72rem"}},{children:"No Reasons Found"}))}))})]})),i(f,{}),n(d,e({disableGutters:!0,elevation:0},{children:[i(s,e({expandIcon:i(u,{})},{children:n(l,e({sx:{display:"flex",alignItems:"center",gap:.8,fontSize:"0.78rem"},fontWeight:600},{children:[i(r,e({sx:{width:24,height:24,borderRadius:"50%",backgroundColor:"#e9ecfd",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:i(p,{sx:{fontSize:14,color:"#5928ed"}})})),"Gaps in Decision"]}))})),i(h,{children:i(r,e({sx:{padding:0,margin:0}},{children:D.length>0?D.map(function(o,t){return n(r,e({sx:{marginBottom:"6px",display:"flex",gap:1}},{children:[n(l,e({variant:"body2",sx:{fontWeight:500,fontSize:"0.75rem"}},{children:[t+1,"."]})),i(l,{variant:"body2",component:"span",sx:{fontSize:"0.75rem"},dangerouslySetInnerHTML:{__html:o}})]}),t)}):i(l,e({variant:"body2",color:"gray",sx:{mb:.5,pl:3,fontSize:"0.72rem"}},{children:"No Gaps Found"}))}))})]}))]}))]})):null};export{k as default};
1
+ import{__assign as n}from"tslib";import{jsxs as i,jsx as e}from"react/jsx-runtime";import{useState as o,useMemo as t}from"react";import{Box as l}from"@mui/system";import{Typography as r,Chip as a,IconButton as c,Accordion as d,AccordionSummary as s,AccordionDetails as u,Divider as h}from"@mui/material";import f from"@mui/icons-material/Close";import m from"@mui/icons-material/ExpandMore";import{LightbulbOutlined as v,ManageSearchOutlined as x,ChatBubbleOutlineOutlined as p}from"@mui/icons-material";import g from"@mui/icons-material/AutoAwesome";import b from"../ChatCitation/ChatCitationRenderer.js";var y=function(n){var i=document.createElement("div");return i.innerHTML=n,Array.from(i.querySelectorAll("li")).map(function(n){return n.innerHTML})},C=function(i){var o=i.style;return e(l,n({component:"svg",viewBox:"0 0 24 24",sx:n({width:14,height:14,fill:"#5928ed"},o)},{children:e("path",{d:"M12 2a7 7 0 0 0-4 12.74V17a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-2.26A7 7 0 0 0 12 2zm-1 19h2v1h-2v-1z"})}))},_=function(_){var S,k=_.open,z=_.onClose,I=_.data,w=_.styles,A=o(null),B=A[0],R=A[1],D=t(function(){var n;return B&&I&&null!==(n=I.block_cognitive_citations.find(function(n){return String(n.citation_number)===B}))&&void 0!==n?n:null},[B,I]),T=t(function(){return(null==I?void 0:I.block_cognitive_reasoning_html)?y(I.block_cognitive_reasoning_html):[]},[null==I?void 0:I.block_cognitive_reasoning_html]),M=t(function(){return(null==I?void 0:I.block_cognitive_gap_html)?y(I.block_cognitive_gap_html):[]},[null==I?void 0:I.block_cognitive_gap_html]),W=function(o,t){for(var r,a,c,d,s,u,h,f=[],m=/<a[^>]*href="([^"]+)"[^>]*>(.*?)<\/a>/g,v=0,x=0,g=function(){var g=h[1].replace(/^.*\$/,""),y=h[2],C=B===g;h.index>v&&f.push(e("span",{children:o.substring(v,h.index)},"txt-".concat(t,"-").concat(x++))),f.push(i("span",{children:[i("span",n({onClick:function(){return R(function(n){return n===g?null:g})},style:n({color:"#2563EB",fontWeight:500,cursor:"pointer",textDecoration:"underline"},null==w?void 0:w.citationLink)},{children:[y,e(p,{sx:{fontSize:"12px",ml:.2}})]})),C&&D&&e(l,n({sx:n({maxHeight:"35vh",padding:"6px",overflow:"auto",backgroundColor:"#ffffff",mt:1},null==w?void 0:w.citationContainer)},{children:e(b,{showRootContainer:!1,modalContainerStyle:null==w?void 0:w.citationModalContainer,rootContainer:{relevanceScore:null!==(r=null==I?void 0:I.block_cognitive_confidence)&&void 0!==r?r:0,slotStyles:{container:n({border:"",paddingLeft:"-20px",color:null!==(c=null===(a=null==w?void 0:w.textContent)||void 0===a?void 0:a.color)&&void 0!==c?c:"black"},null==w?void 0:w.citationRootContainer)}},ruleBookContainer:{title:D.training_data_title||D.title||D.section_ref||"Rule Book",data:{content:(null===(d=D.data_sources)||void 0===d?void 0:d.join("\n\n"))||D.content||D.paraphrase||"",highlighted_texts:D.paraphrase?Array.isArray(D.paraphrase)?D.paraphrase:[D.paraphrase]:Array.isArray(D.highlight)?D.highlight:D.highlight?[D.highlight]:[]},slotStyles:{title:null==w?void 0:w.citationTitle,body:null==w?void 0:w.citationBody,dataContainer:null==w?void 0:w.citationDataContainer,outerContainer:n({margin:"0",color:null!==(u=null===(s=null==w?void 0:w.textContent)||void 0===s?void 0:s.color)&&void 0!==u?u:"black",minHeight:"350px"},null==w?void 0:w.citationRuleBookContainer)}},additionalData:{RuleBookDetailedViewVerticallyStacked:!0},reversePanels:!0})}))]},"anchor-".concat(t,"-").concat(g))),v=m.lastIndex};null!==(h=m.exec(o));)g();return v<o.length&&f.push(e("span",{children:o.substring(v)},"txt-end-".concat(t,"-").concat(x++))),f};return k?i(l,n({sx:n({width:"min(500px, calc(100vw - 16px))",maxWidth:"calc(100vw - 16px)",maxHeight:"80vh",borderRadius:3,display:"flex",flexDirection:"column",overflow:"hidden",border:"1px solid #e0e0e0",backgroundColor:"#fff",color:"#111827"},null==w?void 0:w.container)},{children:[i(l,n({sx:n({px:2,py:1,borderBottom:"1px solid #e0e0e0",display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0,backgroundColor:"#e9ecfd"},null==w?void 0:w.header)},{children:[i(l,n({display:"flex",alignItems:"center",gap:1},{children:[e(C,{style:null==w?void 0:w.headerIcon}),e(r,n({fontWeight:500,sx:n({fontSize:"0.72rem"},null==w?void 0:w.headerTitleText)},{children:"Cognitive Decisioning AI"}))]})),i(l,n({display:"flex",alignItems:"center",gap:1},{children:[e(a,{icon:e(g,{sx:{fontSize:12}}),label:"AI Relevance: ".concat(null!==(S=null==I?void 0:I.block_cognitive_confidence)&&void 0!==S?S:0,"%"),size:"small",sx:n({fontWeight:500,fontSize:"0.68rem",backgroundColor:"#ffffff",color:"#000000",border:"1px solid #ac93f6",height:20,"& .MuiChip-label":{fontSize:"0.68rem",px:.75}},null==w?void 0:w.badge)}),e(c,n({size:"small",onClick:z,sx:null==w?void 0:w.closeButton},{children:e(f,{fontSize:"small"})}))]}))]})),i(l,n({sx:n({flex:1,overflowY:"auto",p:.5},null==w?void 0:w.body)},{children:[i(d,n({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:null==w?void 0:w.accordion},{children:[e(s,n({expandIcon:e(m,{}),sx:null==w?void 0:w.accordionSummary},{children:i(r,n({sx:n({display:"flex",alignItems:"center",gap:.8,fontSize:"0.78rem"},null==w?void 0:w.sectionTitle),fontWeight:600},{children:[e(l,n({sx:n({width:24,height:24,borderRadius:"50%",backgroundColor:"#e9ecfd",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},null==w?void 0:w.sectionIcon)},{children:e(v,{sx:{fontSize:14,color:"#5928ed"}})})),"Decision Making Factors"]}))})),e(u,n({sx:null==w?void 0:w.accordionDetails},{children:e(l,n({sx:{padding:0,margin:0}},{children:T.length>0?T.map(function(o,t){return i(l,n({sx:n({marginBottom:"6px",display:"flex",gap:1},null==w?void 0:w.sectionItem)},{children:[i(r,n({variant:"body2",sx:n({fontWeight:500,fontSize:"0.75rem"},null==w?void 0:w.indexText)},{children:[t+1,"."]})),e(l,n({sx:{flex:1}},{children:e(r,n({variant:"body2",component:"span",sx:n({fontSize:"0.75rem"},null==w?void 0:w.textContent)},{children:W(o,t)}))}))]}),t)}):e(r,n({variant:"body2",color:"gray",sx:n({mb:.5,pl:3,fontSize:"0.72rem"},null==w?void 0:w.sectionSubtitle)},{children:"No Reasons Found"}))}))}))]})),e(h,{}),i(d,n({disableGutters:!0,elevation:0,sx:null==w?void 0:w.accordion},{children:[e(s,n({expandIcon:e(m,{}),sx:null==w?void 0:w.accordionSummary},{children:i(r,n({sx:n({display:"flex",alignItems:"center",gap:.8,fontSize:"0.78rem"},null==w?void 0:w.sectionTitle),fontWeight:600},{children:[e(l,n({sx:n({width:24,height:24,borderRadius:"50%",backgroundColor:"#e9ecfd",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},null==w?void 0:w.sectionIcon)},{children:e(x,{sx:{fontSize:14,color:"#5928ed"}})})),"Gaps in Decision"]}))})),e(u,n({sx:null==w?void 0:w.accordionDetails},{children:e(l,n({sx:{padding:0,margin:0}},{children:M.length>0?M.map(function(o,t){return i(l,n({sx:n({marginBottom:"6px",display:"flex",gap:1},null==w?void 0:w.sectionItem)},{children:[i(r,n({variant:"body2",sx:n({fontWeight:500,fontSize:"0.75rem"},null==w?void 0:w.indexText)},{children:[t+1,"."]})),e(r,{variant:"body2",component:"span",sx:n({fontSize:"0.75rem"},null==w?void 0:w.textContent),dangerouslySetInnerHTML:{__html:o}})]}),t)}):e(r,n({variant:"body2",color:"gray",sx:n({mb:.5,pl:3,fontSize:"0.72rem"},null==w?void 0:w.sectionSubtitle)},{children:"No Gaps Found"}))}))}))]}))]}))]})):null};export{_ as default};
2
2
  //# sourceMappingURL=Cognitivereasoningpanel.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as t,Fragment as r,jsx as i}from"react/jsx-runtime";import a,{useState as o,useCallback as l,useRef as c,useMemo as d,useEffect as s}from"react";import f from"@mui/material/Dialog";import u from"@mui/icons-material/Fullscreen";import h from"@mui/icons-material/CloseFullscreen";var p=170,g=48,y=["#ede9fe","#e0f2fe","#fef3c7","#dcfce7","#ffe4e6","#f0fdf4","#fef9c3","#e0e7ff","#fce7f3","#f1f5f9"],v=["#7c3aed","#0284c7","#b45309","#16a34a","#e11d48","#15803d","#a16207","#4338ca","#db2777","#475569"],x=["⚙","◈","⟐","✦","◎","⬡","◇","⊕","✶","◉"],b=["#a78bfa","#7dd3fc","#fbbf24","#86efac","#fda4af","#6ee7b7","#fde047","#a5b4fc","#f9a8d4","#94a3b8"],m=["linear-gradient(135deg,#7c3aed,#a78bfa)","linear-gradient(135deg,#0284c7,#38bdf8)","linear-gradient(135deg,#b45309,#fbbf24)","linear-gradient(135deg,#16a34a,#86efac)","linear-gradient(135deg,#e11d48,#fda4af)","linear-gradient(135deg,#15803d,#6ee7b7)","linear-gradient(135deg,#a16207,#fde047)","linear-gradient(135deg,#4338ca,#a5b4fc)","linear-gradient(135deg,#db2777,#f9a8d4)","linear-gradient(135deg,#475569,#94a3b8)"];function w(t){var r=Array.isArray(null==t?void 0:t.clusters)?t.clusters:[],i=Array.isArray(null==t?void 0:t.nodes)?t.nodes:[],a=Array.isArray(null==t?void 0:t.edges)?t.edges:[],o=function(e,t,r){var i;void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===r&&(r=[]);var a=Array.isArray(e)?e:[],o=Array.isArray(t)?t:[],l=Array.isArray(r)?r:[],c=a.length;if(0===c)return new Map;var d={};a.forEach(function(e,n){d[e.id]=n});var s={},f={};a.forEach(function(e){s[e.id]=[],f[e.id]=[]}),o.forEach(function(e){s[e.source]&&s[e.source].push(e.target),f[e.target]&&f[e.target].push(e.source)});var u={};a.forEach(function(e){u[e.id]=0});for(var h=0;h<c;h++){for(var p=!1,g=0,y=o;g<y.length;g++){var v=y[g],x=(u[v.source]||0)+1;x>(u[v.target]||0)&&x<c&&(u[v.target]=x,p=!0)}if(!p)break}var b={};l.forEach(function(e,n){b[e.id]=n});var m={};l.forEach(function(e){m[e.id]=[]}),a.forEach(function(e){var n;null===(n=m[e.cluster_id])||void 0===n||n.push(e)}),Object.values(m).forEach(function(e){return e.sort(function(e,n){return(u[e.id]||0)-(u[n.id]||0)})});for(var w=new Float64Array(c),M=new Float64Array(c),k=new Float64Array(c),S=new Float64Array(c),C=function(e){var n=null!==(i=b[e.id])&&void 0!==i?i:0;(m[e.id]||[]).forEach(function(e,t){var r=d[e.id];w[r]=520*n+280,M[r]=200*t+120})},z=0,E=l;z<E.length;z++)C(V=E[z]);for(var A=.0015,F=Math.max.apply(Math,n(n([],a.map(function(e){return u[e.id]||0}),!1),[1],!1)),I=new Float64Array(c),W=0;W<c;W++)I[W]=(u[a[W].id]||0)/F*(200*c*.6)+120;for(var R=0;R<350;R++){var D=Math.max(.015,1-R/350),Y=new Float64Array(c),_=new Float64Array(c);for(W=0;W<c;W++)for(var j=W+1;j<c;j++){var P=(Q=w[W]-w[j])*Q+(U=M[W]-M[j])*U;P<400&&(P=(Q=12*(W-j))*Q+(U=8*(W+j))*U);var B=Q/(O=Math.sqrt(P))*(q=48e4/P),L=U/O*q;Y[W]+=B,_[W]+=L,Y[j]-=B,_[j]-=L}for(var X=0,N=o;X<N.length;X++){v=N[X];var T=d[v.source],H=d[v.target];if(void 0!==T&&void 0!==H){var O,q,Q=w[H]-w[T],U=M[H]-M[T];if(!((O=Math.sqrt(Q*Q+U*U))<1))B=Q/O*(q=.004*(O-380)),L=U/O*q,Y[T]+=B,_[T]+=L,Y[H]-=B,_[H]-=L}}var G={},J={},K={};for(W=0;W<c;W++)G[V=a[W].cluster_id]=(G[V]||0)+w[W],J[V]=(J[V]||0)+M[W],K[V]=(K[V]||0)+1;for(W=0;W<c;W++){var V=a[W].cluster_id;Y[W]+=(G[V]/K[V]-w[W])*A,_[W]+=(J[V]/K[V]-M[W])*A}for(W=0;W<c;W++)_[W]+=.002*(I[W]-M[W]);for(W=0;W<c;W++)k[W]=.84*(k[W]+Y[W])*D,S[W]=.84*(S[W]+_[W])*D,w[W]+=k[W],M[W]+=S[W]}for(h=0;h<40;h++){var Z=!1;for(W=0;W<c;W++)for(j=W+1;j<c;j++){Q=w[W]-w[j],U=M[W]-M[j];var $=270-Math.abs(Q),ee=128-Math.abs(U);if($>0&&ee>0)if(Z=!0,$<ee){var ne=$/2+5;w[W]+=Q>0?ne:-ne,w[j]-=Q>0?ne:-ne}else ne=ee/2+5,M[W]+=U>0?ne:-ne,M[j]-=U>0?ne:-ne}if(!Z)break}var te=1/0,re=1/0;for(W=0;W<c;W++)te=Math.min(te,w[W]),re=Math.min(re,M[W]);var ie=new Map;for(W=0;W<c;W++)ie.set(a[W].id,{x:Math.round(w[W]-te+80),y:Math.round(M[W]-re+80)});return ie}(i,a,r),l=i.map(function(n){var t=o.get(n.id)||{x:0,y:0};return e(e({},n),{x:t.x,y:t.y})}),c={};r.forEach(function(e,n){c[e.id]=n});var d={};r.forEach(function(e){d[e.id]=[]}),l.forEach(function(e){var n;null===(n=d[e.cluster_id])||void 0===n||n.push(e)});var s=36,f=r.map(function(e){var n=d[e.id];if(!n.length)return null;var t=Math.min.apply(Math,n.map(function(e){return e.x})),r=Math.min.apply(Math,n.map(function(e){return e.y})),i=Math.max.apply(Math,n.map(function(e){return e.x+p})),a=Math.max.apply(Math,n.map(function(e){return e.y+g}));return{id:e.id,label:e.label,idx:c[e.id],x:t-s,y:r-s,width:i-t+72,height:a-r+72+22}}).filter(function(e){return null!==e});return{nodes:l.map(function(n){var t;return e(e({},n),{cluster:null!==(t=c[n.cluster_id])&&void 0!==t?t:0})}),edges:a,clusterBounds:f,canvasW:Math.max.apply(Math,l.map(function(e){return e.x+p}))+72,canvasH:Math.max.apply(Math,l.map(function(e){return e.y+g}))+72}}function M(e,n,t){var r=n[e.source],i=n[e.target];if(!r||!i)return"";var a=function(e,n){var t=e.x+85,r=e.y+24,i=n.x+85,a=n.y+24;function o(e,n,t,r){var i=t-e,a=r-n;return Math.abs(a)>.4*Math.abs(i)?a>0?{x:e,y:n+24}:{x:e,y:n-24}:i>0?{x:e+85,y:n}:{x:e-85,y:n}}return{source:o(t,r,i,a),target:o(i,a,t,r)}}(r,i),o=a.source,l=a.target,c=l.x-o.x,d=l.y-o.y,s=Math.sqrt(c*c+d*d);if(s<5)return"M ".concat(o.x," ").concat(o.y," L ").concat(l.x," ").concat(l.y);if(i.y+150<r.y&&i.y<r.y-g){var f=Math.min(r.x,i.x)-110;return"M ".concat(o.x," ").concat(o.y," C ").concat(f," ").concat(o.y,", ").concat(f," ").concat(l.y,", ").concat(l.x," ").concat(l.y)}var u=-d/s,h=c/s;if(t.some(function(n){return n.source===e.target&&n.target===e.source})){var p=e.source<e.target?1:-1,y=Math.max(.18*s,40)*p,v=(o.x+l.x)/2+u*y,x=(o.y+l.y)/2+h*y;return"M ".concat(o.x," ").concat(o.y," Q ").concat(v," ").concat(x," ").concat(l.x," ").concat(l.y)}var b=Math.min(.12*s,55),m=(o.x+l.x)/2+u*b,w=(o.y+l.y)/2+h*b;return"M ".concat(o.x," ").concat(o.y," Q ").concat(m," ").concat(w," ").concat(l.x," ").concat(l.y)}function k(n){var a,f,k=n.data,S=n.onFullscreen,C=n.isFullscreen,z=n.isDarkMode,E=void 0!==z&&z,A=c(null),F=o({x:0,y:0}),I=F[0],W=F[1],R=o(.5),D=R[0],Y=R[1],_=o(!1),j=_[0],P=_[1],B=c({x:0,y:0}),L=c({x:0,y:0}),X=o(null),N=X[0],T=X[1],H=o(null),O=H[0],q=H[1],Q=o(null),U=Q[0],G=Q[1],J=o(null),K=J[0],V=J[1],Z=d(function(){return w(k)},[k]),$=d(function(){var e={};return Z.nodes.forEach(function(n){e[n.id]=n}),e},[Z]),ee=d(function(){var e={};return k.clusters.forEach(function(n,t){e[n.id]=t}),e},[k]),ne=d(function(){return K?new Set(Z.edges.filter(function(e){return e.source===K||e.target===K}).map(function(e){return e.id})):new Set},[K,Z.edges]),te=d(function(){if(!K)return new Set;var e=new Set([K]);return Z.edges.forEach(function(n){n.source===K&&e.add(n.target),n.target===K&&e.add(n.source)}),e},[K,Z.edges]),re=d(function(){return new Date(k.last_analyzed_at).toLocaleString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,day:"numeric",month:"short",year:"numeric"})},[k.last_analyzed_at]),ie=l(function(n){n.target.closest("[data-edge-hit]")||n.target.closest("[data-node]")||(P(!0),B.current={x:n.clientX,y:n.clientY},L.current=e({},I),n.currentTarget.style.cursor="grabbing")},[I]),ae=l(function(e){j&&W({x:L.current.x+(e.clientX-B.current.x),y:L.current.y+(e.clientY-B.current.y)})},[j]),oe=l(function(){P(!1),A.current&&(A.current.style.cursor="grab")},[]),le=l(function(e){e.preventDefault(),Y(function(n){return Math.min(2.5,Math.max(.2,n-.001*e.deltaY))})},[]);s(function(){var e=A.current;return e&&e.addEventListener("wheel",le,{passive:!1}),function(){return null==e?void 0:e.removeEventListener("wheel",le)}},[le]);var ce={width:32,height:32,border:"none",background:"transparent",borderRadius:8,cursor:"pointer",fontSize:16,color:E?"#cbd5e1":"#475569",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500};return t("div",e({style:{width:"100%",height:"100%",background:E?"#090d16":"#ffffff",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",position:"relative",overflow:"hidden"}},{children:[t("div",e({style:{position:"absolute",top:0,left:0,right:0,zIndex:20,borderBottom:C?E?"1px solid #1e293b":"1px solid #f1f5f9":"none",background:E?"#090d16":C?"#fff":"transparent"}},{children:[t("div",e({style:{padding:"10px 14px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t("div",{children:[C&&i("h2",e({style:{margin:0,fontSize:17,fontWeight:700,color:E?"#f8fafc":"#1e293b"}},{children:"Dependency Graph"})),t("p",e({style:{margin:"2px 0 0",fontSize:12,color:"#94a3b8"}},{children:["Last analyzed: ".concat(re||""," · "),"Click a node or connection to explore details and dependencies."]}))]}),t("div",e({style:{display:"flex",gap:6,alignItems:"center"}},{children:[t("div",e({style:{display:"flex",gap:2,background:E?"#1e293b":"#fff",borderRadius:10,padding:3,boxShadow:E?"0 1px 4px rgba(0,0,0,0.4)":"0 1px 4px rgba(0,0,0,0.08)"}},{children:[i("button",e({onClick:function(){return Y(function(e){return Math.max(.2,e-.15)})},style:ce},{children:"−"})),t("button",e({onClick:function(){Y(.5),W({x:0,y:0})},style:e(e({},ce),{fontSize:11,width:52,fontWeight:600})},{children:[Math.round(100*D)||0,"%"]})),i("button",e({onClick:function(){return Y(function(e){return Math.min(2.5,e+.15)})},style:ce},{children:"+"}))]})),S&&i("div",e({style:{display:"flex",background:E?"#1e293b":"#fff",borderRadius:10,padding:3,boxShadow:E?"0 1px 4px rgba(0,0,0,0.4)":"0 1px 4px rgba(0,0,0,0.08)"}},{children:i("button",e({onClick:S,style:ce},{children:i(C?h:u,{style:{fontSize:16}})}))}))]}))]})),O&&i("div",e({style:{margin:"0 20px 14px",width:"30%",minWidth:280,borderRadius:12,overflow:"hidden",boxShadow:"0 2px 12px rgba(0,0,0,0.07)",border:"1px solid #e2e8f0",animation:"slideDown 0.2s ease-out"}},{children:function(){var n,r,a=O.node,o=null!==(n=ee[a.cluster_id])&&void 0!==n?n:0;return Z.edges.filter(function(e){return e.source===a.id}).length,Z.edges.filter(function(e){return e.target===a.id}).length,t("div",{children:[t("div",e({style:{padding:"10px 14px",background:m[o%m.length||0],color:"#fff",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[i("span",e({style:{width:28,height:28,borderRadius:8,background:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14}},{children:x[o%x.length||0]})),t("div",{children:[i("div",e({style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",opacity:.75}},{children:(null===(r=k.clusters[o])||void 0===r?void 0:r.label)||"Cluster Name"})),i("div",e({style:{fontSize:14,fontWeight:700,marginTop:1}},{children:a.label||"Cluster Name"}))]})]})),i("button",e({onClick:function(){q(null),V(null)},style:{background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",borderRadius:6,width:24,height:24,cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:"×"}))]})),i("div",e({style:{padding:"10px 14px",fontSize:13,lineHeight:1.6,color:E?"#cbd5e1":"#475569",background:E?"#1e293b":"#fff"}},{children:a.description||"No description available..."}))]})}()}))]})),t("div",e({ref:A,onPointerDown:ie,onPointerMove:ae,onPointerUp:oe,onPointerLeave:oe,onClick:function(){T(null),q(null),V(null)},style:{width:"100%",height:"100%",cursor:j?"grabbing":"grab",position:"relative"}},{children:[i("div",e({style:{transform:"translate(".concat(I.x,"px, ").concat(I.y,"px) scale(").concat(D,")"),transformOrigin:"top left",position:"absolute",top:C?70:50,left:20,transition:j?"none":"transform 0.08s ease-out"}},{children:t("svg",e({width:Z.canvasW,height:Z.canvasH,style:{overflow:"visible"}},{children:[Z.clusterBounds.map(function(n){return t("g",{children:[i("rect",{x:n.x,y:n.y,width:n.width,height:n.height,rx:"16",fill:E?"rgba(30, 41, 59, 0.35)":"none",stroke:E?"#334155":"#e2e8f0",strokeWidth:"1.5",strokeDasharray:"8 4"}),i("text",e({x:n.x+14,y:n.y+n.height-10,fontSize:"11",fill:"#94a3b8",fontFamily:"Inter, sans-serif",fontWeight:"500"},{children:n.label||"Cluster Name"}))]},n.id)}),Z.edges.map(function(n){var a=M(n,$,Z.edges);if(!a)return null;var o=ne.has(n.id),l=(null==N?void 0:N.edge.id)===n.id,c=U===n.id,d=o||l?"#6366f1":c?"#818cf8":E?"#475569":"#cbd5e1",s=o||l?2.5:c?2:1.5;return t("g",e({style:{opacity:!!K&&!o?.1:1,transition:"opacity 0.25s"}},{children:[i("path",{"data-edge-hit":"true",d:a,fill:"none",stroke:"transparent",strokeWidth:18,style:{cursor:"pointer"},onClick:function(e){return function(e,n){e.stopPropagation();var t=A.current.getBoundingClientRect();T({edge:n,screenX:e.clientX-t.left,screenY:e.clientY-t.top}),q(null),V(null)}(e,n)},onMouseEnter:function(){return G(n.id)},onMouseLeave:function(){return G(null)}}),i("path",{d:a,fill:"none",stroke:d,strokeWidth:s,style:{transition:"stroke 0.2s, stroke-width 0.2s",pointerEvents:"none"}}),(o||l)&&t(r,{children:[i("circle",e({r:4,fill:"#6366f1"},{children:i("animateMotion",{dur:"1.8s",repeatCount:"indefinite",path:a})})),i("circle",e({r:6,fill:"#6366f1",opacity:.2},{children:i("animateMotion",{dur:"1.8s",repeatCount:"indefinite",path:a})}))]})]}),n.id)}),Z.nodes.map(function(n){var r,a=K===n.id,o=te.has(n.id),l=!!K&&!o,c=(null!==(r=ee[n.cluster_id])&&void 0!==r?r:0)%b.length,d=b[c||0];return i("g",e({"data-node":"true",onClick:function(e){return function(e,n){e.stopPropagation();var t=A.current.getBoundingClientRect();K===n.id?(V(null),q(null)):(V(n.id),q({node:n,screenX:e.clientX-t.left,screenY:e.clientY-t.top}),T(null))}(e,n)},style:{cursor:"pointer",opacity:l?.15:1,transition:"opacity 0.25s"}},{children:i("foreignObject",e({x:n.x,y:n.y,width:p,height:g},{children:t("div",e({style:{background:E?"#1e293b":"#fff",border:a?"2.5px solid ".concat(d):E?"1.5px solid #334155":"1.5px solid #e2e8f0",borderRadius:10,padding:"8px 14px",fontSize:13,fontWeight:600,color:E?"#f1f5f9":"#334155",fontFamily:"'Inter', sans-serif",display:"flex",alignItems:"center",gap:8,boxShadow:a?"0 0 0 3px ".concat(d,"33, 0 2px 8px rgba(0,0,0,0.4)"):E?"0 2px 6px rgba(0,0,0,0.3)":"0 1px 3px rgba(0,0,0,0.05)",whiteSpace:"nowrap",userSelect:"none",height:46,boxSizing:"border-box",transition:"border 0.2s, box-shadow 0.2s"}},{children:[i("span",e({style:{width:22,height:22,borderRadius:6,background:y[c],display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,flexShrink:0,color:v[c]}},{children:x[c]})),i("span",e({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:n.label||"Node name"}))]}))}))}),n.id)})]}))})),N&&t("div",e({onClick:function(e){return e.stopPropagation()},style:e(e({position:"absolute"},function(e,n,t,r){if(!A.current)return{};var i=A.current.getBoundingClientRect(),a=e+14,o=n-r/2;return a+t>i.width&&(a=e-t-14),o<8&&(o=8),o+r>i.height&&(o=i.height-r-8),{left:a,top:o}}(N.screenX,N.screenY,320,180)),{width:320,background:"#fff",borderRadius:14,boxShadow:"0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06)",border:"1px solid #e2e8f0",zIndex:30,animation:"popIn 0.18s ease-out",overflow:"hidden"})},{children:[t("div",e({style:{padding:"12px 16px 10px",background:"linear-gradient(135deg, #6366f1, #8b5cf6)",color:"#fff"}},{children:[i("div",e({style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",opacity:.8}},{children:"Edge Reasoning"})),t("div",e({style:{fontSize:13,fontWeight:600,marginTop:4}},{children:[(null===(a=$[N.edge.source])||void 0===a?void 0:a.label)||"Source",i("span",e({style:{opacity:.6,margin:"0 6px"}},{children:"→"})),(null===(f=$[N.edge.target])||void 0===f?void 0:f.label)||"Target"]}))]})),i("div",e({style:{padding:"12px 16px 14px",fontSize:13,lineHeight:1.6,color:"#475569",whiteSpace:"pre-line"}},{children:N.edge.reasoning||"No Reasoning available..."})),i("button",e({onClick:function(){return T(null)},style:{position:"absolute",top:8,right:10,background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",borderRadius:6,width:24,height:24,cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center"}},{children:"×"}))]}))]})),i("style",{children:"\n @keyframes popIn { from { opacity:0; transform:scale(0.95) translateY(4px); } to { opacity:1; transform:scale(1) translateY(0); } }\n @keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }\n "})]}))}var S=a.memo(function(n){var a=n.data,c=n.isDarkMode,d=void 0!==c&&c,s=n.style,u=o(!1),h=u[0],p=u[1],g=l(function(){p(!0)},[]),y=l(function(){p(!1)},[]);return t(r,{children:[i("div",e({style:e({position:"relative",width:"100%",height:"500px"},s)},{children:i(k,{data:a,onFullscreen:g,isDarkMode:d})})),i(f,e({open:h,onClose:y,maxWidth:!1,PaperProps:{style:{width:"95vw",height:"92vh",maxWidth:"none",borderRadius:12,overflow:"hidden",background:d?"#090d16":"#ffffff"}}},{children:i("div",e({style:{width:"100%",height:"100%",position:"relative"}},{children:i(k,{data:a,onFullscreen:y,isFullscreen:!0,isDarkMode:d})}))}))]})});export{S as default};
1
+ import{__rest as e,__assign as n,__spreadArray as r}from"tslib";import{jsxs as t,Fragment as o,jsx as i}from"react/jsx-runtime";import l,{useState as a,useCallback as d,useRef as c,useMemo as u,useEffect as s}from"react";import f from"@mui/material/Dialog";import v from"@mui/icons-material/Fullscreen";import p from"@mui/icons-material/CloseFullscreen";var h=170,g=48,y=["#ede9fe","#e0f2fe","#fef3c7","#dcfce7","#ffe4e6","#f0fdf4","#fef9c3","#e0e7ff","#fce7f3","#f1f5f9"],b=["#7c3aed","#0284c7","#b45309","#16a34a","#e11d48","#15803d","#a16207","#4338ca","#db2777","#475569"],x=["⚙","◈","⟐","✦","◎","⬡","◇","⊕","✶","◉"],m=["#a78bfa","#7dd3fc","#fbbf24","#86efac","#fda4af","#6ee7b7","#fde047","#a5b4fc","#f9a8d4","#94a3b8"],w=["linear-gradient(135deg,#7c3aed,#a78bfa)","linear-gradient(135deg,#0284c7,#38bdf8)","linear-gradient(135deg,#b45309,#fbbf24)","linear-gradient(135deg,#16a34a,#86efac)","linear-gradient(135deg,#e11d48,#fda4af)","linear-gradient(135deg,#15803d,#6ee7b7)","linear-gradient(135deg,#a16207,#fde047)","linear-gradient(135deg,#4338ca,#a5b4fc)","linear-gradient(135deg,#db2777,#f9a8d4)","linear-gradient(135deg,#475569,#94a3b8)"];function k(e){var t=Array.isArray(null==e?void 0:e.clusters)?e.clusters:[],o=Array.isArray(null==e?void 0:e.nodes)?e.nodes:[],i=Array.isArray(null==e?void 0:e.edges)?e.edges:[],l=function(e,n,t){var o;void 0===e&&(e=[]),void 0===n&&(n=[]),void 0===t&&(t=[]);var i=Array.isArray(e)?e:[],l=Array.isArray(n)?n:[],a=Array.isArray(t)?t:[],d=i.length;if(0===d)return new Map;var c={};i.forEach(function(e,n){c[e.id]=n});var u={},s={};i.forEach(function(e){u[e.id]=[],s[e.id]=[]}),l.forEach(function(e){u[e.source]&&u[e.source].push(e.target),s[e.target]&&s[e.target].push(e.source)});var f={};i.forEach(function(e){f[e.id]=0});for(var v=0;v<d;v++){for(var p=!1,h=0,g=l;h<g.length;h++){var y=g[h],b=(f[y.source]||0)+1;b>(f[y.target]||0)&&b<d&&(f[y.target]=b,p=!0)}if(!p)break}var x={};a.forEach(function(e,n){x[e.id]=n});var m={};a.forEach(function(e){m[e.id]=[]}),i.forEach(function(e){var n;null===(n=m[e.cluster_id])||void 0===n||n.push(e)}),Object.values(m).forEach(function(e){return e.sort(function(e,n){return(f[e.id]||0)-(f[n.id]||0)})});for(var w=new Float64Array(d),k=new Float64Array(d),M=new Float64Array(d),C=new Float64Array(d),S=function(e){var n=null!==(o=x[e.id])&&void 0!==o?o:0;(m[e.id]||[]).forEach(function(e,r){var t=c[e.id];w[t]=520*n+280,k[t]=200*r+120})},E=0,z=a;E<z.length;E++)S(V=z[E]);for(var P=.0015,A=Math.max.apply(Math,r(r([],i.map(function(e){return f[e.id]||0}),!1),[1],!1)),F=new Float64Array(d),I=0;I<d;I++)F[I]=(f[i[I].id]||0)/A*(200*d*.6)+120;for(var W=0;W<350;W++){var R=Math.max(.015,1-W/350),B=new Float64Array(d),D=new Float64Array(d);for(I=0;I<d;I++)for(var Y=I+1;Y<d;Y++){var _=(Q=w[I]-w[Y])*Q+(U=k[I]-k[Y])*U;_<400&&(_=(Q=12*(I-Y))*Q+(U=8*(I+Y))*U);var j=Q/(O=Math.sqrt(_))*(q=48e4/_),N=U/O*q;B[I]+=j,D[I]+=N,B[Y]-=j,D[Y]-=N}for(var L=0,X=l;L<X.length;L++){y=X[L];var H=c[y.source],T=c[y.target];if(void 0!==H&&void 0!==T){var O,q,Q=w[T]-w[H],U=k[T]-k[H];if(!((O=Math.sqrt(Q*Q+U*U))<1))j=Q/O*(q=.004*(O-380)),N=U/O*q,B[H]+=j,D[H]+=N,B[T]-=j,D[T]-=N}}var G={},J={},K={};for(I=0;I<d;I++)G[V=i[I].cluster_id]=(G[V]||0)+w[I],J[V]=(J[V]||0)+k[I],K[V]=(K[V]||0)+1;for(I=0;I<d;I++){var V=i[I].cluster_id;B[I]+=(G[V]/K[V]-w[I])*P,D[I]+=(J[V]/K[V]-k[I])*P}for(I=0;I<d;I++)D[I]+=.002*(F[I]-k[I]);for(I=0;I<d;I++)M[I]=.84*(M[I]+B[I])*R,C[I]=.84*(C[I]+D[I])*R,w[I]+=M[I],k[I]+=C[I]}for(v=0;v<40;v++){var Z=!1;for(I=0;I<d;I++)for(Y=I+1;Y<d;Y++){Q=w[I]-w[Y],U=k[I]-k[Y];var $=270-Math.abs(Q),ee=128-Math.abs(U);if($>0&&ee>0)if(Z=!0,$<ee){var ne=$/2+5;w[I]+=Q>0?ne:-ne,w[Y]-=Q>0?ne:-ne}else ne=ee/2+5,k[I]+=U>0?ne:-ne,k[Y]-=U>0?ne:-ne}if(!Z)break}var re=1/0,te=1/0;for(I=0;I<d;I++)re=Math.min(re,w[I]),te=Math.min(te,k[I]);var oe=new Map;for(I=0;I<d;I++)oe.set(i[I].id,{x:Math.round(w[I]-re+80),y:Math.round(k[I]-te+80)});return oe}(o,i,t),a=o.map(function(e){var r=l.get(e.id)||{x:0,y:0};return n(n({},e),{x:r.x,y:r.y})}),d={};t.forEach(function(e,n){d[e.id]=n});var c={};t.forEach(function(e){c[e.id]=[]}),a.forEach(function(e){var n;null===(n=c[e.cluster_id])||void 0===n||n.push(e)});var u=36,s=t.map(function(e){var n=c[e.id];if(!n.length)return null;var r=Math.min.apply(Math,n.map(function(e){return e.x})),t=Math.min.apply(Math,n.map(function(e){return e.y})),o=Math.max.apply(Math,n.map(function(e){return e.x+h})),i=Math.max.apply(Math,n.map(function(e){return e.y+g}));return{id:e.id,label:e.label,idx:d[e.id],x:r-u,y:t-u,width:o-r+72,height:i-t+72+22}}).filter(function(e){return null!==e});return{nodes:a.map(function(e){var r;return n(n({},e),{cluster:null!==(r=d[e.cluster_id])&&void 0!==r?r:0})}),edges:i,clusterBounds:s,canvasW:Math.max.apply(Math,a.map(function(e){return e.x+h}))+72,canvasH:Math.max.apply(Math,a.map(function(e){return e.y+g}))+72}}function M(e,n,r){var t=n[e.source],o=n[e.target];if(!t||!o)return"";var i=function(e,n){var r=e.x+85,t=e.y+24,o=n.x+85,i=n.y+24;function l(e,n,r,t){var o=r-e,i=t-n;return Math.abs(i)>.4*Math.abs(o)?i>0?{x:e,y:n+24}:{x:e,y:n-24}:o>0?{x:e+85,y:n}:{x:e-85,y:n}}return{source:l(r,t,o,i),target:l(o,i,r,t)}}(t,o),l=i.source,a=i.target,d=a.x-l.x,c=a.y-l.y,u=Math.sqrt(d*d+c*c);if(u<5)return"M ".concat(l.x," ").concat(l.y," L ").concat(a.x," ").concat(a.y);if(o.y+150<t.y&&o.y<t.y-g){var s=Math.min(t.x,o.x)-110;return"M ".concat(l.x," ").concat(l.y," C ").concat(s," ").concat(l.y,", ").concat(s," ").concat(a.y,", ").concat(a.x," ").concat(a.y)}var f=-c/u,v=d/u;if(r.some(function(n){return n.source===e.target&&n.target===e.source})){var p=e.source<e.target?1:-1,h=Math.max(.18*u,40)*p,y=(l.x+a.x)/2+f*h,b=(l.y+a.y)/2+v*h;return"M ".concat(l.x," ").concat(l.y," Q ").concat(y," ").concat(b," ").concat(a.x," ").concat(a.y)}var x=Math.min(.12*u,55),m=(l.x+a.x)/2+f*x,w=(l.y+a.y)/2+v*x;return"M ".concat(l.x," ").concat(l.y," Q ").concat(m," ").concat(w," ").concat(a.x," ").concat(a.y)}function C(e){var r,l,f,C=e.data,S=e.onFullscreen,E=e.isFullscreen,z=e.isDarkMode,P=void 0!==z&&z,A=e.style,F=c(null),I=a({x:0,y:0}),W=I[0],R=I[1],B=a(.5),D=B[0],Y=B[1],_=a(!1),j=_[0],N=_[1],L=c({x:0,y:0}),X=c({x:0,y:0}),H=a(null),T=H[0],O=H[1],q=a(null),Q=q[0],U=q[1],G=a(null),J=G[0],K=G[1],V=a(null),Z=V[0],$=V[1],ee=u(function(){return k(C)},[C]),ne=u(function(){var e={};return ee.nodes.forEach(function(n){e[n.id]=n}),e},[ee]),re=u(function(){var e={};return C.clusters.forEach(function(n,r){e[n.id]=r}),e},[C]),te=u(function(){return Z?new Set(ee.edges.filter(function(e){return e.source===Z||e.target===Z}).map(function(e){return e.id})):new Set},[Z,ee.edges]),oe=u(function(){if(!Z)return new Set;var e=new Set([Z]);return ee.edges.forEach(function(n){n.source===Z&&e.add(n.target),n.target===Z&&e.add(n.source)}),e},[Z,ee.edges]),ie=u(function(){return new Date(C.last_analyzed_at).toLocaleString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,day:"numeric",month:"short",year:"numeric"})},[C.last_analyzed_at]),le=d(function(e){e.target.closest("[data-edge-hit]")||e.target.closest("[data-node]")||(N(!0),L.current={x:e.clientX,y:e.clientY},X.current=n({},W),e.currentTarget.style.cursor="grabbing")},[W]),ae=d(function(e){j&&R({x:X.current.x+(e.clientX-L.current.x),y:X.current.y+(e.clientY-L.current.y)})},[j]),de=d(function(){N(!1),F.current&&(F.current.style.cursor="grab")},[]),ce=d(function(e){e.preventDefault(),Y(function(n){return Math.min(2.5,Math.max(.2,n-.001*e.deltaY))})},[]);s(function(){var e=F.current;return e&&e.addEventListener("wheel",ce,{passive:!1}),function(){return null==e?void 0:e.removeEventListener("wheel",ce)}},[ce]);var ue=(null==A?void 0:A.backgroundColor)||(null==A?void 0:A.background)||(P?"#090d16":"#ffffff"),se=(null==A?void 0:A.color)||(P?"#f8fafc":"#1e293b"),fe=(null===(r=null==A?void 0:A.subtitle)||void 0===r?void 0:r.color)||"#94a3b8",ve=function(e,n){return"string"==typeof e?e:n},pe=n({width:32,height:32,border:"none",background:"transparent",borderRadius:8,cursor:"pointer",fontSize:16,color:P?"#cbd5e1":"#475569",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500},null==A?void 0:A.controlButton);return t("div",n({style:n({width:"100%",height:"100%",background:ue,color:se,fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",position:"relative",overflow:"hidden"},null==A?void 0:A.root)},{children:[t("div",n({style:n({position:"absolute",top:0,left:0,right:0,zIndex:20,borderBottom:E?P?"1px solid #1e293b":"1px solid #f1f5f9":"none",background:E?ue:"transparent"},null==A?void 0:A.header)},{children:[t("div",n({style:{padding:"10px 14px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t("div",{children:[E&&i("h2",n({style:n({margin:0,fontSize:17,fontWeight:700,color:se},null==A?void 0:A.title)},{children:"Dependency Graph"})),t("p",n({style:n({margin:"2px 0 0",fontSize:12,color:fe},null==A?void 0:A.subtitle)},{children:["Last analyzed: ".concat(ie||""," · "),"Click a node or connection to explore details and dependencies."]}))]}),t("div",n({style:{display:"flex",gap:6,alignItems:"center"}},{children:[t("div",n({style:n({display:"flex",gap:2,background:P?"#1e293b":"#fff",borderRadius:10,padding:3,boxShadow:P?"0 1px 4px rgba(0,0,0,0.4)":"0 1px 4px rgba(0,0,0,0.08)"},null==A?void 0:A.controls)},{children:[i("button",n({onClick:function(){return Y(function(e){return Math.max(.2,e-.15)})},style:pe},{children:"−"})),t("button",n({onClick:function(){Y(.5),R({x:0,y:0})},style:n(n({},pe),{fontSize:11,width:52,fontWeight:600})},{children:[Math.round(100*D)||0,"%"]})),i("button",n({onClick:function(){return Y(function(e){return Math.min(2.5,e+.15)})},style:pe},{children:"+"}))]})),S&&i("div",n({style:n({display:"flex",background:P?"#1e293b":"#fff",borderRadius:10,padding:3,boxShadow:P?"0 1px 4px rgba(0,0,0,0.4)":"0 1px 4px rgba(0,0,0,0.08)"},null==A?void 0:A.controls)},{children:i("button",n({onClick:S,style:pe},{children:i(E?p:v,{style:{fontSize:16}})}))}))]}))]})),Q&&i("div",n({style:n({margin:"0 20px 14px",width:"30%",minWidth:280,borderRadius:12,overflow:"hidden",boxShadow:"0 2px 12px rgba(0,0,0,0.07)",border:"1px solid #e2e8f0",animation:"slideDown 0.2s ease-out"},null==A?void 0:A.nodePopup)},{children:function(){var e,r,o=Q.node,l=null!==(e=re[o.cluster_id])&&void 0!==e?e:0;return ee.edges.filter(function(e){return e.source===o.id}).length,ee.edges.filter(function(e){return e.target===o.id}).length,t("div",{children:[t("div",n({style:n({padding:"10px 14px",background:w[l%w.length||0],color:"#fff",display:"flex",alignItems:"center",justifyContent:"space-between"},null==A?void 0:A.nodePopupHeader)},{children:[t("div",n({style:{display:"flex",alignItems:"center",gap:10}},{children:[i("span",n({style:{width:28,height:28,borderRadius:8,background:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14}},{children:x[l%x.length||0]})),t("div",{children:[i("div",n({style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",opacity:.75}},{children:(null===(r=C.clusters[l])||void 0===r?void 0:r.label)||"Cluster Name"})),i("div",n({style:{fontSize:14,fontWeight:700,marginTop:1}},{children:o.label||"Cluster Name"}))]})]})),i("button",n({onClick:function(){U(null),$(null)},style:n({background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",borderRadius:6,width:24,height:24,cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},null==A?void 0:A.popupCloseButton)},{children:"×"}))]})),i("div",n({style:n({padding:"10px 14px",fontSize:13,lineHeight:1.6,color:P?"#cbd5e1":"#475569",background:P?"#1e293b":"#fff"},null==A?void 0:A.nodePopupBody)},{children:o.description||"No description available..."}))]})}()}))]})),t("div",n({ref:F,onPointerDown:le,onPointerMove:ae,onPointerUp:de,onPointerLeave:de,onClick:function(){O(null),U(null),$(null)},style:{width:"100%",height:"100%",cursor:j?"grabbing":"grab",position:"relative"}},{children:[i("div",n({style:{transform:"translate(".concat(W.x,"px, ").concat(W.y,"px) scale(").concat(D,")"),transformOrigin:"top left",position:"absolute",top:E?70:50,left:20,transition:j?"none":"transform 0.08s ease-out"}},{children:t("svg",n({width:ee.canvasW,height:ee.canvasH,style:{overflow:"visible"}},{children:[ee.clusterBounds.map(function(e){var r,o,l,a,d;return t("g",{children:[i("rect",{x:e.x,y:e.y,width:e.width,height:e.height,rx:"16",fill:ve((null===(r=null==A?void 0:A.cluster)||void 0===r?void 0:r.backgroundColor)||(null===(o=null==A?void 0:A.cluster)||void 0===o?void 0:o.background),P?"rgba(30, 41, 59, 0.35)":"none"),stroke:ve((null===(l=null==A?void 0:A.cluster)||void 0===l?void 0:l.borderColor)||(null===(a=null==A?void 0:A.cluster)||void 0===a?void 0:a.border),P?"#334155":"#e2e8f0"),strokeWidth:"1.5",strokeDasharray:"8 4"}),i("text",n({x:e.x+14,y:e.y+e.height-10,fontSize:"11",fill:ve(null===(d=null==A?void 0:A.clusterLabel)||void 0===d?void 0:d.color,"#94a3b8"),fontFamily:"Inter, sans-serif",fontWeight:"500"},{children:e.label||"Cluster Name"}))]},e.id)}),ee.edges.map(function(e){var r,l,a,d,c,u,s,f,v,p=M(e,ne,ee.edges);if(!p)return null;var h=te.has(e.id),g=(null==T?void 0:T.edge.id)===e.id,y=J===e.id,b=!!Z&&!h,x=h||g?(null===(r=null==A?void 0:A.activeEdge)||void 0===r?void 0:r.color)||(null===(l=null==A?void 0:A.activeEdge)||void 0===l?void 0:l.borderColor)||"#6366f1":y?(null===(a=null==A?void 0:A.edge)||void 0===a?void 0:a.color)||"#818cf8":(null===(d=null==A?void 0:A.edge)||void 0===d?void 0:d.borderColor)||(null===(c=null==A?void 0:A.edge)||void 0===c?void 0:c.color)||(P?"#475569":"#cbd5e1"),m=h||g?2.5:y?2:1.5;return t("g",n({style:{opacity:b?.1:1,transition:"opacity 0.25s"}},{children:[i("path",{"data-edge-hit":"true",d:p,fill:"none",stroke:"transparent",strokeWidth:18,style:{cursor:"pointer"},onClick:function(n){return function(e,n){e.stopPropagation();var r=F.current.getBoundingClientRect();O({edge:n,screenX:e.clientX-r.left,screenY:e.clientY-r.top}),U(null),$(null)}(n,e)},onMouseEnter:function(){return K(e.id)},onMouseLeave:function(){return K(null)}}),i("path",{d:p,fill:"none",stroke:x,strokeWidth:m,style:{transition:"stroke 0.2s, stroke-width 0.2s",pointerEvents:"none"}}),(h||g)&&t(o,{children:[i("circle",n({r:4,fill:(null===(u=null==A?void 0:A.edgeMarker)||void 0===u?void 0:u.color)||(null===(s=null==A?void 0:A.activeEdge)||void 0===s?void 0:s.color)||"#6366f1"},{children:i("animateMotion",{dur:"1.8s",repeatCount:"indefinite",path:p})})),i("circle",n({r:6,fill:(null===(f=null==A?void 0:A.edgeMarker)||void 0===f?void 0:f.color)||(null===(v=null==A?void 0:A.activeEdge)||void 0===v?void 0:v.color)||"#6366f1",opacity:.2},{children:i("animateMotion",{dur:"1.8s",repeatCount:"indefinite",path:p})}))]})]}),e.id)}),ee.nodes.map(function(e){var r,o,l,a,d,c,u,s,f,v=Z===e.id,p=oe.has(e.id),w=!!Z&&!p,k=(null!==(r=re[e.cluster_id])&&void 0!==r?r:0)%m.length,M=m[k||0];return i("g",n({"data-node":"true",onClick:function(n){return function(e,n){e.stopPropagation();var r=F.current.getBoundingClientRect();Z===n.id?($(null),U(null)):($(n.id),U({node:n,screenX:e.clientX-r.left,screenY:e.clientY-r.top}),O(null))}(n,e)},style:{cursor:"pointer",opacity:w?.15:1,transition:"opacity 0.25s"}},{children:i("foreignObject",n({x:e.x,y:e.y,width:h,height:g},{children:t("div",n({style:n(n({background:(null===(o=null==A?void 0:A.node)||void 0===o?void 0:o.backgroundColor)||(null===(l=null==A?void 0:A.node)||void 0===l?void 0:l.background)||(P?"#1e293b":"#fff"),border:v?(null===(a=null==A?void 0:A.selectedNode)||void 0===a?void 0:a.border)||"2.5px solid ".concat((null===(d=null==A?void 0:A.selectedNode)||void 0===d?void 0:d.borderColor)||M):(null===(c=null==A?void 0:A.node)||void 0===c?void 0:c.border)||"1.5px solid ".concat((null===(u=null==A?void 0:A.node)||void 0===u?void 0:u.borderColor)||(P?"#334155":"#e2e8f0")),borderRadius:10,padding:"8px 14px",fontSize:13,fontWeight:600,color:P?"#f1f5f9":"#334155",fontFamily:"'Inter', sans-serif",display:"flex",alignItems:"center",gap:8,boxShadow:v?(null===(s=null==A?void 0:A.selectedNode)||void 0===s?void 0:s.boxShadow)||"0 0 0 3px ".concat(M,"33, 0 2px 8px rgba(0,0,0,0.4)"):(null===(f=null==A?void 0:A.node)||void 0===f?void 0:f.boxShadow)||(P?"0 2px 6px rgba(0,0,0,0.3)":"0 1px 3px rgba(0,0,0,0.05)"),whiteSpace:"nowrap",userSelect:"none",height:46,boxSizing:"border-box",transition:"border 0.2s, box-shadow 0.2s"},null==A?void 0:A.node),v?null==A?void 0:A.selectedNode:{})},{children:[i("span",n({style:n({width:22,height:22,borderRadius:6,background:y[k],display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,flexShrink:0,color:b[k]},null==A?void 0:A.nodeIcon)},{children:x[k]})),i("span",n({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:e.label||"Node name"}))]}))}))}),e.id)})]}))})),T&&t("div",n({onClick:function(e){return e.stopPropagation()},style:n(n(n({position:"absolute"},function(e,n,r,t){if(!F.current)return{};var o=F.current.getBoundingClientRect(),i=e+14,l=n-t/2;return i+r>o.width&&(i=e-r-14),l<8&&(l=8),l+t>o.height&&(l=o.height-t-8),{left:i,top:l}}(T.screenX,T.screenY,320,180)),{width:320,background:P?"#1e293b":"#fff",borderRadius:14,boxShadow:"0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06)",border:"1px solid #e2e8f0",zIndex:30,animation:"popIn 0.18s ease-out",overflow:"hidden"}),null==A?void 0:A.edgePopup)},{children:[t("div",n({style:n({padding:"12px 16px 10px",background:"linear-gradient(135deg, #6366f1, #8b5cf6)",color:"#fff"},null==A?void 0:A.edgePopupHeader)},{children:[i("div",n({style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",opacity:.8}},{children:"Edge Reasoning"})),t("div",n({style:{fontSize:13,fontWeight:600,marginTop:4}},{children:[(null===(l=ne[T.edge.source])||void 0===l?void 0:l.label)||"Source",i("span",n({style:{opacity:.6,margin:"0 6px"}},{children:"→"})),(null===(f=ne[T.edge.target])||void 0===f?void 0:f.label)||"Target"]}))]})),i("div",n({style:n({padding:"12px 16px 14px",fontSize:13,lineHeight:1.6,color:P?"#cbd5e1":"#475569",whiteSpace:"pre-line"},null==A?void 0:A.edgePopupBody)},{children:T.edge.reasoning||"No Reasoning available..."})),i("button",n({onClick:function(){return O(null)},style:n({position:"absolute",top:8,right:10,background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",borderRadius:6,width:24,height:24,cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center"},null==A?void 0:A.popupCloseButton)},{children:"×"}))]}))]})),i("style",{children:"\n @keyframes popIn { from { opacity:0; transform:scale(0.95) translateY(4px); } to { opacity:1; transform:scale(1) translateY(0); } }\n @keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }\n "})]}))}var S=l.memo(function(r){var l=r.data,c=r.isDarkMode,u=void 0!==c&&c,s=r.style,v=a(!1),p=v[0],h=v[1],g=s||{};g.fullscreenPaper,g.root,g.header,g.title,g.subtitle,g.controls,g.controlButton,g.nodePopup,g.edgePopup;var y=e(g,["fullscreenPaper","root","header","title","subtitle","controls","controlButton","nodePopup","edgePopup"]),b=s||{},x=d(function(){h(!0)},[]),m=d(function(){h(!1)},[]);return t(o,{children:[i("div",n({style:n({position:"relative",width:"100%",height:"500px"},y)},{children:i(C,{data:l,onFullscreen:x,isDarkMode:u,style:b})})),i(f,n({open:p,onClose:m,maxWidth:!1,PaperProps:{style:n({width:"95vw",height:"92vh",maxWidth:"none",borderRadius:12,overflow:"hidden",background:b.backgroundColor||b.background||(u?"#090d16":"#ffffff"),color:b.color||(u?"#f8fafc":"#1e293b")},b.fullscreenPaper)}},{children:i("div",n({style:{width:"100%",height:"100%",position:"relative",background:b.backgroundColor||b.background||(u?"#090d16":"#ffffff")}},{children:i(C,{data:l,onFullscreen:m,isFullscreen:!0,isDarkMode:u,style:b})}))}))]})});export{S as default};
2
2
  //# sourceMappingURL=DependencyGraph.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as n,__awaiter as o,__generator as r}from"tslib";import{jsxs as i,jsx as t,Fragment as a}from"react/jsx-runtime";import l,{useState as d,useMemo as c,useRef as s,useEffect as p}from"react";import u from"react-markdown";import f from"rehype-raw";import{Box as h,Tooltip as g}from"@mui/material";import{Prism as m}from"react-syntax-highlighter";import{oneLight as v}from"react-syntax-highlighter/dist/esm/styles/prism";import{Check as b,ContentCopy as y,ExpandLess as x,ExpandMore as k}from"@mui/icons-material";import S from"@mui/icons-material/ExpandMoreOutlined";import _ from"./Cognitivereasoningpanel.js";var w=function(e){var n,o,r;void 0===e&&(e="");var i=null==e?void 0:e.replace(/\\`/g,"`");return i=null==(i=null==(i=null===(r=null==(i=null===(o=null===(n=null==(i=null==i?void 0:i.replace(/```json\s*([\s\S]*?)```/g,function(e,n){return"<codebasename>".concat(n.trim(),"</codebasename>")}))?void 0:i.replace(/^```.*\n?/,""))||void 0===n?void 0:n.replace(/\n?```$/,""))||void 0===o?void 0:o.trim())?void 0:i.replace(/^```/,""))||void 0===r?void 0:r.replace(/```$/,""))?void 0:i.replace(/<\/summary>/g,"</summary>\n"))?void 0:i.replace(/<details>/g,"\n<details>")},M=function(e){var a=e.text,l=d(!1),c=l[0],s=l[1];return i("button",n({onClick:function(){return o(void 0,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.clipboard.writeText(a)];case 1:return e.sent(),s(!0),setTimeout(function(){return s(!1)},2e3),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}})})},"aria-label":"Copy code",style:{position:"absolute",top:8,right:8,display:"inline-flex",alignItems:"center",gap:4,padding:"3px 8px",fontSize:"0.68rem",fontWeight:500,fontFamily:"inherit",color:c?"#16a34a":"#6B7280",background:c?"#f0fdf4":"#f3f4f6",border:"1px solid ".concat(c?"#bbf7d0":"#e5e7eb"),borderRadius:6,cursor:"pointer",transition:"all 0.2s",opacity:.85},onMouseEnter:function(e){e.currentTarget.style.opacity="1"},onMouseLeave:function(e){e.currentTarget.style.opacity="0.85"}},{children:[t(c?b:y,{style:{fontSize:13}}),c?"Copied":"Copy"]}))},z=function(o){o.node;var r=e(o,["node"]),a=d(!1),c=a[0],u=a[1],f=s(null),h=l.Children.toArray(r.children),g=h.find(function(e){var n;return null===(n=null==e?void 0:e.props)||void 0===n?void 0:n["data-codebase-name"]}),m=!!g,v=m?g.props["data-codebase-name"]:"",b=h.map(function(e){var n;return"string"==typeof e?e:(null===(n=e.props)||void 0===n?void 0:n.children)||""}).join("").replace(/\*\*/g,"").trim(),y=m?"From ".concat(v," codebase"):b||"Accordion title not found";return p(function(){var e,n=null===(e=f.current)||void 0===e?void 0:e.parentElement;if(n){var o=function(){return u(n.open)};return o(),n.addEventListener("toggle",o),function(){return n.removeEventListener("toggle",o)}}},[]),i("summary",n({ref:f,style:{padding:"8px 12px",listStyleType:"none",cursor:"pointer",fontWeight:600,fontSize:"0.82rem",color:"#6932E2",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,borderRadius:8,background:c?"#f5f3ff":"transparent",transition:"background 0.2s"}},{children:[t("span",{children:y}),t("div",n({style:{display:"flex",alignItems:"center",flexShrink:0,color:"#6932E2"}},{children:t(c?x:k,{sx:{fontSize:"1.1rem"}})}))]}))},C=function(o){var r=o.message,s=o.fontSize,p=o.extraMetaData,b=o.isDarkMode,y=void 0!==b&&b,x=o.style,k=o.sx,C=null!=s?s:"0.88rem",W=y?"#e2e8f0":"#1f2937",R=y?"#f8fafc":"#111827",E=d({open:!1,data:null,activeKey:null}),H=E[0],K=E[1],L=function(){return K({open:!1,data:null,activeKey:null})},T=c(function(){var e=function(e){var n={};return{processed:e.replace(/<!--\s*<ai_reasoning>\s*([\s\S]*?)\s*<\/ai_reasoning>\s*-->/g,function(e,o){try{var r=JSON.parse(o.trim()),i=r.id||"reasoning_".concat(Object.keys(n).length);return n[i]=r,'<aireasoning data-reasoning-key="'.concat(i,'">').concat(i,"</aireasoning>")}catch(e){return console.warn("[ai_reasoning] Failed to parse block:",e),""}}),reasoningMap:n}}(r||"");return{processedMessage:e.processed,inlineReasoningMap:e.reasoningMap}},[r]),j=T.processedMessage,B=T.inlineReasoningMap,F=c(function(){return{aireasoning:function(o){o.node;var r=e(o,["node"])["data-reasoning-key"],a=B[r];if(!a)return null;var l=H.open&&H.activeKey===r;return i("div",n({style:{margin:"6px 0"}},{children:[i("span",n({onClick:function(e){e.stopPropagation();var n=function(e){var n,o,r,i,t,a=[];return(null!==(o=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==o?o:[]).forEach(function(e){var n,o,r,i,t,l,d,c,s,p,u=null!==(o=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==o?o:[],f=null!==(i=null===(r=e.customMetadata)||void 0===r?void 0:r.training_data_title)&&void 0!==i?i:[],h=null!==(l=null===(t=e.customMetadata)||void 0===t?void 0:t.paraphrase)&&void 0!==l?l:[],g=null===(d=u[0])||void 0===d?void 0:d.match(/<highlight>([\s\S]*?)<\/highlight>/),m=g?g[1].trim():null!==(c=u[0])&&void 0!==c?c:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(s=f[0])&&void 0!==s?s:"",paraphrase:null!==(p=h[0])&&void 0!==p?p:"",highlight:m})}),{block_cognitive_reasoning_html:null!==(r=e.reasoning)&&void 0!==r?r:"",block_cognitive_gap_html:null!==(i=e.Gap)&&void 0!==i?i:"",block_cognitive_confidence:Number(null!==(t=e.decision_strength)&&void 0!==t?t:0),block_cognitive_citations:a}}(a);K(function(e){return e.open&&e.activeKey===r?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:r}})},style:{display:"inline-flex",alignItems:"center",gap:6,cursor:"pointer",color:y?"#a78bfa":"#6932E2",fontWeight:500,fontSize:C,transition:"all 0.2s",padding:"2px 0"}},{children:[t("span",{children:r}),t("span",n({style:{display:"inline-flex",alignItems:"center",gap:2,border:y?"1px solid #334155":"1px solid #e2e8f0",borderRadius:5,padding:"4px 2px"}},{children:t(S,{sx:{fontSize:"1rem",color:y?"#94a3b8":"#475569",transform:l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})}))]})),l&&H.data&&t(h,n({component:"div",onClick:function(e){return e.stopPropagation()},sx:{display:"block",width:"fit-content",maxWidth:"100%",mt:1,mb:1,ml:0}},{children:t(_,{open:!0,onClose:L,data:H.data})}))]}))},codebasename:function(e){var o=e.children,r=("string"==typeof o[0]?o[0]:"").trim();return""!==r?i("div",n({"data-codebase-name":r,style:{position:"relative",margin:"12px 0"}},{children:[t(M,{text:String(o).replace(/\n$/,"")}),t(m,n({style:v,language:"json",PreTag:"div",customStyle:{borderRadius:8,padding:"1rem",fontSize:"0.8rem",border:y?"1px solid #334155":"1px solid #e5e7eb",margin:0,lineHeight:1.6}},{children:String(o).replace(/\n$/,"")}))]})):t(a,{})},details:function(o){o.node;var r=e(o,["node"]);return t("details",n({},r,{style:{borderRadius:8,border:y?"1px solid #334155":"1px solid #e9e5f5",backgroundColor:"transparent",margin:"8px 0",overflow:"hidden"}},{children:r.children}))},summary:z,p:function(o){o.node;var r=e(o,["node"]);return t("p",n({style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"block",maxWidth:"100%",fontSize:C,lineHeight:1.7,margin:"4px 0",color:W}},{children:null==r?void 0:r.children}))},strong:function(o){o.node;var r=e(o,["node"]);return t("strong",n({style:{fontWeight:650,color:R}},{children:null==r?void 0:r.children}))},h1:function(o){o.node;var r=e(o,["node"]);return t("h1",n({style:{fontSize:"1.35rem",fontWeight:700,color:R,margin:"20px 0 8px",lineHeight:1.3,letterSpacing:"-0.01em"}},{children:r.children}))},h2:function(o){o.node;var r=e(o,["node"]);return t("h2",n({style:{fontSize:"1.15rem",fontWeight:650,color:R,margin:"16px 0 6px",lineHeight:1.35}},{children:r.children}))},h3:function(o){o.node;var r=e(o,["node"]);return t("h3",n({style:{fontSize:"1rem",fontWeight:600,color:R,margin:"14px 0 4px",lineHeight:1.4}},{children:r.children}))},h4:function(o){o.node;var r=e(o,["node"]);return t("h4",n({style:{fontSize:"0.92rem",fontWeight:600,color:W,margin:"12px 0 4px",lineHeight:1.4}},{children:r.children}))},ol:function(o){o.node;var r=e(o,["node"]);return t("ol",n({style:{listStyleType:"decimal",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==r?void 0:r.children}))},ul:function(o){o.node;var r=e(o,["node"]);return t("ul",n({style:{listStyleType:"disc",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==r?void 0:r.children}))},li:function(o){o.node;var r=e(o,["node"]);return t("li",n({style:{fontSize:C,lineHeight:1.7,color:W,paddingLeft:4}},{children:r.children}))},blockquote:function(o){o.node;var r=e(o,["node"]);return t("blockquote",n({style:{margin:"12px 0",padding:"8px 16px",borderLeft:"3px solid #8b5cf6",background:y?"#1e1b4b":"#faf5ff",borderRadius:"0 6px 6px 0",color:y?"#cbd5e1":"#4b5563",fontStyle:"italic",fontSize:C,lineHeight:1.65}},{children:r.children}))},hr:function(){return t("hr",{style:{border:"none",height:1,background:y?"linear-gradient(to right, transparent, #334155, transparent)":"linear-gradient(to right, transparent, #d1d5db, transparent)",margin:"16px 0"}})},table:function(o){o.node;var r=e(o,["node"]);return t("div",n({style:{overflowX:"auto",margin:"12px 0",borderRadius:8,border:y?"1px solid #334155":"1px solid #e5e7eb"}},{children:t("table",n({style:{width:"100%",borderCollapse:"collapse",fontSize:"0.8rem",lineHeight:1.5}},{children:r.children}))}))},thead:function(o){o.node;var r=e(o,["node"]);return t("thead",n({style:{background:y?"#1e293b":"#f9fafb",borderBottom:y?"2px solid #334155":"2px solid #e5e7eb"}},{children:r.children}))},th:function(o){o.node;var r=e(o,["node"]);return t("th",n({style:{padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:"0.76rem",color:y?"#cbd5e1":"#374151",whiteSpace:"nowrap"}},{children:r.children}))},td:function(o){o.node;var r=e(o,["node"]);return t("td",n({style:{padding:"8px 12px",borderTop:y?"1px solid #334155":"1px solid #f3f4f6",color:y?"#94a3b8":"#4b5563",fontSize:"0.8rem"}},{children:r.children}))},a:function(o){var r=o.children;o.node;var l=e(o,["children","node"]),d=l["data-cognitive-reasoning"];if(d&&(null==p?void 0:p[d]))return i(a,{children:[i("span",n({onClick:function(e){e.stopPropagation();var n=function(e){var n,o,r,i,t;if(!e)return null;var a=[];return(null!==(o=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==o?o:[]).forEach(function(e){var n,o,r,i,t,l,d,c,s,p,u=null!==(o=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==o?o:[],f=null!==(i=null===(r=e.customMetadata)||void 0===r?void 0:r.training_data_title)&&void 0!==i?i:[],h=null!==(l=null===(t=e.customMetadata)||void 0===t?void 0:t.paraphrase)&&void 0!==l?l:[],g=null===(d=u[0])||void 0===d?void 0:d.match(/<highlight>([\s\S]*?)<\/highlight>/),m=g?g[1].trim():null!==(c=u[0])&&void 0!==c?c:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(s=f[0])&&void 0!==s?s:"",paraphrase:null!==(p=h[0])&&void 0!==p?p:"",highlight:m})}),{block_cognitive_reasoning_html:null!==(r=e.Reasoning)&&void 0!==r?r:"",block_cognitive_gap_html:null!==(i=e.Gap)&&void 0!==i?i:"",block_cognitive_confidence:Number(null!==(t=e.Confidence_score)&&void 0!==t?t:0),block_cognitive_citations:a}}(p[d]);K(function(e){return e.open&&e.activeKey===d?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:d}})},style:{color:y?"#a78bfa":"#6932E2",fontWeight:500,cursor:"pointer",transition:"all 0.2s",padding:"0 2px",position:"relative",display:"flex",alignItems:"center",gap:6,width:"fit-content"}},{children:[r||"",t("span",n({style:{cursor:"pointer",padding:"4px 2px",display:"flex",alignItems:"center",gap:2,border:y?"1px solid #334155":"1px solid #e2e8f0",borderRadius:"5px",width:"fit-content"}},{children:t(S,{sx:{fontSize:"1rem",color:y?"#94a3b8":"#475569",transition:"transform 0.2s"}})}))]})),H.open&&H.activeKey===d&&H.data&&t(h,n({component:"div",onClick:function(e){return e.stopPropagation()},sx:{display:"block",width:"fit-content",maxWidth:"100%",mt:1,mb:1,ml:0}},{children:t(_,{open:!0,onClose:L,data:H.data})}))]});var c=!1;try{c=new URL(null==l?void 0:l.href).protocol.startsWith("http")}catch(e){c=!1}return c?t("a",n({href:null==l?void 0:l.href,style:{color:y?"#a78bfa":"#6932E2",textDecoration:"none",fontWeight:500,borderBottom:y?"1px solid #7c3aed":"1px solid #c4b5fd",transition:"border-color 0.2s, color 0.2s"},target:"_blank",rel:"noopener noreferrer",onMouseEnter:function(e){e.currentTarget.style.borderBottomColor=y?"#a78bfa":"#6932E2"},onMouseLeave:function(e){e.currentTarget.style.borderBottomColor=y?"#7c3aed":"#c4b5fd"}},{children:r})):t("span",{children:r})},sup:function(o){o.node;var r=e(o,["node"]);return t(g,n({title:r.children,placement:"top",arrow:!0},{children:t(h,n({component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:16,borderRadius:"50%",background:y?"#3730a3":"#ede9fe",color:y?"#c084fc":"#7c3aed",fontSize:"0.6rem",fontWeight:700,verticalAlign:"super",cursor:"pointer",userSelect:"none",lineHeight:1,transition:"all 0.2s","&:hover":{background:y?"#6d28d9":"#7c3aed",color:"#fff"}},"aria-label":"Info",role:"button"},{children:"i"}))}))},code:function(e){var o=e.children;return t("code",n({style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.82em",color:y?"#e9d5ff":"#9333ea",background:y?"#2e1065":"#faf5ff",padding:"1.5px 5px",borderRadius:4,border:y?"1px solid #581c87":"1px solid #f3e8ff",fontWeight:500}},{children:o}))},pre:function(e){var o=e.children,r=function(e){var n;return"string"==typeof e?e:(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?(Array.isArray(e.props.children)?e.props.children:[e.props.children]).map(r).join(""):""},a=l.Children.toArray(o).map(r).join("");return i("div",n({style:{position:"relative",margin:"12px 0"}},{children:[t(M,{text:a}),t("pre",n({style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.8rem",lineHeight:1.6,color:W,background:y?"#0f172a":"#f9fafb",border:y?"1px solid #334155":"1px solid #e5e7eb",borderRadius:8,padding:"14px 16px",margin:0,overflowX:"auto",whiteSpace:"pre"}},{children:o}))]}))},img:function(o){o.node;var r=e(o,["node"]);return t("img",n({},r,{style:{maxWidth:"100%",height:"auto",borderRadius:8,margin:"8px 0",border:y?"1px solid #334155":"1px solid #e5e7eb"},loading:"lazy"}))}}},[r,C,p,H.activeKey,H.open,B,y,W,R]);return t(h,n({className:"pg-markdown-renderer",style:x,sx:n(n({fontSize:C,lineHeight:1.7,color:W,wordBreak:"break-word",position:"relative"},k),{"& span[style*='color'], & font[color]":y?{color:"#60a5fa !important"}:{},"& a":{color:y?"#a78bfa !important":"#6932E2 !important"},"& strong":{color:y?"#f8fafc !important":"#111827 !important"},"& h1, & h2, & h3, & h4, & h5, & h6":{color:y?"#f1f5f9 !important":"#111827 !important"}})},{children:t(u,n({components:F,rehypePlugins:[f],className:"react-markdown-renderer-with-overrides"},{children:w(j)}))}))};export{C as MarkdownRenderer,C as default};
1
+ import{__rest as e,__assign as n,__awaiter as o,__generator as r}from"tslib";import{jsxs as i,jsx as t,Fragment as a}from"react/jsx-runtime";import l,{useState as d,useMemo as c,useRef as s,useEffect as p}from"react";import u from"react-markdown";import f from"rehype-raw";import{Box as h,Tooltip as g}from"@mui/material";import{Prism as m}from"react-syntax-highlighter";import{oneLight as v}from"react-syntax-highlighter/dist/esm/styles/prism";import{Check as b,ContentCopy as y,ExpandLess as x,ExpandMore as k}from"@mui/icons-material";import S from"@mui/icons-material/ExpandMoreOutlined";import _ from"./Cognitivereasoningpanel.js";var w=function(e){var n,o,r;void 0===e&&(e="");var i=null==e?void 0:e.replace(/\\`/g,"`");return i=null==(i=null==(i=null===(r=null==(i=null===(o=null===(n=null==(i=null==i?void 0:i.replace(/```json\s*([\s\S]*?)```/g,function(e,n){return"<codebasename>".concat(n.trim(),"</codebasename>")}))?void 0:i.replace(/^```.*\n?/,""))||void 0===n?void 0:n.replace(/\n?```$/,""))||void 0===o?void 0:o.trim())?void 0:i.replace(/^```/,""))||void 0===r?void 0:r.replace(/```$/,""))?void 0:i.replace(/<\/summary>/g,"</summary>\n"))?void 0:i.replace(/<details>/g,"\n<details>")},M=function(e){var a=e.text,l=d(!1),c=l[0],s=l[1];return i("button",n({onClick:function(){return o(void 0,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.clipboard.writeText(a)];case 1:return e.sent(),s(!0),setTimeout(function(){return s(!1)},2e3),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}})})},"aria-label":"Copy code",style:{position:"absolute",top:8,right:8,display:"inline-flex",alignItems:"center",gap:4,padding:"3px 8px",fontSize:"0.68rem",fontWeight:500,fontFamily:"inherit",color:c?"#16a34a":"#6B7280",background:c?"#f0fdf4":"#f3f4f6",border:"1px solid ".concat(c?"#bbf7d0":"#e5e7eb"),borderRadius:6,cursor:"pointer",transition:"all 0.2s",opacity:.85},onMouseEnter:function(e){e.currentTarget.style.opacity="1"},onMouseLeave:function(e){e.currentTarget.style.opacity="0.85"}},{children:[t(c?b:y,{style:{fontSize:13}}),c?"Copied":"Copy"]}))},z=function(o){o.node;var r=e(o,["node"]),a=d(!1),c=a[0],u=a[1],f=s(null),h=l.Children.toArray(r.children),g=h.find(function(e){var n;return null===(n=null==e?void 0:e.props)||void 0===n?void 0:n["data-codebase-name"]}),m=!!g,v=m?g.props["data-codebase-name"]:"",b=h.map(function(e){var n;return"string"==typeof e?e:(null===(n=e.props)||void 0===n?void 0:n.children)||""}).join("").replace(/\*\*/g,"").trim(),y=m?"From ".concat(v," codebase"):b||"Accordion title not found";return p(function(){var e,n=null===(e=f.current)||void 0===e?void 0:e.parentElement;if(n){var o=function(){return u(n.open)};return o(),n.addEventListener("toggle",o),function(){return n.removeEventListener("toggle",o)}}},[]),i("summary",n({ref:f,style:{padding:"8px 12px",listStyleType:"none",cursor:"pointer",fontWeight:600,fontSize:"0.82rem",color:"#6932E2",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,borderRadius:8,background:c?"#f5f3ff":"transparent",transition:"background 0.2s"}},{children:[t("span",{children:y}),t("div",n({style:{display:"flex",alignItems:"center",flexShrink:0,color:"#6932E2"}},{children:t(c?x:k,{sx:{fontSize:"1.1rem"}})}))]}))},C=function(o){var r=o.message,s=o.fontSize,p=o.extraMetaData,b=o.isDarkMode,y=void 0!==b&&b,x=o.cognitiveDecisioningStyles,k=o.style,C=o.sx,W=null!=s?s:"0.88rem",R=y?"#e2e8f0":"#1f2937",E=y?"#f8fafc":"#111827",H=d({open:!1,data:null,activeKey:null}),K=H[0],L=H[1],T=function(){return L({open:!1,data:null,activeKey:null})},j=c(function(){var e=function(e){var n={};return{processed:e.replace(/<!--\s*<ai_reasoning>\s*([\s\S]*?)\s*<\/ai_reasoning>\s*-->/g,function(e,o){try{var r=JSON.parse(o.trim()),i=r.id||"reasoning_".concat(Object.keys(n).length);return n[i]=r,'<aireasoning data-reasoning-key="'.concat(i,'">').concat(i,"</aireasoning>")}catch(e){return console.warn("[ai_reasoning] Failed to parse block:",e),""}}),reasoningMap:n}}(r||"");return{processedMessage:e.processed,inlineReasoningMap:e.reasoningMap}},[r]),B=j.processedMessage,F=j.inlineReasoningMap,I=c(function(){return{aireasoning:function(o){o.node;var r=e(o,["node"])["data-reasoning-key"],a=F[r];if(!a)return null;var l=K.open&&K.activeKey===r;return i("div",n({style:{margin:"6px 0"}},{children:[i("span",n({onClick:function(e){e.stopPropagation();var n=function(e){var n,o,r,i,t,a=[];return(null!==(o=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==o?o:[]).forEach(function(e){var n,o,r,i,t,l,d,c,s,p,u=null!==(o=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==o?o:[],f=null!==(i=null===(r=e.customMetadata)||void 0===r?void 0:r.training_data_title)&&void 0!==i?i:[],h=null!==(l=null===(t=e.customMetadata)||void 0===t?void 0:t.paraphrase)&&void 0!==l?l:[],g=null===(d=u[0])||void 0===d?void 0:d.match(/<highlight>([\s\S]*?)<\/highlight>/),m=g?g[1].trim():null!==(c=u[0])&&void 0!==c?c:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(s=f[0])&&void 0!==s?s:"",paraphrase:null!==(p=h[0])&&void 0!==p?p:"",highlight:m})}),{block_cognitive_reasoning_html:null!==(r=e.reasoning)&&void 0!==r?r:"",block_cognitive_gap_html:null!==(i=e.Gap)&&void 0!==i?i:"",block_cognitive_confidence:Number(null!==(t=e.decision_strength)&&void 0!==t?t:0),block_cognitive_citations:a}}(a);L(function(e){return e.open&&e.activeKey===r?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:r}})},style:{display:"inline-flex",alignItems:"center",gap:6,cursor:"pointer",color:y?"#a78bfa":"#6932E2",fontWeight:500,fontSize:W,transition:"all 0.2s",padding:"2px 0"}},{children:[t("span",{children:r}),t("span",n({style:{display:"inline-flex",alignItems:"center",gap:2,border:y?"1px solid #334155":"1px solid #e2e8f0",borderRadius:5,padding:"4px 2px"}},{children:t(S,{sx:{fontSize:"1rem",color:y?"#94a3b8":"#475569",transform:l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})}))]})),l&&K.data&&t(h,n({component:"div",onClick:function(e){return e.stopPropagation()},sx:{display:"block",width:"fit-content",maxWidth:"100%",mt:1,mb:1,ml:0}},{children:t(_,{open:!0,onClose:T,data:K.data,styles:x})}))]}))},codebasename:function(e){var o=e.children,r=("string"==typeof o[0]?o[0]:"").trim();return""!==r?i("div",n({"data-codebase-name":r,style:{position:"relative",margin:"12px 0"}},{children:[t(M,{text:String(o).replace(/\n$/,"")}),t(m,n({style:v,language:"json",PreTag:"div",customStyle:{borderRadius:8,padding:"1rem",fontSize:"0.8rem",border:y?"1px solid #334155":"1px solid #e5e7eb",margin:0,lineHeight:1.6}},{children:String(o).replace(/\n$/,"")}))]})):t(a,{})},details:function(o){o.node;var r=e(o,["node"]);return t("details",n({},r,{style:{borderRadius:8,border:y?"1px solid #334155":"1px solid #e9e5f5",backgroundColor:"transparent",margin:"8px 0",overflow:"hidden"}},{children:r.children}))},summary:z,p:function(o){o.node;var r=e(o,["node"]);return t("p",n({style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"block",maxWidth:"100%",fontSize:W,lineHeight:1.7,margin:"4px 0",color:R}},{children:null==r?void 0:r.children}))},strong:function(o){o.node;var r=e(o,["node"]);return t("strong",n({style:{fontWeight:650,color:E}},{children:null==r?void 0:r.children}))},h1:function(o){o.node;var r=e(o,["node"]);return t("h1",n({style:{fontSize:"1.35rem",fontWeight:700,color:E,margin:"20px 0 8px",lineHeight:1.3,letterSpacing:"-0.01em"}},{children:r.children}))},h2:function(o){o.node;var r=e(o,["node"]);return t("h2",n({style:{fontSize:"1.15rem",fontWeight:650,color:E,margin:"16px 0 6px",lineHeight:1.35}},{children:r.children}))},h3:function(o){o.node;var r=e(o,["node"]);return t("h3",n({style:{fontSize:"1rem",fontWeight:600,color:E,margin:"14px 0 4px",lineHeight:1.4}},{children:r.children}))},h4:function(o){o.node;var r=e(o,["node"]);return t("h4",n({style:{fontSize:"0.92rem",fontWeight:600,color:R,margin:"12px 0 4px",lineHeight:1.4}},{children:r.children}))},ol:function(o){o.node;var r=e(o,["node"]);return t("ol",n({style:{listStyleType:"decimal",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==r?void 0:r.children}))},ul:function(o){o.node;var r=e(o,["node"]);return t("ul",n({style:{listStyleType:"disc",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==r?void 0:r.children}))},li:function(o){o.node;var r=e(o,["node"]);return t("li",n({style:{fontSize:W,lineHeight:1.7,color:R,paddingLeft:4}},{children:r.children}))},blockquote:function(o){o.node;var r=e(o,["node"]);return t("blockquote",n({style:{margin:"12px 0",padding:"8px 16px",borderLeft:"3px solid #8b5cf6",background:y?"#1e1b4b":"#faf5ff",borderRadius:"0 6px 6px 0",color:y?"#cbd5e1":"#4b5563",fontStyle:"italic",fontSize:W,lineHeight:1.65}},{children:r.children}))},hr:function(){return t("hr",{style:{border:"none",height:1,background:y?"linear-gradient(to right, transparent, #334155, transparent)":"linear-gradient(to right, transparent, #d1d5db, transparent)",margin:"16px 0"}})},table:function(o){o.node;var r=e(o,["node"]);return t("div",n({style:{overflowX:"auto",margin:"12px 0",borderRadius:8,border:y?"1px solid #334155":"1px solid #e5e7eb"}},{children:t("table",n({style:{width:"100%",borderCollapse:"collapse",fontSize:"0.8rem",lineHeight:1.5}},{children:r.children}))}))},thead:function(o){o.node;var r=e(o,["node"]);return t("thead",n({style:{background:y?"#1e293b":"#f9fafb",borderBottom:y?"2px solid #334155":"2px solid #e5e7eb"}},{children:r.children}))},th:function(o){o.node;var r=e(o,["node"]);return t("th",n({style:{padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:"0.76rem",color:y?"#cbd5e1":"#374151",whiteSpace:"nowrap"}},{children:r.children}))},td:function(o){o.node;var r=e(o,["node"]);return t("td",n({style:{padding:"8px 12px",borderTop:y?"1px solid #334155":"1px solid #f3f4f6",color:y?"#94a3b8":"#4b5563",fontSize:"0.8rem"}},{children:r.children}))},a:function(o){var r=o.children;o.node;var l=e(o,["children","node"]),d=l["data-cognitive-reasoning"];if(d&&(null==p?void 0:p[d]))return i(a,{children:[i("span",n({onClick:function(e){e.stopPropagation();var n=function(e){var n,o,r,i,t;if(!e)return null;var a=[];return(null!==(o=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==o?o:[]).forEach(function(e){var n,o,r,i,t,l,d,c,s,p,u=null!==(o=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==o?o:[],f=null!==(i=null===(r=e.customMetadata)||void 0===r?void 0:r.training_data_title)&&void 0!==i?i:[],h=null!==(l=null===(t=e.customMetadata)||void 0===t?void 0:t.paraphrase)&&void 0!==l?l:[],g=null===(d=u[0])||void 0===d?void 0:d.match(/<highlight>([\s\S]*?)<\/highlight>/),m=g?g[1].trim():null!==(c=u[0])&&void 0!==c?c:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(s=f[0])&&void 0!==s?s:"",paraphrase:null!==(p=h[0])&&void 0!==p?p:"",highlight:m})}),{block_cognitive_reasoning_html:null!==(r=e.Reasoning)&&void 0!==r?r:"",block_cognitive_gap_html:null!==(i=e.Gap)&&void 0!==i?i:"",block_cognitive_confidence:Number(null!==(t=e.Confidence_score)&&void 0!==t?t:0),block_cognitive_citations:a}}(p[d]);L(function(e){return e.open&&e.activeKey===d?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:d}})},style:{color:y?"#a78bfa":"#6932E2",fontWeight:500,cursor:"pointer",transition:"all 0.2s",padding:"0 2px",position:"relative",display:"flex",alignItems:"center",gap:6,width:"fit-content"}},{children:[r||"",t("span",n({style:{cursor:"pointer",padding:"4px 2px",display:"flex",alignItems:"center",gap:2,border:y?"1px solid #334155":"1px solid #e2e8f0",borderRadius:"5px",width:"fit-content"}},{children:t(S,{sx:{fontSize:"1rem",color:y?"#94a3b8":"#475569",transition:"transform 0.2s"}})}))]})),K.open&&K.activeKey===d&&K.data&&t(h,n({component:"div",onClick:function(e){return e.stopPropagation()},sx:{display:"block",width:"fit-content",maxWidth:"100%",mt:1,mb:1,ml:0}},{children:t(_,{open:!0,onClose:T,data:K.data,styles:x})}))]});var c=!1;try{c=new URL(null==l?void 0:l.href).protocol.startsWith("http")}catch(e){c=!1}return c?t("a",n({href:null==l?void 0:l.href,style:{color:y?"#a78bfa":"#6932E2",textDecoration:"none",fontWeight:500,borderBottom:y?"1px solid #7c3aed":"1px solid #c4b5fd",transition:"border-color 0.2s, color 0.2s"},target:"_blank",rel:"noopener noreferrer",onMouseEnter:function(e){e.currentTarget.style.borderBottomColor=y?"#a78bfa":"#6932E2"},onMouseLeave:function(e){e.currentTarget.style.borderBottomColor=y?"#7c3aed":"#c4b5fd"}},{children:r})):t("span",{children:r})},sup:function(o){o.node;var r=e(o,["node"]);return t(g,n({title:r.children,placement:"top",arrow:!0},{children:t(h,n({component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:16,borderRadius:"50%",background:y?"#3730a3":"#ede9fe",color:y?"#c084fc":"#7c3aed",fontSize:"0.6rem",fontWeight:700,verticalAlign:"super",cursor:"pointer",userSelect:"none",lineHeight:1,transition:"all 0.2s","&:hover":{background:y?"#6d28d9":"#7c3aed",color:"#fff"}},"aria-label":"Info",role:"button"},{children:"i"}))}))},code:function(e){var o=e.children;return t("code",n({style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.82em",color:y?"#e9d5ff":"#9333ea",background:y?"#2e1065":"#faf5ff",padding:"1.5px 5px",borderRadius:4,border:y?"1px solid #581c87":"1px solid #f3e8ff",fontWeight:500}},{children:o}))},pre:function(e){var o=e.children,r=function(e){var n;return"string"==typeof e?e:(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?(Array.isArray(e.props.children)?e.props.children:[e.props.children]).map(r).join(""):""},a=l.Children.toArray(o).map(r).join("");return i("div",n({style:{position:"relative",margin:"12px 0"}},{children:[t(M,{text:a}),t("pre",n({style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.8rem",lineHeight:1.6,color:R,background:y?"#0f172a":"#f9fafb",border:y?"1px solid #334155":"1px solid #e5e7eb",borderRadius:8,padding:"14px 16px",margin:0,overflowX:"auto",whiteSpace:"pre"}},{children:o}))]}))},img:function(o){o.node;var r=e(o,["node"]);return t("img",n({},r,{style:{maxWidth:"100%",height:"auto",borderRadius:8,margin:"8px 0",border:y?"1px solid #334155":"1px solid #e5e7eb"},loading:"lazy"}))}}},[r,W,p,K.activeKey,K.open,x,F,y,R,E]);return t(h,n({className:"pg-markdown-renderer",style:k,sx:n(n({fontSize:W,lineHeight:1.7,color:R,wordBreak:"break-word",position:"relative"},C),{"& span[style*='color'], & font[color]":y?{color:"#60a5fa !important"}:{},"& a":{color:y?"#a78bfa !important":"#6932E2 !important"},"& strong":{color:y?"#f8fafc !important":"#111827 !important"},"& h1, & h2, & h3, & h4, & h5, & h6":{color:y?"#f1f5f9 !important":"#111827 !important"}})},{children:t(u,n({components:I,rehypePlugins:[f],className:"react-markdown-renderer-with-overrides"},{children:w(B)}))}))};export{C as MarkdownRenderer,C as default};
2
2
  //# sourceMappingURL=Markdownrenderer.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as i,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as o,useEffect as r,useRef as l}from"react";import{Box as d,Typography as c,Skeleton as a,Accordion as s,AccordionSummary as h,AccordionDetails as p,Tooltip as f,IconButton as x,Switch as u,Dialog as m,Chip as g}from"@mui/material";import v from"@mui/icons-material/ExpandMore";import b from"@mui/icons-material/Fullscreen";import y from"@mui/icons-material/Close";import S from"@mui/icons-material/NearMeOutlined";import w from"@mui/icons-material/ChevronLeft";import z from"@mui/icons-material/ChevronRight";import E from"./DependencyGraph.js";import{MarkdownRenderer as D}from"./Markdownrenderer.js";import{InternalEditor as k}from"./Internaleditor.js";var B=function(n){var r=n.text,l=n.detailedSummary,a=n.extraMetaData,s=n.isDarkMode,h=void 0!==s&&s,p=n.markdownRendererStyle,f=o(!1),x=f[0],u=f[1],m=function(e,i){void 0===i&&(i=220);var t=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(t.length<=i)return{preview:t,truncated:!1};var n=t.slice(0,i),o=n.lastIndexOf(" ");return{preview:(o>0?n.slice(0,o):n).trim(),truncated:!0}}(r),g=m.preview,v=m.truncated;return t(d,{children:i(d,x?{children:[t(D,{message:r,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,style:p}),(null==l?void 0:l.trim())&&t(D,{message:l,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,style:p}),t(c,e({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}:e({sx:{display:"flex",flexDirection:"column"}},{children:[i(c,e({sx:{fontSize:"0.8rem",color:h?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[g,v&&"…"]})),(v||(null==l?void 0:l.trim()))&&t(d,e({sx:{display:"flex",justifyContent:"flex-end"}},{children:t(c,e({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},M=function(n){var a=n.text,s=n.extraMetaData,h=o(!1),p=h[0],f=h[1],x=o(!1),u=x[0],m=x[1],g=l(null);return r(function(){var e=g.current;e&&m(e.scrollWidth>e.clientWidth)},[a]),t(d,e({sx:{pl:1}},{children:i(d,p?e({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[t(D,{message:a,fontSize:"0.68rem",extraMetaData:s}),t(c,e({component:"span",onClick:function(){return f(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]}):e({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[t(c,e({ref:g,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:a})),u&&t(c,e({component:"span",onClick:function(){return f(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))},C=function(C){var R,A=C.promptContent,F=C.promptTitle,W=C.isLoading,I=void 0!==W&&W,H=C.overviewSummary,P=C.functionalityOfSPB,T=void 0===P?[]:P,_=C.spbAdditionalInfo,L=C.extraMetaData,j=C.showCodePanel,O=void 0===j||j,G=C.showInlineApbEditor,N=void 0===G||G,X=C.showCollapseStrip,Y=void 0===X||X,q=C.showFullscreenButton,J=void 0===q||q,K=C.showFullscreenModal,Q=void 0===K||K,U=C.showThemeToggle,V=void 0===U||U,Z=C.isDarkMode,$=void 0===Z||Z,ee=C.styles,ie=C.className,te=C.style,ne=C.sx,oe=o(null),re=oe[0],le=oe[1],de=o(null),ce=de[0],ae=de[1],se=o(""),he=se[0],pe=se[1],fe=void 0!==(null==ee?void 0:ee.isDarkMode)?ee.isDarkMode:$,xe=o(fe),ue=xe[0],me=xe[1],ge=o(null),ve=ge[0],be=ge[1];r(function(){void 0!==(null==ee?void 0:ee.isDarkMode)&&me(ee.isDarkMode)},[null==ee?void 0:ee.isDarkMode]);var ye=o(!1),Se=ye[0],we=ye[1],ze=o(480),Ee=ze[0],De=ze[1],ke=l(!1),Be=l(null);r(function(){var e,i,t;T.length>0&&le((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),t=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(t||"")))},[T]),r(function(){I&&le(null)},[I]),r(function(){ve&&(pe(""),setTimeout(function(){return pe(ve.ref)},500))},[ve]);return i(d,e({className:ie,style:e(e({},null==ee?void 0:ee.root),te),sx:e({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},ne)},{children:[t(d,e({sx:e({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==ee?void 0:ee.header)},{children:i(d,e({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[t(c,e({sx:e({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==ee?void 0:ee.headerTitle)},{children:F||"SPB Analysis"})),t(c,e({sx:e({fontSize:"0.7rem",color:"#9CA3AF"},null==ee?void 0:ee.headerSubtitle)},{children:re?"Last Analyzed at ".concat(re):""}))]}))})),i(d,e({ref:Be,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[t(d,e({sx:e({width:O?Se&&Y?0:Ee:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:ke.current?"none":"width 0.15s",borderRight:!O||Se&&Y?"none":"1px solid #e5e7eb"},null==ee?void 0:ee.leftPanel)},{children:i(d,e({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i(d,e({sx:e({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==ee?void 0:ee.overviewSection)},{children:[t(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==ee?void 0:ee.overviewTitle)},{children:"Overview"})),t(d,e({sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==ee?void 0:ee.overviewContent)},{children:(null===(R=null==H?void 0:H.overallSummary)||void 0===R?void 0:R.trim())?t(B,{text:H.overallSummary,detailedSummary:H.detailedSummary,extraMetaData:L,isDarkMode:ue,markdownRendererStyle:null==ee?void 0:ee.markdownRenderer}):i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[t(a,{variant:"text",width:"100%",height:14}),t(a,{variant:"text",width:"90%",height:14}),t(a,{variant:"text",width:"95%",height:14})]}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==ee?void 0:ee.functionalitySection)},{children:[t(h,e({expandIcon:t(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:t(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ee?void 0:ee.functionalityTitle)},{children:"Functionality of SPB"}))})),t(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:T.length>0?T.map(function(n,o){return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:0===o,sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==ee?void 0:ee.functionalityItem)},{children:[t(h,e({expandIcon:t(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[o+1,". ",n.name||n.section_name]}))})),i(p,e({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[t(D,{fontSize:"0.74rem",message:n.description||n.reason_for_inclusion||"",extraMetaData:L}),t(c,e({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),t(d,e({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:n.apb_references.map(function(n,o){var r="string"==typeof n?n:n.apb_name,l=ce===r;return i(d,e({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i(d,e({onClick:function(){return function(e){ce===e?(ae(null),pe("")):(ae(e),pe(""),setTimeout(function(){return pe(e)},50))}(r)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:"pointer"}},{children:[i(c,e({sx:{fontSize:"0.78rem",color:l?"#5928ed":"#DB2877",fontWeight:500}},{children:[o+1,". ",r]})),t(S,{sx:{fontSize:"0.75rem",color:l?"#5928ed":"#DB2877"}})]})),"string"!=typeof n&&(n.description||n.context)&&t(M,{text:n.description||n.context||"",extraMetaData:L}),N&&l&&t(d,e({sx:{mt:1,height:260,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:t(k,{content:A,selectedTag:he,isDarkMode:ue,height:"100%",fontSize:12})}))]}),o)})}))]}))]}),o)}):t(d,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(n){return i(d,e({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[t(a,{variant:"text",width:"40%",height:16}),t(a,{variant:"text",width:"90%",height:14}),t(a,{variant:"text",width:"80%",height:14}),t(a,{variant:"text",width:"30%",height:14})]}),n)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==ee?void 0:ee.applicabilitySection)},{children:[i(h,e({expandIcon:t(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[t(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ee?void 0:ee.applicabilityTitle)},{children:"Applicability"})),t(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),t(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:t(d,e({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==_?void 0:_.when_to_apply},{label:"When NOT to apply",content:null==_?void 0:_.when_not_to_apply}].map(function(n){var o=n.label,r=n.content;return i(d,e({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[t(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:o})),r?t(D,{fontSize:"0.8rem",message:r,isDarkMode:ue,style:null==ee?void 0:ee.markdownRenderer,extraMetaData:L}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[t(a,{variant:"text",width:"100%",height:14}),t(a,{variant:"text",width:"80%",height:14}),t(a,{variant:"text",width:"90%",height:14})]})):t(c,e({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),o)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==ee?void 0:ee.specificationsSection)},{children:[i(h,e({expandIcon:t(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[t(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ee?void 0:ee.specificationsTitle)},{children:"Specifications"})),t(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),t(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==_?void 0:_.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==_?void 0:_.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==_?void 0:_.output_analysis}].map(function(o){var r=o.label,l=o.tooltip,u=o.content,m="Output"===r,g=m&&u?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,t){return i.push(t.trim()),""}).trim(),code:i.join("\n\n")}}(u):null,b=g?g.text:u,y=g?g.code:"";return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===r,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[t(h,e({expandIcon:t(v,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i(d,e({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[t(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:r})),l&&t(f,e({title:l,placement:"top"},{children:t(d,e({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),t(p,e({sx:{px:1.25,pb:1.25,pt:0}},{children:u?i(n,{children:[b&&t(D,{fontSize:"0.8rem",message:b,isDarkMode:ue,style:null==ee?void 0:ee.markdownRenderer,extraMetaData:L}),m&&y&&i(d,e({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i(d,e({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[t(c,e({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),t(f,e({title:"Copy Code to clipboard"},{children:t(x,e({size:"small",onClick:function(){return e=y,navigator.clipboard.writeText(e);var e}},{children:t(c,e({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),t(d,e({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:t(k,{content:y,isDarkMode:ue,height:"100%",fontSize:10})}))]}))]}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[t(a,{variant:"text",width:"100%",height:14}),t(a,{variant:"text",width:"90%",height:14}),t(a,{variant:"text",width:"75%",height:14})]})):t(c,e({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),r)})}))]})),i(s,e({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==ee?void 0:ee.dependencyGraphSection)},{children:[t(h,e({expandIcon:t(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:t(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ee?void 0:ee.dependencyGraphTitle)},{children:"Dependency Graph"}))})),t(p,e({sx:{px:0,pb:0,pt:0}},{children:(null==_?void 0:_.dependency_graph)?i(d,e({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[t(d,e({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:t(E,{data:_.dependency_graph,isDarkMode:ue,style:null==ee?void 0:ee.dependencyGraph})})),t(c,e({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i(d,e({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[t(a,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),t(a,{variant:"text",width:"100%",height:14}),t(a,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),O&&Y&&t(d,e({onClick:function(){return we(function(e){return!e})},sx:e({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==ee?void 0:ee.collapseStrip)},{children:t(c,e({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),O&&Y&&t(d,e({onClick:function(){return we(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),ke.current=!0;var i=function(e){if(ke.current&&Be.current){var n=Be.current.getBoundingClientRect(),o=n.left,r=n.width,l=e.clientX-o;if(l<200)return we(!0),ke.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",t);l>.7*r||(we(!1),De(l))}},t=function(){ke.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",t)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",t)},sx:e({position:"absolute",left:Se?20:Ee+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==ee?void 0:ee.dragHandle)},{children:t(Se?z:w,{sx:{fontSize:12,color:"#6b7280"}})})),O&&i(d,e({sx:e({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==ee?void 0:ee.codePanel)},{children:[i(d,e({sx:e({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==ee?void 0:ee.codePanelHeader)},{children:[t(c,e({sx:e({fontSize:13,fontWeight:600,color:"#374151"},null==ee?void 0:ee.codePanelTitle)},{children:F||"SPB Analysis"})),i(d,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[V&&t(u,{checked:ue,onChange:function(e){return me(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),J&&Q&&t(f,e({title:"Fullscreen",placement:"top"},{children:t(x,e({size:"small",onClick:function(){return be({ref:he||"",description:""})},sx:{color:"#6b7280"}},{children:t(b,{sx:{fontSize:16}})}))}))]}))]})),t(d,e({sx:e({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==ee?void 0:ee.editorContainer)},{children:t(k,{content:A,selectedTag:he,isDarkMode:ue,height:"100%",fontSize:13})}))]}))]})),Q&&i(m,e({open:!!ve,onClose:function(){return be(null)},maxWidth:!1,PaperProps:{sx:e({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==ee?void 0:ee.fullscreenModal)}},{children:[i(d,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[t(c,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),t(x,e({size:"small",onClick:function(){return be(null)}},{children:t(y,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i(d,e({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i(d,e({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[t(f,e({title:"Atomic Prompt Block",placement:"top"},{children:t(g,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),t(c,e({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==ve?void 0:ve.ref}))]})),i(d,e({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[t(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),t(c,e({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==ve?void 0:ve.description}))]})),i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[t(c,e({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),t(c,e({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:A.split("\n").length}))]}))]}))]})),i(d,e({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t(c,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),t(u,{checked:ue,onChange:function(e){return me(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),t(d,e({sx:{flex:1,minHeight:0,p:1.5}},{children:t(k,{content:A,selectedTag:he,isDarkMode:ue,height:"100%",fontSize:13})}))]}))]}))]}))]}))};export{C as default};
1
+ import{__assign as e}from"tslib";import{jsxs as i,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as r,useRef as l}from"react";import{Box as d,Typography as c,Skeleton as a,Accordion as s,AccordionSummary as h,AccordionDetails as p,Tooltip as f,IconButton as u,Switch as x,Dialog as m,Chip as g}from"@mui/material";import v from"@mui/icons-material/ExpandMore";import b from"@mui/icons-material/Fullscreen";import y from"@mui/icons-material/Close";import S from"@mui/icons-material/NearMeOutlined";import w from"@mui/icons-material/ChevronLeft";import D from"@mui/icons-material/ChevronRight";import z from"./DependencyGraph.js";import{MarkdownRenderer as E}from"./Markdownrenderer.js";import{InternalEditor as k}from"./Internaleditor.js";var B=function(t){var r=t.text,l=t.detailedSummary,a=t.extraMetaData,s=t.isDarkMode,h=void 0!==s&&s,p=t.markdownRendererStyle,f=t.cognitiveDecisioningStyles,u=o(!1),x=u[0],m=u[1],g=function(e,i){void 0===i&&(i=220);var n=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(n.length<=i)return{preview:n,truncated:!1};var t=n.slice(0,i),o=t.lastIndexOf(" ");return{preview:(o>0?t.slice(0,o):t).trim(),truncated:!0}}(r),v=g.preview,b=g.truncated;return n(d,{children:i(d,x?{children:[n(E,{message:r,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,cognitiveDecisioningStyles:f,style:p}),(null==l?void 0:l.trim())&&n(E,{message:l,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,cognitiveDecisioningStyles:f,style:p}),n(c,e({component:"span",onClick:function(){return m(!1)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}:e({sx:{display:"flex",flexDirection:"column"}},{children:[i(c,e({sx:{fontSize:"0.8rem",color:h?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[v,b&&"…"]})),(b||(null==l?void 0:l.trim()))&&n(d,e({sx:{display:"flex",justifyContent:"flex-end"}},{children:n(c,e({component:"span",onClick:function(){return m(!0)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},M=function(t){var a=t.text,s=t.extraMetaData,h=t.cognitiveDecisioningStyles,p=o(!1),f=p[0],u=p[1],x=o(!1),m=x[0],g=x[1],v=l(null);return r(function(){var e=v.current;e&&g(e.scrollWidth>e.clientWidth)},[a]),n(d,e({sx:{pl:1}},{children:i(d,f?e({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[n(E,{message:a,fontSize:"0.68rem",extraMetaData:s,cognitiveDecisioningStyles:h}),n(c,e({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]}):e({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[n(c,e({ref:v,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:a})),m&&n(c,e({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))},C=function(C){var R,A=C.promptContent,F=C.promptTitle,W=C.isLoading,I=void 0!==W&&W,H=C.overviewSummary,P=C.functionalityOfSPB,T=void 0===P?[]:P,_=C.spbAdditionalInfo,L=C.extraMetaData,j=C.showCodePanel,O=void 0===j||j,G=C.showInlineApbEditor,N=void 0===G||G,X=C.disableApbNavigation,Y=void 0!==X&&X,q=C.showCollapseStrip,J=void 0===q||q,K=C.showFullscreenButton,Q=void 0===K||K,U=C.showFullscreenModal,V=void 0===U||U,Z=C.showThemeToggle,$=void 0===Z||Z,ee=C.isDarkMode,ie=void 0===ee||ee,ne=C.styles,te=C.className,oe=C.style,re=C.sx,le=o(null),de=le[0],ce=le[1],ae=o(null),se=ae[0],he=ae[1],pe=o(""),fe=pe[0],ue=pe[1],xe=void 0!==(null==ne?void 0:ne.isDarkMode)?ne.isDarkMode:ie,me=o(xe),ge=me[0],ve=me[1],be=o(null),ye=be[0],Se=be[1];r(function(){void 0!==(null==ne?void 0:ne.isDarkMode)&&ve(ne.isDarkMode)},[null==ne?void 0:ne.isDarkMode]);var we=o(!1),De=we[0],ze=we[1],Ee=o(480),ke=Ee[0],Be=Ee[1],Me=l(!1),Ce=l(null);r(function(){var e,i,n;T.length>0&&ce((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),n=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(n||"")))},[T]),r(function(){I&&ce(null)},[I]),r(function(){ye&&(ue(""),setTimeout(function(){return ue(ye.ref)},500))},[ye]);return i(d,e({className:te,style:e(e({},null==ne?void 0:ne.root),oe),sx:e({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},re)},{children:[n(d,e({sx:e({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==ne?void 0:ne.header)},{children:i(d,e({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[n(c,e({sx:e({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==ne?void 0:ne.headerTitle)},{children:F||"SPB Analysis"})),n(c,e({sx:e({fontSize:"0.7rem",color:"#9CA3AF"},null==ne?void 0:ne.headerSubtitle)},{children:de?"Last Analyzed at ".concat(de):""}))]}))})),i(d,e({ref:Ce,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[n(d,e({sx:e({width:O?De&&J?0:ke:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:Me.current?"none":"width 0.15s",borderRight:!O||De&&J?"none":"1px solid #e5e7eb"},null==ne?void 0:ne.leftPanel)},{children:i(d,e({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i(d,e({sx:e({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==ne?void 0:ne.overviewSection)},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==ne?void 0:ne.overviewTitle)},{children:"Overview"})),n(d,e({sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==ne?void 0:ne.overviewContent)},{children:(null===(R=null==H?void 0:H.overallSummary)||void 0===R?void 0:R.trim())?n(B,{text:H.overallSummary,detailedSummary:H.detailedSummary,extraMetaData:L,isDarkMode:ge,markdownRendererStyle:null==ne?void 0:ne.markdownRenderer,cognitiveDecisioningStyles:null==ne?void 0:ne.cognitiveDecisioning}):i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"95%",height:14})]}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==ne?void 0:ne.functionalitySection)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ne?void 0:ne.functionalityTitle)},{children:"Functionality of SPB"}))})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:T.length>0?T.map(function(t,o){return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:0===o,sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==ne?void 0:ne.functionalityItem)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[o+1,". ",t.name||t.section_name]}))})),i(p,e({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[n(E,{fontSize:"0.74rem",message:t.description||t.reason_for_inclusion||"",extraMetaData:L,cognitiveDecisioningStyles:null==ne?void 0:ne.cognitiveDecisioning}),n(c,e({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),n(d,e({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:t.apb_references.map(function(t,o){var r="string"==typeof t?t:t.apb_name,l=se===r;return i(d,e({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i(d,e({onClick:Y?void 0:function(){return function(e){se===e?(he(null),ue("")):(he(e),ue(""),setTimeout(function(){return ue(e)},50))}(r)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:Y?"default":"pointer"}},{children:[i(c,e({sx:{fontSize:"0.78rem",color:l?"#5928ed":"#DB2877",fontWeight:500}},{children:[o+1,". ",r]})),!Y&&n(S,{sx:{fontSize:"0.75rem",color:l?"#5928ed":"#DB2877"}})]})),"string"!=typeof t&&(t.description||t.context)&&n(M,{text:t.description||t.context||"",extraMetaData:L,cognitiveDecisioningStyles:null==ne?void 0:ne.cognitiveDecisioning}),N&&l&&n(d,e({sx:{mt:1,height:260,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:n(k,{content:A,selectedTag:fe,isDarkMode:ge,height:"100%",fontSize:12})}))]}),o)})}))]}))]}),o)}):n(d,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(t){return i(d,e({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"40%",height:16}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"80%",height:14}),n(a,{variant:"text",width:"30%",height:14})]}),t)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==ne?void 0:ne.applicabilitySection)},{children:[i(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ne?void 0:ne.applicabilityTitle)},{children:"Applicability"})),n(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:n(d,e({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==_?void 0:_.when_to_apply},{label:"When NOT to apply",content:null==_?void 0:_.when_not_to_apply}].map(function(t){var o=t.label,r=t.content;return i(d,e({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:o})),r?n(E,{fontSize:"0.8rem",message:r,isDarkMode:ge,style:null==ne?void 0:ne.markdownRenderer,extraMetaData:L,cognitiveDecisioningStyles:null==ne?void 0:ne.cognitiveDecisioning}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"80%",height:14}),n(a,{variant:"text",width:"90%",height:14})]})):n(c,e({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),o)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==ne?void 0:ne.specificationsSection)},{children:[i(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ne?void 0:ne.specificationsTitle)},{children:"Specifications"})),n(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==_?void 0:_.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==_?void 0:_.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==_?void 0:_.output_analysis}].map(function(o){var r=o.label,l=o.tooltip,x=o.content,m="Output"===r,g=m&&x?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,n){return i.push(n.trim()),""}).trim(),code:i.join("\n\n")}}(x):null,b=g?g.text:x,y=g?g.code:"";return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===r,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i(d,e({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:r})),l&&n(f,e({title:l,placement:"top"},{children:n(d,e({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),n(p,e({sx:{px:1.25,pb:1.25,pt:0}},{children:x?i(t,{children:[b&&n(E,{fontSize:"0.8rem",message:b,isDarkMode:ge,style:null==ne?void 0:ne.markdownRenderer,extraMetaData:L,cognitiveDecisioningStyles:null==ne?void 0:ne.cognitiveDecisioning}),m&&y&&i(d,e({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i(d,e({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[n(c,e({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),n(f,e({title:"Copy Code to clipboard"},{children:n(u,e({size:"small",onClick:function(){return e=y,navigator.clipboard.writeText(e);var e}},{children:n(c,e({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),n(d,e({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:n(k,{content:y,isDarkMode:ge,height:"100%",fontSize:10})}))]}))]}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"75%",height:14})]})):n(c,e({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),r)})}))]})),i(s,e({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==ne?void 0:ne.dependencyGraphSection)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ne?void 0:ne.dependencyGraphTitle)},{children:"Dependency Graph"}))})),n(p,e({sx:{px:0,pb:0,pt:0}},{children:(null==_?void 0:_.dependency_graph)?i(d,e({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[n(d,e({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:n(z,{data:_.dependency_graph,isDarkMode:ge,style:null==ne?void 0:ne.dependencyGraph})})),n(c,e({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i(d,e({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[n(a,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),O&&J&&n(d,e({onClick:function(){return ze(function(e){return!e})},sx:e({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==ne?void 0:ne.collapseStrip)},{children:n(c,e({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),O&&J&&n(d,e({onClick:function(){return ze(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),Me.current=!0;var i=function(e){if(Me.current&&Ce.current){var t=Ce.current.getBoundingClientRect(),o=t.left,r=t.width,l=e.clientX-o;if(l<200)return ze(!0),Me.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",n);l>.7*r||(ze(!1),Be(l))}},n=function(){Me.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)},sx:e({position:"absolute",left:De?20:ke+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==ne?void 0:ne.dragHandle)},{children:n(De?D:w,{sx:{fontSize:12,color:"#6b7280"}})})),O&&i(d,e({sx:e({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==ne?void 0:ne.codePanel)},{children:[i(d,e({sx:e({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==ne?void 0:ne.codePanelHeader)},{children:[n(c,e({sx:e({fontSize:13,fontWeight:600,color:"#374151"},null==ne?void 0:ne.codePanelTitle)},{children:F||"SPB Analysis"})),i(d,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[$&&n(x,{checked:ge,onChange:function(e){return ve(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),Q&&V&&n(f,e({title:"Fullscreen",placement:"top"},{children:n(u,e({size:"small",onClick:function(){return Se({ref:fe||"",description:""})},sx:{color:"#6b7280"}},{children:n(b,{sx:{fontSize:16}})}))}))]}))]})),n(d,e({sx:e({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==ne?void 0:ne.editorContainer)},{children:n(k,{content:A,selectedTag:fe,isDarkMode:ge,height:"100%",fontSize:13})}))]}))]})),V&&i(m,e({open:!!ye,onClose:function(){return Se(null)},maxWidth:!1,PaperProps:{sx:e({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==ne?void 0:ne.fullscreenModal)}},{children:[i(d,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[n(c,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),n(u,e({size:"small",onClick:function(){return Se(null)}},{children:n(y,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i(d,e({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i(d,e({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[n(f,e({title:"Atomic Prompt Block",placement:"top"},{children:n(g,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),n(c,e({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==ye?void 0:ye.ref}))]})),i(d,e({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),n(c,e({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==ye?void 0:ye.description}))]})),i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[n(c,e({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),n(c,e({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:A.split("\n").length}))]}))]}))]})),i(d,e({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),n(x,{checked:ge,onChange:function(e){return ve(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),n(d,e({sx:{flex:1,minHeight:0,p:1.5}},{children:n(k,{content:A,selectedTag:fe,isDarkMode:ge,height:"100%",fontSize:13})}))]}))]}))]}))]}))};export{C as default};
2
2
  //# sourceMappingURL=Spbanalysispanel.js.map
@@ -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"}
@@ -1,3 +1,4 @@
1
+ import { type CSSProperties } from "react";
1
2
  export type BlockCognitiveCitation = {
2
3
  citation_number: number;
3
4
  title?: string;
@@ -5,6 +6,8 @@ export type BlockCognitiveCitation = {
5
6
  content?: string;
6
7
  paraphrase?: string;
7
8
  highlight: string | string[];
9
+ data_sources?: string[];
10
+ training_data_title?: string;
8
11
  };
9
12
  export type CognitiveReasoningData = {
10
13
  block_cognitive_reasoning_html: string;
@@ -12,11 +15,38 @@ export type CognitiveReasoningData = {
12
15
  block_cognitive_confidence: number;
13
16
  block_cognitive_citations: BlockCognitiveCitation[];
14
17
  };
18
+ export interface CognitiveReasoningPanelStyles {
19
+ container?: CSSProperties | any;
20
+ header?: CSSProperties | any;
21
+ headerIcon?: CSSProperties | any;
22
+ headerTitleText?: CSSProperties | any;
23
+ badge?: CSSProperties | any;
24
+ closeButton?: CSSProperties | any;
25
+ body?: CSSProperties | any;
26
+ accordion?: CSSProperties | any;
27
+ accordionSummary?: CSSProperties | any;
28
+ accordionDetails?: CSSProperties | any;
29
+ sectionIcon?: CSSProperties | any;
30
+ sectionTitle?: CSSProperties | any;
31
+ sectionSubtitle?: CSSProperties | any;
32
+ sectionItem?: CSSProperties | any;
33
+ indexText?: CSSProperties | any;
34
+ textContent?: CSSProperties | any;
35
+ citationLink?: CSSProperties | any;
36
+ citationContainer?: CSSProperties | any;
37
+ citationModalContainer?: CSSProperties | any;
38
+ citationRootContainer?: CSSProperties | any;
39
+ citationTitle?: CSSProperties | any;
40
+ citationBody?: CSSProperties | any;
41
+ citationDataContainer?: CSSProperties | any;
42
+ citationRuleBookContainer?: CSSProperties | any;
43
+ }
15
44
  export interface CognitiveReasoningPanelProps {
16
45
  open: boolean;
17
46
  onClose: () => void;
18
47
  data: CognitiveReasoningData | null;
48
+ styles?: CognitiveReasoningPanelStyles;
19
49
  }
20
- declare const CognitiveReasoningPanel: ({ open, onClose, data }: CognitiveReasoningPanelProps) => import("react/jsx-runtime").JSX.Element | null;
50
+ declare const CognitiveReasoningPanel: ({ open, onClose, data, styles }: CognitiveReasoningPanelProps) => import("react/jsx-runtime").JSX.Element | null;
21
51
  export default CognitiveReasoningPanel;
22
52
  //# sourceMappingURL=Cognitivereasoningpanel.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"Cognitivereasoningpanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Cognitivereasoningpanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAwB9D,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;IAC7B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,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,6BAA6B;IAC1C,SAAS,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAChC,MAAM,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAC7B,UAAU,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IACjC,eAAe,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IACtC,KAAK,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAC5B,WAAW,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAClC,IAAI,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAC3B,SAAS,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAChC,gBAAgB,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IACvC,gBAAgB,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IACvC,WAAW,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAClC,YAAY,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IACnC,eAAe,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IACtC,WAAW,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAClC,SAAS,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAChC,WAAW,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAClC,YAAY,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IACnC,iBAAiB,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IACxC,sBAAsB,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAC7C,qBAAqB,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAC5C,aAAa,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IACpC,YAAY,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IACnC,qBAAqB,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;IAC5C,yBAAyB,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC;CACnD;AAED,MAAM,WAAW,4BAA4B;IACzC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,6BAA6B,CAAC;CAC1C;AAoBD,QAAA,MAAM,uBAAuB,oCAAqC,4BAA4B,mDAmM7F,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -34,11 +34,36 @@ export interface DependencyGraphProps {
34
34
  style?: React.CSSProperties | any;
35
35
  sx?: any;
36
36
  }
37
+ interface DependencyGraphStyles extends React.CSSProperties {
38
+ fullscreenPaper?: React.CSSProperties;
39
+ root?: React.CSSProperties;
40
+ header?: React.CSSProperties;
41
+ title?: React.CSSProperties;
42
+ subtitle?: React.CSSProperties;
43
+ controls?: React.CSSProperties;
44
+ controlButton?: React.CSSProperties;
45
+ cluster?: React.CSSProperties;
46
+ clusterLabel?: React.CSSProperties;
47
+ node?: React.CSSProperties;
48
+ selectedNode?: React.CSSProperties;
49
+ nodeIcon?: React.CSSProperties;
50
+ edge?: React.CSSProperties;
51
+ activeEdge?: React.CSSProperties;
52
+ edgeMarker?: React.CSSProperties;
53
+ nodePopup?: React.CSSProperties;
54
+ nodePopupHeader?: React.CSSProperties;
55
+ nodePopupBody?: React.CSSProperties;
56
+ popupCloseButton?: React.CSSProperties;
57
+ edgePopup?: React.CSSProperties;
58
+ edgePopupHeader?: React.CSSProperties;
59
+ edgePopupBody?: React.CSSProperties;
60
+ }
37
61
  export interface DependencyGraphInnerProps {
38
62
  data: ApiData;
39
63
  onFullscreen?: () => void;
40
64
  isFullscreen?: boolean;
41
65
  isDarkMode?: boolean;
66
+ style?: DependencyGraphStyles;
42
67
  }
43
68
  declare function DependencyGraph({ data, isDarkMode, style }: DependencyGraphProps): React.ReactElement;
44
69
  declare const _default: React.MemoExoticComponent<typeof DependencyGraph>;
@@ -1 +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,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAClC,EAAE,CAAC,EAAE,GAAG,CAAC;CACV;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAosBD,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,UAAkB,EAAE,KAAK,EAAE,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CAsCtG;;AAED,wBAA2C"}
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,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAClC,EAAE,CAAC,EAAE,GAAG,CAAC;CACV;AAED,UAAU,qBAAsB,SAAQ,KAAK,CAAC,aAAa;IACzD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACvC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACrC;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,qBAAqB,CAAC;CAC/B;AAqtBD,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,UAAkB,EAAE,KAAK,EAAE,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CAqDtG;;AAED,wBAA2C"}
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { type CognitiveReasoningPanelStyles } from "./Cognitivereasoningpanel";
2
3
  export interface MarkdownRendererProps {
3
4
  message: string | undefined;
4
5
  fontSize?: React.CSSProperties["fontSize"];
@@ -6,9 +7,10 @@ export interface MarkdownRendererProps {
6
7
  extraMetaData?: Record<string, any> | null;
7
8
  /** Whether dark mode is active */
8
9
  isDarkMode?: boolean;
10
+ cognitiveDecisioningStyles?: CognitiveReasoningPanelStyles;
9
11
  style?: React.CSSProperties | any;
10
12
  sx?: any;
11
13
  }
12
- export declare const MarkdownRenderer: ({ message, fontSize, extraMetaData, isDarkMode, style, sx }: MarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const MarkdownRenderer: ({ message, fontSize, extraMetaData, isDarkMode, cognitiveDecisioningStyles, style, sx }: MarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
13
15
  export default MarkdownRenderer;
14
16
  //# sourceMappingURL=Markdownrenderer.d.ts.map
@@ -1 +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;IAC3C,kCAAkC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAClC,EAAE,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,gBAAgB,gEAAyE,qBAAqB,4CA0P1H,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"Markdownrenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Markdownrenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAUpE,OAAgC,EAG5B,KAAK,6BAA6B,EACrC,MAAM,2BAA2B,CAAA;AAoLlC,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;IAC3C,kCAAkC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0BAA0B,CAAC,EAAE,6BAA6B,CAAC;IAC3D,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAClC,EAAE,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,gBAAgB,4FAAqG,qBAAqB,4CA0PtJ,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import type { CognitiveReasoningPanelStyles } from "./Cognitivereasoningpanel";
2
3
  export interface SPBApbReference {
3
4
  apb_name: string;
4
5
  description?: string;
@@ -77,6 +78,8 @@ export interface SPBAnalysisPanelStyles {
77
78
  fullscreenModal?: React.CSSProperties | any;
78
79
  /** Markdown renderer custom style overrides */
79
80
  markdownRenderer?: React.CSSProperties | any;
81
+ /** Cognitive decisioning popup style overrides */
82
+ cognitiveDecisioning?: CognitiveReasoningPanelStyles;
80
83
  /** Theme mode flag inside styles object if passed */
81
84
  isDarkMode?: boolean;
82
85
  }
@@ -94,6 +97,8 @@ export interface SPBAnalysisPanelProps {
94
97
  showCodePanel?: boolean;
95
98
  /** Show the inline Monaco editor that expands beneath a clicked APB reference, highlighting that section. Defaults to true. */
96
99
  showInlineApbEditor?: boolean;
100
+ /** When true, APB reference items are display-only: no click handler and no NearMe icon. */
101
+ disableApbNavigation?: boolean;
97
102
  /** Show the vertical collapse strip and drag handle pill. Defaults to true. */
98
103
  showCollapseStrip?: boolean;
99
104
  /** Show the Fullscreen button in the code panel header. Defaults to true. */
@@ -113,6 +118,6 @@ export interface SPBAnalysisPanelProps {
113
118
  /** Optional MUI sx prop overrides for the root container */
114
119
  sx?: any;
115
120
  }
116
- declare const SPBAnalysisPanel: ({ promptContent, promptTitle, isLoading, overviewSummary, functionalityOfSPB, spbAdditionalInfo, extraMetaData, showCodePanel, showInlineApbEditor, showCollapseStrip, showFullscreenButton, showFullscreenModal, showThemeToggle, isDarkMode: isDarkModeProp, styles, className, style, sx, }: SPBAnalysisPanelProps) => import("react/jsx-runtime").JSX.Element;
121
+ declare const SPBAnalysisPanel: ({ promptContent, promptTitle, isLoading, overviewSummary, functionalityOfSPB, spbAdditionalInfo, extraMetaData, showCodePanel, showInlineApbEditor, disableApbNavigation, showCollapseStrip, showFullscreenButton, showFullscreenModal, showThemeToggle, isDarkMode: isDarkModeProp, styles, className, style, sx, }: SPBAnalysisPanelProps) => import("react/jsx-runtime").JSX.Element;
117
122
  export default SPBAnalysisPanel;
118
123
  //# sourceMappingURL=Spbanalysispanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Spbanalysispanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Spbanalysispanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAoB3D,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,sBAAsB;IACnC,qCAAqC;IACrC,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACjC,qCAAqC;IACrC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACnC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACxC,iDAAiD;IACjD,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC3C,2CAA2C;IAC3C,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACtC,+CAA+C;IAC/C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,4CAA4C;IAC5C,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC1C,2CAA2C;IAC3C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,2DAA2D;IAC3D,oBAAoB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACjD,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC/C,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC9C,sDAAsD;IACtD,oBAAoB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACjD,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC/C,uDAAuD;IACvD,qBAAqB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAClD,mDAAmD;IACnD,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAChD,yDAAyD;IACzD,sBAAsB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACnD,6CAA6C;IAC7C,oBAAoB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACjD,iDAAiD;IACjD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,iEAAiE;IACjE,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACtC,4CAA4C;IAC5C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,uCAAuC;IACvC,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC3C,uDAAuD;IACvD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,8CAA8C;IAC9C,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC1C,uCAAuC;IACvC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACvC,6CAA6C;IAC7C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC7C,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;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,gMAAgM;IAChM,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAE3C,0EAA0E;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,+HAA+H;IAC/H,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,gFAAgF;IAChF,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,wHAAwH;IACxH,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAEhC,yGAAyG;IACzG,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,4DAA4D;IAC5D,EAAE,CAAC,EAAE,GAAG,CAAC;CACZ;AA8GD,QAAA,MAAM,gBAAgB,mSAmBnB,qBAAqB,4CAsavB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"Spbanalysispanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Spbanalysispanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAc3D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAO/E,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,sBAAsB;IACnC,qCAAqC;IACrC,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACjC,qCAAqC;IACrC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACnC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACxC,iDAAiD;IACjD,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC3C,2CAA2C;IAC3C,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACtC,+CAA+C;IAC/C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,4CAA4C;IAC5C,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC1C,2CAA2C;IAC3C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,2DAA2D;IAC3D,oBAAoB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACjD,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC/C,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC9C,sDAAsD;IACtD,oBAAoB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACjD,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC/C,uDAAuD;IACvD,qBAAqB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAClD,mDAAmD;IACnD,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAChD,yDAAyD;IACzD,sBAAsB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACnD,6CAA6C;IAC7C,oBAAoB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACjD,iDAAiD;IACjD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,iEAAiE;IACjE,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACtC,4CAA4C;IAC5C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,uCAAuC;IACvC,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC3C,uDAAuD;IACvD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,8CAA8C;IAC9C,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC1C,uCAAuC;IACvC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IACvC,6CAA6C;IAC7C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC5C,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC;IAC7C,kDAAkD;IAClD,oBAAoB,CAAC,EAAE,6BAA6B,CAAC;IACrD,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;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,gMAAgM;IAChM,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAE3C,0EAA0E;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,+HAA+H;IAC/H,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,4FAA4F;IAC5F,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,gFAAgF;IAChF,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,wHAAwH;IACxH,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAEhC,yGAAyG;IACzG,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,4DAA4D;IAC5D,EAAE,CAAC,EAAE,GAAG,CAAC;CACZ;AAgHD,QAAA,MAAM,gBAAgB,yTAoBnB,qBAAqB,4CAuavB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/citation",
3
- "version": "0.0.239",
3
+ "version": "0.0.241",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",
@@ -287,7 +287,6 @@
287
287
  "rollup-plugin-visualizer": "5.12.0",
288
288
  "ts-loader": "9.5.1",
289
289
  "typescript": "4.9.5",
290
- "@tanstack/react-query": "^4.44.0",
291
290
  "wavesurfer.js": "^7.12.1",
292
291
  "webpack-bundle-analyzer": "^4.10.2"
293
292
  },
@@ -301,6 +300,7 @@
301
300
  "@react-pdf-viewer/page-navigation": "^3.12.0",
302
301
  "@react-pdf-viewer/search": "^3.12.0",
303
302
  "@react-pdf-viewer/zoom": "^3.12.0",
303
+ "@tanstack/react-query": ">=4.0.0",
304
304
  "date-fns": "^4.4.0",
305
305
  "dompurify": ">=3.0.0",
306
306
  "highlight.js": "^11.11.1",