const versions = document.querySelectorAll("[data-version]"); const slots = document.querySelectorAll("[data-commit]"); if (versions.length || slots.length) { try { const response = await fetch(new URL("./build.json", import.meta.url)); if (response.ok) { const info = await response.json(); const version = info.version ? String(info.version) : ""; const rawCommit = info.commit ? String(info.commit).trim() : ""; const commit = /^[0-9a-f]{7,}$/i.test(rawCommit) ? rawCommit.slice(0, 12) : ""; if (version) for (const node of versions) node.textContent = version; if (commit) for (const node of slots) node.textContent = commit; } } catch { /* A file open has no sale-package build record yet. */ } }