1import{u as j,r as x,j as s,D as k,L as y,a as L}from"./index-DqG18D8o.js";import{a as U,v as A,c as C}from"./bestBowlResearch-TRlFA4sb.js";import{a as f}from"./CfbResearchExplorerPage-xMEAMjI4.js";import{T as B}from"./SportWorkspaceRoutes-Dfi7zEok.js";const S="best-puck-research-v1",d=["2025-26","2024-25","2023-24","2021-22"],h={"2025-26":{label:"2025â26",availableRounds:[1,2,3,4],usernames:!0,rosterPoints:!0,rosterSize:16,publicUsernameCount:2847,podLuck:!0,sourceUrl:"https://underdognetwork.com/other/underdog-fantasy-nhl-best-puck-pick-by-pick-data-2025-26"},"2024-25":{label:"2024â25",availableRounds:[1,2,3,4],usernames:!0,rosterPoints:!0,rosterSize:16,publicUsernameCount:2244,podLuck:!0,sourceUrl:"https://underdognetwork.com/other/underdog-fantasy-nhl-best-puck-pick-by-pick-data"},"2023-24":{label:"2023â24",availableRounds:[1,2,3,4],usernames:!0,rosterPoints:!0,rosterSize:16,publicUsernameCount:2309,podLuck:!0,sourceUrl:"https://underdognetwork.com/other/underdog-fantasy-nhl-best-puck-pick-by-pick-data"},"2021-22":{label:"2021â22 · Best Puck II",availableRounds:[1,2,3,4],usernames:!1,rosterPoints:!0,rosterSize:16,publicUsernameCount:0,podLuck:!0,sourceUrl:"https://underdognetwork.com/other/downloadable-pick-by-pick-data-from-the-best-puck-ii-hockey"}};function b(a){return d.some(t=>t===a)}function E(a,t=fetch,e){return v(a,"-overview",t,e)}function Q(a,t=fetch,e){return v(a,"",t,e)}async function v(a,t,e,r){if(!b(a))throw new Error("Unsupported Best Puck research season.");const o=await U(`/data/research/best-puck-${a}${t}.json`,S,`Best Puck ${a}`,e,r),i=z(o,a);if(i.length)throw new Error(`Invalid Best Puck research: ${i.join(" ")}`);return o}function z(a,t){var n,u,l;const e=A(a,S);if(e.length)return e;const r=a,o=String(r.source.season);if(!b(o)||t&&o!==t)return["Research source season does not match the requested season."];const i=h[o];return C(a)&&e.push("Research contains a private identity field."),(r.source.publisher!=="Underdog Network"||r.source.url!==i.sourceUrl)&&e.push("Research source does not match the official NHL source."),r.source.files!==void 0&&(!Array.isArray(r.source.files)||!r.source.files.length||!r.source.files.every($))&&e.push("Research source files are invalid."),r.source.notes!==void 0&&(!Array.isArray(r.source.notes)||r.source.notes.some(c=>typeof c!="string"||!c.trim()))&&e.push("Research source notes are invalid."),(JSON.stringify((n=r.coverage)==null?void 0:n.availableRounds)!==JSON.stringify(i.availableRounds)||((u=r.coverage)==null?void 0:u.usernames)!==i.usernames||((l=r.coverage)==null?void 0:l.rosterPoints)!==i.rosterPoints)&&e.push("Research coverage does not match the verified NHL season."),(JSON.stringify(r.stages.map(c=>c.round))!==JSON.stringify(i.availableRounds)||r.source.rounds.some(c=>c.picks!==c.entries*i.rosterSize))&&e.push("Research round or roster-size contract is invalid."),r.players.some(c=>!["C","W","D","G"].includes(c.position))&&e.push("Historical NHL positions must use C, W, D, and G."),r.podLuck!==void 0&&!T(r.podLuck,r.stages)&&e.push("Research pod calibration is invalid."),e}function T(a,t){return!a||typeof a.methodology!="string"||!a.methodology.trim()||!Array.isArray(a.rounds)||JSON.stringify(a.rounds.map(e=>e==null?void 0:e.round))!=="[1,2,3]"?!1:a.rounds.every(e=>{var r,o;return!e||![e.entries,e.pods,e.podSize,e.qualificationSlots,e.wildcards,e.actualPodQualifications].every(i=>Number.isInteger(i)&&i>=0)||!Number.isFinite(e.expectedPodQualifications)||e.pods<1||e.podSize<2||e.qualificationSlots<1||e.qualificationSlots>=e.podSize?!1:e.entries===((r=t.find(i=>i.round===e.round))==null?void 0:r.entries)&&e.entries===e.pods*e.podSize&&e.actualPodQualifications===e.pods*e.qualificationSlots&&Math.abs(e.expectedPodQualifications-e.actualPodQualifications)<=.001&&e.actualPodQualifications+e.wildcards===((o=t.find(i=>i.round===e.round+1))==null?void 0:o.entries)})}function $(a){if(!a||typeof a!="object"||Array.isArray(a))return!1;const t=a;return typeof t.fileName=="string"&&t.fileName.trim().length>0&&typeof t.url=="string"&&t.url.startsWith("https://storage.googleapis.com/underdog-inc/underblog/")&&typeof t.publishedDate=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(t.publishedDate)&&Number.isFinite(Date.parse(t.publishedDate))&&typeof t.directArticleLink=="boolean"&&Array.isArray(t.rounds)&&t.rounds.length>0&&t.rounds.every(e=>Number.isInteger(e)&&e>=1&&e<=4)}const _=(a,t)=>E(a,fetch,t);function P(a,t=!1){return t&&a==="all"?"all":b(a)?a:d[0]}function N({data:a,seasonControl:t}){var i;const e=String(a.source.season),r=h[e],o=e===d[0]?"":`?${new URLSearchParams({season:e})}`;return s.jsx(B,{data:a,config:{nav:s.jsx(f,{}),historicalLabel:"Historical NHL research",title:`Best Puck ${r.label}
1 research`,rosterSize:r.rosterSize,publicUsernameCount:r.publicUsernameCount,researchLabel:"Best Puck",finalStageLabel:"Finals",routes:{users:`/hockey/research/users${o}`,portfolio:`/hockey/research/portfolio${o}`,explorer:`/hockey/research/explorer${o}`},extraHeroLink:(i=a.coverage)!=null&&i.usernames?s.jsx(y,{className:"best-bowl-text-link",to:`/hockey/research/explorer${o}`,children:"Explore strategy and pod luck â"}):void 0,seasonControl:s.jsxs(s.Fragment,{children:[t,s.jsx(g,{}),s.jsx(R,{data:a})]})}})}function D({loadResearch:a=_}){const[t]=j(),e=P(t.get("season")),[r,o]=x.useState({status:"loading"});x.useEffect(()=>{const n=new AbortController;o({status:"loading"});const u=window.setTimeout(()=>{n.abort(),o({status:"error",message:"Best Puck research data took too long to load."})},15e3);return a(e,n.signal).then(l=>{n.signal.aborted||o({status:"loaded",season:e,data:l})}).catch(l=>{n.signal.aborted||o({status:"error",message:l instanceof Error?l.message:"Unable to load Best Puck research."})}).finally(()=>window.clearTimeout(u)),()=>{window.clearTimeout(u),n.abort()}},[a,e]);const i=s.jsx(m,{season:e});return r.status==="error"?s.jsx(p,{error:!0,label:r.message,seasonControl:i}):r.status!=="loaded"||r.season!==e?s.jsx(p,{label:"Loading Best Puck researchâ¦",seasonControl:i}):s.jsx(N,{data:r.data,seasonControl:i})}function m({season:a,includeOverall:t=!1,label:e="Research season"}){const[r,o]=j();return s.jsxs("label",{className:"best-bowl-season-picker best-puck-season-picker",children:[e,s.jsxs("select",{"aria-label":e,value:a,onChange:i=>{const n=new URLSearchParams(r);i.target.value===d[0]?n.delete("season"):n.set("season",i.target.value),o(n)},children:[t?s.jsx("option",{value:"all",children:"Overall · 2023â26"}):null,d.map(i=>s.jsxs("option",{value:i,children:[h[i].label,t&&!h[i].usernames?" · no public usernames":""]},i))]})]})}function g(){return s.jsx("p",{className:"best-bowl-table-note",children:"Annual NHL Best Puck research uses historical 16-player C/W/D/G rosters. The 2021â22 archive supports field results but has no public usernames. No verified 2022â23 source is available. Public tournament usernames are separate from private imported portfolios; a username does not establish a person's account identity."})}function R({data:a}){const{files:t,notes:e}=a.source;return!(t!=null&&t.length)&&!a.podLuck?null:s.jsxs("div",{className:"best-bowl-table-note",children:[e!=null&&e[0]?s.jsx("p",{children:e[0]}):null,a.podLuck?s.jsxs("details",{children:[s.jsx("summary",{children:"Pod qualification by round"}),s.jsx("p",{children:a.podLuck.methodology}),s.jsxs(L,{className:"best-bowl-table",children:[s.jsx("caption",{children:"Verified pod qualification and field calibration"}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Round"}),s.jsx("th",{children:"Entries"}),s.jsx("th",{children:"Pods"}),s.jsx("th",{children:"Automatic slots"}),s.jsx("th",{children:"Wildcards"}),s.jsx("th",{children:"Actual qualifiers"}),s.jsx("th",{children:"Expected qualifiers"})]})}),s.jsx("tbody",{children:a.podLuck.rounds.map(r=>s.jsxs("tr",{children:[s.jsxs("th",{scope:"row",children:["Round ",r.round]}),s.jsx("td",{children:r.entries.toLocaleString("en-US")}),s.jsx("td",{children:r.pods.toLocaleString("en-US")}),s.jsxs("td",{children:[r.qualificationSlots," of ",r.podSize]}),s.jsx("td",{children:r.wildcards}),s.jsx("td",{children:r.actualPodQualifications.toLocaleString("en-US")}),s.jsx("td",{children:r.expectedPodQualifications.toLocaleString("en-US",{maximumFractionDigits:2})})]},r.round))})]})]}):null,t!=null&&t.length?s.jsxs("details",{children:[s.jsx("summary",{children:"Verified source files"}),s.jsx("ul",{children:t.map(r=>s.jsxs("li",{children:[s.jsxs("a",{href:r.url,target:"_blank",rel:"noreferrer",children:[r.rounds.length===1?`Round ${r.rounds[0]}`:`Rounds ${r.rounds.join(", ")}`," · ",r.publishedDate]}),r.directArticleLink?" · linked by the official article":" · finalized official storage release"]},r.url))}),e==null?void 0:e.slice(1).map(r=>s.jsx("p",{children:r},r))]}):null]})}function p({label:a,error:t=!1,seasonControl:e}){return s.jsx(k,{className:"best-bowl-research",children:s.jsxs("article",{className:"best-bowl-article",children:[s.jsx(f,{}),e,s.jsx("div",{className:"best-bowl-state",role:t?"alert":"status",children:a})]})})}function O({season:a}){return s.jsx(k,{className:"best-bowl-research",children:s.jsxs("article",{className:"best-bowl-article",children:[s.jsx(f,{}),s.jsx(m,{season:a,includeOverall:!0,label:"User performance season"}),s.jsxs("div",{className:"best-bowl-evidence-gap",children:[s.jsxs("h1",{children:["Public usernames are unavailable for ",h[a].label]}),s.jsx("p",{children:"This archive supports aggregate NHL research, but it cannot identify public user portfolios or attribute pod luck to usernames."}),s.jsx(y,{to:`/hockey/research?${new URLSearchParams({season:a})}
1`,children:"Open this season's aggregate research"})]}),s.jsx(g,{})]})})}const I=Object.freeze(Object.defineProperty({__proto__:null,NhlPublicUsersUnavailable:O,NhlResearchCoverageNote:g,NhlResearchPage:D,NhlResearchSeasonPicker:m,NhlResearchSourceEvidence:R,NhlResearchState:p,NhlResearchView:N,parseNhlResearchScope:P},Symbol.toStringTag,{value:"Module"}));export{h as B,O as N,p as a,m as b,g as c,R as d,d as e,E as f,I as g,b as i,Q as l,P as p};
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.