import{B as e,C as t,D as n,E as r,F as i,H as a,L as o,N as s,P as c,Q as l,S as u,T as d,U as f,X as p,Y as m,b as h,et as g,h as _,i as v,j as y,m as b,o as x,q as S,y as C}from"./app-fMWXDdYq.js";import{t as w}from"./i18n-D5HYY_eZ.js";import{t as T}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as E,t as D}from"./TextInput-DbVA_cVz.js";import{t as O}from"./InputLabel-B4OP_sjW.js";import{t as k}from"./SecondaryButton-CTy2VT-d.js";var A={},j={class:`inline-flex items-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-xs font-semibold uppercase tracking-widest text-white transition duration-150 ease-in-out hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 active:bg-red-700 dark:focus:ring-offset-gray-800`};function M(e,n){return i(),t(`button`,j,[o(e.$slots,`default`)])}var N=T(A,[[`render`,M]]),P={class:`fixed inset-0 z-50 overflow-y-auto px-4 py-6 sm:px-0`,"scroll-region":``},F=n({__name:`Modal`,props:{show:{type:Boolean,default:!1},maxWidth:{default:`2xl`},closeable:{type:Boolean,default:!0}},emits:[`close`],setup(n,{emit:l}){let d=n,m=l,g=S(),_=S(d.show);e(()=>d.show,()=>{d.show?(document.body.style.overflow=`hidden`,_.value=!0,g.value?.showModal()):(document.body.style.overflow=``,setTimeout(()=>{g.value?.close(),_.value=!1},200))});let v=()=>{d.closeable&&m(`close`)},y=e=>{e.key===`Escape`&&(e.preventDefault(),d.show&&v())};s(()=>document.addEventListener(`keydown`,y)),c(()=>{document.removeEventListener(`keydown`,y),document.body.style.overflow=``});let w=C(()=>({sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`})[d.maxWidth]);return(e,s)=>(i(),t(`dialog`,{class:`z-50 m-0 min-h-full min-w-full overflow-y-auto bg-transparent backdrop:bg-transparent`,ref_key:`dialog`,ref:g},[h(`div`,P,[r(x,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:a(()=>[f(h(`div`,{class:`fixed inset-0 transform transition-all`,onClick:v},[...s[0]||=[h(`div`,{class:`absolute inset-0 bg-gray-500 opacity-75 dark:bg-gray-900`},null,-1)]],512),[[b,n.show]])]),_:1}),r(x,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,"enter-to-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-to-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`},{default:a(()=>[f(h(`div`,{class:p([`mb-6 transform overflow-hidden rounded-lg bg-white shadow-xl transition-all sm:mx-auto sm:w-full dark:bg-gray-800`,w.value])},[_.value?o(e.$slots,`default`,{key:0}):u(``,!0)],2),[[b,n.show]])]),_:3})])],512))}}),I={class:`space-y-6`},L={class:`text-lg font-medium text-gray-900 dark:text-gray-100`},R={class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},z={class:`p-6`},B={class:`text-lg font-medium text-gray-900 dark:text-gray-100`},V={class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},H={class:`mt-6`},U={class:`mt-6 flex justify-end`},W=n({__name:`DeleteUserForm`,setup(e){let n=S(!1),o=S(null),s=v({password:``}),c=()=>{n.value=!0,y(()=>o.value?.focus())},u=()=>{s.delete(route(`profile.destroy`),{preserveScroll:!0,onSuccess:()=>f(),onError:()=>o.value?.focus(),onFinish:()=>{s.reset()}})},f=()=>{n.value=!1,s.clearErrors(),s.reset()};return(e,g)=>(i(),t(`section`,I,[h(`header`,null,[h(`h2`,L,l(m(w)(`Delete Account`)),1),h(`p`,R,l(m(w)(`Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.`)),1)]),r(N,{onClick:c},{default:a(()=>[d(l(m(w)(`Delete Account`)),1)]),_:1}),r(F,{show:n.value,onClose:f},{default:a(()=>[h(`div`,z,[h(`h2`,B,l(m(w)(`Are you sure you want to delete your account?`)),1),h(`p`,V,l(m(w)(`Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.`)),1),h(`div`,H,[r(O,{for:`password`,value:m(w)(`Password`),class:`sr-only`},null,8,[`value`]),r(D,{id:`password`,ref_key:`passwordInput`,ref:o,modelValue:m(s).password,"onUpdate:modelValue":g[0]||=e=>m(s).password=e,type:`password`,class:`mt-1 block w-3/4`,placeholder:m(w)(`Password`),onKeyup:_(u,[`enter`])},null,8,[`modelValue`,`placeholder`]),r(E,{message:m(s).errors.password,class:`mt-2`},null,8,[`message`])]),h(`div`,U,[r(k,{onClick:f},{default:a(()=>[d(l(m(w)(`Cancel`)),1)]),_:1}),r(N,{class:p([`ms-3`,{"opacity-25":m(s).processing}]),disabled:m(s).processing,onClick:u},{default:a(()=>[d(l(m(w)(`Delete Account`)),1)]),_:1},8,[`class`,`disabled`])])])]),_:1},8,[`show`])]))}}),G=g({default:()=>K}),K=W;export{G as n,K as t};