const e=require("../../../_util/raf.js");let t=require("vue");function n(n){let r=(0,t.shallowRef)(),i=(0,t.shallowRef)(!1);function a(...t){i.value||(e.default.cancel(r.value),r.value=e.default(()=>{n(...t)}))}return(0,t.onBeforeUnmount)(()=>{i.value=!0,e.default.cancel(r.value)}),a}function r(e){let r=(0,t.shallowRef)([]),i=(0,t.shallowRef)(typeof e==`function`?e():e),a=n(()=>{let e=i.value;r.value.forEach(t=>{e=t(e)}),r.value=[],i.value=e});function o(e){r.value.push(e),a()}return[i,o]}exports.default=n,exports.useRafState=r;