1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3199],{13998:(e,s,a)=>{a.d(s,{A:()=>i});var t=a(15383),l=a(91289),r=a(34482),n=a(72810);function i(e){let{open:s,onClose:a}=e;return(0,t.jsx)(n.lG,{open:s,onOpenChange:e=>!e&&a(),children:(0,t.jsxs)(n.Cf,{className:"sm:max-w-lg",children:[(0,t.jsxs)(n.c7,{children:[(0,t.jsx)(n.L3,{children:(0,t.jsx)(l.T,{keyName:"GuidelinesDialog.title"})}),(0,t.jsx)(n.rr,{className:"text-left leading-relaxed",children:(0,t.jsx)(l.T,{keyName:"GuidelinesDialog.content",params:{strong:(0,t.jsx)("b",{}),br:(0,t.jsx)("br",{})}})})]}),(0,t.jsx)(n.Es,{children:(0,t.jsx)(r.$,{onClick:a,autoFocus:!0,children:(0,t.jsx)(l.T,{keyName:"GuidelinesDialog.agree"})})})]})})}},20370:(e,s,a)=>{a.d(s,{A:()=>t});let t={src:"/_next/static/media/padel_court.170eeeaa.png",height:500,width:500,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAACVBMVEX///9MaXH///9B1JedAAAAA3RSTlMSAAWVvkdPAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAHElEQVR4nGNgZGRkYmBkZARhggw4YIICkCgYAAAJBQBBg7EZ3wAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}},34967:(e,s,a)=>{a.d(s,{E:()=>r});var t=a(15383),l=a(58811);function r(e){let{className:s,...a}=e;return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,l.cn)("animate-pulse rounded-md bg-muted",s),...a})}},43348:(e,s,a)=>{a.d(s,{A:()=>p});var t=a(15383),l=a(52230),r=a(62128),n=a(1900),i=a(59138),c=a(80908),o=a(37948),d=a(91019),m=a(74098),x=a(58811);function p(e){let{playingStyle:s,teamColor:a,layout:p="stacked"}=e,u=(0,m.A)("PlayingStyleChart"),h=Object.values(s),g=Math.round(h.reduce((e,s)=>e+s,0)/h.length*100),f=[{key:"serve",abbr:u("serveAbbr"),label:u("serve"),value:Math.round(100*s.serve)},{key:"oh_game",abbr:u("overheadGameAbbr"),label:u("overheadGame"),value:Math.round(100*s.oh_game)},{key:"fitness",abbr:u("fitnessAbbr"),label:u("fitness"),value:Math.round(100*s.fitness)},{key:"aggress",abbr:u("aggressivenessAbbr"),label:u("aggressiveness"),value:Math.round(100*s.aggress)},{key:"position",abbr:u("positioningAbbr"),label:u("positioning"),value:Math.round(100*s.position)},{key:"lob_game",abbr:u("lobGameAbbr"),label:u("lobGame"),value:Math.round(100*s.lob_game)}],_="side"===p;return(0,t.jsxs)("div",{className:(0,x.cn)("flex flex-col",_?"gap-4 md:grid md:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)] md:items-center":"gap-2"),children:[!_&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(d.A,{className:"size-4 text-primary","aria-hidden":!0}),u("playingStyle")]}),(0,t.jsxs)("div",{className:(0,x.cn)("relative",!_&&"rounded-t-lg border border-b-0 bg-muted/40 py-2"),children:[(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 z-10 flex flex-col items-center justify-center text-center",children:[(0,t.jsx)("span",{className:"text-3xl leading-none font-extrabold",style:{color:a},children:g}),(0,t.jsx)("span",{className:"text-[10px] font-semibold tracking-wider text-muted-foreground uppercase",children:u("overallScore")})]}),(0,t.jsx)(l.u,{width:"100%",height:_?260:200,children:(0,t.jsxs)(r.V,{data:f,cx:"50%",cy:"50%",outerRadius:_?"82%":"65%",children:[(0,t.jsx)(n.z,{stroke:"var(--border)"}),(0,t.jsx)(i.r,{dataKey:"abbr",tick:{fontSize:10,fill:"var(--muted-foreground)"}}),(0,t.jsx)(c.m,{cursor:!1,content:e=>{var s;let{payload:a}=e,l=null==a||null==(s=a[0])?void 0:s.payload;return l?(0,t.jsxs)("div",{className:"rounded-md border bg-popover px-2.5 py-1.5 text-xs shadow-md",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:l.label})," ",(0,t.jsx)("span",{className:"font-semibold",children:l.value})]}):null}}),(0,t.jsx)(o.V,{dataKey:"value",stroke:a,strokeWidth:2,fill:a,fillOpacity:.2,isAnimationActive:!1})]})})]}),(0,t.jsx)("dl",{className:(0,x.cn)("grid grid-cols-2 gap-x-4 text-xs",!_&&"rounded-b-lg border border-t-0 bg-muted/40 px-3 py-2",_&&"md:flex md:flex-col md:justify-center md:gap-0"),children:f.map(e=>(0,t.jsxs)("div",{className:(0,x.cn)("flex min-w-0 items-baseline justify-between gap-2 py-0.5",_&&"md:border-b md:border-dashed md:py-1 md:last:border-b-0"),children:[(0,t.jsx)("dt",{className:"truncate text-muted-foreground",title:e.label,children:e.label}),(0,t.jsx)("dd",{className:(0,x.cn)("font-bold",_&&"md:text-base"),style:{color:a},children:e.value})]},e.key))})]})}},66400:(e,s,a)=>{a.d(s,{Tk:()=>x,_x:()=>d,f5:()=>h,ir:()=>p,iv:()=>o,kI:()=>u,mU:()=>c,ny:()=>i,rp:()=>g,tK:()=>m,zq:()=>n});var t=a(15383),l=a(58811);let r={team_a:"var(--series-1)",team_b:"var(--series-2)"},n=e=>{var s;return null!=(s=r[e])?s:"var(--series-1)"},i={attack:"var(--ordinal-3)",transition:"var(--ordinal-2)",defense:"var(--ordinal-1)"},c=Array.from({length:8},(e,s)=>"var(--series-".concat(s+1,")"));function o(e){let{className:s,children:a}=e;return(0,t.jsx)("section",{className:(0,l.cn)("rounded-2xl border bg-background p-5 md:p-6",s),children:a})}function d(e){let{icon:s,children:a,className:r}=e;return(0,t.jsxs)("h3",{className:(0,l.cn)("flex items-center gap-2 text-lg font-semibold tracking-tight",r),children:[s&&(0,t.jsx)(s,{className:"size-5 text-primary","aria-hidden":!0}),a]})}function m(e){let{children:s,className:a}=e;return(0,t.jsx)("h4",{className:(0,l.cn)("text-xs font-semibold tracking-wider text-muted-foreground uppercase",a),children:s})}function x(e){let{icon:s,value:a,label:r,hint:n,className:i}=e;return(0,t.jsxs)("div",{className:(0,l.cn)("flex flex-col items-center gap-1 rounded-xl bg-muted/50 px-4 py-5 text-center",i),children:[s&&(0,t.jsx)(s,{className:"mb-1 size-6 text-primary","aria-hidden":!0}),(0,t.jsx)("span",{className:"text-2xl leading-none font-bold md:text-3xl",children:a}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:r}),n&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:n})]})}function p(e){let{label:s,value:a}=e;return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-0.5 rounded-lg bg-muted/40 px-3 py-3 text-center",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:s}),(0,t.jsx)("span",{className:"text-base font-semibold",children:a})]})}function u(e){let{value:s,color:a="var(--series-1)",label:r,className:n,title:i,valueLabel:c}=e,o=Math.max(0,Math.min(100,s));return(0,t.jsxs)("div",{className:(0,l.cn)("flex items-center gap-2",n),title:i,children:[r&&(0,t.jsx)("span",{className:"w-24 shrink-0 truncate text-xs text-muted-foreground",children:r}),(0,t.jsx)("div",{role:"meter","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":o,className:"relative h-1.5 flex-1 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:"".concat(o,"%"),background:a}})}),null!==c&&(0,t.jsx)("span",{className:"tabular w-10 shrink-0 text-right text-xs font-medium",children:null!=c?c:"".concat(o,"%")})]})}function h(e){var s,a;let{src:r,name:n,className:i}=e;return(0,t.jsx)("span",{className:(0,l.cn)("inline-flex size-12 shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted text-sm font-semibold",i),children:r?(0,t.jsx)("img",{src:r,alt:"",className:"size-full object-cover object-top"}):null!=(a=null==n||null==(s=n[0])?void 0:s.toUpperCase())?a:"?"})}
1function g(e){let{color:s,children:a,className:r}=e;return(0,t.jsxs)("span",{className:(0,l.cn)("inline-flex items-center gap-1.5",r),children:[(0,t.jsx)("span",{className:"size-2.5 shrink-0 rounded-full",style:{background:s},"aria-hidden":!0}),a]})}},68398:e=>{e.exports=JSON.parse('{"m":{"match":{"duration":4920,"playtime":2304,"playtime_perc":47,"num_rallies":178,"avg_rally":6.4,"match_score":7.8,"rally_score":6.92,"int_score":7.4,"mov_score":7.21,"long_rally":28,"med_rally":5,"proc_perc":92},"players":{"player_0":{"name":"Player A1","thumbnail":"","team":"team_a","avg_speed":7.4,"dist":3.2,"max_speed":21.8,"zone_att":42,"zone_trans":33,"zone_def":25,"playing_style":{"serve":0.72,"oh_game":0.65,"fitness":0.78,"aggress":0.7,"position":0.74,"lob_game":0.55},"positioning":{"map":[]},"shot":{"general_stats":{"side":"R","count":184,"perc_total":26,"perc_team":51},"serve_stats":{"avg_speed_first":92.3,"avg_speed_second":71.8,"first_serves":38,"second_serves":12},"zone_stats":[{"zone":"left","perc_att":28,"perc_trans":18,"perc_def":12},{"zone":"center","perc_att":44,"perc_trans":50,"perc_def":38},{"zone":"right","perc_att":28,"perc_trans":32,"perc_def":50}],"opponent_stats":[{"opponent":"player_2","perc_att":55,"perc_trans":48,"perc_def":60},{"opponent":"player_3","perc_att":45,"perc_trans":52,"perc_def":40}]}},"player_1":{"name":"Player A2","thumbnail":"","team":"team_a","avg_speed":6.9,"dist":3,"max_speed":19.5,"zone_att":36,"zone_trans":38,"zone_def":26,"playing_style":{"serve":0.66,"oh_game":0.7,"fitness":0.72,"aggress":0.6,"position":0.81,"lob_game":0.62},"positioning":{"map":[]},"shot":{"general_stats":{"side":"L","count":176,"perc_total":25,"perc_team":49},"serve_stats":{"avg_speed_first":88.4,"avg_speed_second":68.2,"first_serves":36,"second_serves":14},"zone_stats":[{"zone":"left","perc_att":38,"perc_trans":30,"perc_def":44},{"zone":"center","perc_att":40,"perc_trans":46,"perc_def":36},{"zone":"right","perc_att":22,"perc_trans":24,"perc_def":20}],"opponent_stats":[{"opponent":"player_2","perc_att":52,"perc_trans":50,"perc_def":48},{"opponent":"player_3","perc_att":48,"perc_trans":50,"perc_def":52}]}},"player_2":{"name":"Player B1","thumbnail":"","team":"team_b","avg_speed":7.1,"dist":3.1,"max_speed":20.6,"zone_att":38,"zone_trans":36,"zone_def":26,"playing_style":{"serve":0.7,"oh_game":0.62,"fitness":0.74,"aggress":0.68,"position":0.7,"lob_game":0.58},"positioning":{"map":[]},"shot":{"general_stats":{"side":"R","count":172,"perc_total":24,"perc_team":50},"serve_stats":{"avg_speed_first":90.1,"avg_speed_second":70.5,"first_serves":35,"second_serves":13},"zone_stats":[{"zone":"left","perc_att":30,"perc_trans":22,"perc_def":18},{"zone":"center","perc_att":42,"perc_trans":48,"perc_def":40},{"zone":"right","perc_att":28,"perc_trans":30,"perc_def":42}],"opponent_stats":[{"opponent":"player_0","perc_att":50,"perc_trans":50,"perc_def":50},{"opponent":"player_1","perc_att":50,"perc_trans":50,"perc_def":50}]}},"player_3":{"name":"Player B2","thumbnail":"","team":"team_b","avg_speed":7,"dist":3,"max_speed":20.1,"zone_att":34,"zone_trans":40,"zone_def":26,"playing_style":{"serve":0.64,"oh_game":0.68,"fitness":0.7,"aggress":0.6,"position":0.78,"lob_game":0.66},"positioning":{"map":[]},"shot":{"general_stats":{"side":"L","count":168,"perc_total":24,"perc_team":50},"serve_stats":{"avg_speed_first":86,"avg_speed_second":67,"first_serves":33,"second_serves":15},"zone_stats":[{"zone":"left","perc_att":36,"perc_trans":32,"perc_def":42},{"zone":"center","perc_att":42,"perc_trans":44,"perc_def":38},{"zone":"right","perc_att":22,"perc_trans":24,"perc_def":20}],"opponent_stats":[{"opponent":"player_0","perc_att":50,"perc_trans":50,"perc_def":50},{"opponent":"player_1","perc_att":50,"perc_trans":50,"perc_def":50}]}}},"teams":{"team_a":{"players":["player_0","player_1"],"sync_score":7.6,"zone_att":39,"zone_trans":36,"zone_def":25},"team_b":{"players":["player_2","player_3"],"sync_score":7.2,"zone_att":36,"zone_trans":38,"zone_def":26}}}}')},75470:(e,s,a)=>{a.d(s,{A:()=>F});var t=a(15383),l=a(14343),r=a(21566),n=a(74098),i=a(58811),c=a(34482),o=a(13998),d=a(35764),m=a(93245),x=a(96384),p=a(97756),u=a(41196),h=a(66400);let g=e=>{let s=Math.floor(e/3600),a=Math.floor(e%3600/60),t=e%60;return s>0?"".concat(s,"h ").concat(a,"m ").concat(t,"s"):"".concat(a,"m ").concat(t,"s")};function f(e){let{matchData:s}=e,a=(0,n.A)("MatchOverviewCard");return(0,t.jsxs)(h.iv,{className:"flex flex-col gap-6",children:[(0,t.jsx)("h3",{className:"text-center text-xl font-bold tracking-tight",children:a("matchOverview")}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,t.jsx)(h.Tk,{icon:d.A,value:g(s.duration),label:a("totalDuration")}),(0,t.jsx)(h.Tk,{icon:m.A,value:g(s.playtime),label:a("activePlayTime"),hint:(0,t.jsxs)(u.E,{className:"mt-1",children:[s.playtime_perc,"%"]})}),(0,t.jsx)(h.Tk,{icon:x.A,value:s.num_rallies,label:a("totalRallies"),hint:a("avgShots",{shots:s.avg_rally.toFixed(1)})}),(0,t.jsx)(h.Tk,{icon:p.A,value:s.match_score.toFixed(1),label:a("matchScore")})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t pt-5",children:[(0,t.jsx)(h.tK,{className:"text-center",children:a("performanceMetrics")}),(0,t.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2 md:grid-cols-3",children:[(0,t.jsx)(h.ir,{label:a("rallyScore"),value:s.rally_score.toFixed(2)}),(0,t.jsx)(h.ir,{label:a("intensityScore"),value:s.int_score.toFixed(1)}),(0,t.jsx)(h.ir,{label:a("movementScore"),value:s.mov_score.toFixed(2)}),(0,t.jsx)(h.ir,{label:a("longestRally"),value:"".concat(s.long_rally," ").concat(a("shots"))}),(0,t.jsx)(h.ir,{label:a("medianRally"),value:"".concat(s.med_rally," ").concat(a("shots"))}),(0,t.jsx)(h.ir,{label:a("playEfficiency"),value:"".concat(s.playtime_perc,"%")})]})]})]})}var _=a(97248),v=a(82),j=a(40816),b=a(86751),y=a(90214),N=a(43348);function A(e){let{icon:s,label:a,value:l}=e;return(0,t.jsxs)("div",{className:"flex flex-col justify-end gap-0.5",children:[(0,t.jsxs)("span",{className:"flex items-start gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(s,{className:"mt-0.5 size-3.5 shrink-0 text-primary","aria-hidden":!0}),a]}),(0,t.jsx)("span",{className:"text-lg font-bold whitespace-nowrap",children:l})]})}function k(e){let{title:s,icon:a,children:l}=e;return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg bg-muted/40 p-3",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[a&&(0,t.jsx)(a,{className:"size-3.5 text-primary","aria-hidden":!0}),s]}),l]})}function z(e){var s,a,l,r,o,d;let{playerId:m,playerData:x,heatmapImage:g,isSelected:f,onClick:z,claim:w}=e,S=(0,n.A)("PlayerStatsCard"),M=(0,n.A)("PlayerClaim"),C=(0,h.zq)(x.team),I=S("team_a"===x.team?"teamA":"teamB"),P=S("L"===x.shot.general_stats.side?"left"
1:"right"),E=x.shot.serve_stats;return(0,t.jsxs)("article",{onClick:z,"data-state":f?"selected":void 0,className:(0,i.cn)("flex h-full cursor-pointer flex-col gap-4 rounded-2xl border bg-background p-4 transition-colors hover:border-primary/50",f&&"border-primary ring-3 ring-primary/15"),children:[(0,t.jsxs)("header",{className:"flex items-center gap-3",children:[(0,t.jsx)(h.f5,{src:x.thumbnail,name:x.name,className:"size-14"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsx)("h4",{className:"truncate font-semibold",children:x.name}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,t.jsx)(u.E,{className:"border-0 text-white",style:{background:C},children:I}),(0,t.jsx)(u.E,{variant:"secondary",children:P})]})]})]}),(null==w?void 0:w.ready)&&w.isOwner&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",onClick:e=>e.stopPropagation(),children:[w.currentUserPlayerId===m?(0,t.jsxs)(u.E,{className:"gap-1",children:[(0,t.jsx)(_.A,{className:"size-3","aria-hidden":!0}),M("claimedByYou")]}):w.currentUserPlayerId?null:w.claimsByPlayerId[m]?(0,t.jsx)(u.E,{variant:"outline",children:M("taken")}):(0,t.jsx)(c.$,{size:"sm",className:"rounded-full",disabled:!!w.submittingPlayerId&&w.submittingPlayerId!==m,pending:w.submittingPlayerId===m,onClick:()=>w.claim(m),children:M("imThisPlayer")}),w.error&&null===w.submittingPlayerId&&null===w.currentUserPlayerId&&(0,t.jsx)("p",{className:"w-full text-xs text-destructive",children:M("error.".concat(w.error))})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsx)(A,{icon:v.A,label:S("avgSpeed"),value:"".concat(x.avg_speed.toFixed(1)," km/h")}),(0,t.jsx)(A,{icon:j.A,label:S("distance"),value:"".concat(x.dist.toFixed(1)," km")}),(0,t.jsx)(A,{icon:p.A,label:S("maxSpeed"),value:"".concat(x.max_speed.toFixed(1)," km/h")})]}),(0,t.jsx)(k,{title:S("positioningHeatmap"),icon:b.A,children:(0,t.jsx)("div",{className:"flex min-h-20 items-center justify-center overflow-hidden rounded-md bg-background",children:g?(0,t.jsx)("img",{src:g,alt:"".concat(x.name," positioning heatmap"),className:"h-auto w-full"}):(0,t.jsxs)("span",{className:"flex flex-col items-center gap-1 py-3 text-xs text-muted-foreground",children:[(0,t.jsx)(b.A,{className:"size-6 opacity-50","aria-hidden":!0}),S("heatmapLoading")]})})}),x.playing_style&&(0,t.jsx)(N.A,{playingStyle:x.playing_style,teamColor:C}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(h.tK,{children:S("zoneDistribution")}),(0,t.jsx)(h.kI,{label:S("attack"),value:x.zone_att,color:h.ny.attack}),(0,t.jsx)(h.kI,{label:S("transition"),value:x.zone_trans,color:h.ny.transition}),(0,t.jsx)(h.kI,{label:S("defense"),value:x.zone_def,color:h.ny.defense})]}),(0,t.jsx)(k,{title:S("shotSummary"),icon:y.A,children:(0,t.jsx)("dl",{className:"grid grid-cols-3 gap-2 text-center",children:[[x.shot.general_stats.count,S("totalShots")],["".concat(x.shot.general_stats.perc_total,"%"),S("ofMatch")],["".concat(x.shot.general_stats.perc_team,"%"),S("ofTeam")]].map(e=>{let[s,a]=e;return(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("dd",{className:"text-base font-bold",children:s}),(0,t.jsx)("dt",{className:"text-[11px] text-muted-foreground",children:a})]},String(a))})})}),E&&(0,t.jsx)(k,{title:S("serveSummary"),icon:v.A,children:(0,t.jsx)("dl",{className:"grid grid-cols-2 gap-2 text-center",children:[["".concat(null!=(l=null==(s=E.avg_speed_first)?void 0:s.toFixed(1))?l:0," km/h"),S("avgSpeedFirst")],["".concat(null!=(r=null==(a=E.avg_speed_second)?void 0:a.toFixed(1))?r:0," km/h"),S("avgSpeedSecond")],[null!=(o=E.first_serves)?o:0,S("firstServes")],[null!=(d=E.second_serves)?d:0,S("secondServes")]].map(e=>{let[s,a]=e;return(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("dd",{className:"text-base font-bold",children:s}),(0,t.jsx)("dt",{className:"text-[11px] text-muted-foreground",children:a})]},String(a))})})})]})}var w=a(66730),S=a(39837),M=a(23532),C=a(20370);let I="other";function P(e){let{shotData:s}=e,a=(0,n.A)("ShotMap"),{map:r=[],type_stats:c=[]}=s,[o,d]=(0,l.useState)("all"),m=(0,l.useMemo)(()=>{let e=new Set(r.map(e=>e.shot_type)),s=c.filter(s=>e.has(s.shot_type)).sort((e,s)=>s.usage-e.usage),a=s.filter(e=>e.shot_type!==I),t=s.filter(e=>e.shot_type===I),l=a.slice(0,7),n=[...a.slice(7),...t];if(0===n.length)return l;let i=n.reduce((e,s)=>e+s.usage,0),o=n.filter(e=>e.avg_speed);return[...l,{shot_type:I,usage:i,avg_speed:o.length?o.reduce((e,s)=>{var a;return e+(null!=(a=s.avg_speed)?a:0)}
1,0)/o.length:null,folded:n.map(e=>e.shot_type)}]},[r,c]),x=(0,l.useMemo)(()=>{let e=new Map(m.map((e,s)=>[e.shot_type,h.mU[s]])),s=new Map;return m.forEach(e=>"folded"in e?e.folded.forEach(e=>s.set(e,I)):null),a=>{var t,l;return null!=(l=e.get(null!=(t=s.get(a))?t:a))?l:h.mU[7]}},[m]),p=(0,l.useMemo)(()=>r.filter(e=>null!=e.x_src&&null!=e.y_src).map((e,s)=>({id:s,x:Math.max(4,Math.min(396,(e.x_src+5)/10*400)),y:Math.max(4,Math.min(396,(1-(e.y_src+10)/10)*400)),type:e.shot_type})),[r]).filter(e=>{let s;return s=e.type,"all"===o||o===s||o===I&&x(s)===x(I)}),u=e=>a(e);return(0,t.jsxs)("div",{className:"court-surface flex flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-start",children:[(0,t.jsx)("div",{className:"flex flex-1 justify-center rounded-lg border bg-muted/40 p-3",children:(0,t.jsxs)("svg",{viewBox:"0 0 ".concat(400," ").concat(400),className:"aspect-square w-full max-w-100 rounded",role:"img","aria-label":a("shotTypes"),children:[(0,t.jsx)("rect",{x:0,y:0,width:400,height:400,rx:6,className:"fill-court"}),(0,t.jsx)("image",{href:C.A.src,x:0,y:0,width:400,height:400,preserveAspectRatio:"xMidYMid meet"}),p.map(e=>(0,t.jsxs)("g",{className:"group",children:[(0,t.jsx)("circle",{cx:e.x,cy:e.y,r:12,fill:"transparent"}),(0,t.jsx)("circle",{cx:e.x,cy:e.y,r:5,fill:x(e.type),stroke:"var(--court-foreground)",strokeWidth:2,className:"transition-[r] group-hover:[r:7]",children:(0,t.jsx)("title",{children:u(e.type)})})]},e.id))]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 rounded-lg border bg-muted/40 p-3 md:w-56",children:[(0,t.jsx)(h.tK,{className:"mb-1",children:a("shotTypes")}),[{shot_type:"all"},...m].map(e=>{let s=o===e.shot_type;return(0,t.jsx)("button",{type:"button","aria-pressed":s,onClick:()=>d(e.shot_type),className:(0,i.cn)("rounded-md px-2 py-1 text-left text-xs transition-colors hover:bg-background",s&&"bg-background font-semibold ring-1 ring-primary/30"),children:(0,t.jsx)(h.rp,{color:"all"===e.shot_type?"var(--foreground)":x(e.shot_type),children:"all"===e.shot_type?a("allShots"):u(e.shot_type)})},e.shot_type)})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 md:grid-cols-2",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(h.tK,{children:a("usage")}),m.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,t.jsx)(h.rp,{color:x(e.shot_type),children:u(e.shot_type)}),(0,t.jsxs)("span",{className:"tabular font-medium",children:[e.usage.toFixed(1),"%"]})]}),(0,t.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("div",{className:"h-full rounded-full",style:{width:"".concat(e.usage,"%"),background:x(e.shot_type)}})})]},e.shot_type))]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(h.tK,{children:a("avgSpeed")}),(0,t.jsx)("dl",{className:"flex flex-col divide-y",children:m.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between py-1.5 text-sm",children:[(0,t.jsx)("dt",{children:(0,t.jsx)(h.rp,{color:x(e.shot_type),children:u(e.shot_type)})}),(0,t.jsx)("dd",{className:"tabular font-medium",children:e.avg_speed?"".concat(e.avg_speed.toFixed(1)," km/h"):"N/A"})]},e.shot_type))})]})]})]})}function E(e){var s,a,l,r,i,c;let{shotData:o,playerName:d,playersData:m}=e,x=(0,n.A)("ShotAnalysisCard");if(!(null==o?void 0:o.general_stats))return null;let{general_stats:u,zone_stats:g=[],opponent_stats:f=[]}=o,_=["attack","transition","defense"].map(e=>{let s="attack"===e?"perc_att":"transition"===e?"perc_trans":"perc_def";return{key:e,color:h.ny[e],sides:Object.fromEntries(g.map(e=>[e.zone,e[s]])),opponents:f.map(e=>({id:e.opponent,value:e[s]}))}});return(0,t.jsxs)(h.iv,{className:"flex flex-col gap-6",children:[(0,t.jsxs)(h._x,{icon:w.A,children:[x("shotAnalysis")," \xb7 ",d]}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,t.jsx)(h.Tk,{icon:y.A,value:u.count,label:x("totalShots"),hint:x("ofMatch",{value:u.perc_total})}),(0,t.jsx)(h.Tk,{icon:p.A,value:null!=(s=u.count_att)?s:0,label:
1x("attackShots"),hint:"".concat(null!=(a=u.perc_att)?a:0,"%")}),(0,t.jsx)(h.Tk,{icon:S.A,value:null!=(l=u.count_trans)?l:0,label:x("transitionShots"),hint:"".concat(null!=(r=u.perc_trans)?r:0,"%")}),(0,t.jsx)(h.Tk,{icon:M.A,value:null!=(i=u.count_def)?i:0,label:x("defenseShots"),hint:"".concat(null!=(c=u.perc_def)?c:0,"%")})]}),o.map&&o.map.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t pt-6",children:[(0,t.jsx)(h.tK,{children:x("shotMap")}),(0,t.jsx)(P,{shotData:o})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t pt-6",children:[(0,t.jsx)(h.tK,{children:x("shotPlacementAnalysis")}),(0,t.jsx)("div",{className:"grid gap-3 sm:grid-cols-3",children:_.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border p-3",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,t.jsx)("span",{className:"size-3 rounded-full",style:{background:e.color},"aria-hidden":!0}),x(e.key)]}),["right","middle","left"].map(s=>{var a;return(0,t.jsx)(h.kI,{label:x(s),value:null!=(a=e.sides[s])?a:0,color:e.color},s)}),e.opponents.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:e.opponents.map(s=>{var a,l,r;return(0,t.jsx)(h.kI,{value:s.value,color:e.color,title:null==(a=m[s.id])?void 0:a.name,label:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"vs"}),(0,t.jsx)(h.f5,{src:null==(l=m[s.id])?void 0:l.thumbnail,name:null==(r=m[s.id])?void 0:r.name,className:"size-5 text-[9px]"})]})},s.id)})})]},e.key))})]})]})}var T=a(78271),B=a(7094);function D(e){let{teamsData:s,playersData:a}=e,l=(0,n.A)("TeamComparisonCard"),r=e=>"team_a"===e?l("teamA"):l("teamB"),i=Object.entries(s),c=e=>r(s.team_a[e]>s.team_b[e]?"team_a":"team_b");return(0,t.jsxs)(h.iv,{className:"flex flex-col gap-6",children:[(0,t.jsx)("h3",{className:"text-center text-xl font-bold tracking-tight",children:l("teamComparison")}),(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:i.map(e=>{let[s,n]=e,i=(0,h.zq)(s);return(0,t.jsxs)("div",{className:"flex flex-col gap-5 rounded-xl border-2 bg-muted/30 p-4",style:{borderColor:i},children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(T.A,{className:"size-6",style:{color:i},"aria-hidden":!0}),(0,t.jsx)("span",{className:"flex-1 font-semibold",children:r(s)}),(0,t.jsx)("div",{className:"flex -space-x-2",children:n.players.map(e=>{var s,l;return(0,t.jsx)(h.f5,{src:null==(s=a[e])?void 0:s.thumbnail,name:null==(l=a[e])?void 0:l.name,className:"size-10 ring-2 ring-background"},e)})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(p.A,{className:"size-3.5 text-primary","aria-hidden":!0}),l("teamSynchronization")]}),(0,t.jsx)("span",{className:"text-2xl font-bold",children:n.sync_score.toFixed(1)}),(0,t.jsx)(h.kI,{value:10*n.sync_score,color:i,valueLabel:null})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(B.A,{className:"size-3.5 text-primary","aria-hidden":!0}),l("zoneDistribution")]}),(0,t.jsx)(h.kI,{label:l("attack"),value:n.zone_att,color:h.ny.attack}),(0,t.jsx)(h.kI,{label:l("transition"),value:n.zone_trans,color:h.ny.transition}),(0,t.jsx)(h.kI,{label:l("defense"),value:n.zone_def,color:h.ny.defense})]})]},s)})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t pt-5",children:[(0,t.jsx)(h.tK,{className:"text-center",children:l("performanceSummary")}),(0,t.jsxs)("div",{className:"grid gap-2 sm:grid-cols-3",children:[(0,t.jsx)(h.ir,{label:l("bestSynchronization"),value:c("sync_score")}),(0,t.jsx)(h.ir,{label:l("mostAggressive"),value:c("zone_att")}),(0,t.jsx)(h.ir,{label:l("bestDefense"),value:c("zone_def")})]})]})]})}function F(e){var s,a,d,m,x;let{insights:p,heatmapImages:u={},showLowAnalysisWarning:g=!0,claim:_}=e,v=(0,n.A)("pages.AnalyticsPage"),[j,b]=(0,l.useState)("player_0"),[y,N]=(0,l.useState)(!1);if(!p)return null;let A=Object.entries(p.players),k=null!=(m=p.players[j])?m:null==(s=A[0])?void 0:s[1],w=p.players[j]?j:null!=(x=null==(a=A[0])?void 0:a[0])?x:j,S=g&&void 0!==p.match.proc_perc&&p.match.proc_perc<75;return(0,t.jsxs)("div",{className:"flex flex-col gap-8",children:[S&&(0,t.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center gap-3 rounded-xl border border-premium/60 bg-premium/15 px-4 py-3 text-sm",children:[(0,t.jsx)(r.A,{className:"size-4 shrink-0 text-premium-foreground
1/80","aria-hidden":!0}),(0,t.jsx)("span",{className:"flex-1",children:v("lowAnalysisWarning",{percentage:null==(d=p.match.proc_perc)?void 0:d.toFixed(0)})}),(0,t.jsx)(c.$,{variant:"link",size:"sm",className:"h-auto p-0",onClick:()=>N(!0),children:v("viewGuidelines")})]}),(0,t.jsx)(f,{matchData:p.match}),(0,t.jsxs)("section",{className:"flex flex-col gap-5",children:[(0,t.jsx)("h2",{className:"text-center text-2xl font-bold tracking-tight",children:v("playerStatistics")}),(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:A.map(e=>{let[s,a]=e;return(0,t.jsx)(z,{playerId:s,playerData:a,heatmapImage:u[s],isSelected:w===s,onClick:()=>b(s),claim:_},s)})})]}),(0,t.jsxs)("section",{className:"flex flex-col gap-5",children:[(0,t.jsx)("h2",{className:"text-center text-2xl font-bold tracking-tight",children:v("shotStatistics")}),(0,t.jsx)("div",{role:"tablist",className:"flex justify-center gap-3 border-b px-1 pt-1 pb-4",children:A.map(e=>{let[s,a]=e;return(0,t.jsx)("button",{type:"button",role:"tab","aria-selected":w===s,"aria-label":a.name,onClick:()=>b(s),className:(0,i.cn)("inline-flex shrink-0 rounded-full p-0 leading-none ring-offset-2 ring-offset-background transition-[box-shadow,opacity]",w===s?"ring-3 ring-primary":"opacity-60 hover:opacity-100"),children:(0,t.jsx)(h.f5,{src:a.thumbnail,name:a.name,className:"size-14 ring-2 ring-background"})},s)})}),k&&(0,t.jsx)(E,{playerId:w,shotData:k.shot,playerName:k.name||v("playerName",{name:w.replace("player_","")}),playersData:p.players})]}),(0,t.jsx)(D,{teamsData:p.teams,playersData:p.players}),(0,t.jsx)(o.A,{open:y,onClose:()=>N(!1)})]})}}}]);
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.