import{o as e,r as t,t as n}from"./jsx-runtime-BbTa8W_M-1776590214964.js";import{a as r}from"./app-CXDQ5oEH-1776590214964.js";import{t as i}from"./InputError-D01hH39E-1776590214964.js";import{t as a}from"./useTranslation-D1etqd9u-1776590214964.js";import{t as o}from"./createLucideIcon-D477Pc8e-1776590214964.js";import{t as s}from"./circle-check-9ar9m_Xo-1776590214964.js";import{t as c}from"./key-round-DyqVLoC9-1776590214964.js";import{t as l}from"./loader-circle-BF-wgoyu-1776590214964.js";import{t as u}from"./shield-check-BHIMgi8g-1776590214964.js";import{t as d}from"./button-WiAFyHfP-1776590214964.js";import{t as f}from"./label-DwYxovYB-1776590214964.js";import{t as p}from"./input-BlYvaS0F-1776590214964.js";import{t as m}from"./transition--CIL6RWn-1776590214964.js";var h=o(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),g=e(t(),1),_=n();function v({className:e=``}){let{t}=a(),n=(0,g.useRef)(),o=(0,g.useRef)(),{data:v,setData:y,errors:b,put:x,reset:S,processing:C,recentlySuccessful:w}=r({current_password:``,password:``,password_confirmation:``});return(0,_.jsxs)(`section`,{className:e,children:[(0,_.jsxs)(`header`,{className:`mb-6`,children:[(0,_.jsxs)(`h2`,{className:`text-lg font-bold flex items-center gap-2`,children:[(0,_.jsx)(u,{className:`w-5 h-5 text-primary`}),t(`Update Password`)]}),(0,_.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:t(`Ensure your account is using a long, random password to stay secure.`)})]}),(0,_.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x(route(`password.update`),{preserveScroll:!0,onSuccess:()=>S(),onError:e=>{e.password&&(S(`password`,`password_confirmation`),n.current.focus()),e.current_password&&(S(`current_password`),o.current.focus())}})},className:`space-y-6`,children:[(0,_.jsxs)(`div`,{className:`space-y-2 max-w-md`,children:[(0,_.jsxs)(f,{htmlFor:`current_password`,xxl:`8`,className:`text-sm font-bold flex items-center gap-2`,children:[(0,_.jsx)(c,{className:`w-3.5 h-3.5 text-muted-foreground`}),t(`Current Password`)]}),(0,_.jsx)(p,{id:`current_password`,ref:o,value:v.current_password,onChange:e=>y(`current_password`,e.target.value),type:`password`,className:`bg-background border-input`,autoComplete:`current-password`,placeholder:`••••••••`}),(0,_.jsx)(i,{message:b.current_password})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6 pt-2`,children:[(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsxs)(f,{htmlFor:`password`,xxl:`8`,className:`text-sm font-bold flex items-center gap-2`,children:[(0,_.jsx)(h,{className:`w-3.5 h-3.5 text-muted-foreground`}),t(`New Password`)]}),(0,_.jsx)(p,{id:`password`,ref:n,value:v.password,onChange:e=>y(`password`,e.target.value),type:`password`,className:`bg-background border-input`,autoComplete:`new-password`,placeholder:t(`New secure password`)}),(0,_.jsx)(i,{message:b.password})]}),(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsxs)(f,{htmlFor:`password_confirmation`,className:`text-sm font-bold flex items-center gap-2`,children:[(0,_.jsx)(u,{className:`w-3.5 h-3.5 text-muted-foreground`}),t(`Confirm Password`)]}),(0,_.jsx)(p,{id:`password_confirmation`,value:v.password_confirmation,onChange:e=>y(`password_confirmation`,e.target.value),type:`password`,className:`bg-background border-input`,autoComplete:`new-password`,placeholder:t(`Repeat new password`)}),(0,_.jsx)(i,{message:b.password_confirmation})]})]}),(0,_.jsxs)(`div`,{className:`flex items-center gap-4 pt-4 border-t border-border/50`,children:[(0,_.jsxs)(d,{type:`submit`,disabled:C,className:`px-8 font-bold shadow-md active:scale-95 transition-all`,children:[C?(0,_.jsx)(l,{className:`w-4 h-4 mr-2 animate-spin`}):null,t(`Update Password`)]}),(0,_.jsx)(m,{show:w,enter:`transition ease-in-out duration-300`,enterFrom:`opacity-0 translate-x-4`,leave:`transition ease-in-out duration-300`,leaveTo:`opacity-0`,children:(0,_.jsxs)(`p`,{className:`text-sm text-green-600 dark:text-green-500 flex items-center gap-1.5 font-bold`,children:[(0,_.jsx)(s,{className:`w-4 h-4`}),t(`Password Updated.`)]})})]})]})]})}export{v as default};