import{d as F,Q as M,r as c,o as b,A as g,B as u,f as m,a as l,E as p,k as C,a2 as x,K as E,Z as R,__tla as j}from"./index-92ad187a.js";import{_ as B,__tla as D}from"./Dialog-44c9fa34.js";import{_ as K,__tla as P}from"./Form-e4dc4c6b.js";import{g as Q,c as U,u as Z,__tla as q}from"./index-9fa0b586.js";import{r as z,a as G,__tla as H}from"./account.data-a61ba8bd.js";import{u as I,__tla as J}from"./useMessage-d9788660.js";let v,L=Promise.all([(()=>{try{return j}catch{}})(),(()=>{try{return D}catch{}})(),(()=>{try{return P}catch{}})(),(()=>{try{return q}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return J}catch{}})()]).then(async()=>{v=F({name:"SystemMailAccountForm",__name:"MailAccountForm",emits:["success"],setup(N,{expose:h,emit:k}){const{t:o}=M(),n=I(),t=c(!1),i=c(""),e=c(!1),f=c(""),r=c();h({open:async(s,a)=>{if(t.value=!0,i.value=o("action."+s),f.value=s,a){e.value=!0;try{const _=await Q(a);r.value.setValues(_)}finally{e.value=!1}}}});const w=k,S=async()=>{if(r&&await r.value.getElFormRef().validate()){e.value=!0;try{const s=r.value.formModel;f.value==="create"?(await U(s),n.success(o("common.createSuccess"))):(await Z(s),n.success(o("common.updateSuccess"))),t.value=!1,w("success")}finally{e.value=!1}}};return(s,a)=>{const _=K,y=E,V=B,A=R;return b(),g(V,{modelValue:l(t),"onUpdate:modelValue":a[1]||(a[1]=d=>x(t)?t.value=d:null),title:l(i)},{footer:u(()=>[m(y,{disabled:l(e),type:"primary",onClick:S},{default:u(()=>[p("\u786E \u5B9A")]),_:1},8,["disabled"]),m(y,{onClick:a[0]||(a[0]=d=>t.value=!1)},{default:u(()=>[p("\u53D6 \u6D88")]),_:1})]),default:u(()=>[C(m(_,{ref_key:"formRef",ref:r,rules:l(z),schema:l(G).formSchema},null,8,["rules","schema"]),[[A,l(e)]])]),_:1},8,["modelValue","title"])}}})});export{v as _,L as __tla};
