<commit_before><%
  case ENV['RAILS_ENV']
  when 'test'
    _mp = 'myprofile-test'
  when 'staging'
    _mp = 'myprofile-test'
  when 'development'
    _mp = 'myprofile-development'
  else
    _mp = 'myprofile'
  end
%>

window.msettings =
  audience: '<%= ENV['AUDIENCE'] %>'
  surveyMarkup: ''
  environment: '<%= ENV['RAILS_ENV'] %>'
  myprofileName: '<%= _mp %>'

# Get Universal Analytics masked user id from cookie
_mp = JSON.parse(decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(msettings.myprofileName).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || {} );

if _mp and _mp.ua
  window.muaid = _mp.ua
else
  window.muaid = null

jQuery ($) ->
  $.cookie.json = true<commit_msg>Bug fix: non-existent ua cookie<commit_after><%
  case ENV['RAILS_ENV']
  when 'test'
    _mp = 'myprofile-test'
  when 'staging'
    _mp = 'myprofile-test'
  when 'development'
    _mp = 'myprofile-development'
  else
    _mp = 'myprofile'
  end
%>

window.msettings =
  audience: '<%= ENV['AUDIENCE'] %>'
  surveyMarkup: ''
  environment: '<%= ENV['RAILS_ENV'] %>'
  myprofileName: '<%= _mp %>'

# Get Universal Analytics masked user id from cookie
try
  window.muaid = JSON.parse(decodeURIComponent(
    document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" +
    encodeURIComponent(msettings.myprofileName).replace(/[\-\.\+\*]/g, "\\$&") +
    "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1"))).ua;
catch
  window.muaid = null

jQuery ($) ->
  $.cookie.json = true
  return
{'fraction_non_alphanumeric': 0.2298095863427446, 'fraction_numerical': 0.0013131976362442547, 'mean_word_length': 3.5765765765765765, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '404580', 'n_tokens_mistral': 596, 'n_tokens_neox': 588, 'n_words': 106}