{"version":3,"sources":["webpack:///./config/modern-polyfills.js","webpack:///./app/scripts/kickstart.js","webpack:///./app/scripts/components/PartyPill.tsx","webpack:///./app/scripts/components/CandidateRow.tsx","webpack:///./app/scripts/election-utils.ts","webpack:///./app/scripts/components/Contest.tsx","webpack:///./app/scripts/vendor/idb-keyval.js","webpack:///./app/scripts/components/Portal.js","webpack:///./app/scripts/utils/shallow-equal.ts","webpack:///./app/scripts/components/PureComponent.tsx","webpack:///./app/scripts/utils/debounce.js","webpack:///./app/scripts/utils/noop.js","webpack:///./app/scripts/components/Typeahead.js","webpack:///./app/scripts/utils/get-json.js","webpack:///./app/scripts/components/CountyInfo.js","webpack:///./app/scripts/components/YourRaces.js","webpack:///./app/scripts/utils/load-asset-url.js","webpack:///./app/scripts/utils/legislative-districts.js","webpack:///./app/scripts/Ballot.tsx","webpack:///./app/scripts/endpoints.ts","webpack:///./app/scripts/utils/load-json-script.js","webpack:///./app/scripts/packs/main.js"],"names":["require","window","ttData","relatedContentContainer","document","getElementById","related_category","then","_ref","default","RelatedContent","render","h","title","_ref2","AdLoader","targetingKey","targetingValue","init","PartyPill","excludeInitial","party","style","partyPrefix","slice","toLowerCase","partyInitial","toUpperCase","classes","cx","concat","class","capfirst","defaultProps","CandidateRow","Component","divStyle","ballotName","isIncumbent","isViewable","candidateColor","this","props","rowClass","_defineProperty","contestIsCalled","Header","colSpan","countyHeader","columnCount","TT_directory_slugs","office","determineContestTitle","contest","division_type","office_division","trim","determineDistrictTitleRunoff","determineContestTitleYourRaces","determineDistrictTitleYourRaces","Contest","contestTitle","contestOffice","renderCandidate","tableHeader","notes","isNoted","length","candidates","candidacies","partyName","directory_slug","filter","slug","href","xlinkHref","map","candidate","idx","totalVotes","dangerouslySetInnerHTML","__html","value","visibleCandidatesCount","store","Store","constructor","dbName","arguments","undefined","storeName","_dbp","Promise","resolve","reject","openreq","indexedDB","open","onerror","error","onsuccess","result","onupgradeneeded","createObjectStore","_withIDBStore","type","callback","db","transaction","oncomplete","onabort","objectStore","getDefaultStore","Portal","componentDidMount","renderPortal","componentWillUnmount","defaultNode","body","removeChild","node","portal","componentDidUpdate","createElement","appendChild","children","hOP","Object","prototype","hasOwnProperty","is","x","y","shallowEqual","objA","objB","keysA","keys","keysB","i","call","PureComponent","shouldComponentUpdate","state","debounce","func","wait","immediate","timeout","args","context","timestamp","later","last","Date","now","setTimeout","apply","callNow","Typeahead","super","highlightedIndex","isOpen","handleOnBlur","bind","handleOnClear","handleOnFocus","handleOnInput","debouncedHandleOnInput","debounceDuration","handleKeyDown","setInputRef","setMenuRef","setItemRef","listRefs","_","prevState","count","getFilteredItems","Boolean","setState","maybeScrollItemIntoView","element","inputRef","menuRef","itemNode","menuNode","scrollIntoView","block","items","shouldItemRender","sortItems","item","sort","a","b","highlightItemOnMouseEnter","selectItemOnClick","getItemValue","onSelect","blur","renderList","ref","onMouseDown","event","preventDefault","cloneElement","renderItem","onClick","onMouseEnter","el","renderAttribution","onClear","onBlur","inputProps","onFocus","target","onChange","keyEvents","key","renderInput","_objectSpread","role","String","autocomplete","onInput","onKeyDown","aria-label","aria-hidden","noop","ArrowDown","itemsCount","newIndex","ArrowUp","Enter","keyCode","select","setSelectionRange","Escape","jsonResponse","res","ok","Error","status","statusText","json","getJSON","input","fetch","CountyInfo","data","isLoaded","fetchAddress","prevProps","fips","county","replace","process","admin_title","name","web_site","phone_number","elementId","googleIMG","getAttribute","JSON","parse","textContent","asset_url","sessionToken","google","maps","places","AutocompleteSessionToken","autocompleteService","AutocompleteService","bounds","east","west","south","north","componentRestrictions","country","types","YourRaces","contests","coordinates","lookupError","lookupPending","results","handleGeocode","debouncedHandleGeocode","getPlacePredictions","predict","getPredictions","catch","placeId","placesService","getDetails","fields","lat","latitude","lng","longitude","geometry","location","toJSON","includeGeography","LOOKUP_URL","lookup","put","set","PlacesService","addressFeedback","matches","sboe","arr","getElementsByClassName","innerHTML","us_house","district","tx_senate","tx_house","for","id","placeholder","description","place_id","isHighlighted","src","_extends","_resultsPortal","office_slug","_ref3","candidateId","is_incumbent","isWinner","is_winner","totalVotesInContest","votes","column","_ref4","_ref5","_ref6","App","fetchData","seats_mapped","number","propertyName","array","e","findIndex","loadJsonScript","_yourPortal","querySelector","_usPortal","_supremePortal","_sboePortal","_senatePortal","_housePortal"],"mappings":"4IAGAA,EAAQ,S,yDCARC,OAAOC,OAASD,OAAOC,QAAU,GAGjC,IAAMC,EAA0BC,SAASC,eACvC,6BAGEF,GAA2BF,OAAOC,OAAOI,kBAC3C,iCAEEC,KAAKC,IAAA,IAAGC,QAASC,GAAgBF,EAAA,OACjCG,YACEC,YAACF,EAAc,CACbG,MAAO,YACPP,iBAAkBL,OAAOC,OAAOI,mBAElCH,KAeN,iCAA0DI,KACxDO,IAA4B,IAAzBL,QAASM,GAAUD,EACR,IAAIC,EAAS,CACvBC,aAAc,YACdC,eAAgBhB,OAAOC,OAAOe,iBAE5BC,S,iDC7BR,SAASC,EAASX,GAA2C,IAA1C,eAAEY,EAAc,MAAEC,EAAK,MAAEC,GAAcd,EAClDe,EAAcF,EAAMG,MAAM,EAAG,GAAGC,cAChCC,EAAeL,EAAM,GAAGM,cAExBC,EAAUC,IAAG,cAAc,SAADC,OAAWP,IAE3C,OACEX,YAAA,QAAMmB,MAAOH,EAASN,MAAOA,EAAOT,MAAOmB,YAASX,KAChDD,GAAkBM,GAK1BP,EAAUc,aAAe,CACvBb,gBAAgB,GAGHD,QCZf,MAAMe,UAAqBC,IAKzBxB,SACE,IAQIyB,GARE,WACJC,EAAU,YACVC,EAAW,WACXC,EAAU,eACVC,EAAc,MACdnB,GACEoB,KAAKC,MAILF,IACFJ,EAAW,CACT,mBAAoBI,IAIxB,IAAIG,EAAWd,IAAG,YAAa,0BAM/B,OAJKU,IACHI,GAAY,gCAIZ/B,YAAA,MAAImB,MAAOY,GACT/B,YAAA,MAAImB,MAAM,qCACNS,GAAkB5B,YAACO,EAAS,CAACE,MAAOA,IACrCmB,GAAkB5B,YAACO,EAAS,CAACE,MAAOA,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QwH,GAAcA,EAAKvF,OAASpD,EAAQuR,aAAe5I,EAAKvF,OAAI,GAAA3E,OAAQuB,EAAQuR,YAAW,KAAA9S,OAAIuB,EAAQhC,QACxH0C,gBAAiBA,OAMzBnD,YAACqG,EAAM,CAACO,KAAMpH,SAAS8V,cAAc,0BAA2BxJ,IAAMA,GAAcjK,KAAK8T,aAAe7J,GACtG9L,YAAA,OAAKmB,MAAM,0CACR2N,EAAKlL,OAAQnB,GAAoC,gBAAnBA,EAAQF,QAA0ByB,IAAKvB,GACpEzC,YAACgD,EAAO,CACN+J,IAAKtK,EAAQ+Q,GACb/Q,QAASA,EACTJ,YAAaf,EAAae,YAC1BY,aAAcT,EAAsBsM,EAAKlL,OAAQwH,GAAcA,EAAK4I,cAAgBvR,EAAQuR,aAAa,IACzG5Q,YAAa9B,EAAaY,OAC1BmB,MAAOA,EAAMO,OAAQwH,GAAcA,EAAKvF,OAASpD,EAAQuR,aAAe5I,EAAKvF,OAAI,GAAA3E,OAAQuB,EAAQuR,YAAW,KAAA9S,OAAIuB,EAAQhC,QACxH0C,gBAAiBA,SAUlByR,QG9Of7U,YAAOC,YAAC4U,EAAG,MAAKpV,SAASC,eAAe,U","file":"main.a46305a390.mjs","sourcesContent":["'use strict';\n\n// We depend on intersection-observer enough that it should just be assumed as necessary\nrequire('intersection-observer');\n","import { h, render } from 'preact';\n\n// just in case this gets removed\nwindow.ttData = window.ttData || {};\n\n// related content\nconst relatedContentContainer = document.getElementById(\n  'related-content-container'\n);\n\nif (relatedContentContainer && window.ttData.related_category) {\n  import(\n    /* webpackChunkName: \"RelatedContent\" */ './components/RelatedContent'\n  ).then(({ default: RelatedContent }) =>\n    render(\n      <RelatedContent\n        title={'Read more'}\n        related_category={window.ttData.related_category}\n      />,\n      relatedContentContainer\n    )\n  );\n}\n\n// trending ribbon\n// const ribbonContainer = document.getElementById('ribbon-container');\n\n// if (ribbonContainer) {\n//   import(/* webpackChunkName: \"Ribbon\" */ './components/Ribbon').then(\n//     ({ default: Ribbon }) => render(<Ribbon />, ribbonContainer)\n//   );\n// }\n\n// ads\nimport(/* webpackChunkName: \"ads\" */ './utils/ad-loader').then(\n  ({ default: AdLoader }) => {\n    const ads = new AdLoader({\n      targetingKey: 'tribpedia',\n      targetingValue: window.ttData.targetingValue,\n    });\n    ads.init();\n  }\n);\n","// packages\nimport cx from 'classnames';\nimport { capfirst } from 'journalize';\nimport { h } from 'preact';\n\ntype Props = {\n  excludeInitial?: boolean;\n  party: string;\n  style: string;\n};\n\nfunction PartyPill({ excludeInitial, party, style }: Props) {\n  const partyPrefix = party.slice(0, 3).toLowerCase();\n  const partyInitial = party[0].toUpperCase();\n\n  const classes = cx('circle-pill', `pill--${partyPrefix}`);\n\n  return (\n    <span class={classes} style={style} title={capfirst(party)}>\n      {!excludeInitial && partyInitial}\n    </span>\n  );\n}\n\nPartyPill.defaultProps = {\n  excludeInitial: false,\n};\n\nexport default PartyPill;\n","import cx from 'classnames';\nimport { Component, h, VNode } from 'preact';\n\nimport PartyPill from './PartyPill';\n\ninterface Props {\n  ballotName: string;\n  candidateId: string;\n  contestIsCalled: boolean;\n  isIncumbent: boolean;\n  isWinner: boolean;\n  party: string;\n  totalVotesInContest: number;\n  votes: number;\n}\n\nclass CandidateRow extends Component<Props> {\n  static Header: VNode;\n  static countyHeader: VNode;\n  static columnCount: number;\n\n  render() {\n    const {\n      ballotName,\n      isIncumbent,\n      isViewable,\n      candidateColor,\n      party,\n    } = this.props;\n\n    let divStyle;\n\n    if (candidateColor) {\n      divStyle = {\n        'background-color': candidateColor,\n      };\n    }\n\n    let rowClass = cx('candidate', 'contest__candidate-row');\n\n    if (!isViewable) {\n      rowClass += ' race__candidate-row--hidden';\n    }\n\n    return (\n      <tr class={rowClass}>\n        <td class=\"candidate__cell candidate__party\">\n          {!candidateColor && <PartyPill party={party} />}\n          {candidateColor && <PartyPill party={party} style={divStyle} />}\n        </td>\n        <th class=\"candidate__cell candidate__name\">\n          {ballotName}{' '}\n          {isIncumbent && (\n            <span class=\"pill pill--basic\" title=\"Currently holds this seat\">\n              Incumbent\n            </span>\n          )}\n        </th>\n      </tr>\n    );\n  }\n}\n\nCandidateRow.defaultProps = {\n  contestIsCalled: false,\n  isViewable: true,\n};\n\nCandidateRow.Header = (\n  <thead>\n    <tr>\n      <th class=\"contest__candidate-header\" colSpan={2}>\n        Candidates\n      </th>\n    </tr>\n  </thead>\n);\n\nCandidateRow.countyHeader = (\n  <thead>\n    <tr>\n      <th class=\"contest__candidate-header\" colSpan={2}>\n        Candidates\n      </th>\n    </tr>\n  </thead>\n);\n\nCandidateRow.columnCount = 2;\n\nexport default CandidateRow;\n\n","import { capfirst } from 'journalize';\n\nconst TT_directory_slugs = [\n  { office: 'Texas House', 'directory-slug': 'tx-house' },\n  { office: 'Texas Senate', 'directory-slug': 'tx-senate' },\n  { office: 'U.S. House', 'directory-slug': 'us-house' },\n  { office: 'State Board of Education', 'directory-slug': 'sboe' },\n];\n\nexport function get_directory_slug(office: any) {\n  return TT_directory_slugs.filter(slug => slug.office == office);\n}\n\nconst OFFICE_NOTE_SLUGS: { [key: string]: string } = {\n  'U.S. Senate': 'us-senate',\n  'Attorney General': 'attorney-general',\n  'Texas Railroad Commission': 'railroad-commissioner',\n  'Lieutenant Governor': 'lieutenant-governor',\n  'Texas Court of Criminal Appeals': 'texas-court-of-criminal-appeals',\n  'U.S. House': 'us-house',\n  'State Board of Education': 'state-board-of-education',\n  'Texas Senate': 'texas-senate',\n  'Texas House': 'texas-house',\n};\n\nexport function getNoteKey(contest: any) {\n  const slug = OFFICE_NOTE_SLUGS[contest.office] || contest.office_slug;\n  if (!slug) return null;\n  if (contest.division_type === 'statewide' || !contest.office_division) {\n    return slug;\n  }\n  return `${slug}-district-${contest.office_division}-${contest.party}`;\n}\n\nconst PARTY_SORT_ORDER = [\n  'democrat',\n  'republican',\n  'libertarian',\n  'independent',\n  'write-in',\n];\n\nexport function sort_candidates_by_party(candidates: any) {\n  return candidates.sort(\n    (a: any, b: any) =>\n      PARTY_SORT_ORDER.indexOf(a.party) - PARTY_SORT_ORDER.indexOf(b.party)\n  );\n}\n\nexport function determineDistrictTitle(contest: any) {\n  return `${contest.office} ${\n    contest.office === 'President' || contest.division_type === 'class'\n      ? ''\n      : contest.division_type === 'place' && contest.office_division === 1\n      ? 'Chief Justice'\n      : capfirst(contest.division_type) + ' ' + contest.office_division\n  }`.trim();\n}\n\nexport function determineDistrictTitleYourRaces(contest: any) {\n  return `${\n    contest.office === 'President' || contest.division_type === 'class'\n      ? ''\n      : contest.division_type === 'place' && contest.office_division === 1\n      ? 'Chief Justice'\n      : capfirst(contest.division_type) + ' ' + contest.office_division\n  }`.trim();\n}\n\nexport function determineDistrictTitleRunoff(contest: any) {\n  return `${\n    contest.office === 'President' || contest.division_type === 'class'\n      ? ''\n      : contest.division_type === 'place' && contest.office_division === 1\n      ? 'Chief Justice'\n      : 'District ' + contest.office_division\n  }`.trim();\n}\n\nexport function determineContestTitle(contest: any) {\n  if (\n    contest.division_type === 'statewide' ||\n    contest.division_type === 'seat' ||\n    contest.division_type === 'class'\n  )\n    return '';\n\n  return determineDistrictTitleRunoff(contest);\n}\n\nexport function determineContestTitleYourRaces(contest: any) {\n  return determineDistrictTitleYourRaces(contest);\n}\n","import cx from 'classnames';\nimport { Component, h } from 'preact';\n\nimport { get_directory_slug } from '../election-utils';\n\ntype Props = {\n  contest: { [key: string]: any };\n  columnCount: number;\n  tableHeader: JSX.Element;\n  contestTitle: string;\n  contestOffice?: string;\n  renderCandidate: any;\n  visibleCandidatesCount?: number;\n  notes?: { type: string; value: string }[];\n};\n\nclass Contest extends Component<Props> {\n  render() {\n    const {\n      contest,\n      columnCount,\n      contestTitle,\n      contestOffice,\n      renderCandidate,\n      tableHeader,\n      notes,\n    } = this.props;\n\n    const isNoted = notes && notes.length > 0;\n\n    let totalVotes;\n\n    const isStatewide = contest.division_type === 'statewide';\n\n    let candidates = contest.candidacies;\n\n    let partyName = contest.party;\n\n    const directory_slug = get_directory_slug(contest.office);\n\n    const rowClass = cx('seat__race', {\n      'seat__race--Democrat': partyName == 'Democrat',\n      'seat__race--Republican': partyName == 'Republican',\n    });\n\n    return (\n      <div class=\"seat\">\n        <div class={rowClass}>\n          <div class=\"race\">\n            {contestOffice != null && (\n              <h2 class=\"office__title\">{contestOffice}</h2>\n            )}\n            <h4 class=\"seat__title\">\n              {contestTitle ? (\n                <span>{contestTitle}</span>\n              ) : (\n                <span>\n                  {partyName == 'Democrat' && <span>{partyName}ic</span>}\n                  {partyName == 'Republican' && <span>{partyName}</span>}\n                </span>\n              )}\n              {directory_slug[0] && contestTitle && (\n                <span class=\"district__title\">\n                  <a\n                    class=\"t-links-unset\"\n                    href={`https://directory.texastribune.org/districts/${directory_slug[0]['directory-slug']}/${contest['office_division']}/`}\n                  >\n                    <span\n                      class=\"icon-div\"\n                      title=\"Click to learn more about this district\"\n                    >\n                      <svg class=\"icon icon-info\">\n                        <use xlinkHref=\"#icon-info\"></use>\n                      </svg>\n                    </span>\n                  </a>\n                </span>\n              )}\n            </h4>\n            {contestTitle && (\n              <h4 class=\"race__title\">\n                {partyName == 'Democrat' && <span>{partyName}ic</span>}\n                {partyName == 'Republican' && <span>{partyName}</span>}\n              </h4>\n            )}\n\n            <table class=\"race__candidates\">\n              {tableHeader}\n              <tbody>\n                {candidates.map((candidate: any, idx: any) =>\n                  renderCandidate(candidate, idx, {\n                    totalVotes,\n                  })\n                )}\n              </tbody>\n            </table>\n            {isNoted && (\n              <p\n                class=\"note__text\"\n                dangerouslySetInnerHTML={{ __html: notes[0].value }}\n              />\n            )}\n          </div>\n        </div>\n      </div>\n    );\n  }\n}\n\nContest.defaultProps = {\n  visibleCandidatesCount: 3,\n};\n\nexport default Contest;\n","class Store {\n  constructor(dbName = 'keyval-store', storeName = 'keyval') {\n    this.storeName = storeName;\n    this._dbp = new Promise((resolve, reject) => {\n      const openreq = indexedDB.open(dbName, 1);\n      openreq.onerror = () => reject(openreq.error);\n      openreq.onsuccess = () => resolve(openreq.result);\n      // First time setup: create an empty object store\n      openreq.onupgradeneeded = () => {\n        openreq.result.createObjectStore(storeName);\n      };\n    });\n  }\n  _withIDBStore(type, callback) {\n    return this._dbp.then(\n      db =>\n        new Promise((resolve, reject) => {\n          const transaction = db.transaction(this.storeName, type);\n          transaction.oncomplete = () => resolve();\n          transaction.onabort = transaction.onerror = () =>\n            reject(transaction.error);\n          callback(transaction.objectStore(this.storeName));\n        })\n    );\n  }\n}\nlet store;\nfunction getDefaultStore() {\n  if (!store) store = new Store();\n  return store;\n}\nfunction get(key, store = getDefaultStore()) {\n  let req;\n  return store\n    ._withIDBStore('readonly', store => {\n      req = store.get(key);\n    })\n    .then(() => req.result);\n}\nfunction set(key, value, store = getDefaultStore()) {\n  return store._withIDBStore('readwrite', store => {\n    store.put(value, key);\n  });\n}\nfunction del(key, store = getDefaultStore()) {\n  return store._withIDBStore('readwrite', store => {\n    store.delete(key);\n  });\n}\nfunction clear(store = getDefaultStore()) {\n  return store._withIDBStore('readwrite', store => {\n    store.clear();\n  });\n}\nfunction keys(store = getDefaultStore()) {\n  const keys = [];\n  return store\n    ._withIDBStore('readonly', store => {\n      // This would be store.getAllKeys(), but it isn't supported by Edge or Safari.\n      // And openKeyCursor isn't supported by Safari.\n      (store.openKeyCursor || store.openCursor).call(\n        store\n      ).onsuccess = function() {\n        if (!this.result) return;\n        keys.push(this.result.key);\n        this.result.continue();\n      };\n    })\n    .then(() => keys);\n}\n\nexport { Store, get, set, del, clear, keys };\n","import { Component, h, render } from 'preact';\n\nclass Portal extends Component {\n  componentDidMount() {\n    this.renderPortal();\n  }\n\n  componentWillUnmount() {\n    if (this.defaultNode) {\n      document.body.removeChild(this.defaultNode);\n    } else {\n      // Unmount the children rendered in custom node\n      render(null, this.props.node, this.portal);\n    }\n\n    this.defaultNode = null;\n    this.portal = null;\n  }\n\n  componentDidUpdate() {\n    this.renderPortal();\n  }\n\n  renderPortal() {\n    if (!this.props.node && !this.defaultNode) {\n      this.defaultNode = document.createElement('div');\n      document.body.appendChild(this.defaultNode);\n    }\n\n    const children = this.props.children;\n\n    this.portal = render(\n      (children && children[0]) || null,\n      this.props.node || this.defaultNode,\n      this.portal\n    );\n  }\n\n  render() {\n    return null;\n  }\n}\n\nexport default Portal;\n","const hOP = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x: any, y: any): boolean {\n  // SameValue algorithm\n  if (x === y) {\n    // Steps 1-5, 7-10\n    // Steps 6.b-6.e: +0 != -0\n    // Added the nonzero y check to make Flow happy, but it is redundant\n    return x !== 0 || y !== 0 || 1 / x === 1 / y;\n  }\n  // Step 6.a: NaN == NaN\n  return x !== x && y !== y;\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA: object, objB: object): boolean {\n  if (is(objA, objB)) {\n    return true;\n  }\n\n  if (\n    typeof objA !== 'object' ||\n    objA === null ||\n    typeof objB !== 'object' ||\n    objB === null\n  ) {\n    return false;\n  }\n\n  const keysA = Object.keys(objA);\n  const keysB = Object.keys(objB);\n\n  if (keysA.length !== keysB.length) {\n    return false;\n  }\n\n  // Test for A's keys different from B.\n  for (let i = 0; i < keysA.length; i++) {\n    if (!hOP.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nexport default shallowEqual;\n","// packages\nimport { Component } from 'preact';\n\n// internal\nimport shallowEqual from '../utils/shallow-equal';\n\nabstract class PureComponent<P = {}, S = {}> extends Component<P, S> {\n  shouldComponentUpdate(props, state) {\n    const check =\n      shallowEqual(props, this.props) && shallowEqual(state, this.state);\n    return !check;\n  }\n}\n\nexport default PureComponent;\n","export default function debounce(func, wait, immediate) {\n  var timeout, args, context, timestamp, result;\n\n  var later = function() {\n    var last = Date.now() - timestamp;\n\n    if (last < wait && last >= 0) {\n      timeout = setTimeout(later, wait - last);\n    } else {\n      timeout = null;\n      if (!immediate) {\n        result = func.apply(context, args);\n        if (!timeout) context = args = null;\n      }\n    }\n  };\n\n  return function() {\n    context = this;\n    args = arguments;\n    timestamp = Date.now();\n    var callNow = immediate && !timeout;\n    if (!timeout) timeout = setTimeout(later, wait);\n    if (callNow) {\n      result = func.apply(context, args);\n      context = args = null;\n    }\n\n    return result;\n  };\n}\n","export default () => {};\n","// packages\nimport { cloneElement, Component, h } from 'preact';\n\n// internal\nimport debounce from '../utils/debounce';\nimport noop from '../utils/noop';\n\nclass Typeahead extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      highlightedIndex: null,\n      isOpen: false,\n    };\n\n    this.handleOnBlur = this.handleOnBlur.bind(this);\n    this.handleOnClear = this.handleOnClear.bind(this);\n    this.handleOnFocus = this.handleOnFocus.bind(this);\n    this.handleOnInput = this.handleOnInput.bind(this);\n    this.debouncedHandleOnInput = debounce(\n      this.handleOnInput,\n      this.props.debounceDuration\n    );\n    this.handleKeyDown = this.handleKeyDown.bind(this);\n    this.setInputRef = this.setInputRef.bind(this);\n    this.setMenuRef = this.setMenuRef.bind(this);\n    this.setItemRef = this.setItemRef.bind(this);\n\n    this.listRefs = {};\n  }\n\n  static getDerivedStateFromProps(_, prevState) {\n    if (prevState.highlightedIndex == null) {\n      return { highlightedIndex: 0 };\n    }\n  }\n\n  componentDidUpdate() {\n    const { highlightedIndex } = this.state;\n    const count = this.getFilteredItems(this.props).length;\n\n    if (Boolean(highlightedIndex) && highlightedIndex >= count) {\n      this.setState({ highlightedIndex: 0 });\n    }\n\n    this.maybeScrollItemIntoView();\n  }\n\n  setInputRef(element) {\n    this.inputRef = element;\n  }\n\n  setMenuRef(element) {\n    this.menuRef = element;\n  }\n\n  setItemRef(element, idx) {\n    this.listRefs[`item-${idx}`] = element;\n  }\n\n  maybeScrollItemIntoView() {\n    const { highlightedIndex, isOpen } = this.state;\n\n    if (isOpen && highlightedIndex != null) {\n      const itemNode = this.listRefs[`item-${this.state.highlightedIndex}`];\n      const menuNode = this.menuRef;\n\n      if (itemNode && menuNode) {\n        itemNode.scrollIntoView({ block: 'nearest' });\n      }\n    }\n  }\n\n  getFilteredItems(props) {\n    let { items } = props;\n\n    const { shouldItemRender, sortItems } = props;\n\n    if (shouldItemRender) {\n      items = items.filter(item => shouldItemRender(item, props.value));\n    }\n\n    if (sortItems) {\n      items = items.sort((a, b) => sortItems(a, b, props.value));\n    }\n\n    return items;\n  }\n\n  highlightItemOnMouseEnter(highlightedIndex) {\n    this.setState({ highlightedIndex });\n  }\n\n  selectItemOnClick(item) {\n    const { getItemValue, onSelect } = this.props;\n\n    const value = getItemValue(item);\n\n    this.setState(\n      {\n        highlightedIndex: null,\n        isOpen: false,\n      },\n      () => {\n        this.inputRef.blur();\n        onSelect(value, item);\n      }\n    );\n  }\n\n  renderList() {\n    const { highlightedIndex } = this.state;\n    const props = this.props;\n\n    if (!props.value) return null;\n\n    const items = this.getFilteredItems(props);\n\n    return (\n      <ul\n        class=\"listbox\"\n        ref={this.setMenuRef}\n        onMouseDown={event => event.preventDefault()}\n      >\n        {items.map((item, idx) => {\n          return cloneElement(\n            props.renderItem(item, idx === highlightedIndex),\n            {\n              onClick: () => this.selectItemOnClick(item),\n              onMouseEnter: () => this.highlightItemOnMouseEnter(idx),\n              ref: el => this.setItemRef(el, idx),\n            }\n          );\n        })}\n        {items.length > 0 && props.renderAttribution()}\n      </ul>\n    );\n  }\n\n  handleOnClear(event) {\n    this.setState({ isOpen: false });\n\n    this.props.onClear(event);\n  }\n\n  handleOnBlur() {\n    this.setState({ isOpen: false });\n\n    const { onBlur } = this.props.inputProps;\n    if (onBlur) onBlur(event);\n  }\n\n  handleOnFocus(event) {\n    const { value } = this.props;\n\n    if (value.length > 0) this.setState({ isOpen: true });\n\n    const { onFocus } = this.props.inputProps;\n    if (onFocus) onFocus(event);\n  }\n\n  handleOnInput(event) {\n    const { value } = event.target;\n\n    this.props.onChange(value, event);\n\n    if (value.length <= 0) {\n      this.setState({ highlightedIndex: null });\n    }\n  }\n\n  handleKeyDown(event) {\n    const { isOpen } = this.state;\n\n    if (isOpen && Typeahead.keyEvents[event.key]) {\n      Typeahead.keyEvents[event.key].call(this, event);\n    } else if (!isOpen) {\n      this.setState({ isOpen: true });\n    }\n  }\n\n  render() {\n    const { inputProps, onClear, renderInput, value } = this.props;\n    const { isOpen } = this.state;\n\n    return (\n      <div class=\"typeahead\">\n        <div class=\"typeahead__input-wrapper\">\n          {renderInput({\n            ...inputProps,\n            role: 'combobox',\n            'aria-autocomplete': 'list',\n            'aria-expanded': String(isOpen),\n            autocomplete: 'off',\n            onBlur: this.handleOnBlur,\n            onFocus: this.handleOnFocus,\n            onInput: this.handleOnInput,\n            onKeyDown: this.handleKeyDown,\n            value,\n            ref: this.setInputRef,\n          })}\n          {onClear && value && (\n            <button\n              onClick={this.handleOnClear}\n              type=\"button\"\n              class=\"close\"\n              aria-label=\"Clear\"\n            >\n              <span aria-hidden=\"true\">&times;</span>\n            </button>\n          )}\n        </div>\n        {isOpen && this.renderList()}\n      </div>\n    );\n  }\n}\n\nTypeahead.defaultProps = {\n  debounceDuration: 150,\n  inputProps: {},\n  onChange: noop,\n  onClear: noop,\n  onSelect: noop,\n  renderInput: props => <input {...props} />,\n  value: '',\n};\n\nTypeahead.keyEvents = {\n  ArrowDown(event) {\n    event.preventDefault();\n\n    const items = this.getFilteredItems(this.props);\n    const itemsCount = items.length;\n    if (itemsCount < 1) return;\n\n    const { highlightedIndex } = this.state;\n\n    const newIndex =\n      highlightedIndex < itemsCount - 1\n        ? highlightedIndex + 1\n        : highlightedIndex;\n\n    this.setState({ highlightedIndex: newIndex });\n  },\n\n  ArrowUp(event) {\n    event.preventDefault();\n\n    const items = this.getFilteredItems(this.props);\n    const itemsCount = items.length;\n    if (itemsCount < 1) return;\n\n    const { highlightedIndex } = this.state;\n\n    const newIndex =\n      highlightedIndex > 0 ? highlightedIndex - 1 : highlightedIndex;\n\n    this.setState({ highlightedIndex: newIndex });\n  },\n\n  Enter(event) {\n    // not the right kind of Enter, abort\n    if (event.keyCode !== 13) return;\n\n    const { highlightedIndex, isOpen } = this.state;\n\n    if (!isOpen) {\n      // the menu is not open\n      return;\n    } else if (highlightedIndex == null) {\n      // input has control, but there's nothing selected\n      this.setState({ isOpen: false }, () => this.inputRef.select());\n    } else {\n      // the input has control and we have an item\n      event.preventDefault();\n\n      const item = this.getFilteredItems(this.props)[highlightedIndex];\n      const value = this.props.getItemValue(item);\n\n      this.setState(\n        {\n          highlightedIndex: null,\n          isOpen: false,\n        },\n        () => {\n          this.inputRef.setSelectionRange(value.length, value.length);\n          this.props.onSelect(value, item);\n        }\n      );\n    }\n  },\n\n  Escape() {\n    this.setState({\n      highlightedIndex: null,\n      isOpen: false,\n    });\n  },\n};\n\nexport default Typeahead;\n","/**\n * A wrapper for the initial response from a fetch call that funnels to\n * res.json().\n *\n * @private\n * @param {Response} res\n * @returns {Promise}\n */\nfunction jsonResponse(res) {\n  if (!res.ok) throw new Error(`${res.status}: ${res.statusText}`);\n\n  return res.json();\n}\n\n/**\n * A light wrapper around fetch that assumes you're seeking a JSON response.\n *\n * @param {String|Request} input\n * @param {Object} init\n * @returns {Promise}\n */\nexport default function getJSON(input, init = undefined) {\n  return fetch(input, init).then(jsonResponse);\n}\n","import { h } from 'preact';\nimport getJSON from '../utils/get-json';\nimport PureComponent from './PureComponent';\n\nclass CountyInfo extends PureComponent {\n  constructor() {\n    super();\n\n    this.state = { data: null, isLoaded: false };\n  }\n\n  componentDidMount() {\n    this.fetchAddress();\n  }\n\n  componentDidUpdate(prevProps) {\n    if (this.props.fips !== prevProps.fips) {\n      this.fetchAddress();\n    }\n  }\n\n  fetchAddress() {\n    const { county } = this.props;\n    const slug = county.toLowerCase().replace(/\\s+/g, '');\n\n    getJSON(`${process.env.PUBLIC_PATH}api/counties/${slug}.json`).then(\n      data => {\n        this.setState({ data, isLoaded: true });\n      }\n    );\n  }\n\n  render() {\n    const { county } = this.props;\n    const { data, isLoaded } = this.state;\n\n    if (!isLoaded) return null;\n\n    return (\n      <div class=\"t-serif t-links-underlined has-page-padding\">\n        <p class=\"t-copy\">\n          Because you shared your location with us, we were able to determine\n          you are in <span class=\"font-weight-bold\">{county} County</span>. Your\n          primary election contact is{' '}\n          <span class=\"font-weight-bold\">\n            {data.admin_title} {data.name}\n          </span>\n          . To learn more about your local races and see a sample ballot,{' '}\n          <a class=\"t-links-underlined\" href={data.web_site}>\n            you can visit the county's website\n          </a>\n          , or call the election office at{' '}\n          <span class=\"font-weight-bold\">{data.phone_number}</span>.\n        </p>\n      </div>\n    );\n  }\n}\n\nexport default CountyInfo;\n","// packages\nimport cx from 'classnames';\nimport { set } from '../vendor/idb-keyval';\nimport { h } from 'preact';\n\n// components\nimport CandidateRow from './CandidateRow';\nimport Contest from './Contest';\nimport Portal from './Portal';\nimport PureComponent from './PureComponent';\nimport Typeahead from './Typeahead';\nimport CountyInfo from './CountyInfo';\n\n// internal\nimport debounce from '../utils/debounce';\nimport { determineContestTitleYourRaces } from '../election-utils';\nimport { lookup } from '../utils/legislative-districts';\nimport loadAssetURL from '../utils/load-asset-url';\n\nconst googleIMG = loadAssetURL('powered-by-google');\n\nconst sessionToken = new google.maps.places.AutocompleteSessionToken();\nconst autocompleteService = new google.maps.places.AutocompleteService();\n\nconst bounds = {\n  east: -93.514764,\n  west: -106.662177,\n  south: 25.843902,\n  north: 36.500199,\n};\n\nconst componentRestrictions = { country: 'us' };\nconst types = ['geocode'];\n\nconst getPredictions = input => {\n  return new Promise((resolve, reject) => {\n    autocompleteService.getPlacePredictions(\n      { bounds, componentRestrictions, input, sessionToken, types },\n      (predict, status) => {\n        if (status === 'OK') resolve(predict);\n\n        reject(new Error('No results found.'));\n      }\n    );\n  });\n};\n\n// always render what's provided, the geocoder decides\nconst shouldItemRender = () => true;\n\nclass YourRaces extends PureComponent {\n  constructor() {\n    super();\n\n    this.state = {\n      contests: [],\n      coordinates: null,\n      data: null,\n      lookupError: false,\n      lookupPending: false,\n      results: [],\n      value: '',\n    };\n\n    this.handleGeocode = this.handleGeocode.bind(this);\n    this.debouncedHandleGeocode = debounce(this.handleGeocode, 300);\n    this.onChange = this.onChange.bind(this);\n    this.onClear = this.onClear.bind(this);\n    this.onSelect = this.onSelect.bind(this);\n  }\n\n  onClear(value) {\n    this.setState({ value: '' });\n  }\n\n  onChange(value) {\n    this.setState({ value }, this.debouncedHandleGeocode);\n  }\n\n  handleGeocode() {\n    const { value: input } = this.state;\n\n    getPredictions(input)\n      .then(results => this.setState({ results }))\n      .catch(() => this.setState({ results: [] }));\n  }\n\n  onSelect({ name, placeId }) {\n    this.setState({ lookupError: false, lookupPending: true, value: name });\n\n    this.placesService.getDetails(\n      {\n        fields: ['geometry.location'],\n        placeId,\n        sessionToken,\n      },\n      result => {\n        const {\n          lat: latitude,\n          lng: longitude,\n        } = result.geometry.location.toJSON();\n\n        const coordinates = { latitude, longitude };\n\n        lookup(coordinates)\n          .then(({ data }) =>\n            this.setState(\n              {\n                coordinates,\n                data,\n                lookupPending: false,\n              },\n              () => set('your-races-lookup', data)\n            )\n          )\n          .catch(() =>\n            this.setState({\n              data: null,\n              lookupError: true,\n              lookupPending: false,\n            })\n          );\n      }\n    );\n  }\n\n  componentDidMount() {\n    this.placesService = new google.maps.places.PlacesService(this.inputRef);\n  }\n\n  render() {\n    const { contests } = this.props;\n    const {\n      coordinates,\n      data,\n      lookupError,\n      lookupPending,\n      results,\n      value,\n    } = this.state;\n\n    let addressFeedback = null;\n\n    const matches = {\n      'us-house': null,\n      sboe: null,\n      'tx-senate': null,\n      'tx-house': null,\n    };\n\n    if (data) {\n\n      // Hacky fix for bug that let old races hang around after you search for an address in another district\n      var arr = document.getElementsByClassName(\"representative-districts\")\n      for (var i = 0; i < arr.length; i++) {\n        arr[i].innerHTML = \" \";\n     }\n\n      matches['us-house'] = contests.filter(\n        contest =>\n          contest.office === 'U.S. House' &&\n          contest.office_division === data.us_house.district\n      );\n\n      matches['sboe'] = contests.filter(\n        contest =>\n          contest.office === 'State Board of Education' &&\n          contest.office_division === data.sboe.district\n      );\n\n      matches['tx-senate'] = contests.filter(\n        contest =>\n          contest.office === 'Texas Senate' &&\n          contest.office_division === data.tx_senate.district\n      );\n\n      matches['tx-house'] = contests.filter(\n        contest =>\n          contest.office === 'Texas House' &&\n          contest.office_division === data.tx_house.district\n      );\n    }\n\n    if (lookupPending) {\n      addressFeedback = (\n        <p class=\"address-feedback has-padding t-serif t-weight-bold t-align-center\">\n          Finding your details... <br></br> <br></br>\n          <div class=\"c-loading c-loading--tight\" aria-hidden=\"true\"></div>\n        </p>\n      );\n    }\n\n    if (lookupError) {\n      addressFeedback = (\n        <p class=\"address-feedback has-padding t-serif t-weight-bold t-align-center\">\n          Hmm... we were unable to find you in Texas. Please check your address\n          and try again!\n        </p>\n      );\n    }\n\n    if (coordinates && !lookupPending && !lookupError) {\n      addressFeedback = (\n        <p class=\"address-feedback has-padding t-serif t-weight-bold t-align-center\">\n          We found your information! The ballot information has been\n          personalized for you.\n          <br></br> <br></br>\n          You can also vote in statewide and local runoff elections.\n        </p>\n      );\n\n    if (\n      matches['us-house'].length == 0 &&\n      matches['tx-house'].length == 0 &&\n      matches['sboe'].length == 0 &&\n      matches['tx-senate'].length == 0\n    ) {\n      addressFeedback = (\n        <p class=\"address-feedback has-padding t-serif t-weight-bold t-align-center\">\n          No runoff races found in your district. <br></br> <br></br> However,\n          you can still vote in statewide and local runoff elections.\n        </p>\n      );\n    }\n  }\n\n    const inputProps = {\n      id: 'address-input',\n      class: 'address-input__input',\n      placeholder: '1010 Colorado St, Austin, TX, 78701',\n    };\n\n    return (\n      <div class=\"address-input t-sans\">\n        <svg class=\"icon icon-drawn-left-arrow\">\n          <use xlinkHref=\"#icon-drawn-left-arrow\"></use>\n        </svg>\n        <label class=\"address-input__label\" for=\"address-input\">\n          Enter your address\n        </label>\n        <Typeahead\n          inputProps={inputProps}\n          items={results}\n          getItemValue={item => ({\n            name: item.description,\n            placeId: item.place_id,\n          })}\n          value={value}\n          onChange={this.onChange}\n          onClear={this.onClear}\n          onSelect={this.onSelect}\n          renderItem={(item, isHighlighted) => (\n            <li\n              class={cx('listbox__item', {\n                'listbox__item--highlighted': isHighlighted,\n              })}\n              key={item.id}\n            >\n              {item.description}\n            </li>\n          )}\n          renderAttribution={() => (\n            <li class=\"listbox__item listbox__item--attribution\">\n              <img src={googleIMG} />\n            </li>\n          )}\n          shouldItemRender={shouldItemRender}\n          renderInput={props => (\n            <input\n              {...props}\n              ref={el => {\n                props.ref(el);\n                this.inputRef = el;\n              }}\n            />\n          )}\n        />\n        {addressFeedback}\n        <Portal node={document.getElementById('local-candidates-info')}>\n          {data && data.county && (\n            <span>\n              <CountyInfo\n                key={data.county.fips}\n                county={data.county.name}\n                fips={data.county.fips}\n              />\n            </span>\n          )}\n        </Portal>\n        {data && contests.length > 0 && (\n          <Portal\n            node={document.getElementById('your-races-results')}\n            ref={ref => (this._resultsPortal = ref)}\n          >\n            <div class=\"representative-districts contest-list seat__contests-double\">\n              {matches['us-house'].length > 0 &&\n                matches['us-house'].map(contest => (\n                  <Contest\n                    key={matches['us-house'][0].office_slug}\n                    contest={contest}\n                    contestTitle={determineContestTitleYourRaces(\n                      matches['us-house'][0]\n                    )}\n                    contestOffice={matches['us-house'][0].office}\n                    tableHeader={CandidateRow.Header}\n                    columnCount={CandidateRow.columnCount}\n                    renderCandidate={(candidate, idx, { totalVotes }) => (\n                      <CandidateRow\n                        key={candidate.id}\n                        ballotName={candidate.name}\n                        candidateId={candidate.id}\n                        isIncumbent={candidate.is_incumbent}\n                        isWinner={candidate.is_winner}\n                        party={candidate.party}\n                        totalVotesInContest={totalVotes}\n                        votes={candidate.votes}\n                      />\n                    )}\n                  />\n                ))}\n              {matches['sboe'].length > 0 &&\n                matches['sboe'].map(contest => (\n                  <Contest\n                    key={matches['sboe'][0].office_slug}\n                    contest={contest}\n                    contestTitle={determineContestTitleYourRaces(\n                      matches['sboe'][0]\n                    )}\n                    contestOffice={matches['sboe'][0].office}\n                    tableHeader={CandidateRow.Header}\n                    columnCount={CandidateRow.column}\n                    renderCandidate={(candidate, idx, { totalVotes }) => (\n                      <CandidateRow\n                        key={candidate.id}\n                        ballotName={candidate.name}\n                        candidateId={candidate.id}\n                        isIncumbent={candidate.is_incumbent}\n                        isWinner={candidate.is_winner}\n                        party={candidate.party}\n                        totalVotesInContest={totalVotes}\n                        votes={candidate.votes}\n                      />\n                    )}\n                  />\n                ))}\n              {matches['tx-senate'].length > 0 &&\n                matches['tx-senate'].map(contest => (\n                  <Contest\n                    key={matches['tx-senate'][0].office_slug}\n                    contest={contest}\n                    contestTitle={determineContestTitleYourRaces(\n                      matches['tx-senate'][0]\n                    )}\n                    contestOffice={matches['tx-senate'][0].office}\n                    tableHeader={CandidateRow.Header}\n                    columnCount={CandidateRow.columnCount}\n                    renderCandidate={(candidate, idx, { totalVotes }) => (\n                      <CandidateRow\n                        key={candidate.id}\n                        ballotName={candidate.name}\n                        candidateId={candidate.id}\n                        isIncumbent={candidate.is_incumbent}\n                        isWinner={candidate.is_winner}\n                        party={candidate.party}\n                        totalVotesInContest={totalVotes}\n                        votes={candidate.votes}\n                      />\n                    )}\n                  />\n                ))}\n              {matches['tx-house'].length > 0 &&\n                matches['tx-house'].map(contest => (\n                  <Contest\n                    key={matches['tx-house'][0].office_slug}\n                    contest={contest}\n                    contestTitle={determineContestTitleYourRaces(\n                      matches['tx-house'][0]\n                    )}\n                    contestOffice={matches['tx-house'][0].office}\n                    tableHeader={CandidateRow.Header}\n                    columnCount={CandidateRow.columnCount}\n                    renderCandidate={(candidate, idx, { totalVotes }) => (\n                      <CandidateRow\n                        key={candidate.id}\n                        ballotName={candidate.name}\n                        candidateId={candidate.id}\n                        isIncumbent={candidate.is_incumbent}\n                        isWinner={candidate.is_winner}\n                        party={candidate.party}\n                        totalVotesInContest={totalVotes}\n                        votes={candidate.votes}\n                      />\n                    )}\n                  />\n                ))}\n            </div>\n          </Portal>\n        )}\n      </div>\n    );\n  }\n}\n\nexport default YourRaces;\n","/**\n * Grabs the contents of a `jsonScript` created JSON inline string and returns\n * it as a JSON object. If the element does not exist, or if the script\n * element does not have the JSON MIME type, null is returned instead.\n *\n * @param  {String} elementId the ID of the JSON script element\n * @return {Object|null}\n */\nexport default function loadAssetURL(elementId) {\n  const element = document.getElementById(elementId);\n\n  if (element && element.getAttribute('type') === 'application/json') {\n    return JSON.parse(element.textContent).asset_url;\n  } else {\n    return null;\n  }\n}\n","import getJSON from './get-json';\n\nconst LOOKUP_URL = ({ latitude, longitude, includeGeography = false }) =>\n  `https://dv-dev.texastribune.org/legislative-lookup-2025/?latitude=${latitude}&longitude=${longitude}`;\n\nexport function lookup({ latitude, longitude }) {\n  return getJSON(LOOKUP_URL({ latitude, longitude }));\n}\n","// packages\nimport cx from 'classnames';\nimport { Component, h } from 'preact';\n\n// components\nimport CandidateRow from './components/CandidateRow';\nimport Contest from './components/Contest';\nimport YourRaces from './components/YourRaces';\nimport Portal from './components/Portal';\nimport SeatPartyDivider from './components/SeatPartyDivider';\n\nimport { determineContestTitle } from './election-utils';\nimport { RESULTS_IN_USE } from './endpoints';\nimport getJSON from './utils/get-json';\nimport loadJsonScript from './utils/load-json-script';\n\ntype State = {\n  data: { [key: string]: any };\n  now: Date | null;\n};\n\nclass App extends Component<{}, State> {\n  _yourPortal: any;\n  _usPortal: any;\n  _supremePortal: any;\n  _senatePortal: any;\n  _housePortal: any;\n  _sboePortal: any;\n\n  constructor(props: {}) {\n    super(props);\n\n    this.state = {\n      data: [],\n      now: null,\n    };\n\n    this.fetchData = this.fetchData.bind(this);\n  }\n\n  fetchData() {\n    const now = new Date();\n    getJSON(RESULTS_IN_USE).then(data => this.setState({ data, now }));\n  }\n\n  componentDidMount() {\n    this.fetchData();\n  }\n\n  componentWillUnmount() {}\n\n  componentDidUpdate() {}\n\n  render() {\n    const { data } = this.state;\n\n    const seats_mapped = data.map((number: any) => ({\n      office: number.office,\n      office_slug: number.office_slug,\n    }));\n\n    function unique(array: any, propertyName: any) {\n      return array.filter(\n        (e: any, i: any) =>\n          array.findIndex((a: any) => a[propertyName] === e[propertyName]) === i\n      );\n    }\n\n    const unique_seats = unique(seats_mapped, 'office_slug');\n\n    const notes: any[] = (loadJsonScript('notes_data') as any[]) || [];\n\n    const renderCandidate = (candidate: any, idx: any, { totalVotes }: any) => (\n      <CandidateRow\n        key={candidate.id}\n        ballotName={candidate.name}\n        candidateId={candidate.id}\n        contestIsCalled={false}\n        isIncumbent={candidate.is_incumbent}\n        isWinner={candidate.is_winner}\n        party={candidate.party}\n        totalVotesInContest={totalVotes}\n        votes={candidate.votes}\n      />\n    );\n\n    return (\n      <div class=\"results\">\n        <Portal node={document.getElementById('lookup-select')} ref={(ref: any) => (this._yourPortal = ref)}>\n          <YourRaces contests={data} />\n        </Portal>\n\n        <Portal node={document.querySelector('#us-senate .contests')} ref={(ref: any) => (this._usPortal = ref)}>\n          <div class=\"office__contests seat__contests-double\">\n            {data.filter((contest: any) => contest.office === 'U.S. Senate').map((contest: any) => (\n              <Contest\n                key={contest.id}\n                contest={contest}\n                columnCount={CandidateRow.columnCount}\n                contestTitle={determineContestTitle(data.filter((item: any) => item.office_slug === contest.office_slug)[0])}\n                tableHeader={CandidateRow.Header}\n                notes={notes.filter((item: any) => item.type === contest.office_slug || item.type === `${contest.office_slug}-${contest.party}`)}\n                renderCandidate={renderCandidate}\n              />\n            ))}\n          </div>\n        </Portal>\n\n        <Portal node={document.querySelector('#attorney-general .contests')} ref={(ref: any) => (this._usPortal = ref)}>\n          <div>\n            <div class=\"office__contests seat__contests-double\">\n              {data.filter((contest: any) => contest.office === 'Attorney General').map((contest: any) => (\n                <Contest\n                  key={contest.id}\n                  contest={contest}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitle(data.filter((item: any) => item.office_slug === contest.office_slug)[0])}\n                  tableHeader={CandidateRow.Header}\n                  notes={notes.filter((item: any) => item.type === `${contest.office_slug}-${contest.party}`)}\n                  renderCandidate={renderCandidate}\n                />\n              ))}\n            </div>\n            {notes.filter((item: any) => item.type === 'attorney-general').map((item: any) => (\n              <p class=\"note__text note__text--full-width\" dangerouslySetInnerHTML={{ __html: item.value }} />\n            ))}\n          </div>\n        </Portal>\n\n        <Portal node={document.querySelector('#lieutenant-governor .contests')} ref={(ref: any) => (this._usPortal = ref)}>\n          <div class=\"office__contests seat__contests-double\">\n            {data.filter((contest: any) => contest.office === 'Lieutenant Governor').map((contest: any) => (\n              <Contest\n                key={contest.id}\n                contest={contest}\n                columnCount={CandidateRow.columnCount}\n                contestTitle={determineContestTitle(data.filter((item: any) => item.office_slug === contest.office_slug)[0])}\n                tableHeader={CandidateRow.Header}\n                notes={notes.filter((item: any) => item.type === contest.office_slug || item.type === `${contest.office_slug}-${contest.party}`)}\n                renderCandidate={renderCandidate}\n              />\n            ))}\n          </div>\n        </Portal>\n\n        <Portal node={document.querySelector('#texas-court-of-criminal-appeals .contests')} ref={(ref: any) => (this._usPortal = ref)}>\n          <div class=\"office__contests seat__contests-double\">\n            {data.filter((contest: any) => contest.office === 'Texas Court of Criminal Appeals').map((contest: any) => (\n              <Contest\n                key={contest.id}\n                contest={contest}\n                columnCount={CandidateRow.columnCount}\n                contestTitle={determineContestTitle(data.filter((item: any) => item.office_slug === contest.office_slug)[0])}\n                tableHeader={CandidateRow.Header}\n                notes={notes.filter((item: any) => item.type === contest.office_slug || item.type === `${contest.office_slug}-${contest.party}`)}\n                renderCandidate={renderCandidate}\n              />\n            ))}\n          </div>\n        </Portal>\n\n        <Portal node={document.querySelector('#railroad-commission-of-texas .contests')} ref={(ref: any) => (this._supremePortal = ref)}>\n          <div class=\"office__contests seat__contests-double\">\n            {data.filter((contest: any) => contest.office === 'Texas Railroad Commission').map((contest: any) => (\n              <Contest\n                key={contest.id}\n                contest={contest}\n                columnCount={CandidateRow.columnCount}\n                contestTitle={determineContestTitle(data.filter((item: any) => item.office_slug === contest.office_slug)[0])}\n                tableHeader={CandidateRow.Header}\n                notes={notes.filter((item: any) => item.type === contest.office_slug || item.type === `${contest.office_slug}-${contest.party}` || item.type === 'railroad-commissioner')}\n                renderCandidate={renderCandidate}\n              />\n            ))}\n          </div>\n        </Portal>\n\n        <Portal node={document.querySelector('#us-house .contests')} ref={(ref: any) => (this._usPortal = ref)}>\n          <div class=\"office__contests seat__contests-double\">\n            {data.filter((contest: any) => contest.office === 'U.S. House').map((contest: any) => (\n              <Contest\n                key={contest.id}\n                contest={contest}\n                columnCount={CandidateRow.columnCount}\n                contestTitle={determineContestTitle(data.filter((item: any) => item.office_slug === contest.office_slug)[0])}\n                tableHeader={CandidateRow.Header}\n                notes={notes.filter((item: any) => item.type === contest.office_slug || item.type === `${contest.office_slug}-${contest.party}`)}\n                renderCandidate={renderCandidate}\n              />\n            ))}\n          </div>\n        </Portal>\n\n        <Portal node={document.querySelector('#state-board-of-education .contests')} ref={(ref: any) => (this._sboePortal = ref)}>\n          <div class=\"office__contests seat__contests-double\">\n            {data.filter((contest: any) => contest.office === 'State Board of Education').map((contest: any) => (\n              <Contest\n                key={contest.id}\n                contest={contest}\n                columnCount={CandidateRow.columnCount}\n                contestTitle={determineContestTitle(data.filter((item: any) => item.office_slug === contest.office_slug)[0])}\n                tableHeader={CandidateRow.Header}\n                notes={notes.filter((item: any) => item.type === contest.office_slug || item.type === `${contest.office_slug}-${contest.party}`)}\n                renderCandidate={renderCandidate}\n              />\n            ))}\n          </div>\n        </Portal>\n\n        <Portal node={document.querySelector('#texas-senate .contests')} ref={(ref: any) => (this._senatePortal = ref)}>\n          <div class=\"office__contests seat__contests-double\">\n            {data.filter((contest: any) => contest.office === 'Texas Senate').map((contest: any) => (\n              <Contest\n                key={contest.id}\n                contest={contest}\n                columnCount={CandidateRow.columnCount}\n                contestTitle={determineContestTitle(data.filter((item: any) => item.office_slug === contest.office_slug)[0])}\n                tableHeader={CandidateRow.Header}\n                notes={notes.filter((item: any) => item.type === contest.office_slug || item.type === `${contest.office_slug}-${contest.party}`)}\n                renderCandidate={renderCandidate}\n              />\n            ))}\n          </div>\n        </Portal>\n\n        <Portal node={document.querySelector('#texas-house .contests')} ref={(ref: any) => (this._housePortal = ref)}>\n          <div class=\"office__contests seat__contests-double\">\n            {data.filter((contest: any) => contest.office === 'Texas House').map((contest: any) => (\n              <Contest\n                key={contest.id}\n                contest={contest}\n                columnCount={CandidateRow.columnCount}\n                contestTitle={determineContestTitle(data.filter((item: any) => item.office_slug === contest.office_slug)[0])}\n                tableHeader={CandidateRow.Header}\n                notes={notes.filter((item: any) => item.type === contest.office_slug || item.type === `${contest.office_slug}-${contest.party}`)}\n                renderCandidate={renderCandidate}\n              />\n            ))}\n          </div>\n        </Portal>\n      </div>\n    );\n  }\n}\n\nexport default App;\n","// This has emptied out results i.e. is static\nconst STATIC_BALLOT_PAGE =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_runoff/ballot_guide/results_FLAT_for_ballot.json';\n\n// What we are using across the ap\n// will be used on the results page, in the homepage takeover\n// and in the embeds\nconst RESULTS_IN_USE = STATIC_BALLOT_PAGE;\n\nexport { RESULTS_IN_USE };\n","/**\n * Grabs the contents of a `jsonScript` created JSON inline string and returns\n * it as a JSON object. If the element does not exist, or if the script\n * element does not have the JSON MIME type, null is returned instead.\n *\n * @param  {String} elementId the ID of the JSON script element\n * @return {Object|null}\n */\nexport default function loadJsonScript(elementId) {\n  const element = document.getElementById(elementId);\n\n  if (element && element.getAttribute('type') === 'application/json') {\n    return JSON.parse(element.textContent);\n  } else {\n    return null;\n  }\n}\n","// import JS files\nimport '../kickstart';\nimport { h, render } from 'preact';\n\n// Components\nimport App from '../Ballot';\n\nrender(<App />, document.getElementById('app'));\n\nif (process.env.NODE_ENV === 'development') {\n  require('preact/debug');\n}\n"],"sourceRoot":""}