import{j as s}from"./@radix-DAoBbclx.js";import{I as a,B as w}from"./index-DnCFURX3.js";import{u as p,t as u}from"./@zod-3snSrKBm.js";import{P as h}from"./PasswordChecker-BUqppGV5.js";import{g as j}from"./form-schemas-BBw1CsKe.js";function v({displayUsername:r=!1,submitHandler:t,headline:o="Create your password",subHeadine:c="Select a password for your account"}){var l;const{register:e,watch:m,handleSubmit:d,formState:{isValid:n,errors:i}}=p({resolver:u(j(r)),mode:"onChange",criteriaMode:"all",defaultValues:{username:""}}),x=(l=i.newPassword)==null?void 0:l.types;return s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-display-xs font-semibold",children:o}),s.jsx("p",{className:"text-theme-text-secondary",children:c})]}),s.jsxs("form",{onSubmit:d(t),className:"space-y-5",children:[s.jsx("div",{className:"space-y-2",children:r&&s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{className:"text-text-sm",children:"Username"}),s.jsx(a,{...e("username"),className:"w-full"})]})}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{className:"text-text-sm",children:"New Password"}),s.jsx(a,{...e("newPassword"),type:"password",className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{className:"text-text-sm",children:"Confirm Password"}),s.jsx(a,{...e("confirmPassword"),type:"password",className:"w-full"})]}),s.jsx(h,{val:m("newPassword"),errors:x||[]}),s.jsx(w,{disabled:!n,className:"w-full text-center",size:"md",children:s.jsx("span",{className:"w-full",children:"Continue"})})]})]})}export{v as S};
