const classMap = {
  h1: 'heading-01',
  h2: 'heading-02',
  h3: 'heading-03',
  h4: 'heading-04',
  h5: 'heading-05',
  p: 'body',
  a: 'anchor',
  ol: 'list',
  ul: 'list',
  table: 'simple-table'
};
function datarobotCSSClasses() {
  return function (tree) {
    visit(tree, 'element', function (node) {
      if (!node.properties.className) {
        node.properties.className = classMap[node.tagName];
      }
      if (node.tagName === 'a') {
        node.properties.target = '_blank';
      }
    });
  };
}
function visit(tree, type, callback) {
  if (tree.type === type) {
    callback(tree);
  }
  if (tree.children) {
    for (const child of tree.children) {
      visit(child, type, callback);
    }
  }
}
export { datarobotCSSClasses };