import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";import _extends from"@babel/runtime/helpers/esm/extends";import React from"react";import PropTypes from"prop-types";import clsx from"clsx";import withStyles from"../styles/withStyles";import ButtonBase from"../ButtonBase";import capitalize from"../utils/capitalize";import unsupportedProp from"../utils/unsupportedProp";export const styles=e=>({root:_extends({},e.typography.button,{maxWidth:264,minWidth:72,position:"relative",boxSizing:"border-box",minHeight:48,flexShrink:0,padding:"6px 12px",[e.breakpoints.up("sm")]:{padding:"6px 24px"},overflow:"hidden",whiteSpace:"normal",textAlign:"center",[e.breakpoints.up("sm")]:{minWidth:160}}),labelIcon:{minHeight:72,paddingTop:9,"& $wrapper > *:first-child":{marginBottom:6}},textColorInherit:{color:"inherit",opacity:.7,"&$selected":{opacity:1},"&$disabled":{opacity:.5}},textColorPrimary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled}},textColorSecondary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.text.disabled}},selected:{},disabled:{},fullWidth:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},wrapped:{fontSize:e.typography.pxToRem(12),lineHeight:1.5},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"}});const Tab=React.forwardRef(function(e,o){const{classes:t,className:r,disabled:i=!1,disableFocusRipple:l=!1,fullWidth:p,icon:s,indicator:a,label:n,onChange:d,onClick:c,selected:m,textColor:b="inherit",value:y,wrapped:u=!1}=e,h=_objectWithoutPropertiesLoose(e,["classes","className","disabled","disableFocusRipple","fullWidth","icon","indicator","label","onChange","onClick","selected","textColor","value","wrapped"]);return React.createElement(ButtonBase,_extends({focusRipple:!l,className:clsx(t.root,t[`textColor${capitalize(b)}`],r,i&&t.disabled,m&&t.selected,n&&s&&t.labelIcon,p&&t.fullWidth,u&&t.wrapped),ref:o,role:"tab","aria-selected":m,disabled:i,onClick:e=>{d&&d(e,y),c&&c(e)}},h),React.createElement("span",{className:t.wrapper},s,n),a)});"production"!==process.env.NODE_ENV&&(Tab.propTypes={children:unsupportedProp,classes:PropTypes.object.isRequired,className:PropTypes.string,disabled:PropTypes.bool,disableFocusRipple:PropTypes.bool,disableRipple:PropTypes.bool,fullWidth:PropTypes.bool,icon:PropTypes.node,indicator:PropTypes.node,label:PropTypes.node,onChange:PropTypes.func,onClick:PropTypes.func,selected:PropTypes.bool,textColor:PropTypes.oneOf(["secondary","primary","inherit"]),value:PropTypes.any,wrapped:PropTypes.bool});export default withStyles(styles,{name:"MuiTab"})(Tab);