import { flushSync } from "react-dom";
// Use the browser's View Transitions API to cross-fade DOM changes when
// available; falls back to a plain call otherwise. flushSync forces React to
// commit the state update synchronously so the browser can snapshot the new
// DOM before animating.
export function startViewTransition(update) {
    const doc = typeof document !== "undefined" ? document : null;
    if (doc && typeof doc.startViewTransition === "function") {
        doc.startViewTransition(() => {
            flushSync(update);
        });
    }
    else {
        update();
    }
}
//# sourceMappingURL=viewTransition.js.map