const e=require("./HookNotification.js");let t=require("vue");var n=()=>document.body,r=0;function i(...e){let t={};return e.forEach(e=>{e&&Object.keys(e).forEach(n=>{let r=e[n];r!==void 0&&(t[n]=r)})}),t}function a(a={}){let{getContainer:o=n,motion:s,prefixCls:c,maxCount:l,getClassName:u,getStyles:d,onAllRemoved:f,...p}=a,m=(0,t.shallowRef)([]),h=(0,t.shallowRef)(),g=(t,n)=>{let r=t.key||e.getUuid(),i={...t,key:r},a=m.value.map(e=>e.notice.key).indexOf(r),o=m.value.concat();a===-1?(l&&m.value.length>=l&&(i.key=o[0].notice.key,i.updateMark=e.getUuid(),i.userPassKey=r,o.shift()),o.push({notice:i,holderCallback:n})):o.splice(a,1,{notice:i,holderCallback:n}),m.value=o},_=e=>{m.value=m.value.filter(({notice:{key:t,userPassKey:n}})=>(n||t)!==e)},v=()=>{m.value=[]},y=()=>(0,t.createVNode)(e.default,{ref:h,prefixCls:c,maxCount:l,notices:m.value,remove:_,getClassName:u,getStyles:d,animation:s,hashId:a.hashId,onAllRemoved:f,getContainer:o},null),b=(0,t.shallowRef)([]);return(0,t.watch)(b,()=>{b.value.length&&(b.value.forEach(e=>{switch(e.type){case`open`:g(e.config);break;case`close`:_(e.key);break;case`destroy`:v();break}}),b.value=[])}),[{open:e=>{let t=i(p,e);(t.key===null||t.key===void 0)&&(t.key=`vc-notification-${r}`,r+=1),b.value=[...b.value,{type:`open`,config:t}]},close:e=>{b.value=[...b.value,{type:`close`,key:e}]},destroy:()=>{b.value=[...b.value,{type:`destroy`}]}},y]}exports.default=a;