text: var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _react=_interopRequireWildcard(require("react"));var _propTypes=_interopRequireDefault(require("prop-types"));var _reactNative=require("react-native");var _withTheme=_interopRequireDefault(require("../../Theme/withTheme"));var _BodyText=_interopRequireDefault(require("../Typography/BodyText/BodyText.js"));var _Divider=_interopRequireDefault(require("./Divider.styles"));var _excluded=["style","theme","marginVertical","subheader","testID","insetLeft"];var _jsxFileName="/Users/arunshriram/Documents/material-bread/src/Components/Divider/Divider.js";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}var Divider=function(_Component){(0,_inherits2.default)(Divider,_Component);var _super=_createSuper(Divider);function Divider(){(0,_classCallCheck2.default)(this,Divider);return _super.apply(this,arguments);}(0,_createClass2.default)(Divider,[{key:"_renderSubheader",value:function _renderSubheader(){var _this$props=this.props,subheader=_this$props.subheader,marginVertical=_this$props.marginVertical,insetHeader=_this$props.insetHeader,testID=_this$props.testID;return _react.default.createElement(_reactNative.View,{style:{marginVertical:marginVertical?marginVertical:8},testID:testID,__source:{fileName:_jsxFileName,lineNumber:23,columnNumber:7}},this._renderDivider(),_react.default.createElement(_BodyText.default,{style:[_Divider.default.subheader,{marginLeft:insetHeader}],__source:{fileName:_jsxFileName,lineNumber:27,columnNumber:9}},subheader));}},{key:"_renderDivider",value:function _renderDivider(){var _this$props2=this.props,style=_this$props2.style,theme=_this$props2.theme,marginVertical=_this$props2.marginVertical,subheader=_this$props2.subheader,testID=_this$props2.testID,insetLeft=_this$props2.insetLeft,rest=(0,_objectWithoutProperties2.default)(_this$props2,_excluded);var marginVerticalImplemented=marginVertical?marginVertical:8;if(subheader)marginVerticalImplemented=0;var width=insetLeft>0?"calc(100% - "+insetLeft+"px)":'100%';var marginLeft=insetLeft>0?insetLeft:0;return _react.default.createElement(_reactNative.View,(0,_extends2.default)({style:[theme.divider,{height:_reactNative.Platform.OS=='web'?1:_reactNative.StyleSheet.hairlineWidth,marginVertical:marginVerticalImplemented,width:width,marginLeft:marginLeft},style],testID:testID},rest,{__source:{fileName:_jsxFileName,lineNumber:50,columnNumber:7}}));}},{key:"render",value:function render(){var subheader=this.props.subheader;return subheader?this._renderSubheader():this._renderDivider();}}]);return Divider;}(_react.Component);(0,_defineProperty2.default)(Divider,"propTypes",{style:_propTypes.default.oneOfType([_propTypes.default.object,_propTypes.default.array]),theme:_propTypes.default.object,marginVertical:_propTypes.default.number,subheader:_propTypes.default.string,insetHeader:_propTypes.default.number,insetLeft:_propTypes.default.number,testID:_propTypes.default.string});var _default=(0,_withTheme.default)(Divider);exports.default=_default;