import{F as S,bj as _,b as V,d as B,u as W,c as P,o as d,V as $,S as m,r as k,e as i,f as l,a as h,w as g,B as v,am as y,U as C,L as b,W as w,g as T,T as H,_ as I,i as M}from"./index-5c2cde56.js";import{c as F}from"./el-input-a6be26ea.js";let f;const D=s=>{var a;if(!S)return 0;if(f!==void 0)return f;const o=document.createElement("div");o.className=`${s}-scrollbar__wrap`,o.style.visibility="hidden",o.style.width="100px",o.style.position="absolute",o.style.top="-9999px",document.body.appendChild(o);const n=o.offsetWidth;o.style.overflow="scroll";const e=document.createElement("div");e.style.width="100%",o.appendChild(e);const c=e.offsetWidth;return(a=o.parentNode)==null||a.removeChild(o),f=n-c,f};function G(s,a){if(!S)return;if(!a){s.scrollTop=0;return}const o=[];let n=a.offsetParent;for(;n!==null&&s!==n&&s.contains(n);)o.push(n),n=n.offsetParent;const e=a.offsetTop+o.reduce((t,u)=>t+u.offsetTop,0),c=e+a.offsetHeight,r=s.scrollTop,p=r+s.clientHeight;e<r?s.scrollTop=e:c>p&&(s.scrollTop=c-s.clientHeight)}const J=s=>["",..._].includes(s),R=V({type:{type:String,values:["success","info","warning","danger",""],default:""},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:{type:String,default:""},size:{type:String,values:_,default:""},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),j={close:s=>s instanceof MouseEvent,click:s=>s instanceof MouseEvent},K=B({name:"ElTag"}),L=B({...K,props:R,emits:j,setup(s,{emit:a}){const o=s,n=F(),e=W("tag"),c=P(()=>{const{type:t,hit:u,effect:E,closable:z,round:N}=o;return[e.b(),e.is("closable",z),e.m(t),e.m(n.value),e.m(E),e.is("hit",u),e.is("round",N)]}),r=t=>{a("close",t)},p=t=>{a("click",t)};return(t,u)=>t.disableTransitions?(d(),$("span",{key:0,class:i(l(c)),style:T({backgroundColor:t.color}),onClick:p},[m("span",{class:i(l(e).e("content"))},[k(t.$slots,"default")],2),t.closable?(d(),h(l(b),{key:0,class:i(l(e).e("close")),onClick:C(r,["stop"])},{default:g(()=>[v(l(y))]),_:1},8,["class","onClick"])):w("v-if",!0)],6)):(d(),h(H,{key:1,name:`${l(e).namespace.value}-zoom-in-center`,appear:""},{default:g(()=>[m("span",{class:i(l(c)),style:T({backgroundColor:t.color}),onClick:p},[m("span",{class:i(l(e).e("content"))},[k(t.$slots,"default")],2),t.closable?(d(),h(l(b),{key:0,class:i(l(e).e("close")),onClick:C(r,["stop"])},{default:g(()=>[v(l(y))]),_:1},8,["class","onClick"])):w("v-if",!0)],6)]),_:3},8,["name"]))}});var U=I(L,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tag/src/tag.vue"]]);const O=M(U);export{O as E,D as g,J as i,G as s,R as t};
