import{w as B,J as g}from"./element-plus.9175fe58.js";import{d as k,r as C,n as S,D as T,o as s,c as f,a as b,J as m,W as w,a9 as $,O as a,T as d,U as r,M as y,S as u}from"./@vue.c3e77981.js";import{d as E}from"./index.026c5631.js";const V=k({props:{title:{type:String,default:""},content:{type:String,default:""},confirmButtonText:{type:[String,Boolean],default:"\u786E\u5B9A"},cancelButtonText:{type:[String,Boolean],default:"\u53D6\u6D88"},width:{type:String,default:"400px"},disabled:{type:Boolean,default:!1},async:{type:Boolean,default:!1},clickModalClose:{type:Boolean,default:!0},center:{type:Boolean,default:!1},showFooter:{type:Boolean,default:!0},customClass:{type:String,default:""}},emits:["confirm","cancel","close","open"],setup(e,{emit:o}){const t=C(!1),c=n=>{o(n),(!e.async||n==="cancel")&&i()},i=()=>{t.value=!1,S(()=>{o("close")})},p=()=>{e.disabled||(o("open"),t.value=!0)};return T("visible",t),{visible:t,handleEvent:c,close:i,open:p}}});const h={class:"dialog"},D={key:0,class:"dialog-footer"};function _(e,o,t,c,i,p){const n=B,v=g;return s(),f("div",h,[b("div",{class:"dialog__trigger",onClick:o[0]||(o[0]=(...l)=>e.open&&e.open(...l))},[m(e.$slots,"trigger",{},void 0,!0)]),w(v,{modelValue:e.visible,"onUpdate:modelValue":o[3]||(o[3]=l=>e.visible=l),"custom-class":e.customClass,center:e.center,"append-to-body":!0,width:e.width,"close-on-click-modal":e.clickModalClose,onClosed:e.close},$({footer:a(()=>[e.showFooter?(s(),f("div",D,[e.cancelButtonText?(s(),y(n,{key:0,onClick:o[1]||(o[1]=l=>e.handleEvent("cancel"))},{default:a(()=>[d(r(e.cancelButtonText),1)]),_:1})):u("",!0),e.confirmButtonText?(s(),y(n,{key:1,type:"primary",onClick:o[2]||(o[2]=l=>e.handleEvent("confirm"))},{default:a(()=>[d(r(e.confirmButtonText),1)]),_:1})):u("",!0)])):u("",!0)]),default:a(()=>[m(e.$slots,"default",{},()=>[d(r(e.content),1)],!0)]),_:2},[e.title?{name:"header",fn:a(()=>[d(r(e.title),1)]),key:"0"}:void 0]),1032,["modelValue","custom-class","center","width","close-on-click-modal","onClosed"])])}const J=E(V,[["render",_],["__scopeId","data-v-71eeedc7"]]);export{J as P};