import dompurify from "dompurify";
import { html } from "lit";
import { unsafeHTML } from "lit/directives/unsafe-html.js";
import "../../atomic-generated-answer-inline-link/atomic-generated-answer-inline-link.js";
import { transformMarkdownToHtml } from "./markdown-utils.js";
const renderGeneratedMarkdownContent = ({ props })=>{
    const answerAsHtml = dompurify.sanitize(transformMarkdownToHtml(props.answer ?? ''), {
        ADD_ATTR: [
            'part'
        ],
        CUSTOM_ELEMENT_HANDLING: {
            tagNameCheck: /^atomic-generated-answer-inline-link$/,
            attributeNameCheck: /^(href|title|exportparts)$/
        }
    });
    return html`
    <div
      part="generated-text"
      class="text-on-background mb-0 ${props.isStreaming ? 'cursor' : ''}"
    >
      ${unsafeHTML(answerAsHtml)}
    </div>
  `;
};
export { renderGeneratedMarkdownContent };
