"use strict";const n=require("./useOpenChangeComplete-Dk-u_f2y.js"),o=require("react");function d(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(i,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return i.default=e,Object.freeze(i)}const c=d(o);function m(e){return n.useId(e,"base-ui")}function g(e,i=!1,r=!1){const[t,s]=c.useState(e&&i?"idle":void 0),[u,f]=c.useState(e);return e&&!u&&(f(!0),s("starting")),!e&&u&&t!=="ending"&&!r&&s("ending"),!e&&!u&&t==="ending"&&s(void 0),n.useIsoLayoutEffect(()=>{if(!e&&u&&t!=="ending"&&r){const a=n.AnimationFrame.request(()=>{s("ending")});return()=>{n.AnimationFrame.cancel(a)}}},[e,u,t,r]),n.useIsoLayoutEffect(()=>{if(!e||i)return;const a=n.AnimationFrame.request(()=>{s(void 0)});return()=>{n.AnimationFrame.cancel(a)}},[i,e]),n.useIsoLayoutEffect(()=>{if(!e||!i)return;e&&u&&t!=="idle"&&s("starting");const a=n.AnimationFrame.request(()=>{s("idle")});return()=>{n.AnimationFrame.cancel(a)}},[i,e,u,s,t]),c.useMemo(()=>({mounted:u,setMounted:f,transitionStatus:t}),[u,t])}exports.useBaseUiId=m;exports.useTransitionStatus=g;
//# sourceMappingURL=useTransitionStatus-CqbEyvIj.js.map
