const e=require("../../_util/raf.js");let t=require("vue");function n(n){let r=(0,t.shallowRef)(n),i,a=(0,t.shallowRef)([]);function o(t){a.value.push(t),e.default.cancel(i),i=e.default(()=>{let e=a.value;a.value=[],e.forEach(e=>{r.value=e(r.value)})})}return(0,t.onBeforeUnmount)(()=>{e.default.cancel(i)}),[r,o]}function r(e){let n=(0,t.ref)(e||null),r=(0,t.ref)();function i(){clearTimeout(r.value)}function a(e){n.value=e,i(),r.value=setTimeout(()=>{n.value=null,r.value=void 0},100)}function o(){return n.value}return(0,t.onBeforeUnmount)(()=>{i()}),[a,o]}exports.useLayoutState=n,exports.useTimeoutLock=r;