(function () { try { var initTimer; // Capture script reference synchronously — this is the ONLY reliable // moment. document.currentScript becomes null inside setTimeout/async. var _selfScript = document.currentScript || null; // Fallback: find the script tag by its known src pattern. // The seal is always loaded as: if (!_selfScript) { var scripts = document.getElementsByTagName("script"); for (var i = 0; i < scripts.length; i++) { if (scripts[i].src && scripts[i].src.indexOf("c2b1372e-57a6-4c1e-b685-f0551351bf79.js") !== -1) { _selfScript = scripts[i]; break; } } } // Derive the seal image URL from the script's own src. var _sealImageUrl = ""; if (_selfScript && _selfScript.src) { try { var scriptOrigin = new URL(_selfScript.src).origin; _sealImageUrl = scriptOrigin + "/seal/c2b1372e-57a6-4c1e-b685-f0551351bf79.png"; } catch (e) { // URL constructor not supported (very old browsers) — parse manually. var m = _selfScript.src.match(/^(https?:\/\/[^\/]+)/); if (m) _sealImageUrl = m[1] + "/seal/c2b1372e-57a6-4c1e-b685-f0551351bf79.png"; } } // Final fallback: use the build-time CDN constant. if (!_sealImageUrl) { _sealImageUrl = "https://seal.gamecheck.cloud/seal/c2b1372e-57a6-4c1e-b685-f0551351bf79.png"; } function runInit() { clearTimeout(initTimer); initTimer = setTimeout(safeInit, 50); } function safeInit() { try { var allowedDomains = ["bc.game"]; var hostnameParts = window.location.hostname.split("."); var domain = hostnameParts.slice(-2).join("."); var secondLevelDomain = hostnameParts.slice(-3).join("."); if (![domain, secondLevelDomain].some(function(d) { return allowedDomains.indexOf(d) !== -1; })) return; var sealContainer = document.getElementById("trust-seal-container"); if (!sealContainer) return; if (document.getElementById("trust-seal-container-a")) return; var sealHTML = ''; sealContainer.innerHTML = sealHTML; applySealStyle(_sealImageUrl); } catch (e) {} } function applySealStyle(imageUrl) { if (document.getElementById("trust-seal-style")) return; var style = document.createElement("style"); style.id = "trust-seal-style"; style.textContent = "#trust-seal-container-a {" + "position: relative;" + "display: block;" + "width: 217.75px;" + "height: 64px;" + "background-image: url(" + imageUrl + ");" + "background-size: cover;" + "cursor: pointer;" + "transition: transform 0.3s ease-in-out;" + "}" + "#trust-seal-container-a:hover {" + "transform: scale(1.1);" + "}"; document.head.appendChild(style); } // --- Initial run --- runInit(); // --- SPA URL-change detection --- function observeUrlChanges(callback) { var oldHref = location.href; var check = function () { var newHref = location.href; if (oldHref !== newHref) { oldHref = newHref; callback(); } }; var origPush = history.pushState; history.pushState = function () { var r = origPush.apply(this, arguments); check(); return r; }; var origReplace = history.replaceState; history.replaceState = function () { var r = origReplace.apply(this, arguments); check(); return r; }; window.addEventListener("popstate", check); } observeUrlChanges(runInit); // --- DOM mutation watcher --- if (typeof MutationObserver !== "undefined" && document.body) { new MutationObserver(function () { if (!document.getElementById("trust-seal-container-a")) runInit(); }).observe(document.body, { childList: true, subtree: true }); } } catch (e) {} })();