1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[79],{10615:e=>{e.exports={container:"VotersGuide_container__FlTSd",heading:"VotersGuide_heading__vWQbb","voters-guide-article":"VotersGuide_voters-guide-article__MXy6t",faq:"VotersGuide_faq__48xeE",tag:"VotersGuide_tag__KN25k","headline-tag":"VotersGuide_headline-tag__DQO1L","voters-guide-landing-page":"VotersGuide_voters-guide-landing-page__FGrkF","my-choices":"VotersGuide_my-choices__Z_XLq",results:"VotersGuide_results__2GZXq","btn-long":"VotersGuide_btn-long__creZJ","small-text":"VotersGuide_small-text__eOC0g","btn-ghost":"VotersGuide_btn-ghost__MTcpv","candidate-search":"VotersGuide_candidate-search__hYHNa","clear-results":"VotersGuide_clear-results__myI16",search_results:"VotersGuide_search_results__vlh13","candidate-list":"VotersGuide_candidate-list__u7aoK",race:"VotersGuide_race__Ra_m1","race-result":"VotersGuide_race-result__Y73EB",candidate:"VotersGuide_candidate__k_k4D",seats:"VotersGuide_seats__S4OAo",reporting:"VotersGuide_reporting__HHwe_","search-highlight":"VotersGuide_search-highlight__4GOi1",winner:"VotersGuide_winner__mVrNo","dropped-out":"VotersGuide_dropped-out__eukNX",info:"VotersGuide_info__QBLNq",options:"VotersGuide_options__KY7tj",incumbent:"VotersGuide_incumbent__jszLL","view-profile":"VotersGuide_view-profile__t2sRw",check:"VotersGuide_check__mjt3S",selected:"VotersGuide_selected__3Jux1",Republican:"VotersGuide_Republican__wmNjK",Democrat:"VotersGuide_Democrat__ifwWy","not-selected":"VotersGuide_not-selected__FrCy7","candidate-only":"VotersGuide_candidate-only__uBL9a","result-bar":"VotersGuide_result-bar__4NS2R","color-bar":"VotersGuide_color-bar__tdD9y","print-message":"VotersGuide_print-message__ycYAX","vg-top":"VotersGuide_vg-top__BnP1S","ballot-btn":"VotersGuide_ballot-btn__npQcc","btn-disabled":"VotersGuide_btn-disabled___26LS","candidate-profile":"VotersGuide_candidate-profile__optdx",small:"VotersGuide_small__3oaYs","centered-small":"VotersGuide_centered-small__rs5Tj",story:"VotersGuide_story__eBVQy",contentAccess:"VotersGuide_contentAccess__PDJab","no-selections":"VotersGuide_no-selections__N72rf","two-col":"VotersGuide_two-col__xHpdi",status:"VotersGuide_status__znlUh"}},80651:(e,t,s)=>{"use strict";s.d(t,{Ay:()=>v,ph:()=>m,$x:()=>d});var i=s(37876),a=s(14232),r=s(95062),o=s.n(r),l=s(10145),c=s(79752),n=s(25714);function d(e){let{endpoint:t}=e,s=new URL("https:/".concat({local:"local.projects.newsday.com",stage:"stage.projects.newsday.com",prod:"projects.newsday.com"}[(0,n.P$)(!1)],"/voters-guide/api/").concat(t));return c.A.info(s,{label:">>VG API CALL>>"}),fetch(s).then(e=>e.json())}let _={local:"stage.static.newsday.com",stage:"stage.static.newsday.com",prod:"static.newsday.com"},u={"simple-results":"simpleResults"};function p(e){if(!e)return{};if("object"==typeof e&&!Array.isArray(e))return e;if("string"!=typeof e)return{};try{let t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:{}}catch(e){return c.A.debug(e,{label:">>VG S3 HASH PARSE FAILED>>"}),{}}}async function h(e){let{electionSlug:t,feedType:s}=e,i=await d({endpoint:"election/".concat(t)}),a={...i,s3_hash:p(null==i?void 0:i.s3_hash)};if("s3"===a.data_source){let e=function(e){var t,s;let{electionSlug:i,feedType:a,electionMeta:r}=e,o=_[(0,n.P$)(!1)]||_.prod,l=(s=p(null==r?void 0:r.s3_hash))[u[a]||a]||s[a]||"",c="election"===a&&((null==r?void 0:r.id)||(null==r||null==(t=r.election)?void 0:t.id))||i,d=new URL("https://".concat(o,"/elections/").concat(a,"/").concat(c,".json"));return l&&d.searchParams.set("v",l),d}({electionSlug:t,feedType:s,electionMeta:a});c.A.info(e,{label:">>VG S3 FEED CALL>>"});let i=await fetch(e);if(!i.ok)throw Error("Voters guide S3 feed request failed: ".concat(i.status," ").concat(e.toString()));return{electionMeta:a,vgData:await i.json()}}return{electionMeta:a,vgData:await d({endpoint:"metadata"===s||"election"===s?"election/".concat(t):"".concat(s,"/").concat(t)})}}let g=(0,a.createContext)({slug:"",pageType:"",vgData:{},electionMeta:{},setVGData:()=>{},searchFilters:[],setSearchFilters:()=>{},getRaceList:()=>{},updateVGData:()=>{},selected:{},setSelected:()=>{},candidateChosen:()=>{},selectionHandler:()=>{},isRaceMax:()=>{}}),m=()=>(0,a.useContext)(g);function y(e){let{children:t,value:s}=e,[r,o]=(0,a.useState)(s.vgData),[n,d]=(0,a.useState)([]),[_,u]=(0,a.useState)(!1);return(0,i.jsx)(g.Provider,{value:{slug:s.slug,electionMeta:s.electionMeta,vgData:r,setVGData:o,searchFilters:n,setSearchFilters:d,getRaceList:function(){return 0===n.length?r.races:r.races.filter(e=>n.indexOf(e.race.wp_id)>-1)},pageType:s.pageType,updateVGData:function(){let e="results"===s.pageType?"results":"guide";h({electionSlug:s.slug,feedType:e}).then(e=>{let{vgData:t}=e;o(t)}).catch(e=>c.A.debug(e))},selected:_,setSelected:u,selectionHandler:function(e,t){let s=(0,l.Ay)(_);
1s[t.race.wp_id]||(s[t.race.wp_id]={selections:[],choices:t.possible_winners});let i=s[t.race.wp_id].selections;i=i.indexOf(e)>-1?i.filter(t=>t!==e):[...i,e],s[t.race.wp_id]={selections:i,choices_remaining:t.possible_winners-i.length},u(s)},candidateChosen:function(e,t){var s;return((null==(s=_[t.race.wp_id])?void 0:s.selections)||[]).includes(e)},isRaceMax:function(e){var t;let{possible_winners:s}=e;return((null==(t=_[e.race.wp_id])?void 0:t.selections)||[]).length===s}},children:t})}y.propTypes={children:o().object,value:o().object};let v=y},90079:(e,t,s)=>{"use strict";s.d(t,{A:()=>g});var i=s(37876),a=s(80651),r=s(14232),o=s(95062),l=s.n(o),c=s(39854),n=s(67655),d=s(10615),_=s.n(d),u=s(86791),p=s(13774);function h(e){var t;let{item:s,renderType:r,choiceKey:o,searchText:l}=e,{pageType:d,selectionHandler:h,isRaceMax:g,candidateChosen:m}=(0,a.ph)(),{isApp:y}=(0,u.FQ)(),v=s.pols.filter(e=>"my-choices"!==d||m(e.politician.wp_id,s));return 0===v.length?null:(0,i.jsxs)("div",{className:(0,n.StyleSelector)(_(),["race","results"===d&&"race-result"]),children:[(0,i.jsx)("h3",{className:(0,n.StyleSelector)(_(),[(null==(t=s.race.display)?void 0:t.toLowerCase().includes(null==l?void 0:l.toLowerCase()))?"search-highlight":""]),children:s.race.display}),0===s.race.is_referendum&&(0,i.jsxs)("p",{className:(0,n.StyleSelector)(_(),["seats"]),children:[s.possible_winners," ",1===s.possible_winners?"Seat":"Seats"," Open",s.omit_results>0&&s.pols.length<=s.possible_winners&&(0,i.jsx)(i.Fragment,{children:"- Uncontested"})]}),s.race_note&&(0,i.jsx)("div",{className:(0,n.StyleSelector)(_(),["note"]),children:(0,p.t)(s.race_note)}),"results"===d&&(0,i.jsxs)("p",{className:(0,n.StyleSelector)(_(),["reporting"]),children:[s.eds_percent,"% ",s.progress_language]}),v.map(e=>{var t,a,u,p,v;if("choice"===r&&e.politician.wp_id!==o)return;let w=new URL(y?"https://".concat((0,n.site_domain)(),"/app").concat(null==e||null==(t=e.politician)?void 0:t.profile_id):"https://".concat((0,n.site_domain)()).concat(null==e||null==(a=e.politician)?void 0:a.profile_id)),f=e.parties||e.details.parties,S="results"===d&&e.details.dropped_out>0;return(0,i.jsxs)("div",{className:(0,n.StyleSelector)(_(),["candidate",S&&"dropped-out",null==(u=f[0])?void 0:u.noun_singular,"results"===d&&e.details.is_winner&&"winner","election"===d&&m(e.politician.wp_id,s)&&"selected","election"===d&&!m(e.politician.wp_id,s)&&g(s)&&"not-selected"].filter(Boolean)),children:["results"===d&&e.details.is_winner>0&&(0,i.jsx)("p",{children:"WINNER"}),0===s.race.is_referendum&&(0,i.jsx)("img",{src:e.politician.profile_image_url||"https://cdn.newsday.com/projects/voters-guide/silhouettes/mugshot_231.jpg",alt:e.politician.post_title}),(0,i.jsxs)("div",{className:(0,n.StyleSelector)(_(),["info"]),children:[(0,i.jsxs)("div",{className:(0,n.StyleSelector)(_(),["two-col","status"]),children:[e.details.is_incumbent>0&&(0,i.jsx)("p",{className:(0,n.StyleSelector)(_(),["incumbent"]),children:"Incumbent"}),S&&(0,i.jsx)("strong",{className:(0,n.StyleSelector)(_(),["dropped-out"]),children:"Dropped Out"})]}),(0,i.jsx)("p",{className:(0,n.StyleSelector)(_(),[(null==(p=e.politician.display_name)?void 0:p.toLowerCase().includes(null==l?void 0:l.toLowerCase()))?"search-highlight":""]),children:e.politician.display_name}),(0,i.jsx)("div",{children:f.map(t=>(0,i.jsx)("span",{style:{backgroundColor:"#".concat(t.color_code)},className:(0,n.StyleSelector)(_(),["tag"]),children:t.abbreviation},"".concat(s.race.wp_id,"_").concat(e.politician.wp_id,"_").concat(t.wp_id)))})]}),"results"===d&&(0,i.jsxs)("div",{className:(0,n.StyleSelector)(_(),["result-bar"]),children:[(0,i.jsx)("span",{style:{backgroundColor:"#".concat(0===e.details.votes?"808080":null==(v=e.details.parties[0])?void 0:v.color_code),width:"".concat(e.details.vote_percent,"%")},className:(0,n.StyleSelector)(_(),["color-bar"])}),(0,i.jsxs)("p",{children:[e.details.vote_percent,"%"]}),(0,i.jsxs)("p",{children:[e.details.votes.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")," Votes"]})]}),"election"===d&&(0,i.jsxs)("div",{className:(0,n.StyleSelector)(_(),["options"]),children:[!s.omit_results&&(0,i.jsx)("div",{className:(0,n.StyleSelector)(_(),["check"]),onClick:()=>{h(e.politician.wp_id,s)},children:m(e.politician.wp_id,s)&&(0,i.jsx)(c.In,{name:"check"})}),e.politician.profile_id&&(0,i.jsxs)("div",{className:(0,n.StyleSelector)(_(),["view-profile"]),children:[(0,i.jsx)("a",{href:w,children:"VIEW PROFILE"}),(0,i.jsx)(c.In,{name:"chevron-right"})]})]})]},"".concat(s.race.wp_id,"_").concat(e.politician.wp_id))})]})}function g(){let{getRaceList:e,updateVGData:t,selected:s,setSelected:o,setSearchFilters:l,pageType:c}=(0,a.ph)();return((0,r.useEffect)(()=>
1{if("results"===c)return t(),window.vg_data_update_interval=setInterval(()=>{t()},3e4),()=>{clearInterval(window.vg_data_update_interval)}},[]),(0,r.useEffect)(()=>{o(n.ACE_Storage.getItem("selected_candidates")||{})},[]),(0,r.useEffect)(()=>{s&&n.ACE_Storage.setItem("selected_candidates",s)},[s]),(0,r.useEffect)(()=>{"my-choices"===c&&l(Object.keys(n.ACE_Storage.getItem("selected_candidates")||{}).map(e=>Number(e)))},[]),0===Object.keys(s).length&&"my-choices"===c)?(0,i.jsx)("p",{className:(0,n.StyleSelector)(_(),["no-selections"]),children:"You have not made any selections"}):e().map(e=>(0,i.jsx)(h,{item:e},e.race.wp_id))}h.propTypes={item:l().object.isRequired,renderType:l().string,choiceKey:l().number,searchText:l().string}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.