text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = HTMLListElement;
  
  var _reactNative = require("react-native");
  
  var _react = _interopRequireDefault(require("react"));
  
  var _TChildrenRendererContext = require("../context/TChildrenRendererContext");
  
  var _usePrefixRenderer = _interopRequireDefault(require("./usePrefixRenderer"));
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  
  const styles = _reactNative.StyleSheet.create({
    row: {
      flexDirection: 'row',
      flexWrap: 'nowrap',
      alignItems: 'flex-start'
    }
  });
  
  function HTMLListElement({
    tnode,
    TDefaultRenderer,
    hasAnchorAncestor,
    defaultListType,
    style,
    ...props
  }) {
    // Map children to horizontal rows with prefixes
    const TChildrenRenderer = (0, _TChildrenRendererContext.useTChildrenRenderer)();
    const prefixRenderer = (0, _usePrefixRenderer.default)({
      listStyleType: tnode.styles.webTextFlow.listStyleType,
      defaultListType
    });
    const fontSize = tnode.styles.nativeTextFlow.fontSize || 14;
    const color = tnode.styles.nativeTextFlow.color;
    const lineHeight = tnode.styles.nativeTextFlow.lineHeight || 16.8;
    const prefixMarginRight = fontSize / 2;
    const prefixLength = prefixRenderer.computeStrSize(tnode.children.length);
    const bulletWidth = (fontSize || 12) * prefixLength;
    const paddingLeft = typeof tnode.styles.nativeBlockRet.paddingLeft === 'number' ? Math.max(tnode.styles.nativeBlockRet.paddingLeft, bulletWidth + prefixMarginRight) : bulletWidth + prefixMarginRight;
    const PrefixRenderer = prefixRenderer.Component;
    const prefixContainerStyle = {
      width: bulletWidth,
      marginLeft: -(bulletWidth + prefixMarginRight),
      marginRight: prefixMarginRight,
      height: lineHeight,
      alignItems: 'flex-end'
    };
  
    const renderChild = ({
      childElement,
      key,
      index
    }) => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
      key: key,
      style: styles.row
    }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
      style: prefixContainerStyle
    }, /*#__PURE__*/_react.default.createElement(PrefixRenderer, {
      index: index,
      nestLevel: 0,
      color: color,
      fontSize: fontSize,
      lineHeight: lineHeight
    })), childElement);
  
    return /*#__PURE__*/_react.default.createElement(TDefaultRenderer, _extends({
      hasAnchorAncestor: hasAnchorAncestor,
      tnode: tnode,
      style: [style, {
        paddingLeft
      }]
    }, props), /*#__PURE__*/_react.default.createElement(TChildrenRenderer, {
      tchildren: tnode.children,
      hasAnchorAncestor: hasAnchorAncestor,
      renderChild: renderChild
    }));
  }
  //# sourceMappingURL=HTMLListElement.js.map