PageSourceSearch

https://fantasyhoff.com/assets/CheatSheet-D0dzLfV5.js

js fantasyhoff.com collected 2026-09-24 14:42:51 UTC 95,860 bytes, 1 lines download raw bytes

1import{a as C,j as e}from"./vendor-react-DCIP6ipm.js";import{b as pt,a as gt}from"./vendor-query-Brtv2x_Q.js";import{r as ts}from"./vendor-react-dom-CpZ_XJmk.js";import{q as bt,a5 as yt,j as kt,c as xt,a4 as jt,bN as vt,t as We}from"./index-5SgQjDr9.js";import{L as Mt}from"./LeaguePageHeader-DfpVtznf.js";import{b as Nt,L as St,a as wt}from"./LeagueFilterBar-BrkR6O-_.js";import{E as Pt}from"./Paywall-Dp6s2Lm9.js";import{m as Rt}from"./useStats-D63dhjCr.js";import{S as ce,l as Ls,e as Te,c as ys,g as $t,h as Ct,i as Et,j as Tt,s as Ft,t as Lt,k as Bt,m as Ot,u as At,d as Xe,b as ve,a as Dt,D as It,f as _t,n as Wt,o as Ht,p as Kt,r as zt,q as Bs}from"./cheatsheet-Baf6gSOu.js";import{L as Ut}from"./vendor-router-DmCJgN2X.js";import{h as ns,a3 as ks,ba as Os,Q as As,ap as Fe,bf as Yt,bg as Qt,C as Xt,bh as qe,U as qt,bi as os,X as rs,k as Gt}from"./vendor-icons-Cwrlw3JZ.js";const se=["QB","RB","WR","TE","K","DEF"],Vt=[{kind:"QB",label:"QB",eligible:["QB"],starter:!0},{kind:"RB",label:"RB",eligible:["RB"],starter:!0},{kind:"WR",label:"WR",eligible:["WR"],starter:!0},{kind:"TE",label:"TE",eligible:["TE"],starter:!0},{kind:"K",label:"K",eligible:["K"],starter:!0},{kind:"DEF",label:"DEF",eligible:["DEF"],starter:!0},{kind:"WR_RB",label:"W/R",eligible:["RB","WR"],starter:!0},{kind:"REC_FLEX",label:"W/T",eligible:["WR","TE"],starter:!0},{kind:"FLEX",label:"W/R/T",eligible:["RB","WR","TE"],starter:!0},{kind:"SUPER_FLEX",label:"SFLX",eligible:["QB","RB","WR","TE"],starter:!0},{kind:"BENCH",label:"BN",eligible:se,starter:!1}],Jt=["QB","RB","WR","TE","WR_RB","REC_FLEX","FLEX","SUPER_FLEX","K","DEF","BENCH"],Zt=20;function en(s){const t=[];for(const n of Jt){const o=Vt.find(a=>a.kind===n),r=Math.min(Math.max(Math.round(s[n]??0),0),Zt);for(let a=1;a<=r;a++)t.push({id:`${n}${a}`,kind:n,label:o.label,eligible:o.eligible,starter:o.starter})}return t}const Ds={picks:{}};function we(s,t,n){return s.find(o=>!t.picks[o.id]&&o.eligible.includes(n))??null}function Ge(s,t){for(const[n,o]of Object.entries(s.picks))if(o.key===t)return n;return null}function Me(s,t,n){if(Ge(t,n.key))return t;const o=we(s,t,n.position);return o?{...t,picks:{...t.picks,[o.id]:{key:n.key,price:Math.max(Math.round(n.price),0)}}}:null}function xs(s,t){const n={...s.picks};return delete n[t],{...s,picks:n}}function sn(s,t,n){const o=s.picks[t];return o?{...s,picks:{...s.picks,[t]:{...o,price:Math.max(Math.round(n),0)}}}:s}function tn(s,t){const n=new Set(s.map(r=>r.id)),o={};for(const[r,a]of Object.entries(t.picks))n.has(r)&&(o[r]=a);return{...t,picks:o}}function Pe(s,t,n,o){let r=0,a=0,l=0;for(const h of s){const m=t.picks[h.id];m&&(a+=1,r+=m.price,h.starter&&(l+=o(m.key)))}const i=s.length-a,u=s.filter(h=>h.starter&&!t.picks[h.id]).length,c=n-r;return{spent:r,left:c,filled:a,openSeats:i,openStarters:u,maxBid:i===0?0:Math.max(c-(i-1),0),starterPoints:l,overBudget:c<0}}const nn=320,on=70,Ve=400,he=-1/0;function rn(s,t,n,o){const r=[...s].sort((i,u)=>o(u)-o(i)||i.price-u.price),a=[...s].sort((i,u)=>i.price-u.price||o(u)-o(i)),l=new Map;for(const i of r.slice(0,t))l.set(i.key,i);for(const i of a.slice(0,Math.max(20,n+5)))l.set(i.key,i);return[...l.values()]}function an(s,t,n,o,r=a=>a.points){const a=o+1,l=(n+1)*a;let i=new Float32Array(l).fill(he);i.fill(0,0,a);const u=new Uint8Array(Math.max(s.length,1)*l);for(let h=0;h<s.length;h++){const m=i.slice(),d=t[h],x=r(s[h]),k=h*l;for(let w=n;w>=1;w--){const $=w*a,b=(w-1)*a;for(let R=d;R<=o;R++){const f=i[b+R-d];if(f===he)continue;const M=f+x;M>m[$+R]&&(m[$+R]=M,u[k+$+R]=1)}}i=m}const c=[];for(let h=0;h<=n;h++)c.push(new Float32Array(i.subarray(h*a,(h+1)*a)));return{items:s,costs:t,rows:c,took:u,maxK:n,C:o}}function ln(s,t,n){const o=[],r=s.C+1,a=(s.maxK+1)*r;let l=t,i=n;for(let u=s.items.length-1;u>=0&&l>0;u--)s.took[u*a+l*r+i]===1&&(o.push(s.items[u]),i-=s.costs[u],l-=1);return o}function js(s,t,n,o){const r=new Float32Array(n+1).fill(he);for(let a=0;a<=n;a++){let l=he,i=0;for(let u=0;u<=a;u++){const c=s[u];if(c===he)continue;const h=t[a-u];if(h===he)continue;const m=c+h;m>l&&(l=m,i=u)}r[a]=l,o&&(o[a]=i)}return r}function Is(s){const{slots:t,budget:n}=s,o={...s.roster.picks},r=new Set(Object.values(o).map(y=>y.key));let a=0;for(const y of Object.values(o))a+=y.price;const l=t.filter(y=>!o[y.id]),i=l.filter(y=>y.starter),u=l.filter(y=>!y.starter),c=n-a,h=Object.keys(o).length,m=s.pool.filter(y=>!r.has(y.key)&&Number.isFinite(y.price)&&Number.isFinite(y.points)),d=new Map,x=u.length===0?0:Math.min(Math.max(Math.round(s.benchBudget??u.length),u.length),Math.max(c-i.length,u.length)),k=y=>{let S=0;for(const F of y)S+=Math.max(F.price,1);return S},w=y=>y.reduce((S,[,F])=>S+F.points,0);let $=!0,b=[];if(i.length>0){const y=vs(i,m,c-x);if(y)b=y;else{$=!1;const S=[...m].sort((N,g)=>N.price-g.price||g.points-N.points),F=new Set;let E=0,j=l.length;for(const N of i){j-=1;const g=c-E-j,P=S.find(T=>!F.has(T.key)&&N.eligible.includes(T.position)&&Math.max(T.price,1)<=g);P&&(b.push([N.id,P]),F.add(P.key),E+=Math.max(P.price,1))}}}const R=new Set(b.map(([,y])=>y.key)),f=m.filter(y=>!R.has(y.key)&&y.position!=="K"&&y.position!=="DEF"),M=c-k(b.map(([,y])=>y)),D=dn(u.length,f,M,t)??mn(u.length,f,M);if($&&i.length>0){const y=new Set(D.map(F=>F.key)),S=c-k(D);if(S>k(b.map(([,F])=>
1F))){const F=vs(i,m.filter(E=>!y.has(E.key)),S);F&&w(F)>w(b)&&(b=F)}}for(const[y,S]of b)d.set(y,S),r.add(S.key);u.forEach((y,S)=>{const F=D[S];!F||r.has(F.key)||(d.set(y.id,F),r.add(F.key))});for(const[y,S]of cn(l,d))o[y]={key:S.key,price:Math.max(S.price,1)};return{roster:{...s.roster,picks:o},feasible:$,added:Object.keys(o).length-h}}function cn(s,t){const n=s.filter(h=>h.starter),o=[...t.values()].sort((h,m)=>m.points-h.points),r=n.map(()=>null),a=new Map,l=(h,m)=>{for(let d=0;d<n.length;d++){if(m.has(d)||!n[d].eligible.includes(h.position))continue;m.add(d);const x=r[d];if(x===null||l(x,m))return r[d]=h,a.set(h.key,d),!0}return!1};for(const h of o)l(h,new Set);const i=[];n.forEach((h,m)=>{const d=r[m];d&&i.push([h.id,d])});const u=o.filter(h=>!a.has(h.key));let c=0;for(const h of s){if(h.starter)continue;const m=u[c];if(!m)break;c+=1,i.push([h.id,m])}return i}function dn(s,t,n,o){if(s<=0)return[];if(n<s)return null;const r=un(o,s),a=hn(s,r).map(u=>({counts:u,tag:null})),l=_s(a,t,u=>u.value,n);if(!l)return null;const i=[];for(const u of se)i.push(...l.chosen[u]??[]);return i.length!==s?null:i.sort((u,c)=>c.value-u.value)}function un(s,t){const n={};for(const r of se)n[r]=0;for(const r of s)r.starter&&r.eligible.length===1&&(n[r.eligible[0]]+=1);for(const r of se)n[r]=r==="K"||r==="DEF"?0:Math.max(n[r],1);let o=se.reduce((r,a)=>r+n[a],0);for(let r=0;o<t&&r<12;r++){for(const a of se)n[a]>0&&(n[a]+=1);o=se.reduce((a,l)=>a+n[l],0)}return n}function hn(s,t){const n=se.filter(l=>t[l]>0),o=[],r={};for(const l of se)r[l]=0;const a=(l,i)=>{if(o.length>=Ve)return;if(l===n.length){i===0&&o.push({...r});return}const u=n[l],c=Math.min(t[u],i);for(let h=0;h<=c;h++)r[u]=h,a(l+1,i-h);r[u]=0};return a(0,s),o}function mn(s,t,n){const o=[...t].sort((l,i)=>i.value-l.value||i.points-l.points),r=[];let a=n;for(let l=0;l<s;l++){const i=a-(s-l-1),u=o.findIndex(h=>Math.max(h.price,1)<=i);if(u<0)break;const[c]=o.splice(u,1);r.push(c),a-=Math.max(c.price,1)}return r}function vs(s,t,n){var m;if(n<s.length)return null;const o={},r={},a=[];for(const d of s)if(d.eligible.length===1){const x=d.eligible[0];o[x]=(o[x]??0)+1,(r[x]??(r[x]=[])).push(d)}else a.push(d);let l=[[]];for(const d of a){const x=[];for(const k of l)for(const w of d.eligible)x.push([...k,w]);if(l=x,l.length>Ve){l=l.slice(0,Ve);break}}const i=new Map;for(const d of l){const x={};for(const w of se)x[w]=o[w]??0;for(const w of d)x[w]+=1;const k=se.map(w=>x[w]).join(",");i.has(k)||i.set(k,{counts:x,flex:d})}const u=_s([...i.values()].map(d=>({counts:d.counts,tag:d.flex})),t,d=>d.points,n);if(!u)return null;const c=u.chosen,h=[];for(const d of se)for(const x of r[d]??[]){const k=(m=c[d])==null?void 0:m.shift();k&&h.push([x.id,k])}return a.forEach((d,x)=>{var $;const k=u.tag[x],w=($=c[k])==null?void 0:$.shift();w&&h.push([d.id,w])}),h}function _s(s,t,n,o){if(s.length===0)return null;const r={};for(const f of se)r[f]=0;for(const{counts:f}of s)for(const M of se)r[M]=Math.max(r[M],f[M]??0);const a=Math.max(1,Math.ceil(o/nn)),l=Math.floor(o/a);if(l<=0)return null;const i={};for(const f of se){if(r[f]===0)continue;const M=rn(t.filter(y=>y.position===f),on,r[f],n),D=M.map(y=>Math.max(Math.ceil(Math.max(y.price,1)/a),1));i[f]=an(M,D,r[f],l,n)}const u=se.filter(f=>r[f]>0),c=new Float32Array(l+1),h=new Map,m=f=>{let M=c,D="";for(const y of u){D+=`${f[y]??0},`;const S=h.get(D);if(S){M=S;continue}const F=f[y]??0,E=F===0?M:js(M,i[y].rows[F],l);h.set(D,E),M=E}return M};let d=null,x=he;for(const f of s){const M=m(f.counts)[l];M>x&&(x=M,d=f)}if(!d||x===he)return null;const k=[];let w=c;for(const f of u){const M=d.counts[f]??0;if(M===0)continue;const D=new Int32Array(l+1);w=js(w,i[f].rows[M],l,D),k.push({pos:f,split:D})}const $={};let b=l;for(let f=k.length-1;f>=0;f--){const M=k[f].split[b];$[k[f].pos]=b-M,b=M}const R={};for(const f of u){const M=d.counts[f]??0;if(M===0)continue;const D=ln(i[f],M,$[f]??0);if(D.length!==M)return null;R[f]=D.sort((y,S)=>n(S)-n(y))}return{tag:d.tag,chosen:R}}const me=[[1,2],[3,5],[6,9],[10,14],[15,40]],Ms=["QB","RB","WR","TE","K","DEF"];function Ws(s){for(let t=0;t<me.length;t++)if(s>=me[t][0]&&s<=me[t][1])return t;return me.length-1}
1function fn(s){if(!s)return null;const t=new Set;for(const o of Ms)for(const r of Object.keys(s[o]??{}))t.add(r);if(t.size<2)return null;const n={};for(const o of Ms){const r=s[o];if(!r)continue;const a=[];for(const h of Object.values(r))h.forEach((m,d)=>{(a[d]??(a[d]=[])).push(m)});const l=a.map(h=>h.reduce((m,d)=>m+d,0)/h.length),i=me.map(()=>({level:0,cv:0,samples:0})),u=me.map(()=>({sum:0,n:0})),c=me.map(()=>[]);a.forEach((h,m)=>{const d=Ws(m+1),x=l[m];for(const k of h)u[d].sum+=k,u[d].n+=1,h.length>=2&&x>=20&&c[d].push(k/x-1)}),me.forEach((h,m)=>{const{sum:d,n:x}=u[m];if(x===0)return;const k=d/x,w=c[m];let $=0;if(w.length>=3){const b=w.reduce((R,f)=>R+f,0)/w.length;$=Math.sqrt(w.reduce((R,f)=>R+(f-b)*(f-b),0)/(w.length-1))}i[m]={level:k,cv:$,samples:x}});for(let h=0;h<i.length;h++)if(i[h].samples===0||i[h].cv===0){const m=i.map((d,x)=>({s:d,d:Math.abs(x-h)})).filter(({s:d})=>d.samples>0&&d.cv>0).sort((d,x)=>d.d-x.d)[0]??null;m&&(i[h]={level:i[h].samples>0?i[h].level:m.s.level,cv:m.s.cv,samples:i[h].samples})}i.some(h=>h.samples>0)&&(n[o]=i)}return Object.keys(n).length===0?null:{byPosition:n,seasons:t.size}}function pn(s,t,n,o){let r=0,a=0,l=0,i=0;for(const c of t){if(!c.starter)continue;const h=n.picks[c.id];if(!h)continue;i+=1;const m=o(h.key);if(!m)continue;const d=s.byPosition[m.position];if(!d)continue;const x=d[Ws(m.posRank)];!x||x.level<=0||(l+=1,r+=x.level,a+=(x.cv*x.level)**2)}if(i===0||l/i<.6)return null;const u=Math.sqrt(a);return{mu:r,sigma:u,p10:Math.max(r-1.2816*u,0),p90:r+1.2816*u,seatsCovered:l,seatsTotal:i}}const Ns=.3,Ss=.7;function gn(s,t,n,o){const r=Math.max(Ss*s+(1-Ss)*Math.max(o,1),1),a=Math.max((n-t)/2,r*.1);return{mid:r,lo:Math.max(r-a,1),hi:r+a,fromLeague:!0}}const Hs=.1,Ks=150;function zs(s){const t=Math.max(s,1);return{mid:t,lo:Math.max(t*(1-Ns),1),hi:t*(1+Ns),fromLeague:!1}}function Oe(s){let t=s>>>0||1;return()=>{t=t+1831565813>>>0;let n=t;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}const Us=["QB","RB","WR","TE","K","DEF"],as=.12,is=.12,bn=.6;function pe(s){return s()+s()-1}const Ne=pe,yn={room:1,byPosition:{QB:1,RB:1,WR:1,TE:1,K:1,DEF:1}};function kn(s){const t={};for(const n of Us)t[n]=1+is*Ne(s);return{room:1+as*Ne(s),byPosition:t}}function Ys(s,t,n,o=yn,r,a){const l=Math.max(s.mid,1),i=a!=null?Math.min(Math.max(a,.03),.6):Math.min(Math.max((s.hi-s.lo)/(2*l),.05),.6)*bn,u=o.room*(r?o.byPosition[r]??1:1),c=1+i*Ne(n);return Math.max(Math.round(l*(1+t)*u*c),1)}function He(s,t){if(s.length===0)return 0;const n=Math.min(Math.max(Math.round((s.length-1)*t),0),s.length-1);return s[n]}function xn(s){if(s.length===0)return 0;const t=[...s].sort((o,r)=>o-r),n=t.length/2;return t.length%2===1?t[Math.floor(n)]:Math.round((t[n-1]+t[n])/2)}function jn(){return new Promise(s=>{if(typeof MessageChannel=="function"){const t=new MessageChannel;t.port1.onmessage=()=>s(),t.port2.postMessage(0)}else setTimeout(s,0)})}async function vn(s,t={}){var f,M,D,y;const n=Math.max(Math.round(s.draws??Ks),1),o=Math.max(s.premium??Hs,0),r=Oe(s.seed??1),a=Math.max(t.chunk??10,1),l=new Map(s.pool.map(S=>[S.key,S.points])),i=new Set(s.slots.filter(S=>S.starter).map(S=>S.id)),u=new Map,c=[],h=[];let m=0,d=0;for(const S of s.pool)(f=s.bands.get(S.key))!=null&&f.fromLeague&&(d+=1);for(let S=0;S<n&&!((M=t.signal)!=null&&M.cancelled);S++){const F=s.spreads??null,E=F?{room:1+F.roomSpread*Ne(r),byPosition:Object.fromEntries(Us.map(P=>[P,1+F.positionSpread*Ne(r)]))}:kn(r),j=s.pool.map(P=>({...P,price:Ys(s.bands.get(P.key)??zs(P.price),o,r,E,P.position,F==null?void 0:F.idioSpread)})),N=Is({slots:s.slots,roster:s.roster,pool:j,budget:s.budget,benchBudget:s.benchBudget});if(!N.feasible){m+=1;continue}const g=Pe(s.slots,N.roster,s.budget,P=>l.get(P)??0);c.push(g.starterPoints),h.push({points:g.starterPoints,roster:N.roster});for(const[P,T]of Object.entries(N.roster.picks)){const z=u.get(T.key)??{hits:0,starterHits:0,paid:[]};z.hits+=1,i.has(P)&&(z.starterHits+=1),z.paid.push(T.price),u.set(T.key,z)}(S+1)%a===0&&((D=t.onProgress)==null||D.call(t,S+1,n),await jn())}(y=t.onProgress)==null||y.call(t,n,n);const x=new Set(Object.values(s.roster.picks).map(S=>S.key)),k=c.length,w=[...u.entries()].filter(([S])=>!x.has(S)).map(([S,F])=>{const E=[...F.paid].sort((j,N)=>j-N);return{key:S,rate:k>0?F.hits/k:0,starterRate:k>0?F.starterHits/k:0,medianPaid:xn(E),loPaid:E[0]??0,hiPaid:E[E.length-1]??0}}).sort((S,F)=>F.starterRate-S.starterRate||F.rate-S.rate||(l.get(F.key)??0)-(l.get(S.key)??0)),$=[...c].sort((S,F)=>S-F),b=[...h].sort((S,F)=>S.points-F.points),R=[];if(b.length>0){const S=F=>b[Math.min(Math.max(Math.round((b.length-1)*F),0),b.length-1)];R.push({kind:"floor",...S(.1)}),R.push({kind:"typical",...S(.5)}),R.push({kind:"best",...S(.9)})}return{draws:n,infeasible:m,points:$,p10:He($,.1),p50:He($,.5),p90:He($,.9),landing:w,rosters:R,leagueBands:d,totalBands:s.pool.length}}const ws={roomSpread:as,positionSpread:is,idioSpread:.2,seasons:0,measured:!1},Ke=Math.sqrt(6);function ze(s){if(s.length<2)return 0;const t=s.reduce((o,r)=>o+r,0)/s.length,n=s.reduce((o,r)=>
1o+(r-t)*(r-t),0);return Math.sqrt(n/(s.length-1))}function Ps(s){if(s.length===0)return 0;const t=[...s].sort((o,r)=>o-r),n=t.length/2;return t.length%2===1?t[Math.floor(n)]:(t[n-1]+t[n])/2}function Je(s,t){var n;return((n=s.auctionCosts)==null?void 0:n[t])??(s.byPosition[t]??[]).map(o=>o.cost).filter(o=>o!=null&&o>0).sort((o,r)=>r-o)}function Qs(s){const t=s.filter(m=>m.isAuction);if(t.length<3)return{...ws,seasons:t.length};const n=[],o=new Map;for(const m of t){let d=0;const x=new Map;for(const k of ce){const w=Je(m,k).reduce(($,b)=>$+b,0);x.set(k,w),d+=w}if(!(d<=0)){n.push(d);for(const k of ce){const w=o.get(k)??[];w.push((x.get(k)??0)/d),o.set(k,w)}}}if(n.length<3)return{...ws,seasons:t.length};const r=n.reduce((m,d)=>m+d,0)/n.length,a=r>0?ze(n)/r:0,l=[];for(const m of ce){const d=o.get(m)??[],x=d.reduce((k,w)=>k+w,0)/(d.length||1);x>.02&&d.length>=3&&l.push(ze(d)/x)}const i=l.length>0?Ps(l):0,u=[];for(const m of ce){const d=[];t.forEach((x,k)=>{const w=n[k]/r,$=o.get(m)??[],b=$.reduce((M,D)=>M+D,0)/($.length||1),R=b>0?($[k]??b)/b:1,f=w*R||1;Je(x,m).forEach((M,D)=>{(d[D]??(d[D]=[])).push(M/f)})});for(const x of d){if(x.length<3)continue;const k=x.reduce((w,$)=>w+$,0)/x.length;k<3||u.push(ze(x)/k)}}const c=u.length>=4?Ps(u):0,h=(m,d)=>Math.min(Math.max(m,d/2),d*3);return{roomSpread:h(a*Ke,as),positionSpread:h(i*Ke,is),idioSpread:h(c*Ke,.2),seasons:t.length,measured:!0}}function Mn(s,t){const n={};for(const o of["QB","RB","WR","TE","K","DEF"])n[o]=1+s.positionSpread*pe(t);return{room:1+s.roomSpread*pe(t),byPosition:n}}function Nn(s,t={}){const n=s.filter(m=>m.isAuction).sort((m,d)=>d.season.localeCompare(m.season));if(n.length<3)return null;const[o,...r]=n,a=Ls(r),l=Qs(r),i=Math.max(t.samples??400,50),u=Oe(t.seed??7);let c=0,h=0;for(const m of ce){const d=a[m]??[],x=Je(o,m),k=Math.min(d.length,x.length);for(let w=0;w<k;w++){const $=d[w];if(!$||$.samples<2||$.median<3)continue;const b={mid:$.median,lo:$.lo,hi:$.hi},R=[];for(let D=0;D<i;D++){const y=Mn(l,u);R.push(Ys(b,0,u,y,m,l.idioSpread))}R.sort((D,y)=>D-y);const f=R[Math.floor(R.length*.1)],M=R[Math.min(Math.ceil(R.length*.9),R.length-1)];h+=1,x[w]>=f&&x[w]<=M&&(c+=1)}}return h===0?null:{coverage:c/h,checked:h,heldOutSeason:o.season,trainedOn:r.length}}const Se=["QB","RB","WR","TE","K","DEF"],Xs=.6,qs=3,Sn=12,Gs=150,Le={byPosition:{},scatterRounds:0,seasons:0,samples:0};function Be(s){return s.length===0?0:s.reduce((t,n)=>t+n,0)/s.length}function Rs(s){if(s.length<2)return 0;const t=Be(s);return Math.sqrt(Be(s.map(n=>(n-t)*(n-t))))}function wn(s,t,n){var c,h;if(n<=0)return Le;const o=s.filter(m=>!m.isAuction);if(o.length===0)return Le;const r={},a=[],l=new Set;for(const m of Se){const d=[];for(const x of o){const k=x.byPosition[m],w=(c=t[m])==null?void 0:c[x.season];if(!k||!w)continue;const $=Math.min(k.length,w.length,Sn);for(let b=0;b<$;b++){const R=w[b],f=(h=k[b])==null?void 0:h.pick;f==null||R==null||R<=0||(d.push((R-f)/n),l.add(x.season))}}d.length>=3&&(r[m]={biasRounds:Be(d),scatterRounds:Rs(d),samples:d.length},a.push(...d))}const u=Be(["QB","RB","WR","TE"].map(m=>{var d;return(d=r[m])==null?void 0:d.biasRounds}).filter(m=>m!=null));for(const m of Se){const d=r[m];d&&(d.biasRounds-=u)}return{byPosition:r,scatterRounds:Rs(a),seasons:l.size,samples:a.length}}function Ae(s,t,n){const o=[];for(let r=1;r<=n;r++)o.push((r-1)*t+(r%2===1?s:t-s+1));return o}function Pn(s,t,n,o,r,a,l){const i=s.adp??t*14+s.posRank,u=((o==null?void 0:o.biasRounds)??0)*t*a;let c=s.stdev??0;c<=0&&s.adpHigh!=null&&s.adpLow!=null&&s.adpLow>s.adpHigh&&(c=(s.adpLow-s.adpHigh)/4);const h=r*t*a,m=Math.max(Math.sqrt(c*c+h*h),qs);return i-u+n+m*pe(l)}const Rn=.5;function $n(s,t,n,o,r,a){return $s(s,t,n,o,r,a,!0)??$s(s,t,n,o,r,a,!1)}function $s(s,t,n,o,r,a,l){let i=null,u=-1/0;for(const c of Se){const h=n.get(c)??[];let m=null;for(const k of h){if(o.has(k.key))continue;const w=we(s,t,k.position);if(w&&!(l&&!w.starter)){m=k;break}}if(!m)continue;let d=0;if(a!=null)for(const k of h){if(o.has(k.key))continue;const w=r.get(k.key);if(!w)continue;if(Te(w.pick,w.sigma,null,null,a)>=Rn){d=k.value;break}}const x=m.value-d;(x>u+1e-9||Math.abs(x-u)<=1e-9&&m.value>((i==null?void 0:i.value)??-1/0))&&(u=x,i=m)}return i}function Ue(s,t){if(s.length===0)return 0;const n=Math.min(Math.max(Math.round((s.length-1)*t),0),s.length-1);return s[n]}function Cn(s){if(s.length===0)return 0;const t=[...s].sort((o,r)=>o-r),n=t.length/2;return t.length%2===1?t[Math.floor(n)]:Math.round((t[n-1]+t[n])/2)}function En(){return new Promise(s=>{if(typeof MessageChannel=="function"){const t=new MessageChannel;t.port1.onmessage=()=>s(),t.port2.postMessage(0)}else setTimeout(s,0)})}function Vs(s,t,n,o){const r=new Map;for(const a of s){const l=n.byPosition[a.position],i=a.adp??t*14+a.posRank;let u=a.stdev??0;u<=0&&a.adpHigh!=null&&a.adpLow!=null&&a.adpLow>a.adpHigh&&(u=(a.adpLow-a.adpHigh)/4);const c=n.scatterRounds*t*o;r.set(a.key,{pick:i-((l==null?void 0:l.biasRounds)??0)*t*o,sigma:Math.max(Math.sqrt(u*u+c*c),qs)})}return r}async function Tn(s,t={}){var G,B,_;const n=Math.max(Math.round(s.draws??Gs),1),o=Math.max(Math.round(s.teams),2),r=Math.min(Math.max(Math.round(s.seat),1),o),a=Math.min(Math.max(s.leagueWeight??1,0),1),l=s.tendencies??Le,i=Oe(s.seed??1),u=Math.max(t.chunk??10,1),c=s.slots.length,h=Ae(r,o,c),m=o*c,d=new Map(s.pool.map(p=>[p.key,p.points])),x=new Set(Object.values(s.roster.picks).map(p=>p.key)),k=s.pool.filter(p=>!x.has(p.key)),w=s.slots.filter(p=>!s.roster.picks[p.id]).length,$=Math.max(Math.round(s.startPick??1),1),b=h.filter(p=>p>=$),R=$>1?b.slice(0,w):b.slice(Math.max(b.length-w,0)),f=Vs(k,o,l,a),M=new Map;for(const p of Se)M.set(p,k.filter(W=>W.position===p).sort((W,ee)=>ee.value-W.value));const D=new Set(s.slots.filter(p=>p.starter).map(p=>p.id)),y=new Map,S=new Map,F=new Map,E=[],j=[],N=new Float64Array(k.length),g=new Uint16Array(k.length);for(let p=0;p<n&&!((G=t.signal)!=null&&G.cancelled);p++){const W={};for(const Q of Se)W[Q]=Xs*pe(i)*o;for(let Q=0;Q<k.length;Q++){const X=k[Q];N[Q]=Pn(X,o,W[X.position]??0,l.byPosition[X.position],l.scatterRounds,a,i),g[Q]=Q}const ee=Array.from(g).sort((Q,X)=>N[Q]-N[X]),q=new Set;let U=s.roster,V=0,te=0;const ie=new Map(R.map((Q,X)=>[Q,X]));for(let Q=$;Q<=m&&te<R.length;Q++){const X=ie.get(Q);if(X==null){for(;V<ee.length&&q.has(k[ee[V]].key);)V+=1;V<ee.length&&(q.add(k[ee[V]].key),V+=1);continue}for(const oe of k){if(q.has(oe.key))continue;const fe=y.get(oe.key)??(y.set(oe.key,new Array(R.length).fill(0)),y.get(oe.key));fe[X]+=1}const Y=R[te+1]??null,re=$n(s.slots,U,M,q,f,Y);if(re){q.add(re.key),U=Me(s.slots,U,{key:re.key,position:re.position,price:0})??U;const oe=S.get(re.key)??(S.set(re.key,new Array(R.length).fill(0)),S.get(re.key));oe[X]+=1}te+=1}const le=Pe(s.slots,U,0,Q=>d.get(Q)??0);
1E.push(le.starterPoints),j.push({points:le.starterPoints,roster:U});for(const[Q,X]of Object.entries(U.picks)){if(x.has(X.key))continue;const Y=F.get(X.key)??{hits:0,starters:0,rounds:[]};Y.hits+=1,D.has(Q)&&(Y.starters+=1),F.set(X.key,Y)}(p+1)%u===0&&((B=t.onProgress)==null||B.call(t,p+1,n),await En())}(_=t.onProgress)==null||_.call(t,n,n);const P=E.length||1,T=[...F.entries()].map(([p,W])=>({key:p,rate:W.hits/P,starterRate:W.starters/P,medianRound:Cn((S.get(p)??[]).flatMap((ee,q)=>ee>0?new Array(ee).fill(q+1):[]))})).sort((p,W)=>W.starterRate-p.starterRate||W.rate-p.rate||(d.get(W.key)??0)-(d.get(p.key)??0)),z=R.map((p,W)=>{const ee=[...y.entries()].map(([q,U])=>{var V;return{key:q,availability:U[W]/P,takenRate:(((V=S.get(q))==null?void 0:V[W])??0)/P}}).filter(q=>q.availability>.02).sort((q,U)=>U.takenRate-q.takenRate||(d.get(U.key)??0)-(d.get(q.key)??0)).slice(0,8);return{round:Math.ceil(p/o),overallPick:p,players:ee}}),I=[...E].sort((p,W)=>p-W),O=[...j].sort((p,W)=>p.points-W.points),L=[];if(O.length>0){const p=W=>O[Math.min(Math.max(Math.round((O.length-1)*W),0),O.length-1)];L.push({kind:"floor",...p(.1)}),L.push({kind:"typical",...p(.5)}),L.push({kind:"best",...p(.9)})}return{draws:n,myPicks:R,points:I,p10:Ue(I,.1),p50:Ue(I,.5),p90:Ue(I,.9),landing:T,targets:z,rosters:L}}const Js=["QB","RB","WR","TE","K","DEF"];function Zs(s,t){const n=Math.ceil(s/t),o=(s-1)%t+1;return n%2===1?o:t-o+1}function et(s,t,n,o){const r=Zs(s,t);return{overall:s,round:Math.ceil(s/t),slotInRound:(s-1)%t+1,team:r,key:o,mine:r===n}}function Fn(s){const t=Math.max(Math.round(s.teams),2),n=Math.min(Math.max(Math.round(s.seat),1),t),o=s.seed??1,r=Math.min(Math.max(s.leagueWeight??1,0),1),a=s.tendencies??Le,l=Oe(o),i=s.slots.length,u={};for(const d of Js)u[d]=Xs*pe(l)*t;const c=Vs(s.pool,t,a,r),h=s.pool.map(d=>{const x=c.get(d.key);return{key:d.key,slot:x.pick+(u[d.position]??0)+x.sigma*pe(l)}});h.sort((d,x)=>d.slot-x.slot);const m={seed:o,teams:t,seat:n,rounds:i,slots:s.slots,order:h.map(d=>d.key),players:new Map(s.pool.map(d=>[d.key,d])),expected:c,rosters:Array.from({length:t},()=>({picks:{}})),taken:new Set,log:[],cursor:1,onClock:!1,done:i===0||s.pool.length===0};return ls(m)}function ls(s){if(s.done||s.onClock)return s;const t=s.teams*s.rounds,n=[...s.rosters],o=new Set(s.taken),r=[...s.log];let a=s.cursor;for(;a<=t;){const l=Zs(a,s.teams);if(l===s.seat)return{...s,rosters:n,taken:o,log:r,cursor:a,onClock:!0,done:!1};const i=n[l-1];let u=null;for(const c of s.order){if(o.has(c))continue;const h=s.players.get(c);if(!we(s.slots,i,h.position))continue;u=c;const d=Me(s.slots,i,{key:c,position:h.position,price:0});d&&(n[l-1]=d);break}u&&(o.add(u),r.push(et(a,s.teams,s.seat,u))),a+=1}return{...s,rosters:n,taken:o,log:r,cursor:a,onClock:!1,done:!0}}function st(s,t){if(!s.onClock||s.done||s.taken.has(t))return s;const n=s.players.get(t);if(!n)return s;const o=s.rosters[s.seat-1],r=Me(s.slots,o,{key:t,position:n.position,price:0});if(!r||r===o)return s;const a=[...s.rosters];a[s.seat-1]=r;const l=new Set(s.taken);l.add(t);const i=[...s.log,et(s.cursor,s.teams,s.seat,t)];return ls({...s,rosters:a,taken:l,log:i,cursor:s.cursor+1,onClock:!1})}function Ze(s){return Ae(s.seat,s.teams,s.rounds).find(n=>n>s.cursor)??null}function cs(s){if(!s.onClock||s.done)return[];const t=s.rosters[s.seat-1],n=Ze(s),o=Ae(s.seat,s.teams,s.rounds).filter(i=>i>=s.cursor).length,r=s.slots.filter(i=>i.starter&&!t.picks[i.id]).length,a=o<=r,l=[];for(const i of Js){const u=[...s.players.values()].filter(d=>d.position===i&&!s.taken.has(d.key)).sort((d,x)=>x.value-d.value);let c=null;for(const d of u){const x=we(s.slots,t,d.position);if(!x||a&&!x.starter)break;c=d;break}if(!c)continue;let h=0;if(n!=null)for(const d of u){const x=s.expected.get(d.key);if(x&&Te(x.pick,x.sigma,null,null,n)>=.5){h=d.value;break}}const m=s.expected.get(c.key);l.push({key:c.key,position:i,dropoff:c.value-h,survivalOdds:n!=null&&m?Te(m.pick,m.sigma,null,null,n):null,top:!1})}return l.sort((i,u)=>{var c,h;return u.dropoff-i.dropoff||(((c=s.players.get(u.key))==null?void 0:c.value)??0)-(((h=s.players.get(i.key))==null?void 0:h.value)??0)}),l.length>0&&(l[0].top=!0),l}function Ln(s,t=40,n){if(!s.onClock||s.done)return[];const o=s.rosters[s.seat-1],r=[],a=[...s.players.values()].filter(l=>
1!s.taken.has(l.key)&&(n==null||l.position===n)).sort((l,i)=>i.value-l.value||i.points-l.points);for(const l of a)if(we(s.slots,o,l.position)&&(r.push(l),r.length>=t))break;return r}function tt(s){const t=cs(s)[0];return t?st(s,t.key):s}function Bn(s){let t=s,n=s.teams*s.rounds+5;for(;!t.done&&n>0&&(n-=1,t=t.onClock?tt(t):ls(t),!(t.onClock&&cs(t).length===0)););return t}function On(s,t){return Pe(s.slots,s.rosters[t-1],0,n=>{var o;return((o=s.players.get(n))==null?void 0:o.points)??0}).starterPoints}const An=["QB","RB","WR"],Dn=["TE","K","DEF"],Ye=["QB","RB","WR","TE","K","DEF"],nt=.3,Cs={QB:32,RB:64,WR:64,TE:28,K:14,DEF:14};function In(s,t,n){const o=ce.some(l=>{var i;return(i=n==null?void 0:n[l])==null?void 0:i.some(u=>u.samples>=2)}),r={...s.slots,...t.slots},a=s.draftType==="auction"&&o;return{teams:t.teams??s.teams,budget:t.budget??s.auctionBudget,slots:r,scoring:Wt(s.scoring,t.scoring),valuation:t.valuation??"starter-bench",starterPct:t.starterPct??It,allowNegative:t.allowNegative??!0,rosteredOverrides:t.rosteredOverrides??{},priceShape:t.priceShape??(a?ve:Dt),anchors:n,anchorWeight:t.anchorWeight??(a?Xe:0),marketWeight:t.marketWeight??nt,positionFactors:a?null:_t(r)}}function es(s){return s.reduce((t,n)=>t+(n.cost??0),0)}function _n(s,t,n){const o=n>0?` ${n} of them are yours.`:"";return t!=="auction"?`Your league's keepers are already claimed, so they're out of the board, the solver and both simulators.${o}`:`Your league's keepers are already claimed. Their $${es(s)} left the room before the first nomination, so every price here is what's left chasing what's left.${o}`}function Wn(s){return Object.entries(s).some(([,t])=>t!=null&&typeof t=="object"?Object.keys(t).length>0:t!=null)}function ot(s,t){return`hof:cheatsheet:${s}:${t}`}function Hn(s,t){try{const n=localStorage.getItem(ot(s,t));if(n){const o=JSON.parse(n);if(o&&typeof o.taken=="object")return o}}catch{}return{taken:{}}}function rt(s,t){return`hof:cheatsheet:roster:${s}:${t}`}function Kn(s,t){try{const n=localStorage.getItem(rt(s,t));if(n){const o=JSON.parse(n);if(o&&o.picks&&typeof o.picks=="object")return o}}catch{}return Ds}function ko(){var gs;const{active:s,leagueId:t,list:n,isLoading:o}=bt(),r=yt(t),a=r.isFree,l=kt(t),i=Rt(t),u=pt(),c=i.data,h=(s==null?void 0:s.name)??r.leagueName,m=gt({mutationFn:()=>xt.refreshCheatSheet(t),onSuccess:()=>{u.invalidateQueries({queryKey:["leagues",t,"cheat-sheet"]})}}),d=C.useRef(!1),{mutate:x,isPending:k}=m;C.useEffect(()=>{!t||!c||d.current||!c.meta.hasProjections&&!k&&(d.current=!0,x())},[t,c,k,x]);const[w,$]=C.useState({}),b=(c==null?void 0:c.profile)??null,R=C.useMemo(()=>c?Ls(c.history.drafts.filter(v=>v.season!==c.season)):null,[c]),f=C.useMemo(()=>b?In(b,w,R):null,[b,w,R]),[M,D]=C.useState(null),y=M??(b==null?void 0:b.draftType)??"snake",[S,F]=C.useState(!1),[E,j]=C.useState({taken:{}}),N=c==null?void 0:c.season;C.useEffect(()=>{t&&N&&j(Hn(t,N))},[t,N]);const g=C.useCallback(v=>{j(A=>{const H=typeof v=="function"?v(A):v;if(t&&N)try{localStorage.setItem(ot(t,N),JSON.stringify(H))}catch{}return H})},[t,N]),P=c==null?void 0:c.keepers,T=C.useMemo(()=>{if(!P||P.length===0)return E;const v={...E.taken};for(const A of P)A.playerId&&v[A.playerId]===void 0&&(v[A.playerId]=A.cost);return{...E,taken:v}},[E,P]),[z,I]=C.useState(Ds);C.useEffect(()=>{t&&N&&I(Kn(t,N))},[t,N]);const O=C.useCallback(v=>{if(I(v),t&&N)try{localStorage.setItem(rt(t,N),JSON.stringify(v))}catch{}},[t,N]),[L,G]=C.useState(!1),B=C.useCallback(v=>{a?G(!0):v()},[a]),_=C.useMemo(()=>{if(!c||!f||c.players.length===0)return null;const v=c.players.map(J=>({key:J.id,name:J.name,position:J.position,stats:J.stats,marketAdp:J.adp??J.sleeperAdp})),A=y==="auction"&&((f.priceShape??1)!==1||(f.anchorWeight??0)>0),H=(f.marketWeight??0)>0,K=ys(v,{...f,priceShape:1,anchorWeight:0,anchors:null,marketWeight:0}),ne=A||H?ys(v,A?f:{...f,priceShape:1,anchorWeight:0,anchors:null}):K,ae=R?$t(K,R):null;return{result:ne,neutral:K,fitted:ae}},[c,f,R,y]),p=(_==null?void 0:_.result)??null,W=C.useMemo(()=>{const v=new Map;for(const A of(c==null?void 0:c.players)??[])v.set(A.id,A);return v},[c]),ee=(_==null?void 0:_.neutral)??null,q=C.useMemo(()=>
1{if(!ee||!c||!f)return null;const v=new Map;for(const A of c.players)v.set(A.id,{adp:A.adp,sleeperAdp:A.sleeperAdp});return Ct(ee,v,f.teams)},[ee,c,f]),U=(P==null?void 0:P.length)??0,V=C.useMemo(()=>{if(!p)return null;if(S)return Et(p,T);if(U===0||y!=="auction")return null;const v=Tt(p,T);return{global:v,byPosition:{QB:1,RB:1,WR:1,TE:1},adjustedPrice:A=>A.price*v}},[p,S,U,y,T]),te=C.useMemo(()=>p&&S?Ft(p,T):null,[p,S,T]),ie=C.useMemo(()=>p&&S?Lt(p,T):null,[p,S,T]),le=C.useMemo(()=>p&&S?Bt(p,T):null,[p,S,T]),Q=C.useMemo(()=>{if(!p||!S||y!=="snake"||!f||T.slot==null)return null;const v=Object.values(f.slots).reduce((A,H)=>A+H,0);return Ot(T.slot,f.teams,v,T)},[p,S,y,f,T]),X=C.useMemo(()=>f?en(f.slots):[],[f]),Y=C.useMemo(()=>tn(X,z),[X,z]),re=((gs=l.data)==null?void 0:gs.myOwnerId)??null,oe=C.useMemo(()=>re?(P??[]).filter(v=>v.ownerId===re&&v.playerId):[],[P,re]),fe=C.useRef(null);C.useEffect(()=>{const v=`${t}:${N}`;if(!t||!N||fe.current===v||oe.length===0||X.length===0)return;fe.current=v;let A=Y;for(const H of oe){if(Ge(A,H.playerId))continue;const K=Me(X,A,{key:H.playerId,position:H.position,price:H.cost??0});K&&(A=K)}A!==Y&&O(A)},[t,N,oe,X,Y,O]);const Z=C.useMemo(()=>{const v=new Map;if(p)for(const A of Ye)for(const H of p.byPosition[A]??[])v.set(H.key,H);return v},[p]),ue=C.useCallback(v=>Math.max(Math.round(V?V.adjustedPrice(v):v.price),1),[V]),de=C.useMemo(()=>new Set(Object.values(Y.picks).map(v=>v.key)),[Y]),[je,De]=C.useState(null);C.useEffect(()=>{if(!je)return;const v=setTimeout(()=>De(null),6e3);return()=>clearTimeout(v)},[je]);const Ie=C.useCallback(v=>{const A=T.taken[v.key],H=Ge(Y,v.key);if(H){const ae=Y.picks[H];O(xs(Y,H)),S&&A!==void 0&&(y==="auction"?A===ae.price:A===null)&&g(J=>{const ke={...J.taken};return delete ke[v.key],{...J,taken:ke}});return}const K=S&&typeof A=="number"?A:ue(v),ne=Me(X,Y,{key:v.key,position:v.position,price:K});if(!ne){De(`No open ${v.position} seat — drop one first.`);return}O(ne),!S&&A!==void 0&&g(ae=>{const J={...ae.taken};return delete J[v.key],{...ae,taken:J}}),S&&A===void 0&&g(ae=>({...ae,taken:{...ae.taken,[v.key]:y==="auction"?K:null}}))},[Y,X,ue,O,S,T,g,y]),ge=C.useMemo(()=>{const v=[],A=new Map,H=new Map;let K=0;if(p)for(const ne of Ye){const ae=ne==="K"||ne==="DEF"?null:(R==null?void 0:R[ne])??null;for(const J of p.byPosition[ne]??[]){if(T.taken[J.key]!==void 0&&!de.has(J.key))continue;const ke=ue(J);v.push({key:J.key,position:J.position,price:ke,points:J.fpts,value:J.avgVbd});const bs=zs(ke);H.set(J.key,bs);const xe=ae==null?void 0:ae[J.posRank-1];xe&&xe.samples>=2&&xe.median>=1?(K+=1,A.set(J.key,gn(xe.median,xe.lo,xe.hi,ke))):A.set(J.key,bs)}}return{pool:v,leagueBands:A,modelBands:H,anchored:K}},[p,R,S,T,de,ue]),us=C.useMemo(()=>{if(!p)return[];const v=[];for(const A of Ye)for(const H of p.byPosition[A]??[]){if(T.taken[H.key]!==void 0&&!de.has(H.key))continue;const K=W.get(H.key);v.push({key:H.key,position:H.position,points:H.fpts,value:H.avgVbd,adp:(K==null?void 0:K.adp)??(K==null?void 0:K.sleeperAdp)??null,stdev:(K==null?void 0:K.stdev)??null,adpHigh:(K==null?void 0:K.adpHigh)??null,adpLow:(K==null?void 0:K.adpLow)??null,posRank:H.posRank})}return v},[p,S,T,de,W]),Re=C.useMemo(()=>!c||!f?null:wn(c.history.drafts,c.history.market,f.teams),[c,f]),be=C.useMemo(()=>{if(!c)return null;const v=Qs(c.history.drafts);return{cal:v,backtest:v.measured?Nn(c.history.drafts):null}},[c]),hs=C.useMemo(()=>fn((c==null?void 0:c.history.pointsByDraftRank)??null),[c]),[ms,ye]=C.useState(!1),[ct,$e]=C.useState(!1),[dt,ut]=C.useState(null),ht=C.useRef(1),mt=C.useCallback(()=>{if(!p||!f)return;const v=ge.pool,A=Is({slots:X,roster:Y,pool:v,budget:f.budget,benchBudget:Y.benchBudget});O(A.roster),De(A.feasible?null:"Not enough budget left for a full starting lineup — filled what it covers.")},[p,f,ge,X,Y,O]),[fs,ps]=C.useState(null),_e=C.useRef(new Set);C.useEffect(()=>{if(!ie){_e.current=new Set;return}const v=new Set;let A=null;for(const H of ce)for(const K of ie[H])if(K.cliff&&K.remaining>0){const ne=`${H}:${K.tier}`;v.add(ne),_e.current.has(ne)||(A=`${H} tier ${K.tier} is down to ${K.remaining}`)}if(_e.current=v,A){ps(A);const H=setTimeout(()=>ps(null),8e3);return()=>clearTimeout(H)}},[ie]);
1const ft=!t&&!o&&n.length===0;return e.jsxs("main",{className:"hofPage hof-cheatsheet",children:[e.jsx(jt,{}),e.jsx("div",{className:"hjb-frame",children:i.isLoading||o?e.jsx("p",{className:"cs-empty",children:"Setting the board…"}):i.isError?e.jsxs("p",{className:"cs-empty",role:"alert",children:[vt(i.error)?i.error.message:"The cheat sheet didn’t load."," ",e.jsx("button",{className:"hof-link-btn",onClick:()=>i.refetch(),children:"Retry"})]}):ft?e.jsxs("p",{className:"cs-empty",children:["Import a league first — ",e.jsx(Ut,{to:"/add-league",children:"add your league"})," ","and the sheet builds itself from your settings."]}):!c||!f||!b?null:p?e.jsxs(e.Fragment,{children:[e.jsx(Mt,{className:"cs-page-head",icon:e.jsx(ns,{}),eyebrow:"Draft kit · League-tuned rankings",title:"Cheat Sheet",meta:e.jsxs("div",{className:"cs-board-summary","aria-label":`${c.season} draft board, ${b.teams}-team, ${y==="auction"?`$${b.auctionBudget} auction`:"snake"}`,children:[e.jsxs("div",{className:"cs-board-summary__season",children:[e.jsx("span",{children:"Draft board"}),e.jsx("strong",{children:c.season})]}),e.jsxs("div",{className:"cs-board-summary__facts",children:[e.jsxs("span",{children:[e.jsx("strong",{children:b.teams}),e.jsx("small",{children:"Teams"})]}),e.jsxs("span",{children:[e.jsx("strong",{children:y==="auction"?`$${b.auctionBudget}`:"Snake"}),e.jsx("small",{children:y==="auction"?"Auction":"Format"})]})]})]})}),b.sources.scoring!=="provider"&&b.scoringSeason&&b.scoringSeason!==b.season&&e.jsxs("p",{className:"cs-warning",role:"status",children:["Your ",b.season??"current"," season isn't connected yet, so these rankings use your league's ",b.scoringSeason," scoring rules as an estimate. Connect the new season to replace them with this year's rules."]}),b.sources.scoring!=="provider"&&!(b.scoringSeason&&b.scoringSeason!==b.season)&&e.jsxs("p",{className:"cs-warning",role:"status",children:["Scoring rules for ",b.season??"this season"," are unavailable. Review the editable scoring defaults below before using these rankings."]}),!!(f.scoring.model&&At(f.scoring.model).length)&&e.jsx("p",{className:"cs-warning",role:"status",children:"Some custom scoring categories are unavailable in forecasts. Imported position-specific rates are included."}),e.jsx(Un,{data:c,profile:b,mode:y,onMode:D,live:S,onLive:()=>B(()=>F(v=>!v)),inflation:(V==null?void 0:V.global)??1,clock:Q,slot:T.slot??null,onSlot:v=>g(A=>({...A,slot:v??void 0})),teams:f.teams,refreshing:m.isPending,onRefresh:()=>m.mutate(),isFree:a,customized:Wn(w),onResetCustom:()=>$({}),onClearBoard:()=>g(v=>({taken:{},slot:v.slot})),crossoffCount:Object.keys(E.taken).length,keepers:P??null,myKeeperCount:oe.length}),fs&&e.jsxs("p",{className:"cs-warning cs-cliff-alert",role:"status",children:[e.jsx(ks,{size:13,"aria-hidden":"true"})," ",fs]}),p.warnings.map(v=>e.jsxs("p",{className:"cs-warning",role:"status",children:[e.jsx(ks,{size:13,"aria-hidden":"true"})," ",v]},v)),e.jsx(Jn,{settings:f,profile:b,custom:w,setCustom:$,result:p,drafts:c.history.drafts,anchors:R,fitted:(_==null?void 0:_.fitted)??null,mode:y,isFree:a,onLockedClick:()=>G(!0)}),S&&le&&e.jsx(Zn,{board:le,mode:y,inflationDetail:V,playerMeta:W,clock:Q}),e.jsxs("div",{className:"cs-layout has-rail",children:[e.jsxs("div",{className:"cs-main",children:[e.jsx(ro,{result:p,mode:y,live:S,crossoff:T,playerMeta:W,teams:f.teams,inflationDetail:V,rosteredKeys:de,onToggleRoster:Ie}),e.jsx("div",{className:"cs-columns",children:An.map(v=>e.jsx(Fs,{pos:v,players:p.byPosition[v]??[],result:p,mode:y,live:S,inflationDetail:V,scarcity:(te==null?void 0:te[v])??null,liveTiers:ie&&v!=="K"&&v!=="DEF"?ie[v]:null,marketEdge:q,clock:Q,crossoff:T,onCrossoff:g,playerMeta:W,teams:f.teams,anchors:R,rosteredKeys:de,onToggleRoster:Ie},v))}),e.jsx("div",{className:"cs-columns cs-columns-minor",children:Dn.map(v=>e.jsx(Fs,{pos:v,players:p.byPosition[v]??[],result:p,mode:y,live:S,inflationDetail:V,scarcity:(te==null?void 0:te[v])??null,liveTiers:ie&&v==="TE"?ie.TE:null,marketEdge:v==="TE"?q:null,clock:v==="TE"?Q:null,crossoff:T,onCrossoff:g,playerMeta:W,teams:f.teams,anchors:v==="TE"?R:null,rosteredKeys:de,onToggleRoster:Ie},v))}),e.jsxs("p",{className:"cs-sources",children:["Market ADP:"," ",e.jsx("a",{href:"https://fantasyfootballcalculator.com",target:"_blank",rel:"noreferrer",children:"Fantasy Football Calculator"})," ","· Projections & injury report: Sleeper (Rotowire)"]})]}),e.jsxs("div",{className:"cs-rail",children:[e.jsx(eo,{slots:X,roster:Y,valued:Z,meta:W,budget:f.budget,mode:y,teams:f.teams,seat:T.slot??null,livePick:S&&y==="snake"?(Q==null?void 0:Q.nextMine)??null:null,onSeat:v=>g(A=>({...A,slot:v??void 0})),note:je,isFree:a,onPrice:(v,A)=>{const H=Y.picks[v];O(sn(Y,v,A)),S&&y==="auction"&&H&&T.taken[H.key]!==void 0&&g(K=>({...K,taken:{...K.taken,[H.key]:A}}))},onRemove:v=>{const A=Y.picks[v];O(xs(Y,v));const H=A?T.taken[A.key]:void 0;S&&A&&H!==void 0&&(y==="auction"?H===A.price:H===null)&&g(K=>{const ne={...K.taken};return delete ne[A.key],{...K,taken:ne}})}
1,onBenchBudget:v=>O({...Y,benchBudget:v}),onClear:()=>O({picks:{},benchBudget:Y.benchBudget}),onOptimize:()=>B(mt),onSimulate:()=>B(()=>ye(!0)),onMock:y==="snake"?()=>B(()=>$e(!0)):null}),e.jsx(ao,{data:c,mode:y})]})]})]}):e.jsx(zn,{refreshing:m.isPending,failed:d.current&&!m.isPending&&!c.meta.hasProjections,onRetry:()=>m.mutate()})}),ct&&f&&p&&y==="snake"&&e.jsx(no,{slots:X,pool:us,teams:f.teams,seat:T.slot??1,tendencies:Re,leagueWeight:Re&&Re.seasons>=2?.7:0,valued:Z,session:dt,onSession:ut,seedRef:ht,onLoad:v=>{O(v),$e(!1)},onOpenSim:()=>{$e(!1),B(()=>ye(!0))},onClose:()=>$e(!1)}),ms&&f&&p&&y==="snake"&&e.jsx(oo,{slots:X,roster:Y,valued:Z,pool:us,teams:f.teams,seat:T.slot??1,startPick:S?Object.keys(T.taken).length+1:1,tendencies:Re,outcomeModel:hs,onLoad:v=>{O(v),ye(!1)},onClose:()=>ye(!1)}),ms&&f&&p&&y==="auction"&&e.jsx(so,{slots:X,roster:Y,valued:Z,budget:f.budget,pool:ge.pool,leagueBands:ge.leagueBands,modelBands:ge.modelBands,anchoredRanks:ge.anchored,auctionSeasons:(c==null?void 0:c.history.drafts.filter(v=>v.isAuction).length)??0,calibration:(be==null?void 0:be.cal)??null,backtest:(be==null?void 0:be.backtest)??null,outcomeModel:hs,onLoad:v=>{O(v),ye(!1)},onClose:()=>ye(!1)}),L&&t&&e.jsx(Pt,{leagueId:t,leagueName:h,surface:"cheat-sheet",onClose:()=>G(!1)})]})}function zn({refreshing:s,failed:t,onRetry:n}){return e.jsxs("section",{className:"hjb-card cs-card cs-building",children:[e.jsx(Os,{size:22,"aria-hidden":"true"}),s||!t?e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Building your board"}),e.jsx("p",{children:"Pulling this year's projections and market ADP, then pricing every player under your league's rules. A few seconds."})]}):e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Projections aren't answering"}),e.jsx("p",{children:"The projections feed didn't respond. The sheet needs one successful pull — try again in a minute."}),e.jsxs("button",{className:"hof-btn",onClick:n,children:[e.jsx(As,{size:14,"aria-hidden":"true"})," Try again"]})]})]})}function Un({data:s,profile:t,mode:n,onMode:o,live:r,onLive:a,inflation:l,clock:i,slot:u,onSlot:c,teams:h,refreshing:m,onRefresh:d,isFree:x,customized:k,onResetCustom:w,onClearBoard:$,crossoffCount:b,keepers:R,myKeeperCount:f}){return e.jsx(Nt,{className:"cs-toolbar","aria-label":"Cheat sheet controls",children:e.jsxs("div",{className:"cs-actions",children:[k&&e.jsxs("button",{className:"hof-link-btn",onClick:w,children:[e.jsx(Fe,{size:11,"aria-hidden":"true"})," reset to league"]}),r&&n==="auction"&&e.jsxs("span",{className:`cs-inflation${l>1.02?" is-hot":l<.98?" is-cold":""}`,title:"Money left in the room vs. value left on the board",children:["Inflation ×",l.toFixed(2)]}),r&&n==="snake"&&e.jsxs("span",{className:"cs-clock",children:[e.jsx(St,{label:"Seat",children:e.jsx("input",{type:"number",min:1,max:h,value:u??"",placeholder:"—",onChange:M=>{const D=M.target.value.trim();if(D==="")return c(null);const y=Number(D);Number.isFinite(y)&&c(Math.min(Math.max(Math.round(y),1),h))},"aria-label":"Your draft seat"})}),i&&e.jsxs("span",{className:"cs-clock-line",title:"Cross off every pick to keep the clock honest (assumes plain serpentine, no 3rd-round reversal)",children:["Pick ",i.currentPick," · you at ",i.nextMine,i.thenMine!=null?`, then ${i.thenMine}`:""]})]}),e.jsx(wt,{className:"cs-mode",role:"group","aria-label":"Draft type",children:["snake","auction"].map(M=>e.jsx("button",{"aria-pressed":n===M,className:n===M?"is-active":"",onClick:()=>o(M),children:M==="snake"?"Snake":"Auction"},M))}),e.jsx("button",{className:`hof-btn cs-live-btn${r?" is-live":""}`,onClick:a,title:"Cross players off as they leave the board",children:r?"● Draft day":"Draft day"}),r&&b>0&&e.jsx("button",{className:"hof-link-btn",onClick:$,children:"clear board"}),!r&&b>0&&e.jsxs("button",{className:"hof-link-btn cs-kept-chip",onClick:$,title:"Players marked kept are excluded from the board, the solver, and both simulators",children:[b," kept · clear"]}),R&&R.length>0&&e.jsxs("span",{className:"cs-keeper-chip",title:_n(R,n,f),children:[R.length," keeper",R.length===1?"":"s"," off the board",n==="auction"&&es(R)>0?` · $${es(R)} gone`:""]}),e.jsxs("button",{className:"hof-btn cs-icon-btn",onClick:d,disabled:m,title:s.meta.projectionsFetchedAt?`Projections pulled ${new Date(s.meta.projectionsFetchedAt).toLocaleDateString()}`:"Pull projections",children:[e.jsx(As,{size:14,className:m?"cs-spin":"","aria-hidden":"true"}),e.jsx("span",{className:"cs-visually-hidden",children:"Refresh projections"})]}),e.jsxs("button",{className:"hof-btn cs-icon-btn",onClick:()=>window.print(),title:"Print the sheet",children:[e.jsx(Yt,{size:14,"aria-hidden":"true"}),e.jsx("span",{className:"cs-visually-hidden",children:"Print"})]})]})})}const Yn=[{key:"rec",label:"Reception"},{key:"recYd",label:"Rec yd"},{key:"recTd",label:"Rec TD"},{key:"rushYd",label:"Rush yd"},{key:"rushTd",label:"Rush TD"},{key:"rushAtt",label:"Rush att"},{key:"passYd",label:"Pass yd"},{key:"passTd",label:"Pass TD"},{key:"passInt",label:"INT"},{key:"fumLost",label:"Fumble"},{key:"pass2pt",label:"Pass 2pt"},{key:"rush2pt",label:"Rush 2pt"},{key:"rec2pt",label:"Rec 2pt"},{key:"passAtt",label:"Pass att"},{key:"passCmp",label:"Completion"},{key:"passFd",label:"Pass 1st down"},{key:"rushFd",label:"Rush 1st down"},{key:"recFd",label:"Rec 1st down"}],Es=[{key:"QB",label:"QB"},{key:"RB",label:"RB"},{key:"WR",label:"WR"},{key:"TE",label:"TE"},{key:"FLEX",label:"W/R/T"},{key:"WR_RB",label:"W/R"},{key:"REC_FLEX",label:"W/T"},{key:"SUPER_FLEX",label:"SFLX"},{key:"K",label:"K"},{key:"DEF",label:"DEF"},{key:"BENCH",label:"Bench"}];function Ts(s){return s>=1.35?"Very top-heavy":s>=1.12?"Top-heavy":s>.92?"Balanced":s>
1.8?"Spread out":"Very spread out"}function Qn(s){return s>=.93?"Nearly all on starters":s>=.85?"Starters first":s>=.75?"Some bench money":"Real bench money"}function Xn(s){return s<=0?"Model prices only":s<=.35?"Mostly the model":s<.65?"Half and half":s<.95?"Mostly your league":"Your league's real prices"}function ds({status:s,bodyPart:t}){if(!s)return null;const n=s.toLowerCase(),o=n==="questionable"?"Q":n==="doubtful"?"D":n==="out"?"O":s.toUpperCase(),r=n!=="questionable"&&n!=="doubtful";return e.jsx("em",{className:`cs-injury${r?" is-severe":""}`,title:`${s}${t?` — ${t}`:""} (Sleeper injury report)`,children:o})}function qn(s){return s<=0?"Off — pure projections":s<=.2?"A nudge from ADP":s<=.4?"Listens to the market":s<.65?"Half and half":s<.95?"Mostly the market":"The market's board"}function Gn(s){return Number.isInteger(s)?String(s):String(Number(s.toFixed(4)))}function Vn(s,t){return(s==="passYd"||s==="rushYd"||s==="recYd")&&t>0&&t<1?`1 pt / ${Math.round(1/t)} yd`:null}function Ce({name:s,reading:t,help:n,ends:o,min:r,max:a,step:l,value:i,disabled:u,onChange:c,footer:h}){return e.jsxs("div",{className:"cs-dial",children:[e.jsxs("div",{className:"cs-dial-head",children:[e.jsx("span",{className:"cs-dial-name",children:s}),e.jsx("b",{className:"cs-dial-reading",children:t})]}),e.jsx("input",{type:"range",min:r,max:a,step:l,value:i,disabled:u,"aria-label":s,onChange:m=>c(Number(m.target.value))}),e.jsxs("span",{className:"cs-dial-ends","aria-hidden":"true",children:[e.jsx("i",{children:o[0]}),e.jsx("i",{children:o[1]})]}),e.jsx("p",{className:"cs-dial-help",children:n}),h]})}function Jn({settings:s,profile:t,custom:n,setCustom:o,result:r,drafts:a,anchors:l,fitted:i,mode:u,isFree:c,onLockedClick:h}){const m=(j,N,g)=>P=>{const T=P.target.value.trim();if(T==="")return;let z=Number(T);Number.isFinite(z)&&(N!=null&&(z=Math.max(z,N)),g!=null&&(z=Math.min(z,g)),j(z))},d=(j,N)=>o(g=>{const P={...g.slots};return N===t.slots[j]?delete P[j]:P[j]=N,{...g,slots:P}}),x=(j,N)=>o(g=>{const P={...g.scoring},T=Object.values(t.scoring.positionOverrides??{}).some(z=>z[j]!==void 0);return N===t.scoring[j]&&!T?delete P[j]:P[j]=N,{...g,scoring:P}}),k=s.teams*Object.values(s.slots).reduce((j,N)=>j+N,0),w=Ht(a,r.starters,k),$=l?ce.reduce((j,N)=>{var g;return j+(((g=l[N])==null?void 0:g.filter(P=>P.samples>=2).length)??0)},0):0,b=l?Math.max(0,...ce.flatMap(j=>(l[j]??[]).map(N=>N.samples))):0,R=u==="auction"&&i!=null&&Math.abs(i-ve)>.01,f=u==="auction"&&$>=6,M=w.draftsSampled>0,D=[R?"the price curve":null,f?"price anchors":null,M?"roster depth":null].filter(Boolean),y=(!R||Math.abs((s.priceShape??ve)-i)<=.01)&&(!f||Math.abs((s.anchorWeight??0)-Xe)<=.01)&&(!M||Object.entries(w.suggestion).every(([j,N])=>{var g;return((g=n.rosteredOverrides)==null?void 0:g[j])===N})),S=()=>o(j=>{const N={...j};return R&&(N.priceShape=i),f&&(N.anchorWeight=Xe),M&&(N.rosteredOverrides={...j.rosteredOverrides,...w.suggestion}),N}),F=(n.teams!=null?1:0)+(n.budget!=null?1:0)+(n.starterPct!=null?1:0)+(n.valuation!=null?1:0)+(n.priceShape!=null?1:0)+(n.anchorWeight!=null?1:0)+Object.keys(n.scoring??{}).length+Object.keys(n.slots??{}).length+Object.keys(n.rosteredOverrides??{}).length,E=Es.filter(j=>s.slots[j.key]>0).map(j=>`${s.slots[j.key]}${j.label}`).join(" · ");return e.jsxs("details",{className:`hjb-card cs-card cs-settings${c?" is-elite-locked":""}`,onClickCapture:c?j=>{j.preventDefault(),j.stopPropagation(),h()}:void 0,children:[e.jsxs("summary",{children:[e.jsx(Qt,{size:14,"aria-hidden":"true"})," League settings & model tuning",e.jsxs("span",{className:"cs-settings-hint",children:[s.teams," tm · ",s.scoring.rec," PPR",u==="auction"?` · $${s.budget}`:"",F>0&&e.jsxs("b",{className:"cs-edit-count",children:[F," edited"]})]})]}),e.jsxs("div",{className:"cs-settings-body",children:[D.length>0&&e.jsxs("section",{className:`cs-tune-cta${y?" is-applied":""}`,children:[e.jsxs("div",{children:[e.jsxs("h3",{children:[y?e.jsx(Xt,{size:14,"aria-hidden":"true"}):e.jsx(qe,{size:14,"aria-hidden":"true"}),y?"Matched to your league":"Match your league"]}),e.jsx("p",{children:y?e.jsxs(e.Fragment,{children:["The board is priced off"," ",D.join(", ").replace(/, ([^,]*)$/," and $1")," from your own drafts. Move any dial below to override it."]}):e.jsxs(e.Fragment,{children:[M?`${w.draftsSampled} of your drafts`:`${b} auction season${b===1?"":"s"}`," ","on file. Sets"," ",D.join(", ").replace(/, ([^,]*)$/," and $1")," from how this room really drafts — the best single thing you can do to the board."]})})]}),!y&&e.jsx("button",{type:"button",className:"hof-btn",disabled:c,onClick:S,children:"Tune from history"})]}),u==="auction"&&e.jsxs("section",{className:"cs-set-block",children:[e.jsx("h3",{children:"How dollars get spread"}),e.jsx(Ce,{name:"Spend on starters",reading:`${Math.round(s.starterPct*100)}% · ${Qn(s.starterPct)}
1`,help:"How much of the room's money the model assumes goes to starting lineups rather than bench depth. Raise it and elite starters cost more.",ends:["bench matters","starters only"],min:60,max:98,value:Math.round(s.starterPct*100),disabled:c,onChange:j=>o(N=>({...N,starterPct:j/100}))}),e.jsx(Ce,{name:"How your room bids",reading:Ts(s.priceShape??ve),help:"Balanced spreads dollars down the board. Top-heavy concentrates them on the elites — set it to match the way your league actually bids.",ends:["balanced","stars & scrubs"],min:70,max:160,value:Math.round((s.priceShape??ve)*100),disabled:c,onChange:j=>o(N=>({...N,priceShape:j/100})),footer:R?e.jsxs("button",{type:"button",className:"hof-link-btn cs-calibrate",disabled:c,onClick:()=>o(j=>({...j,priceShape:i})),children:[e.jsx(qe,{size:11,"aria-hidden":"true"})," Your last"," ",b," auction",b===1?"":"s"," look"," ",Ts(i).toLowerCase()," — use that"]}):null}),f?e.jsx(Ce,{name:"Trust your league's prices",reading:Xn(s.anchorWeight??0),help:`Blends the model's prices toward what your league has actually paid at each positional rank (${$} ranks across ${b} auction seasons). The board rebalances, so a premium at the top comes out of the middle.`,ends:["the model","your history"],min:0,max:100,step:5,value:Math.round((s.anchorWeight??0)*100),disabled:c,onChange:j=>o(N=>({...N,anchorWeight:j/100}))}):e.jsx("p",{className:"cs-set-note",children:b===0?"Import an auction draft and the board can price players off what your league has actually paid.":"Pricing off your league's own history needs two auction seasons — one more and it unlocks."})]}),e.jsxs("section",{className:"cs-set-block",children:[e.jsx("h3",{children:"The market’s vote"}),e.jsx(Ce,{name:"Trust the market",reading:qn(s.marketWeight??0),help:"Blends the board toward the market's current draft order (Fantasy Football Calculator ADP, refreshed daily). Projections are editorial and can lag injuries and camp news by weeks; ADP reprices overnight. Each player blends toward the value the model gives his market slot, so your league's scoring shape survives the pull.",ends:["the model","the market"],min:0,max:100,step:5,value:Math.round((s.marketWeight??0)*100),disabled:c,onChange:j=>o(N=>({...N,marketWeight:j===Math.round(nt*100)?void 0:j/100}))})]}),e.jsxs("section",{className:"cs-set-block",children:[e.jsx("h3",{children:"How deep your league drafts"}),e.jsxs("p",{className:"cs-set-lede",children:["Where each position stops being worth a roster spot. This is the single biggest lever on ",u==="auction"?"prices":"value"," — a league that rosters 60 running backs values them very differently from one that rosters 40."]}),e.jsx("div",{className:"cs-set-grid cs-depth-grid",children:ce.map(j=>{const N=Math.round(r.rostered[j]),g=Math.ceil(r.starters[j]);return e.jsxs("label",{children:[j," drafted",e.jsx("input",{type:"number",min:g,placeholder:String(N),value:s.rosteredOverrides[j]??"",disabled:c,onChange:P=>{const T=P.target.value.trim();o(z=>{const I={...z.rosteredOverrides};if(T==="")delete I[j];else{const O=Number(T);Number.isFinite(O)&&O>0&&(I[j]=Math.round(O))}return{...z,rosteredOverrides:I}})},onBlur:P=>{const T=Number(P.target.value);Number.isFinite(T)&&T>0&&T<g&&o(z=>({...z,rosteredOverrides:{...z.rosteredOverrides,[j]:g}}))}}),e.jsx("i",{className:"cs-depth-hint",children:w.observed[j]!=null?`yours draft ~${Math.round(w.observed[j])}`:`default ${N}`})]},j)})})]}),e.jsxs("details",{className:"cs-set-fold",children:[e.jsxs("summary",{children:["Your league's setup",e.jsxs("i",{children:[s.teams," teams",u==="auction"?` · $${s.budget}`:""," ·"," ",E," · ",s.scoring.rec," PPR",t.sources.scoring==="provider"?" · imported":""]})]}),e.jsxs("div",{className:"cs-fold-body",children:[e.jsxs("div",{className:"cs-set-group",children:[e.jsx("h4",{children:"League"}),e.jsxs("label",{children:["Teams",e.jsx("input",{type:"number",min:4,max:20,value:s.teams,disabled:c,onChange:m(j=>o(N=>({...N,teams:j})),2,24)})]}),u==="auction"&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:["Budget $",e.jsx("input",{type:"number",min:1,value:s.budget,disabled:c,onChange:m(j=>o(N=>({...N,budget:j})),1)})]}),e.jsxs("label",{title:"Starter / Bench prices starter value and bench value at different rates (the spreadsheet's model). Flat $ per point is the simpler one-rate alternative.",children:["Pricing method",e.jsxs("select",{value:s.valuation,disabled:c,onChange:j=>o(N=>({...N,valuation:j.target.value})),children:[e.jsx("option",{value:"starter-bench",children:"Starter / Bench"}),e.jsx("option",{value:"avg-vbd",children:"Flat $ per point"})]})]})]})]}),e.jsxs("div",{className:"cs-set-group",children:[e.jsxs("h4",{children:["Starting lineup",t.sources.slots==="provider"?" · imported":""]}),e.jsx("div",{className:"cs-set-grid",children:Es.map(j=>e.jsxs("label",{children:[j.label,e.jsx("input",{type:"number",min:0,max:12,value:s.slots[j.key],disabled:c,onChange:m(N=>d(j.key,N),0,12)})]},j.key))})]}),e.jsxs("div",{className:"cs-set-group cs-scoring-group",children:[e.jsxs("h4",{children:["Scoring",t.sources.scoring==="provider"?" · imported":""]}),Object.values(s.scoring.positionOverrides??{}).some(j=>Object.keys(j).length>0)&&e.jsx("p",{className:"cs-depth-hint",children:"Position-specific rates are shown below each field. Editing a field applies that rate to every position."}),s.scoring.firstDownsIncludeTouchdowns&&[s.scoring,...Object.values(s.scoring.positionOverrides??{})].some(j=>j.passFd||j.rushFd||j.recFd)&&e.jsx("p",{className:"cs-depth-hint",children:"First-down points also apply to touchdowns under your league’s rules."}),e.jsx("div",{className:"cs-set-grid",children:Yn.map(j=>{const N=s.scoring[j.key]??0,g=Vn(j.key,N);return e.jsxs("label",{children:[j.label,e.jsx("input",{type:"number",step:"0.01",value:Gn(N),disabled:c,onChange:m(P=>x(j.key,P))}),g&&e.jsx("i",{className:"cs-depth-hint",children:g}),Object.entries(s.scoring.positionOverrides??{}).some(([,P])=>P[j.key]!==void 0)&&e.jsx("i",{className:"cs-depth-hint",children:Object.entries(s.scoring.positionOverrides??{}).filter(([,P])=>P[j.key]!==void 0).map(([P,T])=>`${P}: ${T[j.key]}`).join(" · ")})]},j.key)})})]})]})]}),F>0&&e.jsx("div",{className:"cs-set-reset",children:e.jsxs("button",{type:"button",className:"hof-link-btn",disabled:c,onClick:()=>o({}),children:[e.jsx(Fe,{size:11,"aria-hidden":"true"})," Reset all"," ",F," edit",F===1?"":"s"," back to your league"]})})]})]})}function Zn({board:s,mode:t,inflationDetail:n,playerMeta:o,clock:r}){return e.jsx("div",{className:"cs-board-strip","aria-label":"Best remaining per position",children:ce.map(a=>{const l=s[a];if(!l)return null;const i=o.get(l.best.key),u=t==="auction"?Math.max(Math.round((n==null?void 0:n.adjustedPrice(l.best))??l.best.price),1):null,c=(i==null?void 0:i.adp)??(i==null?void 0:i.sleeperAdp)??null,h=(r==null?void 0:r.thenMine)!=null&&c!=null&&c<=r.thenMine;return e.jsxs("div",{className:`hjb-card cs-card cs-board-cell${l.strike?" is-strike":""}`,style:{"--cs-pos":`var(--pos-${a.toLowerCase()})`},children:[e.jsx("b",{className:"cs-board-pos",children:a}),e.jsxs("span",{className:"cs-board-name",children:[l.best.name,e.jsxs("i",{children:[(i==null?void 0:i.team)??"",i!=null&&i.bye?` · ${i.bye}`:""]})]}),e.jsx("span",{className:"cs-board-val",children:u!=null?`$${u}`:Math.round(l.best.avgVbd)}
1),l.next&&e.jsxs("span",{className:"cs-board-drop",title:`Next best: ${l.next.name}`,children:["▼ ",Math.round(l.dropVbd)," pts to next",l.strike?" — strike now":""]}),h&&e.jsxs("span",{className:"cs-board-gone",children:["won't survive to pick ",r.thenMine]})]},a)})})}function eo({slots:s,roster:t,valued:n,meta:o,budget:r,mode:a,teams:l,seat:i,livePick:u,onSeat:c,note:h,isFree:m,onPrice:d,onRemove:x,onClear:k,onOptimize:w,onSimulate:$,onMock:b,onBenchBudget:R}){const f=Pe(s,t,r,E=>{var j;return((j=n.get(E))==null?void 0:j.fpts)??0}),M=s.filter(E=>!E.starter).length,D=u??(a==="snake"&&i!=null?Ae(i,l,s.length)[f.filled]??null:null),y=f.openSeats-f.openStarters,S=Math.max(y,1),F=Math.max(t.benchBudget??y,S);return e.jsxs("aside",{className:"hjb-card cs-card cs-lineup","aria-label":"Lineup builder",children:[e.jsxs("header",{className:"cs-col-head",children:[e.jsxs("h2",{children:[e.jsx(qt,{size:14,"aria-hidden":"true"})," Your lineup"]}),f.filled>0&&e.jsx("button",{className:"hof-link-btn cs-lu-clear",onClick:k,children:"clear"})]}),a==="auction"?e.jsxs("div",{className:"cs-lu-topline",children:[e.jsxs("span",{className:`cs-lu-stat${f.overBudget?" is-over":""}`,children:[e.jsxs("b",{children:["$",f.left]}),e.jsxs("i",{children:["left of $",r]})]}),e.jsxs("span",{className:"cs-lu-stat",children:[e.jsx("b",{children:f.openSeats}),e.jsx("i",{children:"seats open"})]}),e.jsxs("span",{className:"cs-lu-stat",title:"The most you can bid on one player and still put a $1 body in every remaining seat",children:[e.jsxs("b",{children:["$",f.maxBid]}),e.jsx("i",{children:"max bid"})]})]}):e.jsxs("div",{className:"cs-lu-topline",children:[e.jsxs("label",{className:"cs-lu-stat cs-lu-seat",children:[e.jsx("b",{children:e.jsx("input",{type:"number",min:1,max:l,value:i??"",placeholder:"—","aria-label":"Your draft seat",onChange:E=>{const j=E.target.value.trim();if(j==="")return c(null);const N=Number(j);Number.isFinite(N)&&c(Math.min(Math.max(Math.round(N),1),l))}})}),e.jsx("i",{children:"your seat"})]}),e.jsxs("span",{className:"cs-lu-stat",children:[e.jsx("b",{children:D??"—"}),e.jsx("i",{children:"next pick"})]}),e.jsxs("span",{className:"cs-lu-stat",children:[e.jsx("b",{children:f.openSeats}),e.jsx("i",{children:"seats open"})]})]}),e.jsxs("p",{className:"cs-lu-pts",children:[e.jsx("b",{children:Math.round(f.starterPoints).toLocaleString()})," projected starter points"]}),a==="auction"&&e.jsxs("button",{className:"hof-btn cs-lu-build",onClick:w,title:"Fill every empty seat with the highest-scoring starting lineup the money left can buy — seats you've already filled stay put",children:[e.jsx(qe,{size:13,"aria-hidden":"true"})," Build optimal"]}),e.jsxs("button",{className:"hof-btn cs-lu-sim",onClick:$,title:"Run the draft hundreds of times at your league's real auction prices and see which teams you can actually come away with",children:[e.jsx(os,{size:13,"aria-hidden":"true"})," Simulate drafts"]}),a==="snake"&&b&&e.jsxs("button",{className:"hof-btn cs-lu-mock",onClick:b,title:"Draft one full mock against bots that pick the way your league actually drafts — you're on the clock at every one of your turns",children:[e.jsx(ns,{size:13,"aria-hidden":"true"})," Mock draft"]}),a==="auction"&&M>0&&e.jsxs("label",{className:"cs-lu-bench",title:"Money the solver holds back from the starting lineup and spends on bench depth. At the $1-a-seat minimum it buys starters with everything and fills the bench with fliers.",children:[e.jsx("span",{children:"Keep for bench"}),e.jsx(ss,{value:F,onCommit:E=>R(Math.max(E,S)),label:"Dollars reserved for bench seats"}),e.jsxs("i",{children:[y," of ",M," open"]})]}),h&&e.jsx("p",{className:"cs-lu-note",role:"status",children:h}),e.jsx("ol",{className:"cs-lu-slots",children:s.map(E=>{var g,P;const j=t.picks[E.id],N=j?n.get(j.key):null;return e.jsxs("li",{className:`${E.starter?"":"is-bench"}${j?" is-filled":""}`,style:{"--cs-pos":N?`var(--pos-${N.position.toLowerCase()})`:"var(--pos-other)"},children:[e.jsx("b",{className:"cs-lu-slot",children:E.label}),j?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"cs-lu-name",children:[(N==null?void 0:N.name)??"—",N&&e.jsx(ds,{status:(g=o.get(N.key))==null?void 0:g.injuryStatus,bodyPart:(P=o.get(N.key))==null?void 0:P.injuryBodyPart}),N&&e.jsx("i",{children:Math.round(N.fpts)})]}),a==="auction"&&e.jsxs(e.Fragment,{children:[e.jsx(ss,{value:j.price,onCommit:T=>d(E.id,T),label:`Price for ${(N==null?void 0:N.name)??E.label}`}),e.jsxs("span",{className:"cs-lu-print",children:["$",j.price]})]}),e.jsx("button",{className:"cs-cross",onClick:()=>x(E.id),"aria-label":`Remove ${(N==null?void 0:N.name)??"player"} from ${E.label}`,children:"✕"})]}):e.jsx("span",{className:"cs-lu-empty",children:"empty"})]},E.id)})}),e.jsx("p",{className:"cs-lu-foot",children:a==="auction"?e.jsxs(e.Fragment,{children:["Prices start at the board's current forecast — edit any of them to what you actually paid. ",e.jsx("b",{children:"Build optimal"})," buys the highest-projecting starters the money outside the bench reserve reaches, then spends that reserve on the best value left."]}):e.jsxs(e.Fragment,{children:["Add players as you draft them. ",e.jsx("b",{children:"Simulate drafts"})," plays the room out hundreds of times from your seat — using how your league has actually drafted, not just market ADP — to show who really reaches you."]})})]})}function at({points:s}){const t=C.useMemo(()=>
1{if(s.length===0)return[];const n=s[0],r=s[s.length-1]-n||1,a=22,l=new Array(a).fill(0);for(const u of s)l[Math.min(Math.floor((u-n)/r*a),a-1)]+=1;const i=Math.max(...l,1);return l.map(u=>u/i)},[s]);return t.length===0?null:e.jsx("div",{className:"cs-sim-hist","aria-hidden":"true",children:t.map((n,o)=>e.jsx("i",{style:{height:`${Math.max(n*100,3)}%`}},o))})}function so({slots:s,roster:t,valued:n,budget:o,pool:r,leagueBands:a,modelBands:l,anchoredRanks:i,auctionSeasons:u,calibration:c,backtest:h,outcomeModel:m,onLoad:d,onClose:x}){const k=i>=6,[w,$]=C.useState(k),[b,R]=C.useState(Math.round(Hs*100)),[f,M]=C.useState(Ks),[D,y]=C.useState(!1),[S,F]=C.useState(0),[E,j]=C.useState(null),[N,g]=C.useState("typical"),P=C.useRef(null),T=C.useRef(1);C.useEffect(()=>{const B=p=>p.key==="Escape"&&x();window.addEventListener("keydown",B);const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",B),document.body.style.overflow=_,P.current&&(P.current.cancelled=!0)}},[x]);const z=C.useCallback(async()=>{P.current&&(P.current.cancelled=!0);const B={cancelled:!1};P.current=B,y(!0),F(0);const _=await vn({slots:s,roster:t,pool:r,budget:o,benchBudget:t.benchBudget,bands:w?a:l,premium:b/100,spreads:w&&(c!=null&&c.measured)?c:null,draws:f,seed:T.current},{onProgress:(p,W)=>F(p/W),signal:B});B.cancelled||(P.current=null,y(!1),j(_))},[s,t,r,o,w,a,l,b,c,f]),I=C.useRef(!1);C.useEffect(()=>{I.current||(I.current=!0,z())},[z]);const O=(E==null?void 0:E.rosters.find(B=>B.kind===N))??null,L=O?Pe(s,O.roster,o,B=>{var _;return((_=n.get(B))==null?void 0:_.fpts)??0}):null,G=E?E.draws-E.infeasible:0;return ts.createPortal(e.jsx("div",{className:"pw-backdrop cs-sim-backdrop",onMouseDown:B=>B.target===B.currentTarget&&x(),children:e.jsxs("div",{className:"cs-sim",role:"dialog","aria-modal":"true","aria-label":"Draft simulator",children:[e.jsx("button",{type:"button",className:"pw-close","aria-label":"Close",onClick:x,children:e.jsx(rs,{size:16})}),e.jsxs("header",{className:"cs-sim-head",children:[e.jsxs("h2",{children:[e.jsx(os,{size:17,"aria-hidden":"true"})," Draft simulator"]}),e.jsxs("p",{children:["Every price gets re-drawn from"," ",w&&k?`what your league has actually paid (${i} positional ranks across ${u} auction season${u===1?"":"s"})`:"a spread around the board's forecast",", then the roster is re-solved. What comes back is the range of teams you can realistically walk away with."]}),w&&(c==null?void 0:c.measured)&&e.jsxs("p",{className:"cs-sim-calibrated",title:`Room heat ±${Math.round(c.roomSpread*100)}%, positional runs ±${Math.round(c.positionSpread*100)}%, player noise ±${Math.round(c.idioSpread*100)}% — measured from your league's own auctions instead of generic defaults.${h?` Checked against your ${h.heldOutSeason} draft (trained only on the ${h.trainedOn} earlier season${h.trainedOn===1?"":"s"}): ${Math.round(h.coverage*100)}% of its real prices fell inside the simulator's 80% band across ${h.checked} players. Near 80% = honest bands; higher = cautious; lower = still too confident.`:""}`,children:[e.jsx(Gt,{size:12,"aria-hidden":"true"})," Risk measured from your"," ",c.seasons," auctions",h&&` · ${Math.round(h.coverage*100)}% of ${h.heldOutSeason}'s prices inside the sim's 80% band`]})]}),e.jsxs("div",{className:"cs-sim-controls",children:[e.jsxs("label",{children:["Prices",e.jsxs("select",{value:w?"league":"model",disabled:D,onChange:B=>$(B.target.value==="league"),children:[e.jsx("option",{value:"league",disabled:!k,children:k?"Your league's history":"Your league's history (needs 2 auctions)"}),e.jsx("option",{value:"model",children:"Model forecast"})]})]}),e.jsxs("label",{title:"What you pay over the going rate to actually win a player. Without it the solver quietly assumes it wins every bid at the typical price.",children:["Bid premium",e.jsxs("span",{className:"cs-sim-pct",children:[e.jsx("input",{type:"number",min:0,max:50,step:5,value:b,disabled:D,onChange:B=>{const _=Number(B.target.value);Number.isFinite(_)&&R(Math.min(Math.max(_,0),50))}}),"%"]})]}),e.jsxs("label",{children:["Drafts",e.jsxs("select",{value:f,disabled:D,onChange:B=>M(Number(B.target.value)),children:[e.jsx("option",{value:50,children:"50"}),e.jsx("option",{value:150,children:"150"}),e.jsx("option",{value:300,children:"300"})]})]}),e.jsx("button",{className:"hof-btn",onClick:()=>{T.current+=1,z()},disabled:D,children:D?`Running… ${Math.round(S*100)}%`:"Re-run"})]}),D&&e.jsx("div",{className:"cs-sim-progress",role:"status","aria-live":"polite",children:e.jsx("i",{style:{width:`${Math.round(S*100)}%`}})}),E&&!D&&G===0&&e.jsxs("p",{className:"cs-sim-empty",role:"status",children:["No legal roster fit the money in any of the ",E.draws," drafts — at these prices the budget can't fill every seat. Drop the bid premium, or free up seats in the rail."]}),E&&!D&&G>0&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"cs-sim-range",children:[e.jsxs("div",{className:"cs-sim-numbers",children:[e.jsxs("span",{children:[e.jsx("i",{children:"floor"}
1),e.jsx("b",{children:Math.round(E.p10).toLocaleString()})]}),e.jsxs("span",{className:"is-mid",children:[e.jsx("i",{children:"typical team"}),e.jsx("b",{children:Math.round(E.p50).toLocaleString()})]}),e.jsxs("span",{children:[e.jsx("i",{children:"best case"}),e.jsx("b",{children:Math.round(E.p90).toLocaleString()})]})]}),e.jsx(at,{points:E.points}),e.jsxs("p",{className:"cs-sim-caption",children:["Projected starter points across ",G," draft",G===1?"":"s",E.infeasible>0&&` · ${E.infeasible} where the budget couldn't fill the roster`]}),e.jsx(it,{model:m,slots:s,roster:(O==null?void 0:O.roster)??null,valued:n})]}),e.jsxs("div",{className:"cs-sim-body",children:[e.jsxs("section",{className:"cs-sim-landing",children:[e.jsx("h3",{children:"Who you actually land"}),e.jsx("p",{className:"cs-sim-sub",children:"Share of drafts this player ends up on your roster, and what he cost when he did. Ordered by how often he holds a starting seat."}),e.jsx("ol",{children:E.landing.slice(0,14).map(B=>{const _=n.get(B.key);return e.jsxs("li",{title:`On your roster in ${Math.round(B.rate*100)}% of drafts, in your starting lineup in ${Math.round(B.starterRate*100)}%`,children:[e.jsx("b",{className:"cs-sim-pos",style:{"--cs-pos":`var(--pos-${((_==null?void 0:_.position)??"other").toLowerCase()})`},children:(_==null?void 0:_.position)??"—"}),e.jsx("span",{className:"cs-sim-name",children:(_==null?void 0:_.name)??B.key}),e.jsxs("span",{className:"cs-sim-rate",children:[e.jsx("i",{style:{width:`${Math.round(B.rate*100)}%`}}),e.jsxs("em",{children:[Math.round(B.rate*100),"%"]})]}),e.jsxs("span",{className:"cs-sim-paid",children:["$",B.medianPaid,B.loPaid!==B.hiPaid&&e.jsxs("i",{children:["$",B.loPaid,"–",B.hiPaid]})]})]},B.key)})})]}),e.jsxs("section",{className:"cs-sim-rosters",children:[e.jsx("h3",{children:"Take one to the draft"}),e.jsx("div",{className:"cs-sim-tabs",role:"group","aria-label":"Which roster",children:E.rosters.map(B=>e.jsxs("button",{"aria-pressed":N===B.kind,className:N===B.kind?"is-active":"",onClick:()=>g(B.kind),children:[B.kind==="floor"?"Bad night":B.kind==="typical"?"Typical":"Best case",e.jsx("i",{children:Math.round(B.points).toLocaleString()})]},B.kind))}),O&&e.jsxs(e.Fragment,{children:[e.jsx("ol",{className:"cs-sim-seats",children:s.map(B=>{const _=O.roster.picks[B.id],p=_?n.get(_.key):null;return e.jsxs("li",{className:B.starter?"":"is-bench",children:[e.jsx("b",{children:B.label}),e.jsx("span",{children:(p==null?void 0:p.name)??"—"}),e.jsxs("em",{children:["$",(_==null?void 0:_.price)??0]})]},B.id)})}),e.jsxs("button",{className:"hof-btn cs-sim-load",onClick:()=>d(O.roster),children:["Load this roster · $",(L==null?void 0:L.spent)??0," of $",o]})]})]})]}),e.jsxs("p",{className:"cs-sim-foot",children:[E.leagueBands>0?`${E.leagueBands} of ${E.totalBands} players priced from your league's own auction history; the rest from the board's forecast. `:"","Seats you've already filled stay locked at what you paid, and crossed-off players never appear."]})]})]})}),document.body)}const to=["ALL","QB","RB","WR","TE","K","DEF"];function Qe(s,t){const n=Math.ceil(s/t),o=(s-1)%t+1;return`${n}.${String(o).padStart(2,"0")}`}function no({slots:s,pool:t,teams:n,seat:o,tendencies:r,leagueWeight:a,valued:l,session:i,onSession:u,seedRef:c,onLoad:h,onOpenSim:m,onClose:d}){const[x,k]=C.useState("ALL"),[w,$]=C.useState(null),[b,R]=C.useState(o),f=C.useCallback(g=>{c.current+=1,u({state:Fn({slots:s,pool:t,teams:n,seat:g,tendencies:r,leagueWeight:a,seed:c.current}),prev:null}),$(null),We("mock_draft_started",{teams:n,seat:g})},[s,t,n,r,a,u,c]);C.useEffect(()=>{i||f(o)},[]),C.useEffect(()=>{const g=T=>T.key==="Escape"&&d();window.addEventListener("keydown",g);const P=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",g),document.body.style.overflow=P}},[d]);const M=(i==null?void 0:i.state)??null,D=C.useMemo(()=>M?cs(M):[],[M]),y=C.useMemo(()=>M?Ln(M,24,x==="ALL"?void 0:x):[],[M,x]),S=g=>{var P;return((P=l.get(g))==null?void 0:P.name)??g},F=g=>{if(!M)return;const P=st(M,g);if(P===M){$(`No open seat for ${S(g)} — his position is full on your roster.`);return}$(null),u({state:P,prev:M})},E=C.useMemo(()=>
1{if(!(M!=null&&M.done))return null;const g=Array.from({length:M.teams},(P,T)=>({seat:T+1,points:On(M,T+1)})).sort((P,T)=>T.points-P.points);return{rows:g,myRank:g.findIndex(P=>P.seat===M.seat)+1,mine:g.find(P=>P.seat===M.seat)}},[M]);if(!M)return null;const j=M.rosters[M.seat-1],N=[...M.log].slice(-10).reverse();return ts.createPortal(e.jsx("div",{className:"pw-backdrop cs-sim-backdrop",onMouseDown:g=>g.target===g.currentTarget&&d(),children:e.jsxs("div",{className:"cs-sim cs-mock",role:"dialog","aria-modal":"true","aria-label":"Mock draft room",children:[e.jsx("button",{type:"button",className:"pw-close","aria-label":"Close",onClick:d,children:e.jsx(rs,{size:16})}),e.jsxs("header",{className:"cs-sim-head",children:[e.jsxs("h2",{children:[e.jsx(ns,{size:17,"aria-hidden":"true"})," Mock draft room"]}),e.jsxs("p",{children:["One full draft against bots that pick the way"," ",r&&r.seasons>=2?"your league actually drafts":"the market drafts",". Closing pauses the room; Restart deals a new draft."]})]}),e.jsxs("div",{className:"cs-sim-controls cs-mock-controls",children:[e.jsx("span",{className:"cs-mock-status",children:M.done?e.jsx("b",{children:"Draft complete"}):e.jsxs(e.Fragment,{children:[e.jsxs("b",{children:["Pick ",Qe(M.cursor,M.teams)]})," · you're on the clock"]})}),e.jsxs("label",{children:["Seat",e.jsx("input",{type:"number",min:1,max:n,value:b,onChange:g=>{const P=Math.min(Math.max(Math.round(Number(g.target.value)||1),1),n);R(P)}})]}),e.jsxs("button",{className:"hof-btn",onClick:()=>f(b),children:[e.jsx(Fe,{size:12,"aria-hidden":"true"})," Restart"]}),!M.done&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"hof-btn",onClick:()=>{const g=tt(M);g!==M&&u({state:g,prev:M})},children:"Auto-pick"}),e.jsx("button",{className:"hof-btn",onClick:()=>{const g=Bn(M);g!==M&&u({state:g,prev:M}),We("mock_draft_autofinished",{teams:n})},children:"Auto-finish"})]}),(i==null?void 0:i.prev)&&e.jsx("button",{className:"hof-link-btn",onClick:()=>u({state:i.prev,prev:null}),children:"undo"})]}),w&&e.jsx("p",{className:"cs-mock-note",children:w}),!M.done&&e.jsxs("div",{className:"cs-mock-body",children:[e.jsxs("div",{className:"cs-mock-main",children:[e.jsxs("section",{children:[e.jsx("h3",{children:"The clock says"}),e.jsxs("p",{className:"cs-sim-sub",children:["Best available at each position versus what likely survives to your next pick",Ze(M)!=null?` (${Qe(Ze(M),M.teams)})`:"",". The drop-off is what waiting costs."]}),e.jsx("ol",{className:"cs-mock-recs",children:D.slice(0,4).map(g=>{const P=l.get(g.key);return e.jsxs("li",{className:g.top?"is-top":"",children:[e.jsx("b",{className:"cs-ovr-pos",style:{"--cs-pos":`var(--pos-${g.position.toLowerCase()})`},children:g.position}),e.jsxs("span",{className:"cs-mock-rec-name",children:[g.top&&e.jsx("em",{children:"best pick"}),S(g.key)]}),e.jsxs("span",{className:"cs-mock-rec-meta",children:[g.dropoff>.5?`−${Math.round(g.dropoff)} if you wait`:"safe to wait",g.survivalOdds!=null&&` · ${Math.round(g.survivalOdds*100)}% there next turn`,P?` · T${P.tier}`:""]}),e.jsx("button",{className:"hof-btn cs-mock-take",onClick:()=>F(g.key),children:"Draft"})]},g.key)})})]}),e.jsxs("section",{children:[e.jsx("div",{className:"cs-mock-filter",role:"group","aria-label":"Position filter",children:to.map(g=>e.jsx("button",{"aria-pressed":x===g,className:x===g?"is-active":"",onClick:()=>k(g),children:g==="ALL"?"All":g},g))}),e.jsx("ol",{className:"cs-mock-board",children:y.map(g=>e.jsxs("li",{children:[e.jsx("b",{className:"cs-ovr-pos",style:{"--cs-pos":`var(--pos-${g.position.toLowerCase()})`},children:g.position}),e.jsxs("span",{className:"cs-mock-row-name",children:[S(g.key),e.jsx("i",{children:g.adp!=null?` ADP ${Math.round(g.adp)}`:""})]}),e.jsx("button",{className:"hof-link-btn",onClick:()=>F(g.key),children:"draft"})]},g.key))})]})]}),e.jsxs("aside",{className:"cs-mock-side",children:[e.jsx("h3",{children:"Your roster"}),e.jsx("ul",{className:"cs-mock-roster",children:s.map(g=>{const P=j.picks[g.id];return e.jsxs("li",{className:P?"is-filled":"",children:[e.jsx("b",{children:g.label}),e.jsx("span",{children:P?S(P.key):"—"})]},g.id)})}),e.jsx("h3",{children:"Draft so far"}),e.jsx("ul",{className:"cs-mock-log",children:N.map(g=>e.jsxs("li",{className:g.mine?"is-mine":"",children:[e.jsx("b",{children:Qe(g.overall,M.teams)}),e.jsx("i",{children:g.mine?"you":`T${g.team}`}),e.jsx("span",{children:S(g.key)})]},g.overall))})]})]}),M.done&&E&&e.jsxs("div",{className:"cs-mock-recap",children:[e.jsxs("div",{className:"cs-sim-numbers",children:[e.jsxs("span",{className:"is-mid",children:[e.jsx("i",{children:"your projected starters"}
1),e.jsx("b",{children:Math.round(E.mine.points).toLocaleString()})]}),e.jsxs("span",{children:[e.jsx("i",{children:"room rank"}),e.jsxs("b",{children:[E.myRank," of ",M.teams]})]}),e.jsxs("span",{children:[e.jsx("i",{children:"best in room"}),e.jsx("b",{children:Math.round(E.rows[0].points).toLocaleString()})]})]}),e.jsx("ul",{className:"cs-mock-roster is-recap",children:s.map(g=>{const P=j.picks[g.id];return e.jsxs("li",{className:P?"is-filled":"",children:[e.jsx("b",{children:g.label}),e.jsx("span",{children:P?S(P.key):"—"})]},g.id)})}),e.jsxs("div",{className:"cs-sim-load",children:[e.jsx("button",{className:"hof-btn",onClick:()=>{h(j),We("mock_draft_loaded",{teams:n})},children:"Load this roster into the rail"}),e.jsxs("button",{className:"hof-btn",onClick:()=>f(b),children:[e.jsx(Fe,{size:12,"aria-hidden":"true"})," Draft again"]}),e.jsx("button",{className:"hof-link-btn",onClick:m,title:"The simulator plays this room 150 times and reports who you actually land, per pick",children:"Run this room 150× →"})]})]})]})}),document.body)}function oo({slots:s,roster:t,valued:n,pool:o,teams:r,seat:a,startPick:l,tendencies:i,outcomeModel:u,onLoad:c,onClose:h}){const m=((i==null?void 0:i.seasons)??0)>=2,[d,x]=C.useState(m?100:0),[k,w]=C.useState(Gs),[$,b]=C.useState(a),[R,f]=C.useState(!1),[M,D]=C.useState(0),[y,S]=C.useState(null),[F,E]=C.useState("typical"),j=C.useRef(null),N=C.useRef(1);C.useEffect(()=>{const I=L=>L.key==="Escape"&&h();window.addEventListener("keydown",I);const O=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",I),document.body.style.overflow=O,j.current&&(j.current.cancelled=!0)}},[h]);const g=C.useCallback(async()=>{j.current&&(j.current.cancelled=!0);const I={cancelled:!1};j.current=I,f(!0),D(0);const O=await Tn({slots:s,roster:t,pool:o,teams:r,seat:$,startPick:l,tendencies:i,leagueWeight:d/100,draws:k,seed:N.current},{onProgress:(L,G)=>D(L/G),signal:I});I.cancelled||(j.current=null,f(!1),S(O))},[s,t,o,r,$,l,i,d,k]),P=C.useRef(!1);C.useEffect(()=>{P.current||(P.current=!0,g())},[g]);const T=(y==null?void 0:y.rosters.find(I=>I.kind===F))??null,z=Object.entries((i==null?void 0:i.byPosition)??{}).filter(([,I])=>Math.abs(I.biasRounds)>=.35).sort((I,O)=>Math.abs(O[1].biasRounds)-Math.abs(I[1].biasRounds));return ts.createPortal(e.jsx("div",{className:"pw-backdrop cs-sim-backdrop",onMouseDown:I=>I.target===I.currentTarget&&h(),children:e.jsxs("div",{className:"cs-sim",role:"dialog","aria-modal":"true","aria-label":"Draft simulator",children:[e.jsx("button",{type:"button",className:"pw-close","aria-label":"Close",onClick:h,children:e.jsx(rs,{size:16})}),e.jsxs("header",{className:"cs-sim-head",children:[e.jsxs("h2",{children:[e.jsx(os,{size:17,"aria-hidden":"true"})," Draft simulator"]}),e.jsxs("p",{children:["The room drafts ",k," times from seat ",$,". Every player's slot is drawn from market ADP, shifted by a run at his position and by how your league has actually drafted — so you find out who really reaches you, not who theoretically should."]})]}),m&&z.length>0&&e.jsxs("section",{className:"cs-habits",children:[e.jsxs("h3",{children:["How your league drafts",e.jsxs("i",{children:[i.seasons," season",i.seasons===1?"":"s"," ·"," ",i.samples," picks vs the market"]})]}),e.jsx("ul",{children:z.map(([I,O])=>e.jsxs("li",{children:[e.jsx("b",{className:"cs-sim-pos",style:{"--cs-pos":`var(--pos-${I.toLowerCase()})`},children:I}),e.jsxs("span",{className:O.biasRounds>0?"is-early":"is-late",children:[O.biasRounds>0?"▲":"▼"," ",Math.abs(O.biasRounds).toFixed(1)," rd"]}),e.jsx("i",{children:O.biasRounds>0?"earlier than market":"later than market"})]},I))}),i.scatterRounds>=1.5&&e.jsxs("p",{className:"cs-sim-sub",children:["This room drifts ",i.scatterRounds.toFixed(1)," rounds from ADP on average — a loose board, so treat the odds below as rough."]})]}),e.jsxs("div",{className:"cs-sim-controls",children:[e.jsxs("label",{children:["Seat",e.jsx("input",{type:"number",min:1,max:r,value:$,disabled:R,onChange:I=>{const O=Number(I.target.value);Number.isFinite(O)&&b(Math.min(Math.max(Math.round(O),1),r))}})]}),e.jsxs("label",{title:m?"How much to trust your league's own drafting habits over plain market ADP.":"Needs two past drafts before your league's habits mean anything.",children:["League habits",e.jsxs("span",{className:"cs-sim-pct",children:[e.jsx("input",{type:"number",min:0,max:100,step:10,value:d,disabled:R||!m,onCh
1ange:I=>{const O=Number(I.target.value);Number.isFinite(O)&&x(Math.min(Math.max(O,0),100))}}),"%"]})]}),e.jsxs("label",{children:["Drafts",e.jsxs("select",{value:k,disabled:R,onChange:I=>w(Number(I.target.value)),children:[e.jsx("option",{value:50,children:"50"}),e.jsx("option",{value:150,children:"150"}),e.jsx("option",{value:300,children:"300"})]})]}),e.jsx("button",{className:"hof-btn",onClick:()=>{N.current+=1,g()},disabled:R,children:R?`Running… ${Math.round(M*100)}%`:"Re-run"})]}),R&&e.jsx("div",{className:"cs-sim-progress",role:"status","aria-live":"polite",children:e.jsx("i",{style:{width:`${Math.round(M*100)}%`}})}),y&&!R&&y.points.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"cs-sim-range",children:[e.jsxs("div",{className:"cs-sim-numbers",children:[e.jsxs("span",{children:[e.jsx("i",{children:"floor"}),e.jsx("b",{children:Math.round(y.p10).toLocaleString()})]}),e.jsxs("span",{className:"is-mid",children:[e.jsx("i",{children:"typical team"}),e.jsx("b",{children:Math.round(y.p50).toLocaleString()})]}),e.jsxs("span",{children:[e.jsx("i",{children:"best case"}),e.jsx("b",{children:Math.round(y.p90).toLocaleString()})]})]}),e.jsx(at,{points:y.points}),e.jsxs("p",{className:"cs-sim-caption",children:["Projected starter points across ",y.points.length," drafts from pick ",y.myPicks[0]]}),e.jsx(it,{model:u,slots:s,roster:(T==null?void 0:T.roster)??null,valued:n})]}),e.jsxs("div",{className:"cs-sim-body",children:[e.jsxs("section",{className:"cs-sim-landing",children:[e.jsx("h3",{children:"Who's there when you pick"}),e.jsx("p",{className:"cs-sim-sub",children:"For each of your picks: how often each player is still on the board, and how often you end up taking him."}),e.jsx("ol",{className:"cs-targets",children:y.targets.slice(0,7).map(I=>e.jsxs("li",{children:[e.jsxs("b",{className:"cs-target-pick",children:[I.round,".",String((I.overallPick-1)%r+1).padStart(2,"0")]}),e.jsx("span",{className:"cs-target-list",children:I.players.slice(0,4).map(O=>{var L;return e.jsxs("em",{className:O.availability>=.7?"is-safe":"",title:`Taken here in ${Math.round(O.takenRate*100)}% of drafts`,children:[((L=n.get(O.key))==null?void 0:L.name)??O.key,e.jsxs("i",{children:[Math.round(O.availability*100),"%"]})]},O.key)})})]},I.overallPick))})]}),e.jsxs("section",{className:"cs-sim-rosters",children:[e.jsx("h3",{children:"Take one to the draft"}),e.jsx("div",{className:"cs-sim-tabs",role:"group","aria-label":"Which roster",children:y.rosters.map(I=>e.jsxs("button",{"aria-pressed":F===I.kind,className:F===I.kind?"is-active":"",onClick:()=>E(I.kind),children:[I.kind==="floor"?"Bad night":I.kind==="typical"?"Typical":"Best case",e.jsx("i",{children:Math.round(I.points).toLocaleString()})]},I.kind))}),T&&e.jsxs(e.Fragment,{children:[e.jsx("ol",{className:"cs-sim-seats",children:s.map(I=>{const O=T.roster.picks[I.id],L=O?n.get(O.key):null;return e.jsxs("li",{className:I.starter?"":"is-bench",children:[e.jsx("b",{children:I.label}),e.jsx("span",{children:(L==null?void 0:L.name)??"—"})]},I.id)})}),e.jsx("button",{className:"hof-btn cs-sim-load",onClick:()=>c(T.roster),children:"Load this roster"})]})]})]}),e.jsx("p",{className:"cs-sim-foot",children:"Assumes a plain serpentine with no third-round reversal. Players you've already added stay yours, and crossed-off players never appear."})]})]})}),document.body)}function ro({result:s,mode:t,live:n,crossoff:o,playerMeta:r,teams:a,inflationDetail:l,rosteredKeys:i,onToggleRoster:u}){const[c,h]=C.useState(!1),m=C.useMemo(()=>{const k=Kt(s,t==="auction"?"price":"vbd",100);if(t==="auction"&&l){const w=$=>{const b=o.taken[$.key];return b!==void 0?b??$.price:l.adjustedPrice($)};return[...k].sort(($,b)=>w(b)-w($))}return k},[s,t,n,l,o]),d=n?m.findIndex(k=>o.taken[k.key]===void 0):-1,x=d>=0?m[d].key:null;return e.jsxs("section",{className:`hjb-card cs-card cs-overall${c?" is-expanded":""}`,children:[e.jsxs("header",{className:"cs-col-head",children:[e.jsx("h2",{children:"Overall board"}),e.jsx("span",{className:"cs-col-meta",children:"best available across every position"}),e.jsx("button",{className:"hof-link-btn cs-showmore","aria-expanded":c,onClick:()=>h(k=>!k),children:c?"top 40":"top 100"})]}),e.jsx("ol",{className:`cs-ovr-list${u?" has-add":""}`,children:m.map((k,w)=>
1{const $=r.get(k.key),b=o.taken[k.key],R=b!==void 0,f=($==null?void 0:$.adp)??($==null?void 0:$.sleeperAdp)??null,M=Bs(f,a),D=R?b??k.price:l?l.adjustedPrice(k):k.price,y=!c&&w>=40&&w!==d;return e.jsxs("li",{className:[R?"is-taken":"",n&&k.key===x?"is-best":"",y?"cs-ovr-overflow":""].filter(Boolean).join(" "),children:[e.jsx("span",{className:"cs-ovr-rank",children:w+1}),e.jsx("b",{className:"cs-ovr-pos",style:{"--cs-pos":`var(--pos-${k.position.toLowerCase()})`},children:k.position}),e.jsxs("span",{className:"cs-ovr-name",children:[n&&k.key===x&&e.jsx("em",{className:"cs-ovr-star",title:"Best player available",children:"★"}),k.name,e.jsx(ds,{status:$==null?void 0:$.injuryStatus,bodyPart:$==null?void 0:$.injuryBodyPart}),e.jsx("i",{children:($==null?void 0:$.team)??""})]}),e.jsx("span",{className:"cs-ovr-val",children:t==="auction"?`$${Math.max(Math.round(D),k.status==="undrafted"?0:1)}`:M!=null?`R${M}`:"—"}),u&&e.jsx(lt,{player:k,onToggle:u,seated:(i==null?void 0:i.has(k.key))??!1})]},k.key)})})]})}function it({model:s,slots:t,roster:n,valued:o}){const r=C.useMemo(()=>!s||!n?null:pn(s,t,n,a=>{const l=o.get(a);return l?{position:l.position,posRank:l.posRank}:null}),[s,t,n,o]);return r?e.jsxs("p",{className:"cs-sim-outcome",title:`Across your league's last ${s.seasons} completed seasons, players drafted at each of this lineup's positional ranks went on to score these totals — busts, breakouts and all. The range is p10–p90 of that history applied to this roster's starting seats (${r.seatsCovered} of ${r.seatsTotal} priced). Projections don't carry that risk, which is why this range sits wider and usually lower.`,children:["History check: lineups drafted from these slots really scored"," ",e.jsxs("b",{children:[Math.round(r.p10).toLocaleString(),"–",Math.round(r.p90).toLocaleString()]})," ","(typical ",Math.round(r.mu).toLocaleString(),") over your last"," ",s.seasons," seasons."]}):null}function ss({value:s,onCommit:t,label:n}){const[o,r]=C.useState(String(s));C.useEffect(()=>r(String(s)),[s]);const a=()=>{const l=Number(o);o.trim()!==""&&Number.isFinite(l)&&l>=1?t(Math.round(l)):r(String(s))};return e.jsx("input",{className:"cs-paid",type:"number",min:1,value:o,onClick:l=>l.stopPropagation(),onChange:l=>r(l.target.value),onBlur:a,onKeyDown:l=>{l.key==="Enter"&&l.target.blur()},"aria-label":n})}function lt({player:s,seated:t,onToggle:n}){return e.jsx("button",{className:`cs-add${t?" is-on":""}`,"aria-pressed":t,onClick:o=>{o.stopPropagation(),n(s)},title:t?`Drop ${s.name} from your lineup`:`Add ${s.name} to your lineup`,"aria-label":t?`Drop ${s.name} from your lineup`:`Add ${s.name} to your lineup`,children:t?"✓":"+"})}function Fs({pos:s,players:t,result:n,mode:o,live:r,inflationDetail:a,scarcity:l,liveTiers:i,marketEdge:u,clock:c,crossoff:h,onCrossoff:m,playerMeta:d,teams:x,anchors:k,rosteredKeys:w,onToggleRoster:$}){const[b,R]=C.useState(!1),f=s!=="K"&&s!=="DEF",M=f?n.starters[s]:null,D=f?Math.round(n.rostered[s]):null,y=f?(k==null?void 0:k[s])??null:null,S=f?Math.min(Cs[s],40,Math.max(16,(D??0)+4)):10,F=t.slice(0,r?t.length:Cs[s]),E=b?F.length:Math.min(S,F.length),j=r?F.findIndex(L=>h.taken[L.key]===void 0):-1,N=r?F.filter((L,G)=>G>=E&&G!==j&&h.taken[L.key]===void 0).length:F.length-E,g=f&&a?a.byPosition[s]:null,P=new Map((i??[]).map(L=>[L.tier,L])),T=L=>a?a.adjustedPrice(L):L.price,z=L=>{m(G=>{const B={...G.taken};return B[L.key]!==void 0?delete B[L.key]:B[L.key]=r&&o==="auction"?Math.max(Math.round(T(L)),1):null,{...G,taken:B}})},I=(L,G)=>{m(B=>({...B,taken:{...B.taken,[L.key]:G}}))};let O=0;return e.jsxs("section",{className:"hjb-card cs-card cs-col",style:{"--cs-pos":`var(--pos-${s.toLowerCase()})`},children:[e.jsxs("header",{className:"cs-col-head",children:[e.jsx("h2",{children:s}),f?e.jsxs("span",{className:"cs-col-meta",children:[M," start · ",D," rostered"]}):e.jsx("span",{className:"cs-col-meta",children:"$1 tier"}),r&&o==="auction"&&g!=null&&g!==1&&e.jsxs("span",{className:`cs-pos-inflation${g>1.02?" is-hot":g<.98?" is-cold":""}`,title:`This room pays ${g>1?"over":"under"} list for ${s}s`,children:["×",g.toFixed(2)]}),r&&l!=null&&e.jsxs("span",{className:`cs-scarcity${l<.35?" is-dry":""}`,title:"Share of this position's value still on the board",children:[e.jsx("i",{style:{width:`${Math.round(l*100)}%`}}),e.jsxs("b",{children:[Math.round(l*100),"%"]})]})]}),e.jsx("ol",{className:`cs-rows${$?" has-add":""}`,children:F.map((L,G)=>{var oe,fe;const B=h.taken[L.key],_=B!==void 0,p=d.get(L.key),W=(p==null?void 0:p.adp)??(p==null?void 0:p.sleeperAdp)??null,ee=Bs(W,x),q=p?zt({adp:p.adp,adpHigh:p.adpHigh,adpLow:p.adpLow,stdev:p.stdev},x):null,U=(u==null?void 0:u.get(L.key))??null,V=L.tier!==O;O=L.tier;const te=V?P.get(L.tier):void 0,ie=o==="auction",le=Math.max(Math.round(_?B??L.price:T(L)),L.status==="undrafted"?0:1),Q=!_&&c!=null&&W!=null&&W<=c.nextMine,X=!_&&!Q&&c!=null&&W!=null&&(p==null?void 0:p.adpHigh)!=null&&p.adpHigh<=c.nextMine,Y=c!=null&&W!=null&&!_?Te(W,(p==null?void 0:p.stdev)??null,(p==null?void 0:p.adpHigh)??null,(p==null?void 0:p.adpLow)??null,c.nextMine):null,re=Y!=null&&Y>.15&&Y<.85;return e.jsxs("li",{className:[V?"is-tier-break":"",_?"is-taken":"",L.status==="starter"?"is-starter":"",Q?"is-gone":"",G>
1=E&&!(r&&G===j)?"cs-overflow":""].filter(Boolean).join(" "),"data-tier":L.tier,children:[V&&e.jsxs("span",{className:"cs-tier-chip",children:["T",L.tier,r&&te&&te.total>=2&&e.jsxs("b",{className:te.cliff?"is-cliff":"",children:[" ","· ",te.remaining," left"]})]}),e.jsx("span",{className:"cs-rank",children:L.posRank}),e.jsxs("span",{className:"cs-name",children:[L.name,e.jsx(ds,{status:p==null?void 0:p.injuryStatus,bodyPart:p==null?void 0:p.injuryBodyPart}),e.jsxs("i",{children:[(p==null?void 0:p.team)??"",p!=null&&p.bye?` · ${p.bye}`:""]}),(U==null?void 0:U.verdict)&&e.jsxs("em",{className:`cs-edge is-${U.verdict}${U.confident?"":" is-soft"}`,title:`Model: #${U.valueRank} by value · Market: #${U.marketRank} by ADP${U.confident?"":" (thin or disagreeing market data)"}`,children:[U.verdict==="target"?"▲":"▼",Math.abs(U.edgeRounds)>=1?`${U.edgeRounds>0?"+":"−"}${Math.abs(U.edgeRounds).toFixed(1)}R`:""]}),(U==null?void 0:U.disagreementRounds)!=null&&U.disagreementRounds>=1.25&&e.jsx("em",{className:"cs-edge is-contested",title:`Boards disagree by ${U.disagreementRounds.toFixed(1)} rounds (FFC ${((oe=p==null?void 0:p.adp)==null?void 0:oe.toFixed(1))??"—"} vs Sleeper ${((fe=p==null?void 0:p.sleeperAdp)==null?void 0:fe.toFixed(1))??"—"})`,children:"⇄"}),X&&e.jsx("em",{className:"cs-edge is-risk",title:`Has gone as early as pick ${p==null?void 0:p.adpHigh} — may not last to your ${c==null?void 0:c.nextMine}`,children:"⏳"})]}),o==="snake"&&(q!=null||ee!=null)&&e.jsxs("span",{className:`cs-round${((q==null?void 0:q.volatility)??0)>=1?" is-volatile":""}`,title:q?`ADP ${W==null?void 0:W.toFixed(1)} · market range picks ${(p==null?void 0:p.adpHigh)??"?"}–${(p==null?void 0:p.adpLow)??"?"}`:`ADP ${W==null?void 0:W.toFixed(1)}`,children:[q&&q.lo!==q.hi?`R${q.lo}–${q.hi}`:`R${ee}`,re?` · ${Math.round(Y*100)}%`:""]}),(()=>{const Z=ie?y==null?void 0:y[L.posRank-1]:void 0,ue=Z&&Z.samples>=2,de=ue?Z.median-le:0,je=ue&&Math.abs(de)>=Math.max(4,le*.25);return e.jsxs("span",{className:"cs-val",title:ue?`Your league has paid $${Z.lo}–$${Z.hi} for the ${s}${L.posRank} (median $${Z.median}, ${Z.samples} auctions)`:void 0,children:[ie?`$${le}`:Math.round(L.avgVbd)>0?Math.round(L.avgVbd):"–",je&&e.jsxs("i",{className:`cs-lg-hint${de>0?" is-under":" is-over"}`,children:["lg $",Z.lo===Z.hi?Z.median:`${Z.lo}–${Z.hi}`]})]})})(),$&&e.jsx(lt,{player:L,onToggle:$,seated:(w==null?void 0:w.has(L.key))??!1}),!r&&e.jsx("button",{className:`cs-cross cs-keep${_?" is-kept":""}`,onClick:()=>z(L),title:_?"Put him back on the board":"Mark as kept — off the board before the draft starts","aria-label":_?`Restore ${L.name}`:`Mark ${L.name} as kept`,children:_?"↺":"⊘"}),r&&(_&&o==="auction"?e.jsxs(e.Fragment,{children:[e.jsx(ss,{value:B??le,onCommit:Z=>I(L,Z),label:`Price paid for ${L.name}`}),e.jsxs("span",{className:"cs-paid-print",children:["paid $",B??le]})]}):e.jsx("button",{className:"cs-cross",onClick:()=>z(L),"aria-label":_?`Restore ${L.name}`:`Cross off ${L.name}`,children:_?"↺":"✕"})),r&&_&&o==="auction"&&e.jsx("button",{className:"cs-cross",onClick:()=>z(L),"aria-label":`Restore ${L.name}`,children:"↺"})]},L.key)})}),(N>0||b)&&e.jsx("button",{className:"hof-link-btn cs-showmore","aria-expanded":b,onClick:()=>R(L=>!L),children:b?"Show fewer":`Show ${N} more`})]})}function Ee(s){return s.length===0?null:s.reduce((t,n)=>t+n,0)/s.length}function ao({data:s,mode:t}){const n=["QB","RB","WR","TE"],o=s.history.drafts,r=n.map(a=>{var $;const l=o.flatMap(b=>{var f;const R=(f=b.byPosition[a])==null?void 0:f[0];return R?[{...R,season:b.season}]:[]}),i=Ee(l.map(b=>b.pick)),u=o.filter(b=>b.isAuction).map(b=>{var R,f;return((f=(R=b.byPosition[a])==null?void 0:R[0])==null?void 0:f.cost)??null}).filter(b=>b!=null&&b>0),c=Object.entries(s.history.market[a]??{}).filter(([b])=>b!==s.season).map(([,b])=>b),h=Ee(c.map(b=>b[0]).filter(b=>b!=null)),m=Ee(c.map(b=>b[2]).filter(b=>b!=null)),x=Object.keys(s.history.pointsByPosRank[a]??{}).sort((b,R)=>R.localeCompare(b))[0]??null,k=x?($=s.history.pointsByPosRank[a])==null?void 0:$[x]:null,w=Math.min(11,((k==null?void 0:k.length)??0)-1);return{pos:a,firstAvg:i,lastFirst:l[0]??null,topCost:Ee(u),p1:h,p3:m,ptsYear:x,anchorRank:w+1,anchorPts:k&&w>=0?k[w]:null}});return e.jsxs("section",{className:"hjb-card cs-card cs-history",children:[e.jsx("header",{className:"cs-col-head",children:e.jsxs("h2",{children:[e.jsx(Os,{size:14,"aria-hidden":"true"})," Your league's history"]})}
1),o.length===0?e.jsx("p",{className:"cs-history-empty",children:"No drafted seasons imported yet — market history only."}):null,e.jsx("ul",{className:"cs-history-list",children:r.map(a=>e.jsxs("li",{children:[e.jsx("b",{className:"cs-history-pos",children:a.pos}),e.jsxs("span",{children:[a.lastFirst&&e.jsxs(e.Fragment,{children:["First off the board in ",a.lastFirst.season,":"," ",e.jsxs("b",{children:[a.lastFirst.player,t==="auction"&&a.lastFirst.cost?` ($${a.lastFirst.cost})`:` (pick ${a.lastFirst.pick})`]}),a.firstAvg!=null&&` · avg first pick ${a.firstAvg.toFixed(1)}`,"."," "]}),a.p1!=null&&e.jsxs(e.Fragment,{children:["Market: ",a.pos,"1 goes ~",a.p1.toFixed(1),a.p3!=null&&`, ${a.pos}3 ~${a.p3.toFixed(1)}`," (3-yr ADP)."," "]}),t==="auction"&&a.topCost!=null&&e.jsxs(e.Fragment,{children:["Top ",a.pos," ticket averages ",e.jsxs("b",{children:["$",Math.round(a.topCost)]}),"."," "]}),a.anchorPts!=null&&e.jsxs(e.Fragment,{children:[a.pos,a.anchorRank," scored ",e.jsx("b",{children:Math.round(a.anchorPts)})," pts in your scoring in ",a.ptsYear,"."]})]})]},a.pos))})]})}export{ko as CheatSheet};

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.