diff --git a/CLAUDE.md b/CLAUDE.md index bd07cef..a827cfa 100755 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -672,9 +672,11 @@ snapshot, locked to the line, and read from cache. props. It's `rbi` now; a normalizer test locks it. - **The streaks/hotlist path uses its own `rbis` key** built from raw MLB stats — independent of the odds normalizer. Don't "unify" them; the split is intentional. -- **MLB is the ONLY end-to-end-live sport.** Outcome settlement is MLB-only - (WNBA/NBA/soccer grades never settle → `accuracy` reflects MLB only). Fixing - that (ESPN box-score settle path) is roadmap Session 57. +- **MLB and WNBA both settle end-to-end.** CORRECTED 2026-07-26 (was "MLB-only"): + `outcomeService.SPORTS` includes wnba, which settles via ESPN box scores + (`espnStatsAdapter` box-field map) — verified: 376 WNBA rows settled, settle + logic spot-checked correct. NBA/soccer still do not settle (no free settled + feed wired). So `accuracy` reflects MLB + WNBA, not MLB only. - **`src/utils/opsNotify.js`** pushes pipeline alerts to ntfy (`vyndr-pipeline- kev2026`). It NEVER throws and is auto-disabled under `NODE_ENV==='test'` / `PIPELINE_ALERTS=0` (inject `fetchImpl` to test it). `snapshotService` alerts on diff --git a/VYNDR-CANONICAL-STATE.md b/VYNDR-CANONICAL-STATE.md new file mode 100644 index 0000000..ddae4e5 --- /dev/null +++ b/VYNDR-CANONICAL-STATE.md @@ -0,0 +1,290 @@ +# VYNDR — CANONICAL STATE FILE +Read-only ground-truth audit. Written 2026-07-26 by Claude Code (repo + deployed DB access). +Every item tagged **VERIFIED** (file/line or measured number), **CANNOT DETERMINE** (with reason), +or **BLOCKED** (with what unblocks it). Where a prior claim conflicts with code/data, the code/data wins. +Nothing was built, changed, deployed, or migrated by this audit. + +--- + +## REVIEW ZERO — PREMISE + +- **0.1 What I can read** — VERIFIED. The **repo** (full source), the **deployed Supabase DB** + (read-only via MCP, project `zmdnczhtdxcddsxzttub`), and the **deployed API** (`api.vyndr.app`). +- **0.2 Key reachability** — VERIFIED. `PROPLINE_API_KEY_*` are **NOT on the box** (`.env` absent); + they were pasted in-session earlier this conversation and are usable for probes. `ODDS_API_KEY` + is on the box but **exhausted (0/500)**. `ODDSPAPI_KEY` not on box. DB-dependent items were run + against prod directly, so nothing here is BLOCKED on PropLine keys. + +--- + +## PHASE 0 — THE ROI RECONCILIATION (headline) + +- **0.1 ROI computed in code?** — VERIFIED. **Not for the model ledger.** ROI exists only for + **user bet-tracking**: `performanceService.js:42` (`roi: stats.roi`) and `betService.js:172-174` + (`profit = payout - amount`). There is **no ROI computation over `ledger_entries`** (the model's + public record). That is why the model's ROI has been invisible. + +- **0.2 Price-at-grade persisted?** — VERIFIED. **YES** — `ledger_entries.locked_odds` (text, + American), written by `ledgerService.recordPipelineGrades`. Populated on essentially all settled + rows (5 nulls on B). **ROI IS computable for accrued history.** + +- **0.3 11-point index persisted?** — VERIFIED (nuanced). **NOT in `ledger_entries`** — only the + collapsed letter (`grade`); `_grade_11` is explicitly `delete`d at `gradeSlateService.js:97` + before the ledger write. **BUT it IS retained in `model_snapshots.grade_11`** (migration + `025:51`, `retentionService.js:117`) — 2,888 of 4,600 snapshot rows carry it. So sub-tier is + **lost on the settled-outcome table but recoverable** by joining `model_snapshots` to + `ledger_entries` on (player, stat, line, date). STATE.md's "grade_11 is stored" and this audit's + "deleted before ledger write" are BOTH correct — different tables. + +- **0.4 Price distribution by grade (American odds, settled)** — VERIFIED: + | sport | grade | n(decided) | median | q1 | q3 | + |---|---|---|---|---|---| + | MLB | B | 285 | −270 | −650 | −155 | + | MLB | C | 176 | −169 | −500 | +109 | + | WNBA | B | 208 | −124 | −145 | −110 | + | WNBA | C | 160 | −120 | −134 | −108 | + Blended B median −160, C median −130. Overall range −10000 … +600. MLB grades skew to **deep + favorites**; WNBA grades cluster tight around −120. + +- **0.5 Flat-stake unit ROI by grade (1u/row at `locked_odds`, decided rows hit/miss, voids + excluded)** — VERIFIED: + | sport | grade | n | hit% | **ROI%** | + |---|---|---|---|---| + | MLB | B | 285 | 70.2 | **−1.02** | + | MLB | C | 176 | 60.8 | **+4.57** | + | WNBA | B | 208 | 52.4 | **−4.79** | + | WNBA | C | 160 | 51.9 | **−5.26** | + | A / D / F | (all) | 1 / 2 / 4 | 0 / 0 / 0 | −100 each (negligible n) | + Including voids as net-0 (my first pass) gives blended B −2.31%, C −0.10%. + **CONCLUSION — the premise's binary is a false dichotomy; the truth decomposes:** + - MLB **B** = high-hit (70%) **break-even favorites** — the premise's "favorites at fair prices, + zero edge" hypothesis is CONFIRMED here. + - WNBA **B/C** = **losing** (~52% hit at ~−120 where break-even is ~54.5%). + - MLB **C** = **genuinely +EV (+4.57% on 176 decided)** — a real edge the blended "no ROI" masked. + So: ROI is not uniformly zero-edge. It is **not computed in code**, and when computed here it shows + **one profitable segment (MLB-C) hidden under WNBA losses and break-even MLB-B**. + +- **0.6 64/56 population** — VERIFIED. The displayed `/api/ledger/accuracy` figures are + `hits/(hits+misses)`, **excluding voids** (88 void rows, 8.8%) and unsettled (67). Distinct + `outcome` values are **{hit, miss, void, null}** — **no `push`** (pushes structurally impossible: + half-number lines). The ROI table above uses the SAME decided (hit/miss) population, so hit-rate + and ROI are comparable. Blended B hit is 63.1% on `hits/(hit+miss)` but 55.9% on all-settled + (the 64 void B rows are the gap). + +- **0.7 Hit rate in UI/marketing?** — VERIFIED. Displayed on **≥10 surfaces**: `app/page.tsx` + (landing), `GradeCard`, `TopSignals`, `vyndr/TierRecord`, `vyndr/ModelRecord`, `vyndr/AccuracyBadge`, + `game/[id]/page`, `u/[handle]/portrait`, `ledger/page`, `scan/page`. **ROI / edge is displayed + NOWHERE.** Honesty gap: users see "63% / 70% HIT" with no indication MLB-B is −1% and WNBA is −5%. + +- **0.8 CLV computed / closing persisted?** — VERIFIED (with a broken-ness caveat). `closing_odds` + on **962/996** rows, `clv` on **842/996** — so CLV IS computed and closing IS persisted. BUT + `closingCapture.js:7-8` documents it as **effectively broken**: `closing_line == locked_line on + 92% of rows` (only ~56 rows show real movement), because `captureClosing` overwrites the field + with the current feed on every snapshot and most props leave the feed near their lock. CLV exists + but is **largely degenerate (≈0)**. + +--- + +## PHASE 1 — THE GRADED LINE + +- **1.9 Selector location** — VERIFIED. Two stages: (a) `gradeSlateService.dedupeProps` + (`gradeSlateService.js:34`, called `:144`); (b) the `snapshotService` dedup at + `snapshotService.js:425-434`. +- **1.10 Reads over which set?** — VERIFIED. **One provider at a time** — PropLine-normalized rows + (primary) via `oddsService` → `recordDownstream` → `gradeAndCacheSlate`. Falls back to + odds-api / oddspapi only if PropLine fails (`oddsService` fallback chain). Not all providers merged. +- **1.11 dedupeProps exists?** — VERIFIED. **YES, it EXISTS** (`gradeSlateService.js:34`). Logic: + Set on key `` `${player}::${stat_type}::${line}` `` — keeps the **FIRST** row per (player, stat, + line), discards later rows at the same (player, stat, line) (i.e. other books at the same line), + caps at `limit`. Written **Session 32** (`f0c8b4f`, "Grades pipeline + NFL/NHL wiring"). This + settles the asserted/un-asserted question: **it is real, not imagined.** +- **1.12 snapshotService 411-434** — VERIFIED. Confirmed: dedup by `` `${nameKey}|${stat_type}` ``, + keeps the row with the **highest `confidence`**. `confidence` derives from the **grade letter** + (band-midpoint from `grade_thresholds.json`, `confidence_basis:'grade_band'`) — so "highest + confidence" == "highest grade letter". It carries no information beyond the letter. +- **1.13 consensus vs first-book** — VERIFIED. **NO consensus rule exists in code.** The graded line + is chosen by **first-book-at-each-line (dedupeProps) then highest-grade-across-lines + (snapshotService)**. The "book-agnostic consensus rule" description is a prior order's *proposal*, + never built. The "first book" description is CLOSER to correct. **Code wins: no consensus.** +- **1.14 5 books at 3 lines → which line?** — VERIFIED (walked). `normalizeProps` emits one row per + book → `dedupeProps` keeps the first book at each of the 3 distinct lines (3 survivors) → + `gradeAndCacheSlate` grades both sides of each → `snapshotService` keeps the **highest-grade** of + the 3. **The graded line = whichever of the 3 lines grades highest** (a best-grade-for-us + selection, active now that the feed is 27% MLB / 82% WNBA multi-book). +- **1.15 Consumers assuming one book/prop** — VERIFIED (partial list): the grade path + (`dedupeProps` collapses book multiplicity), `analyzeViaEngine1` (`book_odds`/`fair_prob` use the + single surviving row's odds), the snapshot GameCard overlay, `detectBestBook` (no-ops <2 books). +- **1.16 Test pinning graded line vs book-set change?** — VERIFIED: **NONE.** `dedupeProps` and + `snapshotService` have unit tests for dedup mechanics, but **no test pins graded-line stability + against a change in the book set** (a multi-book different-line scenario). +- **1.17 Ledger flag for pre/post book-set change?** — VERIFIED. **No dedicated flag.** `model_version` + stamps the model era and challenger-version columns exist, but **nothing distinguishes grades by + book-set basis.** A silent book-set change would not be visible on the ledger. + +--- + +## PHASE 2 — THE FEED + +- **2.18 Books-per-prop TODAY (2026-07-26, live `/api/odds`)** — VERIFIED, and it **CORRECTS the + prior "137/140 single-book, DK129/FD14" measurement — the feed has broadened:** + - **MLB**: n=322 → `{1 book: 234 (73%), 2: 51, 3: 26, 4: 10, 5: 1}`. Books: **draftkings 273, + betmgm 105, betrivers 49, pinnacle 30, fanduel 2.** So 73% single-book (mostly DK), 27% + multi-book, **5 books now present** (not DK-only). + - **WNBA**: n=163 → `{1 book: 29 (18%), 2 books: 134 (82%)}`. Books: **fanduel 149, draftkings 148.** + **WNBA is graded off a genuine 2-book feed (DK + FD)** — better multi-book coverage than MLB. +- **2.19 ALLOWED_BOOKS** — VERIFIED. `oddsNormalizer.js:9` = 11 books (draftkings, fanduel, betmgm, + caesars, fanatics, bet365, hardrockbet, pointsbet, betrivers, pinnacle, thescore), applied at + `:110`/`:198`/`:235`. **Drops nothing today** (every book in the live feed is on the list). +- **2.20 PropLine request** — VERIFIED. `proplineAdapter.js:128` `buildUrl = ${BASE}/${sportKey}/odds`; + `:151-152` params = `{ apiKey, markets }`. **No `regions`/`bookmakers` param is sent.** The feed + broadening (2.18) happens on PropLine's DEFAULT response, not a param we added. +- **2.21 PropLine docs / multi-book param** — CANNOT DETERMINE (not re-tested this order). Prior + research (WebSearch): PropLine advertises "13 books + 5 exchanges; every payload includes a + bookmakers array" and is The-Odds-API-compatible (which uses `regions`/`bookmakers`). Whether a + param unlocks the full set on our tier is **unconfirmed** — would need a keyed test with the param. + +--- + +## PHASE 3 — THE CHALLENGER LEDGER + +- **3.22 Row counts** — VERIFIED: + | challenger | total | settled | first row | note | + |---|---|---|---|---| + | arch-v1 | 164 | 128 | 2026-07-21 | 94 with non-zero delta | + | contact-v1 | 122 | 86 | 2026-07-23 | 107 non-null `p_win_contact` (15 abstained) | + | proj-v1 + proj-v1.1 | 76 + 46 = 122 | 86 | 2026-07-23 | 119 with `proj_point` | + **All MLB** (challengers are statcast-gated → MLB only; the 407 WNBA rows carry none). Public + ledger total = **996 rows** (929 settled, 67 unsettled). **The earlier "ZERO settled p_win / + measurement not begun" is now STALE — 86-128 settled per challenger.** +- **3.23 Population rate** — VERIFIED. 872 rows in the last 14 days across **12 active days** (2 days + had no rows). Challengers populate a fraction of rows (arch 164/996) — the rest are pre-deploy or + WNBA. +- **3.24 Idempotent-lock lag** — VERIFIED, **still structural.** The ledger upsert is + `ignoreDuplicates:true`, so a challenger's fields land ONLY on rows first written AFTER that + challenger's code deployed (arch 07-21, contact/proj 07-23); re-running a snapshot never + backfills challenger fields onto an already-locked row. Any challenger added later inherits the + same gap. **Settlement itself is healthy** (`stale_unsettled = 0`). +- **3.25 Silent-failure / abstain path** — VERIFIED: **none producing fake accrual.** contact-v1's + nulls are honest abstentions (thin/absent Statcast); proj-v1 projects 119/122; arch-v1's + non-moved rows are byte-identical-to-champion (no distinctive axis). No caught-throw-writes-null + path masquerading as accrual. +- **3.26 Void/DNP rate** — VERIFIED. **88 void (8.8%)** + 67 unsettled of 996. Matches the ~9% premise. +- **3.27 model_snapshots / archetype / opp_rank** — VERIFIED (partial). `model_snapshots` is LIVE: + **4,600 rows, latest 2026-07-26 22:01**, `grade_11` on 2,888. Archetype + `opp_rank_stat` were + verified live per-sport (MLB + WNBA) in prior orders; **CANNOT re-confirm per-sport freshness here + without additional queries** (not run to keep this pass bounded). + +--- + +## PHASE 4 — WHAT IS ACTUALLY WIRED + +- **4.28 SportsGameOdds wired?** — VERIFIED. **NOTHING.** No SGO reference in `src/`, `web/src/`, + or `.env`. Not wired, configured, committed, or deployed. (The audit that qualified it as a source + was report-only.) +- **4.29 Design surfaces live vs designed** — VERIFIED: + - **S2 (book comparison / crown / disagreement):** `BookComparison.tsx` EXISTS in + `web/src/components/` but is **NOT imported/routed anywhere (dead component)**. `BookChip` + + `BookWordmark` exist and are used. `MovementStrip`, `CrownBadge` → **NOT FOUND** (never built). + (Corrects an earlier order that said "BookComparison doesn't exist" — it exists, just unrouted.) + - **THE WIRE:** = the **daily newsletter/content format** (see 4.30). Newsletter engine built + (`newsletterService`); send is unscheduled (internal endpoint only). + - **S3 article media:** **NOT FOUND** (no article-media generator; `mediaEngine` only has wire/ + share text templates). + - **S-2 Offseason hub / SeasonBoard:** **NOT FOUND** (never built). + - **System / Intelligence:** design files present in `specs/design-reference/`; live components partial. +- **4.30 What is THE WIRE?** — VERIFIED. It is **VYNDR's daily newsletter / content voice**, not a UI + surface: `newsletterService.js:219-220` (`THE WIRE — {date}`) + `mediaEngine.js:6,121` + (`MORNING WIRE`, `SIGNAL` deterministic templates). It's the editorial format for the daily report. +- **4.31 detectBestBook + LineSparkline** — VERIFIED. `slateAdapter.detectBestBook` returns a book + only when ≥2 books post the SAME line at differing prices (no-ops on 1 book, never marks a lone + price "best"). `StatStrip.LineSparkline` (`StatStrip.tsx:130`) renders only at **≥3 history + points**, returns `null` below. Both degrade honest-absent on single-book/shallow data. +- **4.32 Line history / closing overwrite** — VERIFIED. `history` (`{t,line}`, line-deduped, cap 24) + is shallow — most props sit at 1-2 flat points (line moves are rare; books move odds, not the + half-point line). Two distinct closing mechanisms: the **`closing_captures` TABLE is INSERTED / + appended** (`closingCapture.js:234`), but the **`ledger_entries.closing_line/closing_odds` is + OVERWRITTEN every snapshot** (`ledgerService.js:18-21` doc; overwrite is why CLV is degenerate — 0.8). +- **4.33 Migration drift** — VERIFIED, **still present.** Repo `supabase/migrations/` has + **001-022, 025, 030, 031, 032**. **MISSING: 023, 024, 026, 027, 028, 029** — applied to prod but + untracked (they carry the challenger columns `p_win_challenger`/`challenger_*`, `model_version`, + `env_*`, `archetype_vector` — confirmed live in prod). The repo does NOT reflect prod schema; check + `information_schema.columns` via MCP, not the repo, before schema work. +- **4.34 WNBA grading live?** — VERIFIED. **YES.** 407 WNBA ledger rows, **376 settled**, graded off + a 2-book (DK+FD) feed. WNBA carries no challenger rows (statcast-gated MLB-only). + +--- + +## PHASE 5 — DOCTRINE AND THE BOARD + +- **5.35 CLAUDE.md (read in full)** — VERIFIED. Standing rules & findings: + - **NO CODE WITHOUT A SPEC**; 5 quality gates; WSL2 heredoc rule (python3 for >10-line files); + update BUILD-STATE.md / BLOCKERS.md. + - **Data Semantics Rule:** VYNDR never generates lines/odds — market values are REAL captured book + numbers; only model_value/grade/edge are model output. `Number(null)===0` is the recurring + fabrication bug; use strict null guards. + - **Grade internals:** grade is an additive integer index (`engine1`, NEUTRAL_INDEX 3), moved by + flat ±1.0/±0.5 deltas; A needs sum ≥+4.5, D ≤−1.51. `confidence` is NOT a probability (grade-band + midpoint). `p_win` is the real signal. **NEVER rescale thresholds to mint A's (permanent founder + ruling).** **A-RATED marketing on hold** until a prod fingerprint shows real A grades. + - **Three stat_type whitelists must stay in sync** (analyze.js, scan.js, validation.py). + - **Snapshot pipeline** is the product model (scheduled grade → lock to line → read from cache); + on-demand "Read" retired. SNAP_TTL 24h. + - **DO-NOT-WIRE / DO-NOT-TOUCH:** Tank01 player props = empty (do not wire); ParlayAPI host dead; + `gameLogService.getGameLogs` returns null for MLB (a trap — use `featureCache.getStatRows`); + `mlbGrader.js` is dead code; the legacy `--grade-a` token alias block kept until consumers migrate. + - **Three separate MLB stat maps on purpose** (featureCache / outcomeService / liveTrackingService) — + do not merge. Settlement is MLB-only (WNBA/NBA/soccer never settle via that path — but WNBA IS + grading + settling per 4.34, so confirm the settle path). +- **5.36 Running task list / open items** — VERIFIED. Primary: **`specs/STATE.md`** (1,886 lines, + "STATE OF THE WORLD," CURRENT STATUS + OPEN ITEMS block, last dated 2026-07-22). Also + `BUILD-STATE.md`, `BLOCKERS.md`, `DECISIONS.md`, `AUTONOMY.md`, `PROMISE-AUDIT.md`, `ROADMAP.md`. + **Open threads I have been tracking across recent orders that a strategist chat may not have:** + (a) challenger measurement now HAS settled rows (arch 128 / contact 86 / proj 86) — promotion is a + future per-prop-type ledger decision; (b) the design-migration arc (Landing hero migrated; scanner + S6/S7 blue-channel reskin shipped; S2/THE WIRE/Offseason/article-media are GAP/unbuilt); + (c) multi-book: SGO qualified (report-only), nothing wired; (d) **ROI is uncomputed in code and + decomposes to MLB-C +4.57% / MLB-B −1% / WNBA −5%** (this file). +- **5.37 Spec / roadmap files** — VERIFIED (in `specs/`): `STATE.md` (running state), + `VYNDR-NORTH-STAR.md`, `DESIGN-SPEC.md`, `ROW-GRAMMAR.md` (row grammar law), `LIVE-TRACKING.md`, + `VOICE.md`, `model-train.md`, `phase-0-kill-the-lies.md`, `phase-1-truth-infrastructure.md`, + `propline-audit.md`, `feature-1-1…4-1` + `a1-s3/s7/s9/s10` feature specs, `combat-intelligence.md`, + `design-reference/` (the design bundle). Root docs: `CLAUDE.md`, `DECISIONS.md`, `ARCHITECTURE.md`, + `AUTONOMY.md`, `BACKEND_HANDOFF.md`, `BUILD-STATE.md`, `BLOCKERS.md`, `PROMISE-AUDIT.md`. +- **5.38 Standing decisions a new session might contradict** — VERIFIED: `DECISIONS.md` + (DECISION-001+ architecture log); CLAUDE.md's permanent rulings (never mint A's; A-RATED hold; + data-semantics; do-not-wire list); STATE.md open items (A does not emit in prod; EV overconfident/ + unvalidated — hero ranks on ev_pct and picks the most overconfident read; grade_11 stored in + model_snapshots). `AUTONOMY.md` = the zero-touch loop trace. + +--- + +## CLAIMS I WAS ASKED ABOUT THAT TURNED OUT TO BE FALSE OR UNSUPPORTED + +1. **"the ledger reports … 597 settled with 'no ROI'"** — the population is now **929 settled / 996 + total** (597 was an earlier snapshot); and **ROI IS computable** (`locked_odds` persisted) — it is + simply **not computed in the ledger code**. "No ROI" = no computation, not incomputable. +2. **"Either ROI is not computed, or the model is selecting heavy favorites at fair prices"** — the + binary is false; **both are partially true and it decomposes by sport/grade**: MLB-B = high-hit + break-even favorites (the hypothesis), WNBA = losing, **MLB-C = genuinely +4.57% EV**. Not + uniformly zero-edge. +3. **"the graded line is chosen by a book-agnostic consensus rule"** — **no consensus rule exists in + code.** It is first-book-at-line (`dedupeProps`) + highest-grade-across-lines (`snapshotService`). +4. **Prior "137/140 single-book, draftkings 129 / fanduel 14" (~98% single-book)** — **corrected**: + today MLB is 73% single-book with **5 books present** (DK/BetMGM/BetRivers/Pinnacle/FanDuel), and + **WNBA is 82% two-book (DK+FD)**. The feed broadened. +5. **"the 11-point index is lost / unrecoverable"** — **it is retained in `model_snapshots.grade_11`** + (2,888 rows); lost only from `ledger_entries`. Recoverable via join. +6. **"ZERO settled p_win yet / challenger measurement not begun"** (from prior challenger orders) — + **stale**: arch-v1 128, contact-v1 86, proj-v1 86 rows are now settled. +7. **"BookComparison doesn't exist, only BookChip"** (an earlier order) — **BookComparison.tsx + EXISTS**, it is just unrouted/dead. +8. **CLV framed as "held / not computed"** — **CLV IS computed** (842 rows) and closing IS persisted + (962), but it is **largely degenerate** (closing==locked on 92%) due to the overwrite — a + different problem than "not computed." +9. **WNBA implicitly treated as not-really-grading** (settlement described as MLB-only in CLAUDE.md) — + **WNBA IS grading AND settling** (376 settled). The doctrine note about MLB-only settlement is + contradicted by the data; the WNBA settle path should be confirmed. + +--- +*End of canonical state. Regenerate the measured numbers before citing them in a later session — +they move as the ledger accrues. Structural facts (file/line, schema, wiring) are stable until code changes.* diff --git a/outputs/VYNDR-COMPLETION-MATRIX.md b/outputs/VYNDR-COMPLETION-MATRIX.md index e9baa3d..bfd2610 100644 --- a/outputs/VYNDR-COMPLETION-MATRIX.md +++ b/outputs/VYNDR-COMPLETION-MATRIX.md @@ -139,6 +139,11 @@ scorer, pipeline, or real feature touched. Updated HONEST cells: ## KNOWN HONESTY GAPS (not fixed this order — logged, not fabrication) - **Hit rate 59% (n=763) shown without ROI/CLV** — thin, not false. ROI/CLV surfacing is a later build. +- **"0 pushes = mis-scoring" — RETIRED 2026-07-29 as a false alarm** (premise re-verified, report-only). + The displayed hit/miss denominators are NOT corrupted by a hidden push bug: the feed is still 100% + half-numbers (0 whole lines in 117,970 captured market lines / 6,050 snapshots / 1,141 ledger rows / + 173 lock_lines), all 992 settled actuals are integers, and the smallest actual-vs-line gap in the + whole ledger is 0.5. Expected pushes = exactly 0. See the verdict block below. - **CLV instrument REPAIRED 2026-07-28** (commit 6552281). Was: 59 usable closing_prob. Now: **406** (MLB 248, WNBA 158) — the collapse was `attachClosingProb`'s `.limit(50000)`/no-ORDER-BY read + write-once `market_unavailable`, NOT capture (95% per-prop coverage) or the join (0 key mismatches). **CLV finding, straight: MLB unders lag the close (mean −9.1 prob-pts, 74% lose); MLB overs +2.0; WNBA flat.** → the +4.57% MLB-C and over/under asymmetry are substantially stale-line artifacts. This UNBLOCKS the proof order (proj-v1.1), which gates promoting p_win/ev to served grades. **Honest state after this order: "no KNOWN live fabrications" — not "provably none."** The audit was thorough (repo + prod), but absence of a claim of falsehood is not a proof of universal truth. @@ -191,3 +196,160 @@ Gates the champion's over-CLV signal (partial r=0.375, p≈0.003, n=62 takeable # HERO RANKING FIX — 2026-07-29 (commit 41b86e3, deployed) The landing/hero (matrix row 1) selection was silently broken: it ranked on `ev_pct`, which is NULL on served grades, and **`Number(null) === 0`** made every prop tie at EV 0 → the "top read" was the FIRST takeable A/B prop in cache order — **arbitrary, dressed as ranked** (prod served Kelsey Mitchell, the #6 read by p_win). FIXED: rank by the **champion's p_win** (the only promising edge signal) among A/B **takeable-priced** reads (`isTakeable` −160..+200, same band as the proof/audit); strict-null guard; takeable filter excludes chalk; **no backfill** → honest empty state when nothing qualifies. p_win is ranking-only (never exposed; the route strips it). Display-only — reads caches, writes to nothing. No proven-edge/+EV/best-bet claim, no CLV/ROI/edge number. This makes the champion's p_win a real (display) consumer for the first time. Fingerprint VERIFIED: hero is the max-p_win read across sports (WNBA A), not old code's first-in-order MLB pick (Schanuel −135); untakeable chalk excluded. Visual auth-gated → data fingerprint. + +--- + +# PUSH-SCORING PREMISE VERIFY — verdict 2026-07-29 (report-only, read-only) + +Tested the standing ruling "push scoring is correct — do not touch." That ruling rested on +"100% half-number lines → pushes structurally impossible," which was true for the data it was +made on. If whole-number lines had entered the feed since, 0 pushes across settled rows would be +a real mis-scoring bug the ruling was shielding. **The premise HOLDS — the ruling stands.** + +**Phase 1 — feed distribution, 4 independent populations, per sport AND per market (never blended):** + +| population | what it covers | rows with a line | whole-number lines | +|---|---|---|---| +| `closing_captures` | raw captured market lines, 5 books, `book`+`sharp`, Jul 20-29 continuous | **117,970** | **0** | +| `model_snapshots` | every graded prop **incl. grader refusals** (not survivorship-filtered) | 6,050 | **0** | +| `ledger_entries` (public) | the settled public record, 11 markets | 1,141 | **0** | +| `lock_lines` | TODAY's lock-time per-book lines (freshest feed, migration 033) | 173 | **0** | + +Per-market: MLB hits / doubles / rbi / total_bases / stolen_bases / runs / strikeouts / home_runs / +walks / earned_runs / outs / hits_allowed and WNBA points / rebounds / assists / threes — **every +market's min AND max line ends in `.5`** (e.g. MLB strikeouts 2.5-8.5, WNBA points 5.5-26.5, MLB +outs 3.5-19.5). No whole-number market is hiding inside a blended fraction. + +**Phase 2 — the push branch would fire.** `outcomeService.js:151` `if (a === l) return 'push'`, +reached **after** `Number()` + `Number.isFinite` guards on both operands — a sound numeric compare, +not the `Number(null) === 0` string-vs-number class that hit the hero. It is the **single scoring +chokepoint** (`ledgerService.js:31` imports `settleResult`; no parallel hit/miss derivation exists +in `src/`), it is **unit-tested live** (`outcomeService.test.js:38`, `nbaSettlement.test.js:104`), +and both `ledger_entries.outcome` and `outcomes.result` CHECK constraints **include `'push'`** — a +real push would score, write, and persist end-to-end. + +**Phase 2.6 — the decisive number.** Across 992 settled rows carrying an actual: **0 exact ties, 0 +fractional actuals, and the smallest actual-vs-line gap is 0.5** — the arithmetic minimum between an +integer result and a half-number line. + +**VERDICT: RULING HOLDS.** Expected push rate is **exactly 0 (P = 0), not "low"** — 0/992 is +*forced*, not chance. The "implausible" flag mistook an arithmetic impossibility for a suspicious +absence; the row closes honestly. Stale n corrected: the flag said 470 settled, it is now **1,097** +(593 hit / 399 miss / 105 void / 44 unsettled-today). Nothing modified — no scoring, settlement, +re-settle, or backfill. + +**No latent bug either.** Because the branch is correct and covered, a whole-number market entering +later (NFL/NHL are code-wired but out of season; whole-number strikeout props exist at some books) +would be scored as a push automatically. The residual is a **monitoring** gap, not a scoring gap: +nothing alerts on the first whole-number line to enter the feed. Logged, not built. + +--- + +# EDGE_PCT SCALE DIAGNOSIS — 2026-07-29 (report-only, read-only). Fork REPORTED, not chosen. + +**What it is (0.1).** `analyzeViaEngine1.js:265-270` — `edge_pct = ((projection − line) / line) × 100`, +signed by direction, where `projection = l5_avg ?? l20_avg ?? {stat}_per_90 ?? xg_per_90`. +**Independent of `p_win`** (so NOT tainted by the overconfidence that damns `ev_pct`) but it takes +**no price input at all**, so it cannot express a betting edge. **Arithmetically correct, MISLABELLED:** +honest as "% the projection differs from the line," **a lie at any scale as "EDGE."** Two independent +implementations — backend `edgePctFor` and `web/src/lib/gradeAdapter.js:25-31 computeEdge`; the grade +card renders the WEB one, so a backend-only fix would miss it. + +**The cap (0.2).** `SANE_EDGE_MAX = 40` (`deskShowcaseService.js:31`: *"beyond this the (model-line)/line +value isn't a market edge"*), mirrored in `slateAdapter.js:613` and `MobileEdgeBoard.tsx:45`. A +self-declared plausibility bound from an earlier order, not a derived statistical one. + +**Mechanism (0.3) = SMALL-DENOMINATOR EXPLOSION** — not units, not inversion, not a missing ×100. +`line` is the denominator and **86% of MLB rows (562/655) sit at line 0.5**. Max 620 = a ~3.6 projection +on a 0.5 line. + +| population | n | >cap 40 | >100 | median | p95 | max | min | +|---|---|---|---|---|---|---|---| +| **MLB** | 655 | 65.8% (>50) | 13.6% | **60** | 180 | **620** | −86.7 | +| **WNBA** | 486 | 4.9% (>50) | **0%** | 12 | 49 | 77.8 | −51.7 | +| blended | 1,141 | **44.0% (502)** | 7.8% | — | — | 620 | — | + +Per line (the proof): MLB 0.5 → 73.0% over cap, max 620 · MLB 1.5 → 43.8%, max 153 · WNBA 12.5 → 6.7% +· **WNBA 26.5 → max 1.9.** Matrix figures re-verified: **51.5% is stale → 44.0%; worst 620 is exact.** +**Shape: structurally broken for MLB, sane for WNBA** — and the scale is a *function of line size*, so +the metric is incomparable across markets **by construction**. No rescaling fixes that. + +**Surfaces (Phase 2) — the "~13" count is NOT confirmed. Three surfaces RENDER it:** + +| surface | live | access | role | user sees at 620 | +|---|---|---|---|---| +| `GradeResultCard.tsx:182,216,325` | YES (3 importers) | **auth-gated `/scan`** → **TAGGED FOR CHROME AUDIT** | display | **"+620% edge", raw + GREEN** | +| `DeskShowcase.tsx:40` | YES | **PUBLIC** `/pricing` | display | **"—"** (already honest) | +| `SoccerGradeResult.tsx:229` | YES | orphan `/soccer` (0 nav links, public by URL) | display | raw uncapped `X.X% edge` | +| `MobileEdgeBoard.tsx:47` | **DEAD** (0 importers) | — | sort+display | "—" (pulled in honesty pass) | +| `PropRow:45`, `GradeCard:32`, `ledger/page:40` | live components | — | **type-only, never rendered** | nothing | +| `contentTemplateService.js:164` | public `/api/content` | API | string | uncapped — **no page fetches it** | + +**🔴 IT DRIVES TWO LIVE SORTS (the fork's load-bearing answer).** +1. `slateAdapter.selectTopGrades:469-471` — `grade → confidence → |edge| desc` → **dashboard TOP GRADES + top-10** (`dashboard/page.tsx:419`). **97.3% of rows (1110/1141) sit in a (date,sport,grade,confidence) + tie group of ≥2** (biggest 56), so |edge| is operative for essentially the whole slate — the **de facto + ordering** of that leaderboard. +2. `analyzeViaEngine1.js:506` — the Desk **alt-line ladder** is sorted by `edge_pct` desc. + +**Two scale-INDEPENDENT defects inside that sort** (`Math.abs(numOr(g.edge, -Infinity))`): **(i) abs()** +on an already-direction-signed value ranks the model's strongest *disagreements* equal to its strongest +agreements (**177 negative-edge rows**: 58 B / 118 C / 1 F, worst −86.7); **(ii)** `Math.abs(-Infinity) += Infinity` → a **missing edge sorts FIRST**. The `Number(null)` fabrication class again, new costume. + +**Phase 4 correction — "nothing renders `ev_pct`" is WRONG.** `PriceTriplet.tsx:60,67,76` renders +`${pct(ev)} EV`, live and wired (scan → `gradeAdapter:143`). It shows nothing only because `ev_pct` is +NULL on served grades → `valueState.js:121` falls to **NO_MODEL honest-absent**. The right metric already +has a live honest render site, **starved of data, not unwired** — and the card's "EDGE" row sits exactly +where a price-aware number belongs. + +**THE FORK (reported, not chosen).** +- **FIX** — dishonest: no rescaling turns a price-free projection gap into an edge (renaming, not fixing); + it silently re-ranks the dashboard top-10 (the hero-class bug just fixed); needs BOTH implementations. +- **HIDE** — cheap: 3 render sites, each already has a null branch (no layout breaks), and DeskShowcase + already proves the honest "—" pattern in-product. Not load-bearing for layout anywhere. +- **RECOMMENDED: HIDE the number and re-point the sort at `p_win`** — the hero order established p_win is + on 100% of recent ledger rows and is the only signal that survived an adversarial audit. Repairing a key + that is a 0.5-line artifact is not worth it. End state: **p_win ranks · ev_pct displays · edge_pct retires.** + The abs()/null-first sort defects deserve their own small order either way. + +*Nothing changed: no edge_pct, scale, surface, sort, grade, ledger, or accruing edge touched.* + +--- + +# GRADE-BOARD SORT FIX — 2026-07-29 (spec `specs/grade-board-sort.md`, shipped) + +Display ORDERING only. Fixes two defects that were wrong at ANY scale, independent of edge_pct's +separate retirement (Order B, still held). + +**Defects removed.** `selectTopGrades` ranked on `Math.abs(numOr(g.edge, -Infinity))`: +`abs()` on an already-direction-signed value ranked the model's strongest **disagreements** level with +its agreements (177 public ledger rows carry a negative edge); and `Math.abs(-Infinity) === Infinity` +made a **missing** signal sort **FIRST** — absent data as the top pick. Now: `grade → confidence → +takeable-gated p_win (nulls LAST) → SIGNED edge (nulls LAST) → input order`, scales never mixed. +The alt-line ladder (`analyzeViaEngine1:506`) no longer sorts by `edge_pct`; it is ordered +highest-p_win-first via the monotonic line rule (line-ASC for an over, line-DESC for an under) at zero +added compute. + +**Three premise breaks found report-first.** (1) **`/api/props/top-graded` 404s in prod** — the +dashboard board's feed does not exist, so that board renders receipts/empty and the sort orders nothing +there today; the prior order's "97.3% of rows tie → the edge key decides the board" was a ledger +measurement wrongly extrapolated to it. (2) **p_win is stripped for unentitled tiers by design** +(`snapshotGating`, Session 67 — "shipping p_win is shipping the model price"); verified live, prod +`/api/snapshot` carries p_win on **0/8 MLB and 0/25 WNBA** grades, so the browser path uses the signed +edge and only entitled callers rank on p_win. (3) **Ladder rungs carry no per-rung price**, so the +hero's takeable gate is inapplicable there. + +**Verified on real data, both sports, both paths.** Unentitled: WNBA (n=25) ordering CHANGED, MLB (n=8) +unchanged; signed edge non-increasing within every (grade,confidence) tie group — 20 pairs, 0 +violations. Entitled: 40 real ledger rows with p_win+locked_odds — p_win-descending, untakeable chalk +not promoted, 36 pairs, 0 violations. + +**Hero consistency, honestly:** same signal + same gate, different precedence by contract (board = +grade-tier-first "top GRADES"; hero = p_win-first "top read"). They agree exactly **within** the +leading tier (verified); across tiers the board may lead with an A the hero doesn't pick. Not a +contradiction — do not "fix" it by making the board ignore grade. + +**Floor:** 310 suites / 3864 tests green, web build exit 0. Dashboard + Desk visuals are auth/feed-gated +→ tagged for the Chrome audit, no visual faked. **Held:** edge_pct rescale/display retirement, building +the missing `/api/props/top-graded` selector, exposing p_win to unentitled tiers. diff --git a/specs/STATE.md b/specs/STATE.md index b4974e0..015ac49 100644 --- a/specs/STATE.md +++ b/specs/STATE.md @@ -110,6 +110,146 @@ > hero is Kelsey Mitchell (WNBA A), the max-p_win read ACROSS sports, and untakeable chalk > (Yainer Diaz −200, Altuve C) is excluded → new code confirmed serving. Visual is auth-gated > (landing hero public, dashboard not) — data fingerprint used, `cf-cache-status: DYNAMIC`. +> ## ✅ PUSH-SCORING PREMISE VERIFY 2026-07-29 (report-only): **RULING HOLDS — row closed** +> Tested whether the standing "push scoring is correct — do not touch" ruling still rests on a +> true premise, or whether whole-number lines had entered the feed since it was made (which +> would make 0 pushes a real mis-scoring bug the ruling was shielding). **The premise HOLDS.** +> 0.1 basis confirmed verbatim (`VYNDR-CANONICAL-STATE.md:69`): "*no `push`* (pushes structurally +> impossible: half-number lines)". **Phase 1 — the feed is STILL 100% half-numbers, on 4 +> independent populations, per sport AND per market (no blend): `closing_captures` **117,970 +> priced market lines → 0 whole** (5 books incl. `sharp`/pinnacle, 16 sport/stat groups, Jul 20–29 +> continuous); `model_snapshots` 6,050 → 0 (incl. grader refusals, so not survivorship); +> `ledger_entries` 1,141 public → 0 (11 markets: MLB hits/doubles/TB/SB/ER/HR/outs, WNBA pts/reb/ +> ast/3s — every min AND max ends in `.5`); `lock_lines` 173 → 0 (TODAY's lock, freshest feed). +> **Phase 2** — push branch is `outcomeService.js:151` `if (a === l) return 'push'` **after** +> `Number()` + `Number.isFinite` guards on both operands → sound numeric compare, NOT the +> `Number(null)===0` string-vs-number class. It is the **single scoring chokepoint** (`ledgerService.js:31` +> imports `settleResult`; no parallel scorer derives hit/miss anywhere in `src/`), it is **unit-tested +> live** (`outcomeService.test.js:38` `settleResult('over',2,2)==='push'`, `nbaSettlement.test.js:104`), +> and both `ledger_entries.outcome` + `outcomes.result` CHECK constraints **include `'push'`** → a real +> push would score, write, and persist. **Phase 2.6 / the decisive number: 0 exact ties in 992 settled +> rows, 0 fractional actuals, and the SMALLEST actual-vs-line gap across all 992 rows is 0.5** — the +> arithmetic minimum between an integer result and a half-number line. **VERDICT: RULING HOLDS.** +> Expected push rate is **exactly 0 (P=0), not "low" — 0/992 is FORCED, not chance**, so the +> "implausible" flag is retired: it mistook an arithmetic impossibility for a suspicious absence. +> The open-items row is CLOSED honestly. Nothing was modified (no scoring, settlement, re-settle, +> or backfill). NOTE the stale n: the flag said 470 settled; it is now **1,097 settled** (593 hit / +> 399 miss / 105 void / 44 unsettled-today). **No latent bug either** — the branch is correct and +> covered, so if a whole-number market ever DOES enter (NFL/NHL are code-wired but out of season; +> whole-number K props exist at some books), it scores as a push automatically. Residual risk is +> a monitoring gap, not a scoring gap: nothing ALERTS on the first whole-number line. + +> ## 🔬 EDGE_PCT SCALE DIAGNOSIS 2026-07-29 (report-only): **not a units bug — a mislabelled metric that DRIVES A LIVE SORT** +> **0.1 What it is.** `analyzeViaEngine1.js:265-270 edgePctFor()`: +> `signed = over ? (projection − line) : (line − projection)`; `Math.round((signed/line)*1000)/10` +> → **edge_pct = ((projection − line) / line) × 100**, signed by direction, 1dp. `projection` = +> `projectionFor` = `l5_avg ?? l20_avg ?? {stat}_per_90 ?? xg_per_90` (`:252-257`). **It is +> INDEPENDENT of `p_win`** — so it is NOT tainted by the overconfidence that damns `ev_pct`. But it +> takes **NO price input at all**, so it cannot express edge in the betting sense. **Verdict: +> arithmetically correct, MISLABELLED. Honest as "% the model's projection differs from the line"; +> a lie at ANY scale as "EDGE"** — which is exactly how every surface labels it. **TWO independent +> implementations exist** — backend `edgePctFor` AND `web/src/lib/gradeAdapter.js:25-31 computeEdge` +> (same formula); the grade card renders the WEB one, so a backend-only fix would not reach it. +> **0.2 The cap.** `SANE_EDGE_MAX = 40`, `deskShowcaseService.js:31`, comment: *"beyond this the +> (model-line)/line value isn't a market edge"*. Mirrored `slateAdapter.js:613 EDGE_BOARD_SANE_MAX=40` +> + `MobileEdgeBoard.tsx:45`. It is a self-declared plausibility bound from an earlier order, **not a +> derived statistical bound**. +> **0.3 Mechanism = SMALL-DENOMINATOR EXPLOSION** (not units, not inverted, not missing ×100 — the +> ×100 is present and correct). `line` is the denominator and **562 of 655 MLB rows (86%) sit at line +> 0.5**, where every 0.1 of projection is ±20 points. Max 620 = projection ≈3.6 on a 0.5 line. PROVEN +> per-line: MLB 0.5 → 73.0% over cap, max 620 · MLB 1.5 → 43.8%, max 153 · WNBA 12.5 → 6.7% · **WNBA +> 26.5 → max 1.9**. Monotone decay with line size. +> **PHASE 1 — matrix figures RE-VERIFIED, partly stale.** Blended over cap-40 = **502/1141 = 44.0%** +> (matrix said 51.5% — direction right, number stale). **Worst value 620 = EXACT match.** Per sport: +> **MLB n=655** — 13.6% >100, 65.8% >50, median **60** (already 1.5× the cap), p95 180, p99 238, +> min −86.7, max 620. **WNBA n=486 — 0% >100**, median 12, p95 49, max 77.8. **Shape: structurally +> broken for MLB, essentially SANE for WNBA.** Not a mild calibration — and note what that means: +> the scale is a FUNCTION OF LINE SIZE, so the metric is incomparable across markets **by +> construction**. No rescaling fixes that; only changing what the metric IS would. +> **PHASE 2 — the ~13-surface count is NOT confirmed. Only 3 surfaces RENDER it:** +> (a) **`GradeResultCard.tsx:182,216,325`** — LIVE (3 importers), **auth-gated `/scan`** → +> **TAGGED FOR THE CHROME AUDIT, no visual faked** — renders **"+620% edge" RAW and GREEN**, no cap; +> (b) **`DeskShowcase.tsx:40`** — LIVE, **PUBLIC** `/pricing` — **already honest**, shows "—" +> (service nulls >40); (c) **`SoccerGradeResult.tsx:229`** — uncapped, on the ORPHAN `/soccer` +> (0 nav links, public by URL). **Dead:** `MobileEdgeBoard` (0 importers, pulled in the honesty pass), +> `DemoScan` (0 importers). **TYPE-ONLY, never rendered:** `PropRow.tsx:45`, `GradeCard.tsx:32`, +> `ledger/page.tsx:40`. **API-only:** `contentTemplateService.js:164` emits an uncapped "+620% edge" +> string on public `/api/content` — **no page fetches it** (verified). +> **🔴 THE SORT ANSWER — YES, IT DRIVES TWO LIVE SORTS.** (1) `slateAdapter.selectTopGrades:469-471` +> sorts `grade → confidence → |edge| desc`, consumed by `dashboard/page.tsx:419` for the dashboard +> **TOP GRADES top-10**. **MEASURED: 97.3% of rows (1110/1141) sit in a (date,sport,grade,confidence) +> tie group of ≥2 (biggest 56)** → the |edge| key is operative for essentially the whole slate, so it +> is the **de facto ordering** of that leaderboard. (2) `analyzeViaEngine1.js:506` sorts the Desk +> alt-line ladder by `edge_pct` desc. **TWO SCALE-INDEPENDENT DEFECTS FOUND INSIDE THAT SORT:** +> `edge: Math.abs(numOr(g.edge, -Infinity))` — (i) **abs()** on an already-direction-signed value ranks +> the model's strongest DISAGREEMENTS equal to its strongest agreements (**177 ledger rows carry a +> negative edge**: 58 B / 118 C / 1 F, most negative −86.7); (ii) `Math.abs(-Infinity) = Infinity`, so +> a **MISSING edge sorts FIRST** — the `Number(null)` fabrication class again, in a new costume. +> **PHASE 4 — the matrix's "nothing renders `ev_pct`" is WRONG.** `PriceTriplet.tsx:60,67,76` renders +> `${pct(ev)} EV` and is LIVE + wired (scan → `gradeAdapter:143` → PriceTriplet). It shows nothing only +> because `ev_pct` is NULL on served grades, so `valueState.js:121` correctly falls to **NO_MODEL +> honest-absent**. So: **the right metric already has a live, honest render site starved of data** — +> and the card's "EDGE" row sits exactly where a price-aware number belongs. +> **PHASE 3 — THE FORK (reported, NOT chosen).** **FIX is not honest**: no rescaling turns a +> price-free projection gap into an edge — you would be renaming, not fixing; it silently re-ranks the +> dashboard top-10 (the hero-class bug just fixed); and it must land in TWO implementations. +> **HIDE is cheap**: only 3 render sites, every one already has a null branch (so no layout breaks), +> and **DeskShowcase already proves the honest "—" pattern in-product**. **RECOMMENDED: HIDE the +> number, and re-point the sort at `p_win`** (the hero order established p_win is on 100% of recent +> ledger rows and is the one signal that survived an adversarial audit) rather than repair a key that +> is a 0.5-line artifact. Coherent end state: **p_win ranks · ev_pct displays · edge_pct retires.** +> The abs()/null-first sort defects are worth their own small order regardless of the fork. + +> ## 🔧 GRADE-BOARD SORT FIXED 2026-07-29 (spec `specs/grade-board-sort.md`): signed signal, missing sorts LAST +> Display ORDERING only — no grade, ledger, lock_line, scoring, or edge_pct scale/display change. +> **THREE PREMISE BREAKS found REPORT-FIRST, before code:** (1) **`/api/props/top-graded` returns 404 +> in prod** — it does not exist in `src/` (only 3 axios *callers*), so the Next proxy catches → +> `{props:[]}` → the dashboard board renders `proofMode`/empty and **the edge sort orders nothing on +> that surface today**. CORRECTION to my prior order: its "97.3% of rows tie → the edge key decides the +> board" was a LEDGER measurement I extrapolated to this board — wrong; the board has no rows. The fix +> is still correct-in-itself and lands the moment the feed is restored. (2) **p_win CANNOT be a +> client-side sort key for all tiers** — `utils/snapshotGating.stripModelPrice` (Session 67) strips +> `p_win`/`ev_pct`/`model_odds`/`value`/`takeable` for unentitled tiers because *"shipping p_win is +> shipping the model price in a different base"*, and `selectTopGrades` runs in the BROWSER. Ranking +> there by p_win for everyone would REVERSE that gate. **VERIFIED LIVE: prod `/api/snapshot` returns +> p_win on 0/8 MLB and 0/25 WNBA grades** (stripped, as designed). (3) **The ladder cannot take the +> takeable gate** — rungs carry NO per-rung price (books price each line differently; we don't fetch +> them) and `isTakeable` is a property of price alone. +> **WHAT SHIPPED.** `selectTopGrades`: `grade → confidence → takeable-gated p_win (nulls LAST) → +> SIGNED edge (nulls LAST) → input order`. `Math.abs()` GONE — `edge` is signed by direction upstream +> so positive = the model AGREES; `|edge|` had been ranking the model's strongest DISAGREEMENTS level +> with its agreements (177 public ledger rows carry a negative edge). `Math.abs(-Infinity)=Infinity` +> GONE — a missing signal sorted FIRST (absent data as the top pick, the `Number(null)` class); it now +> sorts LAST and rows are never dropped. **Scales are never mixed** (p_win 0..1 vs edge % — 0.62 vs 62 +> is not a comparison). Takeable band = `web/src/lib/valueState.isTakeable`, asserted by test to be +> byte-equal to the hero's `config/valueEngine.isTakeable` (−160..+200) incl. strict-null. +> **Alt-line ladder** (`analyzeViaEngine1:506`): was `edge_pct desc` (and `Number(x)||0` collapsed +> absent edges to mid-pack); now ordered **highest-p_win-first derived ANALYTICALLY at zero added +> compute** — `P(stat ≥ k)` is monotone non-increasing in k, so p_win-desc is exactly line-ASC for an +> over and line-DESC for an under. `base` stays marked, so order never implies a recommendation; no +> consumer depends on `alt_lines[0]` (grepped), and `deskShowcaseService.rungsOf:40` already re-sorted +> by line anyway. +> **FINGERPRINTED ON REAL DATA (both sports, both paths).** Unentitled path, live prod snapshots: +> **WNBA (n=25) ordering CHANGED**, MLB (n=8) unchanged (its top edges were already positive); +> **within every (grade,confidence) tie group the signed edge is non-increasing — 20 adjacent pairs, +> 0 violations**. Entitled path, 40 real ledger rows carrying p_win+locked_odds: p_win-descending +> within tie groups, **untakeable chalk correctly NOT promoted** (Trea Turner p_win .757 @−275 does +> not beat Rhyne Howard .745 @−120) — **36 pairs, 0 violations**. +> **HERO CONSISTENCY — stated honestly, they are NOT identical and should not be.** Same signal, same +> gate, DIFFERENT precedence by contract: the board is `top GRADES` (grade-tier first), the hero is +> `top read` (p_win first). On the real rows the board leads with Angel Reese (A, p_win .555) while +> the hero picks Brionna Jones (B, p_win .90). **Within the leading tier they agree exactly (verified +> true).** That is a difference of question, not a contradiction — do not "fix" it by making the board +> ignore grade. +> **FLOOR: 310 suites / 3864 tests green, web build exit 0.** New `tests/unit/gradeBoardSort.test.js` +> locks: disagreement never outranks agreement, missing sorts LAST and stays present, null/'' edge is +> absent-not-zero, takeable p_win beats untakeable higher-p_win chalk, scales never mixed, the two +> takeable bands match, grade tier still dominates, and the ladder order for BOTH directions. +> **HELD:** edge_pct rescale/display retirement (Order B) · building the missing +> `/api/props/top-graded` server selector (that is what would make the board render at all) · +> exposing p_win to unentitled tiers. **Dashboard + Desk visuals are auth/feed-gated → TAGGED FOR +> THE CHROME AUDIT, no visual faked.** + - **Redirect EXISTS + WIRED:** `closingCapture.buildCaptureRows`→`closing_captures` (append-only, provenance: captured_at/book/line_type/both-prices/missed_reason) via `intradayRefreshService:221` + internal endpoint; `ledgerService.attachClosingProb`→`closing_prob` (de-vigs both raw sides, @@ -243,12 +383,12 @@ exist locally; harmless, the data restores completely. | Item | Status | Note | |---|---|---| -| **Settlement: 0 pushes / 470 settled** | 🔴 OPEN, unstarted | Implausible — hits/TB land on the number regularly. Exact-number push almost certainly mis-scored as hit or miss. Corrupts every accuracy/ROI number. | +| **Settlement: 0 pushes / 470 settled** | ✅ **CLOSED 2026-07-29 — premise re-verified, NOT a bug** | The ruling's basis STILL HOLDS: the feed is **100% half-numbers**. 0 whole-number lines in **117,970 captured market lines** (5 books, 16 markets, `book`+`sharp`, Jul 20–29), 6,050 `model_snapshots` (incl. refusals), 1,141 ledger rows, 173 `lock_lines` (today). All 992 settled actuals are INTEGERS → **smallest actual-vs-line gap across all 992 = 0.5**, the arithmetic minimum. Expected pushes = **exactly 0 (P=0)**, not chance. Push branch sound + tested; CHECK constraints accept `'push'`. See the verify block above. | | **~28 props/day never settle** | 🔴 OPEN, unstarted | Jul 17 MLB 86 graded/57 settled; Jul 18 103/75. Cause undiagnosed. | | **Model-version contamination** | 🟠 PERMANENT, mitigate | `ledger_entries` mixes pre/post-2026-07-19-fix grades with no marker; eras cannot be separated retroactively. **Any backtest/accuracy claim off existing ledger history MUST treat the fix boundary as a hard cutoff.** `model_snapshots` stamps `model_version`+`code_sha` so it can't recur. | | **A-grade unreachable in prod** | 🔴 OPEN | `opp_rank_stat` null; ESPN team endpoint has no defensive metric at all. Marketing hold stands. | | **EV overconfident** | 🟠 OPEN | Needs calibration before it drives any surface. Hero v2 already ranks on it. | -| **`edge_pct` broken scale (U-deg pt 2)** | 🔴 OPEN | 51.5% of ledger rows exceed the sane cap; worst 620. 13 frontend surfaces render it; **nothing renders `ev_pct`**; it's the free-tier hook; it's written to the append-only `edge` column every cron. | +| **`edge_pct` broken scale (U-deg pt 2)** | 🔴 OPEN — **DIAGNOSED 2026-07-29, fork reported, not chosen** | Re-verified: **44.0% over cap-40 (502/1141)**, not 51.5%; **worst 620 exact**. MLB median 60 / max 620 (86% of MLB rows are 0.5 lines); **WNBA sane** (median 12, 0% >100). Cause = **small-denominator explosion**, NOT units. **Only 3 surfaces RENDER it** (not 13): GradeResultCard (uncapped, auth-gated), DeskShowcase (already honest "—"), SoccerGradeResult (uncapped, orphan). **It DRIVES the dashboard top-10 sort** (operative on 97.3% of rows) + the Desk alt-ladder. `ev_pct` **DOES** have a live render site (PriceTriplet) — starved, not unwired. **Recommendation: HIDE + re-point the sort at p_win.** See the diagnosis block above. | | **CLV broken (C4)** | 🔴 OPEN | `closing_line == locked_line` on ~95% of rows. BEAT CLOSE suppressed. **CLV ledger stays PRIVATE until backtest-proven.** | | **Consistency CV floor** | 🟠 STOPGAP | `CONSISTENCY_MIN_MEAN=4` leaves a ±1.0 dead for MLB low-count stats. Real fix = index-of-dispersion classifier; needs a backtest first. | diff --git a/specs/grade-board-sort.md b/specs/grade-board-sort.md new file mode 100644 index 0000000..e91edb8 --- /dev/null +++ b/specs/grade-board-sort.md @@ -0,0 +1,73 @@ +# SPEC — Fix the grade-board sort (display ordering only) + +**Status:** built 2026-07-29. Report-first found three premise breaks — see §2. +**Scope:** display ORDERING only. No grade, ledger row, lock_line, scoring, model, +or edge_pct scale/display change. Push scoring untouched. + +## 1. The two defects (wrong at ANY scale, independent of edge_pct's retirement) + +`web/src/lib/slateAdapter.js selectTopGrades` ranked on +`edge: Math.abs(numOr(g.edge, -Infinity))`: + +1. **abs() on an already-signed value.** `edge` is signed BY DIRECTION upstream + (`edgePctFor`: `over ? proj−line : line−proj`), so **positive = the model AGREES + with the graded side**. Taking `|edge|` ranked the model's strongest + DISAGREEMENTS equal to its strongest agreements. 177 public ledger rows carry a + negative edge (58 B / 118 C / 1 F, worst −86.7). +2. **`Math.abs(-Infinity) === Infinity`** → a row with NO edge sorted **FIRST**. + Absent data presented as the top pick — the `Number(null)` fabrication class. + +`src/services/intelligence/analyzeViaEngine1.js:506` sorted the Desk alt-line +ladder by `edge_pct` desc — the same price-free 0.5-line artifact. + +## 2. REPORT-FIRST — three premise breaks found before building + +- **B1. Site 1's board is fed by a 404.** `/api/props/top-graded` **does not exist** + in `src/` (only three axios *callers* reference it) and returns **404 in prod**. + The Next proxy catches → `{props: []}` → `topGrades = []` → `selectTopGrades([])` + → the dashboard renders `proofMode` (yesterday's receipts) or honest empty copy. + **The edge sort orders nothing on that surface today.** CORRECTION to the prior + order: its "97.3% of rows tie → the edge key decides the board" was a LEDGER + population measurement extrapolated to this board; the board has no rows to order. + The fix is still correct-in-itself and lands the moment the feed is restored. +- **B2. p_win CANNOT be the client-side sort key.** `src/utils/snapshotGating.js` + (Session 67) strips `p_win`/`ev_pct`/`model_odds`/`value`/`takeable` for + unentitled tiers, with the explicit rationale *"shipping p_win is shipping the + price in a different base."* `selectTopGrades` runs in the BROWSER. Ranking there + by p_win for all tiers would REVERSE that gate. Implemented instead: + **p_win is used WHEN THE ROW CARRIES IT** (entitled tiers / server callers), + takeable-gated identically to the hero; unentitled tiers fall through to the + signed edge uniformly. Scales are NEVER mixed in one comparator. +- **B3. The ladder cannot take the takeable gate, and p_win order there is + ANALYTICALLY the line order.** Ladder rungs carry **no per-rung price** (books + price each line differently; we do not fetch them), and `isTakeable` is a + property of price alone → inapplicable per rung. And `P(stat ≥ k)` is monotone + non-increasing in `k`, so **p_win-desc ≡ line-asc for an over, line-desc for an + under**. Implemented as the direction-aware line order = exactly p_win-desc, at + zero added compute. (`deskShowcaseService.rungsOf:40` already re-sorted rungs by + line, discarding the edge order — so only `GradeResultCard` ever showed it.) + +## 3. What ships + +- `selectTopGrades`: `grade → confidence → takeable-gated p_win (nulls last) → + SIGNED edge (nulls last) → input order`. No `abs()`. Missing signal ranks LAST, + rows are never dropped. +- Alt-line ladder: ordered by highest p_win first, computed via the monotonic + line equivalence (direction-aware). No `edge_pct` in the sort. +- The takeable band is `web/src/lib/valueState.isTakeable` (−160..+200), which + mirrors `src/config/valueEngine.isTakeable` — the hero's exact definition. + +## 4. Acceptance criteria + +1. A disagreement (negative-edge) prop does NOT outrank an agreement at equal + grade+confidence. +2. A missing-signal row sorts LAST and is still PRESENT. +3. A takeable p_win row outranks a higher-p_win UNTAKEABLE (chalk) row. +4. p_win and edge are never compared against each other. +5. Ladder rungs are ordered highest-p_win-first for both over and under. +6. No grade/ledger/lock_line/scoring write. Full suite green, web build exit 0. + +## 5. Held (NOT this order) + +edge_pct rescale or display retirement (Order B) · building the missing +`/api/props/top-graded` server selector · exposing p_win to unentitled tiers. diff --git a/src/services/intelligence/analyzeViaEngine1.js b/src/services/intelligence/analyzeViaEngine1.js index 9965c2d..57c05af 100644 --- a/src/services/intelligence/analyzeViaEngine1.js +++ b/src/services/intelligence/analyzeViaEngine1.js @@ -503,7 +503,23 @@ async function analyzeViaEngine1(rawProp = {}) { }, { edgePct: edgePctFor(features, { ...shiftedProp, stat_type: rawProp.stat_type, direction: prop.direction }) }); return { line: ln, grade: adapted.grade, edge_pct: adapted.edge_pct, base: ln === baseLine }; }) - .sort((a, b) => (Number(b.edge_pct) || 0) - (Number(a.edge_pct) || 0)); + // SORT FIX (2026-07-29, specs/grade-board-sort.md). Was + // `edge_pct desc` — a price-free (proj−line)/line artifact whose scale is + // a function of line size, so on a 0.5 line it explodes and ordered the + // ladder by nothing meaningful. `Number(x) || 0` also collapsed absent + // edges to 0 (mid-pack). + // + // Now ordered HIGHEST-p_win-FIRST, derived analytically at zero added + // compute: P(stat ≥ k) is monotone NON-INCREASING in k, so for an OVER + // p_win-desc is exactly line-ASC, and for an UNDER (p_win = 1 − p_over) + // it is exactly line-DESC. Rungs carry NO per-rung price — books price + // each line differently and we do not fetch them — so the hero's + // takeable gate (a property of price alone) is inapplicable here; that + // is why this ranks on probability order only. The `base` rung stays + // marked, so ordering never implies a recommendation. + .sort((a, b) => (String(prop.direction || 'over').toLowerCase() === 'under' + ? Number(b.line) - Number(a.line) + : Number(a.line) - Number(b.line))); if (ladder.length > 1) legacy.alt_lines = ladder; } } catch { /* the ladder is additive — never breaks the read */ } diff --git a/tests/unit/gradeBoardSort.test.js b/tests/unit/gradeBoardSort.test.js new file mode 100644 index 0000000..39ae9aa --- /dev/null +++ b/tests/unit/gradeBoardSort.test.js @@ -0,0 +1,134 @@ +/** + * Grade-board sort (specs/grade-board-sort.md) — display ORDERING only. + * + * Locks the two defects that were wrong at ANY scale: + * 1. abs() on an already-direction-signed edge ranked DISAGREEMENTS level with + * agreements. + * 2. Math.abs(-Infinity) === Infinity made a MISSING signal sort FIRST. + * Plus: the takeable gate matches the hero, and p_win/edge scales never mix. + */ + +const adapter = require('../../web/src/lib/slateAdapter'); +const { isTakeable } = require('../../web/src/lib/valueState'); +const { isTakeable: backendIsTakeable } = require('../../src/config/valueEngine'); + +const names = (rows) => rows.map((r) => r.player); + +describe('selectTopGrades — signed signal, missing sorts LAST', () => { + test('a DISAGREEMENT does not outrank an AGREEMENT at equal grade+confidence', () => { + // edge is signed by direction: positive = model agrees with the graded side. + // Old |edge| ranked -80 (strong disagreement) above +10 (mild agreement). + const grades = [ + { player: 'disagrees', grade: 'B', confidence: 50, edge: -80 }, + { player: 'agrees', grade: 'B', confidence: 50, edge: 10 }, + ]; + expect(names(adapter.selectTopGrades(grades, 10))).toEqual(['agrees', 'disagrees']); + }); + + test('a MISSING signal sorts LAST and is still PRESENT (never dropped)', () => { + const grades = [ + { player: 'no-signal', grade: 'B', confidence: 50 }, + { player: 'weak-but-real', grade: 'B', confidence: 50, edge: 0.1 }, + { player: 'negative-but-real', grade: 'B', confidence: 50, edge: -5 }, + ]; + const out = names(adapter.selectTopGrades(grades, 10)); + expect(out).toEqual(['weak-but-real', 'negative-but-real', 'no-signal']); + expect(out).toHaveLength(3); // present, not dropped + expect(out[out.length - 1]).toBe('no-signal'); + }); + + test('null/empty-string edge is absent, NOT zero (Number(null) === 0 guard)', () => { + const grades = [ + { player: 'nullish', grade: 'B', confidence: 50, edge: null }, + { player: 'empty', grade: 'B', confidence: 50, edge: '' }, + { player: 'real-negative', grade: 'B', confidence: 50, edge: -1 }, + ]; + // A real negative beats two absents; absents keep input order at the bottom. + expect(names(adapter.selectTopGrades(grades, 10))).toEqual(['real-negative', 'nullish', 'empty']); + }); +}); + +describe('selectTopGrades — takeable-gated p_win outranks edge, scales never mix', () => { + test('takeable p_win row outranks an UNTAKEABLE higher-p_win chalk row', () => { + const grades = [ + { player: 'chalk', grade: 'B', confidence: 50, p_win: 0.92, book_odds: -300 }, // untakeable + { player: 'takeable', grade: 'B', confidence: 50, p_win: 0.61, book_odds: -120 }, + ]; + expect(names(adapter.selectTopGrades(grades, 10))[0]).toBe('takeable'); + }); + + test('p_win is preferred over edge, and a p_win row outranks an edge-only row', () => { + const grades = [ + { player: 'edge-only', grade: 'B', confidence: 50, edge: 300 }, + { player: 'has-pwin', grade: 'B', confidence: 50, p_win: 0.55, book_odds: 100 }, + ]; + // 0.55 must NOT be compared against 300 — the p_win-bearing row wins on the + // earlier key instead (scales never mixed in one comparator). + expect(names(adapter.selectTopGrades(grades, 10))[0]).toBe('has-pwin'); + }); + + test('among takeable p_win rows the HIGHER p_win wins', () => { + const grades = [ + { player: 'lower', grade: 'B', confidence: 50, p_win: 0.55, book_odds: -110 }, + { player: 'higher', grade: 'B', confidence: 50, p_win: 0.71, book_odds: -110 }, + ]; + expect(names(adapter.selectTopGrades(grades, 10))[0]).toBe('higher'); + }); + + test('gradedAt.odds is accepted as the price when book_odds is absent', () => { + const grades = [ + { player: 'via-gradedAt', grade: 'B', confidence: 50, p_win: 0.66, gradedAt: { odds: -115 } }, + { player: 'edge-only', grade: 'B', confidence: 50, edge: 5 }, + ]; + expect(names(adapter.selectTopGrades(grades, 10))[0]).toBe('via-gradedAt'); + }); + + test('the frontend takeable band MATCHES the backend hero gate exactly', () => { + for (const price of [-400, -160, -159, -110, 0, 100, 200, 201, 500]) { + expect(isTakeable(price)).toBe(backendIsTakeable(price)); + } + // and the strict-null contract both sides + expect(isTakeable(null)).toBe(false); + expect(backendIsTakeable(null)).toBe(false); + }); + + test('grade tier still dominates every signal', () => { + const grades = [ + { player: 'B-strong', grade: 'B', confidence: 99, p_win: 0.99, book_odds: -110 }, + { player: 'A-weak', grade: 'A', confidence: 1, edge: -50 }, + ]; + expect(names(adapter.selectTopGrades(grades, 10))[0]).toBe('A-weak'); + }); +}); + +describe('alt-line ladder — ordered highest-p_win-first via the monotonic line rule', () => { + // P(stat >= k) is monotone non-increasing in k, so p_win-desc is line-ASC for an + // over and line-DESC for an under. Assert the ordering the engine emits. + const ladderOrder = (direction, lines) => { + const rungs = lines.map((line) => ({ line })); + return rungs + .slice() + .sort((a, b) => (String(direction).toLowerCase() === 'under' + ? Number(b.line) - Number(a.line) + : Number(a.line) - Number(b.line))) + .map((r) => r.line); + }; + + test('OVER: lowest line (highest p_win) first', () => { + expect(ladderOrder('over', [1.5, 0.5, 2.5, 1, 2])).toEqual([0.5, 1, 1.5, 2, 2.5]); + }); + + test('UNDER: highest line (highest p_win) first', () => { + expect(ladderOrder('under', [1.5, 0.5, 2.5, 1, 2])).toEqual([2.5, 2, 1.5, 1, 0.5]); + }); + + test('the engine sorts its ladder by that rule, NOT by edge_pct', () => { + const src = require('fs').readFileSync( + require('path').join(__dirname, '../../src/services/intelligence/analyzeViaEngine1.js'), + 'utf8', + ); + // the old key must be gone from the ladder sort + expect(src).not.toMatch(/sort\(\(a, b\) => \(Number\(b\.edge_pct\)/); + expect(src).toMatch(/Number\(b\.line\) - Number\(a\.line\)/); + }); +}); diff --git a/web/public/sw.js b/web/public/sw.js index 9693299..f52c883 100644 --- a/web/public/sw.js +++ b/web/public/sw.js @@ -1,2 +1,2 @@ (()=>{"use strict";let e,t,a,s,r,i={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"serwist",runtime:"runtime",suffix:"u">typeof registration?registration.scope:""},n=e=>[i.prefix,e,i.suffix].filter(e=>e&&e.length>0).join("-"),c=e=>e||n(i.precache),o=e=>e||n(i.runtime);var l=class extends Error{details;constructor(e,t){super(((e,...t)=>{let a=e;return t.length>0&&(a+=` :: ${JSON.stringify(t)}`),a})(e,t)),this.name=e,this.details=t}};function h(e){return new Promise(t=>setTimeout(t,e))}let u=new Set;function d(e,t){let a=new URL(e);for(let e of t)a.searchParams.delete(e);return a.href}async function f(e,t,a,s){let r=d(t.url,a);if(t.url===r)return e.match(t,s);let i={...s,ignoreSearch:!0};for(let n of(await e.keys(t,i)))if(r===d(n.url,a))return e.match(n,s)}var p=class{promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};let m=async()=>{for(let e of u)await e()},w="-precache-",g=async(e,t=w)=>{let a=(await self.caches.keys()).filter(a=>a.includes(t)&&a.includes(self.registration.scope)&&a!==e);return await Promise.all(a.map(e=>self.caches.delete(e))),a},y=(e,t)=>{let a=t();return e.waitUntil(a),a},_=(e,t)=>t.some(t=>e instanceof t),b=new WeakMap,v=new WeakMap,R=new WeakMap,E={get(e,t,a){if(e instanceof IDBTransaction){if("done"===t)return b.get(e);if("store"===t)return a.objectStoreNames[1]?void 0:a.objectStore(a.objectStoreNames[0])}return q(e[t])},set:(e,t,a)=>(e[t]=a,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function q(e){if(e instanceof IDBRequest){let t;return t=new Promise((t,a)=>{let s=()=>{e.removeEventListener("success",r),e.removeEventListener("error",i)},r=()=>{t(q(e.result)),s()},i=()=>{a(e.error),s()};e.addEventListener("success",r),e.addEventListener("error",i)}),R.set(t,e),t}if(v.has(e))return v.get(e);let t=function(e){if("function"==typeof e)return(r||(r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),q(this.request)}:function(...t){return q(e.apply(x(this),t))};return(e instanceof IDBTransaction&&function(e){if(b.has(e))return;let t=new Promise((t,a)=>{let s=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",i),e.removeEventListener("abort",i)},r=()=>{t(),s()},i=()=>{a(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",r),e.addEventListener("error",i),e.addEventListener("abort",i)});b.set(e,t)}(e),_(e,s||(s=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(e,E):e}(e);return t!==e&&(v.set(e,t),R.set(t,e)),t}let x=e=>R.get(e);function D(e,t,{blocked:a,upgrade:s,blocking:r,terminated:i}={}){let n=indexedDB.open(e,t),c=q(n);return s&&n.addEventListener("upgradeneeded",e=>{s(q(n.result),e.oldVersion,e.newVersion,q(n.transaction),e)}),a&&n.addEventListener("blocked",e=>a(e.oldVersion,e.newVersion,e)),c.then(e=>{i&&e.addEventListener("close",()=>i()),r&&e.addEventListener("versionchange",e=>r(e.oldVersion,e.newVersion,e))}).catch(()=>{}),c}let S=["get","getKey","getAll","getAllKeys","count"],k=["put","add","delete","clear"],T=new Map;function P(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(T.get(t))return T.get(t);let a=t.replace(/FromIndex$/,""),s=t!==a,r=k.includes(a);if(!(a in(s?IDBIndex:IDBObjectStore).prototype)||!(r||S.includes(a)))return;let i=async function(e,...t){let i=this.transaction(e,r?"readwrite":"readonly"),n=i.store;return s&&(n=n.index(t.shift())),(await Promise.all([n[a](...t),r&&i.done]))[0]};return T.set(t,i),i}E={...e=E,get:(t,a,s)=>P(t,a)||e.get(t,a,s),has:(t,a)=>!!P(t,a)||e.has(t,a)};let C=["continue","continuePrimaryKey","advance"],N={},I=new WeakMap,U=new WeakMap,L={get(e,t){if(!C.includes(t))return e[t];let a=N[t];return a||(a=N[t]=function(...e){I.set(this,U.get(this)[t](...e))}),a}};async function*A(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let a=new Proxy(t,L);for(U.set(a,t),R.set(a,x(t));t;)yield a,t=await (I.get(a)||t.continue()),I.delete(a)}function O(e,t){return t===Symbol.asyncIterator&&_(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&_(e,[IDBIndex,IDBObjectStore])}E={...t=E,get:(e,a,s)=>O(e,a)?A:t.get(e,a,s),has:(e,a)=>O(e,a)||t.has(e,a)};let M=async(e,t)=>{let s=null;if(e.url&&(s=new URL(e.url).origin),s!==self.location.origin)throw new l("cross-origin-copy-response",{origin:s});let r=e.clone(),i={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},n=t?t(i):i,c=!function(){if(void 0===a){let e=new Response("");if("body"in e)try{new Response(e.body),a=!0}catch{a=!1}a=!1}return a}()?await r.blob():r.body;return new Response(c,n)},B="requests",K="queueName";var F=class{_db=null;async addEntry(e){let t=(await this.getDb()).transaction(B,"readwrite",{durability:"relaxed"});await t.store.add(e),await t.done}async getFirstEntryId(){return(await (await this.getDb()).transaction(B).store.openCursor())?.value.id}async getAllEntriesByQueueName(e){return await (await this.getDb()).getAllFromIndex(B,K,IDBKeyRange.only(e))||[]}async getEntryCountByQueueName(e){return(await this.getDb()).countFromIndex(B,K,IDBKeyRange.only(e))}async deleteEntry(e){await (await this.getDb()).delete(B,e)}async getFirstEntryByQueueName(e){return await this.getEndEntryFromIndex(IDBKeyRange.only(e),"next")}async getLastEntryByQueueName(e){return await this.getEndEntryFromIndex(IDBKeyRange.only(e),"prev")}async getEndEntryFromIndex(e,t){return(await (await this.getDb()).transaction(B).store.index(K).openCursor(e,t))?.value}async getDb(){return this._db||(this._db=await D("serwist-background-sync",3,{upgrade:this._upgradeDb})),this._db}_upgradeDb(e,t){t>0&&t<3&&e.objectStoreNames.contains(B)&&e.deleteObjectStore(B),e.createObjectStore(B,{autoIncrement:!0,keyPath:"id"}).createIndex(K,K,{unique:!1})}},W=class{_queueName;_queueDb;constructor(e){this._queueName=e,this._queueDb=new F}async pushEntry(e){delete e.id,e.queueName=this._queueName,await this._queueDb.addEntry(e)}async unshiftEntry(e){let t=await this._queueDb.getFirstEntryId();t?e.id=t-1:delete e.id,e.queueName=this._queueName,await this._queueDb.addEntry(e)}async popEntry(){return this._removeEntry(await this._queueDb.getLastEntryByQueueName(this._queueName))}async shiftEntry(){return this._removeEntry(await this._queueDb.getFirstEntryByQueueName(this._queueName))}async getAll(){return await this._queueDb.getAllEntriesByQueueName(this._queueName)}async size(){return await this._queueDb.getEntryCountByQueueName(this._queueName)}async deleteEntry(e){await this._queueDb.deleteEntry(e)}async _removeEntry(e){return e&&await this.deleteEntry(e.id),e}};let j=["method","referrer","referrerPolicy","mode","credentials","cache","redirect","integrity","keepalive"];var H=class e{_requestData;static async fromRequest(t){let a={url:t.url,headers:{}};for(let e of("GET"!==t.method&&(a.body=await t.clone().arrayBuffer()),t.headers.forEach((e,t)=>{a.headers[t]=e}),j))void 0!==t[e]&&(a[e]=t[e]);return new e(a)}constructor(e){"navigate"===e.mode&&(e.mode="same-origin"),this._requestData=e}toObject(){let e=Object.assign({},this._requestData);return e.headers=Object.assign({},this._requestData.headers),e.body&&(e.body=e.body.slice(0)),e}toRequest(){return new Request(this._requestData.url,this._requestData)}clone(){return new e(this.toObject())}};let $="serwist-background-sync",V=new Set,Q=e=>{let t={request:new H(e.requestData).toRequest(),timestamp:e.timestamp};return e.metadata&&(t.metadata=e.metadata),t};var G=class{_name;_onSync;_maxRetentionTime;_queueStore;_forceSyncFallback;_syncInProgress=!1;_requestsAddedDuringSync=!1;constructor(e,{forceSyncFallback:t,onSync:a,maxRetentionTime:s}={}){if(V.has(e))throw new l("duplicate-queue-name",{name:e});V.add(e),this._name=e,this._onSync=a||this.replayRequests,this._maxRetentionTime=s||10080,this._forceSyncFallback=!!t,this._queueStore=new W(this._name),this._addSyncListener()}get name(){return this._name}async pushRequest(e){await this._addRequest(e,"push")}async unshiftRequest(e){await this._addRequest(e,"unshift")}async popRequest(){return this._removeRequest("pop")}async shiftRequest(){return this._removeRequest("shift")}async getAll(){let e=await this._queueStore.getAll(),t=Date.now(),a=[];for(let s of e){let e=60*this._maxRetentionTime*1e3;t-s.timestamp>e?await this._queueStore.deleteEntry(s.id):a.push(Q(s))}return a}async size(){return await this._queueStore.size()}async _addRequest({request:e,metadata:t,timestamp:a=Date.now()},s){let r={requestData:(await H.fromRequest(e.clone())).toObject(),timestamp:a};switch(t&&(r.metadata=t),s){case"push":await this._queueStore.pushEntry(r);break;case"unshift":await this._queueStore.unshiftEntry(r)}this._syncInProgress?this._requestsAddedDuringSync=!0:await this.registerSync()}async _removeRequest(e){let t,a=Date.now();switch(e){case"pop":t=await this._queueStore.popEntry();break;case"shift":t=await this._queueStore.shiftEntry()}if(t){let s=60*this._maxRetentionTime*1e3;return a-t.timestamp>s?this._removeRequest(e):Q(t)}}async replayRequests(){let e;for(;e=await this.shiftRequest();)try{await fetch(e.request.clone())}catch{throw await this.unshiftRequest(e),new l("queue-replay-failed",{name:this._name})}}async registerSync(){if("sync"in self.registration&&!this._forceSyncFallback)try{await self.registration.sync.register(`${$}:${this._name}`)}catch(e){}}_addSyncListener(){"sync"in self.registration&&!this._forceSyncFallback?self.addEventListener("sync",e=>{if(e.tag===`${$}:${this._name}`){let t=async()=>{let t;this._syncInProgress=!0;try{await this._onSync({queue:this})}catch(e){if(e instanceof Error)throw e}finally{this._requestsAddedDuringSync&&!(t&&!e.lastChance)&&await this.registerSync(),this._syncInProgress=!1,this._requestsAddedDuringSync=!1}};e.waitUntil(t())}}):this._onSync({queue:this})}static get _queueNames(){return V}},z=class{_queue;constructor(e,t){this._queue=new G(e,t)}async fetchDidFail({request:e}){await this._queue.pushRequest({request:e})}};let Y={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};function J(e){return"string"==typeof e?new Request(e):e}var X=class{event;request;url;params;_cacheKeys={};_strategy;_handlerDeferred;_extendLifetimePromises;_plugins;_pluginStateMap;constructor(e,t){for(const a of(this.event=t.event,this.request=t.request,t.url&&(this.url=t.url,this.params=t.params),this._strategy=e,this._handlerDeferred=new p,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map,this._plugins))this._pluginStateMap.set(a,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:t}=this,a=J(e),s=await this.getPreloadResponse();if(s)return s;let r=this.hasCallback("fetchDidFail")?a.clone():null;try{for(let e of this.iterateCallbacks("requestWillFetch"))a=await e({request:a.clone(),event:t})}catch(e){if(e instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:e.message})}let i=a.clone();try{let e;for(let s of(e=await fetch(a,"navigate"===a.mode?void 0:this._strategy.fetchOptions),this.iterateCallbacks("fetchDidSucceed")))e=await s({event:t,request:i,response:e});return e}catch(e){throw r&&await this.runCallbacks("fetchDidFail",{error:e,event:t,originalRequest:r.clone(),request:i.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),a=t.clone();return this.waitUntil(this.cachePut(e,a)),t}async cacheMatch(e){let t,a=J(e),{cacheName:s,matchOptions:r}=this._strategy,i=await this.getCacheKey(a,"read"),n={...r,cacheName:s};for(let e of(t=await caches.match(i,n),this.iterateCallbacks("cachedResponseWillBeUsed")))t=await e({cacheName:s,matchOptions:r,cachedResponse:t,request:i,event:this.event})||void 0;return t}async cachePut(e,t){let a=J(e);await h(0);let s=await this.getCacheKey(a,"write");if(!t)throw new l("cache-put-with-no-response",{url:new URL(String(s.url),location.href).href.replace(RegExp(`^${location.origin}`),"")});let r=await this._ensureResponseSafeToCache(t);if(!r)return!1;let{cacheName:i,matchOptions:n}=this._strategy,c=await self.caches.open(i),o=this.hasCallback("cacheDidUpdate"),u=o?await f(c,s.clone(),["__WB_REVISION__"],n):null;try{await c.put(s,o?r.clone():r)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await m(),e}for(let e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:i,oldResponse:u,newResponse:r.clone(),request:s,event:this.event});return!0}async getCacheKey(e,t){let a=`${e.url} | ${t}`;if(!this._cacheKeys[a]){let s=e;for(let e of this.iterateCallbacks("cacheKeyWillBeUsed"))s=J(await e({mode:t,request:s,event:this.event,params:this.params}));this._cacheKeys[a]=s}return this._cacheKeys[a]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let a of this.iterateCallbacks(e))await a(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if("function"==typeof t[e]){let a=this._pluginStateMap.get(t),s=s=>{let r={...s,state:a};return t[e](r)};yield s}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async getPreloadResponse(){if(this.event instanceof FetchEvent&&"navigate"===this.event.request.mode&&"preloadResponse"in this.event)try{let e=await this.event.preloadResponse;if(e)return e}catch(e){return}}async _ensureResponseSafeToCache(e){let t=e,a=!1;for(let e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,a=!0,!t)break;return!a&&t&&200!==t.status&&(t=void 0),t}},Z=class{cacheName;plugins;fetchOptions;matchOptions;constructor(e={}){this.cacheName=o(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,a="string"==typeof e.request?new Request(e.request):e.request,s=new X(this,e.url?{event:t,request:a,url:e.url,params:e.params}:{event:t,request:a}),r=this._getResponse(s,a,t);return[r,this._awaitComplete(r,s,a,t)]}async _getResponse(e,t,a){let s;await e.runCallbacks("handlerWillStart",{event:a,request:t});try{if(s=await this._handle(t,e),void 0===s||"error"===s.type)throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(let i of e.iterateCallbacks("handlerDidError"))if(void 0!==(s=await i({error:r,event:a,request:t})))break}if(!s)throw r}for(let r of e.iterateCallbacks("handlerWillRespond"))s=await r({event:a,request:t,response:s});return s}async _awaitComplete(e,t,a,s){let r,i;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:s,request:a,response:r}),await t.doneWaiting()}catch(e){e instanceof Error&&(i=e)}if(await t.runCallbacks("handlerDidComplete",{event:s,request:a,response:r,error:i}),t.destroy(),i)throw i}},ee=class extends Z{_networkTimeoutSeconds;constructor(e={}){super(e),this.plugins.some(e=>"cacheWillUpdate"in e)||this.plugins.unshift(Y),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(e,t){let a,s=[],r=[];if(this._networkTimeoutSeconds){let{id:i,promise:n}=this._getTimeoutPromise({request:e,logs:s,handler:t});a=i,r.push(n)}let i=this._getNetworkPromise({timeoutId:a,request:e,logs:s,handler:t});r.push(i);let n=await t.waitUntil((async()=>await t.waitUntil(Promise.race(r))||await i)());if(!n)throw new l("no-response",{url:e.url});return n}_getTimeoutPromise({request:e,logs:t,handler:a}){let s;return{promise:new Promise(t=>{s=setTimeout(async()=>{t(await a.cacheMatch(e))},1e3*this._networkTimeoutSeconds)}),id:s}}async _getNetworkPromise({timeoutId:e,request:t,logs:a,handler:s}){let r,i;try{i=await s.fetchAndCachePut(t)}catch(e){e instanceof Error&&(r=e)}return e&&clearTimeout(e),(r||!i)&&(i=await s.cacheMatch(t)),i}},et=class extends Z{_networkTimeoutSeconds;constructor(e={}){super(e),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(e,t){let a,s;try{let a=[t.fetch(e)];if(this._networkTimeoutSeconds){let e=h(1e3*this._networkTimeoutSeconds);a.push(e)}if(!(s=await Promise.race(a)))throw Error(`Timed out the network response after ${this._networkTimeoutSeconds} seconds.`)}catch(e){e instanceof Error&&(a=e)}if(!s)throw new l("no-response",{url:e.url,error:a});return s}};let ea=e=>e&&"object"==typeof e?e:{handle:e};var es=class{handler;match;method;catchHandler;constructor(e,t,a="GET"){this.handler=ea(t),this.match=e,this.method=a}setCatchHandler(e){this.catchHandler=ea(e)}},er=class e extends Z{_fallbackToNetwork;static defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e};static copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:e})=>e.redirected?await M(e):e};constructor(t={}){t.cacheName=c(t.cacheName),super(t),this._fallbackToNetwork=!1!==t.fallbackToNetwork,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){let a=await t.getPreloadResponse();if(a)return a;let s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let a,s=t.params||{};if(this._fallbackToNetwork){let r=s.integrity,i=e.integrity,n=!i||i===r;a=await t.fetch(new Request(e,{integrity:"no-cors"!==e.mode?i||r:void 0})),r&&n&&"no-cors"!==e.mode&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,a.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return a}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();let a=await t.fetch(e);if(!await t.cachePut(e,a.clone()))throw new l("bad-precaching-response",{url:e.url,status:a.status});return a}_useDefaultCacheabilityPluginIfNeeded(){let t=null,a=0;for(let[s,r]of this.plugins.entries())r!==e.copyRedirectedCacheableResponsesPlugin&&(r===e.defaultPrecacheCacheabilityPlugin&&(t=s),r.cacheWillUpdate&&a++);0===a?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):a>1&&null!==t&&this.plugins.splice(t,1)}},ei=class extends es{_allowlist;_denylist;constructor(e,{allowlist:t=[/./],denylist:a=[]}={}){super(e=>this._match(e),e),this._allowlist=t,this._denylist=a}_match({url:e,request:t}){if(t&&"navigate"!==t.mode)return!1;let a=e.pathname+e.search;for(let e of this._denylist)if(e.test(a))return!1;return!!this._allowlist.some(e=>e.test(a))}},en=class extends es{constructor(e,t,a){super(({url:t})=>{let a=e.exec(t.href);if(a)return t.origin!==location.origin&&0!==a.index?void 0:a.slice(1)},t,a)}};let ec=e=>{if(!e)throw new l("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:t,url:a}=e;if(!a)throw new l("add-to-cache-list-unexpected-type",{entry:e});if(!t){let e=new URL(a,location.href);return{cacheKey:e.href,url:e.href}}let s=new URL(a,location.href),r=new URL(a,location.href);return s.searchParams.set("__WB_REVISION__",t),{cacheKey:s.href,url:r.href}};var eo=class{updatedURLs=[];notUpdatedURLs=[];handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)};cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:a})=>{if("install"===e.type&&t?.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;a?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return a}};let el=async(e,t,a)=>{let s=t.map((e,t)=>({index:t,item:e})),r=async e=>{let t=[];for(;;){let r=s.pop();if(!r)return e(t);let i=await a(r.item);t.push({result:i,index:r.index})}},i=Array.from({length:e},()=>new Promise(r));return(await Promise.all(i)).flat().sort((e,t)=>e.indexe.result)};"u">typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);let eh="cache-entries",eu=e=>{let t=new URL(e,location.href);return t.hash="",t.href};var ed=class{_cacheName;_db=null;constructor(e){this._cacheName=e}_getId(e){return`${this._cacheName}|${eu(e)}`}_upgradeDb(e){let t=e.createObjectStore(eh,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&function(e,{blocked:t}={}){let a=indexedDB.deleteDatabase(e);t&&a.addEventListener("blocked",e=>t(e.oldVersion,e)),q(a).then(()=>void 0)}(this._cacheName)}async setTimestamp(e,t){e=eu(e);let a={id:this._getId(e),cacheName:this._cacheName,url:e,timestamp:t},s=(await this.getDb()).transaction(eh,"readwrite",{durability:"relaxed"});await s.store.put(a),await s.done}async getTimestamp(e){return(await (await this.getDb()).get(eh,this._getId(e)))?.timestamp}async expireEntries(e,t){let a=await (await this.getDb()).transaction(eh,"readwrite").store.index("timestamp").openCursor(null,"prev"),s=[],r=0;for(;a;){let i=a.value;i.cacheName===this._cacheName&&(e&&i.timestamp=t?(a.delete(),s.push(i.url)):r++),a=await a.continue()}return s}async getDb(){return this._db||(this._db=await D("serwist-expiration",1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}},ef=class{_isRunning=!1;_rerunRequested=!1;_maxEntries;_maxAgeSeconds;_matchOptions;_cacheName;_timestampModel;constructor(e,t={}){this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new ed(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;let e=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),a=await self.caches.open(this._cacheName);for(let e of t)await a.delete(e,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,this.expireEntries())}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(!this._maxAgeSeconds)return!1;let t=await this._timestampModel.getTimestamp(e),a=Date.now()-1e3*this._maxAgeSeconds;return void 0===t||t{u.add(e)})(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===o())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new ef(e,this._config),this._cacheExpirations.set(e,t)),t}cachedResponseWillBeUsed({event:e,cacheName:t,request:a,cachedResponse:s}){if(!s)return null;let r=this._isResponseDateFresh(s),i=this._getCacheExpiration(t),n="last-used"===this._config.maxAgeFrom,c=(async()=>{n&&await i.updateTimestamp(a.url),await i.expireEntries()})();try{e.waitUntil(c)}catch{}return r?s:null}_isResponseDateFresh(e){if("last-used"===this._config.maxAgeFrom)return!0;let t=Date.now();if(!this._config.maxAgeSeconds)return!0;let a=this._getDateHeaderTimestamp(e);return null===a||a>=t-1e3*this._config.maxAgeSeconds}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;let t=new Date(e.headers.get("date")).getTime();return Number.isNaN(t)?null:t}async cacheDidUpdate({cacheName:e,request:t}){let a=this._getCacheExpiration(e);await a.updateTimestamp(t.url),await a.expireEntries()}async deleteCacheAndMetadata(){for(let[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}};let em=/^\/(\w+\/)?collect/,ew=({serwist:e,cacheName:t,...a})=>{let s,r,c=t||n(i.googleAnalytics),o=new z("serwist-google-analytics",{maxRetentionTime:2880,onSync:async({queue:e})=>{let t;for(;t=await e.shiftRequest();){let{request:s,timestamp:r}=t,i=new URL(s.url);try{let e="POST"===s.method?new URLSearchParams(await s.clone().text()):i.searchParams,t=r-(Number(e.get("qt"))||0),n=Date.now()-t;if(e.set("qt",String(n)),a.parameterOverrides)for(let t of Object.keys(a.parameterOverrides)){let s=a.parameterOverrides[t];e.set(t,s)}"function"==typeof a.hitFilter&&a.hitFilter.call(null,e),await fetch(new Request(i.origin+i.pathname,{body:e.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(a){throw await e.unshiftRequest(t),a}}}});for(let t of[new es(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtm.js"===e.pathname,new ee({cacheName:c}),"GET"),new es(({url:e})=>"www.google-analytics.com"===e.hostname&&"/analytics.js"===e.pathname,new ee({cacheName:c}),"GET"),new es(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtag/js"===e.pathname,new ee({cacheName:c}),"GET"),new es(s=({url:e})=>"www.google-analytics.com"===e.hostname&&em.test(e.pathname),r=new et({plugins:[o]}),"GET"),new es(s,r,"POST")])e.registerRoute(t)};var eg=class{_fallbackUrls;_serwist;constructor({fallbackUrls:e,serwist:t}){this._fallbackUrls=e,this._serwist=t}async handlerDidError(e){for(let t of this._fallbackUrls)if("string"==typeof t){let e=await this._serwist.matchPrecache(t);if(void 0!==e)return e}else if(t.matcher(e)){let e=await this._serwist.matchPrecache(t.url);if(void 0!==e)return e}}},ey=class extends Z{async _handle(e,t){let a,s=await t.cacheMatch(e);if(s);else try{s=await t.fetchAndCachePut(e)}catch(e){e instanceof Error&&(a=e)}if(!s)throw new l("no-response",{url:e.url,error:a});return s}},e_=class extends es{constructor(e,t){super(({request:a})=>{let s=e.getUrlsToPrecacheKeys();for(let r of function*(e,{directoryIndex:t="index.html",ignoreURLParametersMatching:a=[/^utm_/,/^fbclid$/],cleanURLs:s=!0,urlManipulation:r}={}){let i=new URL(e,location.href);i.hash="",yield i.href;let n=((e,t=[])=>{for(let a of[...e.searchParams.keys()])t.some(e=>e.test(a))&&e.searchParams.delete(a);return e})(i,a);if(yield n.href,t&&n.pathname.endsWith("/")){let e=new URL(n.href);e.pathname+=t,yield e.href}if(s){let e=new URL(n.href);e.pathname+=".html",yield e.href}if(r)for(let e of r({url:i}))yield e.href}(a.url,t)){let t=s.get(r);if(t)return{cacheKey:t,integrity:e.getIntegrityForPrecacheKey(t)}}},e.precacheStrategy)}},eb=class{_precacheController;constructor({precacheController:e}){this._precacheController=e}cacheKeyWillBeUsed=async({request:e,params:t})=>{let a=t?.cacheKey||this._precacheController.getPrecacheKeyForUrl(e.url);return a?new Request(a,{headers:e.headers}):e}},ev=class{_urlsToCacheKeys=new Map;_urlsToCacheModes=new Map;_cacheKeysToIntegrities=new Map;_concurrentPrecaching;_precacheStrategy;_routes;_defaultHandlerMap;_catchHandler;_requestRules;constructor({precacheEntries:e,precacheOptions:t,skipWaiting:a=!1,importScripts:s,navigationPreload:r=!1,cacheId:n,clientsClaim:o=!1,runtimeCaching:l,offlineAnalyticsConfig:h,disableDevLogs:u=!1,fallbacks:d,requestRules:f}={}){const{precacheStrategyOptions:p,precacheRouteOptions:m,precacheMiscOptions:w}=((e,t={})=>{let{cacheName:a,plugins:s=[],fetchOptions:r,matchOptions:i,fallbackToNetwork:n,directoryIndex:o,ignoreURLParametersMatching:l,cleanURLs:h,urlManipulation:u,cleanupOutdatedCaches:d,concurrency:f=10,navigateFallback:p,navigateFallbackAllowlist:m,navigateFallbackDenylist:w}=t??{};return{precacheStrategyOptions:{cacheName:c(a),plugins:[...s,new eb({precacheController:e})],fetchOptions:r,matchOptions:i,fallbackToNetwork:n},precacheRouteOptions:{directoryIndex:o,ignoreURLParametersMatching:l,cleanURLs:h,urlManipulation:u},precacheMiscOptions:{cleanupOutdatedCaches:d,concurrency:f,navigateFallback:p,navigateFallbackAllowlist:m,navigateFallbackDenylist:w}}})(this,t);if(this._concurrentPrecaching=w.concurrency,this._precacheStrategy=new er(p),this._routes=new Map,this._defaultHandlerMap=new Map,this._requestRules=f,this.handleInstall=this.handleInstall.bind(this),this.handleActivate=this.handleActivate.bind(this),this.handleFetch=this.handleFetch.bind(this),this.handleCache=this.handleCache.bind(this),s&&s.length>0&&self.importScripts(...s),r&&self.registration?.navigationPreload&&self.addEventListener("activate",e=>{e.waitUntil(self.registration.navigationPreload.enable().then(()=>{}))}),void 0!==n&&(e=>{var t=e;for(let e of Object.keys(i))(e=>{let a=t[e];"string"==typeof a&&(i[e]=a)})(e)})({prefix:n}),a?self.skipWaiting():self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),o&&self.addEventListener("activate",()=>self.clients.claim()),e&&e.length>0&&this.addToPrecacheList(e),w.cleanupOutdatedCaches&&(e=>{self.addEventListener("activate",t=>{t.waitUntil(g(c(e)).then(e=>{}))})})(p.cacheName),this.registerRoute(new e_(this,m)),w.navigateFallback&&this.registerRoute(new ei(this.createHandlerBoundToUrl(w.navigateFallback),{allowlist:w.navigateFallbackAllowlist,denylist:w.navigateFallbackDenylist})),void 0!==h&&("boolean"==typeof h?h&&ew({serwist:this}):ew({...h,serwist:this})),void 0!==l){if(void 0!==d){const e=new eg({fallbackUrls:d.entries,serwist:this});l.forEach(t=>{t.handler instanceof Z&&!t.handler.plugins.some(e=>"handlerDidError"in e)&&t.handler.plugins.push(e)})}for(const e of l)this.registerCapture(e.matcher,e.handler,e.method)}u&&(self.__WB_DISABLE_DEV_LOGS=!0)}get precacheStrategy(){return this._precacheStrategy}get routes(){return this._routes}addEventListeners(){self.addEventListener("install",this.handleInstall),self.addEventListener("activate",this.handleActivate),self.addEventListener("fetch",this.handleFetch),self.addEventListener("message",this.handleCache)}addToPrecacheList(e){let t=[];for(let a of e){"string"==typeof a?t.push(a):a&&!a.integrity&&void 0===a.revision&&t.push(a.url);let{cacheKey:e,url:s}=ec(a),r="string"!=typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(s)&&this._urlsToCacheKeys.get(s)!==e)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(s),secondEntry:e});if("string"!=typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==a.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:s});this._cacheKeysToIntegrities.set(e,a.integrity)}this._urlsToCacheKeys.set(s,e),this._urlsToCacheModes.set(s,r)}t.length>0&&console.warn(`Serwist is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`)}handleInstall(e){return this.registerRequestRules(e),y(e,async()=>{let t=new eo;this.precacheStrategy.plugins.push(t),await el(this._concurrentPrecaching,Array.from(this._urlsToCacheKeys.entries()),async([t,a])=>{let s=this._cacheKeysToIntegrities.get(a),r=this._urlsToCacheModes.get(t),i=new Request(t,{integrity:s,cache:r,credentials:"same-origin"});await Promise.all(this.precacheStrategy.handleAll({event:e,request:i,url:new URL(i.url),params:{cacheKey:a}}))});let{updatedURLs:a,notUpdatedURLs:s}=t;return{updatedURLs:a,notUpdatedURLs:s}})}async registerRequestRules(e){if(this._requestRules&&e?.addRoutes)try{await e.addRoutes(this._requestRules),this._requestRules=void 0}catch(e){throw e}}handleActivate(e){return y(e,async()=>{let e=await self.caches.open(this.precacheStrategy.cacheName),t=await e.keys(),a=new Set(this._urlsToCacheKeys.values()),s=[];for(let r of t)a.has(r.url)||(await e.delete(r),s.push(r.url));return{deletedCacheRequests:s}})}handleFetch(e){let{request:t}=e,a=this.handleRequest({request:t,event:e});a&&e.respondWith(a)}handleCache(e){if(e.data&&"CACHE_URLS"===e.data.type){let{payload:t}=e.data,a=Promise.all(t.urlsToCache.map(t=>{let a;return a="string"==typeof t?new Request(t):new Request(...t),this.handleRequest({request:a,event:e})}));e.waitUntil(a),e.ports?.[0]&&a.then(()=>e.ports[0].postMessage(!0))}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,ea(e))}setCatchHandler(e){this._catchHandler=ea(e)}registerCapture(e,t,a){let s=((e,t,a)=>{if("string"==typeof e){let s=new URL(e,location.href);return new es(({url:e})=>e.href===s.href,t,a)}if(e instanceof RegExp)return new en(e,t,a);if("function"==typeof e)return new es(e,t,a);if(e instanceof es)return e;throw new l("unsupported-route-type",{moduleName:"serwist",funcName:"parseRoute",paramName:"capture"})})(e,t,a);return this.registerRoute(s),s}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});let t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}getUrlsToPrecacheKeys(){return this._urlsToCacheKeys}getPrecachedUrls(){return[...this._urlsToCacheKeys.keys()]}getPrecacheKeyForUrl(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForPrecacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,a=this.getPrecacheKeyForUrl(t);if(a)return(await self.caches.open(this.precacheStrategy.cacheName)).match(a)}createHandlerBoundToUrl(e){let t=this.getPrecacheKeyForUrl(e);if(!t)throw new l("non-precached-url",{url:e});return a=>(a.request=new Request(e),a.params={cacheKey:t,...a.params},this.precacheStrategy.handle(a))}handleRequest({request:e,event:t}){let a,s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;let r=s.origin===location.origin,{params:i,route:n}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:s}),c=n?.handler,o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;try{a=c.handle({url:s,request:e,event:t,params:i})}catch(e){a=Promise.reject(e)}let l=n?.catchHandler;return a instanceof Promise&&(this._catchHandler||l)&&(a=a.catch(async a=>{if(l)try{return await l.handle({url:s,request:e,event:t,params:i})}catch(e){e instanceof Error&&(a=e)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw a})),a}findMatchingRoute({url:e,sameOrigin:t,request:a,event:s}){for(let r of this._routes.get(a.method)||[]){let i,n=r.match({url:e,sameOrigin:t,request:a,event:s});if(n)return Array.isArray(i=n)&&0===i.length||n.constructor===Object&&0===Object.keys(n).length?i=void 0:"boolean"==typeof n&&(i=void 0),{route:r,params:i}}return{}}};let eR="/offline",eE=["pages","api-responses","next-static","static-media","fallback","offline-fallback"],eq=[{matcher:({url:e,sameOrigin:t})=>t&&e.pathname.startsWith("/api/"),handler:new ee({cacheName:"api-responses",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:100,maxAgeSeconds:3600})]})},{matcher:({request:e})=>"navigate"===e.mode,handler:new ee({cacheName:"pages",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:50,maxAgeSeconds:86400}),{handlerDidError:async()=>await caches.match(eR)||Response.error()}]})},{matcher:({url:e,sameOrigin:t})=>t&&e.pathname.startsWith("/_next/static/"),handler:new ey({cacheName:"next-static",plugins:[new ep({maxEntries:200,maxAgeSeconds:2592e3})]})},{matcher:({url:e})=>e.pathname.startsWith("/images/")||e.pathname.startsWith("/icons/")||/\.(?:png|jpe?g|gif|svg|webp|ico|woff2?)$/.test(e.pathname),handler:new ey({cacheName:"static-media",plugins:[new ep({maxEntries:100,maxAgeSeconds:2592e3})]})},{matcher:()=>!0,handler:new ee({cacheName:"fallback",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:50,maxAgeSeconds:86400})]})}];new ev({precacheEntries:[{'revision':'ab8abfd07f39ac406789faac7d61b363','url':'/_next/static/Zn-0zI3BT8MCj9ay5NIpk/_buildManifest.js'},{'revision':'b6652df95db52feb4daf4eca35380933','url':'/_next/static/Zn-0zI3BT8MCj9ay5NIpk/_ssgManifest.js'},{'revision':null,'url':'/_next/static/chunks/1079-cffc1eb37436de53.js'},{'revision':null,'url':'/_next/static/chunks/1393-e01c6861d0341a69.js'},{'revision':null,'url':'/_next/static/chunks/1896-a9d2dc75c88c85fb.js'},{'revision':null,'url':'/_next/static/chunks/1958-56cbbb8dba15fd2f.js'},{'revision':null,'url':'/_next/static/chunks/2346-36e36720a5f6591a.js'},{'revision':null,'url':'/_next/static/chunks/3263-1fd6000d3a990905.js'},{'revision':null,'url':'/_next/static/chunks/4836-4871e0bacaaca435.js'},{'revision':null,'url':'/_next/static/chunks/4bd1b696-e356ca5ba0218e27.js'},{'revision':null,'url':'/_next/static/chunks/52774a7f.f2ab7a9b4b8ba576.js'},{'revision':null,'url':'/_next/static/chunks/5741-3085cade73716f0f.js'},{'revision':null,'url':'/_next/static/chunks/5838-7e0aa455e9f24259.js'},{'revision':null,'url':'/_next/static/chunks/6243-06350499fc86734c.js'},{'revision':null,'url':'/_next/static/chunks/7551-4c9aa7502ea6cc30.js'},{'revision':null,'url':'/_next/static/chunks/7602.2868ff821d53ee09.js'},{'revision':null,'url':'/_next/static/chunks/7918-b6bc29652564489b.js'},{'revision':null,'url':'/_next/static/chunks/8200-9a6d7728a5c09911.js'},{'revision':null,'url':'/_next/static/chunks/8500-f62a38ff68ab7f42.js'},{'revision':null,'url':'/_next/static/chunks/9da6db1e-9623f3245f088d02.js'},{'revision':null,'url':'/_next/static/chunks/app/_global-error/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/_not-found/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/about/page-70022fc79d67ea5a.js'},{'revision':null,'url':'/_next/static/chunks/app/account/page-9300f08c33aa8887.js'},{'revision':null,'url':'/_next/static/chunks/app/admin/page-43ddd38031c7119e.js'},{'revision':null,'url':'/_next/static/chunks/app/api/accuracy/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/admin/stats/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/books/%5B...path%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/checkout/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/combat/%5Bdate%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/content/%5B...path%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/desk-showcase/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/desk/pack/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/fight/%5Bid%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/founders/count/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/futures/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/gamelines/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/props/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/tonight/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hero-prop/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hotlist/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/intelligence/feed/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/accuracy/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/mine/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/model/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/lines/%5B...path%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/live/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/news/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/newsletter/subscribe/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/mlb/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/nba/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/soccer/%5Bleague%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/wnba/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/add-leg/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/calculate/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/grade/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/players/search/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/preferences/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/profiles/%5Bhandle%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/profiles/me/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/live/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/most-parlayed/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/top-graded/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/scan/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/injuries/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/lineups/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/pitchers/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/slips/parse/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/snapshot/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/snapshot/summary/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/cascade/%5Bplayer%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/depth/%5Bteam%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/leaders/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/lineup/%5Bteam%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/parlays-graded/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/pitcher/%5Bname%5D/arsenal/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/player/%5Bname%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/public/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/streaks/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stripe/portal/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/team/%5Babbr%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ticker/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/profile/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/recent-scans/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/scan-meter/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/scans/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/waitlist/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/welcome-email/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/auth/callback/page-e6df9771a50edb87.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/%5Bslug%5D/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/compare/page-1119694e961d71c4.js'},{'revision':null,'url':'/_next/static/chunks/app/dashboard/page-aa1beeb392637aa1.js'},{'revision':null,'url':'/_next/static/chunks/app/desk/page-7acc556c00f487e5.js'},{'revision':null,'url':'/_next/static/chunks/app/explore/page-4c518cd2ef8bb2cd.js'},{'revision':null,'url':'/_next/static/chunks/app/fight/%5Bid%5D/page-308862cc7b686178.js'},{'revision':null,'url':'/_next/static/chunks/app/forgot-password/page-a251f52b4206e8d1.js'},{'revision':null,'url':'/_next/static/chunks/app/game/%5Bid%5D/page-0a74de29a6580a35.js'},{'revision':null,'url':'/_next/static/chunks/app/help/page-10e0eae5e4e1de7c.js'},{'revision':null,'url':'/_next/static/chunks/app/intelligence/page-af6b3ddd4f155539.js'},{'revision':null,'url':'/_next/static/chunks/app/invite/page-01dda8e223484025.js'},{'revision':null,'url':'/_next/static/chunks/app/layout-156f1e90da4ba847.js'},{'revision':null,'url':'/_next/static/chunks/app/ledger/page-d31795dedaf2ac88.js'},{'revision':null,'url':'/_next/static/chunks/app/login/page-869e21de85065bc1.js'},{'revision':null,'url':'/_next/static/chunks/app/marketplace/page-cbada49ae96a7527.js'},{'revision':null,'url':'/_next/static/chunks/app/methodology/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/not-found-aea5d97d52af5780.js'},{'revision':null,'url':'/_next/static/chunks/app/notifications/page-70022fc79d67ea5a.js'},{'revision':null,'url':'/_next/static/chunks/app/offline/page-a7a57ff039afc1af.js'},{'revision':null,'url':'/_next/static/chunks/app/onboarding/page-507c881a3cf2cdad.js'},{'revision':null,'url':'/_next/static/chunks/app/opengraph-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/page-23bd5465d662c2c6.js'},{'revision':null,'url':'/_next/static/chunks/app/parlay/page-9fb644e7cfb54cb7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/layout-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/opengraph-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/page-dc02d996495083aa.js'},{'revision':null,'url':'/_next/static/chunks/app/pricing/page-7719f6003ec52cfd.js'},{'revision':null,'url':'/_next/static/chunks/app/privacy/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/profile/page-8bb575ea4a91bfdb.js'},{'revision':null,'url':'/_next/static/chunks/app/report/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/responsible-gambling/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/scan/page-d457046e933b5d3f.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/page-9bf003e5a54e5190.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/security/page-f0d118bb0bf17bf8.js'},{'revision':null,'url':'/_next/static/chunks/app/signup/page-d34a7133af025c69.js'},{'revision':null,'url':'/_next/static/chunks/app/slip/page-32a5d1ace27127d2.js'},{'revision':null,'url':'/_next/static/chunks/app/soccer/page-3ae10f80a7ebddf9.js'},{'revision':null,'url':'/_next/static/chunks/app/team/%5Babbr%5D/page-bde75cf1101ae726.js'},{'revision':null,'url':'/_next/static/chunks/app/terminal/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/terms/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/tracker/page-2ce2d278c7e0ed48.js'},{'revision':null,'url':'/_next/static/chunks/app/twitter-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/opengraph-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/page-252629d55ee3c82b.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/portrait/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/cancel/page-3702e818a6853705.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/desk/page-0709bc8c6f29ea65.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/success/page-dc7c14a4f1c96dbd.js'},{'revision':null,'url':'/_next/static/chunks/app/verify/page-b121fa98601397d8.js'},{'revision':null,'url':'/_next/static/chunks/app/welcome/page-028357260721a9f9.js'},{'revision':null,'url':'/_next/static/chunks/framework-95da69ac6843d788.js'},{'revision':null,'url':'/_next/static/chunks/main-a354262253293123.js'},{'revision':null,'url':'/_next/static/chunks/main-app-4231d5f500f33972.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/app-error-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/forbidden-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/global-error-756d787dba63aa4d.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/unauthorized-a2e62102f89140a7.js'},{'revision':'846118c33b2c0e922d7b3a7676f81f6f','url':'/_next/static/chunks/polyfills-42372ed130431b0a.js'},{'revision':null,'url':'/_next/static/chunks/webpack-c39c325c0a9c381a.js'},{'revision':null,'url':'/_next/static/css/fe8315bb5b899fa0.css'},{'revision':'cd34c7793d9776838308cfbe5d93922b','url':'/_next/static/media/011e180705008d6f-s.woff2'},{'revision':'324703f03c390d2e2a4f387de85fe63d','url':'/_next/static/media/0aa834ed78bf6d07-s.woff2'},{'revision':'9dda5cfc9a46f256d0e131bb535e46f8','url':'/_next/static/media/19cfc7226ec3afaa-s.woff2'},{'revision':'7de6d31e5076eb437418b6e01998ee12','url':'/_next/static/media/20535187d867b7b9-s.woff2'},{'revision':'4e2553027f1d60eff32898367dd4d541','url':'/_next/static/media/21350d82a1f187e9-s.woff2'},{'revision':'0d11e07b5aaafda6ae2efc53256932ec','url':'/_next/static/media/37786be940ec402b-s.woff2'},{'revision':'5de0bff80f9f432b5cf52c1c2f80fe20','url':'/_next/static/media/46e154b2fcbd6033-s.woff2'},{'revision':'6041b3192dc3e1a50141d5d418a24199','url':'/_next/static/media/5356a6a4f2c8c8d8-s.woff2'},{'revision':'f572f7b57d27ec7fd8373961f0b762b0','url':'/_next/static/media/58f386aa6b1a2a92-s.woff2'},{'revision':'e829cbe042e8b2b2e6b99c0eec9e230d','url':'/_next/static/media/656feb427634a431-s.woff2'},{'revision':'54f02056e07c55023315568c637e3a96','url':'/_next/static/media/67957d42bae0796d-s.woff2'},{'revision':'e220ad1849c282590e47db0ff88fc3f3','url':'/_next/static/media/704b853f32d191d5-s.woff2'},{'revision':'662cde3543f3375874e26c26845cec22','url':'/_next/static/media/73cb51aac9c97f90-s.woff2'},{'revision':'afac1fab355fe8db5c2dcaa7623dffb3','url':'/_next/static/media/7ba5fb2a8c88521c-s.woff2'},{'revision':'c94e6e6c23e789fcb0fc60d790c9d2c1','url':'/_next/static/media/886030b0b59bc5a7-s.woff2'},{'revision':'01ba6c2a184b8cba08b0d57167664d75','url':'/_next/static/media/8e9860b6e62d6359-s.woff2'},{'revision':'17a5b2a15bf5647b49cadb9a3bb02e1c','url':'/_next/static/media/92eeb95d069020cc-s.woff2'},{'revision':'4a4e74bed5809194e4bc6538eb1a1e30','url':'/_next/static/media/939c4f875ee75fbb-s.woff2'},{'revision':'6708425c446b05de1c2d471a0eaf4099','url':'/_next/static/media/98e207f02528a563-s.woff2'},{'revision':'13dface50f6dc0bff1015561c84119e6','url':'/_next/static/media/991629005c80bdf1-s.woff2'},{'revision':'216ee1a35b060106ed2852cdd8c026c7','url':'/_next/static/media/99dcf268bda04fe5-s.woff2'},{'revision':'9e494903d6b0ffec1a1e14d34427d44d','url':'/_next/static/media/ba9851c3c22cd980-s.woff2'},{'revision':'782150e6836b9b074d1a798807adcb18','url':'/_next/static/media/bb3ef058b751a6ad-s.p.woff2'},{'revision':'027a89e9ab733a145db70f09b8a18b42','url':'/_next/static/media/c5fe6dc8356a8c31-s.woff2'},{'revision':'75fa2e527eaae805bbf44e3378d1232c','url':'/_next/static/media/d26bbd13d6b70f89-s.woff2'},{'revision':'0ba762bde65aaa682fcc089f8c57288e','url':'/_next/static/media/d29838c109ef09b4-s.woff2'},{'revision':'814fe1615d4dbc7bbd92d26a6bda0905','url':'/_next/static/media/d3ebbfd689654d3a-s.woff2'},{'revision':'e71a597e376ed91862e822b5a5de8c04','url':'/_next/static/media/db96af6b531dc71f-s.woff2'},{'revision':'d54db44de5ccb18886ece2fda72bdfe0','url':'/_next/static/media/df0a9ae256c0569c-s.woff2'},{'revision':'9fb609fe01d739bb9df558e1fba2498e','url':'/_next/static/media/e40af3453d7c920a-s.woff2'},{'revision':'65850a373e258f1c897a2b3d75eb74de','url':'/_next/static/media/e4af272ccee01ff0-s.p.woff2'},{'revision':'de1d49f26130d43f91829088086625f4','url':'/_next/static/media/ef4d5661765d0e49-s.woff2'},{'revision':'0f8d347d49960d05c9430d83e49edeb7','url':'/_next/static/media/f911b923c6adde36-s.woff2'},{'revision':'d7bc0f63f9618b8b700d028d7d242de8','url':'/apple-touch-icon.png'},{'revision':'300b6bcc84329321d40dec63416e9566','url':'/books/bet365.svg'},{'revision':'c5d3df8f35278d119bacd44726536a53','url':'/books/betmgm.svg'},{'revision':'c0898e8b017d76457549b49df00d78dd','url':'/books/betrivers.svg'},{'revision':'8acaa0c6c9c413fe01caf8f5d9cf1ac3','url':'/books/caesars.svg'},{'revision':'7fbceb80c3466f82e5cebed0f84d00f4','url':'/books/draftkings.svg'},{'revision':'d275072bd73625ea22826b370fed3697','url':'/books/fanduel.svg'},{'revision':'8457294d0c8dcb63396875c6ae594dc2','url':'/books/hardrockbet.svg'},{'revision':'77bafdb1e2a6ff85e34038ad06a9fa31','url':'/books/pinnacle.svg'},{'revision':'5616f81ec5f8a9f726a17fb7ac66a54a','url':'/favicon-16.png'},{'revision':'1fc285cfb0116a0523eb34c779a7d282','url':'/favicon-32.png'},{'revision':'583b034f36839a8af92841771eef38b6','url':'/favicon.ico'},{'revision':'b15795128b3691e5703d0ce14ce10827','url':'/favicon.png'},{'revision':'44e9d71551be13574ac2e10063d03aa9','url':'/favicon.svg'},{'revision':'252b8f8c4d0f64c7cd120f182a6c74ab','url':'/icon-192.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icon-512.png'},{'revision':'252b8f8c4d0f64c7cd120f182a6c74ab','url':'/icons/icon-192.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icons/icon-512.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icons/icon-maskable-512.png'},{'revision':'bf670b1fafa1b3127bd50abe86d723b9','url':'/images/player-silhouette.svg'},{'revision':'1cd41b3d92ff160c4635a1ee75bbc34b','url':'/manifest.json'},{'revision':'9f61cf51298661d5c57a782534216240','url':'/og-image.png'},{'revision':'7c759c20b35840eacf9344692cb51061','url':'/og-image.svg'},{'revision':'9327802333275f11e68c3f19f20c160d','url':'/widget.js'}],skipWaiting:!0,clientsClaim:!0,navigationPreload:!0,runtimeCaching:eq}).addEventListeners(),self.addEventListener("install",e=>{e.waitUntil(caches.open("offline-fallback").then(e=>e.add(eR)).catch(()=>{}))}),self.addEventListener("activate",e=>{e.waitUntil(caches.keys().then(e=>Promise.all(e.filter(e=>!eE.includes(e)&&!e.startsWith("serwist")).map(e=>(console.log("[SW] deleting stale cache:",e),caches.delete(e))))))}),self.addEventListener("push",e=>{let t;if(!e.data)return;try{t=e.data.json()}catch{t={title:"VYNDR",body:e.data.text()}}let{title:a="VYNDR",body:s="",icon:r="/icons/icon-192.png",url:i="/",tag:n="vyndr-notification"}=t;e.waitUntil(self.registration.showNotification(a,{body:s,icon:r,badge:"/icons/icon-192.png",tag:n,data:{url:i}}))}),self.addEventListener("notificationclick",e=>{e.notification.close();let t=e.notification.data?.url??"/";e.waitUntil(self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(e=>{let a=e.find(e=>e.url.endsWith(t));return a?a.focus():self.clients.openWindow(t)}))})})(); \ No newline at end of file +This is generally NOT safe. Learn more at https://bit.ly/wb-precache`)}handleInstall(e){return this.registerRequestRules(e),y(e,async()=>{let t=new eo;this.precacheStrategy.plugins.push(t),await el(this._concurrentPrecaching,Array.from(this._urlsToCacheKeys.entries()),async([t,a])=>{let s=this._cacheKeysToIntegrities.get(a),r=this._urlsToCacheModes.get(t),i=new Request(t,{integrity:s,cache:r,credentials:"same-origin"});await Promise.all(this.precacheStrategy.handleAll({event:e,request:i,url:new URL(i.url),params:{cacheKey:a}}))});let{updatedURLs:a,notUpdatedURLs:s}=t;return{updatedURLs:a,notUpdatedURLs:s}})}async registerRequestRules(e){if(this._requestRules&&e?.addRoutes)try{await e.addRoutes(this._requestRules),this._requestRules=void 0}catch(e){throw e}}handleActivate(e){return y(e,async()=>{let e=await self.caches.open(this.precacheStrategy.cacheName),t=await e.keys(),a=new Set(this._urlsToCacheKeys.values()),s=[];for(let r of t)a.has(r.url)||(await e.delete(r),s.push(r.url));return{deletedCacheRequests:s}})}handleFetch(e){let{request:t}=e,a=this.handleRequest({request:t,event:e});a&&e.respondWith(a)}handleCache(e){if(e.data&&"CACHE_URLS"===e.data.type){let{payload:t}=e.data,a=Promise.all(t.urlsToCache.map(t=>{let a;return a="string"==typeof t?new Request(t):new Request(...t),this.handleRequest({request:a,event:e})}));e.waitUntil(a),e.ports?.[0]&&a.then(()=>e.ports[0].postMessage(!0))}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,ea(e))}setCatchHandler(e){this._catchHandler=ea(e)}registerCapture(e,t,a){let s=((e,t,a)=>{if("string"==typeof e){let s=new URL(e,location.href);return new es(({url:e})=>e.href===s.href,t,a)}if(e instanceof RegExp)return new en(e,t,a);if("function"==typeof e)return new es(e,t,a);if(e instanceof es)return e;throw new l("unsupported-route-type",{moduleName:"serwist",funcName:"parseRoute",paramName:"capture"})})(e,t,a);return this.registerRoute(s),s}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});let t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}getUrlsToPrecacheKeys(){return this._urlsToCacheKeys}getPrecachedUrls(){return[...this._urlsToCacheKeys.keys()]}getPrecacheKeyForUrl(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForPrecacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,a=this.getPrecacheKeyForUrl(t);if(a)return(await self.caches.open(this.precacheStrategy.cacheName)).match(a)}createHandlerBoundToUrl(e){let t=this.getPrecacheKeyForUrl(e);if(!t)throw new l("non-precached-url",{url:e});return a=>(a.request=new Request(e),a.params={cacheKey:t,...a.params},this.precacheStrategy.handle(a))}handleRequest({request:e,event:t}){let a,s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;let r=s.origin===location.origin,{params:i,route:n}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:s}),c=n?.handler,o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;try{a=c.handle({url:s,request:e,event:t,params:i})}catch(e){a=Promise.reject(e)}let l=n?.catchHandler;return a instanceof Promise&&(this._catchHandler||l)&&(a=a.catch(async a=>{if(l)try{return await l.handle({url:s,request:e,event:t,params:i})}catch(e){e instanceof Error&&(a=e)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw a})),a}findMatchingRoute({url:e,sameOrigin:t,request:a,event:s}){for(let r of this._routes.get(a.method)||[]){let i,n=r.match({url:e,sameOrigin:t,request:a,event:s});if(n)return Array.isArray(i=n)&&0===i.length||n.constructor===Object&&0===Object.keys(n).length?i=void 0:"boolean"==typeof n&&(i=void 0),{route:r,params:i}}return{}}};let eR="/offline",eE=["pages","api-responses","next-static","static-media","fallback","offline-fallback"],eq=[{matcher:({url:e,sameOrigin:t})=>t&&e.pathname.startsWith("/api/"),handler:new ee({cacheName:"api-responses",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:100,maxAgeSeconds:3600})]})},{matcher:({request:e})=>"navigate"===e.mode,handler:new ee({cacheName:"pages",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:50,maxAgeSeconds:86400}),{handlerDidError:async()=>await caches.match(eR)||Response.error()}]})},{matcher:({url:e,sameOrigin:t})=>t&&e.pathname.startsWith("/_next/static/"),handler:new ey({cacheName:"next-static",plugins:[new ep({maxEntries:200,maxAgeSeconds:2592e3})]})},{matcher:({url:e})=>e.pathname.startsWith("/images/")||e.pathname.startsWith("/icons/")||/\.(?:png|jpe?g|gif|svg|webp|ico|woff2?)$/.test(e.pathname),handler:new ey({cacheName:"static-media",plugins:[new ep({maxEntries:100,maxAgeSeconds:2592e3})]})},{matcher:()=>!0,handler:new ee({cacheName:"fallback",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:50,maxAgeSeconds:86400})]})}];new ev({precacheEntries:[{'revision':'9a7af73b065abd1fe8e5787943d03007','url':'/_next/static/84B3wTnkYIduhm5nRwvkw/_buildManifest.js'},{'revision':'b6652df95db52feb4daf4eca35380933','url':'/_next/static/84B3wTnkYIduhm5nRwvkw/_ssgManifest.js'},{'revision':null,'url':'/_next/static/chunks/1079-cffc1eb37436de53.js'},{'revision':null,'url':'/_next/static/chunks/1393-e01c6861d0341a69.js'},{'revision':null,'url':'/_next/static/chunks/1896-97eb79100b49d1c0.js'},{'revision':null,'url':'/_next/static/chunks/1958-56cbbb8dba15fd2f.js'},{'revision':null,'url':'/_next/static/chunks/2346-36e36720a5f6591a.js'},{'revision':null,'url':'/_next/static/chunks/3263-1fd6000d3a990905.js'},{'revision':null,'url':'/_next/static/chunks/4836-4871e0bacaaca435.js'},{'revision':null,'url':'/_next/static/chunks/4bd1b696-e356ca5ba0218e27.js'},{'revision':null,'url':'/_next/static/chunks/52774a7f.f2ab7a9b4b8ba576.js'},{'revision':null,'url':'/_next/static/chunks/5838-7e0aa455e9f24259.js'},{'revision':null,'url':'/_next/static/chunks/6243-06350499fc86734c.js'},{'revision':null,'url':'/_next/static/chunks/7551-4c9aa7502ea6cc30.js'},{'revision':null,'url':'/_next/static/chunks/7602.2868ff821d53ee09.js'},{'revision':null,'url':'/_next/static/chunks/7888-abba63ea3f0367ce.js'},{'revision':null,'url':'/_next/static/chunks/7918-b6bc29652564489b.js'},{'revision':null,'url':'/_next/static/chunks/8200-21d547d5cc8fa089.js'},{'revision':null,'url':'/_next/static/chunks/8500-f62a38ff68ab7f42.js'},{'revision':null,'url':'/_next/static/chunks/9da6db1e-9623f3245f088d02.js'},{'revision':null,'url':'/_next/static/chunks/app/_global-error/page-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/_not-found/page-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/about/page-fc862fb775f19a57.js'},{'revision':null,'url':'/_next/static/chunks/app/account/page-9300f08c33aa8887.js'},{'revision':null,'url':'/_next/static/chunks/app/admin/page-43ddd38031c7119e.js'},{'revision':null,'url':'/_next/static/chunks/app/api/accuracy/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/admin/stats/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/books/%5B...path%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/checkout/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/combat/%5Bdate%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/content/%5B...path%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/desk-showcase/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/desk/pack/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/fight/%5Bid%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/founders/count/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/futures/%5Bsport%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/gamelines/%5Bsport%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/props/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/tonight/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hero-prop/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hotlist/%5Bsport%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/intelligence/feed/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/accuracy/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/mine/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/model/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/lines/%5B...path%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/live/%5Bsport%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/news/%5Bsport%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/newsletter/subscribe/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/mlb/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/nba/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/soccer/%5Bleague%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/wnba/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/add-leg/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/calculate/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/grade/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/players/search/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/preferences/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/profiles/%5Bhandle%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/profiles/me/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/live/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/most-parlayed/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/top-graded/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/scan/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/injuries/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/lineups/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/pitchers/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/slips/parse/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/snapshot/%5Bsport%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/snapshot/summary/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/cascade/%5Bplayer%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/depth/%5Bteam%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/leaders/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/lineup/%5Bteam%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/parlays-graded/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/pitcher/%5Bname%5D/arsenal/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/player/%5Bname%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/public/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/streaks/%5Bsport%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stripe/portal/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/team/%5Babbr%5D/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ticker/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/profile/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/recent-scans/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/scan-meter/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/scans/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/waitlist/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/welcome-email/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/auth/callback/page-e6df9771a50edb87.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/%5Bslug%5D/page-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/page-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/compare/page-de2157a8c9537565.js'},{'revision':null,'url':'/_next/static/chunks/app/dashboard/page-d45908acc2a6822f.js'},{'revision':null,'url':'/_next/static/chunks/app/desk/page-cbc817b88f9e9a38.js'},{'revision':null,'url':'/_next/static/chunks/app/explore/page-4c518cd2ef8bb2cd.js'},{'revision':null,'url':'/_next/static/chunks/app/fight/%5Bid%5D/page-99737329acab5f31.js'},{'revision':null,'url':'/_next/static/chunks/app/forgot-password/page-a251f52b4206e8d1.js'},{'revision':null,'url':'/_next/static/chunks/app/game/%5Bid%5D/page-0a74de29a6580a35.js'},{'revision':null,'url':'/_next/static/chunks/app/help/page-10e0eae5e4e1de7c.js'},{'revision':null,'url':'/_next/static/chunks/app/intelligence/page-af6b3ddd4f155539.js'},{'revision':null,'url':'/_next/static/chunks/app/invite/page-01dda8e223484025.js'},{'revision':null,'url':'/_next/static/chunks/app/layout-a55cf429d44133bf.js'},{'revision':null,'url':'/_next/static/chunks/app/ledger/page-9797c2526b8f5d22.js'},{'revision':null,'url':'/_next/static/chunks/app/login/page-2e887c7e0b1ca155.js'},{'revision':null,'url':'/_next/static/chunks/app/marketplace/page-cbada49ae96a7527.js'},{'revision':null,'url':'/_next/static/chunks/app/methodology/page-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/not-found-5b5b386fb24619a8.js'},{'revision':null,'url':'/_next/static/chunks/app/notifications/page-fc862fb775f19a57.js'},{'revision':null,'url':'/_next/static/chunks/app/offline/page-a7a57ff039afc1af.js'},{'revision':null,'url':'/_next/static/chunks/app/onboarding/page-507c881a3cf2cdad.js'},{'revision':null,'url':'/_next/static/chunks/app/opengraph-image/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/page-098a7001ba14210c.js'},{'revision':null,'url':'/_next/static/chunks/app/parlay/page-9fb644e7cfb54cb7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/layout-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/opengraph-image/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/page-dc02d996495083aa.js'},{'revision':null,'url':'/_next/static/chunks/app/pricing/page-679088d5e877faae.js'},{'revision':null,'url':'/_next/static/chunks/app/privacy/page-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/profile/page-8bb575ea4a91bfdb.js'},{'revision':null,'url':'/_next/static/chunks/app/report/page-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/responsible-gambling/page-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/scan/page-d05abbea92b1c350.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/page-9bf003e5a54e5190.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/security/page-f0d118bb0bf17bf8.js'},{'revision':null,'url':'/_next/static/chunks/app/signup/page-d34a7133af025c69.js'},{'revision':null,'url':'/_next/static/chunks/app/slip/page-32a5d1ace27127d2.js'},{'revision':null,'url':'/_next/static/chunks/app/soccer/page-3ae10f80a7ebddf9.js'},{'revision':null,'url':'/_next/static/chunks/app/team/%5Babbr%5D/page-bde75cf1101ae726.js'},{'revision':null,'url':'/_next/static/chunks/app/terminal/page-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/terms/page-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/tracker/page-2ce2d278c7e0ed48.js'},{'revision':null,'url':'/_next/static/chunks/app/twitter-image/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/opengraph-image/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/page-252629d55ee3c82b.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/portrait/route-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/cancel/page-3702e818a6853705.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/desk/page-0709bc8c6f29ea65.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/success/page-dc7c14a4f1c96dbd.js'},{'revision':null,'url':'/_next/static/chunks/app/verify/page-b121fa98601397d8.js'},{'revision':null,'url':'/_next/static/chunks/app/welcome/page-028357260721a9f9.js'},{'revision':null,'url':'/_next/static/chunks/framework-95da69ac6843d788.js'},{'revision':null,'url':'/_next/static/chunks/main-a354262253293123.js'},{'revision':null,'url':'/_next/static/chunks/main-app-4231d5f500f33972.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/app-error-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/forbidden-2a52674a799ff6d7.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/global-error-756d787dba63aa4d.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/unauthorized-2a52674a799ff6d7.js'},{'revision':'846118c33b2c0e922d7b3a7676f81f6f','url':'/_next/static/chunks/polyfills-42372ed130431b0a.js'},{'revision':null,'url':'/_next/static/chunks/webpack-c39c325c0a9c381a.js'},{'revision':null,'url':'/_next/static/css/fe8315bb5b899fa0.css'},{'revision':'cd34c7793d9776838308cfbe5d93922b','url':'/_next/static/media/011e180705008d6f-s.woff2'},{'revision':'324703f03c390d2e2a4f387de85fe63d','url':'/_next/static/media/0aa834ed78bf6d07-s.woff2'},{'revision':'9dda5cfc9a46f256d0e131bb535e46f8','url':'/_next/static/media/19cfc7226ec3afaa-s.woff2'},{'revision':'7de6d31e5076eb437418b6e01998ee12','url':'/_next/static/media/20535187d867b7b9-s.woff2'},{'revision':'4e2553027f1d60eff32898367dd4d541','url':'/_next/static/media/21350d82a1f187e9-s.woff2'},{'revision':'0d11e07b5aaafda6ae2efc53256932ec','url':'/_next/static/media/37786be940ec402b-s.woff2'},{'revision':'5de0bff80f9f432b5cf52c1c2f80fe20','url':'/_next/static/media/46e154b2fcbd6033-s.woff2'},{'revision':'6041b3192dc3e1a50141d5d418a24199','url':'/_next/static/media/5356a6a4f2c8c8d8-s.woff2'},{'revision':'f572f7b57d27ec7fd8373961f0b762b0','url':'/_next/static/media/58f386aa6b1a2a92-s.woff2'},{'revision':'e829cbe042e8b2b2e6b99c0eec9e230d','url':'/_next/static/media/656feb427634a431-s.woff2'},{'revision':'54f02056e07c55023315568c637e3a96','url':'/_next/static/media/67957d42bae0796d-s.woff2'},{'revision':'e220ad1849c282590e47db0ff88fc3f3','url':'/_next/static/media/704b853f32d191d5-s.woff2'},{'revision':'662cde3543f3375874e26c26845cec22','url':'/_next/static/media/73cb51aac9c97f90-s.woff2'},{'revision':'afac1fab355fe8db5c2dcaa7623dffb3','url':'/_next/static/media/7ba5fb2a8c88521c-s.woff2'},{'revision':'c94e6e6c23e789fcb0fc60d790c9d2c1','url':'/_next/static/media/886030b0b59bc5a7-s.woff2'},{'revision':'01ba6c2a184b8cba08b0d57167664d75','url':'/_next/static/media/8e9860b6e62d6359-s.woff2'},{'revision':'17a5b2a15bf5647b49cadb9a3bb02e1c','url':'/_next/static/media/92eeb95d069020cc-s.woff2'},{'revision':'4a4e74bed5809194e4bc6538eb1a1e30','url':'/_next/static/media/939c4f875ee75fbb-s.woff2'},{'revision':'6708425c446b05de1c2d471a0eaf4099','url':'/_next/static/media/98e207f02528a563-s.woff2'},{'revision':'13dface50f6dc0bff1015561c84119e6','url':'/_next/static/media/991629005c80bdf1-s.woff2'},{'revision':'216ee1a35b060106ed2852cdd8c026c7','url':'/_next/static/media/99dcf268bda04fe5-s.woff2'},{'revision':'9e494903d6b0ffec1a1e14d34427d44d','url':'/_next/static/media/ba9851c3c22cd980-s.woff2'},{'revision':'782150e6836b9b074d1a798807adcb18','url':'/_next/static/media/bb3ef058b751a6ad-s.p.woff2'},{'revision':'027a89e9ab733a145db70f09b8a18b42','url':'/_next/static/media/c5fe6dc8356a8c31-s.woff2'},{'revision':'75fa2e527eaae805bbf44e3378d1232c','url':'/_next/static/media/d26bbd13d6b70f89-s.woff2'},{'revision':'0ba762bde65aaa682fcc089f8c57288e','url':'/_next/static/media/d29838c109ef09b4-s.woff2'},{'revision':'814fe1615d4dbc7bbd92d26a6bda0905','url':'/_next/static/media/d3ebbfd689654d3a-s.woff2'},{'revision':'e71a597e376ed91862e822b5a5de8c04','url':'/_next/static/media/db96af6b531dc71f-s.woff2'},{'revision':'d54db44de5ccb18886ece2fda72bdfe0','url':'/_next/static/media/df0a9ae256c0569c-s.woff2'},{'revision':'9fb609fe01d739bb9df558e1fba2498e','url':'/_next/static/media/e40af3453d7c920a-s.woff2'},{'revision':'65850a373e258f1c897a2b3d75eb74de','url':'/_next/static/media/e4af272ccee01ff0-s.p.woff2'},{'revision':'de1d49f26130d43f91829088086625f4','url':'/_next/static/media/ef4d5661765d0e49-s.woff2'},{'revision':'0f8d347d49960d05c9430d83e49edeb7','url':'/_next/static/media/f911b923c6adde36-s.woff2'},{'revision':'d7bc0f63f9618b8b700d028d7d242de8','url':'/apple-touch-icon.png'},{'revision':'300b6bcc84329321d40dec63416e9566','url':'/books/bet365.svg'},{'revision':'c5d3df8f35278d119bacd44726536a53','url':'/books/betmgm.svg'},{'revision':'c0898e8b017d76457549b49df00d78dd','url':'/books/betrivers.svg'},{'revision':'8acaa0c6c9c413fe01caf8f5d9cf1ac3','url':'/books/caesars.svg'},{'revision':'7fbceb80c3466f82e5cebed0f84d00f4','url':'/books/draftkings.svg'},{'revision':'d275072bd73625ea22826b370fed3697','url':'/books/fanduel.svg'},{'revision':'8457294d0c8dcb63396875c6ae594dc2','url':'/books/hardrockbet.svg'},{'revision':'77bafdb1e2a6ff85e34038ad06a9fa31','url':'/books/pinnacle.svg'},{'revision':'5616f81ec5f8a9f726a17fb7ac66a54a','url':'/favicon-16.png'},{'revision':'1fc285cfb0116a0523eb34c779a7d282','url':'/favicon-32.png'},{'revision':'583b034f36839a8af92841771eef38b6','url':'/favicon.ico'},{'revision':'b15795128b3691e5703d0ce14ce10827','url':'/favicon.png'},{'revision':'44e9d71551be13574ac2e10063d03aa9','url':'/favicon.svg'},{'revision':'252b8f8c4d0f64c7cd120f182a6c74ab','url':'/icon-192.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icon-512.png'},{'revision':'252b8f8c4d0f64c7cd120f182a6c74ab','url':'/icons/icon-192.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icons/icon-512.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icons/icon-maskable-512.png'},{'revision':'bf670b1fafa1b3127bd50abe86d723b9','url':'/images/player-silhouette.svg'},{'revision':'1cd41b3d92ff160c4635a1ee75bbc34b','url':'/manifest.json'},{'revision':'9f61cf51298661d5c57a782534216240','url':'/og-image.png'},{'revision':'7c759c20b35840eacf9344692cb51061','url':'/og-image.svg'},{'revision':'9327802333275f11e68c3f19f20c160d','url':'/widget.js'}],skipWaiting:!0,clientsClaim:!0,navigationPreload:!0,runtimeCaching:eq}).addEventListeners(),self.addEventListener("install",e=>{e.waitUntil(caches.open("offline-fallback").then(e=>e.add(eR)).catch(()=>{}))}),self.addEventListener("activate",e=>{e.waitUntil(caches.keys().then(e=>Promise.all(e.filter(e=>!eE.includes(e)&&!e.startsWith("serwist")).map(e=>(console.log("[SW] deleting stale cache:",e),caches.delete(e))))))}),self.addEventListener("push",e=>{let t;if(!e.data)return;try{t=e.data.json()}catch{t={title:"VYNDR",body:e.data.text()}}let{title:a="VYNDR",body:s="",icon:r="/icons/icon-192.png",url:i="/",tag:n="vyndr-notification"}=t;e.waitUntil(self.registration.showNotification(a,{body:s,icon:r,badge:"/icons/icon-192.png",tag:n,data:{url:i}}))}),self.addEventListener("notificationclick",e=>{e.notification.close();let t=e.notification.data?.url??"/";e.waitUntil(self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(e=>{let a=e.find(e=>e.url.endsWith(t));return a?a.focus():self.clients.openWindow(t)}))})})(); \ No newline at end of file diff --git a/web/src/lib/slateAdapter.js b/web/src/lib/slateAdapter.js index 496e1b7..c16adcb 100644 --- a/web/src/lib/slateAdapter.js +++ b/web/src/lib/slateAdapter.js @@ -454,10 +454,62 @@ const numOr = (v, fallback) => { return Number.isFinite(n) ? n : fallback; }; +/** Strict numeric read — `Number(null) === 0` is the recurring fabrication bug. */ +const strictNum = (v) => (v == null || v === '' ? null : (Number.isFinite(Number(v)) ? Number(v) : null)); + +/** + * The takeable-gated champion probability for one grade row, or null. + * + * Gate = `valueState.isTakeable` (−160..+200), which mirrors + * `src/config/valueEngine.isTakeable` — the IDENTICAL band the hero ranks on + * (`heroPropService` HERO RULE v3), so the two ranking surfaces agree. The gate + * is mandatory: raw p_win crowns −300 chalk, which is not the product. + * + * p_win is ABSENT BY DESIGN for unentitled tiers — `utils/snapshotGating` + * strips it on the way out because "shipping p_win is shipping the model price + * in a different base" (Session 67). Those callers legitimately get null here + * and fall through to the signed edge. + */ +function takeablePWin(g) { + const { isTakeable } = require('./valueState'); + const p = strictNum(g && g.p_win); + if (p == null) return null; + const price = strictNum(g && g.book_odds) ?? strictNum(g && g.gradedAt && g.gradedAt.odds); + if (price == null || !isTakeable(price)) return null; + return p; +} + +/** Descending comparator that always sorts a null signal LAST (never first). */ +function descNullsLast(a, b) { + if (a == null && b == null) return 0; + if (a == null) return 1; + if (b == null) return -1; + return b - a; +} + /** * #13 — rank tonight's grades by TIER, then the VARYING signal so a leaderboard - * of near-identical rows stops being noise: confidence desc, then |edge| desc, - * stable by input order. Drops gradeless rows. Returns at most `limit`. + * of near-identical rows stops being noise. Drops gradeless rows. Returns at + * most `limit`. + * + * SORT FIX (2026-07-29, `specs/grade-board-sort.md`). The old key was + * `edge: Math.abs(numOr(g.edge, -Infinity))`, carrying two defects that were + * wrong at ANY scale — independent of edge_pct's separate retirement: + * + * 1. abs() ON AN ALREADY-SIGNED VALUE. `edge` is signed BY DIRECTION upstream + * (`edgePctFor`: over ? proj−line : line−proj), so POSITIVE = the model + * AGREES with the graded side. Ranking |edge| put the model's strongest + * DISAGREEMENTS level with its strongest agreements — the board promoted + * reads the model contradicts (177 public ledger rows carry a negative edge). + * 2. `Math.abs(-Infinity) === Infinity`, so a row with NO edge sorted FIRST. + * Absent data presented as the top pick — the `Number(null)` class again. + * + * Now: takeable-gated champion p_win first (so this board and the hero agree), + * then the SIGNED edge, each descending with MISSING SORTING LAST. Rows are + * never dropped for a missing signal — they rank at the bottom. + * + * SCALES ARE NEVER MIXED: p_win (0..1) is compared only against p_win, edge (%) + * only against edge. Comparing 0.62 against 62 is not a comparison. */ function selectTopGrades(grades, limit = 10) { const arr = (Array.isArray(grades) ? grades : []).filter((g) => g && g.grade); @@ -466,9 +518,15 @@ function selectTopGrades(grades, limit = 10) { idx, rank: gradeRankOf(g.grade), conf: numOr(g.confidence, -1), - edge: Math.abs(numOr(g.edge, -Infinity)), + pWin: takeablePWin(g), + // SIGNED — no abs(). null (absent) sorts last, not first. + edge: strictNum(g.edge), })); - scored.sort((a, b) => a.rank - b.rank || b.conf - a.conf || b.edge - a.edge || a.idx - b.idx); + scored.sort((a, b) => a.rank - b.rank + || b.conf - a.conf + || descNullsLast(a.pWin, b.pWin) + || descNullsLast(a.edge, b.edge) + || a.idx - b.idx); return scored.slice(0, Math.max(0, limit)).map((s) => s.g); }