document.addEventListener("DOMContentLoaded", function () {
    var script = document.createElement("script");
    script.src = "https://widget.kapa.ai/kapa-widget.bundle.js";
    script.setAttribute("data-bot-protection-mechanism", "hcaptcha");
    script.setAttribute("data-website-id", "6b18f5e5-d883-4ccd-9a24-371457cc0d7b");
    script.setAttribute("data-mcp-enabled", "true");
    script.setAttribute("data-mcp-server-url", "https://mcp.espressif.com/docs");
    script.setAttribute("data-mcp-dropdown-description", "更多关于乐鑫文档 MCP 服务器的信息请参阅[这篇文章](https://blog.csdn.net/espressif/article/details/159958703?spm=1001.2014.3001.5501)。");
    script.setAttribute("data-mcp-button-text", "MCP 服务器");
    script.setAttribute("data-modal-title", "ESP-IDF 编程指南文档 AI 助手");
    script.setAttribute("data-project-name", "ESP-IDF 编程指南");
    script.setAttribute("data-project-color", "#C62817");
    script.setAttribute("data-project-logo", "https://dl.espressif.com/public/logo.png");
    script.setAttribute("data-button-image", "https://dl.espressif.com/chatbot/Chatbot.png");
    script.setAttribute("data-button-text-font-size", "0px");
    script.setAttribute("data-button-border-radius", "50%");
    script.setAttribute("data-button-bg-color", "#38393a");
    script.setAttribute("data-button-border", "#38393a");
    script.setAttribute("data-button-height", "45px");
    script.setAttribute("data-button-width", "45px");
    script.setAttribute("data-button-animation-enabled", "false");
    script.setAttribute("data-button-image-height", "100%");
    script.setAttribute("data-button-image-width", "100%");
    script.setAttribute("data-button-padding", "0");
    script.setAttribute("data-button-hover-animation-enabled", "false");
    script.setAttribute("data-button-position-top", "50px");
    script.setAttribute("data-button-position-left", "305px");
    script.setAttribute("data-button-box-shadow", "0px 6px 12px 1px rgba(0,0,0,0.16)");
    script.setAttribute("data-modal-override-open-class", "test-ai");
    script.setAttribute("data-user-analytics-fingerprint-enabled", "true");
    script.setAttribute("data-language", "zh");
    script.setAttribute("data-modal-example-questions-title", "问题示例");
    script.setAttribute("data-modal-disclaimer", "欢迎使用乐鑫文档智能问答助手！本助手基于乐鑫的公开文档，旨在为您提供产品和服务的技术支持与解答。如有任何意见或建议，欢迎留下反馈！\n\n**注意**：本回答由 AI 生成，可能存在不准确之处，请核实重要信息。");
    script.setAttribute("data-modal-example-questions", "esp-idf 是什么？,我如何使用 esp-idf？");
    script.async = true;
    document.head.appendChild(script);
  });
