{
  "version": 3,
  "sources": ["../src/modules/tier.js"],
  "sourcesContent": ["// zelvior-runtime/tier -- one-shot device capability classifier. Zero\n// dependency on core zelvior.js. ESM source of truth; bundled by build.mjs.\n//\n// Combines cheap, synchronous signals (no benchmarking loop, no blocking\n// the thread) into a single low/mid/high tier so other modules -- or a\n// consuming app -- can pick sane defaults for genuinely old hardware\n// (Windows XP-era browsers, first-gen Chromebooks, budget Android) without\n// each of them re-implementing detection.\n\nfunction num(v, fallback) { return typeof v === 'number' && !isNaN(v) ? v : fallback; }\n\n/**\n * Returns { tier: 'low'|'mid'|'high', cores, memory, connection, legacy, reasons }.\n * `legacy` is true when the environment is missing APIs common on any\n * browser from the last ~8 years (Promise, IntersectionObserver, etc.) --\n * a strong low-tier signal independent of raw hardware specs.\n */\nexport function detectTier() {\n  var nav = (typeof navigator === 'object' && navigator) || {};\n  var cores = num(nav.hardwareConcurrency, null);\n  var memory = num(nav.deviceMemory, null); // GB, Chromium-only\n  var conn = nav.connection || nav.mozConnection || nav.webkitConnection || null;\n  var effectiveType = conn && conn.effectiveType || null;\n  var saveData = !!(conn && conn.saveData);\n\n  var legacy = !(\n    typeof Promise !== 'undefined' &&\n    typeof (typeof window !== 'undefined' ? window.IntersectionObserver : undefined) !== 'undefined' &&\n    typeof Array.prototype.includes === 'function'\n  );\n\n  var reasons = [];\n  var score = 0; // higher = more capable\n\n  if (cores !== null) { if (cores <= 2) { score -= 2; reasons.push('low-cores'); } else if (cores >= 8) { score += 2; } else { score += 0; } }\n  if (memory !== null) { if (memory <= 2) { score -= 2; reasons.push('low-memory'); } else if (memory >= 8) { score += 2; } }\n  if (saveData || effectiveType === 'slow-2g' || effectiveType === '2g') { score -= 2; reasons.push('slow-connection'); }\n  if (legacy) { score -= 3; reasons.push('legacy-engine'); }\n  if (cores === null && memory === null) { reasons.push('no-hardware-signals'); }\n\n  var tier = score <= -3 ? 'low' : (score >= 2 ? 'high' : 'mid');\n\n  return {\n    tier: tier,\n    cores: cores,\n    memory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
  "names": ["tier_exports", "__export", "detectTier", "__toCommonJS", "num", "v", "fallback", "nav", "cores", "memory", "conn", "effectiveType", "saveData", "legacy", "reasons", "score", "tier"]
}
