import{j as e}from"./radix-ui-nu4wz29m.js";import{r as o}from"./react-vendor-Bjx91N7w.js";import{I as l,c as d}from"./index-CcGVqYOy.js";import{ak as m,E as u,g as x}from"./icons-DzKUh8vG.js";function j({label:t,hideSensitivePill:a=!1,className:i,...r}){const[s,c]=o.useState(!1);return e.jsxs("div",{className:"group/masked space-y-1.5",children:[t&&e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-sm font-medium",children:[e.jsx(m,{"aria-hidden":!0,className:"size-3 text-accent/70"}),t]}),!a&&e.jsx("span",{className:"rounded border border-accent/40 bg-accent/10 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wider text-accent",children:"sensitive"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(l,{...r,type:s?"text":"password",className:d("pr-9 font-mono transition-all","focus-visible:ring-1 focus-visible:ring-accent/40 focus-visible:border-accent/50",i)}),e.jsx("button",{type:"button",onClick:()=>c(n=>!n),"aria-label":s?"Hide value":"Reveal value","aria-pressed":s,className:"absolute right-1.5 top-1/2 flex size-7 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/60",children:s?e.jsx(u,{className:"size-3.5"}):e.jsx(x,{className:"size-3.5"})})]})]})}export{j as M};
