{"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","checkStyle","ballotName","contestIsCalled","isIncumbent","isWinner","isViewable","candidateColor","totalVotesInContest","votes","this","props","color","rowClass","checkClass","_defineProperty","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","is_winner","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,IAYIyB,EAEAC,GAdE,WACJC,EAAU,gBACVC,EAAe,YACfC,EAAW,SACXC,EAAQ,WACRC,EAAU,eACVC,EAAc,MACdtB,EAAK,oBACLuB,EAAmB,MACnBC,GACEC,KAAKC,MAMLJ,IACFP,EAAW,CACT,mBAAoBO,GAEtBN,EAAa,CACXW,MAAOL,IAIX,IAAIM,EAAWpB,IAAG,YAAa,yBAA0B,CACvD,6CACEU,GAAmBE,GAAqB,YAATpB,EACjC,6CACEkB,GAAm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xGpM,YAAA,OAAKmB,MAAM,0CACRiO,EAAKlL,OAAQnB,GAAoC,iBAAnBA,EAAQF,QAA2ByB,IAAKvB,GACrE/C,YAACsD,EAAO,CACN+J,IAAKtK,EAAQ+Q,GACb/Q,QAASA,EACTJ,YAAarB,EAAaqB,YAC1BY,aAAcT,EAAsBsM,EAAKlL,OAAQwH,GAAcA,EAAK4I,cAAgBvR,EAAQuR,aAAa,IACzG5Q,YAAapC,EAAakB,OAC1BmB,MAAOA,EAAMO,OAAQwH,GAAcA,EAAKvF,OAASpD,EAAQuR,aAAe5I,EAAKvF,OAAI,GAAAjF,OAAQ6B,EAAQuR,YAAW,KAAApT,OAAI6B,EAAQtC,QACxHgD,gBAAiBA,OAMzBzD,YAAC2G,EAAM,CAACO,KAAM1H,SAASiW,cAAc,0BAA2BrJ,IAAMA,GAAclK,KAAK4T,aAAe1J,GACtGpM,YAAA,OAAKmB,MAAM,0CACRiO,EAAKlL,OAAQnB,GAAoC,gBAAnBA,EAAQF,QAA0ByB,IAAKvB,GACpE/C,YAACsD,EAAO,CACN+J,IAAKtK,EAAQ+Q,GACb/Q,QAASA,EACTJ,YAAarB,EAAaqB,YAC1BY,aAAcT,EAAsBsM,EAAKlL,OAAQwH,GAAcA,EAAK4I,cAAgBvR,EAAQuR,aAAa,IACzG5Q,YAAapC,EAAakB,OAC1BmB,MAAOA,EAAMO,OAAQwH,GAAcA,EAAKvF,OAASpD,EAAQuR,aAAe5I,EAAKvF,OAAI,GAAAjF,OAAQ6B,EAAQuR,YAAW,KAAApT,OAAI6B,EAAQtC,QACxHgD,gBAAiBA,SAUlBsR,QG9OfhV,YAAOC,YAAC+U,EAAG,MAAKvV,SAASC,eAAe,U","file":"main.2d9fffa0e4.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      contestIsCalled,\n      isIncumbent,\n      isWinner,\n      isViewable,\n      candidateColor,\n      party,\n      totalVotesInContest,\n      votes,\n    } = this.props;\n\n    let divStyle;\n\n    let checkStyle;\n\n    if (candidateColor) {\n      divStyle = {\n        'background-color': candidateColor,\n      };\n      checkStyle = {\n        color: candidateColor,\n      };\n    }\n\n    let rowClass = cx('candidate', 'contest__candidate-row', {\n      'contest__candidate-row--winner dem--border':\n        contestIsCalled && isWinner && party == 'Democrat',\n      'contest__candidate-row--winner rep--border':\n        contestIsCalled && isWinner && party == 'Republican',\n    });\n\n    let checkClass = cx('check', {\n      'dem-winner': party == 'Democrat',\n      'rep-winner': party == 'Republican',\n    });\n\n    if (!isViewable) {\n      rowClass += ' race__candidate-row--hidden';\n    }\n\n    const checkmark = '\\u2713';\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          {isWinner && (\n            <span class={checkClass} style={checkStyle}>\n              {checkmark}\n            </span>\n          )}\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":""}