import{u as w,e as $,w as e,b as u,t,a as r,d as a,g as l,n as g,C as h,j as p,o as k}from"./app-CYVHboi-.js";import{_ as v}from"./TextInput-CMrw-9XJ.js";import{_ as C}from"./InputError-u5FIXCwc.js";import{_ as D}from"./DialogModal-BGpz32gV.js";import{_ as f}from"./DangerButton-dMO1Xwz1.js";import{_ as b}from"./ActionSection-CzawoB33.js";import{_ as V}from"./SecondaryButton-CHQvCfls.js";import"./browser-BwNzv7vE.js";import"./Modal-oUJ1UwGv.js";import"./SectionTitle-DAHP_o6O.js";const A={class:"max-w-xl text-sm text-gray-600 dark:text-gray-400"},U={class:"mt-5"},B={class:"mt-4"},E={__name:"DeleteUserForm",setup(F){const n=p(!1),c=p(null),o=w({password:""}),_=()=>{n.value=!0,setTimeout(()=>c.value.focus(),250)},d=()=>{o.delete(route("current-user.destroy"),{preserveScroll:!0,onSuccess:()=>i(),onError:()=>c.value.focus(),onFinish:()=>o.reset()})},i=()=>{n.value=!1,o.reset()};return(s,m)=>(k(),$(b,null,{title:e(()=>[a(t(s.$t("Delete Account")),1)]),description:e(()=>[a(t(s.$t("Permanently delete your account.")),1)]),content:e(()=>[u("div",A,t(s.$t("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),u("div",U,[r(f,{onClick:_},{default:e(()=>[a(t(s.$t("Delete Account")),1)]),_:1})]),r(D,{show:n.value,onClose:i},{title:e(()=>[a(t(s.$t("Delete Account")),1)]),content:e(()=>[a(t(s.$t("Are you sure you want to delete your account? 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),u("div",B,[r(v,{type:"password",ref_key:"passwordInput",ref:c,placeholder:"Password",modelValue:l(o).password,"onUpdate:modelValue":m[0]||(m[0]=y=>l(o).password=y),class:"mt-1 block w-3/4",onKeyup:h(d,["enter"]),autocomplete:"current-password"},null,8,["modelValue"]),r(C,{message:l(o).errors.password,class:"mt-2"},null,8,["message"])])]),footer:e(()=>[r(V,{onClick:i},{default:e(()=>[a(t(s.$t("Cancel")),1)]),_:1}),r(f,{class:g(["ms-3",{"opacity-25":l(o).processing}]),disabled:l(o).processing,onClick:d},{default:e(()=>[a(t(s.$t("Delete Account")),1)]),_:1},8,["class","disabled"])]),_:1},8,["show"])]),_:1}))}};export{E as default};
