import{j as e}from"./vendor-radix-DNp60FuA.js";import{r as n}from"./vendor-react-DL0tRKZA.js";import{p as t,B as m}from"./index-DbhEjV5W.js";import{I as x}from"./input-BB7xZgTE.js";import{g as p}from"./auth-validation-Pa3ShdjD.js";import{E as u}from"./eye-off-DMaBMyBk.js";import{E as h}from"./eye-DIFaUC5Z.js";const f=n.forwardRef(({className:o,showStrengthIndicator:d=!1,value:s="",...l},c)=>{const[r,i]=n.useState(!1),a=p(s);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(x,{type:r?"text":"password",className:t("pr-10",o),ref:c,value:s,...l}),e.jsx(m,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>i(!r),disabled:l.disabled,tabIndex:-1,"aria-label":r?"Hide password":"Show password",children:r?e.jsx(u,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(h,{className:"h-4 w-4 text-muted-foreground"})})]}),d&&s.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full transition-all duration-300 ease-in-out",style:{width:`${a.score/7*100}%`,backgroundColor:a.color}})}),e.jsx("span",{className:"text-xs font-medium",style:{color:a.color},children:a.label})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsx("p",{children:"Password must contain:"}),e.jsxs("ul",{className:"mt-1 space-y-1",children:[e.jsxs("li",{className:t("flex items-center gap-1",s.length>=8?"text-primary":"text-muted-foreground"),children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-current"}),"At least 8 characters"]}),e.jsxs("li",{className:t("flex items-center gap-1",/[a-z]/.test(s)?"text-primary":"text-muted-foreground"),children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-current"}),"One lowercase letter"]}),e.jsxs("li",{className:t("flex items-center gap-1",/[A-Z]/.test(s)?"text-primary":"text-muted-foreground"),children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-current"}),"One uppercase letter"]}),e.jsxs("li",{className:t("flex items-center gap-1",/\d/.test(s)?"text-primary":"text-muted-foreground"),children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-current"}),"One number"]}),e.jsxs("li",{className:t("flex items-center gap-1",/[^A-Za-z0-9]/.test(s)?"text-primary":"text-muted-foreground"),children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-current"}),"One special character"]})]})]})]})]})});f.displayName="PasswordInput";export{f as P};