import{slicedToArray as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{useState as r,useCallback as o,useEffect as c}from"react";function n(n){var t=n.checked,i=n.defaultChecked,a=n.onChange,d=r(void 0===t?i||!1:t),u=e(d,2),l=u[0],f=u[1],h=o((function(e){void 0===t&&f(!l),a(e.currentTarget.checked)}),[t,a,l]);return c((function(){void 0!==t&&f(t)}),[t]),{checked:l,onChange:h}}export{n as useSwitchChecked};
