<commit_before>import React from "react";
var validUrl = require('valid-url');

export default class Form extends React.Component {
  constructor(props) {
    super(props);
    this.state = {url: ""};
  }

  handleURLChange(e) {
    const url = e.target.value;
    this.setState({url: url});
  }

  handleSubmit(e) {
    e.preventDefault();

    var self = this;

    // TODO: Use a real API URL
    if (validUrl.isWebUri(this.state.url)) {
      self.props.onUpdate(self.state)
    }
  }

  render() {
    var formGroupClass = "form-group";
    var helpBlock;
    if (this.state.url == null || this.state.url == "") {
      // No validation state
    } else if (validUrl.isWebUri(this.state.url)) {
      formGroupClass = `${formGroupClass} has-success`
    } else {
      formGroupClass = `${formGroupClass} has-error`
      helpBlock = <span className="help-block">Please enter a fully qualified valid URL…</span>;
    }

    return (
      <form onSubmit={this.handleSubmit.bind(this)}>
        <div className={formGroupClass}>
          <label className="control-label" htmlFor="url">URL</label>
          <input type="url" className="form-control" id="url" placeholder="https://…" onChange={this.handleURLChange.bind(this)}/>
          {helpBlock}
        </div>
        <button type="submit" className="btn btn-danger">Start test</button>
        <hr/>
        <h4>Demo settings</h4>
        <p>Download the CLI tool for full control.</p>
        <div className="form-group">
          <label>Maximum concurrency</label><commit_msg>Make the demo default to goad.io, turn off autocomplete<commit_after>import React from "react";
var validUrl = require('valid-url');

export default class Form extends React.Component {
  constructor(props) {
    super(props);
    this.state = {url: "https://goad.io"};
  }

  handleURLChange(e) {
    const url = e.target.value;
    this.setState({url: url});
  }

  handleSubmit(e) {
    e.preventDefault();

    var self = this;

    // TODO: Use a real API URL
    if (validUrl.isWebUri(this.state.url)) {
      self.props.onUpdate(self.state)
    }
  }

  render() {
    var formGroupClass = "form-group";
    var helpBlock;
    if (this.state.url == null || this.state.url == "") {
      // No validation state
    } else if (validUrl.isWebUri(this.state.url)) {
      formGroupClass = `${formGroupClass} has-success`
    } else {
      formGroupClass = `${formGroupClass} has-error`
      helpBlock = <span className="help-block">Please enter a fully qualified valid URL…</span>;
    }

    return (
      <form onSubmit={this.handleSubmit.bind(this)}>
        <div className={formGroupClass}>
          <label className="control-label" htmlFor="url">URL</label>
          <input value={this.state.url} type="url" autoComplete="off" className="form-control" id="url" placeholder="https://…" onChange={this.handleURLChange.bind(this)}/>
          {helpBlock}
        </div>
        <button type="submit" className="btn btn-danger">Start test</button>
        <hr/>
        <h4>Demo settings</h4>
        <p>Download the CLI tool for full control.</p>
        <div className="form-group">
          <label>Maximum concurrency</label>
{'fraction_non_alphanumeric': 0.1504564054139125, 'fraction_numerical': 0.0012590494176896443, 'mean_word_length': 2.8898408812729497, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1187130', 'n_tokens_mistral': 986, 'n_tokens_neox': 973, 'n_words': 218}