SIMULATED shell \u2014 helix dev. Purchases, saves and achievements are simulated locally; nothing here proves a product is registered or that settlement works.
\n\n
Simulated purchase
\n \n\n\n\n\n";
export declare const DEV_SHELL_PAGE_JS = "// Served by `helix dev`. Everything here is SIMULATED \u2014 see the banner.\nconst logEl = document.getElementById('log');\nconst menuEl = document.getElementById('menu');\nconst metaEl = document.getElementById('meta');\nconst frame = document.getElementById('world');\nconst toastEl = document.getElementById('toast');\n\nlet toastTimer = null;\nfunction toast(text) {\n toastEl.textContent = text;\n toastEl.className = 'show';\n if (toastTimer) clearTimeout(toastTimer);\n toastTimer = setTimeout(function () { toastEl.className = ''; }, 4000);\n}\n\n// The real shell's purchase confirm, simulated: one dialog at a time, queued in arrival order.\nconst confirmEl = document.getElementById('confirm');\nlet confirmChain = Promise.resolve();\nfunction confirmPurchase(req) {\n const ask = function () {\n return new Promise(function (done) {\n document.getElementById('confirmTitle').textContent = req.title;\n document.getElementById('confirmPrice').innerHTML = req.isFree\n ? 'Free claim · balance stays ' + req.balanceLix + ' LIX'\n : '' + req.priceLix + ' LIX · balance ' + req.balanceLix + ' → ' + req.balanceAfterLix + '';\n confirmEl.className = 'show';\n const buy = document.getElementById('confirmBuy');\n const cancel = document.getElementById('confirmCancel');\n const settle = function (verdict) {\n confirmEl.className = '';\n buy.onclick = null;\n cancel.onclick = null;\n done(verdict);\n };\n buy.onclick = function () { settle(true); };\n cancel.onclick = function () { settle(false); };\n });\n };\n const result = confirmChain.then(ask);\n confirmChain = result.then(function () {}, function () {});\n return result;\n}\n\nfunction append(text, kind) {\n const line = document.createElement('div');\n if (kind) line.className = kind;\n line.textContent = text;\n logEl.appendChild(line);\n while (logEl.childElementCount > 500) logEl.removeChild(logEl.firstChild);\n logEl.scrollTop = logEl.scrollHeight;\n}\n\nfunction show(value) {\n if (value === undefined) return '';\n try {\n return typeof value === 'string' ? value : JSON.stringify(value);\n } catch (err) {\n return String(value);\n }\n}\n\nfunction button(label, onClick) {\n const el = document.createElement('button');\n el.textContent = label;\n el.addEventListener('click', function () { onClick(el); });\n menuEl.appendChild(el);\n return el;\n}\n\nasync function main() {\n const config = await (await fetch('/dev/config')).json();\n frame.src = config.worldOrigin + '/';\n\n const devShell = await import('/sdk/dev-shell/index.js');\n const prefix = devShell.DEV_SHELL_LOG_PREFIX;\n\n let pending = null;\n let sending = false;\n async function flush() {\n if (sending || pending === null) return;\n sending = true;\n const body = pending;\n pending = null;\n try {\n await fetch('/dev/state', { method: 'POST', headers: { 'content-type': 'application/json' }, body: body });\n } catch (err) {\n append('state was not saved: ' + String(err), 'err');\n }\n sending = false;\n flush();\n }\n\n // A fresh player has no stored state, so the seeded achievement registry is minted into a new one here.\n const freshState = !config.state && config.achievements\n ? devShell.createDevShellState({ identity: config.user, achievements: config.achievements })\n : undefined;\n\n const shell = devShell.createDevShell({\n worldWindow: frame,\n worldOrigin: config.worldOrigin,\n world: config.world,\n user: config.user,\n state: config.state || freshState,\n products: config.products || undefined,\n debug: true,\n onAchievementEarned: function (a) {\n toast('Achievement unlocked (SIMULATED): ' + a.name + (a.points ? ' (+' + a.points + ')' : ''));\n },\n confirmPurchase: confirmPurchase,\n log: function (message, detail) {\n append(detail === undefined ? message : message + ' ' + show(detail), message.indexOf(prefix) === 0 ? 'sim' : null);\n if (detail === undefined) console.log(message);\n else console.log(message, detail);\n },\n onStateChange: function (state) {\n pending = JSON.stringify(state);\n flush();\n },\n });\n window.helixDevShell = shell;\n\n metaEl.innerHTML =\n '