<commit_before>import React from 'react';
import {IntlMixin, FormattedNumber} from 'react-intl';

var AmountButton = React.createClass({
  render: function() {
    var checked = false;
    if (this.props.value === this.props.amount) {
      checked = true;
    }

    return (
      <div className="third">
        <input onChange={this.props.onChange} checked={checked} type="radio" name="donation_amount" value={this.props.value} id={"amount-" + this.props.value}/>
        <label htmlFor={"amount-" + this.props.value} className="large-label-size">
          <FormattedNumber
            minimumFractionDigits={0}
            value={this.props.value}
            style="currency"
            currency="USD"
          />
        </label>
      </div>
    );
  }
});

var AmountOtherButton = React.createClass({
  onRadioClick: function() {
    document.querySelector("#amount-other-input").focus();
  },
  onInputClick: function() {
    document.querySelector("#amount-other").click();
  },
  render: function() {
    return (
      <div className="two-third">
        <div id="amount-other-container">
          <input id="amount-other" type="radio" name="donation_amount"
            checked={this.props.checked}
            onClick={this.onRadioClick}
            onChange={this.props.onRadioChange}
            value={this.props.amount}
          />
          <label htmlFor="amount-other" className="large-label-size">$</label>
          <input id="amount-other-input" className="medium-label-size" type="text"
            onChange={this.props.onInputChange}
            value={this.props.amount}
            onClick={this.onInputClick}
            placeholder={this.props.placeholder}
          />
        </div>
      </div>
    );
  }
});

var AmountButtons = React.createClass({
  mixins: [IntlMixin, require('../scripts/commonAPI.js')],
  getInitialState: function() {
    var presets = this.props.presets || "";
    presets = presets.split(",");
    if (presets.length !== 4) {
      presets = ["20", "10", "5", "3"];
    }
    var amount = this.props.amount;
    var preset = presets.indexOf(amount);
    var userInputting = false;
    if (preset < 0 && amount) {
      userInputting = true;
    }
    return {
      presets: presets,
      userInputting: userInputting,
      values: {
        amount: amount || "",<commit_msg>made the wrong choice in a merge conflict<commit_after>import React from 'react';
import {IntlMixin, FormattedNumber} from 'react-intl';

var AmountButton = React.createClass({
  render: function() {
    var checked = false;
    if (this.props.value === this.props.amount) {
      checked = true;
    }

    return (
      <div className="third">
        <input onChange={this.props.onChange} checked={checked} type="radio" name="donation_amount" value={this.props.value} id={"amount-" + this.props.value}/>
        <label htmlFor={"amount-" + this.props.value} className="large-label-size">
          <FormattedNumber
            minimumFractionDigits={0}
            value={this.props.value}
            style="currency"
            currency="USD"
          />
        </label>
      </div>
    );
  }
});

var AmountOtherButton = React.createClass({
  onRadioClick: function() {
    document.querySelector("#amount-other-input").focus();
  },
  onInputClick: function() {
    document.querySelector("#amount-other").click();
  },
  render: function() {
    return (
      <div className="two-third">
        <div id="amount-other-container">
          <input id="amount-other" type="radio" name="donation_amount"
            checked={this.props.checked}
            onClick={this.onRadioClick}
            onChange={this.props.onRadioChange}
            value={this.props.amount}
          />
          <label htmlFor="amount-other" className="large-label-size">$</label>
          <input id="amount-other-input" className="medium-label-size" type="text"
            onChange={this.props.onInputChange}
            value={this.props.amount}
            onClick={this.onInputClick}
            placeholder={this.props.placeholder}
          />
        </div>
      </div>
    );
  }
});

var AmountButtons = React.createClass({
  mixins: [require('react-intl').IntlMixin],
  getInitialState: function() {
    var presets = this.props.presets || "";
    presets = presets.split(",");
    if (presets.length !== 4) {
      presets = ["20", "10", "5", "3"];
    }
    var amount = this.props.amount;
    var preset = presets.indexOf(amount);
    var userInputting = false;
    if (preset < 0 && amount) {
      userInputting = true;
    }
    return {
      presets: presets,
      userInputting: userInputting,
      values: {
        amount: amount || "",
{'fraction_non_alphanumeric': 0.15368241805023414, 'fraction_numerical': 0.0038314176245210726, 'mean_word_length': 2.5014903129657227, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 31, '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': '5603174', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1405, 'n_words': 256}