function CMSPoll(n){let e=this,t=$("#"+n),i;this.bind=function(){let n=t.find(".poll-answer__input"),l=t.find(".btn-add-answer");n.unbind().bind("change",function(){n.filter(":checked").length>0&&l.removeAttr("disabled")}),l.unbind().bind("click",function(n){n.preventDefault(),e.voteAnswer()}),FingerprintJS.load().then(n=>n.get()).then(n=>{let{audio:e,availableScreenResolution:t,screenResolution:l,...o}=n.components,d={...o};i=FingerprintJS.hashComponents(d)})},this.voteAnswer=function(){let n=t.find('form[name="formPoll"]').serialize(),e=t.find(".poll-answer__input").filter(":checked"),l=0;e.length>0&&(l=e.attr("id").replace("poll-answer-","")),n+="&PollAnswerId="+l,n+="&PluginName=poll",n+="&fingerprint="+i,n+="&csrf_token="+getCsrfTokenJs(),n+="&Action=VOTE_ANSWER",$.ajax({type:"POST",url:URL_CLIENT_REQUEST,data:n,success:this.addVoteResponse,error:ajaxErrorResponse,dataType:"json"})},this.addVoteResponse=function(n){t.find(".poll-plugin__notice").html(n.notice),n.notice.indexOf("noticeError")>=0&&t.find(".noticeError").addClass("alert alert-danger").css("width","100%").attr("role","alert"),n.displaydata&&(t.find('form[name="formPoll"]').hide(),t.find(".btn-add-answer").hide(),t.find(".poll-plugin__header").hide(),$("#poll-plugin-container-"+n.id).show().html(n.displaydata))}}