PageSourceSearch

https://korso.pl/_nuxt/BiiAo-p0.js

js korso.pl collected 2026-09-24 09:59:53 UTC 8,083 bytes, 1 lines download raw bytes

1import{d as o,B as t,a as e,J as s,u as l}from"./Cm2J8wJT.js";import{ah as i,ak as a,J as n,L as p,a5 as d,as as r,M as h,$ as c,V as u,U as _,Q as y,a8 as g,T as m,R as f,S as v,a4 as w,O as b}from"./Cw52Jb_b.js";import"./oPzPbeIq.js";import"./Dv5-W7ly.js";const k=o({name:"PollOption",props:["option","itemKey","showResults","showType","forceDisabled","isPlebiscite"],data:()=>({toggled:!1}),methods:{}},"$njDFCA7RnM"),V=["for"],O=["id","disabled"],z={class:"pollOption__circle"},$={key:0,class:"pollOption__image"},x=["src","alt"],M={class:"pollOption__title"},C={key:2,class:"pollOption__result"},j={class:"pollOption__result-score"};const H=i(k,[["render",function(o,t,e,s,l,i){const v=a("font-awesome-icon");return o.option?(n(),p("label",{key:0,class:y("poll__single-option pollOption "+(o.option.cover&&""!==o.option.cover?"pollOption--plebiscite":"")),for:`pollOption_${o.itemKey}`},[d(h("input",{"onUpdate:modelValue":t[0]||(t[0]=t=>o.option.value=t),type:"checkbox",id:`pollOption_${o.itemKey}`,name:"pollOption[]",disabled:o.forceDisabled},null,8,O),[[r,o.option.value]]),h("span",z,[c(v,{icon:["fas","check"]})]),o.option.cover&&""!==o.option.cover?(n(),p("span",$,[h("img",{src:o.getImageUrl(o.option.cover),alt:`${o.option.title}`},null,8,x)])):u("",!0),h("h4",M,_(o.option.title),1),h("div",{class:y("pollOption__text "+(!o.toggled&&o.option.description.length>96?"pollOption__text--toggled":""))},_(o.option.description),3),o.option.description&&o.option.description.length>96?(n(),p("div",{key:1,class:y("pollOption__toggle "+(o.toggled?"pollOption__toggle--toggled":"")),onClick:t[1]||(t[1]=g((t=>o.toggled=!o.toggled),["stop","prevent"]))},[t[2]||(t[2]=h("span",null,null,-1)),m(" "+_(o.toggled?"zwiń":"rozwiń"),1)],2)):u("",!0),o.showResults?(n(),p("div",C,[h("span",{class:"pollOption__result-bar",style:f(`width: ${o.option.procent}%`)},null,4),h("span",j,[m(_(1==o.showType?`(${o.option.votes}) `:""),1),h("strong",null,_(o.option.procent)+"%",1)])])):u("",!0)],10,V)):u("",!0)}]]);t.defaults.headers.common.multiportal="true";const R=o({name:"SinglePoll",props:["poll","showPollFace","pollUpdate","articleId"],setup:()=>({store:e()}),mounted(){window&&(this.isMobile=window.innerWidth<1290,this.currentHref=window.location.href);const o=(new Date).getTime(),t=1e3*this.$datefns.getUnixTime(this.poll.vote_from)<o,e=1e3*this.$datefns.getUnixTime(this.poll.vote_until)<o;this.voteStarted=t,this.voteEnded=e,(this.user||0!=this.poll.pool_access)&&t||(this.canVote=!1),(1==this.poll.show_result||(2==this.poll.show_result||0==this.poll.show_result)&&e)&&(this.showResults=!0),1==this.poll.type&&(this.typeMaxVotes=2),this.getVoteCookie()},components:{PollOption:H},data:()=>({loading:!1,isMobile:!1,currentHref:"",message:"",alreadyVoted:!1,voteEnded:!1,canVote:!0,voteStarted:!1,showResults:!1,typeMaxVotes:2}),computed:{user(){return this.store.user},selectedOptions(){let o=[];for(let t of this.poll.options)t.value&&o.push(t);return o}},watch:{selectedOptions(o,t){if(0==this.poll.type&&1==t.length)for(let e of this.poll.options)e.id==t[0].id&&(e.value=!1)},user:function(){this.store.user&&this.getVoteCookie()}},methods:{createHash(o){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let e=" ";for(let s=0;s<o;s++)e+=t.charAt(Math.floor(62*Math.random()));return e},async handleVote(){if(this.loading)return;this.loading=!0;const o=this.alreadyVoted;try{let e=[],l=[];for(let o of this.poll.options)o.value&&(e.push(o.id),l.push(o.title));const i={pool_id:this.poll.id,option_id:e};this.user?i.user_id=this.user.user_id:i.hash=this.createHash(10);const a=(await t.post("/api/polls/vote",i)).data;if(a.success){const t=a.data;s({articleId:this.articleId,pollId:this.poll.id,optionIds:e,optionLabels:l,isVoteChange:o}),this.setVoteCookie(e),this.message="Dziękujemy za oddany głos",this.canVote=!1,this.alreadyVoted=!0,0==this.poll.show_result&&(this.showResults=!0);for(let o of t.options)o.value=e.indexOf(o.id)>-1;3==this.poll.show_type?this.message+=` wyniki będą dostępne po ${this.poll.vote_until} w osobnym artykule`:2==this.poll.show_type&&(this.message+=` wyniki będą dostępne ${this.poll.vote_until}`),this.pollUpdate(t),this.getVoteCookie()}else a.message&&(this.canVote=!1,this.message=a.message,this.message.indexOf("został 
1już oddany")&&(this.alreadyVoted=!0,this.setVoteCookie()))}catch(e){e.response&&e.response.data&&(this.canVote=!1,this.message=e.response.data.message,this.message.indexOf("został już oddany")&&(this.alreadyVoted=!0,this.setVoteCookie()))}this.loading=!1},setVoteCookie(o){let t=`poll_voted_${this.poll.id}`;this.user&&(t+=`_${this.user.user_id}`);const e=86400*(this.poll&&1==this.poll.pool_frequency?1:360);l(t,{maxAge:e,path:"/",sameSite:"lax"}).value=JSON.stringify(o)},getVoteCookie(){let o=`poll_voted_${this.poll.id}`;this.user&&(o+=`_${this.user.user_id}`);let t=l(o);if(t=t.value,t){this.alreadyVoted=!0,this.canVote=!1,this.message="Głos został już oddany.",3==this.poll.show_type?this.message+=` wyniki będą dostępne po ${this.poll.vote_until} w osobnym artykule`:2==this.poll.show_type&&(this.message+=` wyniki będą dostępne ${this.poll.vote_until}`);for(let o of this.poll.options)t.indexOf(o.id)>-1&&(o.value=!0);0==this.poll.show_result&&(this.showResults=!0)}}}},"$TeNOWrHJ1N"),S=["data-poll-id","data-poll-title"],P={class:"poll__single"},T={class:"poll__single-top"},D={class:"poll__single-small poll__single-type"},I={class:"poll__title"},U={key:0,class:"poll__single-small"},E={class:"poll__single-options"},A={key:0,class:"btn"},K={class:"poll__single-summary"},J={key:1,class:"message"},N={key:2,class:"message"},G={key:1,class:"poll__single-disabled"},L={key:0,class:"poll__unauthorized"},Z={class:"poll__unauthorized-btn"},B=["href"];const F=i(R,[["render",function(o,t,e,s,l,i){const d=a("PollOption");return o.poll?(n(),p("div",{key:0,class:"poll","data-poll-id":o.poll.id,"data-poll-title":o.poll.title},[h("div",P,[1==o.poll.enabled?(n(),p(v,{key:0},[h("div",T,[h("span",D,_(0==o.poll.type?"SONDA":"PLEBISCYT"),1),h("h3",I,_(o.poll.title),1),1==o.poll.show_votes?(n(),p("span",U," Zagłosowało "+_(o.poll.all_votes)+" osób",1)):u("",!0)]),h("div",E,[(n(!0),p(v,null,w(o.poll.options,(t=>(n(),b(d,{option:t,isPlebiscite:1==o.poll.type,showResults:o.showResults,showType:o.poll.show_type,forceDisabled:o.alreadyVoted||!o.canVote||o.selectedOptions.length>=o.typeMaxVotes&&!t.value||o.showResults,itemKey:`poll_${o.poll.id}_option_${t.id}`},null,8,["option","isPlebiscite","showResults","showType","forceDisabled","itemKey"])))),256))]),o.canVote&&!o.voteEnded?(n(),p("div",{key:0,class:y("poll__single-votebar "+(0==o.selectedOptions.length?"poll__single-votebar--disabled":""))},[o.loading?(n(),p("span",A,t[1]||(t[1]=[h("span",{class:"spinner-border"},null,-1)]))):(n(),p("span",{key:1,class:"btn",onClick:t[0]||(t[0]=t=>o.handleVote())},"Zagłosuj"))],2)):u("",!0),h("div",K,[o.message&&""!=o.message||o.voteEnded?o.voteEnded?(n(),p("span",J,_(1==o.poll.type?"Plebiscyt został zakończony dnia":"Sonda została zakończona dnia")+" "+_(o.$datefns.format(o.poll.vote_until,"dd.MM.yyyy"))+" o godz "+_(o.$datefns.format(o.poll.vote_until,"HH:mm")),1)):(n(),p("span",N,_(o.message),1)):(n(),p(v,{key:0},[o.voteStarted?(n(),p(v,{key:0},[m(" Głosy można oddawać do "+_(o.$datefns.format(o.poll.vote_until,"dd.MM.yyyy"))+" do godz "+_(o.$datefns.format(o.poll.vote_until,"HH:mm")),1)],64)):(n(),p(v,{key:1},[m(" Głosy można oddawać od "+_(o.$datefns.format(o.poll.vote_from,"dd.MM.yyyy"))+" od godz "+_(o.$datefns.format(o.poll.vote_from,"HH:mm")),1)],64))],64))])],64)):(n(),p("div",G," Sonda / plebiscyt została wyłączona przez administratora "))]),o.user||0!=o.poll.pool_access||1!=o.poll.enabled?u("",!0):(n(),p("div",L,[t[2]||(t[2]=h("div",{class:"poll__unauthorized-txt"},"Aby móc wziąć udział w głosowaniu, należy być zarejestrowanym i zalogowanym na naszym serwisie",-1)),h("div",Z,[h("a",{href:`/login?redirect=${o.currentHref}`,class:"btn btn--orange"},"Zaloguj się",8,B)])]))],8,S)):u("",!0)}]]);export{F as default};

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.