1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1182],{30705:function(e,t,n){"use strict";n.r(t);var r,i=n(28520),s=n.n(i),o=n(85893),a=n(92764),c=n(33612),l=n(28509),u=n.n(l),d=n(94184),p=n.n(d),v=n(67294);function f(e,t,n,r,i,s,o){try{var a=e[s](o),c=a.value}catch(l){return void n(l)}a.done?t(c):Promise.resolve(c).then(r,i)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var s=e.apply(t,n);function o(e){f(s,r,i,o,a,"next",e)}function a(e){f(s,r,i,o,a,"throw",e)}o(void 0)}))}}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}t.default=function(e){var t=e.item,n=function(e){var t=g(e);return t>100&&(t=100),{width:"".concat(t,"%")}},i=localStorage.getItem("poll_".concat(t.id)),l=i?+i:0,d=(0,v.useState)(t.options.find((function(e){return e.id===l}))),f=d[0],h=d[1],m=(0,v.useState)(!1),b=m[0],w=m[1],j=t.options.reduce((function(e,t){return e+t.votes}),0),g=function(e){return Math.round(e.votes/j*100)};function N(){return(N=_(s().mark((function e(n){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return w(!0),e.prev=3,e.next=6,c.Z.post("results/poll",{poll_id:t.id,option_id:n.id});case 6:++n.votes,h(n),localStorage.setItem("poll_".concat(t.id),"".concat(n.id)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),(0,a.Z)(e.t0,!0);case 14:w(!1);case 15:case"end":return e.stop()}}),e,null,[[3,11]])})))).apply(this,arguments)}return(0,o.jsxs)("div",{className:"mb-4",children:[(0,o.jsxs)("div",{className:"font-bold text-xl mb-4",children:[(0,o.jsx)("span",{children:t.title}),(0,o.jsx)("span",{className:"cm-label relative ml-1",children:"\u041e\u043f\u0440\u043e\u0441"})]}),t.options.map((function(e,t){return(0,o.jsxs)("button",{type:"button",onClick:function(){return function(e){return N.apply(this,arguments)}(e)},className:p()((r={},x(r,u().answer,!0),x(r,u().__active,(null===f||void 0===f?void 0:f.id)===e.id),x(r,"pointer-events-none",f),r)),children:[(0,o.jsx)("svg",{viewBox:"0 0 24 26",children:(0,o.jsx)("polyline",{points:"0 16.48 7.74 26 24 5.14 24 0 7.75 20.98 0 11.53 0 16.48"})}),(0,o.jsx)("div",{className:"text-lg",children:e.title}),(0,o.jsx)("div",{className:u().progress,style:n(e)}),f&&(0,o.jsxs)("div",{className:"text-xs",children:[g(e),"%"]})]},t)}))]})}},28509:function(e){e.exports={progress:"Poll_progress__SJeb7",answer:"Poll_answer__LaUL6",__active:"Poll___active__08bRF"}}}]);
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.