import{b as l,f as h,p as u,j as e,L as x,N as g,C as j,e as s,d as m}from"./index-Cziemgsu.js";const f=()=>{var r,n;const{isAuthenticated:c,isAuthLoading:o}=l(),d=h(),{data:i}=u(),t=(r=i==null?void 0:i.auth_methods)==null?void 0:r.includes("oidc"),a=((n=i==null?void 0:i.config)==null?void 0:n["user.ui.sso_only"])=="true";return o?e.jsx(x,{}):c?e.jsx(g,{to:"/ui",replace:!0}):e.jsx(j,{children:e.jsxs("div",{className:"empty-state login",children:[e.jsx("h1",{className:"p-heading--4 u-sv-2",children:"Login"}),t&&e.jsxs(e.Fragment,{children:[!a&&e.jsx(e.Fragment,{children:e.jsx("p",{className:"u-sv1",children:"Choose your login method"})}),e.jsx("a",{className:"p-button--positive",href:"/oidc/login",children:"Login with SSO"}),!a&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"p-heading--5 u-sv-2",children:"Other methods"}),e.jsxs("div",{children:["Either"," ",e.jsx(s,{to:"/ui/login/certificate-generate",children:"create a new certificate"})]}),e.jsxs("div",{children:["Or"," ",e.jsx(s,{to:"/ui/login/certificate-add",children:"use an existing certificate"})," ","already added to your browser"]})]})]}),!t&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"u-sv1",children:"Certificate selection"}),e.jsx(m.Button,{appearance:"positive",onClick:()=>d("/ui/login/certificate-generate"),children:"Create a new certificate"}),e.jsxs("p",{children:["Or"," ",e.jsx(s,{to:"/ui/login/certificate-add",children:"use an existing certificate"})," ","already added to your browser"]})]})]})})};export{f as default};
