import{aT as A,a8 as R,ci as r,aw as d,cj as f,X as U,at as $,ah as p,cb as D,by as K,bT as u,a0 as O,bs as c,al as V,ct as v,bC as b,am as m,an as H,bj as j,bO as g,ap as I,bf as L,H as z,cv as F,cw as X}from"./index-BVAEVuZQ.js";const q=R({trigger:f.trigger,triggerKeys:f.triggerKeys,placement:d.placement,disabled:f.disabled,visible:r.visible,transition:r.transition,popperOptions:d.popperOptions,tabindex:d.tabindex,content:r.content,popperStyle:r.popperStyle,popperClass:r.popperClass,enterable:{...r.enterable,default:!0},effect:{...r.effect,default:"light"},teleported:r.teleported,appendTo:r.appendTo,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),G={"update:visible":t=>A(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},J="onUpdate:visible",M=$({name:"ElPopover",__name:"popover",props:q,emits:G,setup(t,{expose:a,emit:n}){const o=t,s=n,w=p(()=>o[J]),i=D("popover"),l=K(),y=p(()=>{var e;return(e=u(l))==null?void 0:e.popperRef}),C=p(()=>[{width:O(o.width)},o.popperStyle]),P=p(()=>[i.b(),o.popperClass,{[i.m("plain")]:!!o.content}]),k=p(()=>o.transition===`${i.namespace.value}-fade-in-linear`),E=()=>{var e;(e=l.value)==null||e.hide()},T=()=>{s("before-enter")},S=()=>{s("before-leave")},B=()=>{s("after-enter")},N=()=>{s("update:visible",!1),s("after-leave")};return a({popperRef:y,hide:E}),(e,_)=>(c(),V(u(z),L({ref_key:"tooltipRef",ref:l},e.$attrs,{trigger:e.trigger,"trigger-keys":e.triggerKeys,placement:e.placement,disabled:e.disabled,visible:e.visible,transition:e.transition,"popper-options":e.popperOptions,tabindex:e.tabindex,content:e.content,offset:e.offset,"show-after":e.showAfter,"hide-after":e.hideAfter,"auto-close":e.autoClose,"show-arrow":e.showArrow,"aria-label":e.title,effect:e.effect,enterable:e.enterable,"popper-class":P.value,"popper-style":C.value,teleported:e.teleported,"append-to":e.appendTo,persistent:e.persistent,"gpu-acceleration":k.value,"onUpdate:visible":w.value,onBeforeShow:T,onBeforeHide:S,onShow:B,onHide:N}),{content:v(()=>[e.title?(c(),H("div",{key:0,class:j(u(i).e("title")),role:"title"},g(e.title),3)):m("v-if",!0),b(e.$slots,"default",{},()=>[I(g(e.content),1)])]),default:v(()=>[e.$slots.reference?b(e.$slots,"reference",{key:0}):m("v-if",!0)]),_:3},16,["trigger","trigger-keys","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","append-to","persistent","gpu-acceleration","onUpdate:visible"]))}});var Q=U(M,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popover/src/popover.vue"]]);const h=(t,a)=>{const n=a.arg||a.value,o=n?.popperRef;o&&(o.triggerRef=t)};var W={mounted(t,a){h(t,a)},updated(t,a){h(t,a)}};const Y="popover",Z=X(W,Y),ee=F(Q,{directive:Z});export{ee as E};
