"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[395],{6395:function(e,i,t){t.d(i,{Z:function(){return r}});var s=t(5893);t(1664);var n=t(7294),l=t(6937),a=t(8856),d=t(1163);function r(e){var i,t,r,o;let{event:c,hideodd:m,openActionSheet:g}=e,u=(0,d.useRouter)(),h=localStorage.getItem("token"),p=(0,n.useRef)(),x=()=>{if(g){g();return}p.current.open()},f=()=>{p.current.close()},v=(e,i)=>e.length>i?e.substring(0,i)+"...":e,y=e=>{let i=e.reduce((e,i)=>e+i,0);return e.map(e=>e/i*100)},{addToBasket:j,betData:_}=(0,l.K)(),b=(0,n.useRef)(!1),w=async(e,i,t,s,n,l,a)=>{try{if(b.current)return;b.current=!0;let d=JSON.stringify(l);h?await j({event_id:e,group:i,sub_group:t,sub_group_id:s,sub_group_name:n,odd:d,sport_id:a}):u.push("/login")}catch(r){}b.current=!1};return c.sport_id?(0,s.jsxs)("div",{className:"col-12 col-md col-lg matchwrap",style:{marginBottom:16},children:[(0,s.jsxs)("div",{className:"match-card ",style:{overflow:"unset"},children:[(0,s.jsxs)("div",{className:"header d-flex justify-content-center align-items-center container",style:{maxWidth:"100%"},children:[(0,s.jsx)("div",{className:"icon top-left",style:{backgroundColor:"#010119",position:"absolute",left:10,top:-2},children:(0,s.jsx)("img",{src:c.icon_path||c.sport_icon,className:"soccer-icon"})}),(0,s.jsx)("div",{className:"date-time",children:(e=>{let i=new Date(1e3*e);return new Intl.DateTimeFormat("fr-FR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}).format(i)})(c.time)}),(0,s.jsxs)("div",{style:{backgroundColor:"#010119",position:"absolute",right:10,top:-2,cursor:"pointer"},className:"info d-flex align-items-center top-right",onClick:x,children:[(0,s.jsx)("img",{src:"/images/info-circle.png",style:{width:"16px"}}),(0,s.jsx)("span",{className:"users-count",children:c.users_count}),(0,s.jsx)("img",{src:"/images/profile-2user.png",style:{width:"16px"}})]})]}),(0,s.jsxs)("div",{className:"league d-flex justify-content-center align-items-center",children:[(0,s.jsx)("img",{src:c.league.country_icon,alt:"League flag"}),(0,s.jsx)("span",{children:c.league.name})]}),(0,s.jsxs)("a",{style:{overflow:"hidden",pointerEvents:c.bet365_id?"auto":"none"},href:"/event?eventId=".concat(c.bet365_id,"&sportId=").concat(c.sport_id,"&leagueId=").concat(c.league.id)||0,children:[(0,s.jsx)("div",{className:"teams d-flex justify-content-center",children:(0,s.jsxs)("div",{style:{textAlign:"center"},children:[(0,s.jsxs)("span",{title:c.home.name,children:[(null==c?void 0:null===(i=c.home)||void 0===i?void 0:i.image_id)?0!==c.home.image_id?(0,s.jsx)("img",{src:"https://assets.b365api.com/images/team/b/".concat(null==c?void 0:null===(t=c.home)||void 0===t?void 0:t.image_id,".png"),height:22,alt:"Flag",style:{marginRight:"5px"}}):(0,s.jsx)("span",{children:" "}):null,v(c.home.name,15)]}),(0,s.jsx)("span",{children:" - "}),(0,s.jsxs)("span",{title:c.away.name,children:[(null==c?void 0:null===(r=c.away)||void 0===r?void 0:r.image_id)?0!==c.away.image_id?(0,s.jsx)("img",{src:"https://assets.b365api.com/images/team/b/".concat(null==c?void 0:null===(o=c.away)||void 0===o?void 0:o.image_id,".png"),height:22,alt:"Flag",style:{marginRight:"5px"}}):(0,s.jsx)("span",{children:" "}):null,v(c.away.name,15)]})]})}),!c.bet365_id&&(0,s.jsxs)("div",{style:{fontSize:11,fontWeight:500,marginBottom:16,marginLeft:16,marginRight:16,textAlign:"center"},children:[(0,s.jsx)("img",{src:"/images/info-circle.png",style:{width:"12px",marginTop:-2,marginRight:5}}),"Il est actuellement impossible de prendre des paris sur cet \xe9v\xe9nement"]}),!m&&(0,s.jsx)("div",{className:"odds",children:c.odds&&(()=>{let e=Object.keys(null==c?void 0:c.odds)[0],i=null==c?void 0:c.odds[e];if(i&&Array.isArray(i.odds)){let t=i.odds.slice(0,3);if(t.length>0){let n=t.map(e=>parseFloat(e.odds)),l=y(n);return(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"row gx-3",style:{paddingLeft:8,paddingRight:8},children:t.slice(0,3).map((t,n)=>{var a;let d=l[n],r=_.find(e=>(null==e?void 0:e.odd.id)==(null==t?void 0:t.id));return(0,s.jsxs)("div",{className:"col odds-item",style:{marginBottom:5},onClick:s=>{s.preventDefault(),s.stopPropagation(),w(c.bet365_id,"main",e,i.id,i.name_fr||i.name,t,c.sport_id)},children:[(0,s.jsxs)("div",{style:{paddingTop:6,paddingBottom:6},className:"odds-item-details  ".concat(r?"clicked-odd":""),children:[(0,s.jsx)("div",{style:{fontSize:14,fontWeight:500},className:"odds-name",children:"1"===t.name?v(c.home.name,15):"2"===t.name?v(c.away.name,15):v(t.name_fr,15)}),(0,s.jsx)("div",{className:"odds-value",style:{fontSize:18,fontWeight:600},children:null===(a=(+t.odds).toFixed(2))||void 0===a?void 0:a.replace(".",",")})]}),(0,s.jsxs)("div",{className:"grid-container",style:{marginTop:5,display:"flex",flexDirection:"row"},children:[(0,s.jsxs)("span",{style:{fontSize:12,fontWeight:300},children:[d.toFixed(0),"%"]}),(0,s.jsx)("div",{className:"odds-bar",children:(0,s.jsx)("div",{className:"bar color-bar",style:{width:"".concat(d,"%")}})}),(0,s.jsx)("img",{src:"/images/info-circle.png",style:{width:"16px"}})]})]},n)})})},i.id)}}return null})()})]})]}),(0,s.jsx)(a.Z,{touchEnable:!1,sheetStyle:{borderWidth:0,overflow:"auto"},ref:p,children:(0,s.jsxs)("div",{style:{height:70,backgroundColor:"#03031F",padding:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[(0,s.jsx)("img",{src:"/images/rectangle.png",style:{width:"50px",cursor:"pointer"},onClick:f}),(0,s.jsxs)("div",{style:{paddingTop:10,display:"flex",justifyContent:"center",alignItems:"center"},children:[(0,s.jsx)("img",{src:"/images/info-circle.png",style:{width:"16px",marginRight:10}})," ","Nombre de parieurs sur ce match"]})]})})]}):null}}}]);