import{A as e,H as t,M as n,U as r,W as i,_ as a,f as o,m as s,p as c,x as l}from"./index-HVdHQ9Gs.js";import{t as u}from"./_plugin-vue_export-helper-B52Kst-M-CyeiEtOQ.js";var d={id:`Poll`},f={class:`question`},p={class:`subtitle`},m={class:`text`},h={class:`percentage`},g={class:`tail`},_=u(l({__name:`Poll`,props:{f:{}},setup(l){let u=l,_=c(()=>u.f),v=c(()=>Math.max(..._.value.options.map(e=>e.voter_count)));function y(e){return _.value.total_voter_count==0?`0%`:(e.voter_count/_.value.total_voter_count*100).toFixed(0)+`%`}let b=c(()=>{let e=_.value.type==`REGULAR`?`Poll`:`Quiz`;return _.value.is_anonymous&&(e=`Anonymous `+e),e});return(c,l)=>(e(),a(`div`,d,[s(`div`,f,i(_.value.question),1),s(`div`,p,i(b.value),1),(e(!0),a(o,null,n(_.value.options,n=>(e(),a(`div`,{class:t([`options`,{dominant:n.voter_count===v.value&&v.value!==0}]),key:n.data},[s(`span`,m,i(n.text),1),l[0]||=s(`span`,{class:`f-grow1`},null,-1),s(`span`,h,i(y(n)),1),s(`div`,{class:`bar`,style:r({width:y(n)})},null,4)],2))),128)),s(`div`,g,`Final Results - `+i(_.value.total_voter_count)+` Responses`,1)]))}}),[[`__scopeId`,`data-v-37741415`]]);export{_ as default};