(function () { const logoUrl = 'https://bluvia.anala.us/wp-content/uploads/2026/09/01_Brandmark-white.svg';
function replaceLauncherIcon() {
const root = document.querySelector('#wpsc-chatbot-root');
if (!root || !root.shadowRoot) { return false; }
const shadow = root.shadowRoot;
const launcher = shadow.querySelector('.wpsc-chatbot-launcher');
if (!launcher) { return false; }
// Already done if (launcher.querySelector('.bluvia-chatbot-logo')) { root.style.setProperty('visibility', 'visible', 'important'); return true; }
const svg = launcher.querySelector('svg');
if (!svg) { return false; }
// Create the Bluvia logo const img = document.createElement('img');
img.src = logoUrl; img.alt = 'Bluvia'; img.className = 'bluvia-chatbot-logo';
img.style.cssText = ` width: 32px; height: 32px; object-fit: contain; display: block; `;
// Replace the SupportCandy SVG svg.replaceWith(img);
// Now reveal the chatbot root.style.setProperty('visibility', 'visible', 'important');
return true; }
function watchForChatbot() {
const root = document.querySelector('#wpsc-chatbot-root');
if (!root) { return; }
// Keep hidden while we modify the Shadow DOM root.style.setProperty('visibility', 'hidden', 'important');
if (replaceLauncherIcon()) { return; }
// Watch INSIDE the Shadow DOM const shadowObserver = new MutationObserver(function () {
if (replaceLauncherIcon()) { shadowObserver.disconnect(); }
});
shadowObserver.observe(root.shadowRoot, { childList: true, subtree: true }); }
// Check frequently because SupportCandy creates the root dynamically const interval = setInterval(function () {
const root = document.querySelector('#wpsc-chatbot-root');
if (root && root.shadowRoot) { watchForChatbot(); clearInterval(interval); }
}, 50);
})();