{"version":3,"file":"Radio.mjs","sources":["../../../../../../../../node_modules/@mui/material/Radio/Radio.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport refType from '@mui/utils/refType';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { alpha } from '@mui/system/colorManipulator';\nimport SwitchBase from \"../internal/SwitchBase.js\";\nimport RadioButtonIcon from \"./RadioButtonIcon.js\";\nimport capitalize from \"../utils/capitalize.js\";\nimport createChainedFunction from \"../utils/createChainedFunction.js\";\nimport useFormControl from \"../FormControl/useFormControl.js\";\nimport useRadioGroup from \"../RadioGroup/useRadioGroup.js\";\nimport radioClasses, { getRadioUtilityClass } from \"./radioClasses.js\";\nimport rootShouldForwardProp from \"../styles/rootShouldForwardProp.js\";\nimport { styled } from \"../zero-styled/index.js\";\nimport memoTheme from \"../utils/memoTheme.js\";\nimport createSimplePaletteValueFilter from \"../utils/createSimplePaletteValueFilter.js\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n  const {\n    classes,\n    color,\n    size\n  } = ownerState;\n  const slots = {\n    root: ['root', `color${capitalize(color)}`, size !== 'medium' && `size${capitalize(size)}`]\n  };\n  return {\n    ...classes,\n    ...composeClasses(slots, getRadioUtilityClass, classes)\n  };\n};\nconst RadioRoot = styled(SwitchBase, {\n  shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',\n  name: 'MuiRadio',\n  slot: 'Root',\n  overridesResolver: (props, styles) => {\n    const {\n      ownerState\n    } = props;\n    return [styles.root, ownerState.size !== 'medium' && styles[`size${capitalize(ownerState.size)}`], styles[`color${capitalize(ownerState.color)}`]];\n  }\n})(memoTheme(({\n  theme\n}) => ({\n  color: (theme.vars || theme).palette.text.secondary,\n  [`&.${radioClasses.disabled}`]: {\n    color: (theme.vars || theme).palette.action.disabled\n  },\n  variants: [{\n    props: {\n      color: 'default',\n      disabled: false,\n      disableRipple: false\n    },\n    style: {\n      '&:hover': {\n        backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity)\n      }\n    }\n  }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({\n    props: {\n      color,\n      disabled: false,\n      disableRipple: false\n    },\n    style: {\n      '&:hover': {\n        backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)\n      }\n    }\n  })), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({\n    props: {\n      color,\n      disabled: false\n    },\n    style: {\n      [`&.${radioClasses.checked}`]: {\n        color: (theme.vars || theme).palette[color].main\n      }\n    }\n  })), {\n    // Should be last to override other colors\n    props: {\n      disableRipple: false\n    },\n    style: {\n      // Reset on touch devices, it doesn't add specificity\n      '&:hover': {\n        '@media (hover: none)': {\n          backgroundColor: 'transparent'\n        }\n      }\n    }\n  }]\n})));\nfunction areEqualValues(a, b) {\n  if (typeof b === 'object' && b !== null) {\n    return a === b;\n  }\n\n  // The value could be a number, the DOM will stringify it anyway.\n  return String(a) === String(b);\n}\nconst defaultCheckedIcon = /*#__PURE__*/_jsx(RadioButtonIcon, {\n  checked: true\n});\nconst defaultIcon = /*#__PURE__*/_jsx(RadioButtonIcon, {});\nconst Radio = /*#__PURE__*/React.forwardRef(function Radio(inProps, ref) {\n  const props = useDefaultProps({\n    props: inProps,\n    name: 'MuiRadio'\n  });\n  const {\n    checked: checkedProp,\n    checkedIcon = defaultCheckedIcon,\n    color = 'primary',\n    icon = defaultIcon,\n    name: nameProp,\n    onChange: onChangeProp,\n    size = 'medium',\n    className,\n    disabled: disabledProp,\n    disableRipple = false,\n    ...other\n  } = props;\n  const muiFormControl = useFormControl();\n  let disabled = disabledProp;\n  if (muiFormControl) {\n    if (typeof disabled === 'undefined') {\n      disabled = muiFormControl.disabled;\n    }\n  }\n  disabled ??= false;\n  const ownerState = {\n    ...props,\n    disabled,\n    disableRipple,\n    color,\n    size\n  };\n  const classes = useUtilityClasses(ownerState);\n  const radioGroup = useRadioGroup();\n  let checked = checkedProp;\n  const onChange = createChainedFunction(onChangeProp, radioGroup && radioGroup.onChange);\n  let name = nameProp;\n  if (radioGroup) {\n    if (typeof checked === 'undefined') {\n      checked = areEqualValues(radioGroup.value, props.value);\n    }\n    if (typeof name === 'undefined') {\n      name = radioGroup.name;\n    }\n  }\n  return /*#__PURE__*/_jsx(RadioRoot, {\n    type: \"radio\",\n    icon: /*#__PURE__*/React.cloneElement(icon, {\n      fontSize: defaultIcon.props.fontSize ?? size\n    }),\n    checkedIcon: /*#__PURE__*/React.cloneElement(checkedIcon, {\n      fontSize: defaultCheckedIcon.props.fontSize ?? size\n    }),\n    disabled: disabled,\n    ownerState: ownerState,\n    classes: classes,\n    name: name,\n    checked: checked,\n    onChange: onChange,\n    ref: ref,\n    className: clsx(classes.root, className),\n    ...other\n  });\n});\nprocess.env.NODE_ENV !== \"production\" ? Radio.propTypes /* remove-proptypes */ = {\n  // ┌────────────────────────────── Warning ──────────────────────────────┐\n  // │ These PropTypes are generated from the TypeScript type definitions. │\n  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │\n  // └─────────────────────────────────────────────────────────────────────┘\n  /**\n   * If `true`, the component is checked.\n   */\n  checked: PropTypes.bool,\n  /**\n   * The icon to display when the component is checked.\n   * @default <RadioButtonIcon checked />\n   */\n  checkedIcon: PropTypes.node,\n  /**\n   * Override or extend the styles applied to the component.\n   */\n  classes: PropTypes.object,\n  /**\n   * @ignore\n   */\n  className: PropTypes.string,\n  /**\n   * The color of the component.\n   * It supports both default and custom theme colors, which can be added as shown in the\n   * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n   * @default 'primary'\n   */\n  color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n  /**\n   * If `true`, the component is disabled.\n   */\n  disabled: PropTypes.bool,\n  /**\n   * If `true`, the ripple effect is disabled.\n   * @default false\n   */\n  disableRipple: PropTypes.bool,\n  /**\n   * The icon to display when the component is unchecked.\n   * @default <RadioButtonIcon />\n   */\n  icon: PropTypes.node,\n  /**\n   * The id of the `input` element.\n   */\n  id: PropTypes.string,\n  /**\n   * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n   */\n  inputProps: PropTypes.object,\n  /**\n   * Pass a ref to the `input` element.\n   */\n  inputRef: refType,\n  /**\n   * Name attribute of the `input` element.\n   */\n  name: PropTypes.string,\n  /**\n   * Callback fired when the state is changed.\n   *\n   * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.\n   * You can pull out the new value by accessing `event.target.value` (string).\n   * You can pull out the new checked state by accessing `event.target.checked` (boolean).\n   */\n  onChange: PropTypes.func,\n  /**\n   * If `true`, the `input` element is required.\n   * @default false\n   */\n  required: PropTypes.bool,\n  /**\n   * The size of the component.\n   * `small` is equivalent to the dense radio styling.\n   * @default 'medium'\n   */\n  size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),\n  /**\n   * The system prop that allows defining system overrides as well as additional CSS styles.\n   */\n  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n  /**\n   * The value of the component. The DOM API casts this to a string.\n   */\n  value: PropTypes.any\n} : void 0;\nexport default Radio;"],"names":["useUtilityClasses","areEqualValues","_jsx","Radio","React.forwardRef","React.cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAMA,mBAAiB,GAAG,UAAU,IAAI;AACxC,EAAE,MAAM;AACR,IAAI,OA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