<commit_before>(function() {
  "use strict";
  window.GOVUK = window.GOVUK || {};

  var ReportAProblem = function ($container) {
    this.$container = $container;
    var $form = $container.find('form'),
        form = new GOVUK.ReportAProblemForm($form);

    this.addToggleLink($container);
    $form.on('reportAProblemForm.success', this.showConfirmation.bind(this));
    $form.on('reportAProblemForm.error', this.showError.bind(this));
  };

  ReportAProblem.prototype.addToggleLink = function($container) {
    var $toggle = $('\
      <div class="report-a-problem-toggle-wrapper js-footer">\
        <p class="report-a-problem-toggle">\
          <a href="">Is there anything wrong with this page?</a>\
        </p>\
      </div>');

    $container.before($toggle);
    $toggle.on("click", ".report-a-problem-toggle a", function(evt) {
      $container.toggle();
      evt.preventDefault();
    });
  };

  ReportAProblem.prototype.showConfirmation = function(evt, data) {
    this.$container.find('.report-a-problem-content').html(data.message);
  }

  ReportAProblem.prototype.showError = function() {
    var response = "\
      <h2>Sorry, we’re unable to receive your message right now.</h2>\
      <p>We have other ways for you to provide feedback on the \
      <a href='/contact'>contact page</a>.</p>";

    this.$container.find('.report-a-problem-content').html(response);
  }

  GOVUK.ReportAProblem = ReportAProblem;

  $(document).ready(function() {<commit_msg>report-a-problem: minor tidy to ReportAProblem class<commit_after>(function() {
  "use strict";
  window.GOVUK = window.GOVUK || {};

  var ReportAProblem = function ($container) {
    this.$container = $container;
    var $form = $container.find('form'),
        form = new GOVUK.ReportAProblemForm($form);

    this.addToggleLink();
    $form.on('reportAProblemForm.success', this.showConfirmation.bind(this));
    $form.on('reportAProblemForm.error', this.showError.bind(this));
  };

  ReportAProblem.prototype.addToggleLink = function() {
    var $toggle = $('\
      <div class="report-a-problem-toggle-wrapper js-footer">\
        <p class="report-a-problem-toggle">\
          <a href="">Is there anything wrong with this page?</a>\
        </p>\
      </div>');

    this.$container.before($toggle);
    $toggle.on("click", ".report-a-problem-toggle a", function(evt) {
      this.$container.toggle();
      evt.preventDefault();
    }.bind(this));
  };

  ReportAProblem.prototype.showConfirmation = function(evt, data) {
    this.$container.find('.report-a-problem-content').html(data.message);
  }

  ReportAProblem.prototype.showError = function() {
    var response = "\
      <h2>Sorry, we’re unable to receive your message right now.</h2>\
      <p>We have other ways for you to provide feedback on the \
      <a href='/contact'>contact page</a>.</p>";

    this.$container.find('.report-a-problem-content').html(response);
  }

  GOVUK.ReportAProblem = ReportAProblem;

  $(document).ready(function() {
{'fraction_non_alphanumeric': 0.17, 'fraction_numerical': 0.0013333333333333333, 'mean_word_length': 3.381021897810219, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '5205254', 'n_tokens_mistral': 965, 'n_tokens_neox': 920, 'n_words': 172}