"use client";
let react = require("react");
//#region packages/@mantine/hooks/src/use-uncontrolled/use-uncontrolled.ts
function useUncontrolled({ value, defaultValue, finalValue, onChange = () => {} }) {
	const [uncontrolledValue, setUncontrolledValue] = (0, react.useState)(defaultValue !== void 0 ? defaultValue : finalValue);
	const handleUncontrolledChange = (val, ...payload) => {
		setUncontrolledValue(val);
		onChange?.(val, ...payload);
	};
	if (value !== void 0) return [
		value,
		onChange,
		true
	];
	return [
		uncontrolledValue,
		handleUncontrolledChange,
		false
	];
}
//#endregion
exports.useUncontrolled = useUncontrolled;

//# sourceMappingURL=use-uncontrolled.cjs.map