1import{Ct as n,D as h,G as y,Jt as d,T as l,U as r,V as w,b as p,ht as i,j as F,jt as P,m as g,nt as A,q as C,st as N,v as t,w as S,x as a}from"./vue.runtime.esm-bundler-DYdOdNtL.js";import{i as j}from"./auth-CR7pDtDd.js";import{Fn as T,jn as V}from"./main-DnpaWVIM.js";import{o as c}from"./format-CDnuUStP.js";import{t as D}from"./useToast-m1WG9pkD.js";import{t as B}from"./CheckCircleIcon-Bm7xHvr0.js";import{t as E}from"./DocumentTextIcon-BsQ6W8zZ.js";import{t as I}from"./ExclamationTriangleIcon-DyTIopum.js";import{n as $,t as q}from"./PatientTopNavigation-BImmj8Vh.js";F();N(),P();var L={class:"container px-4 py-3 space-y-4"},G={key:0,class:"max-w-3xl space-y-3"},J={key:1,class:"max-w-3xl rounded-lg border border-gray-200 dark:border-gray-700 p-8 text-center"},M={class:"mt-3 text-sm text-gray-600 dark:text-gray-400"},R={key:2,class:"max-w-3xl rounded-lg border border-dashed border-gray-300 dark:border-gray-700 p-10 text-center"},U={key:3,class:"max-w-3xl space-y-6"},W={key:0,class:"rounded-lg border border-dashed border-gray-300 dark:border-gray-700 p-6 text-center"},Y={key:1,class:"space-y-2"},z={class:"min-w-0"},H={class:"text-sm font-medium text-gray-900 dark:text-white truncate"},K={class:"text-xs text-gray-500 dark:text-gray-400 tabular-nums"},O={key:0},Q={key:1},X={key:0},Z={class:"divide-y divide-gray-200 dark:divide-gray-700 rounded-lg border border-gray-200 dark:border-gray-700"},ee={class:"text-xs text-gray-900 dark:text-white truncate"},te={class:"text-xs text-gray-500 dark:text-gray-400 tabular-nums flex-shrink-0"},re=h({__name:"PatientForms",setup(ae){const f=T(),{showError:b}=D();V(15,"PatientSignIn");const v=i(!0),u=i(""),_=i(!0),m=i([]),x=i([]);return w(async()=>{try{const o=await j();if(!o||o.role!=="patient"){b("Access denied: This area is for patients only"),f.push({name:"PatientSignIn"});return}const e=await $();if(!e.available){_.value=!1;return}m.value=e.outstanding,x.value=e.completed}catch(o){u.value=o instanceof Error?o.message:"We could not load your forms."}finally{v.value=!1}}),(o,e)=>{const k=C("router-link");return r(),a("div",null,[l(q),t("div",L,[e[6]||(e[6]=t("header",null,[t("h1",{class:"text-xl font-bold text-gray-900 dark:text-white"},"Forms"),t("p",{class:"mt-1 text-sm text-gray-500 dark:text-gray-400"}," Forms your office has asked you to fill out. ")],-1)),v.value?(r(),a("div",G,[(r(),a(g,null,y(3,s=>t("div",{key:s,class:"h-14 bg-gray-200 dark:bg-gray-700 rounded animate-pulse"})),64))])):u.value?(r(),a("div",J,[l(n(I),{class:"mx-auto h-12 w-12 text-amber-500"}),t("p",M,d(u.value),1)])):_.value?(r(),a("div",U,[t("section",null,[e[4]||(e[4]=t("h2",{class:"text-sm font-semibold text-gray-900 dark:text-white mb-2"},"To fill out",-1)),m.value.length===0?(r(),a("div",W,[l(n(B),{class:"mx-auto h-10 w-10 text-green-500"}),e[2]||(e[2]=t("p",{class:"mt-2 text-sm text-gray-500 dark:text-gray-400"},"You're all caught up. No forms are waiting.",-1))])):(r(),a("ul",Y,[(r(!0),a(g,null,y(m.value,s=>(r(),a("li",{key:s.id,class:"flex items-center justify-between gap-3 rounded-lg border border-gray-200 dark:border-gray-700 px-4 py-3"},[t("div",z,[t("p",H,d(s.formName),1),t("p",K,[s.sentAt?(r(),a("span",O,"Sent "+d(n(c)(s.sentAt)),1)):p("",!0),s.expiresAt?(r(),a("span",Q," · Due by "+d(n(c)(s.expiresAt)),1)):p("",!0)])]),l(k,{to:{name:"PatientPortalForm",params:{requestId:s.id}},class:"btn btn-primary flex-shrink-0"},{default:A(()=>[...e[3]||(e[3]=[S(" Fill out ",-1)])]),_:1},8,["to"])]))),128))]))]),x.value.length>0?(r(),a("section",X,[e[5]||(e[5]=t("h2",{class:"text-sm font-semibold text-gray-900 dark:text-white mb-2"},"Completed",-1)),t("ul",Z,[(r(!0),a(g,null,y(x.value,s=>(r(),a("li",{key:s.id,class:"flex items-center justify-between gap-3 px-4 py-2"},[t("span",ee,d(s.formName),1),t("span",te,d(s.completedAt?`Submitted ${n(c)(s.completedAt)}`:"Submitted"),1)]))),128))])])):p("",!0)])):(r(),a("div",R,[l(n(E),{class:"mx-auto h-12 w-12 text-gray-400 dark:text-gray-500"}),e[0]||(e[0]=t("h3",{class:"mt-3 text-sm font-medium text-gray-900 dark:text-white"},"Forms are not available online",-1)),e[1]||(e[1]=t("p",{class:"mt-1 text-sm text-gray-500 dark:text-gray-400"},"Please contact the office.",-1))]))])])}}}),ye=re;export{ye as default};
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.