const e=require("../_util/canUseDom.js"),t=require("../_util/classNames.js"),n=require("../_util/props-util/initDefaultProps.js"),r=require("../_util/props-util/index.js"),i=require("../config-provider/hooks/useConfigInject.js"),a=require("../_util/transition.js"),o=require("../_util/hooks/useMergedState.js"),s=require("./interface.js"),c=require("./context.js"),l=require("./style/index.js"),u=require("./FloatButton.js");let d=require("vue"),f=require("@antsoo-lib/icons");var p=(0,d.defineComponent)({compatConfig:{MODE:3},name:`AFloatButtonGroup`,inheritAttrs:!1,props:n.default(s.floatButtonGroupProps(),{type:`default`,shape:`circle`}),setup(n,{attrs:s,slots:p,emit:m}){let{prefixCls:h,direction:g}=i.default(u.floatButtonPrefixCls,n),[_,v]=l.default(h),[y,b]=o.default(!1,{value:(0,d.computed)(()=>n.open)}),x=(0,d.ref)(null),S=(0,d.ref)(null);c.useProvideFloatButtonGroupContext({shape:(0,d.computed)(()=>n.shape)});let C={onMouseenter(){b(!0),m(`update:open`,!0),n.onOpenChange?.(!0)},onMouseleave(){b(!1),m(`update:open`,!1),n.onOpenChange?.(!1)}},w=(0,d.computed)(()=>n.trigger===`hover`?C:{}),T=()=>{let e=!y.value;m(`update:open`,e),n.onOpenChange?.(e),b(e)},E=e=>{if(x.value?.contains(e.target)){r.findDOMNode(S.value)?.contains(e.target)&&T();return}b(!1),m(`update:open`,!1),n.onOpenChange?.(!1)};return(0,d.watch)((0,d.computed)(()=>n.trigger),t=>{e.default()&&(document.removeEventListener(`click`,E),t===`click`&&document.addEventListener(`click`,E))},{immediate:!0}),(0,d.onBeforeUnmount)(()=>{document.removeEventListener(`click`,E)}),()=>{let{shape:e=`circle`,type:r=`default`,tooltip:i,description:o,trigger:c}=n,l=`${h.value}-group`,m=t.default(l,v.value,s.class,{[`${l}-rtl`]:g.value===`rtl`,[`${l}-${e}`]:e,[`${l}-${e}-shadow`]:!c}),b=t.default(v.value,`${l}-wrap`),C=a.getTransitionProps(`${l}-wrap`);return _((0,d.createVNode)(`div`,{ref:x,...s,class:m,...w.value},[c&&[`click`,`hover`].includes(c)?(0,d.createVNode)(d.Fragment,null,[(0,d.createVNode)(d.Transition,C,{default:()=>[(0,d.withDirectives)((0,d.createVNode)(`div`,{class:b},[p.default&&p.default()]),[[d.vShow,y.value]])]}),(0,d.createVNode)(u.default,{ref:S,type:r,shape:e,tooltip:i,description:o},{icon:()=>y.value?p.closeIcon?.()||(0,d.createVNode)(f.CloseOutlined,null,null):p.icon?.()||(0,d.createVNode)(f.FileTextOutlined,null,null),tooltip:p.tooltip,description:p.description})]):p.default?.()]))}}});exports.default=p;