"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")),React=_interopRequireWildcard(require("react")),_propTypes=_interopRequireDefault(require("prop-types")),_clsx=_interopRequireDefault(require("clsx")),_withStyles=_interopRequireDefault(require("../styles/withStyles")),_capitalize=_interopRequireDefault(require("../utils/capitalize")),styles=function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}};exports.styles=styles;var defaultVariantMapping={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},Typography=React.forwardRef(function(e,t){var r=e.align,a=void 0===r?"inherit":r,i=e.classes,o=e.className,p=e.color,l=void 0===p?"initial":p,n=e.component,s=e.display,y=void 0===s?"initial":s,u=e.gutterBottom,h=void 0!==u&&u,d=e.noWrap,c=void 0!==d&&d,f=e.paragraph,g=void 0!==f&&f,b=e.variant,_=void 0===b?"body1":b,m=e.variantMapping,v=void 0===m?defaultVariantMapping:m,x=(0,_objectWithoutProperties2.default)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),q=n||(g?"p":v[_]||defaultVariantMapping[_])||"span";return React.createElement(q,(0,_extends2.default)({className:(0,_clsx.default)(i.root,o,"inherit"!==_&&i[_],"initial"!==l&&i["color".concat((0,_capitalize.default)(l))],c&&i.noWrap,h&&i.gutterBottom,g&&i.paragraph,"inherit"!==a&&i["align".concat((0,_capitalize.default)(a))],"initial"!==y&&i["display".concat((0,_capitalize.default)(y))]),ref:t},x))});"production"!==process.env.NODE_ENV&&(Typography.propTypes={align:_propTypes.default.oneOf(["inherit","left","center","right","justify"]),children:_propTypes.default.node,classes:_propTypes.default.object.isRequired,className:_propTypes.default.string,color:_propTypes.default.oneOf(["initial","inherit","primary","secondary","textPrimary","textSecondary","error"]),component:_propTypes.default.elementType,display:_propTypes.default.oneOf(["initial","block","inline"]),gutterBottom:_propTypes.default.bool,noWrap:_propTypes.default.bool,paragraph:_propTypes.default.bool,variant:_propTypes.default.oneOf(["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline","srOnly","inherit"]),variantMapping:_propTypes.default.object});var _default=(0,_withStyles.default)(styles,{name:"MuiTypography"})(Typography);exports.default=_default;