import { o as i } from "./rolldown-runtime.js";
import { i as l } from "./vendor/react.js";
var e = /* @__PURE__ */ i(l());
function p({ controlled: t, default: r, name: n, state: c = "value" }) {
  const { current: a } = e.useRef(t !== void 0), [o, s] = e.useState(r);
  return [a ? t : o, e.useCallback((u) => {
    a || s(u);
  }, [])];
}
export {
  p as t
};

//# sourceMappingURL=useControlled.js.map