const fs = require('fs');
const content = fs.readFileSync('dist/assets/index-D9sWWWv_.js', 'utf8');

const targetIdx = content.indexOf("Simulasikan Data Demo");
if (targetIdx !== -1) {
  const startIdx = Math.max(0, targetIdx - 6000);
  console.log("=== Printing preceding 6000 chars ===");
  const preceding = content.substring(startIdx, targetIdx);
  // Find where const r or let r or var r is defined
  console.log(preceding.substring(preceding.lastIndexOf("const r=")));
  console.log("Full chunk of preceding 2000 chars:");
  console.log(content.substring(targetIdx - 2000, targetIdx));
} else {
  console.log("Simulasikan Data Demo not found");
}
