PageSourceSearch

https://cdn.metaratings.ru/_next/static/chunks/54467-9cb4e0bfa16186df.js

js metaratings.ru collected 2026-10-09 22:43:24 UTC 9,089 bytes, 23 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[54467],{14085:e=>{e.exports={lineChart:"LineChart_lineChart__PgN6Q",box:"LineChart_box__pFGJ8",title:"LineChart_title__sw3oB",value:"LineChart_value___MN2Y",progress:"LineChart_progress__EXhLf",progressGreat:"LineChart_progressGreat__fnBDo",progressGood:"LineChart_progressGood__gGs1J",progressBad:"LineChart_progressBad__tnoWs",progressNeutral:"LineChart_progressNeutral__YEd04"}},15031:(e,t,s)=>{"use strict";s.d(t,{b:()=>_});var l=s(60072),r=s(86419),o=s.n(r),a=s(87520),n=s(14085),i=s.n(n);let _=({value:e,title:t,className:s,alwaysGreenProgress:r=!1})=>(0,l.jsxs)("div",{className:o()(i().lineChart,s),children:[!(0,a.Ie)(t)&&(0,l.jsxs)("div",{className:i().box,children:[(0,l.jsx)("span",{className:i().title,children:t}),(0,l.jsx)("span",{className:i().value,children:e<=100?e:100})]}),(0,l.jsx)("div",{className:o()(i().progress,{[i().progressGreat]:e>=75||r,[i().progressGood]:e>=50&&e<75&&!r,[i().progressBad]:e>0&&e<50&&!r,[i().progressNeutral]:0===e&&!r}),style:{width:`${e}%`}})]})},21837:e=>{e.exports={polls:"Vote_polls__VU0qD",tipsVote:"Vote_tipsVote__2F_7N",lessFive:"Vote_lessFive__yWG5u",pollsItem:"Vote_pollsItem__2rQNy",lackOne:"Vote_lackOne__rxnI5",lackTwo:"Vote_lackTwo__zjjnM",lackThree:"Vote_lackThree__pfBJd",lackFour:"Vote_lackFour__WHsZx",pollsVariants:"Vote_pollsVariants__1VmUZ",pollsCreative:"Vote_pollsCreative__C_YLk",pollsBody:"Vote_pollsBody___PZLW",pollsTitle:"Vote_pollsTitle__DttRv",pollsOptionIcon:"Vote_pollsOptionIcon__5OIx1",active:"Vote_active__V_LsR",pollsRow:"Vote_pollsRow__tnDCm",pollsButton:"Vote_pollsButton__dqryX",pollsResults:"Vote_pollsResults__ELLEK",pollsResultsItem:"Vote_pollsResultsItem__9Ra_o",pollsResultsValue:"Vote_pollsResultsValue__CBwjb",pollsResultsLabel:"Vote_pollsResultsLabel__Cb_es",pollsResultsProgress:"Vote_pollsResultsProgress__rPKvq"}},54467:(e,t,s)=>{"use strict";s.d(t,{x:()=>E});var l=s(60072),r=s(60004),o=s(36109),a=s(86419),n=s.n(a),i=s(10366),_=s(87520),u=s(67335),c=s(83055),p=s(61240),d=s(1510),h=s(36914),g=s(12519),m=s(15031),v=s(75052),f=s(21837),R=s.n(f),V=s(81727),w=s(40546);let I=(0,w.J1)`
2  mutation VoteOnPoll($poll_id: Int!, $answer_id: Int!) {
3    voteOnPoll(answer_id: $answer_id, poll_id: $poll_id) {
4      vote_count
5    }
6  }
7`;(0,w.J1)`
8  mutation VoteOnPoll($poll_id: Int!, $answer_id: Int!) {
9    voteOnTips(answer_id: $answer_id, tips_id: $poll_id) {
10      vote_count
11    }
12  }
13`,(0,w.J1)`
14  query TipsVotes($slug: String!) {
15    tipsDetail(slug: $slug) {
16      votes {
17        name
18        id
19        vote_count
20      }
21    }
22  }
23`;let N=50,E=({appearance:e,id:t,name:s,banner:a,preview:f,preview_mobile:w,promoLink:E,votes:C,show_vote_count_min_votes:T,show_vote_count:x=!0,option_icon_size:O=N})=>{let j,[y]=(0,o.n)(I),{trigger:A}=(0,p.Oz)({tipsId:t}),{hasAuth:b}=(0,c.Ay)(),[L,k]=(0,r.useState)(null),[P,S]=(0,r.useState)(!1),[$,B]=(0,r.useState)(0),[X,G]=(0,r.useState)(null),{t:U}=(0,i.Bd)("layout");(0,r.useEffect)(()=>{let s=localStorage.getItem(`${e}-${t}`);s&&"false"!==s&&(S(!0),k(s.toString()))},[]),(0,r.useEffect)(()=>{B(C.reduce((e,t)=>e+t.vote_count,0))},[C]);let F=e=>X&&e.id.toString()===L?X:e.vote_count,M=(e=>{let t=e.reduce((e,t)=>e+t,0);if(0===t)return e.map(()=>0);let s=e.map(e=>e/t*100),l=s.map(Math.floor),r=100-l.reduce((e,t)=>e+t,0),o=s.map((e,t)=>({val:e,i:t})).sort((e,t)=>t.val%1-e.val%1).map(e=>e.i);for(let e=0;e<r;e++)l[o[e]]++;return l})(C.map(F));if((0,_.Ie)(C))return null;let H=O??N,J=e=>e.icon?(0,l.jsx)("img",{src:e.icon,alt:"",className:R().pollsOptionIcon,width:H,height:H,style:{width:H,height:H}}):null;return(0,l.jsxs)("div",{className:n()(R().polls,{[R().tipsVote]:"tipsVote"===e,[R().lessFive]:"tipsVote"===e&&C.length<5,[R().lackOne]:"tipsVote"===e&&C.length>4&&C.length%4==1,[R().lackTwo]:"tipsVote"===e&&C.length>4&&C.length%4==2,[R().lackThree]:"tipsVote"===e&&C.length>4&&C.length%4==3,[R().lackFour]:"tipsVote"===e&&C.length>4&&C.length%4==0}),children:[P&&"poll"===e&&!(0,_.Ie)(a)&&(0,l.jsx)(g.A,{type:"SHORT_TAG",banner:a}),(0,l.jsxs)("div",{className:R().pollsBody,children:[w?.url&&f?.url&&"poll"===e&&!P&&(j=(0,l.jsx)(v.A,{layout:"fixed",className:R().pollsCreative,images:[{src:w.url,width:w.width,height:w.height,media:767},{src:f.url,width:f.width,height:f.height}],alt:s||""}),E?.href?(0,l.jsx)(d.N,{className:"js-seo",href:E.href,rel:E.rel,target:"_blank","data-seo-data":(0,u._)(E?.analytics_data,{event:"click_on_bk_web",version:"logo",place:"logo"}),children:j}):j),"tipsVote"===e&&(P?(0,l.jsx)(g.A,{type:"FORECAST_AFTER_VOTE"},"after"):(0,l.jsx)(g.A,{type:"FORECAST_VOTE"},"before")),!(0,_.Ie)(s)&&(0,l.jsx)("div",{className:R().pollsTitle,children:s}),!(0,_.Ie)(C)&&!P&&(0,l.jsx)("div",{className:R().pollsVariants,children:C.map((e,t)=>(0,l.jsxs)("div",{onClick:t=>{P||k(e.id.toString())},className:n()(R().pollsItem,{[R().active]:L===e.id.toString()}),children:[J(e),e.name]},t))}),!(0,_.Ie)(C)&&P&&(0,l.jsx)("div",{className:R().pollsResults,children:C.map((t,s)=>{let r=M[s],o=F(t);return(0,l.jsxs)("div",{className:n()(R().pollsResultsItem,{[R().active]:L===t.id.toString()}),children:[(0,l.jsxs)("span",{className:R().pollsResultsValue,children:[r,"%","poll"===e&&x&&o>=(T??200)&&` (${o})`]}),(0,l.jsxs)("span",{className:R().pollsResultsLabel,children:[J(t),t.name]}),(0,l.jsx)(m.b,{value:r,className:R().pollsResultsProgress,alwaysGreenProgress:!0})]},s)})}),(0,l.jsxs)("div",{className:R().pollsRow,children:[b&&(0,l.jsx)(h.$,{size:V.pK.LARGE,color:V.nw.PRIMARY_OUTLINE,className:R().pollsButton,href:"#comments",children:U("Discuss")}),!P&&(0,l.jsx)(h.$,{size:V.pK.LARGE,color:V.nw.PRIMARY,className:R().pollsButton,disabled:(0,_.Ie)(L),onClick:s=>(s=>{if(S(!(0,_.Ie)(s)),(0,_.Ie)(s))localStorage.removeItem(`${e}-${t}`);else{localStorage.setItem(`${e}-${t}`,s);let l=parseInt(s);("poll"===e?y({variables:{answer_id:l,poll_id:parseInt(t)}}).then(e=>e.data.voteOnPoll.vote_count):A({answer_id:l}).then(e=>e.vote_count)).then(e=>{B(e=>e+1),G(e)})}return!1})(L),children:U("Vote")})]})]})]})}},61240:(e,t,s)=>{"use strict";s.d(t,{ji:()=>v,Oz:()=>R,$A:()=>f});var l=s(64948),r=s(60004),o=s(61347),a=s(2625);let n=a.r?e=>{e()}:r.startTransition,i=(0,o.Ht)(l.Ay,()=>(e,t,s={})=>{let{mutate:l}=(0,o.iX)(),i=(0,r.useRef)(e),_=(0,r.useRef)(t),u=(0,r.useRef)(s),c=(0,r.useRef)(0),[p,d,h]=(e=>{let[,t]=(0,r.useState)({}),s=(0,r.useRef)(!1),l=(0,r.useRef)(e),o=(0,r.useRef)({data:!1,error:!1,isValidating:!1}),n=(0,r.useCallback)(e=>{let r=!1,a=l.current;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&a[t]!==e[t]&&(a[t]=e[t],o.current[t]&&(r=!0));r&&!s.current&&t({})},[]);return(0,a.u)(()=>(s.current=!1,()=>{s.current=!0})),[l,o.current,n]})({data:a.U,error:a.U,isMutating:!1}),g=p.current,m=(0,r.useCallback)(async(e,t)=>{let[s,r]=(0,a.s)(i.current);if(!_.current)throw Error("Can’t trigger the mutation: missing fetcher.");if(!s)throw Error("Can’t trigger the mutation: missing key.");let o=(0,a.m)((0,a.m)({populateCache:!1,throwOnError:!0},u.current),t),p=(0,a.o)();c.current=p,h({isMutating:!0});try{let t=await l(s,_.current(r,{arg:e}),(0,a.m)(o,{throwOnError:!0}));return c.current<=p&&(n(()=>h({data:t,isMutating:!1,error:void 0})),null==o.onSuccess||o.onSuccess.call(o,t,s,o)),t}catch(e){if(c.current<=p&&(n(()=>h({error:e,isMutating:!1})),null==o.onError||o.onError.call(o,e,s,o),o.throwOnError))throw e}},[]),v=(0,r.useCallback)(()=>{c.current=(0,a.o)(),h({data:a.U,error:a.U,isMutating:!1})},[]);return(0,a.u)(()=>{i.current=e,_.current=t,u.current=s}),{trigger:m,reset:v,get data(){return d.data=!0,g.data},get error(){return d.error=!0,g.error},get isMutating(){return d.isMutating=!0,g.isMutating}}});var _=s(67508),u=s(89034),c=s(89034);let p=c.env.REST_API_URL||"";
23class d extends Error{constructor(e,t){super(`[fetchApi] ${e}: HTTP ${t}`),this.name="FetchApiError",this.status=t,this.endpoint=e}}async function h(e,t,s){let l=_.A?p:"https://metaratings.ru/api/v1";if(_.A&&!p)throw Error("[fetchApi] REST_API_URL is not configured. Check .env file and restart the dev server.");let r=new URL(`${l}${e}`,_.A?void 0:window.location.origin);if(t)for(let[e,s]of Object.entries(t))Array.isArray(s)?s.forEach(t=>r.searchParams.append(`${e}[]`,t)):r.searchParams.set(e,s);let o={Accept:"application/json"};_.A?(o["X-meta-host"]="metaratings.ru",o["X-meta-region"]=c.env.NEXT_PUBLIC_REGION_PREFIX||"",o["X-Meta-Url"]="/",o["X-meta-code"]="sport_ru"):s?.withRegion&&(o["X-meta-region"]=c.env.NEXT_PUBLIC_REGION_PREFIX||"");let a={headers:o,signal:function(){if("phase-production-build"===u.env.NEXT_PHASE)return AbortSignal.timeout(1e4)}()};s?.method&&(a.method=s.method),s?.body!==void 0&&(o["Content-Type"]="application/json",a.body=JSON.stringify(s.body));let n=await fetch(r.toString(),a);if(!n.ok)throw new d(e,n.status);return n.json()}let g=e=>`/tips/${e}/votes`,m=e=>`/tips/${e}/edit-url`;function v(e){let{slug:t,enabled:s}=e;return(0,l.Ay)(s&&t?m(t):null,h)}function f(e){let{slug:t}=e;return(0,l.Ay)(t?g(t):null,h)}function R(e){let{tipsId:t}=e;return i(null!=t?g(t):null,(e,{arg:t})=>h(e,void 0,{method:"POST",body:t}))}}}]);

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.