(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{5557:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return n(5099)}])},5099:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var s=n(5893),a=n(7294),i=n(1163),r=n(9798),c=n(4508),o=n.n(c),l=n(3922),d=n(418),u=n(1622),h=n(1973),g=n(8856);n(1664);let _=e=>{var t,n;return(0,s.jsx)("div",{className:"ad-component d-flex flex-column ",children:(0,s.jsx)("a",{href:null==e?void 0:null===(t=e.adData)||void 0===t?void 0:t.link,target:"_blank",rel:"noopener noreferrer",className:"d-flex flex-column justify-content-center align-items-center",children:(0,s.jsx)("img",{src:null==e?void 0:null===(n=e.adData)||void 0===n?void 0:n.image,alt:"Ad",style:{width:"100%",maxHeight:400,objectFit:"contain"}})})})},m=()=>(0,s.jsx)("div",{style:{padding:16,paddingTop:4,paddingBottom:.2,borderRadius:8,backgroundColor:"#03031F"},children:(0,s.jsx)("div",{style:{backgroundColor:"",backgroundColor:"#03031F"},className:" bet-booster-container",children:(0,s.jsx)("div",{className:"teams ",children:(0,s.jsxs)("a",{href:"/booster",className:"d-flex flex-column justify-content-center",children:[(0,s.jsx)("img",{src:"/images/bet.png",style:{width:"100px"}}),(0,s.jsx)("img",{src:"/images/booster.png",style:{width:"200px",marginLeft:"10%"}}),(0,s.jsx)("img",{src:"/images/x13.png",style:{width:"100px",marginLeft:"35%"}}),(0,s.jsx)("button",{className:"button btn-large",children:"Boostez vos c\xf4tes"})]})})})});var x=n(25),f=n.n(x);let p=e=>{var t;let n=null==e?void 0:null===(t=e.products)||void 0===t?void 0:t.slice(0,3);return(0,s.jsxs)("div",{className:"row gx-3",children:[(0,s.jsxs)("a",{href:"/store",children:[" ",(0,s.jsx)("h1",{style:{fontSize:22,marginBottom:16},children:"\xc9changez pour gagner"})]}),n.map(e=>(0,s.jsx)("a",{href:"/store/".concat(e.id),className:"col",children:(0,s.jsx)("div",{className:f().product,children:(0,s.jsxs)("div",{style:{paddingTop:"8px"},children:[(0,s.jsx)("img",{style:{minHeight:80,height:"20vw",maxHeight:150},src:e.thumbnail,alt:e.name}),(0,s.jsx)("div",{children:(0,s.jsxs)("span",{className:"current",children:[e.cost_in_coins.toString().replace(/\B(?=(\d{3})+(?!\d))/g,"."),(0,s.jsx)("img",{style:{marginLeft:2,marginTop:-4},width:22,height:13,src:"/images/coinsh.png",alt:"coins"})]})})]})})},e.id))]})};var j=n(3636),v=n(3540),S=n(6937),b=n(6395),y=n(4203);let N=()=>{let e=(0,a.useRef)(),t=(0,i.useRouter)(),[n,c]=(0,a.useState)(!1),[x,f]=(0,a.useState)(!1),[N,w]=(0,a.useState)(""),[k,M]=(0,a.useState)(""),[B,E]=(0,a.useState)(null),[T,C]=(0,a.useState)([]),R={ad1:!1,ad2:!1,ad3:!1},{initBasket:Z}=(0,S.K)(),[L,z]=(0,a.useState)(1),[A]=(0,a.useState)(5),[F,I]=(0,a.useState)(!1),[O,D]=(0,a.useState)([]),[H,q]=(0,a.useState)(!0),X=(0,a.useRef)(),P=async e=>{I(!0);try{let t=await r.Z.get("/bet365/v7/featured-competitions?per_page=10&page=".concat(e)),n=t.data,s=n.data;D(e=>{let t=[...e,...s.filter(t=>!e.some(e=>e.id===t.id))];return t}),q(e<n.pagination.meta.last_page)}catch(a){console.error("Error fetching data:",a)}finally{I(!1)}};(0,a.useEffect)(()=>{P(L)},[L]);let K=(0,a.useRef)();(0,a.useEffect)(()=>{let e=X.current;e&&e.disconnect();let t=e=>{e[0].isIntersecting&&H&&!F&&z(e=>e+1)};return X.current=new IntersectionObserver(t,{root:null,rootMargin:"20px",threshold:1}),K.current&&X.current.observe(K.current),()=>{e&&e.disconnect()}},[F,H]),(0,a.useEffect)(()=>{let e=localStorage.getItem("token");e&&w(e),(async()=>{I(!0);try{let e=await r.Z.get("/general/banners");E(e.data.data[0])}catch(t){t&&(0,j.notify)("Une erreur est survenue")}try{let{data:n}=await r.Z.get("/products");C(n.data)}catch(s){s&&(0,j.notify)("Une erreur est survenue")}await Z(),I(!1)})()},[L,A]);let Q=(e,t)=>(2===e||t<3)&&!R.ad1?(R.ad1=!0,(0,s.jsx)("div",{className:"col-12",style:{marginBottom:5},children:(0,s.jsx)(m,{},"ad1")})):(e-2)%4!=0||R.ad2?(e-2)%4!=2||R.ad3?null:(R.ad3=!0,(0,s.jsx)("div",{className:"col-12",children:(0,s.jsx)(p,{products:T},"ad3")})):(R.ad2=!0,(0,s.jsx)("div",{className:"col-12",style:{marginBottom:18},children:(0,s.jsx)(_,{adData:B},"ad2")})),U=()=>{let n=localStorage.getItem("token");n?(w(n),e.current.open(),f(!0)):t.push("/login")},W=()=>{f(!1),I(!1),c(e=>!e)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"page",style:{backgroundColor:"transparent"},children:F?(0,s.jsx)(h.Z,{show:!0}):(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{style:{width:"100%"},children:[(0,s.jsx)("h1",{className:"H1",style:{marginBottom:0},children:"Parier sans argent"}),(0,s.jsx)("h1",{className:"H1",style:{marginBottom:0,fontSize:28},children:"Accumuler des cadeaux \xe9patants"}),(0,s.jsx)("p",{className:"current",children:"Regardez des pubs, pariez et \xe9changez vos coins dans la boutique."}),(0,s.jsx)("div",{className:"row gx-3",children:O.map((e,t)=>{let n=t===O.length-1;return(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)(b.Z,{event:(0,y.o)(e)}),Q(t,O.length),n&&(0,s.jsx)("div",{ref:K})]},e.id)})}),F&&(0,s.jsx)("p",{children:"Loading more events..."}),N&&(0,u.Z)(N)&&(0,s.jsx)(d.Z,{onClick:U}),k&&(0,s.jsx)("div",{className:o().messages,role:"alert",children:k})]})})}),(0,s.jsx)(g.Z,{touchEnable:!1,sheetStyle:{borderWidth:0,overflow:"auto"},ref:e,onClose:W,children:x&&(0,s.jsx)(l.Z,{sheetref:e})}),(0,s.jsx)(v.O,{})]})};var w=function(){return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N,{})})}},25:function(e){e.exports={product:"AdSection_product__XKtW7",productimg:"AdSection_productimg__LLNpn",indicator:"AdSection_indicator__iE_k8"}},4508:function(e){e.exports={section:"MatchSection_section__TDrTk",section__container:"MatchSection_section__container__jBx1d",section__image:"MatchSection_section__image___dTqg",section__content:"MatchSection_section__content__hvBbr",text:"MatchSection_text__tGdho",messages:"MatchSection_messages__4429A",slideInRight:"MatchSection_slideInRight__uRXa8",fadeOut:"MatchSection_fadeOut__TsMLC","icon-quotes":"MatchSection_icon-quotes__nAdj4","chif-info__name":"MatchSection_chif-info__name__Q_To5","icon-signature":"MatchSection_icon-signature__nuL7D",card:"MatchSection_card__oBgQM"}}},function(e){e.O(0,[190,117,395,251,774,888,179],function(){return e(e.s=5557)}),_N_E=e.O()}]);