import{i as e,n as t,t as n}from"./jsx-runtime-ByY1xr43.js";import{c as r,i}from"./index-BuU36CvS.js";var a=e(t(),1),o=n();function s(){let[e,t]=(0,a.useState)(``),[n,s]=(0,a.useState)(``),[c,l]=(0,a.useState)(``),[u,d]=(0,a.useState)(``),[f,p]=(0,a.useState)(``),[m,h]=(0,a.useState)(``),[g,_]=(0,a.useState)(``),[v,y]=(0,a.useState)(``),[b,x]=(0,a.useState)(``),[S,C]=(0,a.useState)(`full`),[w,T]=(0,a.useState)(null),E=r({mutationFn:e=>i.post(`/api/well-visit/note`,e),onSuccess:e=>T(e.note)});function D(t){t.preventDefault(),T(null),E.mutate({patientAge:e,patientGender:n,visitAge:c,vitals:u,measurements:f,parentConcerns:m,transcript:g,screenings:v,vaccines:b,noteStyle:S})}let O=`w-full rounded-md border border-input bg-background px-3 py-2 text-sm`;return(0,o.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6 space-y-4`,children:[(0,o.jsxs)(`header`,{children:[(0,o.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Well Visit`}),(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Preventive-care note generation. Milestones and SSHADESS sub-tabs land in a follow-up; this first port covers the Visit Note pane.`})]}),(0,o.jsxs)(`form`,{onSubmit:D,className:`space-y-4`,children:[(0,o.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,o.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Age`}),(0,o.jsx)(`input`,{className:O,value:e,onChange:e=>t(e.target.value)})]}),(0,o.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Gender`}),(0,o.jsxs)(`select`,{className:O,value:n,onChange:e=>s(e.target.value),children:[(0,o.jsx)(`option`,{value:``,children:`Select`}),(0,o.jsx)(`option`,{children:`Male`}),(0,o.jsx)(`option`,{children:`Female`})]})]}),(0,o.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Visit age`}),(0,o.jsx)(`input`,{className:O,placeholder:`e.g. 6 months`,value:c,onChange:e=>l(e.target.value)})]})]}),(0,o.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,o.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Vital signs`}),(0,o.jsx)(`textarea`,{className:O+` min-h-[60px] font-mono text-xs`,value:u,onChange:e=>d(e.target.value)})]}),(0,o.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Measurements / growth`}),(0,o.jsx)(`textarea`,{className:O+` min-h-[60px] font-mono text-xs`,value:f,onChange:e=>p(e.target.value)})]})]}),(0,o.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Parent / patient concerns`}),(0,o.jsx)(`textarea`,{className:O+` min-h-[60px] text-sm`,value:m,onChange:e=>h(e.target.value)})]}),(0,o.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Transcript / dictation`}),(0,o.jsx)(`textarea`,{className:O+` min-h-[160px] font-mono text-sm`,value:g,onChange:e=>_(e.target.value)})]}),(0,o.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,o.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Screenings completed`}),(0,o.jsx)(`textarea`,{className:O+` min-h-[60px] text-xs`,value:v,onChange:e=>y(e.target.value)})]}),(0,o.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Immunizations today`}),(0,o.jsx)(`textarea`,{className:O+` min-h-[60px] text-xs`,value:b,onChange:e=>x(e.target.value)})]})]}),(0,o.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Note style`}),(0,o.jsxs)(`select`,{className:O,value:S,onChange:e=>C(e.target.value),children:[(0,o.jsx)(`option`,{value:`full`,children:`Full encounter note`}),(0,o.jsx)(`option`,{value:`short`,children:`Brief SOAP`})]})]}),E.error&&(0,o.jsx)(`div`,{className:`text-sm text-destructive`,children:E.error.message}),(0,o.jsx)(`button`,{type:`submit`,disabled:E.isPending||!e.trim()&&!c.trim(),className:`rounded-md bg-primary text-primary-foreground px-4 py-2 text-sm font-medium disabled:opacity-50`,children:E.isPending?`Generating…`:`Generate Well Visit Note`})]}),w&&(0,o.jsxs)(`section`,{className:`rounded-lg border border-border bg-card`,children:[(0,o.jsxs)(`header`,{className:`px-4 py-2 border-b border-border flex items-center justify-between bg-muted/40`,children:[(0,o.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Well Visit Note`}),(0,o.jsx)(`button`,{onClick:()=>navigator.clipboard.writeText(w),className:`text-xs text-muted-foreground underline`,children:`Copy`})]}),(0,o.jsx)(`div`,{className:`p-4 whitespace-pre-wrap text-sm`,children:w})]})]})}export{s as default};