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