1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29238],{29238:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var l=a(95155),n=a(12115),s=a(52987),r=a(23436),o=a(25016),d=a(69038),i=a(26099),c=a(35850),u=a(38956),x=a(83357);function m(e){var t,a,m;let{match:h,history:g,plan:b,onPlanChange:p}=e,{matchTwin:v}=(0,u.P)(h,g),j=(0,n.useMemo)(()=>(0,d.O)([h]),[h]),N=(0,n.useMemo)(()=>(0,i.n)(h,g),[h,g]),w=(0,n.useMemo)(()=>v?(0,c.U3)(v,N,j):[],[v,N,j]),y=(0,n.useMemo)(()=>v?(0,c.Q5)(v,N,j):null,[v,N,j]),[k,M]=(0,n.useState)(null),R=null!=(a=null!=(t=null!=b?b:k)?t:null==y?void 0:y.plan.id)?a:"as-played",C=(0,n.useMemo)(()=>v?(0,c.DR)(R,v,N,j):null,[R,v,N,j]);if(!v||w.length<2||!C)return null;let G=null!=(m=c.VN.find(e=>e.id===R))?m:c.VN[0],S="as-played"===R,[W,_]=(0,n.useState)(!1),D=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"-mx-4 mb-5 flex snap-x gap-2 overflow-x-auto px-4 pb-1 sm:-mx-1 sm:px-1",children:w.map(e=>{var t,a;let n=e.id===R,s="as-played"===e.id?0:null!=(a=v&&(null==(t=(0,c.DR)(e.id,v,N,j))?void 0:t.swing))?a:0;return(0,l.jsxs)("button",{type:"button",onClick:()=>{var t;M(t=e.id),null==p||p(t)},className:(0,o.cn)("group flex shrink-0 snap-start flex-col items-start gap-1 rounded-2xl border px-4 py-3 text-left transition-colors",n?"border-foreground
1/40 bg-foreground/[0.06]":"border-border/60 hover:border-foreground/25"),children:[(0,l.jsx)("span",{className:(0,o.cn)("text-sm font-bold",n?"text-foreground":"text-muted-foreground group-hover:text-foreground"),children:e.name}),(0,l.jsx)("span",{className:(0,o.cn)("text-xs font-semibold tabular-nums","as-played"===e.id?"text-muted-foreground/60":s>.5?"text-level-strong":s<-.5?"text-level-weak":"text-muted-foreground/60"),children:"as-played"===e.id?"baseline":"".concat(s>0?"+":"").concat(s," pts")})]},e.id)})}),(0,l.jsx)("p",{className:"mb-3 text-xs leading-snug text-muted-foreground",children:G.premise}),(0,l.jsxs)("div",{className:"mb-4 flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[!S&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("span",{className:"text-base font-semibold tabular-nums text-muted-foreground/60",children:[C.baselineWinRate,"%"]}),(0,l.jsx)(s.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/40"})]}),(0,l.jsxs)("span",{className:(0,o.cn)("text-3xl font-black tabular-nums leading-none sm:text-4xl",S?"text-foreground":C.swing>.5?"text-level-strong":C.swing<-.5?"text-level-weak":"text-foreground"),children:[C.projectedWinRate,"%"]}),(0,l.jsxs)("span",{className:"text-xs text-muted-foreground",children:["win rate",S?" as played":""]}),!S&&(0,l.jsx)("span",{className:(0,o.cn)("rounded-full px-2 py-0.5 text-xs font-bold tabular-nums",1>Math.abs(C.ralliesGained)?"bg-muted text-muted-foreground":C.swing>.5?"bg-level-strong/15 text-level-strong":"bg-level-weak/15 text-level-weak"),children:1>Math.abs(C.ralliesGained)?"No real change":"".concat(C.ralliesGained>0?"+":"â").concat((0,x.lt)(Math.abs(C.ralliesGained),C.rallies),"% of rallies")})]}),C.reasoning&&(0,l.jsx)("p",{className:"mb-4 text-sm leading-relaxed text-foreground/85",children:C.reasoning}),!S&&(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("button",{type:"button",onClick:()=>_(e=>!e),className:"text-xs font-semibold text-foreground/70 underline-offset-2 hover:text-foreground hover:underline",children:W?"Hide the detail":"Show what actually changes"}),W&&(0,l.jsxs)("div",{className:"mt-4 grid gap-5 sm:grid-cols-2 sm:gap-6",children:[(0,l.jsx)(f,{title:"Rally lengths",rows:C.rallyMix.map(e=>({label:e.label,before:e.before,after:e.after,note:"".concat(e.winRate,"% won")}))}),(0,l.jsx)(f,{title:"Shot selection",rows:C.shotMix.map(e=>({label:e.type,before:e.before,after:e.after,note:"".concat(e.effectiveness," eff.")}))})]})]}),(C.caveat||"high"!==C.confidence)&&(0,l.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground/70",children:[C.caveat,C.caveat&&"low"===C.confidence&&" ","low"===C.confidence&&"Only a handful of rallies behind this â read the direction, not the size.",C.caveat&&"medium"===C.confidence&&" ","medium"===C.confidence&&"Weighted over a thin sample â enough to point a direction, not to bank the number."]})]});return(0,l.jsx)(r.Zk,{label:"What if I played it differently?",hint:"Try a different approach and see what would change.",className:"mb-4",children:D})}function f(e){let{title:t,rows:a}=e,n=Math.max(1,...a.flatMap(e=>[e.before,e.after]));return(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"mb-3 text-[10px] font-black uppercase tracking-wider text-muted-foreground",children:t}),(0,l.jsx)("ul",{className:"space-y-2.5",children:a.map(e=>{let t=Math.round((e.after-e.before)*10)/10;return(0,l.jsxs)("li",{children:[(0,l.jsxs)("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[(0,l.jsx)("span",{className:"min-w-0 truncate font-medium text-foreground",children:e.label}),(0,l.jsxs)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[Math.round(e.before),"% â ",Math.round(e.after),"%",Math.abs(t)>=.5&&(0,l.jsxs)("span",{className:(0,o.cn)("ml-1.5 font-semibold",t>0?"text-level-strong":"text-level-weak"),children:[t>0?"+":"",t]})]})]}),(0,l.jsxs)("div",{className:"relative mt-1 h-2 overflow-hidden rounded-full bg-muted",children:[(0,l.jsx)("span",{className:"absolute inset-y-0 left-0 rounded-full bg-foreground
1/20",style:{width:"".concat(e.before/n*100,"%")}}),(0,l.jsx)("span",{className:"absolute inset-y-0 left-0 rounded-full bg-foreground/70",style:{width:"".concat(e.after/n*100,"%"),height:"100%"}})]}),(0,l.jsx)("p",{className:"mt-0.5 text-[10px] text-muted-foreground/70",children:e.note})]},e.label)})})]})}}}]);
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.