(function () {
const currentScript = document.currentScript;
if (!currentScript) return;
const siteId = currentScript.getAttribute(“data-site-id”);
const domain = currentScript.getAttribute(“data-domain”) || window.location.hostname;
const theme = currentScript.getAttribute(“data-theme”) || “light”;
const target = document.getElementById(“ngd-verification-badge”);
if (!target || !siteId) return;
const styles = {
light: {
bg: “#ffffff”,
border: “#d0d7de”,
text: “#111827”,
subtext: “#4b5563”,
link: “#0f766e”
},
dark: {
bg: “#111827”,
border: “#374151”,
text: “#f9fafb”,
subtext: “#d1d5db”,
link: “#5eead4”
}
};
const selected = styles[theme] || styles.light;
function escapeHtml(value) {
return String(value)
.replace(/&/g, “&”)
.replace(//g, “>”)
.replace(/”/g, “"”)
.replace(/’/g, “'”);
}
function renderLoading() {
target.innerHTML = `
Checking verification status…
`;
}
function renderError() {
target.innerHTML = `
Verification status unavailable.
`;
}
function renderBadge(data) {
const verifiedAt = new Date(data.verified_at);
const displayDate = isNaN(verifiedAt.getTime())
? “Verified”
: verifiedAt.toLocaleString();
const verifyUrl = escapeHtml(data.verify_url);
const emblemUrl = escapeHtml(data.emblem_url);
const company = escapeHtml(data.company_name || “NetGlobalDomain.com”);
const statusText = escapeHtml(data.status_text || “This site has been tested and verified”);
const verifiedDomain = escapeHtml(data.domain || domain);
target.innerHTML = `
${statusText}
by ${company}
Domain:
