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