import{A as e,B as t,C as n,H as r,R as i,Z as a,t as o}from"./icon-K_9KhGme.js";import{A as s,B as c,C as l,Dt as u,K as d,Ot as f,Q as p,S as m,Tt as h,U as g,_,g as v,h as y,ot as b,pt as x,v as S,w as C}from"./vue.esm-bundler-DcNPjsgv.js";import{a as w,i as T,r as E}from"./css-B9Va6QAv.js";import{a as D}from"./icon-DARh_Gl7.js";import{r as O,t as k}from"./button-_eWW8JXC.js";/* empty css             */import"./css-DLir5tDM.js";var A=e(C({name:`ElPopconfirm`,__name:`popconfirm`,props:a({title:String,confirmButtonText:String,cancelButtonText:String,confirmButtonType:{type:String,values:O,default:`primary`},cancelButtonType:{type:String,values:O,default:`text`},icon:{type:D,default:()=>n},iconColor:{type:String,default:`#f90`},hideIcon:Boolean,hideAfter:{type:Number,default:200},effect:{...w.effect,default:`light`},teleported:w.teleported,persistent:w.persistent,width:{type:[String,Number],default:150},virtualTriggering:T.virtualTriggering,virtualRef:T.virtualRef}),emits:{confirm:e=>e instanceof MouseEvent,cancel:e=>e instanceof MouseEvent},setup(e,{expose:n,emit:a}){let C=e,w=a,{t:T}=t(),D=i(`popconfirm`),O=b(),A=b(),j=y(()=>x(O)?.popperRef),M=()=>{A.value?.focus?.()},N=()=>{O.value?.onClose?.()},P=y(()=>({width:r(C.width)})),F=e=>{w(`confirm`,e),N()},I=e=>{w(`cancel`,e),N()},L=y(()=>C.confirmButtonText||T(`el.popconfirm.confirmButtonText`)),R=y(()=>C.cancelButtonText||T(`el.popconfirm.cancelButtonText`));return n({popperRef:j,hide:N}),(t,n)=>(c(),_(x(E),s({ref_key:`tooltipRef`,ref:O,trigger:`click`,effect:e.effect},t.$attrs,{"virtual-triggering":e.virtualTriggering,"virtual-ref":e.virtualRef,"popper-class":`${x(D).namespace.value}-popover`,"popper-style":P.value,teleported:e.teleported,"fallback-placements":[`bottom`,`top`,`right`,`left`],"hide-after":e.hideAfter,persistent:e.persistent,loop:``,onShow:M}),{content:p(()=>[v(`div`,{ref_key:`rootRef`,ref:A,tabindex:`-1`,class:h(x(D).b())},[v(`div`,{class:h(x(D).e(`main`))},[!e.hideIcon&&e.icon?(c(),_(x(o),{key:0,class:h(x(D).e(`icon`)),style:u({color:e.iconColor})},{default:p(()=>[(c(),_(d(e.icon)))]),_:1},8,[`class`,`style`])):S(`v-if`,!0),m(` `+f(e.title),1)],2),v(`div`,{class:h(x(D).e(`action`))},[g(t.$slots,`actions`,{confirm:F,cancel:I},()=>[l(x(k),{size:`small`,type:e.cancelButtonType===`text`?``:e.cancelButtonType,text:e.cancelButtonType===`text`,onClick:I},{default:p(()=>[m(f(R.value),1)]),_:1},8,[`type`,`text`]),l(x(k),{size:`small`,type:e.confirmButtonType===`text`?``:e.confirmButtonType,text:e.confirmButtonType===`text`,onClick:F},{default:p(()=>[m(f(L.value),1)]),_:1},8,[`type`,`text`])])],2)],2)]),default:p(()=>[t.$slots.reference?g(t.$slots,`reference`,{key:0}):S(`v-if`,!0)]),_:3},16,[`effect`,`virtual-triggering`,`virtual-ref`,`popper-class`,`popper-style`,`teleported`,`hide-after`,`persistent`]))}}));export{A as t};