import e from"../_util/classNames.mjs";import t from"../config-provider/hooks/useConfigInject.mjs";import n from"../vc-notification/useNotification.mjs";import r from"./style/index.mjs";import{PureContent as i,getCloseIcon as a}from"./PurePanel.mjs";import{getMotion as o,getPlacementStyle as s}from"./util.mjs";import{computed as c,createVNode as l,defineComponent as u,shallowRef as d}from"vue";var f=24,p=4.5,m=u({name:`Holder`,inheritAttrs:!1,props:[`prefixCls`,`class`,`type`,`icon`,`content`,`onAllRemoved`],setup(i,{expose:l}){let{getPrefixCls:u,getPopupContainer:d}=t(`notification`,i),m=c(()=>i.prefixCls||u(`notification`)),h=e=>s(e,i.top??f,i.bottom??f),[,g]=r(m),[_,v]=n({prefixCls:m.value,getStyles:h,getClassName:()=>e(g.value,{[`${m.value}-rtl`]:i.rtl}),motion:()=>o(m.value),closable:!0,closeIcon:a(m.value),duration:p,getContainer:()=>i.getPopupContainer?.()||d.value?.()||document.body,maxCount:i.maxCount,hashId:g.value,onAllRemoved:i.onAllRemoved});return l({..._,prefixCls:m.value,hashId:g}),v}});function h(t){let n=d(null),r=Symbol(`notificationHolderKey`),a=t=>{if(!n.value)return;let{open:r,prefixCls:a,hashId:o}=n.value,s=`${a}-notice`,{message:c,description:u,icon:d,type:f,btn:p,class:m,...h}=t;return r({placement:`topRight`,...h,content:()=>l(i,{prefixCls:s,icon:typeof d==`function`?d():d,type:f,message:typeof c==`function`?c():c,description:typeof u==`function`?u():u,btn:typeof p==`function`?p():p},null),class:e(f&&`${s}-${f}`,o,m)})},o={open:a,destroy:e=>{e===void 0?n.value?.destroy():n.value?.close(e)}};return[`success`,`info`,`warning`,`error`].forEach(e=>{o[e]=t=>a({...t,type:e})}),[o,()=>l(m,{key:r,...t,ref:n},null)]}function g(e){return h(e)}export{g as default,h as useInternalNotification};