import { jsx as T } from "@emotion/react/jsx-runtime";
import { useState as d } from "react";
function p(t) {
  return (o) => {
    const { isToggled: e, onToggle: g, ...s } = o, [n, l] = d(o.defaultIsPressed || !1);
    return /* @__PURE__ */ T(t, { ...s, onToggle: g !== void 0 ? g : () => l((r) => !r), isToggled: e !== void 0 ? e : n });
  };
}
export {
  p as withToggle
};
