const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../config-provider/hooks/useConfigInject.js"),r=require("../_util/vue-types/index.js"),i=require("../_util/colors.js"),a=require("../_util/wave/index.js"),o=require("./style/index.js"),s=require("./CheckableTag.js");let c=require("vue"),l=require("@antsoo-lib/icons");var u=()=>({prefixCls:String,color:{type:String},closable:{type:Boolean,default:!1},closeIcon:r.default.any,visible:{type:Boolean,default:void 0},onClose:{type:Function},onClick:e.eventType(),"onUpdate:visible":Function,icon:r.default.any,bordered:{type:Boolean,default:!0}}),d=(0,c.defineComponent)({compatConfig:{MODE:3},name:`ATag`,inheritAttrs:!1,props:u(),slots:Object,setup(e,{slots:r,emit:s,attrs:u}){let{prefixCls:d,direction:f}=n.default(`tag`,e),[p,m]=o.default(d),h=(0,c.shallowRef)(!0);(0,c.watchEffect)(()=>{e.visible!==void 0&&(h.value=e.visible)});let g=t=>{t.stopPropagation(),s(`update:visible`,!1),s(`close`,t),!t.defaultPrevented&&e.visible===void 0&&(h.value=!1)},_=(0,c.computed)(()=>i.isPresetColor(e.color)||i.isPresetStatusColor(e.color)),v=(0,c.computed)(()=>t.default(d.value,m.value,{[`${d.value}-${e.color}`]:_.value,[`${d.value}-has-color`]:e.color&&!_.value,[`${d.value}-hidden`]:!h.value,[`${d.value}-rtl`]:f.value===`rtl`,[`${d.value}-borderless`]:!e.bordered})),y=e=>{s(`click`,e)};return()=>{let{icon:t=r.icon?.(),color:n,closeIcon:i=r.closeIcon?.(),closable:o=!1}=e,s=()=>o?i?(0,c.createVNode)(`span`,{class:`${d.value}-close-icon`,onClick:g},[i]):(0,c.createVNode)(l.CloseOutlined,{class:`${d.value}-close-icon`,onClick:g},null):null,f={backgroundColor:n&&!_.value?n:void 0},m=t||null,h=r.default?.(),b=m?(0,c.createVNode)(c.Fragment,null,[m,(0,c.createVNode)(`span`,null,[h])]):h,x=e.onClick!==void 0,S=(0,c.createVNode)(`span`,{...u,onClick:y,class:[v.value,u.class],style:[f,u.style]},[b,s()]);return p(x?(0,c.createVNode)(a.default,null,{default:()=>[S]}):S)}}});d.CheckableTag=s.default,d.install=function(e){return e.component(d.name,d),e.component(s.default.name,s.default),e},exports.CheckableTag=s.default,exports.default=d,exports.tagProps=u;