const e=require("../../_util/raf.js");let t=require("vue");var n=[`measure`,`align`,null,`motion`],r=(r,i)=>{let a=(0,t.shallowRef)(null),o=(0,t.shallowRef)(),s=(0,t.shallowRef)(!1);function c(e){s.value||(a.value=e)}function l(){e.default.cancel(o.value)}function u(t){l(),o.value=e.default(()=>{let e=a.value;switch(a.value){case`align`:e=`motion`;break;case`motion`:e=`stable`;break;default:}c(e),t?.()})}return(0,t.watch)(r,()=>{c(`measure`)},{immediate:!0,flush:`post`}),(0,t.onMounted)(()=>{(0,t.watch)(a,()=>{switch(a.value){case`measure`:i();break;default:}a.value&&(o.value=e.default(async()=>{let e=n.indexOf(a.value),t=n[e+1];t&&e!==-1&&c(t)}))},{immediate:!0,flush:`post`})}),(0,t.onBeforeUnmount)(()=>{s.value=!0,l()}),[a,u]};exports.default=r;