function LeadDiscoveryRunForm(props) {
  var React = window.React;
  var useState = React.useState;
  var initial = {
    targetDomain: '', industry: '', location: '', services: '', targetQueries: '', manualLeads: '', fetchPages: false
  };
  var statePair = useState(initial);
  var form = statePair[0];
  var setForm = statePair[1];
  function update(name, value) { setForm(Object.assign({}, form, Object.defineProperty({}, name, { value: value, enumerable: true }))); }
  function lines(value) { return String(value || '').split(/\n/).map(function (x) { return x.trim(); }).filter(Boolean); }
  function submit(event) {
    event.preventDefault();
    props.onSubmit && props.onSubmit({
      targetDomain: form.targetDomain,
      industry: form.industry,
      location: form.location,
      services: form.services.split(',').map(function (x) { return x.trim(); }).filter(Boolean),
      targetQueries: lines(form.targetQueries),
      sources: ['manual'],
      manualLeads: lines(form.manualLeads).map(function (url) { return { url: url }; }),
      options: { fetchPages: Boolean(form.fetchPages) },
      limits: { maxLeads: 50, maxPagesPerLead: 3 }
    });
  }
  return <form className="free-seo-card" onSubmit={submit}>
    <h3>Create competitor lead discovery run</h3>
    <label>Client domain<input value={form.targetDomain} onChange={function (e) { update('targetDomain', e.target.value); }} placeholder="exampleconstruction.com" /></label>
    <label>Industry<input value={form.industry} onChange={function (e) { update('industry', e.target.value); }} placeholder="construction" /></label>
    <label>Location<input value={form.location} onChange={function (e) { update('location', e.target.value); }} placeholder="Manchester" /></label>
    <label>Services, comma separated<input value={form.services} onChange={function (e) { update('services', e.target.value); }} placeholder="roofing, renovations, extensions" /></label>
    <label>Target queries<textarea value={form.targetQueries} onChange={function (e) { update('targetQueries', e.target.value); }} placeholder={'construction company Manchester\nhome renovation Manchester'} /></label>
    <label>Manual competitor URLs<textarea value={form.manualLeads} onChange={function (e) { update('manualLeads', e.target.value); }} placeholder={'https://competitor-one.example\nhttps://competitor-two.example'} /></label>
    <label><input type="checkbox" checked={form.fetchPages} onChange={function (e) { update('fetchPages', e.target.checked); }} /> Fetch public homepages for deeper analysis</label>
    <button type="submit">Run lead discovery</button>
  </form>;
}
window.LeadDiscoveryRunForm = LeadDiscoveryRunForm;
