PageSourceSearch

https://bankstoday.net/wp-content/plugins/yop-poll/build/frontend.js?ver=54b6fdbb9911317ec01e

js bankstoday.net collected 2026-10-03 17:34:13 UTC 42,117 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var s in o)e.o(o,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:o[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,o=window.wp.i18n,s=window.wp.apiFetch;var n=e.n(s);function l(e,t,o){if(t<=0||0===e.length)return e.map(()=>0);const s=Math.pow(10,o),n=e.reduce((e,t)=>e+t,0),l=Math.round(n/t*100*s),r=e.map(e=>e/t*100*s),a=r.map(e=>Math.floor(e));let i=l-a.reduce((e,t)=>e+t,0);return i>0&&r.map((e,t)=>({idx:t,frac:e-Math.floor(e)})).sort((e,t)=>t.frac-e.frac).slice(0,i).forEach(e=>{a[e.idx]+=1}),a.map(e=>e/s)}function r(e){const t=(e||"#000000").replace("#",""),o=3===t.length?t.split("").map(e=>e+e).join(""):t;return(299*parseInt(o.substring(0,2),16)+587*parseInt(o.substring(2,4),16)+114*parseInt(o.substring(4,6),16))/1e3<128?"#ffffff":"#000000"}const a=window.ReactJSXRuntime;function i(e){return("undefined"!=typeof window&&window.yopPollFront&&window.yopPollFront.restUrl?window.yopPollFront.restUrl:"/wp-json/yop-poll/v1/")+e}function p(e,t,o){return new Promise((s,l)=>{const r=e+"?redirect_to="+encodeURIComponent(t),a=(screen.width-800)/2,p=(screen.height-600)/2,c=window.open(r,"yop_poll_wp_login",`width=800,height=600,left=${a},top=${p}`);
1if(!c)return void l(new Error("Popup blocked"));let d=!1;const u=()=>{d=!0,window.removeEventListener("message",y),m&&clearInterval(m),_&&clearInterval(_)},h=e=>{if(!d){u();try{c.close()}catch(e){}s({nonce:e.nonce,wpRestNonce:e.wpRestNonce})}},y=e=>{e.source===c&&("yop_poll_wp_login_success"===e.data?.type?h(e.data):"yop_poll_wp_login_failed"===e.data?.type&&(u(),l(new Error("Login failed"))))};window.addEventListener("message",y);const m=setInterval(()=>{d||n()({url:i("auth/status?poll_id="+encodeURIComponent(o||0))}).then(e=>{e&&e.loggedIn&&h(e)}).catch(()=>{})},1500),_=setInterval(()=>{d||c.closed&&(u(),l(new Error("Login cancelled")))},700)})}function c(e){return e?"string"==typeof e.meta_data?JSON.parse(e.meta_data):e.meta_data||{}:{}}function d(e,t,o,s){return e?.[t]?.[o]||s}function u(e,t){return`rgba(${parseInt(e.slice(1,3),16)}, ${parseInt(e.slice(3,5),16)}, ${parseInt(e.slice(5,7),16)}, ${t})`}function h(e,t){return e.replace(/\{(\w+)\}/g,(e,o)=>t[o]??"")}function y(e,t){if(!e)return"";const o=new Date(e);if(isNaN(o.getTime()))return e;const s={Y:String(o.getFullYear()),y:String(o.getFullYear()).slice(-2),m:String(o.getMonth()+1).padStart(2,"0"),n:String(o.getMonth()+1),d:String(o.getDate()).padStart(2,"0"),j:String(o.getDate()),H:String(o.getHours()).padStart(2,"0"),G:String(o.getHours()),h:String(o.getHours()%12||12).padStart(2,"0"),g:String(o.getHours()%12||12),i:String(o.getMinutes()).padStart(2,"0"),s:String(o.getSeconds()).padStart(2,"0"),A:o.getHours()>=12?"PM":"AM",a:o.getHours()>=12?"pm":"am",F:["January","February","March","April","May","June","July","August","September","October","November","December"][o.getMonth()],M:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],l:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][o.getDay()],D:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][o.getDay()],N:0===o.getDay()?"7":String(o.getDay())};return t.replace(/\\(.)|(.)/g,(e,t,o)=>void 0!==t?t:void 0!==s[o]?s[o]:o)}function m(){const e="yop_poll_voter_id";let t=localStorage.getItem(e);return t||(t="yop_"+Math.random().toString(36).substring(2)+Date.now().toString(36),localStorage.setItem(e,t)),t}function _(e){const t=window.yopPollFront?.captcha;return{recaptcha_v2_checkbox:t?.recaptchaV2?.siteKey,recaptcha_v2_invisible:t?.recaptchaV2Invisible?.siteKey,recaptcha_v3:t?.recaptchaV3?.siteKey,hcaptcha:t?.hcaptcha?.siteKey,turnstile:t?.turnstile?.siteKey}[e]||""}function g({breakEl:e,currentPage:t,onNext:s,onPrev:n}){const l=e?.meta_data||{},r=void 0!==l.next_label?l.next_label:(0,o.__)("Next","yop-poll"),i=void 0!==l.prev_label?l.prev_label:(0,o.__)("Previous","yop-poll"),p=t>0&&!1!==l.display_prev_btn,c=`yop-poll-page-nav yop-poll-page-nav--${l.btn_align||"center"}`,d={padding:`${l.btn_paddingTop??6}px ${l.btn_paddingRight??16}px ${l.btn_paddingBottom??6}px ${l.btn_paddingLeft??16}px`},u={padding:`${l.prev_btn_paddingTop??6}px ${l.prev_btn_paddingRight??16}px ${l.prev_btn_paddingBottom??6}px ${l.prev_btn_paddingLeft??16}px`};return(0,a.jsxs)("div",{className:c,children:[p&&(0,a.jsx)("button",{type:"button",className:"yop-poll-vote-button yop-poll-btn-prev",style:u,onClick:n,children:i}),(0,a.jsx)("button",{type:"button",className:"yop-poll-vote-button yop-poll-btn-next",style:d,onClick:s,children:r})]})}function x({poll:e,elements:s,templateBase:n,wrapperStyle:r,pollMeta:i,submitted:p,onBackToVote:c,messages:h,successMessage:y,forceResultsOnly:m}){const[_,g]=(0,t.useState)(!1),[x,b]=(0,t.useState)(null);(0,t.useEffect)(()=>{const e=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(e)},[]);const f=parseInt(e.total_submits,10)||0,w=i?.options?.results||{},v=Array.isArray(w.resultsDetails)?w.resultsDetails:[w.resultsDetails||"percentages"],k=v.includes("votes-number")||v.includes("percentages-votes-number"),j=v.includes("percentages")||v.includes("percentages-votes-number"),S=w.sortResults||"as-defined",N=w.sortResultsRule||"ascending",$=w.displayResultsAs||"bar",A=Number.isFinite(parseInt(w.percentagesDecimals,10))?parseInt(w.percentagesDecimals,10):2,C="yes"===w.roundPercentage?0:A,I="yes"===w.backToVoteOption&&!m,L=w.backToVoteCaption||(0,o.__)("← Back to Vote","yop-poll"),R=["question-text"];return(0,a.jsxs)("div",{className:"yop-poll","data-template":n,style:r,children:[y&&(0,a.jsx)("div",{className:"yop-poll-message yop-poll-message--success",children:y}),s.map(e=>{if(!R.includes(e.etype)||!e.subelements?.length)return null;let t=[...e.subelements];const o=e.meta_data||{};if("as-defined"!==S){const e="ascending"===N;"alphabetical"===S?t.sort((t,o)=>e?(t.stext||"").localeCompare(o.stext||""):(o.stext||"").localeCompare(t.stext||"")):t.sort((t,o)=>e?(t.total_submits||0)-(o.total_submits||0):(o.total_submits||0)-(t.total_submits||0))}const s=parseInt(e.other_votes_count,10)||0,n=(e.subelements||[]).reduce((e,t)=>
1e+(parseInt(t.total_submits,10)||0),0)+s||f,r="yes"===o.allowOtherAnswers,i=r&&"yes"===o.displayOtherAnswersInResults&&Array.isArray(e.other_answers_list),p=i?e.other_answers_list:[],c=t.map(e=>parseInt(e.total_submits,10)||0),y=l(r?[...c,s]:c,n,C),m=y.slice(0,t.length),g=r?y[t.length]??0:0,x=`${s} ${1===s?d(h,"results","single-vote","vote"):d(h,"results","multiple-votes","votes")}`,b=o.answersAlign||"left",w="horizontal"===o.answersDisplay?"yop-poll-answers yop-poll-answers--horizontal":"columns"===o.answersDisplay?`yop-poll-answers yop-poll-answers--columns-${o.answersColumns||2}`:"",v="left"!==b?`${w?w+" ":"yop-poll-answers "}yop-poll-answers--align-${b}`.trim():w;return(0,a.jsxs)("div",{className:"yop-poll-element",children:[e.etext&&(0,a.jsx)("div",{className:"yop-poll-question",dangerouslySetInnerHTML:{__html:e.etext}}),(0,a.jsxs)("div",{className:v,children:[t.map((e,t)=>{const o=parseInt(e.total_submits,10)||0,s=m[t]??0,n=["#058dc7","#ed561b","#50b432","#990000","#2f7ed8","#f28f43"],l=e.meta_data?.resultsColor||n[t%n.length],r=u(l,.15),i=`${o} ${1===o?d(h,"results","single-vote","vote"):d(h,"results","multiple-votes","votes")}`;return(0,a.jsxs)("div",{className:"yop-poll-answer-row",style:{marginBottom:"8px"},children:[(0,a.jsxs)("div",{className:"yop-poll-result-text",children:[(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",gap:"7px"},dangerouslySetInnerHTML:{__html:e.stext||""}}),(0,a.jsxs)("span",{children:[k&&j&&`${s}% (${i})`,k&&!j&&i,!k&&j&&`${s}%`]})]}),"bar"===$&&(0,a.jsx)("div",{className:"yop-poll-result-bar",style:r?{background:r}:{},children:(0,a.jsx)("div",{className:"yop-poll-result-fill",style:{width:`${_?s:0}%`,...l?{background:l}:{}}})})]},e.id)}),r&&"pie"!==$&&(0,a.jsxs)("div",{className:"yop-poll-answer-row",style:{marginBottom:"8px"},children:[(0,a.jsxs)("div",{className:"yop-poll-result-text",children:[(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",gap:"7px"},dangerouslySetInnerHTML:{__html:o.otherAnswersLabel||"Other"}}),(0,a.jsxs)("span",{children:[k&&j&&`${g}% (${x})`,k&&!j&&x,!k&&j&&`${g}%`]})]}),"bar"===$&&(0,a.jsx)("div",{className:"yop-poll-result-bar",style:{background:u(o.resultsColorForOtherAnswers||"#058dc7",.15)},children:(0,a.jsx)("div",{className:"yop-poll-result-fill",style:{width:`${_?g:0}%`,background:o.resultsColorForOtherAnswers||"#058dc7"}})}),i&&p.length>0&&(0,a.jsx)("div",{style:{marginTop:"4px",paddingLeft:"8px",borderLeft:"3px solid #eee"},children:p.map((e,t)=>(0,a.jsxs)("div",{style:{fontSize:"13px",color:"#555",padding:"2px 0"},children:[e.answer," (",parseInt(e.count,10)||0,")"]},`__other__${t}`))})]})]})]},e.id)}),I&&(0,a.jsx)("div",{className:"yop-poll-footer",children:(0,a.jsx)("button",{type:"button",className:"yop-poll-vote-button",onClick:c,children:L})})]})}function b({pollId:e,initialData:s=null}){const b=s?.tracking_id||"",f=function(e,t){if(!t)return"unknown";if(t.show_results)return"voted";const o=c(t.poll),s=Array.isArray(o.options?.results?.showResultsMoment)?o.options.results.showResultsMoment:["after-vote"];return s.includes("after-vote")||s.includes("always")||s.includes("before-vote")?t.already_voted?"voted":"unknown":"not-voted"}(0,s),[w,v]=(0,t.useState)(null),[k,j]=(0,t.useState)([]),[S,N]=(0,t.useState)({}),[$,A]=(0,t.useState)("F j, Y"),[C,I]=(0,t.useState)({}),[L,R]=(0,t.useState)({}),M=(0,t.useRef)({}),T=(0,t.useRef)({}),[P,D]=(0,t.useState)(0),[F,O]=(0,t.useState)(!1),[E,B]=(0,t.useState)(null),[H,q]=(0,t.useState)(null),[z,W]=(0,t.useState)(null),[U,V]=(0,t.useState)(!1),[J,G]=(0,t.useState)(!1),[Y,K]=(0,t.useState)(!1),X=(0,t.useRef)(null),Q=(0,t.useRef)(null),Z=(0,t.useRef)(null),[ee,te]=(0,t.useState)(!1),[oe,se]=(0,t.useState)(null),[ne,le]=(0,t.useState)("voted"===f),[re,ae]=(0,t.useState)(!1),[ie,pe]=(0,t.useState)(""),[ce,de]=(0,t.useState)(""),[ue,he]=(0,t.useState)("unknown"===f),[ye,me]=(0,t.useState)(!1),[_e,ge]=(0,t.useState)(s?.nonce||""),[xe,be]=(0,t.useState)(!1),[fe,we]=(0,t.useState)(()=>!!window.yopPollFront?.wpUserLoggedIn),ve=(0,t.useRef)(!1),ke=(0,t.useRef)(null);function je(t){v(t.poll),j(t.elements||[]),N(t.messages||{}),A(t.date_format||"F j, Y"),ge(t.nonce||"");const o=c(t.poll),s=Array.isArray(o.options?.results?.showResultsMoment)?o.options.results.showResultsMoment:["after-vote"];se(t);let l=!!t.show_results;if(!l){if(s.includes("after-vote")&&t.already_voted&&(l=!0),!l&&s.includes("custom-date")){const e=o.options?.results?.customDateResults;e&&new Date(e)<=new Date&&(l=!0)}if(!l&&s.includes("after-poll-end-date")){const e=o.options?.poll?.endDateOption||"never",t=o.options?.poll?.endDateCustom||"";"custom"===e&&t&&new Date(t)<=new Date&&(l=!0)}if(!l&&s.includes("after-vote")){const e=o.options?.poll?.endDateOption||"never",t=o.options?.poll?.endDateCustom||"";"custom"===e&&t&&new Date(t)<=new Date&&(l=!0)}}l&&le(!0);const r=o.style?.custom||{};if(r.css){const e=document.createElement("style");e.textContent=r.css,document.head.appendChild(e)}if(r.javascript)try{new Function(r.javascript)()}catch(e){}const a={},p={};for(const e of t.elements||[]){const t="yes"===(e.meta_data||{}).allowMultipleAnswers;
1for(const o of e.subelements||[])"1"===(o.meta_data||{}).makeDefault&&(t?a[e.id]=[...a[e.id]||[],String(o.id)]:a[e.id]||(a[e.id]=String(o.id)))}Object.keys(a).length&&I(a),Object.keys(p).length&&R(p);const d=c(t.poll);"built_in"===(d.options?.poll?.useCaptcha||"no")&&n()({url:i(`captcha?poll_id=${e}`)}).then(B).catch(()=>{});const u=void 0!==t.already_voted,h=s.includes("after-vote")||s.includes("always")||s.includes("before-vote");(l||u||!h)&&he(!1)}function Se(e,t){I(o=>({...o,[e]:t}))}function Ne(e,t,o){I(s=>{const n=Array.isArray(s[e])?s[e]:[];return{...s,[e]:o?[...n,t]:n.filter(e=>e!==t)}})}function $e(e,t){R(o=>({...o,[e]:t}))}(0,t.useEffect)(()=>{const e=T.current;Object.entries(C).forEach(([t,o])=>{const s=Array.isArray(e[t])?e[t].includes("__other__"):"__other__"===e[t],n="other_"+t+"_0";(Array.isArray(o)?o.includes("__other__"):"__other__"===o)&&!s&&M.current[n]&&M.current[n].focus()}),T.current=C},[C]),(0,t.useEffect)(()=>{if(!oe)return void ae(!1);const e=c(w);if(!(Array.isArray(e?.options?.results?.showResultsMoment)?e.options.results.showResultsMoment:[]).includes("before-vote"))return;const t=requestAnimationFrame(()=>ae(!0));return()=>cancelAnimationFrame(t)},[oe]),(0,t.useEffect)(()=>{s?je(s):async function(){try{je(await n()({url:i(`polls/${e}/results?tracking_id=${encodeURIComponent(b)}&voter_id=${encodeURIComponent(m())}`)}))}catch(e){pe((0,o.__)("Failed to load poll.","yop-poll")),he(!1)}}()},[e]),(0,t.useEffect)(()=>{if(!s)return;const t=localStorage.getItem(`yop_poll_voted_${e}`)||"",o=t?`&email=${encodeURIComponent(t)}`:"";n()({url:i(`polls/${e}/results?tracking_id=${encodeURIComponent(b)}&voter_id=${encodeURIComponent(m())}${o}`)}).then(e=>{if(ge(e.nonce||""),!s?.show_results){if(v(e.poll),j(e.elements||[]),N(e.messages||{}),se(e),e.already_voted){const t=c(e.poll),o=Array.isArray(t.options?.results?.showResultsMoment)?t.options.results.showResultsMoment:["always"];(o.includes("after-vote")||o.includes("always")||o.includes("before-vote"))&&le(!0)}he(!1)}}).catch(()=>{he(!1)})},[e]),(0,t.useEffect)(()=>{if(ue)return;ke.current?.offsetHeight>0&&localStorage.setItem(`yop_poll_h_${e}`,ke.current.offsetHeight);const t=ke.current?.closest(".yop-poll-container");t&&(t.style.minHeight="")},[ue]);const Ae=(0,t.useCallback)(()=>{q(null),n()({url:i(`captcha?poll_id=${e}`)}).then(B).catch(()=>{})},[e]);(0,t.useEffect)(()=>{if(!w)return;const e=c(w).options?.poll?.useCaptcha||"no";if("no"===e||"built_in"===e)return;const t=_(e);if(!t)return;const o=`yop-poll-captcha-${e}`;if(document.getElementById(o))return void V(!0);const s=e.startsWith("recaptcha")?"yopPollRecaptchaLoaded":"hcaptcha"===e?"yopPollHCaptchaLoaded":"yopPollTurnstileLoaded";window[s]=()=>V(!0);const n=document.createElement("script");n.id=o,n.src=function(e,t){switch(e){case"recaptcha_v2_checkbox":case"recaptcha_v2_invisible":return"https://www.google.com/recaptcha/api.js?onload=yopPollRecaptchaLoaded&render=explicit";case"recaptcha_v3":return`https://www.google.com/recaptcha/api.js?onload=yopPollRecaptchaLoaded&render=${t}`;case"hcaptcha":return"https://js.hcaptcha.com/1/api.js?onload=yopPollHCaptchaLoaded&render=explicit";case"turnstile":return"https://challenges.cloudflare.com/turnstile/v0/api.js?onload=yopPollTurnstileLoaded"}}(e,t),n.async=!0,document.head.appendChild(n)},[w]),(0,t.useEffect)(()=>{if(!U||!J)return;if(null!==Q.current)return;const e=c(w).options?.poll?.useCaptcha||"no";if("no"===e||"built_in"===e)return;const t=_(e),o=X.current;if(!o||!t)return;const s=e=>W(e),n=()=>W(null);switch(e){case"recaptcha_v2_checkbox":Q.current=window.grecaptcha.render(o,{sitekey:t,callback:s,"expired-callback":n});break;case"recaptcha_v2_invisible":Q.current=window.grecaptcha.render(o,{sitekey:t,size:"invisible",callback:s,"expired-callback":n});break;case"recaptcha_v3":Q.current=0;break;case"hcaptcha":Q.current=window.hcaptcha.render(o,{sitekey:t,callback:s,"expired-callback":n});break;case"turnstile":Q.current=window.turnstile.render(o,{sitekey:t,callback:s,"expired-callback":n})}},[U,J]),(0,t.useEffect)(()=>{if(!Y||!z)return;const e=Z.current;Z.current=null,K(!1),me(!0),Pe(e,z)},[Y,z]);const Ce=[{elements:k,breakEl:null}],Ie=P>=Ce.length-1,Le=Ce[P]||{elements:[],breakEl:null},Re=P>0&&Ce[P-1]?.breakEl?.meta_data||{},Me=P>0&&!1!==Re.display_prev_btn;function Te(e){for(const t of e){const e=t.meta_data||{},o=t.etype;if("question-text"===o){if("yes"!==(e.makeRequired??"yes")&&!0!==e.makeRequired)continue;const o=C[t.id],s=o?Array.isArray(o)?o:[o]:[],n=s.includes("__other__"),l=s.filter(e=>"__other__"!==e).length+(n?1:0);if(0===l)return d(S,"voting","no-answers-selected","Please select an answer.");if("yes"===e.allowMultipleAnswers){const t=parseInt(e.multipleAnswersMinim,10);if(t>0&&l<t)return h(d(S,"voting","min-answers-required","Please select at least {min_answers_allowed} answer(s)."),{min_answers_allowed:t});const o=parseInt(e.multipleAnswersMaxim,10);if(o>0&&l>o)return h(d(S,"voting","max-answers-required","Please select at most {max_answers_allowed} answer(s)."),{max_answers_allowed:o})}if(n){const o="number"==typeof e.otherAnswersCount?e.otherAnswersCount:1,s=Array.from({length:o}).map((e,o)=>(L["other_"+t.id+"_"+o]||"").trim());if(s.every(e=>""===e))return d(S,"voting","no-answer-for-other",'Please enter a value for the "Other" field.');const n=parseInt(e.otherMaxCharsAllowed,10);if(n>0&&s.some(e=>e.length>n))return d(S,"voting","answer-for-other-too-long",'Your "Other" answer is too long.')}}if("standard-single-line-text"===o){const o=(L[t.id]||"").trim(),s=t.etext?t.etext.replace(/<[^>]*>/g,""):"";if(("yes"===e.makeRequired||!0===e.makeRequired)&&""===o)return h(d(S,"voting","no-value-for-custom-field","{custom_field_name} is required."),{custom_field_name:s});const n=parseInt(e.maxCharsAllowed,10);if(n>0&&o.length>n)return h(d(S,"voting","too-many-chars-for-custom-field","Text for {custom_field_name} is too long."),{custom_field_name:s})}}return null}async function Pe(t,l,r=null,a=null,p=null){try{const u=(await n()({url:i("votes"),method:"POST",...a?{headers:{"X-WP-Nonce":a}}:{},data:{poll_id:e,page_id:s?.page_id??0,answers:t,tracking_id:b,voter_id:m(),nonce:r??_e,...E?{captcha_token:E.token}:{},...H?{captcha_value:H}:{},...l?{captcha_response:l}:{},...p?{selected_perm:p}:{}}})).poll_data;se(u),ge(u?.nonce||""),te(!0),u?.poll&&v(e=>({...e,total_submits:u.poll.total_submits,total_submited_answers:u.poll.total_submited_answers})),u?.elements&&j(u.elements);const h=c(w),y=h.options?.poll||{},_=Array.isArray(h.options?.results?.showResultsMoment)?h.options.results.showResultsMoment:["always"];if((_.includes("after-vote")||_.includes("always")||_.includes("before-vote"))&&le(!0),de(d(S,"voting","thank-you",(0,o.__)("Thank y
1ou for voting!","yop-poll"))),"yes"===y.redirectAfterVote&&y.redirectUrl){const e=parseInt(y.redirectAfter,10)||0;setTimeout(()=>{window.location.href=y.redirectUrl},1e3*e)}}catch(e){if("yop_poll_limit_reached"===e?.code)pe(d(S,"voting","not-allowed-by-limit",e.message));else if("yop_poll_block_reached"===e?.code)pe(d(S,"voting","not-allowed-by-block",e.message));else if("yop_poll_ban_reached"===e?.code)pe(d(S,"voting","not-allowed-by-ban",e.message));else{const t=e?.message||(0,o.__)("Failed to submit vote.","yop-poll");pe(t),E&&Ae(),function(e){W(null);const t=Q.current;null!==t&&0!==t&&(["recaptcha_v2_checkbox","recaptcha_v2_invisible"].includes(e)?window.grecaptcha?.reset(t):"hcaptcha"===e?window.hcaptcha?.reset(t):"turnstile"===e&&window.turnstile?.reset(X.current))}(c(w).options?.poll?.useCaptcha||"no")}}me(!1)}async function De({skipOverlay:t=!1,nonceOverride:s=null,wpRestNonceOverride:l=null,selectedPerm:r=null}={}){if(pe(""),ot)return;if(lt)return;const a=Te(Le.elements);if(a)return void pe(a);const i=c(w),u=i.options?.poll?.useCaptcha||"no";if(["recaptcha_v2_checkbox","hcaptcha","turnstile"].includes(u)&&!z)return void pe(d(S,"voting","no-captcha-selected",(0,o.__)("Please complete the captcha.","yop-poll")));if("yes"===(i.options?.poll?.enableGdpr||"no")&&["ask_consent","consent"].includes(i.options?.poll?.gdprSolution||"ask_consent")&&!F)return void pe(d(S,"voting","consent-not-checked","Please accept the terms and conditions."));if(ze&&!t)return void be(!0);if(!t&&!ze&&"wordpress"===qe[0]&&!fe){if(ve.current)return;ve.current=!0;const t=window.yopPollFront?.wpLoginUrl||"",s=`${window.yopPollFront?.adminAjaxUrl||""}?action=yop_poll_wp_login_redirect&poll_id=${e}`;try{const{nonce:o,wpRestNonce:l}=await p(t,s,e);n().nonceMiddleware&&(n().nonceMiddleware.nonce=l),we(!0),ge(o),await De({skipOverlay:!0,nonceOverride:o})}catch(e){pe(e.message||(0,o.__)("WordPress login failed.","yop-poll"))}finally{ve.current=!1}return}me(!0);const h=[];Object.entries(C).forEach(([e,t])=>{(Array.isArray(t)?t:[t]).forEach(t=>{if("__other__"===t){const t=parseInt(e,10),o=k.find(e=>e.id===t),s=o&&o.meta_data||{},n="number"==typeof s.otherAnswersCount?s.otherAnswersCount:1;Array.from({length:n}).forEach((o,s)=>{const n=(L["other_"+e+"_"+s]||"").trim();n&&h.push({element_id:t,answer_id:0,answer_value:n})})}else h.push({element_id:parseInt(e,10),answer_id:parseInt(t,10),answer_value:""})})}),Object.entries(L).forEach(([e,t])=>{e.startsWith("other_")||h.push({element_id:parseInt(e,10),answer_id:0,answer_value:String(t)})});const y=c(w).options?.poll?.useCaptcha||"no";if("recaptcha_v3"===y){const e=_(y);return window.grecaptcha&&e?void window.grecaptcha.ready(async()=>{const t=await window.grecaptcha.execute(e,{action:"vote"});await Pe(h,t,s,l,r)}):(pe((0,o.__)("Captcha not configured.","yop-poll")),void me(!1))}if("recaptcha_v2_invisible"===y&&!z)return window.grecaptcha?(Z.current=h,K(!0),window.grecaptcha.execute(Q.current),void me(!1)):(pe((0,o.__)("Captcha not configured.","yop-poll")),void me(!1));await Pe(h,"built_in"!==y&&"no"!==y?z:null,s,l,r)}function Fe(t,s,n=null){const i="yes"===s.allowMultipleAnswers,p="material"===w.template_base,h="bootstrap"===w.template_base;t.etype;let y=[...t.subelements||[]];const m=s.answersAlign||"left",_="horizontal"===s.answersDisplay?"yop-poll-answers yop-poll-answers--horizontal":"columns"===s.answersDisplay?`yop-poll-answers yop-poll-answers--columns-${s.answersColumns||2}`:"yop-poll-answers",g="left"!==m?`${_} yop-poll-answers--align-${m}`:_,x=c(w),b=x.style?.answers?.colorScheme||"#f44336",f=c(w),v=f?.options?.results||{},k=(Array.isArray(v.showResultsMoment)?v.showResultsMoment:[]).includes("before-vote")&&!!oe,j=v.displayResultsAs||"bar",N=parseInt(oe?.poll?.total_submits,10)||0,$=(t.subelements||[]).reduce((e,t)=>e+(parseInt(t.total_submits,10)||0),0)||N,A=Number.isFinite(parseInt(v.percentagesDecimals,10))?parseInt(v.percentagesDecimals,10):2,I="yes"===v.roundPercentage?0:A,R=Array.isArray(v.resultsDetails)?v.resultsDetails:[v.resultsDetails||"percentages"],T=R.includes("votes-number")||R.includes("percentages-votes-number"),P=R.includes("percentages")||R.includes("percentages-votes-number"),D=["#058dc7","#ed561b","#50b432","#990000","#2f7ed8","#f28f43"],F=l(y.map(e=>parseInt(e.total_submits,10)||0),$,I);function O(e,t){if(!k||"bar"!==j)return null;const o=parseInt(e.total_submits,10)||0,s=F[t]??0,n=1===o?d(S,"results","single-vote","vote"):d(S,"results","multiple-votes","votes"),l=T&&P?`${s}% (${o} ${n})`:T?`${o} ${n}`:`${s}%`;return(0,a.jsx)("span",{className:"yop-poll-inline-detail",children:l})}function E(e,t){if(!k||"bar"!==j)return null;const o=F[t]??0,s=e.meta_data?.resultsColor||D[t%D.length],n=u(s,.15);return(0,a.jsx)("div",{className:"yop-poll-inline-result",children:(0,a.jsx)("div",{className:"yop-poll-result-bar",style:{background:n},children:(0,a.jsx)("div",{className:"yop-poll-result-fill",style:{width:`${re?o:0}%`,background:s}})})})}return(0,a.jsxs)("div",{className:g,role:"group","aria-labelledby":n||void 0,children:[y.map((o,s)=>{const n=String(o.id);if(h){const l=o.meta_data||{},p=i?Array.isArray(C[t.id])&&C[t.id].includes(n):C[t.id]===n;return(0,a.jsxs)("div",{className:"yop-poll-answer-row",children:[(0,a.jsxs)("label",{className:"yop-poll-answer",children:[(0,a.jsx)("input",{type:i?"checkbox":"radio",className:"yop-poll-bootstrap-input",n
1ame:`yop-poll-${e}-${t.id}`,value:n,checked:p,onChange:e=>i?Ne(t.id,n,e.target.checked):Se(t.id,n)}),(0,a.jsx)("span",{className:"yop-poll-bootstrap-outer",children:(0,a.jsx)("svg",{className:"yop-poll-bootstrap-check",viewBox:"0 0 12 12",fill:"none",children:(0,a.jsx)("polyline",{points:"1.5,6 5,9.5 10.5,2.5",stroke:r(b),strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,a.jsx)("span",{className:"yop-poll-answer-text",children:"1"===l.makeLink&&l.link?(0,a.jsx)("a",{href:l.link,target:"_blank",rel:"noopener noreferrer",dangerouslySetInnerHTML:{__html:o.stext||""}}):(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:o.stext||""}})}),O(o,s)]}),E(o,s)]},o.id)}if(p&&i){const l=o.meta_data||{},r=!!Array.isArray(C[t.id])&&C[t.id].includes(n);return(0,a.jsxs)("div",{className:"yop-poll-answer-row",children:[(0,a.jsxs)("label",{className:"yop-poll-answer",children:[(0,a.jsx)("input",{type:"checkbox",className:"yop-poll-checkbox-input",name:`yop-poll-${e}-${t.id}`,value:n,checked:r,onChange:e=>Ne(t.id,n,e.target.checked)}),(0,a.jsx)("span",{className:"yop-poll-checkbox-outer",children:(0,a.jsx)("svg",{className:"yop-poll-checkbox-check",viewBox:"0 0 12 12",fill:"none",children:(0,a.jsx)("polyline",{points:"1.5,6 5,9.5 10.5,2.5",stroke:"#fff",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,a.jsx)("span",{className:"yop-poll-answer-text",children:"1"===l.makeLink&&l.link?(0,a.jsx)("a",{href:l.link,target:"_blank",rel:"noopener noreferrer",dangerouslySetInnerHTML:{__html:o.stext||""}}):(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:o.stext||""}})}),O(o,s)]}),E(o,s)]},o.id)}if(p){const l=o.meta_data||{};return(0,a.jsxs)("div",{className:"yop-poll-answer-row",children:[(0,a.jsxs)("label",{className:"yop-poll-answer",children:[(0,a.jsx)("input",{type:"radio",className:"yop-poll-radio-input",name:`yop-poll-${e}-${t.id}`,value:n,checked:C[t.id]===n,onChange:()=>Se(t.id,n)}),(0,a.jsx)("span",{className:"yop-poll-radio-outer",children:(0,a.jsx)("span",{className:"yop-poll-radio-inner"})}),(0,a.jsx)("span",{className:"yop-poll-answer-text",children:"1"===l.makeLink&&l.link?(0,a.jsx)("a",{href:l.link,target:"_blank",rel:"noopener noreferrer",dangerouslySetInnerHTML:{__html:o.stext||""}}):(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:o.stext||""}})}),O(o,s)]}),E(o,s)]},o.id)}const l=o.meta_data||{};return(0,a.jsxs)("div",{className:"yop-poll-answer-row",children:[(0,a.jsxs)("label",{className:"yop-poll-answer",children:[(0,a.jsx)("input",{type:i?"checkbox":"radio",name:`yop-poll-${e}-${t.id}`,value:n,checked:i?Array.isArray(C[t.id])&&C[t.id].includes(n):C[t.id]===n,onChange:e=>i?Ne(t.id,n,e.target.checked):Se(t.id,n)}),(0,a.jsx)("span",{className:"yop-poll-answer-text",children:"1"===l.makeLink&&l.link?(0,a.jsx)("a",{href:l.link,target:"_blank",rel:"noopener noreferrer",dangerouslySetInnerHTML:{__html:o.stext||""}}):(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:o.stext||""}})}),O(o,s)]}),E(o,s)]},o.id)}),"yes"===s.allowOtherAnswers&&(0,a.jsxs)("label",{className:"yop-poll-answer yop-poll-other-answer",children:[h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:i?"checkbox":"radio",className:"yop-poll-bootstrap-input",name:`yop-poll-${e}-${t.id}`,value:"__other__",checked:i?Array.isArray(C[t.id])&&C[t.id].includes("__other__"):"__other__"===C[t.id],onChange:e=>i?Ne(t.id,"__other__",e.target.checked):Se(t.id,"__other__")}),(0,a.jsx)("span",{className:"yop-poll-bootstrap-outer",children:(0,a.jsx)("svg",{className:"yop-poll-bootstrap-check",viewBox:"0 0 12 12",fill:"none",children:(0,a.jsx)("polyline",{points:"1.5,6 5,9.5 10.5,2.5",stroke:r(b),strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})})]}):p&&i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"checkbox",className:"yop-poll-checkbox-input",name:`yop-poll-${e}-${t.id}`,value:"__other__",checked:Array.isArray(C[t.id])&&C[t.id].includes("__other__"),onChange:e=>Ne(t.id,"__other__",e.target.checked)}),(0,a.jsx)("span",{className:"yop-poll-checkbox-outer",children:(0,a.jsx)("svg",{className:"yop-poll-checkbox-check",viewBox:"0 0 12 12",fill:"none",children:(0,a.jsx)("polyline",{points:"1.5,6 5,9.5 10.5,2.5",stroke:"#fff",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})})]}):p?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"radio",className:"yop-poll-radio-input",n
1ame:`yop-poll-${e}-${t.id}`,value:"__other__",checked:"__other__"===C[t.id],onChange:()=>Se(t.id,"__other__")}),(0,a.jsx)("span",{className:"yop-poll-radio-outer",children:(0,a.jsx)("span",{className:"yop-poll-radio-inner"})})]}):(0,a.jsx)("input",{type:i?"checkbox":"radio",name:`yop-poll-${e}-${t.id}`,value:"__other__",checked:i?Array.isArray(C[t.id])&&C[t.id].includes("__other__"):"__other__"===C[t.id],onChange:e=>i?Ne(t.id,"__other__",e.target.checked):Se(t.id,"__other__")}),(0,a.jsxs)("div",{className:"yop-poll-other-wrap",children:[(0,a.jsx)("span",{className:"yop-poll-other-label",dangerouslySetInnerHTML:{__html:s.otherAnswersLabel||(0,o.__)("Other","yop-poll")}}),("no"!==s.otherFieldAlwaysVisible||(Array.isArray(C[t.id])?C[t.id].includes("__other__"):"__other__"===C[t.id]))&&(()=>{const e="number"==typeof s.otherAnswersCount?s.otherAnswersCount:1;return Array.from({length:e}).map((e,o)=>{const n="other_"+t.id+"_"+o,l="multi-line"===s.otherFieldType?(0,a.jsx)("textarea",{ref:e=>{M.current[n]=e},className:`yop-poll-textarea yop-poll-text-input--${s.otherFieldSize||"small"} yop-poll-other-input`,maxLength:parseInt(s.otherMaxCharsAllowed,10)>0?parseInt(s.otherMaxCharsAllowed,10):void 0,value:L[n]||"",onChange:e=>$e(n,e.target.value),onClick:e=>e.stopPropagation(),onFocus:()=>{i?(Array.isArray(C[t.id])?C[t.id]:[]).includes("__other__")||Ne(t.id,"__other__",!0):Se(t.id,"__other__")}}):(0,a.jsx)("input",{ref:e=>{M.current[n]=e},type:"text",className:`yop-poll-text-input yop-poll-text-input--${s.otherFieldSize||"small"} yop-poll-other-input`,maxLength:parseInt(s.otherMaxCharsAllowed,10)>0?parseInt(s.otherMaxCharsAllowed,10):void 0,value:L[n]||"",onChange:e=>$e(n,e.target.value),onClick:e=>e.stopPropagation(),onFocus:()=>{i?(Array.isArray(C[t.id])?C[t.id]:[]).includes("__other__")||Ne(t.id,"__other__",!0):Se(t.id,"__other__")}});return(0,a.jsx)("div",{className:"yop-poll-other-field",children:l},o)})})()]})]})]})}if(ue)return(0,a.jsx)("div",{className:"yop-poll-loading",children:(0,o.__)("Loading poll…","yop-poll")});if(!w)return(0,a.jsx)("div",{className:"yop-poll-error",children:ie||(0,o.__)("Poll could not be loaded.","yop-poll")});const Oe=c(w),Ee=Oe?.style?.buttons?.align||"center",Be="bottom"===Oe?.options?.poll?.notificationMessageLocation?"bottom":"top",He=Oe?.options?.access?.votePermissions,qe=Array.isArray(He)?He:["guest"],ze=qe.length>
11,We=Oe?.options?.poll?.voteButtonLabel||"",Ue={guest:"anonymous",wordpress:"wordpress",facebook:"facebook",google:"google"},Ve={guest:"Vote Now",wordpress:"Sign in with WordPress",facebook:"Sign in with Facebook",google:"Sign in with Google",email:"Vote Now"},Je=Oe?.style?.poll||{},Ge=Oe?.style?.questions||{},Ye=Oe?.style?.answers?.colorScheme||"#f44336",Ke=Oe?.style?.errors||{},Xe=Oe?.style?.answers||{},Qe=Oe?.style?.buttons||{},Ze={...void 0!==Je.backgroundColor&&{backgroundColor:Je.backgroundColor},...Je.backgroundImageUrl&&{backgroundImage:`url(${JSON.stringify(Je.backgroundImageUrl)})`,backgroundSize:Je.backgroundSize||"cover",backgroundPosition:Je.backgroundPosition||"center center",backgroundRepeat:Je.backgroundRepeat||"no-repeat"},borderWidth:(Je.borderSize??0)+"px",borderStyle:Je.borderStyle??"none",borderColor:Je.borderColor??"#ffffff",borderRadius:(Je.borderRadius??0)+"px",...void 0!==Je.paddingTopBottom&&{paddingTop:Je.paddingTopBottom+"px",paddingBottom:Je.paddingTopBottom+"px"},...void 0!==Je.paddingLeftRight&&{paddingLeft:Je.paddingLeftRight+"px",paddingRight:Je.paddingLeftRight+"px"},..."material"===w.template_base||"bootstrap"===w.template_base?{"--yop-radio-color":Ye}:{},"--yop-ans-ts":(Xe.textSize??14)+"px","--yop-ans-tw":Xe.textWeight??"normal",...Xe.textColor?{"--yop-ans-tc":Xe.textColor}:{},...void 0!==Xe.paddingTopBottom&&{"--yop-ans-pt":`${Xe.paddingTopBottom}px`,"--yop-ans-pb":`${Xe.paddingTopBottom}px`},...void 0!==Xe.paddingLeftRight&&{"--yop-ans-pl":`${Xe.paddingLeftRight}px`,"--yop-ans-pr":`${Xe.paddingLeftRight}px`},"--yop-msg-bcs":Ke.borderLeftColorForSuccess??"#008000","--yop-msg-bce":Ke.borderLeftColorForError??"#ff0000","--yop-msg-blw":(Ke.borderLeftSize??10)+"px","--yop-msg-pt":(Ke.paddingTopBottom??0)+"px","--yop-msg-pb":(Ke.paddingTopBottom??0)+"px","--yop-msg-tc":Ke.textColor??"#000000","--yop-msg-ts":(Ke.textSize??14)+"px","--yop-msg-tw":Ke.textWeight??"normal",...void 0!==Qe.backgroundColor&&{"--yop-btn-bg":Qe.backgroundColor},...void 0!==Qe.textColor&&{"--yop-btn-tc":Qe.textColor},...void 0!==Qe.borderSize&&{"--yop-btn-bw":`${Qe.borderSize}px`},...void 0!==Qe.borderStyle&&{"--yop-btn-bs":Qe.borderStyle},...void 0!==Qe.borderColor&&{"--yop-btn-bc":Qe.borderColor},...void 0!==Qe.borderRadius&&{"--yop-btn-br":`${Qe.borderRadius}px`},...void 0!==Qe.paddingTopBottom&&{"--yop-btn-pt":`${Qe.paddingTopBottom}px`,"--yop-btn-pb":`${Qe.paddingTopBottom}px`},...void 0!==Qe.paddingLeftRight&&{"--yop-btn-pl":`${Qe.paddingLeftRight}px`,"--yop-btn-pr":`${Qe.paddingLeftRight}px`},...void 0!==Qe.textSize&&{"--yop-btn-ts":`${Qe.textSize}px`},...void 0!==Qe.textWeight&&{"--yop-btn-tw":Qe.textWeight},...void 0!==Ge.paddingTopBottom&&{"--yop-el-pt":`${Ge.paddingTopBottom}px`,"--yop-el-pb":`${Ge.paddingTopBottom}px`},...void 0!==Ge.paddingLeftRight&&{"--yop-el-pl":`${Ge.paddingLeftRight}px`,"--yop-el-pr":`${Ge.paddingLeftRight}px`},...void 0!==Ge.textAlign&&{"--yop-el-ta":Ge.textAlign},...void 0!==Ge.textColor&&{"--yop-q-tc":Ge.textColor},...void 0!==Ge.textSize&&{"--yop-q-ts":`${Ge.textSize}px`},...void 0!==Ge.textWeight&&{"--yop-q-tw":Ge.textWeight},...void 0!==Ge.labelGap&&{"--yop-q-gap":`${Ge.labelGap}px`}},et=Oe?.options?.poll?.startDateOption||"now",tt=Oe?.options?.poll?.startDateCustom||"",ot="custom"===et&&!!tt&&new Date(tt)>
1new Date,st=Oe?.options?.poll?.endDateOption||"never",nt=Oe?.options?.poll?.endDateCustom||"",lt="custom"===st&&!!nt&&new Date(nt)<new Date;if(ne&&oe)return(0,a.jsx)(x,{poll:oe.poll,elements:oe.elements,templateBase:w.template_base,wrapperStyle:Ze,pollMeta:Oe,submitted:ee,onBackToVote:()=>{le(!1),D(0),de("")},messages:S,successMessage:ee?ce:"",forceResultsOnly:!!s?.show_results});const rt=ie?(0,a.jsx)("div",{className:"yop-poll-message yop-poll-message--error",children:ie}):null,at=ce?(0,a.jsx)("div",{className:"yop-poll-message yop-poll-message--success",children:ce}):null,it=ot?(0,a.jsx)("div",{className:"yop-poll-message yop-poll-message--error",children:d(S,"voting","poll-not-started",(0,o.__)("This poll has not started yet.","yop-poll")).replace(/%START-DATE%/g,y(tt,$))}):null,pt=lt?(0,a.jsx)("div",{className:"yop-poll-message yop-poll-message--error",children:d(S,"voting","poll-ended",(0,o.__)("This poll is no longer accepting votes.","yop-poll")).replace(/%END-DATE%/g,y(nt,$))}):null;return(0,a.jsxs)("div",{ref:ke,className:"yop-poll","data-template":w.template_base,style:Ze,children:["top"===Be&&(it||pt||rt||at),Le.elements.map(t=>function(t){const o=t.meta_data||{},s=t.etype;if(["question-text"].includes(s)){const n=`yop-poll-${e}-${t.id}-label`;return(0,a.jsxs)("div",{className:"yop-poll-element","data-element-type":s,children:[t.etext&&(0,a.jsx)("div",{id:n,className:"yop-poll-question",dangerouslySetInnerHTML:{__html:t.etext}}),Fe(t,o,t.etext?n:null)]},t.id)}if("standard-single-line-text"===s){const n=`yop-poll-${e}-${t.id}-label`,l=t.etext?t.etext.replace(/<[^>]+>/g,"").trim():"";return(0,a.jsxs)("div",{className:"yop-poll-element","data-element-type":s,children:[t.etext&&(0,a.jsx)("div",{id:n,className:"yop-poll-question",dangerouslySetInnerHTML:{__html:t.etext}}),(0,a.jsx)("input",{type:"text",className:`yop-poll-text-input yop-poll-text-input--${o.size||"small"} yop-poll-text-input--${o.align||"left"}`,maxLength:parseInt(o.maxCharsAllowed,10)>0?parseInt(o.maxCharsAllowed,10):void 0,value:L[t.id]||"",onChange:e=>$e(t.id,e.target.value),"aria-labelledby":t.etext?n:void 0,"aria-label":!t.etext&&l?l:void 0})]},t.id)}return null}(t)),Ie&&(()=>{const t=c(w);if("yes"!==(t.options?.poll?.enableGdpr||"no"))return null;const o=t.options?.poll?.gdprSolution||"ask_consent";if("ask_consent"!==o&&"consent"!==o)return null;const s=(t.options?.poll?.gdprConsentText||"").replace(/^\s*<p[^>]*>/i,"").replace(/<\/p>\s*$/i,""),n="material"===w.template_base,l="bootstrap"===w.template_base;if(n)return(0,a.jsx)("div",{className:"yop-poll-element yop-poll-gdpr",children:(0,a.jsxs)("label",{className:"yop-poll-gdpr__label",children:[(0,a.jsx)("input",{type:"checkbox",className:"yop-poll-checkbox-input",checked:F,onChange:e=>O(e.target.checked)}),(0,a.jsx)("span",{className:"yop-poll-checkbox-outer",children:(0,a.jsx)("svg",{className:"yop-poll-checkbox-check",viewBox:"0 0 12 12",fill:"none",children:(0,a.jsx)("polyline",{points:"1.5,6 5,9.5 10.5,2.5",stroke:"#fff",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:s}})]})},"poll-gdpr");if(l){const e=c(w).style?.answers?.colorScheme||"#0d6efd";return(0,a.jsx)("div",{className:"yop-poll-element yop-poll-gdpr",children:(0,a.jsxs)("label",{className:"yop-poll-gdpr__label",children:[(0,a.jsx)("input",{type:"checkbox",className:"yop-poll-bootstrap-input",checked:F,onChange:e=>O(e.target.checked)}),(0,a.jsx)("span",{className:"yop-poll-bootstrap-outer",children:(0,a.jsx)("svg",{className:"yop-poll-bootstrap-check",viewBox:"0 0 12 12",fill:"none",children:(0,a.jsx)("polyline",{points:"1.5,6 5,9.5 10.5,2.5",stroke:r(e),strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:s}})]})},"poll-gdpr")}return(0,a.jsxs)("div",{className:"yop-poll-element yop-poll-gdpr",children:[(0,a.jsx)("input",{type:"checkbox",id:`yop-gdpr-${e}`,checked:F,onChange:e=>O(e.target.checked),style:{margin:0,flexShrink:0}}),(0,a.jsx)("label",{htmlFor:`yop-gdpr-${e}`,dangerouslySetInnerHTML:{__html:s},style:{cursor:"pointer"}})]},"poll-gdpr")})(),Ie&&(()=>{const e=c(w),t=e.options?.poll?.useCaptcha||"no";return"no"===t?null:"built_in"!==t?_(t)?"recaptcha_v3"===t?null:(0,a.jsx)("div",{className:"yop-poll-element yop-poll-captcha",children:(0,a.jsx)("div",{ref:e=>{X.current=e,e&&!J&&G(!0)},className:"yop-poll-captcha__external-container"})},"poll-captcha"):(0,a.jsx)("div",{className:"yop-poll-element",children:(0,a.jsx)("div",{className:"yop-poll-captcha__not-configured",children:(0,o.__)("Captcha not configured.","yop-poll")})},"poll-captcha"):E?(0,a.jsxs)("div",{className:"yop-poll-element yop-poll-captcha",children:[(0,a.jsx)("div",{className:"yop-poll-captcha__question",dangerouslySetInnerHTML:{__html:E.question}}),(0,a.jsxs)("div",{className:"yop-poll-captcha__images",children:[E.images.map(e=>(0,a.jsx)("button",{type:"button",className:"yop-poll-captcha__image-btn"+(H===e.value?" is-selected":""),onClick:()=>q(e.value),children:(0,a.jsx)("img",{src:e.src,alt:""})},e.value)),(0,a.jsx)("button",{type:"button",className:"yop-poll-captcha__refresh",onClick:Ae,children:"↻"})]})]},"poll-captcha"):null})(),Ie&&(()=>{const e=c(w),t=e.options?.poll||{},o="yes"===t.showTotalVotes,s="yes"===t.showTotalAnswers;if(!o&&!s)return null;const n=parseInt(w.total_submits,10)||0,l=parseInt(w.total_submited_answers,10)||0,r=1===n?d(S,"results","single-vote","vote"):d(S,"results","multiple-votes","votes"),i=1===l?d(S,"results","single-answer","answer"):d(S,"results","multiple-answers","answers"),p=[];return o&&p.push(`${n} ${r}`),s&&p.push(`${l} ${i}`),(0,a.jsx)("div",{className:"yop-poll-element yop-poll-total-votes",style:{fontSize:"13px",color:"#555",textAlign:"center"},children:p.join(" · ")},"poll-total-votes")})(),"top"!==Be&&(it||pt||rt||at),Ie?(0,a.jsxs)("div",{className:`yop-poll-footer yop-poll-footer--${Ee}`,children:[Me&&(0,a.jsx)("button",{type:"button",className:"yop-poll-vote-button yop-poll-btn-prev",style:{padding:`${Re.prev_btn_paddingTop??6}px ${Re.prev_btn_paddingRight??16}px ${Re.prev_btn_paddingBottom??6}px ${Re.prev_btn_paddingLeft??16}px`},onClick:()=>D(e=>e-1),children:Re.prev_label||(0,o.__)("Previous","yop-poll")}),(0,a.jsx)("button",{type:"button",className:"yop-poll-vote-button",onClick:De,disabled:ye||ot||lt,children:ye?d(S,"buttons","submitting",(0,o.__)("Submitting…","yop-poll")):We||d(S,"buttons","anonymous","Vote Now")}),"yes"===Oe?.options?.poll?.showResultsLink&&oe&&(0,a.jsx)("button",{type:"button",className:"yop-poll-vote-button",onClick:()=>le(!0),children:Oe?.options?.poll?.resultsLabelText||(0,o.__)("Results","yop-poll")})]}):(0,a.jsx)(g,{breakEl:Le.breakEl,currentPage:P,onNext:function(){const e=Te(Le.elements);e?pe(e):(pe(""),D(e=>e+1))},onPrev:()=>D(e=>e-1)}),xe&&(0,a.jsx)("div",{className:"yop-poll-perm-overlay",onClick:e=>{e.target===e.currentTarget&&be(!1)},children:(0,a.jsx)("div",{className:"yop-poll-perm-overlay__inner",children:qe.map(t=>(0,a.jsx)("button",{type:"button",className:"yop-poll-vote-button",onClick:async()=>
1{if("guest"===t)be(!1),De({skipOverlay:!0,selectedPerm:"guest"});else if("wordpress"===t)if(fe)be(!1),De({skipOverlay:!0,selectedPerm:"wordpress"});else{if(ve.current)return;ve.current=!0;const t=window.yopPollFront?.wpLoginUrl||"",s=`${window.yopPollFront?.adminAjaxUrl||""}?action=yop_poll_wp_login_redirect&poll_id=${e}`;try{const{nonce:o,wpRestNonce:l}=await p(t,s,e);n().nonceMiddleware&&(n().nonceMiddleware.nonce=l),we(!0),ge(o),be(!1),De({skipOverlay:!0,nonceOverride:o,selectedPerm:"wordpress"})}catch(e){pe(e.message||(0,o.__)("WordPress login failed.","yop-poll"))}finally{ve.current=!1}}},disabled:ye,children:d(S,"buttons",Ue[t],Ve[t]||"Vote Now")},t))})})]})}function f(e=document){e.querySelectorAll("[data-yop-poll-id]").forEach(e=>{if("true"===e.dataset.yopPollMounted)return;const o=parseInt(e.dataset.yopPollId,10);if(!o)return;e.dataset.yopPollMounted="true";let s=null;const n=e.querySelector("[data-yop-poll-init]");if(n)try{s=JSON.parse(n.textContent)}catch(e){}const l=window.localStorage.getItem(`yop_poll_h_${o}`);l&&(e.style.minHeight=l+"px"),(0,t.createRoot)(e).render((0,a.jsx)(b,{pollId:o,initialData:s}))})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>f()):f();let w=!1;const v=()=>{!w&&window.elementorFrontend?.hooks&&(w=!0,window.elementorFrontend.hooks.addAction("frontend/element_ready/yop_poll.default",e=>f(e[0])))};v(),window.addEventListener("elementor/frontend/init",v)})();

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.