<commit_before>

// REDEEMING /////////////////////////////////////////////////////////

window.handleRedeemResponse = function(data, textStatus, jqXHR) {
  if (data.error) {
    var error = '';
    if (data.error === 'ALREADY_REDEEMED') {
      error = 'The passcode has already been redeemed.';
    } else if (data.error === 'ALREADY_REDEEMED_BY_PLAYER') {
      error = 'You have already redeemed this passcode.';
    } else if (data.error === 'INVALID_PASSCODE') {
      error = 'This passcode is invalid.';
    } else {
      error = 'There was a problem redeeming the passcode. Try again?';
    }
    alert('<strong>' + data.error + "</strong>\n" + error);
  } else if (data.result) {
	var tblResult = $('<table />', {'class': 'redeem-result' }).append($('<tr />').append($('<th />', {colspan: 2}).append("Passcode redeemed!")));
  
	if (data.result.apAward)
	  tblResult.append($('<tr />').append($('<td />')).append($('<td />').append('AP (' + data.result.apAward + ')')));
	if (data.result.xmAward)
	  tblResult.append($('<tr />').append($('<td />')).append($('<td />').append('XM (' + data.result.xmAward + ')')));
  
	var resonators = {};
	var bursts = {};
	var shields = {};
	 
    for (var i in data.result.inventoryAward) {
      var acquired = data.result.inventoryAward[i][2];
      if (acquired.modResource) {
        if (acquired.modResource.resourceType === 'RES_SHIELD') {
		  var rarity = acquired.modResource.rarity.split('_').map(function (i) {return i[0]}).join('');
		  if (!shields[rarity])
			shields[rarity] = 0;
		  shields[rarity] += 1;
        }
      } else if (acquired.resourceWithLevels) {
        if (acquired.resourceWithLevels.resourceType === 'EMITTER_A') {
		  var level = acquired.resourceWithLevels.level
		  if (!resonators[level])
			resonators[level] = 0;
		  resonators[level] += 1;<commit_msg>Changed AP / XM Message to "+ 100 XM"<commit_after>

// REDEEMING /////////////////////////////////////////////////////////

window.handleRedeemResponse = function(data, textStatus, jqXHR) {
  if (data.error) {
    var error = '';
    if (data.error === 'ALREADY_REDEEMED') {
      error = 'The passcode has already been redeemed.';
    } else if (data.error === 'ALREADY_REDEEMED_BY_PLAYER') {
      error = 'You have already redeemed this passcode.';
    } else if (data.error === 'INVALID_PASSCODE') {
      error = 'This passcode is invalid.';
    } else {
      error = 'There was a problem redeeming the passcode. Try again?';
    }
    alert('<strong>' + data.error + "</strong>\n" + error);
  } else if (data.result) {
	var tblResult = $('<table />', {'class': 'redeem-result' }).append($('<tr />').append($('<th />', {colspan: 2}).append("Passcode redeemed!")));
  
	if (data.result.apAward)
	  tblResult.append($('<tr />').append($('<td />').append('+')).append($('<td />').append(data.result.apAward + ' AP')));
	if (data.result.xmAward)
	  tblResult.append($('<tr />').append($('<td />').append('+')).append($('<td />').append(data.result.xmAward + ' XM')));
  
	var resonators = {};
	var bursts = {};
	var shields = {};
	 
    for (var i in data.result.inventoryAward) {
      var acquired = data.result.inventoryAward[i][2];
      if (acquired.modResource) {
        if (acquired.modResource.resourceType === 'RES_SHIELD') {
		  var rarity = acquired.modResource.rarity.split('_').map(function (i) {return i[0]}).join('');
		  if (!shields[rarity])
			shields[rarity] = 0;
		  shields[rarity] += 1;
        }
      } else if (acquired.resourceWithLevels) {
        if (acquired.resourceWithLevels.resourceType === 'EMITTER_A') {
		  var level = acquired.resourceWithLevels.level
		  if (!resonators[level])
			resonators[level] = 0;
		  resonators[level] += 1;
{'fraction_non_alphanumeric': 0.2245557350565428, 'fraction_numerical': 0.0045772751750134625, 'mean_word_length': 3.0032327586206895, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7174270', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1243, 'n_words': 261}