import{d as k,u as S,c,a as t,w as V,b as m,v as b,t as p,e as v,f as _,r as u,g as C,h as D,o as f,_ as L}from"./index-WryWQMIk.js";const B={class:"login-bg relative min-h-dvh flex flex-col justify-center px-6 text-white overflow-hidden"},U={class:"relative max-w-sm w-full mx-auto"},j={key:0,class:"text-status-crit text-meta"},E=["disabled"],I=["disabled"],M=k({__name:"LoginView",setup(N){const x=C(),w=D(),r=S(),a=u(""),i=u(""),o=u(""),s=u(!1),g=!1;async function y(){var l,e;if(o.value="",!a.value||!i.value){o.value="Enter your username and password.";return}s.value=!0;try{await r.login(a.value.trim(),i.value),d()}catch(n){o.value=((e=(l=n==null?void 0:n.response)==null?void 0:l.data)==null?void 0:e.message)??"Sign-in failed. Check your connection."}finally{s.value=!1}}async function h(){s.value=!0,o.value="",await r.devLogin()||r.demoLogin(),d(),s.value=!1}function d(){const l=w.query.from||"/schedule";x.replace(l)}return(l,e)=>(f(),c("div",B,[e[6]||(e[6]=t("div",{class:"pointer-events-none absolute -top-24 -right-20 w-72 h-72 rounded-full bg-white/15 blur-3xl"},null,-1)),e[7]||(e[7]=t("div",{class:"pointer-events-none absolute -bottom-28 -left-24 w-80 h-80 rounded-full bg-brand-500/40 blur-3xl"},null,-1)),e[8]||(e[8]=t("div",{class:"pointer-events-none absolute top-1/3 -left-10 w-44 h-44 rounded-full bg-white/10 blur-2xl"},null,-1)),t("div",U,[e[4]||(e[4]=t("div",{class:"text-center mb-8"},[t("div",{class:"inline-flex items-center justify-center w-16 h-16 rounded-card bg-white/15 text-3xl mb-3"},"🩺"),t("h1",{class:"text-display"},"Shifa Staff"),t("p",{class:"text-white/70 text-meta mt-1"},"Sign in with your clinic account")],-1)),t("form",{class:"bg-surface text-ink rounded-card shadow-card p-5 space-y-4",onSubmit:V(y,["prevent"])},[t("div",null,[e[2]||(e[2]=t("label",{class:"text-meta font-semibold text-ink-muted"},"Username or email",-1)),m(t("input",{"onUpdate:modelValue":e[0]||(e[0]=n=>a.value=n),type:"text",autocomplete:"username",autocapitalize:"none",class:"mt-1 w-full rounded-xl border border-ink/10 bg-surface-muted px-3 py-2.5 text-body focus:outline-none focus:ring-2 focus:ring-brand-500"},null,512),[[b,a.value]])]),t("div",null,[e[3]||(e[3]=t("label",{class:"text-meta font-semibold text-ink-muted"},"Password",-1)),m(t("input",{"onUpdate:modelValue":e[1]||(e[1]=n=>i.value=n),type:"password",autocomplete:"current-password",class:"mt-1 w-full rounded-xl border border-ink/10 bg-surface-muted px-3 py-2.5 text-body focus:outline-none focus:ring-2 focus:ring-brand-500"},null,512),[[b,i.value]])]),o.value?(f(),c("p",j,p(o.value),1)):v("",!0),t("button",{type:"submit",disabled:s.value,class:"w-full rounded-xl bg-brand-600 text-white font-semibold py-3 disabled:opacity-60 active:scale-[.99] transition"},p(s.value?"Signing in…":"Sign in"),9,E),_(g)?(f(),c("button",{key:1,type:"button",onClick:h,disabled:s.value,class:"w-full rounded-xl border border-ink/10 text-ink-muted text-meta font-semibold py-2.5"}," Dev sign-in (debug only) ",8,I)):v("",!0)],32),e[5]||(e[5]=t("p",{class:"text-center text-white/60 text-micro mt-6"},"Shifa One · Staff app",-1))])]))}}),q=L(M,[["__scopeId","data-v-f51252ee"]]);export{q as default};
//# sourceMappingURL=LoginView-Gq04yw01.js.map
