1import{b1 as v,eV as u,eS as a,r as b,a0 as I,bh as T,aW as R,cx as k,fC as N}from"./vendor-DBXqAbrB.js";import{eA as A,cQ as L,cR as m,eB as F,aR as P}from"./vendor-labrav-CAmO9yiy.js";import{bc as B,u as E,p as O,mt as M,eN as z,ah as H}from"./index-pX4fafRj.js";import{S as W}from"./salesforce--s0eMWjZ.js";import{u as D}from"./useCanvasContentResize-FQwWy9s_.js";import{F as V,a9 as _}from"./vendor-fontawesome-CPOBI59z.js";import"./vendor-redux-dAzQAaTw.js";import"./vendor-charts-CLdlcQdB.js";const j=v()(e=>({root:{width:"100%",minHeight:560,"& .MuiDrawer-paper":{border:"2px solid rgb(255,112,138)",borderTopLeftRadius:e.spacing(1),borderBottomLeftRadius:e.spacing(1)},'& button[title="Expand"], & button[title="Push back in side"]':{display:"none"}}})),y=v()(e=>({root:{display:"flex",flexDirection:"column",gap:8,width:"100%"},sectionTitle:{fontFamily:"Inter, sans-serif",fontWeight:600,fontSize:14,lineHeight:"20px",letterSpacing:"0.1px",color:e.palette.labraText.description},list:{display:"flex",flexDirection:"column",gap:8,width:"100%"},row:{position:"relative",backgroundColor:e.palette.text.white,border:`1px solid ${e.palette.labraChat.border}`,borderRadius:8,padding:"8px 12px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",transition:"background-color 0.15s ease","&:hover, &:focus-visible":{backgroundColor:e.palette.labraChat.hoverBgAlt,outline:"none"},"&:hover .labra-row-action, &:focus-visible .labra-row-action":{visibility:"visible",opacity:1}},rowAction:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",paddingRight:12,paddingLeft:48,background:`linear-gradient(to right, transparent, ${e.palette.labraChat.hoverBgAlt} 48px)`,visibility:"hidden",opacity:0,transition:"opacity 0.15s ease",pointerEvents:"none"},rowActionBtn:{backgroundColor:e.palette.text.white,border:`1px solid ${e.palette.labraChat.borderStrong}`,borderRadius:4,padding:"2px 8px",display:"flex",alignItems:"center",gap:4,fontFamily:"Inter, sans-serif",fontWeight:500,fontSize:12,lineHeight:"20px",letterSpacing:"-0.15px",color:e.palette.labraChat.darkText,whiteSpace:"nowrap"},rowIconContainer:{width:28,height:28,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},rowIcon:{fontSize:16,color:e.palette.labraText.description},rowText:{flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontSize:14,lineHeight:"20px",fontFamily:"Inter, sans-serif",textAlign:"left",fontWeight:400,color:e.palette.labraText.description,letterSpacing:"0.25px"},loadingRow:{display:"flex",alignItems:"center",justifyContent:"center",padding:"16px 0",color:e.palette.labraText.description},emptyRow:{fontFamily:"Inter, sans-serif",fontWeight:400,fontSize:14,lineHeight:"20px",letterSpacing:"0.25px",color:e.palette.labraText.description,padding:"8px 0"},viewMoreRow:{display:"flex",alignItems:"center",gap:16,alignSelf:"flex-start"},viewMoreLink:{fontFamily:"Inter, sans-serif",fontWeight:500,fontSize:12,lineHeight:"20px",letterSpacing:"0.1px",color:e.palette.icon.blue,background:"none",border:"none",padding:"2px 0",cursor:"pointer",alignSelf:"flex-start"}})),U=({icon:e,text:o,actionLabel:p,onAction:t})=>{const{classes:i,cx:l}=y();return u("div",{className:i.row,role:"button",tabIndex:0,onClick:t,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t())},children:[a("div",{className:i.rowIconContainer,children:a(V,{icon:e,className:i.rowIcon})}),a(A,{text:o,className:i.rowText}),a("div",{className:l(i.rowAction,"labra-row-action"),children:a("span",{className:i.rowActionBtn,children:p})})]})},x=4,w=10,$=({todos:e,loading:o,onSelect:p})=>{const{classes:t}=y(),[i,l]=b.useState(x),n=e.slice(0,i),d=Math.min(w,e.length-i),c=i>x,g=e.length>0,h=o&&!g;return u("div",{className:t.root,children:[a("span",{className:t.sectionTitle,children:"ToDos & Recommendations"}),h?a("div",{className:t.loadingRow,children:a(I,{size:16,thickness:5})}):g?u("div",{className:t.list,children:[n.map(r=>a(U,{icon:_,text:r.text,actionLabel:"View details",onAction:()=>p(r)},r.id)),(d>0||c)&&u("div",{className:t.viewMoreRow,children:[d>
10&&u("button",{className:t.viewMoreLink,type:"button",onClick:()=>l(r=>r+w),children:["View ",d," more out of total ",e.length]}),c&&a("button",{className:t.viewMoreLink,type:"button",onClick:()=>l(x),children:"Show less"})]})]}):a("div",{className:t.emptyRow,children:"You're all caught up â nothing needs action."})]})},ee=()=>{const{classes:e}=j(),{partnerId:o,actions:p}=B(),{userId:t=""}=T(),i=R(),l=D(560),n=E(),[d]=k(),c=d.get("prompt")??"",g=O(s=>{var f;return((f=s.labraChat)==null?void 0:f.isPanelOpen)??!1}),h=b.useRef(!1),{todos:r,loading:C}=N(),S=s=>{if(s.action===W.OpenSfCosell){p.triggerAction(s.action);return}n(m(o,s.prompt??s.text,{displayMessage:s.text}))};return b.useEffect(()=>{if(g){h.current=!0;return}h.current&&i({pathname:"../todos"},{relative:"path"})},[g,i]),b.useEffect(()=>{var s,f;o&&(t&&n(M(t)),n(L()),c&&(((f=(s=z.getState().labraChat)==null?void 0:s.messages)==null?void 0:f.length)??0)===0&&n(m(o,c)))},[o,t,n,c]),a(P,{partnerId:o,accountId:o,userId:t,chatEndpoint:H,agentType:"supervisor_agent",children:a("div",{ref:l,className:e.root,children:a(F,{title:"Labra AI Agent",header:a($,{todos:r,loading:C,onSelect:S}),hideFullScreenToggle:!0,showPanelBorder:!0,variant:"embedded"})})})};export{ee as FundingChatWrapper,ee as default}; 2//# sourceMappingURL=FundingChatWrapper-DbrvPVMU.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.