// screens-setup.jsx — Post-signup subscription redirect. // The old ApiSetup and ExtInstall flows lived here — superseded by the // Telegram bot (/buyapi, /addkey, /install), so the web flow now exists // only as the post-signup landing before Billing takes over. // ── SUBSCRIPTION ────────────────────────────────────────────── const MAX_SLOTS = 4; const Subscription = ({ goto, path, plan, setPlan }) => { const [billing, setBilling] = React.useState("monthly"); const [chosen, setChosen] = React.useState(plan || "house_cut"); const [slotCount, setSlots] = React.useState(1); const [promoCode, setPromoCode] = React.useState(""); const [promoInfo, setPromoInfo] = React.useState(null); const [promoErr, setPromoErr] = React.useState(""); const [checking, setChecking] = React.useState(false); const [checkingOut, setCheckingOut] = React.useState(false); const [payError, setPayError] = React.useState(""); // Three paid tiers — every plan covers both Stake.com and Stake.us, ships // with reloads + daily dollar, and grants the (forthcoming) Shuffle/Thrill // extension. What separates them is which code tiers BoostMonitor will route // to the user: regular only / + highroller / + Saturday stream. const PLANS = [ { id: "house_cut", name: "The House Cut", tag: "Regular codes", price: { monthly: 10, yearly: 96 }, blurb: "Regular bonus drops on both Stake.com and Stake.us — daily dollar and reloads on us.", features: [ "Regular bonus codes (both platforms)", "Reloads + Stake.us daily dollar — bundled", "Pre-solved captchas, residential proxy", "Extension access (Shuffle + Thrill — coming soon)", ], }, { id: "prime_cut", name: "The Prime Cut", tag: "+ Highroller", price: { monthly: 15, yearly: 144 }, blurb: "Regular + highroller codes, both platforms. The pour-over of bonus claiming.", features: [ "Everything in House Cut", "Highroller codes (both platforms)", "Same bundled reloads + daily dollar", "Telegram alerts on every claim", ], featured: true, }, { id: "grand_feast", name: "The Grand Feast", tag: "Every code", price: { monthly: 30, yearly: 288 }, blurb: "The whole spread — regular, highroller, and Saturday stream codes for both platforms.", features: [ "Everything in Prime Cut", "Saturday stream codes (both platforms)", "First in line on every drop tier", "Priority support", ], }, ]; const chosenPlan = PLANS.find(p => p.id === chosen); const basePrice = billing === "monthly" ? (chosenPlan?.price.monthly ?? 0) : (chosenPlan?.price.yearly ?? 0); // Price scales linearly with slot count. 1 slot = 1 API key bound to one // platform; buying a 2nd slot lets the user run both Stake.com and Stake.us // in parallel under the same tier. const total = basePrice * slotCount; const checkPromo = async () => { if (!promoCode.trim()) return; setPromoErr(""); setChecking(true); setPromoInfo(null); const token = localStorage.getItem("cc_token"); try { const r = await fetch("/api/promo/check", { method: "POST", headers: { "content-type": "application/json", "Authorization": `Bearer ${token}` }, body: JSON.stringify({ code: promoCode.trim() }), }); const d = await r.json(); if (d.error) { setPromoErr(d.error); } else { setPromoInfo(d); } } catch (_) { setPromoErr("Network error"); } setChecking(false); }; const checkout = async () => { setPayError(""); const token = localStorage.getItem("cc_token"); if (!token) { goto("signup"); return; } setCheckingOut(true); try { const r = await fetch("/api/payments/create", { method: "POST", headers: { "content-type": "application/json", "Authorization": `Bearer ${token}` }, body: JSON.stringify({ plan: chosen, addons: { reload: addonReload, extra_seat: addonSeat }, promo_code: promoCode.trim() || undefined, }), }); const d = await r.json(); if (d.error) { setPayError(d.error); setCheckingOut(false); return; } if (d.dev_mode || !d.invoice_url) { setPlan(chosen); goto("api-setup"); } else { window.location.href = d.invoice_url; } } catch { setPayError("Network error — try again"); setCheckingOut(false); } }; const pill = (label) => ( {label} ); return (
Choose your platform. Add extras below. Yearly saves ~20%.
{/* Billing toggle */}{p.blurb}
{a.blurb}
{promoErr}
} {payError &&{payError}
}