"use client";
import { f as e } from "./useRenderElement-CmuWsiNa.js";
import { t } from "./useOnMount-Dirf6DNj.js";
//#region ../../node_modules/.bun/@base-ui+utils@0.2.9+f7941a290aa3d619/node_modules/@base-ui/utils/esm/useAnimationFrame.js
var n = null, r = globalThis.requestAnimationFrame, i = new class {
	callbacks = [];
	callbacksCount = 0;
	nextId = 1;
	startId = 1;
	isScheduled = !1;
	tick = (e) => {
		this.isScheduled = !1;
		let t = this.callbacks, n = this.callbacksCount;
		if (this.callbacks = [], this.callbacksCount = 0, this.startId = this.nextId, n > 0) for (let n = 0; n < t.length; n += 1) t[n]?.(e);
	};
	request(e) {
		let t = this.nextId;
		this.nextId += 1, this.callbacks.push(e), this.callbacksCount += 1;
		let n = process.env.NODE_ENV !== "production" && r !== requestAnimationFrame && (r = requestAnimationFrame, !0);
		return (!this.isScheduled || n) && (requestAnimationFrame(this.tick), this.isScheduled = !0), t;
	}
	cancel(e) {
		let t = e - this.startId;
		t < 0 || t >= this.callbacks.length || (this.callbacks[t] = null, --this.callbacksCount);
	}
}(), a = class e {
	static create() {
		return new e();
	}
	static request(e) {
		return i.request(e);
	}
	static cancel(e) {
		return i.cancel(e);
	}
	currentId = n;
	request(e) {
		this.cancel(), this.currentId = i.request(() => {
			this.currentId = n, e();
		});
	}
	cancel = () => {
		this.currentId !== n && (i.cancel(this.currentId), this.currentId = n);
	};
	disposeEffect = () => this.cancel;
};
function o() {
	let n = e(a.create).current;
	return t(n.disposeEffect), n;
}
//#endregion
export { o as n, a as t };
