"use strict";(()=>{var e={};e.id=2672,e.ids=[2672],e.modules={20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},59496:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>m,patchFetch:()=>x,requestAsyncStorage:()=>h,routeModule:()=>c,serverHooks:()=>v,staticGenerationAsyncStorage:()=>f});var s={};a.r(s),a.d(s,{GET:()=>d});var o=a(49303),i=a(88716),r=a(60670),n=a(87070);let p=process.env.API_FOOTBALL_KEY||"",u=process.env.API_FOOTBALL_URL||"https://v3.football.api-sports.io",l=new Map;async function d(e,{params:t}){let{id:a}=await t,{searchParams:s}=new URL(e.url),o=parseInt(s.get("homeId")||"1"),i=parseInt(s.get("awayId")||"2"),r=s.get("homeNama")||void 0,d=s.get("awayNama")||void 0,c=s.get("homeLogo")||void 0,h=s.get("awayLogo")||void 0,f=s.get("status")||"upcoming",v=l.get(a);if(v&&Date.now()-v.ts<6e4)return n.NextResponse.json({sukses:!0,data:v.data,dariCache:!0});if(p)try{let e=await fetch(`${u}/fixtures/statistics?fixture=${a}`,{headers:{"x-apisports-key":p},next:{revalidate:60}});if(e.ok){let t=(await e.json()).response||[];if(t.length>0)return l.set(a,{data:t,ts:Date.now()}),n.NextResponse.json({sukses:!0,data:t,dariCache:!1})}else console.warn(`Statistics API returned ${e.status} for fixture ${a}`)}catch(e){console.warn("Statistics API error:",e)}if(!("live"===f||"finished"===f))return n.NextResponse.json({sukses:!0,data:[],dariCache:!1,sumber:"unavailable"});let m=function(e,t,a,s,o,i,r){let n=e.split("").reduce((e,t)=>e+t.charCodeAt(0),0),p=40+15838*n%100%21,u=100-p,l=8+23757*n%100%10,d=6+31676*n%100%10,c=Math.floor(.4*l)+39595*n%100%3,h=Math.floor(.4*d)+47514*n%100%3,f=Math.max(0,l-c-55433*n%100%2),v=Math.max(0,d-h-63352*n%100%2),m=71271*n%100%4,x=79190*n%100%4,y=Math.floor(.6*l),g=Math.floor(.6*d),w=l-y,M=d-g,P=8+87109*n%100%8,k=8+95028*n%100%8,A=3+102947*n%100%7,C=2+110866*n%100%7,S=118785*n%100%4,b=126704*n%100%4,R=134623*n%100%4,$=142542*n%100%4,j=150461*n%100%2==0?0:1,I=158380*n%100%2==0?0:1,L=h>0?Math.max(0,h-166299*n%100%2):0,T=c>0?Math.max(0,c-174218*n%100%2):0,O=300+182137*n%100%200,N=250+190056*n%100%200,B=75+197975*n%100%20,F=72+205894*n%100%20,G=Math.floor(O*B/100),_=Math.floor(N*F/100),q=e=>[{type:"Shots on Goal",value:e?c:h},{type:"Shots off Goal",value:e?f:v},{type:"Total Shots",value:e?l:d},{type:"Blocked Shots",value:e?m:x},{type:"Shots insidebox",value:e?y:g},{type:"Shots outsidebox",value:e?w:M},{type:"Fouls",value:e?P:k},{type:"Corner Kicks",value:e?A:C},{type:"Offsides",value:e?S:b},{type:"Ball Possession",value:`${e?p:u}%`},{type:"Yellow Cards",value:e?R:$},{type:"Red Cards",value:e?j:I},{type:"Goalkeeper Saves",value:e?L:T},{type:"Total passes",value:e?O:N},{type:"Passes accurate",value:e?G:_},{type:"Passes %",value:`${e?B:F}%`}];return[{team:{id:t,name:s||`Tim ${t}`,logo:i||`https://media.api-sports.io/football/teams/${t}.png`},statistics:q(!0)},{team:{id:a,name:o||`Tim ${a}`,logo:r||`https://media.api-sports.io/football/teams/${a}.png`},statistics:q(!1)}]}(a,o,i,r,d,c,h);return l.set(a,{data:m,ts:Date.now()}),n.NextResponse.json({sukses:!0,data:m,dariCache:!1,sumber:"estimasi"})}let c=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/fixtures/[id]/statistics/route",pathname:"/api/fixtures/[id]/statistics",filename:"route",bundlePath:"app/api/fixtures/[id]/statistics/route"},resolvedPagePath:"C:\\xampp\\htdocs\\Bolafest\\app\\api\\fixtures\\[id]\\statistics\\route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:h,staticGenerationAsyncStorage:f,serverHooks:v}=c,m="/api/fixtures/[id]/statistics/route";function x(){return(0,r.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:f})}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),s=t.X(0,[9276,5972],()=>a(59496));module.exports=s})();