// 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 (
cancel anytime
step 3 · pick your cut

What'll it be?

Choose your platform. Add extras below. Yearly saves ~20%.

{/* Billing toggle */}
{["monthly", "yearly"].map(b => ( ))}
{/* Plan cards */}
{PLANS.map(p => (
setChosen(p.id)} style={{ minHeight: 300, position: "relative", cursor: "pointer" }}> {p.featured && best value}
{p.name} {pill(p.tag)}

{p.blurb}

${billing === "monthly" ? p.price.monthly : p.price.yearly} /{billing === "monthly" ? "mo" : "yr"}
    {p.features.map((f, i) => (
  • {f}
  • ))}
{chosen === p.id && } {chosen === p.id ? "selected" : "tap to select"}
))}
{/* Add-ons */}
secret seasonings {!hasApi && — requires a Stake.com or Stake.us plan}
{ADDONS.map(a => { const active = addonStates[a.id]; const disabled = a.requiresApi && !hasApi; return (
!disabled && addonSetters[a.id](!active)} style={{ border: `2px solid ${active ? "var(--accent)" : "var(--border-2)"}`, borderRadius: "var(--radius-sm)", padding: "14px 18px", minWidth: 200, flex: 1, maxWidth: 320, cursor: disabled ? "not-allowed" : "pointer", opacity: disabled ? 0.4 : 1, background: active ? "rgba(0,230,77,.07)" : "var(--surf)", transition: "border-color .15s, background .15s", }}>
{a.icon} {a.name} +${billing === "monthly" ? a.price.monthly : a.price.yearly} /{billing === "monthly" ? "mo" : "yr"}

{a.blurb}

{active && } {active ? "added" : "tap to add"}
); })}
{/* Order summary */}
{chosenPlan?.name} ${basePrice}/{billing === "monthly" ? "mo" : "yr"}
{addonReload && (
+ Reload Claimer +${ADDONS[0].price[billing]}/{billing === "monthly" ? "mo" : "yr"}
)} {addonSeat && (
+ Extra API Slot +${ADDONS[1].price[billing]}/{billing === "monthly" ? "mo" : "yr"}
)} {promoInfo && (
✓ {promoInfo.code} −{promoInfo.description}
)}
Total ${total}/{billing === "monthly" ? "mo" : "yr"}
{/* Promo code */}
{ setPromoCode(e.target.value.toUpperCase()); setPromoInfo(null); setPromoErr(""); }} placeholder="Promo code (optional)" style={{ flex: 1, padding: "8px 12px", fontSize: 13, background: "var(--surf-2)", color: "var(--text)", border: "1px solid var(--border-2)", borderRadius: "var(--radius-sm)", textTransform: "uppercase", letterSpacing: ".06em", outline: "none" }} /> {checking ? "…" : "Apply"}
{promoErr &&

{promoErr}

} {payError &&

{payError}

}
goto("onboarding")}> Back {checkingOut ? <> Starting… : <>Subscribe · ${total}/{billing === "monthly" ? "mo" : "yr"} }
); }; Object.assign(window, { Subscription });