import { objectSpread2 as _objectSpread2 } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
import { createElement } from 'react';
import { sanitizeHtml } from '../utils/sanitizeHtml.js';

var renderElement = function renderElement(key, fallback, props, children) {
  return /*#__PURE__*/createElement(fallback, _objectSpread2(_objectSpread2({}, props), {}, {
    key: key
  }), children);
};
var renderSanitizedHtml = function renderSanitizedHtml(key, html) {
  var tagName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'span';
  return /*#__PURE__*/createElement(tagName, {
    dangerouslySetInnerHTML: {
      __html: sanitizeHtml(html)
    },
    key: key
  });
};
var resolveTokenNode = function resolveTokenNode(tokenRenderer, token, defaultNode, children) {
  var customNode = tokenRenderer === null || tokenRenderer === void 0 ? void 0 : tokenRenderer(token, children);
  return customNode === undefined ? defaultNode : customNode;
};

export { renderElement, renderSanitizedHtml, resolveTokenNode };
