import{b4 as g,j as a,d as s,ci as b,p as f,c,aa as m,ab as C,Q as p,b6 as e,q as u,cj as r,bh as y,L as v,aR as o,aQ as w}from"./index-CK33qGU_.js";const N=({error:i,register:n,login:t,loginHelp:x,children:d})=>{const l=g();return a.jsxs(s,{mt:"50px",flexDirection:"column",alignItems:"center",autoComplete:"on",children:[a.jsx(b,{}),a.jsx(f,{mb:"60px",mt:"15px",fontFamily:"Inter",fontSize:"18px",primary:!0,children:"Hopsworks Feature Store"}),i&&a.jsx(c,{width:"466px",mb:"20px",children:a.jsx(m,{type:C.error,content:i.message})}),d,n&&a.jsx(c,{sx:{h4:{fontSize:"12px"}},children:a.jsx(p,{mb:"20px",width:"466px",actions:a.jsx(e,{intent:"secondary",onClick:()=>l(u.auth.register),children:"Register"}),title:"Don’t have an account?"})}),t&&a.jsx(c,{sx:{h4:{fontSize:"12px !important"}},children:a.jsx(p,{mb:"20px",width:"466px",actions:a.jsx(e,{intent:"secondary",onClick:()=>l(u.auth.login),children:"Login"}),title:"Already have an account?"})}),x&&a.jsx(s,{as:"div",mb:"60px",children:a.jsx(r,{})})]})},S=({needConsent:i,remoteUser:n,chosenEmail:t,setChosenEmail:x,handleSubmit:d,onCancel:l})=>{const h=y(j=>j.loading.effects.auth.oauthLogin);return a.jsx(p,{width:"466px",mb:"20px",title:"Complete registration",children:h?a.jsx(v,{}):a.jsxs(a.Fragment,{children:[a.jsxs(s,{flexDirection:"row",justifyContent:"space-between",mb:"20px",children:[a.jsx(o,{width:"203px",label:"First name",name:"firstName",disabled:!0,value:n==null?void 0:n.givenName}),a.jsx(o,{width:"203px",label:"Last name",name:"lastName",disabled:!0,value:n==null?void 0:n.surname})]}),n!=null&&n.email&&(n==null?void 0:n.email.length)>1?a.jsx(w,{width:"100%",label:"Choose an email",noDataMessage:"No email found",options:(n==null?void 0:n.email)||[],value:t,onChange:x}):a.jsx(o,{width:"100%",label:"Email",name:"email",value:t||"No email found",disabled:!0}),a.jsxs(s,{justifyContent:"flex-end",mt:"20px",children:[i&&a.jsx(e,{mr:"20px",intent:"secondary",type:"button",alignSelf:"flex-end",onClick:l,children:"Cancel"}),a.jsx(e,{intent:"primary",type:"button",alignSelf:"flex-end",isLoading:h,onClick:d,children:"Register"})]})]})})};export{S as C,N as L};
