1import{r as g,d as Y,c as P,j as e,a4 as R,ac as k,i as z,B as C,z as b}from"./index-CbUVcLen.js";import{draftStorage as x}from"./draftStorage-BCj5elyP.js";import{T as f}from"./textarea-CfFKaXR3.js";import{d as A,c as F,e as B,a as J,T as U}from"./PersonaDashboardDemo-CH11LzDl.js";import{T as V}from"./trending-up-DVhbbsJK.js";import{A as E}from"./activity-ShWvxVWv.js";import{P as G}from"./pill-DDWXBGlg.js";import{C as S}from"./calendar-check-NJAH2rcE.js";import{C as q}from"./chevron-down-Bn2ixTyI.js";import"./demoBaselineJourney-AukcfODY.js";import"./SwirlLogo-C34WGKNa.js";import"./DashboardLogoutButton-CbkJ_MMP.js";import"./log-out-CbMY2iDa.js";import"./BaselineBarGraph-SxE0ZC7c.js";import"./patient-BGAHPpHJ.js";import"./use-mobile-DgwQRiXk.js";import"./VisitSheetBody-Cbg71a7x.js";import"./dialog-CTxxYOzo.js";import"./index-Ism7gw5U.js";import"./Combination-mypONuiH.js";import"./mic-off-CZPr_hv9.js";import"./mic-CZ82Dg1c.js";import"./rotate-ccw-CsIMuSNV.js";import"./copy-C96whDjK.js";import"./BaselineIndicesGraphs-DuwRUdlG.js";import"./ScreeningBarGraph-CcPOYNMk.js";import"./screeningQuestions-CiBOpQnU.js";import"./severityScales-CBaJQIBL.js";import"./ScreeningIndicesGraphs-D48lC6AV.js";import"./ScreeningGroupRecommendations-Dr7AZNl8.js";import"./screeningDynamicText-CeHh5M2h.js";import"./symptomRecommendations-6TaiUsIb.js";import"./RrAiInsight-XEyp6IFj.js";import"./arrow-up-right-CsDqo52D.js";import"./RecommendationInfoDrawers-BsobtgAp.js";import"./AssessmentShareQr-DhlcMeZg.js";import"./index-DgIkZ_T-.js";import"./checkbox-CpDKOYsU.js";import"./check-UJLIhtLN.js";import"./qr-code-BgD7hh-F.js";import"./download-B_Em0fNU.js";import"./clipboard-list-BwZK9cw1.js";import"./target-BxI6WKKL.js";import"./BaselineGroupRecommendations-BolIrsBs.js";import"./baselineDynamicText-DLHwycdb.js";import"./journeyMetrics-bF9LVsmE.js";import"./demoScreeningProfile-DA3_YwxY.js";import"./useE360ProProfile-IVWoanCs.js";import"./e360ProStore-Du918Rrm.js";import"./generateCategoricalChart-C6119K-Z.js";import"./BarChart-B1ek40YH.js";import"./heart-handshake-LvmCpP_7.js";import"./repeat-DY3Cgt9O.js";import"./zap-lBWRfq_F.js";import"./collapsible-BQxux2ho.js";import"./index-D9iXc636.js";import"./chevron-up-Urz6d9RP.js";import"./e360ProSymptoms-6PBqe2wd.js";import"./slider-Cs1YnmU7.js";import"./index-B7RoTnsJ.js";import"./LineChart-rlxfPRQ0.js";import"./Line-C5cru-_P.js";import"./badge-CZIH4sEl.js";import"./label-D6ncC9lR.js";import"./avatar-BZarkFI9.js";import"./smart-watch-hero-Di3V9fYj.js";import"./toggle-group-DgnxPMT6.js";import"./index-DN-eOJHr.js";import"./AIInsightsDisclosure-Br7lkWWM.js";import"./TruncatedIntro-B3gXKvEd.js";import"./E360ScreenInfo-CPJdj05C.js";import"./goBack-rwS57VaQ.js";import"./DemoHeader-CZd_350Q.js";import"./LanguageSelector-Cabh3t_d.js";import"./dropdown-menu-C6245JAw.js";import"./circle-xAkeTpgX.js";import"./arrow-right-CiTmDFtw.js";import"./useAIRecommendations-D1Hqe0n3.js";import"./popover-B7d3w24H.js";import"./usePaymentStatus-Js6f7Av6.js";import"./useQuery-BC5ebnXi.js";import"./useSubscriptionGate-DXYBdFcF.js";import"./paywallAnalytics-BNXvmBOC.js";import"./CumulativePatientProfile-Beoz1551.js";import"./calendar-clock-pLBPnc3t.js";import"./phone-oWEAVnS9.js";import"./printer-BtDfOTtr.js";import"./mail-ZaXhWy4N.js";import"./users-ChGz4B3M.js";import"./message-square-D7-7Q06N.js";import"./calendar-DSywXBi0.js";import"./file-text-CREpXOMI.js";import"./heart-CeDOpAyZ.js";import"./brain-BO_xxGIy.js";import"./shield-alert-zpXvFs0q.js";import"./globe-ByPPCEHb.js";import"./wine-DD0VKYdc.js";import"./lightbulb-CoDYTNP2.js";import"./briefcase-D3sepr2V.js";import"./table-DHls9WvP.js";import"./pencil-C5jUd58j.js";import"./square-DjAYVgbc.js";import"./save-DcMCS8Hl.js";import"./trash-2-BqodEeR2.js";import"./GradientHeroCard-CgSqagdf.js";import"./blogPosts-DAf5wDme.js";import"./ScreeningSymptomProfile-DP55aiku.js";import"./journeyDynamicText-B-fr-sxu.js";import"./clipboard-check-CdU82ED-.js";import"./providerDemoData-Cfqm9S0Y.js";import"./FAQ-S6a40FwN.js";import"./circle-help-sZbQjbrV.js";import"./LifeBalanceAllocation-CnoheGy5.js";import"./PieChart-qS2G39BQ.js";import"./AreaChart-RZVQNp_a.js";import"./Area-CjakimPa.js";import"./E360ReportCabinet-BPiPFNy2.js";import"./E360NarrativeReport-BWj-Sim0.js";import"./book-open-z6bYbE6O.js";
1import"./separator-BjrexbG4.js";import"./ownScreeningScores-_INM2lN8.js";import"./mouse-pointer-click-C3paJu4A.js";import"./EditableDrawerContent-qGjcb72q.js";import"./circle-alert-ClngU-5Y.js";import"./chart-column-B67U6GNl.js";import"./scale-CU43y5nZ.js";import"./layout-dashboard-CpAaYNcG.js";import"./layers-C6-txn7f.js";import"./watch-EJCVj2-2.js";import"./video-HQ61HZXu.js";import"./quote-DTmDTzP5.js";import"./settings-Cjy5VHH3.js";import"./heart-pulse-CDwPubfr.js";import"./chart-pie-wDMaj_vk.js";import"./database-4UAEHbpi.js";import"./receipt-Bk0Id5yD.js";import"./star-SWDdSHaF.js";import"./plus-B5nsbfZG.js";import"./bell-DsBtQJgK.js";import"./plug-B_P-YE5C.js";const H=[{key:"work",label:"a) At work or school",placeholder:"e.g. getting through the morning without stallingâ¦"},{key:"home",label:"b) At home (cooking, cleaning, shopping, organizing, fixing)",placeholder:"e.g. kitchen stays tidy; groceries done weeklyâ¦"},{key:"interpersonal",label:"c) Interpersonally (in conversations, meetings, correspondence)",placeholder:"e.g. answering messages same day; speaking up in meetingsâ¦"},{key:"mood",label:"d) In your mood",placeholder:"e.g. fewer flat days; recover faster after setbacksâ¦"},{key:"selfCare",label:"e) In self-care (sleep, diet, fitness)",placeholder:"e.g. asleep by 11; back to the gym twice a weekâ¦"},{key:"addiction",label:"f) Addiction (with regard to habits and substances)",placeholder:"e.g. fewer urges; cut back on evening drinkingâ¦"}],y={work:"",home:"",interpersonal:"",mood:"",selfCare:"",addiction:""},T=s=>{const o=s??{},r={...y};if(o.domains&&typeof o.domains=="object")for(const i of Object.keys(y)){const n=o.domains[i];r[i]=typeof n=="string"?n:""}return{...m,...o,domains:r,meds:{...m.meds,...o.meds??{}},wins:{...m.wins,...o.wins??{}},concerns:{...m.concerns,...o.concerns??{}}}},m={overall:null,domains:{...y},meds:{taking:null,adherence:null,sideEffects:null,sideEffectDetails:""},wins:{has:null,details:""},concerns:{has:null,details:""}},w="e360.followup.draft",D="e360.followup.log",K={better:"bg-emerald-500 text-white border-emerald-500",same:"bg-muted text-foreground border-border",worse:"bg-rose-500 text-white border-rose-500"},X=({value:s,onChange:o})=>e.jsx("div",{className:"flex gap-2 flex-wrap",children:["better","same","worse"].map(r=>e.jsx("button",{type:"button",onClick:()=>o(s===r?null:r),className:b("px-3 py-1 rounded-md text-xs font-medium border transition-colors capitalize",s===r?K[r]:"bg-background text-foreground/70 border-border hover:bg-muted/50"),children:r},r))}),u=({value:s,onChange:o})=>e.jsx("div",{className:"flex gap-2",children:["yes","no"].map(r=>e.jsx("button",{type:"button",onClick:()=>o(s===r?null:r),className:b("px-3 py-1 rounded-md text-xs font-medium border transition-colors",s===r?"bg-primary text-primary-foreground border-primary":"bg-background text-foreground/70 border-border hover:bg-muted/50"),children:r==="yes"?"Yes":"No"},r))}),h=({icon:s,label:o,summary:r,open:i,onToggle:n,answered:p,children:d})=>e.jsxs("div",{className:"rounded-md border border-border/50 bg-background overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:n,className:"w-full flex items-center gap-2.5 px-3 py-2.5 text-left hover:bg-muted/40 transition-colors",children:[e.jsx(s,{className:"h-4 w-4 text-primary shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:o}),e.jsx("div",{className:"text-[11px] text-muted-foreground truncate",children:r})]}),p&&e.jsx("span",{className:"text-[10px] font-medium text-teal-700 dark:text-teal-300 uppercase tracking-wide",children:"Answered"}),e.jsx(q,{className:b("h-4 w-4 text-muted-foreground transition-transform shrink-0",i&&"rotate-180")})]}),i&&e.jsx("div",{className:"px-3 pb-3 pt-1 space-y-3 border-t border-border/40",children:d})]}),c=({label:s,children:o})=>e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsx("p",{className:"text-sm text-foreground/85 flex-1 min-w-[220px]",children:s}),o]}),Ts=()=>{const[s,o]=g.useState(m),[r,i]=g.useState("overall"),[n,p]=g.useState([]),{user:d}=Y(),O=P();g.useEffect(()=>{try{const t=x.getItem(w);o(t?T(JSON.parse(t)):A(T(F),m));const a=x.getItem(D);p(a?JSON.parse(a):A(B,[]))}catch{}},[]);const l=t=>{const a={...s,...t};o(a);try{x.setItem(w,JSON.stringify(a))}catch{}},j=()=>{o(m);try{x.removeItem(w)}catch{}},I=()=>
1{if(!d)return;const a=[{...s,id:`fu-${Date.now()}`,savedAt:new Date().toISOString(),visitNumber:n.length+1},...n];p(a);try{x.setItem(D,JSON.stringify(a))}catch{}j(),i("overall")},v=s.overall!==null,L=Object.values(s.domains).some(t=>t.trim()!==""),_=s.meds.taking!==null||s.meds.sideEffects!==null,W=s.wins.has!==null,M=s.concerns.has!==null,N=v&&!!d;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-teal-500/30 bg-teal-500/5 px-3 py-2 text-xs text-teal-700 dark:text-teal-300",children:[e.jsx(R,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("span",{className:"font-medium",children:k()?"Demo mode.":"Blank by design."})," ",k()?J:U," Each saved visit is added to your growing baseline record below."]}),e.jsx("button",{type:"button",onClick:j,className:"text-[11px] underline underline-offset-2 hover:text-foreground",children:"Clear"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{icon:V,label:"My Trajectory",summary:"Better, worse, or the same",open:r==="overall",onToggle:()=>i(t=>t==="overall"?null:"overall"),answered:v,children:e.jsx(c,{label:"Since we talked last, are you better, worse or the same?",children:e.jsx(X,{value:s.overall,onChange:t=>l({overall:t})})})}),e.jsxs(h,{icon:z,label:"What's better",summary:"What changed since your last visit",open:r==="wins",onToggle:()=>i(t=>t==="wins"?null:"wins"),answered:W,children:[e.jsx(c,{label:"Anything that clearly went better since your last visit?",children:e.jsx(u,{value:s.wins.has,onChange:t=>l({wins:{...s.wins,has:t}})})}),s.wins.has==="yes"&&e.jsxs("div",{className:"pl-1",children:[e.jsx("label",{className:"text-[11px] font-medium text-muted-foreground block mb-1",children:"What worked?"}),e.jsx(f,{rows:2,value:s.wins.details,placeholder:"e.g. back to morning runs 3Ã/week; first full week without a low mood dayâ¦",onChange:t=>l({wins:{...s.wins,details:t.target.value}}),className:"text-sm"})]})]}),e.jsxs(h,{icon:E,label:"What's worse",summary:"What got worse or stalled",open:r==="concerns",onToggle:()=>i(t=>t==="concerns"?null:"concerns"),answered:M,children:[e.jsx(c,{label:"Anything that got worse or didn't improve?",children:e.jsx(u,{value:s.concerns.has,onChange:t=>l({concerns:{...s.concerns,has:t}})})}),s.concerns.has==="yes"&&e.jsxs("div",{className:"pl-1",children:[e.jsx("label",{className:"text-[11px] font-medium text-muted-foreground block mb-1",children:"What was hardest?"}),e.jsx(f,{rows:2,value:s.concerns.details,placeholder:"e.g. mid-afternoon focus dip; one panic spike Sunday after a difficult callâ¦",onChange:t=>l({concerns:{...s.concerns,details:t.target.value}}),className:"text-sm"})]})]}),e.jsxs(h,{icon:E,label:"Domains",summary:"Work, home, interpersonal, mood, self-care, addiction",open:r==="domains",onToggle:()=>i(t=>t==="domains"?null:"domains"),answered:L,children:[e.jsx("p",{className:"text-[11px] text-muted-foreground pl-1 -mt-1",children:"Compared to no treatment, what's better or what tasks are easier?"}),H.map(t=>e.jsxs("div",{className:"pl-1",children:[e.jsx("label",{className:"text-xs font-medium text-foreground/85 block mb-1",children:t.label}),e.jsx(f,{rows:2,value:s.domains[t.key],placeholder:t.placeholder,onChange:a=>l({domains:{...s.domains,[t.key]:a.target.value}}),className:"text-sm"})]},t.key))]}),e.jsxs(h,{icon:G,label:"Medications",summary:"Adherence and side effects",open:r==="meds",onToggle:()=>i(t=>t==="meds"?null:"meds"),answered:_,children:[e.jsx(c,{label:"Are you currently taking any prescribed medication?",children:e.jsx(u,{value:s.meds.taking,onChange:t=>l({meds:{...s.meds,taking:t}})})}),s.meds.taking==="yes"&&e.jsxs(e.Fragment,{children:[e.jsx(c,{label:"Have you been taking it as prescribed?",children:e.jsx(u,{value:s.meds.adherence,onChange:t=>l({meds:{...s.meds,adherence:t}})})}),e.jsx(c,{label:"Any side effects?",children:e.jsx(u,{value:s.meds.sideEffects,onChange:t=>l({meds:{...s.meds,sideEffects:t}})})}),s.meds.sideEffects==="yes"&&e.jsxs("div",{className:"pl-1",children:[e.jsx("label",{className:"text-[11px] font-medium text-muted-foreground block mb-1",children:"Describe the side effects"}),e.jsx(f,{rows:2,value:s.meds.sideEffectDetails,placeholder:"e.g. dry mouth, mild jitteriness in the morningsâ¦",onChange:t=>l({meds:{...s.meds,sideEffectDetails:t.target.value}}),className:"text-sm"})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap pt-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground",children:d?N?"Ready to save. This becomes visit #"+(n.length+1)+".":"Answer at least the first question to save this visit.":"Register or sign in to save this visit to your record."}),d?e.jsxs(C,{type:"button",size:"sm",onClick:I,disabled:!N,className:"gap-1.5",children:[e.jsx(S,{className:"h-3.5 w-3.5"}),"Save visit"]}):e.jsxs(C,{type:"button",size:"sm",variant:"outline",onClick:()=>O("/auth"),className:"gap-1.5",children:[e.jsx(S,{className:"h-3.5 w-3.5"}),"Register to save"]})]}),e.jsxs("div",{className:"space-y-2 pt-2 border-t border-border/40",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Your follow-up record"}),e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[n.length," saved"]})]}),n.length===0?e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No follow-ups saved yet. Answer the questions above and hit Save visit â your record will start to build here."}):e.jsx("div",{className:"space-y-2",children:n.map(t=>{const a=t.overall??"â";return e.jsxs("div",{className:"rounded-md border border-border/60 p-3 space-y-1 bg-muted/20",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsxs("div",{className:"text-sm font-medium text-foreground",children:["Visit #",t.visitNumber,e.jsx("span",{className:"text-xs text-muted-foreground font-normal ml-2",children:new Date(t.savedAt).toLocaleStr
1ing(void 0,{month:"short",day:"numeric",year:"numeric"})})]}),e.jsx("span",{className:b("text-[10px] uppercase tracking-wide px-2 py-0.5 rounded-md font-medium",t.overall==="better"&&"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300",t.overall==="same"&&"bg-muted text-foreground/70",t.overall==="worse"&&"bg-rose-500/15 text-rose-700 dark:text-rose-300",!t.overall&&"bg-muted text-muted-foreground"),children:a})]}),t.wins.details&&e.jsxs("p",{className:"text-xs text-foreground/80",children:[e.jsx("span",{className:"text-muted-foreground",children:"What's better: "}),t.wins.details]}),t.concerns.details&&e.jsxs("p",{className:"text-xs text-foreground/80",children:[e.jsx("span",{className:"text-muted-foreground",children:"What's worse: "}),t.concerns.details]})]},t.id)})})]})]})};export{Ts as StructuredFollowUpSection};
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.