1import{aG as D,r as n,M,c as H,N as z,d as i,e as c,f as m,w as _,O as G,W as U,l as Q,g as f,H as W,n as g,j as s,x as q,V as J,F as K,P as X,y as B,m as Y,p as b}from"./app-4h8KysWF.js";import{d as O}from"./PollService-r9nQBceU.js";import{_ as Z}from"./PoweredBy-q5ng-A3z.js";import{_ as ee,a as te}from"./PollResultSection-noagwolX.js";import{_ as le}from"./PollQuestionSection-1CB7q1Uk.js";import{s as oe}from"./message.esm-dBk5wkAy.js";import{u as se}from"./index-RjwNpF1t.js";/* empty css */import"./AxiosService-xrT-wMRI.js";import"./vue-tabler-icons.es-rN11HwC2.js";import"./progressbar.esm-CkP8XB-s.js";import"./index.esm-CChYWSe0.js";import"./index.esm-jIX710yK.js";const ae=s("meta",{name:"robots",content:"noindex, nofollow"},null,-1),ne={class:"h-full"},re={class:"rounded-xl"},ie={class:"text-base font-bold text-center min-h-[48px]"},ue={class:"entry-poll__media flex-shrink-0 text-left order-2 xl:order-1 max-w-lg w-full mx-auto"},ce={class:"poll-element-with-cover ans-card rounded-xl h-full"},pe={class:"grid grid-cols-2 gap-4 px-1 md:px-5 pb-5"},de={class:"dmp-card-section rounded-lg overflow-hidden relative cursor-pointer"},ve={class:"relative aspect-square overflow-hidden bg-gray-50 rounded-b-lg"},me=["src"],fe={class:"text-sm font-medium text-center p-1"},xe={key:0,class:"m-5 mt-0"},he={class:"ans-card-section px-5 py-3 bg-gray-50 rounded-b-xl"},we={name:"PollResult"},je=Object.assign(we,{props:{auth:Object,poll:Object,enableRegistration:Boolean,enableGuestForm:Boolean,oauthRedirect:Boolean,errors:Object,registrationType:String,pid:String,isEmbed:Boolean,statusMessage:String,nextPoll:Object},setup(x){const{isIframe:u}=D(),R=n(null),{height:P}=se(R);let y=new URLSearchParams(window.location.search);const N=n(y.get("style")),p=x,{steps:r}=p.poll,I=n(!!p.auth.user),e=n(p.poll.steps.length-1),t=n(r[e.value]),T=n([]),j=n({id:null,title:"",value:"",params:null,placeholder:"Enter the option here...",voted:0,percentage:0}),$=n(!1),h=n(r[e.value].options),w=n(p.nextPoll),V=M(()=>(I.value||!p.poll.register_to_view_result)&&h.value.length&&t.value.pollType!=="input"),A=M(()=>(I.value||!p.poll.register_to_view_result)&&h.value.length&&t.value.pollType==="input"),k=(l=0)=>{let a=[];t.value.pollType!=="input"&&(a=U(r)[e.value].options.filter(o=>(o==null?void 0:o.userVote)===!0).map(o=>o.value),T.value=a)},S=(l=0)=>{let a;t.value.pollType!=="input"&&(a=r[e.value].options.reduce((v,o)=>v.voted>o.voted?v:o)),j.value=a},E=()=>{e.value<r.length-1&&(e.value=e.value+1,t.value=r[e.value],h.value=r[e.value].options,S(e.value),k(e.value))},F=()=>{e.value===0&&($.value=!1),e.value>0&&(e.value=e.value-1,t.value=r[e.value],h.value=r[e.value].options,S(e.value),k(e.value))},L=()=>{b.Inertia.visit(`${window.location.pathname}${window.location.search}`)},d=n(!1),C=async()=>{if(!u){d.value=!0;let l=await O({params:window.location.search});return w.value=l==null?void 0:l.poll,w.value.alias?b.Inertia.visit(route("public.polls.item",w.value.alias)):b.Inertia.visit(route("public.polls.all"))}if(u){d.value=!0;let l=await O({params:window.location.search});w.value=l==null?void 0:l.poll,b.Inertia.visit(route("public.embed.poll.item",{alias:w.value.alias})+`${window.location.search}`)}};return H(()=>{if(S(),k(),u){var l={height:P.value,id:y.get("qyTD")};window.parent.postMessage(l,"*")}}),z([()=>P.value],()=>{if(y=new URLSearchParams(window.location.search),u){let l={height:P.value,id:y.get("qyTD")};window.parent.postMessage(l,"*")}}),(l,a)=>(i(),c("div",{ref_key:"containerRef",ref:R},[m(G,null,{default:_(()=>{var v;return[x.isEmbed?(i(),Q(f(W),{key:0},{default:_(()=>[ae]),_:1})):g("",!0),s("div",ne,[s("div",re,[s("div",ie,q(x.poll.title),1),s("div",ue,[s("div",ce,[m(le,{title:t.value.questionField.title,"question-cover":t.value.questionCover,"question-type":t.value.pollType,"title-class":t.value.pollType==="boolean"||t.value.pollType==="rating"||t.value.pollType==="checkbox"||t.value.pollType==="input"?"text-center":t.value.pollType==="ab"?"text-center py-7":""},J({_:2},[t.value.pollType==="ab"?{name:"options",fn:_(()=>[s("div",pe,[(i(!0),c(K,null,X(t.value.options,o=>(i(),c("div",{key:o.id},[s("div",{class:B([{"border-primary-300 text-primary-700":T.value.includes(o.value)},"ans-card rounded-xl p-1 block h-full cursor-pointer"])},[s("div",de,[s("div",ve,[s("img",{class:"absolute w-full h-full object-cover object-center",src:o.url},null,8,me)]),s("div",fe,q(o.title),1)])],2)]))),128))])]),key:"0"}:void 0]),1032,["title","question-cover","question-type","title-class"]),m(ee,{"question-type":(v=t.value)==null?void 0:v.pollType,"current-answer":T.value,"current-top-answer":j.value,"is-poll-step-answered":!0,"poll-result":h.value,"show-result-progress":V.value,"show-result-input":A.value},null,8,["question-type","current-answer","current-top-answer","poll-result","show-result-progress","show-result-input"]),m(te,{"next-step":e.value!==f(r).length-1,"is-login":!0,"control-type":"result","current-poll-index":e.value,onOnNextPoll:E,onOnPrevPoll:F},null,8,["next-step","current-poll-index"]),x.statusMessage?(i(),c("div",xe,[m(f(oe),{severity:"info",closable:!1},{default:_(()=>[Y(q(x.statusMessage),1)]),_:1})])):g("",!0),s("div",he,[m(Z)])])]),f(u)&&N.value==="multiple"?(i(),c("div",{key:0,class:"text-sm font-normal text-primary-700 text-center mt-4 cursor-pointer",onClick:a[0]||(a[0]=()=>L())}," Back to polls ")):g("",!0),f(u)&&N.value==="single"?(i(),c("div",{key:1,class:B(["text-sm font-normal text-primary-700 text-center mt-4 cursor-pointer",{"text-primary-200":d.value}]),onClick:a[1]||(a[1]=()=>!d.value&&C())}," Show next poll ",2)):g("",!0),f(u)?g("",!0):(i(),c("div",{key:2,class:B(["text-base font-normal text-primary-700 text-center mt-4 cursor-pointer",{"text-primary-200":d.value}]),onClick:a[2]||(a[2]=()=>!d.value&&C())}," Show next poll ",2))])])]}),_:1})],512))}});
1export{je 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.