import{e as g,E as C}from"./button-c2afb424.js";import{s as $,a1 as x,I as z,E as V,_}from"./index-3bef6acb.js";import{u as E,E as A}from"./index-51e1cffc.js";import{a0 as D,a2 as P,ap as M,a4 as R,r as U,G as i,o as p,g as c,w as s,a as f,n as a,f as t,a7 as j,al as q,l as S,j as u,t as m,ab as b,h as k,U as G,ai as L}from"./index-25eb6331.js";const F=D({title:String,confirmButtonText:String,cancelButtonText:String,confirmButtonType:{type:String,values:g,default:"primary"},cancelButtonType:{type:String,values:g,default:"text"},icon:{type:$,default:()=>x},iconColor:{type:String,default:"#f90"},hideIcon:{type:Boolean,default:!1},hideAfter:{type:Number,default:200},teleported:E.teleported,persistent:E.persistent,width:{type:[String,Number],default:150}}),H={confirm:o=>o instanceof MouseEvent,cancel:o=>o instanceof MouseEvent},J=P({name:"ElPopconfirm"}),K=P({...J,props:F,emits:H,setup(o,{emit:d}){const r=o,{t:y}=M(),n=R("popconfirm"),B=U(),T=()=>{var e,l;(l=(e=B.value)==null?void 0:e.onClose)==null||l.call(e)},N=i(()=>({width:z(r.width)})),v=e=>{d("confirm",e),T()},h=e=>{d("cancel",e),T()},w=i(()=>r.confirmButtonText||y("el.popconfirm.confirmButtonText")),I=i(()=>r.cancelButtonText||y("el.popconfirm.cancelButtonText"));return(e,l)=>(p(),c(t(A),G({ref_key:"tooltipRef",ref:B,trigger:"click",effect:"light"},e.$attrs,{"popper-class":"".concat(t(n).namespace.value,"-popover"),"popper-style":t(N),teleported:e.teleported,"fallback-placements":["bottom","top","right","left"],"hide-after":e.hideAfter,persistent:e.persistent}),{content:s(()=>[f("div",{class:a(t(n).b())},[f("div",{class:a(t(n).e("main"))},[!e.hideIcon&&e.icon?(p(),c(t(V),{key:0,class:a(t(n).e("icon")),style:j({color:e.iconColor})},{default:s(()=>[(p(),c(q(e.icon)))]),_:1},8,["class","style"])):S("v-if",!0),u(" "+m(e.title),1)],2),f("div",{class:a(t(n).e("action"))},[b(e.$slots,"actions",{confirm:v,cancel:h},()=>[k(t(C),{size:"small",type:e.cancelButtonType==="text"?"":e.cancelButtonType,text:e.cancelButtonType==="text",onClick:h},{default:s(()=>[u(m(t(I)),1)]),_:1},8,["type","text"]),k(t(C),{size:"small",type:e.confirmButtonType==="text"?"":e.confirmButtonType,text:e.confirmButtonType==="text",onClick:v},{default:s(()=>[u(m(t(w)),1)]),_:1},8,["type","text"])])],2)],2)]),default:s(()=>[e.$slots.reference?b(e.$slots,"reference",{key:0}):S("v-if",!0)]),_:3},16,["popper-class","popper-style","teleported","hide-after","persistent"]))}});var O=_(K,[["__file","popconfirm.vue"]]);const Z=L(O);export{Z as E};
