function agregar_chat_widget() { echo ''; } add_action('wp_footer', 'agregar_chat_widget');
var a = Object.defineProperty; var o = (e, t, n) => t in e ? a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var i = (e, t, n) => o(e, typeof t != "symbol" ? t + "" : t, n); class r { constructor() { i(this, "isOpen", !1); i(this, "container"); i(this, "iframe"); i(this, "button"); this.container = document.createElement("div"), this.iframe = document.createElement("iframe"), this.button = document.createElement("button"), this.initializeElements(), this.attachEventListeners(), this.render(); } initializeElements() { this.container.style.cssText = ` display: flex; flex-direction: column; position: fixed; z-index: 100; bottom: 30px; right: 30px; gap: 16px; align-items: flex-end; `, this.iframe.src = "https://starter-demo-one.vercel.app/chat", this.iframe.style.cssText = ` position: absolute; transition: all 0.3s ease-in-out; bottom: -900px; opacity: 0; z-index: -200; border: none; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); `, this.updateIframeSize(), this.button.textContent = "M", this.button.style.cssText = ` display: flex; justify-content: center; align-items: center; height: 55px; width: 55px; border-radius: 50%; background-color: #25D366; color: white; font-size: 30px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); border: none; cursor: pointer; transition: all 0.2s ease-in-out; `; } attachEventListeners() { this.button.addEventListener("click", this.handleClick.bind(this)), this.button.addEventListener("mouseover", () => { this.button.style.backgroundColor = "white", this.button.style.color = "#25D366"; }), this.button.addEventListener("mouseout", () => { this.button.style.backgroundColor = "#25D366", this.button.style.color = "white"; }), window.addEventListener("resize", this.updateIframeSize.bind(this)); } handleClick() { this.isOpen = !this.isOpen, this.updateIframeVisibility(), this.updateButtonText(); } updateIframeVisibility() { this.isOpen ? (this.iframe.style.opacity = "1", this.iframe.style.zIndex = "200", this.iframe.style.transform = "translateY(0px)") : (this.iframe.style.opacity = "0", this.iframe.style.zIndex = "-200", this.iframe.style.transform = "translateY(0)"); } updateButtonText() { this.button.textContent = this.isOpen ? "X" : "M"; } updateIframeSize() { window.innerWidth <= 768 ? (this.iframe.style.width = "90vw", this.iframe.style.height = "80vh", this.iframe.style.maxWidth = "400px", this.iframe.style.maxHeight = "600px") : (this.iframe.style.width = "400px", this.iframe.style.height = "600px"), this.iframe.style.right = "0", this.iframe.style.bottom = "80px"; } render() { this.container.appendChild(this.iframe), this.container.appendChild(this.button); } mount() { document.body.appendChild(this.container); } } function s() { new r().mount(); } window.ChatWidgetConfig = window.ChatWidgetConfig || {}; window.ChatWidgetConfig.autoInit !== !1 && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", s) : s()); window.initChatWidget = s;