1/*! For license information please see 1441.7fd91c32.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[1441],{1441:(e,s,a)=>{a.r(s),a.d(s,{default:()=>G});var t=a(2555),i=a(9950),l=a(1361),n=a(1353),r=a(1473),c=a(2569),d=a(4245),o=a(1111),m=a(9630),x=a(4779),h=a(3139),u=a(1455),j=a(3787),v=a(5475),p=a(9636),g=a(557),f=a(810),N=a(1884),b=a(5924),y=a(7737),w=a(446),A=a(5097),C=a(3052),_=a(7637),k=a(2737);const S=(0,a(6230).A)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var R=a(3147),F=a(6355),q=a(7838),E=a(6987),P=a(1878),z=a(3167),I=a(2828),B=a(1742),T=a(9318),V=a(7304),D=a(2607),Z=a(1646),M=a(4814),$=a(2033),L=a(4414);function W(){const[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)({}),[n,c]=(0,i.useState)(!0),[h,j]=(0,i.useState)(!1),[p,g]=(0,i.useState)(!1),[f,N]=(0,i.useState)(null),[b,y]=(0,i.useState)("general");(0,i.useEffect)(()=>{A(),C()},[]);const A=async()=>{try{c(!0);const e=await r.Ay.get("/admin/drill-config");e.data.success&&(s(e.data.config),l(e.data.persona_options||{}))}catch(e){console.error("Failed to load Drill config:",e),$.oR.error("Failed to load chatbot configuration")}finally{c(!1)}},C=async()=>{try{const e=await r.Ay.get("/admin/drill-config/status");e.data.success&&N(e.data.status)}catch(e){console.error("Failed to load Drill status:",e)}},_=(e,a)=>{s(s=>(0,t.A)((0,t.A)({},s),{},{[e]:a})),g(!0)},k=async()=>{try{j(!0);const a=await r.Ay.put("/admin/drill-config",e);a.data.success&&($.oR.success("Configuration saved successfully"),g(!1),s(a.data.config))}catch(a){console.error("Failed to save config:",a),$.oR.error("Failed to save configuration")}finally{j(!1)}},R=(s,a,i)=>{const l=[...e.quick_questions||[]];l[s]=(0,t.A)((0,t.A)({},l[s]),{},{[a]:i}),_("quick_questions",l)};return n?(0,L.jsx)(d.Zp,{children:(0,L.jsx)(d.Wu,{className:"flex items-center justify-center py-12",children:(0,L.jsx)(E.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}):e?(0,L.jsxs)("div",{className:"space-y-6",children:[(0,L.jsxs)("div",{className:"flex items-center justify-between",children:[(0,L.jsxs)("div",{children:[(0,L.jsxs)("h2",{className:"text-2xl font-bold flex items-center gap-2",children:[(0,L.jsx)(S,{className:"h-6 w-6 text-primary"}),"Drill Chatbot Configuration"]}),(0,L.jsx)("p",{className:"text-muted-foreground mt-1",children:"Customize the AI assistant's behavior and responses"})]}),(0,L.jsxs)("div",{className:"flex items-center gap-3",children:[f&&(0,L.jsx)(m.E,{variant:f.api_configured?"default":"destructive",children:f.api_configured?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(w.A,{className:"h-3 w-3 mr-1"})," API Connected"]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(I.A,{className:"h-3 w-3 mr-1"})," API Not Configured"]})}),(0,L.jsxs)(o.$,{variant:"outline",onClick:async()=>{if(window.confirm("Reset all settings to defaults? This cannot be undone."))try{j(!0);const e=await r.Ay.post("/admin/drill-config/reset");e.data.success&&($.oR.success("Configuration reset to defaults"),s(e.data.config),g(!1))}catch(e){console.error("Failed to reset config:",e),$.oR.error("Failed to reset configuration")}finally{j(!1)}},disabled:h,children:[(0,L.jsx)(E.A,{className:"h-4 w-4 mr-2"}),"Reset"]}),(0,L.jsxs)(o.$,{onClick:k,disabled:!p||h,children:[(0,L.jsx)(B.A,{className:"h-4 w-4 mr-2"}),h?"Saving...":"Save Changes"]})]})]}),(0,L.jsxs)(v.tU,{value:b,onValueChange:y,children:[(0,L.jsxs)(v.j7,{className:"grid w-full grid-cols-4",children:[(0,L.jsxs)(v.Xi,{value:"general",className:"flex items-center gap-2",children:[(0,L.jsx)(T.A,{className:"h-4 w-4"}),"General"]}),(0,L.jsxs)(v.Xi,{value:"persona",className:"flex items-center gap-2",children:[(0,L.jsx)(S,{className:"h-4 w-4"}),"Persona"]}),(0,L.jsxs)(v.Xi,{value:"messages",className:"flex items-center gap-2",children:[(0,L.jsx)(P.A,{className:"h-4 w-4"}),"Messages"]}),(0,L.jsxs)(v.Xi,{value:"questions",className:"flex items-center gap-2",children:[(0,L.jsx)(V.A,{className:"h-4 w-4"}),"Quick Questions"]})]}),(0,L.jsxs)(v.av,{value:"general",className:"space-y-6 mt-6",children:[(0,L.jsxs)(d.Zp,{children:[(0,L.jsxs)(d.aR,{children:[(0,L.jsx)(d.ZB,{children:"General Settings"}),(0,L.jsx)(d.BT,{children:"Control chatbot availability and core features"})]}),(0,L.jsxs)(d.Wu,{className:"space-y-6",children:[(0,L.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"font-medium",children:"Enable Chatbot"}),(0,L.jsx)("p",{className:"text-sm text-muted-foreground",children:"Turn the Drill assistant on or off"})]}),(0,L.jsx)(z.d,{checked:e.enabled,onCheckedChange:e=>_("enabled",e)})]}),(0,L.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"font-medium",children:"Enable Humor"}),(0,L.jsx)("p",{className:"text-sm text-muted-foreground",children:"Include military-style jokes and wit"})]}),(0,L.jsx)(z.d,{checked:e.humor_enabled,onCheckedChange:e=>_("humor_enabled",e)})]}),(0,L.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"font-medium",children:"Enable RAG"}),(0,L.jsx)("p",{className:"text-sm text-muted-foreground",children:"Use knowledge base for accurate responses"})]}),(0,L.jsx)(z.d,{checked:e.rag_enabled,onCheckedChange:e=>_("rag_enabled",e)})]}),(0,L.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"font-medium",children:"Show Citations"}),(0,L.jsx)("p",{className:"text-sm text-muted-foreground",children:"Display source references in responses"})]}),(0,L.jsx)(z.d,{checked:e.citation_enabled,onCheckedChange:e=>_("citation_enabled",e)})]})]})]}),(0,L.jsxs)(d.Zp,{children:[(0,L.jsxs)(d.aR,{children:[(0,L.jsx)(d.ZB,{children:"Model Settings"}),(0,L.jsx)(d.BT,{children:"Configure AI model parameters"})]}),(0,L.jsx)(d.Wu,{className:"space-y-4",children:(0,L.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"Model"}),(0,L.jsxs)(u.l6,{value:e.model,onValueChange:e=>_("model",e),children:[(0,L.jsx)(u.bq,{children:(0,L.jsx)(u.yv,{})}),(0,L.jsxs)(u.gC,{children:[(0,L.jsx)(u.eb,{value:"gpt-4o-mini",children:"GPT-4o Mini (Fast)"}),(0,L.jsx)(u.eb,{value:"gpt-4o",children:"GPT-4o (Powerful)"}),(0,L.jsx)(u.eb,{value:"gpt-4-turbo",children:"GPT-4 Turbo"})]})]})]}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"Response Length"}),(0,L.jsxs)(u.l6,{value:e.response_length,onValueChange:e=>_("response_length",e),children:[(0,L.jsx)(u.bq,{children:(0,L.jsx)(u.yv,{})}),(0,L.jsxs)(u.gC,{children:[(0,L.jsx)(u.eb,{value:"concise",children:"Concise"}),(0,L.jsx)(u.eb,{value:"balanced",children:"Balanced"}),(0,L.jsx)(u.eb,{value:"detailed",children:"Detailed"})]})]})]}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsxs)("label",{className:"text-sm font-medium",children:["Temperature (",e.temperature,")"]}),(0,L.jsx)(x.p,{type:"range",min:"0",max:"1",step:"0.1",value:e.temperature,onChange:e=>_("temperature",parseFloat(e.target.value)),className:"w-full"}),(0,L.jsx)("p",{className:"text-xs text-muted-foreground",children:"Lower = more focused, Higher = more creative"})]}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"Max Tokens"}),(0,L.jsx)(x.p,{type:"number",min:"100",max:"2000",value:e.max_tokens,onChange:e=>_("max_tokens",parseInt(e.target.value))})]})]})})]})]}),(0,L.jsx)(v.av,{value:"persona",className:"space-y-6 mt-6",children:(0,L.jsxs)(d.Zp,{children:[(0,L.jsxs)(d.aR,{children:[(0,L.jsx)(d.ZB,{children:"Persona Settings"}),(0,L.jsx)(d.BT,{children:"Customize the chatbot's personality"})]}),(0,L.jsxs)(d.Wu,{className:"space-y-4",children:[(0,L.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"Name"}),(0,L.jsx)(x.p,{value:e.persona_name,onChange:e=>_("persona_name",e.target.value),placeholder:"DRILL"})]}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"Title"}),(0,L.jsx)(x.p,{value:e.persona_title,onChange:e=>_("persona_title",e.target.value),placeholder:"VA Claims Advisor"})]})]}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"Personality Tone"}),(0,L.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:Object.entries(a).map(s=>{var a;let[t,i]=s;return(0,L.jsxs)("div",{onClick:()=>_("persona_tone",t),className:"p-4 border rounded-lg cursor-pointer transition-colors ".concat(e.persona_tone===t?"border-primary bg-primary/5":"hover:border-muted-foreground
2/50"),children:[(0,L.jsx)("p",{className:"font-medium",children:i.name}),(0,L.jsx)("p",{className:"text-sm text-muted-foreground",children:i.description}),(0,L.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:null===(a=i.phrases)||void 0===a?void 0:a.slice(0,3).map((e,s)=>(0,L.jsx)(m.E,{variant:"secondary",className:"text-xs",children:e},s))})]},t)})})]}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"Custom Persona Additions"}),(0,L.jsx)("textarea",{value:e.custom_persona_additions||"",onChange:e=>_("custom_persona_additions",e.target.value),placeholder:"Add custom instructions for the chatbot persona...",className:"w-full min-h-[100px] p-3 border rounded-lg resize-y"}),(0,L.jsx)("p",{className:"text-xs text-muted-foreground",children:"Extra instructions appended to the system prompt"})]})]})]})}),(0,L.jsxs)(v.av,{value:"messages",className:"space-y-6 mt-6",children:[(0,L.jsxs)(d.Zp,{children:[(0,L.jsxs)(d.aR,{children:[(0,L.jsx)(d.ZB,{children:"Greeting Messages"}),(0,L.jsx)(d.BT,{children:"Customize how Drill greets users"})]}),(0,L.jsxs)(d.Wu,{className:"space-y-4",children:[(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"New User Greeting"}),(0,L.jsx)("textarea",{value:e.greeting_new_user||"",onChange:e=>_("greeting_new_user",e.target.value),className:"w-full min-h-[80px] p-3 border rounded-lg resize-y"})]}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"Returning User Greeting"}),(0,L.jsx)("textarea",{value:e.greeting_returning_user||"",onChange:e=>_("greeting_returning_user",e.target.value),className:"w-full min-h-[80px] p-3 border rounded-lg resize-y"})]})]})]}),(0,L.jsxs)(d.Zp,{children:[(0,L.jsxs)(d.aR,{children:[(0,L.jsx)(d.ZB,{children:"Error Messages"}),(0,L.jsx)(d.BT,{children:"Customize error response messages"})]}),(0,L.jsxs)(d.Wu,{className:"space-y-4",children:[(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"Offline Message"}),(0,L.jsx)(x.p,{value:e.offline_message||"",onChange:e=>_("offline_message",e.target.value)})]}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"Rate Limit Message"}),(0,L.jsx)(x.p,{value:e.rate_limit_message||"",onChange:e=>_("rate_limit_message",e.target.value)})]}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)("label",{className:"text-sm font-medium",children:"General Error Message"}),(0,L.jsx)(x.p,{value:e.error_message||"",onChange:e=>_("error_message",e.target.value)})]})]})]})]}),(0,L.jsx)(v.av,{value:"questions",className:"space-y-6 mt-6",children:(0,L.jsxs)(d.Zp,{children:[(0,L.jsx)(d.aR,{children:(0,L.jsxs)("div",{className:"flex items-center justify-between",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)(d.ZB,{children:"Quick Questions"}),(0,L.jsx)(d.BT,{children:"Manage suggested questions for users"})]}),(0,L.jsxs)(o.$,{variant:"outline",size:"sm",onClick:()=>{const s=[...e.quick_questions||[]],a="custom_".concat(Date.now());s.push({id:a,question:"New question",category:"general",enabled:!0,order:s.length+1}),_("quick_questions",s)},children:[(0,L.jsx)(D.A,{className:"h-4 w-4 mr-2"}),"Add Question"]})]})}),(0,L.jsx)(d.Wu,{children:(0,L.jsxs)("div",{className:"space-y-3",children:[(e.quick_questions||[]).map((s,a)=>(0,L.jsxs)("div",{className:"flex items-center gap-3 p-3 border rounded-lg",children:[(0,L.jsx)(Z.A,{className:"h-5 w-5 text-muted-foreground cursor-move"}),(0,L.jsx)(z.d,{checked:s.enabled,onCheckedChange:e=>R(a,"enabled",e)}),(0,L.jsx)(x.p,{value:s.question,onChange:e=>R(a,"question",e.target.value),className:"flex-1"}),(0,L.jsxs)(u.l6,{value:s.category,onValueChange:e=>R(a,"category",e),children:[(0,L.jsx)(u.bq,{className:"w-32",children:(0,L.jsx)(u.yv,{})}),(0,L.jsxs)(u.gC,{children:[(0,L.jsx)(u.eb,{value:"evidence",children:"Evidence"}),(0,L.jsx)(u.eb,{value:"ratings",children:"Ratings"}),(0,L.jsx)(u.eb,{value:"conditions",children:"Conditions"}),(0,L.jsx)(u.eb,{value:"process",children:"Process"}),(0,L.jsx)(u.eb,{value:"appeals",children:"Appeals"}),(0,L.jsx)(u.eb,{value:"workflow",children:"Workflow"}),(0,L.jsx)(u.eb,{value:"general",children:"General"})]})]}),(0,L.jsx)(o.$,{variant:"ghost",size:"icon",onClick:()=>(s=>{const a=(e.quick_questions||[]).filter((e,a)=>a!==s);_("quick_questions",a)})(a),className:"text-destructive hover:text-destructive",children:(0,L.jsx)(M.A,{className:"h-4 w-4"})})]},s.id)),(!e.quick_questions||0===e.quick_questions.length)&&(0,L.jsx)("div",{className:"text-center py-8 text-muted-foreground",children:'No quick questions configured. Click "Add Question" to create one.'})]})})]})})]}),p&&(0,L.jsxs)("div",{className:"fixed bottom-4 right-4 bg-primary text-primary-foreground px-4 py-2 rounded-lg shadow-lg flex items-center gap-3",children:[(0,L.jsx)("span",{children:"You have unsaved changes"}),(0,L.jsx)(o.$,{variant:"secondary",size:"sm",onClick:k,disabled:h,children:h?"Saving...":"Save Now"})]})]}):(0,L.jsx)(d.Zp,{children:(0,L.jsx)(d.Wu,{className:"flex items-center justify-center py-12",children:(0,L.jsx)("p",{className:"text-muted-foreground",children:"Failed to load configuration"})})})}function G(){var e,s,a,z,I;const{user:B}=(0,n.As)(),T=(0,l.Zp)(),[V,D]=(0,i.useState)([]),[Z,M]=(0,i.useState)([]),[G,H]=(0,i.useState)(null),[U,X]=(0,i.useState)(!1),[O,Q]=(0,i.useState)(!0),[J,Y]=(0,i.useState)(null),[K,ee]=(0,i.useState)({status:"all",priority:"all",search:""}),[se,ae]=(0,i.useState)(new Set),[te,ie]=(0,i.useState)("claims"),[le,ne]=(0,i.useState)([]),[re,ce]=(0,i.useState)(!1),[de,oe]=(0,i.useState)(!1),[me,xe]=(0,i.useState)(!1),[he,ue]=(0,i.useState)(!1),[je,ve]=(0,i.useState)(""),[pe,ge]=(0,i.useState)(""),[fe,Ne]=(0,i.useState)(!1);(0,i.useEffect)(()=>{be()},[]),(0,i.useEffect)(()=>{me&&(ye(),we())},[me]);const be=async()=>{var e;if(!0===(null===B||void 0===B?void 0:B.is_demo)||(null===B||void 0===B||null===(e=B.email)||void 0===e?void 0:e.endsWith("@earnedit.demo")))xe(!0);else try{const e=await r.Ay.get("/partner/member/onboarding-status");if(e.data.has_membership&&!e.data.onboarding_completed)return void T("/agent/onboarding");xe(!0)}catch(s){xe(!0)}};(0,i.useEffect)(()=>{Ce()},[V,K]);const ye=async()=>{try{Q(!0);const[e,s]=await Promise.all([r.Ay.get("/agent/claims"),r.Ay.get("/agent/dashboard")]);D(e.data.claims||[]),Y(s.data)}catch(e){console.error("Failed to load dashboard:",e),$.oR.error("Failed to load dashboard data")}finally{Q(!1)}},we=async()=>{try{const e=await r.Ay.get("/va/status");ce(e.data.configured)}catch(e){ce(!1)}},Ae=async()=>{try{oe(!0);const e=await r.Ay.get("/va/pending-submissions");ne(e.data.submissions||[])}catch(e){console.error("Failed to load VA submissions:",e),$.oR.error("Failed to load VA submissions")}finally{oe(!1)}},Ce=()=>{let e=[...V];if("all"!==K.status&&(e=e.filter(e=>e.status===K.status)),"all"!==K.priority&&(e=e.filter(e=>e.priority===K.priority)),K.search){const s=K.search.toLowerCase();e=e.filter(e=>{var a;return e.claim_id.toLowerCase().includes(s)||(null===(a=e.veteran_name)||void 0===a?void 0:a.toLowerCase().includes(s))})}M(e)},_e=e=>({pending:"bg-yellow-500",in_review:"bg-blue-500",approved:"bg-[hsl(var(--success))]",needs_evidence:"bg-orange-500",submitted:"bg-purple-500"}[e]||"bg-white0"),ke=e=>"high"===e?(0,L.jsx)(b.A,{className:"h-4 w-4 text-[hsl(var(--destructive))]"}):"medium"===e?(0,L.jsx)(y.A,{className:"h-4 w-4 text-yellow-500"}):(0,L.jsx)(w.A,{className:"h-4 w-4 text-[hsl(var(--muted-foreground))]"});return!me||O?(0,L.jsx)(c.A,{children:(0,L.jsx)("div",{className:"p-6",children:(0,L.jsxs)("div",{className:"animate-pulse space-y-4",children:[(0,L.jsx)("div",{className:"h-8 w-64 bg-muted rounded"}),(0,L.jsx)("div",{className:"h-96 bg-muted rounded"})]})})}):(0,L.jsxs)(c.A,{children:[(0,L.jsxs)("div",{className:"p-6 space-y-6","data-testid":"agent-dashboard",children:[(0,L.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Work Queue"}),(0,L.jsx)("p",{className:"text-muted-foreground",children:"Prioritized claims requiring your action"})]}),(0,L.jsxs)("div",{className:"flex gap-3",children:[(0,L.jsxs)(o.$,{variant:"outline",className:"flex items-center gap-2",onClick:()=>ue(!0),children:[(0,L.jsx)(A.A,{className:"w-4 h-4"}),"Invite Veteran"]}),(0,L.jsxs)(o.$,{className:"bg-[#1B3A5F] hover:bg-[#152d4a] text-white flex items-center gap-2",onClick:()=>T("/agent/create-claim"),children:[(0,L.jsx)(C.A,{className:"w-4 h-4"}),"Create Claim"]})]})]}),(0,L.jsxs)(v.tU,{value:te,onValueChange:e=>{ie(e),"va-submissions"===e&&Ae()},className:"mb-6",children:[(0,L.jsxs)(v.j7,{children:[(0,L.jsxs)(v.Xi,{value:"claims",className:"flex items-center gap-2",children:[(0,L.jsx)(_.A,{className:"h-4 w-4"}),"Claims"]}),(0,L.jsxs)(v.Xi,{value:"va-submissions",className:"flex items-center gap-2",children:[(0,L.jsx)(k.A,{className:"h-4 w-4"}),"VA Submissions",!re&&(0,L.jsx)("span",{className:"text-xs text-amber-500",children:"(Not Configured)"})]}),("admin"===(null===B||void 0===B?void 0:B.role)||"super_admin"===(null===B||void 0===B?void 0:B.role))&&(0,L.jsxs)(v.Xi,{value:"drill-config",className:"flex items-center gap-2",children:[(0,L.jsx)(S,{className:"h-4 w-4"}),"Drill Config"]})]}),(0,L.jsxs)(v.av,{value:"claims",children:[se.size>0&&(0,L.jsx)("div",{className:"mb-4 flex justify-end",children:(0,L.jsxs)(o.$,{onClick:async()=>
2{if(0!==se.size)try{await r.Ay.post("/agent/bulk/status",{claim_ids:Array.from(se),new_status:"qa_pending"}),$.oR.success("".concat(se.size," claims approved")),ae(new Set),ye()}catch(e){$.oR.error("Failed to approve claims")}},className:"bg-[hsl(var(--success))] hover:bg-[hsl(var(--success))]/90","data-testid":"bulk-approve-button",children:["Approve ",se.size," Selected"]})}),(0,L.jsxs)("div",{className:"grid md:grid-cols-4 gap-6 mb-8",children:[(0,L.jsx)(d.Zp,{"data-testid":"stat-card-pending",className:"cursor-pointer hover:border-yellow-500 transition-colors",onClick:()=>ee((0,t.A)((0,t.A)({},K),{},{status:"pending"})),children:(0,L.jsx)(d.Wu,{className:"pt-6",children:(0,L.jsxs)("div",{className:"flex items-center justify-between",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Pending Review"}),(0,L.jsx)("p",{className:"text-3xl font-bold text-foreground mt-2",children:(null===J||void 0===J?void 0:J.pending)||(null===J||void 0===J||null===(e=J.status_counts)||void 0===e?void 0:e.pending)||0})]}),(0,L.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-yellow-500/10",children:(0,L.jsx)(y.A,{className:"h-6 w-6 text-yellow-500"})})]})})}),(0,L.jsx)(d.Zp,{"data-testid":"stat-card-in-review",className:"cursor-pointer hover:border-blue-500 transition-colors",onClick:()=>ee((0,t.A)((0,t.A)({},K),{},{status:"in_review"})),children:(0,L.jsx)(d.Wu,{className:"pt-6",children:(0,L.jsxs)("div",{className:"flex items-center justify-between",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"In Review"}),(0,L.jsx)("p",{className:"text-3xl font-bold text-foreground mt-2",children:(null===J||void 0===J?void 0:J.in_review)||(null===J||void 0===J||null===(s=J.status_counts)||void 0===s?void 0:s.in_review)||0})]}),(0,L.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-blue-500/10",children:(0,L.jsx)(_.A,{className:"h-6 w-6 text-blue-500"})})]})})}),(0,L.jsx)(d.Zp,{"data-testid":"stat-card-approved",className:"cursor-pointer hover:border-green-500 transition-colors",onClick:()=>ee((0,t.A)((0,t.A)({},K),{},{status:"approved"})),children:(0,L.jsx)(d.Wu,{className:"pt-6",children:(0,L.jsxs)("div",{className:"flex items-center justify-between",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Approved"}),(0,L.jsx)("p",{className:"text-3xl font-bold text-foreground mt-2",children:(null===J||void 0===J?void 0:J.approved)||(null===J||void 0===J||null===(a=J.status_counts)||void 0===a?void 0:a.qa_pending)||0})]}),(0,L.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-[hsl(var(--success))]/10",children:(0,L.jsx)(w.A,{className:"h-6 w-6 text-[hsl(var(--success))]"})})]})})}),(0,L.jsx)(d.Zp,{"data-testid":"stat-card-needs-evidence",className:"cursor-pointer hover:border-orange-500 transition-colors",onClick:()=>ee((0,t.A)((0,t.A)({},K),{},{status:"needs_evidence"})),children:(0,L.jsx)(d.Wu,{className:"pt-6",children:(0,L.jsxs)("div",{className:"flex items-center justify-between",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Needs Evidence"}),(0,L.jsx)("p",{className:"text-3xl font-bold text-foreground mt-2",children:(null===J||void 0===J?void 0:J.needs_evidence)||(null===J||void 0===J||null===(z=J.status_counts)||void 0===z?void 0:z.evidence_needed)||0})]}),(0,L.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-orange-500/10",children:(0,L.jsx)(b.A,{className:"h-6 w-6 text-orange-500"})})]})})})]}),(0,L.jsx)(d.Zp,{className:"mb-6",children:(0,L.jsx)(d.Wu,{className:"pt-6",children:(0,L.jsxs)("div",{className:"grid md:grid-cols-4 gap-4",children:[(0,L.jsxs)("div",{className:"relative",children:[(0,L.jsx)(R.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,L.jsx)(x.p,{placeholder:"Search claims...",value:K.search,onChange:e=>ee((0,t.A)((0,t.A)({},K),{},{search:e.target.value})),className:"pl-10","data-testid":"search-input"})]}),(0,L.jsxs)(u.l6,{value:K.status,onValueChange:e=>ee((0,t.A)((0,t.A)({},K),{},{status:e})),children:[(0,L.jsx)(u.bq,{"data-testid":"status-filter",children:(0,L.jsx)(u.yv,{placeholder:"All Statuses"})}),(0,L.jsxs)(u.gC,{children:[(0,L.jsx)(u.eb,{value:"all",children:"All Statuses"}),(0,L.jsx)(u.eb,{value:"pending",children:"Pending"}),(0,L.jsx)(u.eb,{value:"in_review",children:"In Review"}),(0,L.jsx)(u.eb,{value:"approved",children:"Approved"}),(0,L.jsx)(u.eb,{value:"needs_evidence",children:"Needs Evidence"})]})]}),(0,L.jsxs)(u.l6,{value:K.priority,onValueChange:e=>ee((0,t.A)((0,t.A)({},K),{},{priority:e})),children:[(0,L.jsx)(u.bq,{"data-testid":"priority-filter",children:(0,L.jsx)(u.yv,{placeholder:"All Priorities"})}),(0,L.jsxs)(u.gC,{children:[(0,L.jsx)(u.eb,{value:"all",children:"All Priorities"}),(0,L.jsx)(u.eb,{value:"high",children:"High Priority"}),(0,L.jsx)(u.eb,{value:"medium",children:"Medium Priority"}),(0,L.jsx)(u.eb,{value:"low",children:"Low Priority"})]})]}),(0,L.jsxs)(o.$,{variant:"outline",className:"flex items-center gap-2",children:[(0,L.jsx)(F.A,{className:"h-4 w-4"}),"More Filters"]})]})})}),(0,L.jsxs)(d.Zp,{"data-testid":"claims-table",children:[(0,L.jsx)(d.aR,{children:(0,L.jsx)(d.ZB,{children:"Claims Management"})}),(0,L.jsx)(d.Wu,{children:(0,L.jsxs)(j.XI,{children:[(0,L.jsx)(j.A0,{children:(0,L.jsxs)(j.Hj,{children:[(0,L.jsx)(j.nd,{className:"w-12",children:(0,L.jsx)(N.S,{checked:se.size===Z.length&&Z.length>0,onCheckedChange:e=>{ae(e?new Set(Z.map(e=>e.claim_id)):new Set)},"data-testid":"select-all-checkbox"})}),(0,L.jsx)(j.nd,{children:"Claim ID"}),(0,L.jsx)(j.nd,{children:"Veteran"}),(0,L.jsx)(j.nd,{children:"Status"}),(0,L.jsx)(j.nd,{children:"Priority"}),(0,L.jsx)(j.nd,{children:"Evidence Score"}),(0,L.jsx)(j.nd,{children:"Last Updated"}),(0,L.jsx)(j.nd,{className:"text-right",children:"Actions"})]})}),(0,L.jsx)(j.BF,{children:0===Z.length?(0,L.jsx)(j.Hj,{children:(0,L.jsx)(j.nA,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"No claims found matching your filters"})}):Z.map(e=>{var s;const a=e.id||e.claim_id;return(0,L.jsxs)(j.Hj,{"data-testid":"claim-row",className:"cursor-pointer hover:bg-muted/50",onClick:()=>T("/claim/".concat(a)),children:[(0,L.jsx)(j.nA,{onClick:e=>e.stopPropagation(),children:(0,L.jsx)(N.S,{checked:se.has(a),onCheckedChange:()=>(e=>{const s=new Set(se);s.has(e)?s.delete(e):s.add(e),ae(s)})(a),"data-testid":"claim-checkbox"})}),(0,L.jsx)(j.nA,{className:"font-mono text-sm",children:null===a||void 0===a?void 0:a.slice(-8)}),(0,L.jsx)(j.nA,{children:(null===(s=e.veteran)||void 0===s?void 0:s.name)||e.veteran_name||"Unknown"}),(0,L.jsx)(j.nA,{children:(0,L.jsx)(m.E,{className:_e(e.status),children:e.status})}),(0,L.jsx)(j.nA,{children:(0,L.jsxs)("div",{className:"flex items-center gap-1",children:[ke(e.priority),(0,L.jsx)("span",{className:"capitalize",children:e.priority||"medium"})]})}),(0,L.jsx)(j.nA,{children:(0,L.jsxs)("div",{className:"flex items-center gap-2",children:[(0,L.jsx)(f.k,{value:e.evidence_score||0,className:"w-16 h-2"}),(0,L.jsxs)("span",{className:"text-sm font-medium",children:[e.evidence_score||0,"%"]})]})}),(0,L.jsx)(j.nA,{className:"text-sm text-muted-foreground",children:e.updated_at?new Date(e.updated_at).toLocaleDateString():"N/A"}),(0,L.jsx)(j.nA,{className:"text-right",onClick:e=>e.stopPropagation(),children:(0,L.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,L.jsx)(o.$,{size:"sm",variant:"ghost",onClick:()=>T("/claim/".concat(a)),"data-testid":"view-claim-button",children:(0,L.jsx)(q.A,{className:"h-4 w-4"})}),("needs_evidence"===e.status||"evidence_needed"===e.status)&&(0,L.jsx)(o.$,{size:"sm",variant:"outline",onClick:()=>(async e=>{try{await r.Ay.post("/agent/kanban/move",{claim_id:e,new_status:"evidence_needed"}),$.oR.success("Evidence request sent to veteran"),ye()}catch(s){$.oR.error("Failed to request evidence")}})(a),"data-testid":"request-evidence-button",children:"Request Evidence"})]})})]},a)})})]})})]})]}),(0,L.jsx)(v.av,{value:"va-submissions",children:(0,L.jsxs)(d.Zp,{children:[(0,L.jsx)(d.aR,{children:(0,L.jsxs)("div",{className:"flex items-center justify-between",children:[(0,L.jsxs)(d.ZB,{className:"flex items-center gap-2",children:[(0,L.jsx)(k.A,{className:"h-5 w-5"}),"VA Submissions"]}),(0,L.jsxs)(o.$,{variant:"outline",size:"sm",onClick:Ae,disabled:de,children:[(0,L.jsx)(E.A,{className:"h-4 w-4 mr-2 ".concat(de?"animate-spin":"")}),"Refresh"]})]})}),(0,L.jsx)(d.Wu,{children:re?de?(0,L.jsxs)("div",{className:"text-center py-8",children:[(0,L.jsx)(E.A,{className:"h-8 w-8 mx-auto animate-spin text-muted-foreground mb-4"}),(0,L.jsx)("p",{className:"text-muted-foreground",children:"Loading submissions..."})]}):0===le.length?(0,L.jsxs)("div",{className:"text-center py-8",children:[(0,L.jsx)(k.A,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),(0,L.jsx)("h3",{className:"font-medium text-lg mb-2",children:"No Pending Submissions"}),(0,L.jsx)("p",{className:"text-muted-foreground",children:"There are no claims awaiting VA submission or with pending status."})]}):(0,L.jsxs)(j.XI,{children:[(0,L.jsx)(j.A0,{children:(0,L.jsxs)(j.Hj,{children:[(0,L.jsx)(j.nd,{children:"Claim ID"}),(0,L.jsx)(j.nd,{children:"Veteran"}),(0,L.jsx)(j.nd,{children:"Submission Status"}),(0,L.jsx)(j.nd,{children:"VA Confirmation"}),(0,L.jsx)(j.nd,{children:"Submitted"}),(0,L.jsx)(j.nd,{className:"text-right",children:"Actions"})]})}),(0,L.jsx)(j.BF,{children:le.map(e=>{var s;return(0,L.jsxs)(j.Hj,{children:[(0,L.jsx)(j.nA,{className:"font-mono text-sm",children:(null===(s=e.claim_id)||void 0===s?void 0:s.slice(-8))||"N/A"}),(0,L.jsx)(j.nA,{children:e.veteran_name||"Unknown"}),(0,L.jsx)(j.nA,{children:(0,L.jsx)(m.E,{className:"received"===e.va_status?"bg-green-500":"processing"===e.va_status?"bg-blue-500":"pending"===e.va_status?"bg-yellow-500":"bg-white0",children:e.va_status||"Awaiting"})}),(0,L.jsx)(j.nA,{className:"font-mono text-xs",children:e.va_submission_id||"-"}),(0,L.jsx)(j.nA,{className:"text-sm text-muted-foreground",children:e.submitted_at?new Date(e.submitted_at).toLocaleDateString():"-"}),(0,L.jsx)(j.nA,{className:"text-right",children:(0,L.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[!e.va_submission_id&&(0,L.jsxs)(o.$,{size:"sm",onClick:()=>(async e=>{try{const s=await r.Ay.post("/va/submit",{claim_id:e});s.data.success?($.oR.success("Claim submitted to VA successfully"),Ae(),ye()):$.oR.error(s.data.error||"Failed to submit to VA")}catch(t){var s,a;$.oR.error((null===(s=t.response)||void 0===s||null===(a=s.data)||void 0===a?void 0:a.detail)||"Failed to submit claim to VA")}})(e.claim_id),className:"bg-green-600 hover:bg-green-700",children:[(0,L.jsx)(k.A,{className:"h-4 w-4 mr-1"}),"Submit"]}),e.va_submission_id&&(0,L.jsx)(o.$,{size:"sm",variant:"outline",onClick:()=>(async e=>{try{const s=await r.Ay.get("/va/claim/".concat(e,"/status"));$.oR.success("Status: ".concat(s.data.status)),Ae()}catch(s){$.oR.error("Failed to refresh status")}})(e.claim_id),children:(0,L.jsx)(E.A,{className:"h-4 w-4"})})]})})]},e.claim_id)})})]}):(0,L.jsxs)("div",{className:"text-center py-8",children:[(0,L.jsx)(b.A,{className:"h-12 w-12 mx-auto text-amber-500 mb-4"}),(0,L.jsx)("h3",{className:"font-medium text-lg mb-2",children:"VA Lighthouse Not Configured"}),(0,L.jsx)("p",{className:"text-muted-foreground mb-4",children:"The VA Lighthouse API is not yet configured. Please add the VA_LIGHTHOUSE_API_KEY to enable direct VA submissions."}),(0,L.jsx)(h.A,{href:"https://developer.va.gov/",className:"inline-flex items-center gap-2 text-blue-600 hover:underline",showIcon:!0,children:"Get VA API Credentials"})]})})]})}),(0,L.jsx)(v.av,{value:"drill-config",children:(0,L.jsx)(W,{})})]})]}),(0,L.jsx)(p.lG,{open:U,onOpenChange:X,children:(0,L.jsxs)(p.Cf,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[(0,L.jsx)(p.c7,{children:(0,L.jsx)(p.L3,{children:"Claim Details"})}),G&&(0,L.jsxs)("div",{className:"space-y-6",children:[(0,L.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm text-muted-foreground",children:"Claim ID"}),(0,L.jsx)("p",{className:"font-mono",children:G.claim_id})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm text-muted-foreground",children:"Status"}),(0,L.jsx)(m.E,{className:_e(G.status),children:G.status})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm text-muted-foreground",children:"Evidence Score"}),(0,L.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,L.jsx)(f.k,{value:G.evidence_score||0,className:"flex-1 h-2"}),(0,L.jsxs)("span",{className:"font-medium",children:[G.evidence_score||0,"%"]})]})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm text-muted-foreground",children:"Priority"}),(0,L.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[ke(G.priority),(0,L.jsx)("span",{className:"capitalize",children:G.priority})]})]})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Conditions"}),(0,L.jsx)("div",{className:"flex flex-wrap gap-2",children:(null===(I=G.conditions)||void 0===I?void 0:I.map((e,s)=>(0,L.jsx)(m.E,{variant:"outline",children:e},s)))||(0,L.jsx)("p",{className:"text-sm text-muted-foreground",children:"No conditions listed"})})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"AI Analysis"}),(0,L.jsx)(d.Zp,{className:"bg-white border border-slate-200",children:(0,L.jsx)(d.Wu,{className:"pt-4",children:(0,L.jsx)("p",{className:"text-sm",children:G.ai_analysis||"No analysis available yet"})})})]}),(0,L.jsxs)("div",{className:"flex gap-2",children:[(0,L.jsxs)(o.$,{className:"flex-1 bg-[hsl(var(--success))] hover:bg-[hsl(var(--success))]/90","data-testid":"approve-claim-button",children:[(0,L.jsx)(w.A,{className:"h-4 w-4 mr-2"}),"Approve Claim"]}),(0,L.jsxs)(o.$,{variant:"outline",className:"flex-1","data-testid":"request-more-evidence-button",children:[(0,L.jsx)(b.A,{className:"h-4 w-4 mr-2"}),"Request More Evidence"]}),(0,L.jsx)(o.$,{variant:"outline","data-testid":"message-veteran-button",children:(0,L.jsx)(P.A,{className:"h-4 w-4"})})]})]})]})}),(0,L.jsx)(p.lG,{open:he,onOpenChange:ue,children:(0,L.jsxs)(p.Cf,{className:"max-w-md",children:[(0,L.jsxs)(p.c7,{children:[(0,L.jsx)(p.L3,{children:"Invite Veteran"}),(0,L.jsx)(p.rr,{children:"Send an invitation email to a veteran to begin their onboarding process."})]}),(0,L.jsxs)("div",{className:"space-y-4 py-4",children:[(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)(g.J,{htmlFor:"veteran-email",children:"Email Address *"}),(0,L.jsx)(x.p,{id:"veteran-email",type:"email",placeholder:"[email protected]",value:je,onChange:e=>ve(e.target.value)})]}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)(g.J,{htmlFor:"veteran-name",children:"Veteran Name (Optional)"}),(0,L.jsx)(x.p,{id:"veteran-name",type:"text",placeholder:"John Smith",value:pe,onCh
2ange:e=>ge(e.target.value)})]})]}),(0,L.jsxs)(p.Es,{children:[(0,L.jsx)(o.$,{variant:"outline",onClick:()=>ue(!1),children:"Cancel"}),(0,L.jsx)(o.$,{className:"bg-[#1B3A5F] hover:bg-[#152d4a]",onClick:async()=>{if(je){Ne(!0);try{const e=await r.Ay.post("/partner/clients/invitations",{veteran_email:je,veteran_name:pe||null});e.data.success?($.oR.success("Invitation sent successfully"),ue(!1),ve(""),ge(""),e.data.email_sent||$.oR.warning("Invitation created but email could not be sent. Please contact support.")):$.oR.error("Failed to send invitation")}catch(a){var e,s;console.error("Invite error:",a),$.oR.error((null===(e=a.response)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.detail)||"Failed to send invitation")}finally{Ne(!1)}}else $.oR.error("Please enter a valid email address")},disabled:fe||!je,children:fe?"Sending...":"Send Invitation"})]})]})})]})}},2569:(e,s,a)=>{a.d(s,{A:()=>z});var t=a(9950),i=a(1361),l=a(1353),n=a(9332),r=a(1111),c=a(8212),d=a(9630),o=a(8134),m=a(801),x=a(983),h=a(6150),u=a(7637),j=a(2420),v=a(4276),p=a(5332),g=a(772),f=a(1878),N=a(3147),b=a(9318),y=a(1946),w=a(9975),A=a(6479),C=a(478),_=a(8034),k=a(4414);const S=[{title:"Work Queue",href:"/agent",icon:h.A,description:"Prioritized claims requiring action"},{title:"Command Center",href:"/agent/command-center",icon:v.A,description:"Kanban board view"},{title:"My Schedule",href:"/agent/schedule",icon:m.A,description:"Meetings with clients"},{title:"Evidence & Documents",href:"/agent/evidence",icon:j.A,description:"Document management hub"},{title:"Communications",href:"/agent/communications",icon:f.A,description:"Messages and notifications"},{title:"Metrics & Reports",href:"/agent/metrics",icon:o.A,description:"Analytics & impact reports"}],R=[{title:"Forms Library",href:"/forms-library",icon:u.A},{title:"Settings",href:"/settings",icon:b.A}],F=[{title:"Admin Dashboard",href:"/admin/dashboard",icon:v.A,description:"System administration"},{title:"Accreditation Review",href:"/admin/accreditation",icon:y.A,description:"Review pending accreditations"}];function q(e){let{item:s,isActive:a,collapsed:t}=e;const l=s.icon;return(0,k.jsxs)(i.N_,{to:s.href,className:(0,n.cn)("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors",a?"bg-[hsl(var(--primary))] text-white":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[(0,k.jsx)(l,{className:"h-5 w-5 flex-shrink-0"}),!t&&(0,k.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,k.jsx)("div",{className:"font-medium",children:s.title}),s.description&&(0,k.jsx)("div",{className:"text-xs opacity-70 truncate",children:s.description})]}),!t&&a&&(0,k.jsx)(x.A,{className:"h-4 w-4 flex-shrink-0"})]})}function E(e){let{collapsed:s,setCollapsed:a}=e;const t=(0,i.zy)(),o=(0,i.Zp)(),{user:m,logout:x}=(0,l.As)();return(0,k.jsxs)("div",{className:(0,n.cn)("flex flex-col h-full bg-[#1B3A5F] text-white transition-all duration-300",s?"w-16":"w-64"),children:[(0,k.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-white/10",children:[!s&&(0,k.jsxs)("div",{className:"flex items-center gap-2",children:[(0,k.jsx)(y.A,{className:"h-6 w-6 text-[#D4A574]"}),(0,k.jsx)("span",{className:"font-bold text-lg",children:"EarnedIT"})]}),(0,k.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>a(!s),className:"text-white hover:bg-white/10",children:(0,k.jsx)(g.A,{className:"h-5 w-5"})})]}),!s&&(0,k.jsx)("div",{className:"px-4 py-3 border-b border-white/10",children:(0,k.jsxs)("div",{className:"flex items-center gap-3",children:[(0,k.jsx)("div",{className:"h-10 w-10 rounded-full bg-[#D4A574] flex items-center justify-center",children:(0,k.jsx)(w.A,{className:"h-5 w-5 text-[#1B3A5F]"})}),(0,k.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,k.jsx)("div",{className:"font-medium text-sm truncate",children:(null===m||void 0===m?void 0:m.name)||"Claims Agent"}),(0,k.jsx)(d.E,{className:"bg-[#D4A574] text-[#1B3A5F] text-xs",children:"Claims Agent"})]})]})}),(0,k.jsxs)(c.F,{className:"flex-1 px-3 py-4",children:[(0,k.jsx)("div",{className:"space-y-1",children:S.map(e=>(0,k.jsx)(q,{item:e,isActive:t.pathname===e.href,collapsed:s},e.href))}),!s&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{className:"my-4 border-t border-white/10"}),(0,k.jsx)("div",{className:"space-y-1",children:R.map(e=>(0,k.jsx)(q,{item:e,isActive:t.pathname===e.href,collapsed:s},e.href))})]}),!s&&"admin"===(null===m||void 0===m?void 0:m.role)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{className:"my-4 border-t border-white/10"}),(0,k.jsx)("div",{className:"text-xs uppercase tracking-wider text-white/50 px-3 mb-2",children:"Admin"}),(0,k.jsx)("div",{className:"space-y-1",children:F.map(e=>(0,k.jsx)(q,{item:e,isActive:t.pathname===e.href,collapsed:s},e.href))})]})]}),(0,k.jsx)("div",{className:"p-3 border-t border-white/10",children:(0,k.jsxs)(r.$,{variant:"ghost",className:(0,n.cn)("w-full text-white hover:bg-white/10",s?"justify-center":"justify-start"),onClick:async()=>{await x(),o("/login")},children:[(0,k.jsx)(p.A,{className:"h-5 w-5"}),!s&&(0,k.jsx)("span",{className:"ml-3",children:"Sign Out"})]})})]})}function P(){const e=(0,i.zy)(),s=(0,i.Zp)(),{user:a,logout:o}=(0,l.As)(),[m,x]=(0,t.useState)(!1);return(0,k.jsxs)(_.cj,{open:m,onOpenChange:x,children:[(0,k.jsx)(_.CG,{asChild:!0,children:(0,k.jsx)(r.$,{variant:"ghost",size:"sm",className:"lg:hidden",children:(0,k.jsx)(g.A,{className:"h-6 w-6"})})}),(0,k.jsx)(_.h,{side:"left",className:"w-72 p-0 bg-[#1B3A5F]",children:(0,k.jsxs)("div",{className:"flex flex-col h-full text-white",children:[(0,k.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-white/10",children:[(0,k.jsxs)("div",{className:"flex items-center gap-2",children:[(0,k.jsx)(y.A,{className:"h-6 w-6 text-[#D4A574]"}),(0,k.jsx)("span",{className:"font-bold text-lg",children:"EarnedIT"})]}),(0,k.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-white hover:bg-white/10",children:(0,k.jsx)(A.A,{className:"h-5 w-5"})})]}),(0,k.jsx)("div",{className:"px-4 py-3 border-b border-white/10",children:(0,k.jsxs)("div",{className:"flex items-center gap-3",children:[(0,k.jsx)("div",{className:"h-10 w-10 rounded-full bg-[#D4A574] flex items-center justify-center",children:(0,k.jsx)(w.A,{className:"h-5 w-5 text-[#1B3A5F]"})}),(0,k.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,k.jsx)("div",{className:"font-medium text-sm truncate",children:(null===a||void 0===a?void 0:a.name)||"Claims Agent"}),(0,k.jsx)(d.E,{className:"bg-[#D4A574] text-[#1B3A5F] text-xs",children:"Claims Agent"})]})]})}),(0,k.jsxs)(c.F,{className:"flex-1 px-3 py-4",children:[(0,k.jsx)("div",{className:"space-y-1",children:S.map(s=>(0,k.jsxs)(i.N_,{to:s.href,onClick:()=>x(!1),className:(0,n.cn)("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors",e.pathname===s.href?"bg-[hsl(var(--primary))] text-white":"text-white/70 hover:bg-white/10 hover:text-white"),children:[(0,k.jsx)(s.icon,{className:"h-5 w-5"}),(0,k.jsxs)("div",{children:[(0,k.jsx)("div",{className:"font-medium",children:s.title}),s.description&&(0,k.jsx)("div",{className:"text-xs opacity-70",children:s.description})]})]},s.href))}),(0,k.jsx)("div",{className:"my-4 border-t border-white/10"}),(0,k.jsx)("div",{className:"space-y-1",children:R.map(s=>(0,k.jsxs)(i.N_,{to:s.href,onClick:()=>x(!1),className:(0,n.cn)("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors",e.pathname===s.href?"bg-[hsl(var(--primary))] text-white":"text-white/70 hover:bg-white/10 hover:text-white"),children:[(0,k.jsx)(s.icon,{className:"h-5 w-5"}),(0,k.jsx)("span",{children:s.title})]},s.href))}),"admin"===(null===a||void 0===a?void 0:a.role)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{className:"my-4 border-t border-white/10"}),(0,k.jsx)("div",{className:"text-xs uppercase tracking-wider text-white/50 px-3 mb-2",children:"Admin"}),(0,k.jsx)("div",{className:"space-y-1",children:F.map(s=>(0,k.jsxs)(i.N_,{to:s.href,onClick:()=>x(!1),className:(0,n.cn)("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors",e.pathname===s.href?"bg-[hsl(var(--primary))] text-white":"text-white/70 hover:bg-white/10 hover:text-white"),children:[(0,k.jsx)(s.icon,{className:"h-5 w-5"}),(0,k.jsxs)("div",{children:[(0,k.jsx)("div",{className:"font-medium",children:s.title}),s.description&&(0,k.jsx)("div",{className:"text-xs opacity-70",children:s.description})]})]},s.href))})]})]}),(0,k.jsx)("div",{className:"p-3 border-t border-white/10",children:(0,k.jsxs)(r.$,{variant:"ghost",className:"w-full justify-start text-white hover:bg-white/10",onClick:async()=>{await o(),s("/login")},children:[(0,k.jsx)(p.A,{className:"h-5 w-5 mr-3"}),"Sign Out"]})})]})})]})}function z(e){let{children:s}=e;const[a,i]=(0,t.useState)(!1);return(0,k.jsxs)("div",{className:"flex h-screen bg-background",children:[(0,k.jsx)("div",{className:"hidden lg:flex",children:(0,k.jsx)(E,{collapsed:a,setCollapsed:i})}),(0,k.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,k.jsxs)("header",{className:"flex items-center gap-4 px-4 py-3 border-b bg-white lg:px-6",children:[(0,k.jsx)(P,{}),(0,k.jsx)("div",{className:"flex-1 flex items-center gap-4",children:(0,k.jsxs)("div",{className:"relative flex-1 max-w-md",children:[(0,k.jsx)(N.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,k.jsx)("input",{type:"text",placeholder:"Search claims, veterans...",className:"w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-[hsl(var(--primary))]"})]})}),(0,k.jsx)(C.A,{})]}),(0,k.jsxs)("div",{className:"bg-[hsl(var(--phi-bg))] border-b px-4 py-2 flex items-center gap-2 text-sm",children:[(0,k.jsx)(y.A,{className:"h-4 w-4 text-[hsl(var(--primary))]"}),(0,k.jsxs)("span",{children:[(0,k.jsx)("strong",{children:"PHI Notice:"})," You are viewing protected health information. All actions are audited."]})]}),(0,k.jsx)("main",{className:"flex-1 overflow-auto",children:s})]})]})}},3167:(e,s,a)=>{a.d(s,{d:()=>o});
2var t=a(2555),i=a(3986),l=a(9950),n=a(9222),r=a(9332),c=a(4414);const d=["className"],o=l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,d);return(0,c.jsx)(n.bL,(0,t.A)((0,t.A)({className:(0,r.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a)},l),{},{ref:s,children:(0,c.jsx)(n.zi,{className:(0,r.cn)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}))});o.displayName=n.bL.displayName},3787:(e,s,a)=>{a.d(s,{A0:()=>p,BF:()=>g,Hj:()=>f,XI:()=>v,nA:()=>b,nd:()=>N});var t=a(2555),i=a(3986),l=a(9950),n=a(9332),r=a(4414);const c=["className"],d=["className"],o=["className"],m=["className"],x=["className"],h=["className"],u=["className"],j=["className"],v=l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,c);return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",(0,t.A)({ref:s,className:(0,n.cn)("w-full caption-bottom text-sm",a)},l))})});v.displayName="Table";const p=l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,d);return(0,r.jsx)("thead",(0,t.A)({ref:s,className:(0,n.cn)("[&_tr]:border-b",a)},l))});p.displayName="TableHeader";const g=l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,o);return(0,r.jsx)("tbody",(0,t.A)({ref:s,className:(0,n.cn)("[&_tr:last-child]:border-0",a)},l))});g.displayName="TableBody";l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,m);return(0,r.jsx)("tfoot",(0,t.A)({ref:s,className:(0,n.cn)("border-t bg-white font-medium [&>tr]:last:border-b-0",a)},l))}).displayName="TableFooter";const f=l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,x);return(0,r.jsx)("tr",(0,t.A)({ref:s,className:(0,n.cn)("border-b transition-colors hover:bg-neutral-50 data-[state=selected]:bg-neutral-100",a)},l))});f.displayName="TableRow";const N=l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,h);return(0,r.jsx)("th",(0,t.A)({ref:s,className:(0,n.cn)("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a)},l))});N.displayName="TableHead";const b=l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,u);return(0,r.jsx)("td",(0,t.A)({ref:s,className:(0,n.cn)("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a)},l))});b.displayName="TableCell";l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,j);return(0,r.jsx)("caption",(0,t.A)({ref:s,className:(0,n.cn)("mt-4 text-sm text-muted-foreground",a)},l))}).displayName="TableCaption"},5475:(e,s,a)=>{a.d(s,{Xi:()=>u,av:()=>j,j7:()=>h,tU:()=>x});var t=a(2555),i=a(3986),l=a(9950),n=a(7970),r=a(9332),c=a(4414);const d=["className"],o=["className"],m=["className"],x=n.bL,h=l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,d);return(0,c.jsx)(n.B8,(0,t.A)({ref:s,className:(0,r.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-white border border-slate-200 p-1 text-muted-foreground",a)},l))});h.displayName=n.B8.displayName;const u=l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,o);return(0,c.jsx)(n.l9,(0,t.A)({ref:s,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",a)},l))});u.displayName=n.l9.displayName;const j=l.forwardRef((e,s)=>{let{className:a}=e,l=(0,i.A)(e,m);return(0,c.jsx)(n.UC,(0,t.A)({ref:s,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a)},l))});j.displayName=n.UC.displayName}}]);
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.