const fs = require('fs');

const b1 = 'dist/assets/index-D9sWWWv_.js';
const b2 = 'dist/assets/index-D9sWWWv_.js.bak-before-new-payment-logic';

if (fs.existsSync(b2)) {
  const content1 = fs.readFileSync(b1, 'utf8');
  const content2 = fs.readFileSync(b2, 'utf8');
  
  const target = "Aktivasi otomatis sukses via Tripay";
  const idx1 = content1.indexOf(target);
  const idx2 = content2.indexOf(target);
  
  console.log("--- Current ---");
  if (idx1 !== -1) {
    console.log(content1.substring(idx1 - 200, idx1 + 1500));
  } else {
    console.log("Not found in current");
  }
  
  console.log("\n--- Backup ---");
  if (idx2 !== -1) {
    console.log(content2.substring(idx2 - 200, idx2 + 1500));
  } else {
    console.log("Not found in backup");
  }
} else {
  console.log("Backup file does not exist");
}
