"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.HeaderCloseIcon = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _MaterialCommunityIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialCommunityIcons"));
var _TouchableRipple = _interopRequireDefault(require("../TouchableRipple/TouchableRipple.native"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (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; }
const HeaderCloseIcon = _ref => {
  let {
    size = 24,
    color,
    onPress = () => null,
    accessibilityLabel
  } = _ref;
  const iosIconSize = size - 3;
  return /*#__PURE__*/React.createElement(_TouchableRipple.default, {
    borderless: true,
    onPress: onPress,
    accessibilityLabel: accessibilityLabel,
    style: styles.touchable,
    rippleColor: color ? color : '#F9F9F9'
    // @ts-expect-error We keep old a11y props for backwards compat with old RN versions
    ,
    accessibilityTraits: 'button',
    accessibilityComponentType: "button",
    accessibilityRole: "button",
    hitSlop: _TouchableRipple.default.supported ? {
      top: 10,
      left: 10,
      bottom: 10,
      right: 10
    } : {
      top: 6,
      left: 6,
      bottom: 6,
      right: 6
    }
  }, _reactNative.Platform.OS === 'ios' ? /*#__PURE__*/React.createElement(_reactNative.View, {
    style: [styles.wrapper, {
      width: size + 14,
      height: size + 14,
      transform: [{
        scaleX: _reactNative.I18nManager.isRTL ? -1 : 1
      }]
    }]
  }, /*#__PURE__*/React.createElement(_reactNative.Image, {
    source: require('../../assets/close.png'),
    style: [styles.icon, {
      tintColor: color,
      width: iosIconSize,
      height: iosIconSize
    }]
  })) : /*#__PURE__*/React.createElement(_reactNative.View, {
    style: [styles.wrapper, {
      width: size + 14,
      height: size + 14,
      transform: [{
        scaleX: _reactNative.I18nManager.isRTL ? -1 : 1
      }]
    }]
  }, /*#__PURE__*/React.createElement(_MaterialCommunityIcons.default, {
    name: "close",
    color: color,
    size: size,
    direction: _reactNative.I18nManager.isRTL ? 'rtl' : 'ltr'
  })));
};
exports.HeaderCloseIcon = HeaderCloseIcon;
const styles = _reactNative.StyleSheet.create({
  wrapper: {
    alignItems: 'center',
    justifyContent: 'center',
    // backgroundColor: '#F9F9F9',
    borderRadius: 8
  },
  icon: {
    resizeMode: 'contain'
  },
  touchable: {
    // flexGrow: 0,
    justifyContent: 'center',
    alignItems: 'center'
  }
});
var _default = HeaderCloseIcon; // @component-docs ignore-next-line
exports.default = _default;
//# sourceMappingURL=CloseIcon.js.map