import{shallowRef as r,onBeforeUnmount as i,ref as f}from"vue";import l from"../../_util/raf.mjs";function p(c){const e=r(c);let t;const a=r([]);function u(n){a.value.push(n),l.cancel(t),t=l(()=>{const o=a.value;a.value=[],o.forEach(s=>{e.value=s(e.value)})})}return i(()=>{l.cancel(t)}),[e,u]}function R(c){const e=f(null),t=f();function a(){clearTimeout(t.value)}function u(o){e.value=o,a(),t.value=setTimeout(()=>{e.value=null,t.value=void 0},100)}function n(){return e.value}return i(()=>{a()}),[u,n]}export{p as useLayoutState,R as useTimeoutLock};
