// Pricing page — routes every purchase to Gumroad (Option C model).
//
// Catalog-wide offers up top, then a per-module picker exposing the five
// products each module has on Gumroad. All links + prices live in
// site-data.js (SITE.CATALOG_OFFERS, SITE.MODULE_PRODUCTS). Gumroad handles
// payment + delivery; videos stream, ebooks/templates download.
const { useState } = React;
const ENROLL_DEFAULTS = /*EDITMODE-BEGIN*/{ "themeColor": "navy" } /*EDITMODE-END*/;
function priceLabel(p) {
return (p === null || p === undefined) ? "—" : "$" + p;
}
function BuyCard({ icon, title, desc, product, popular }) {
const url = product && product.url ? product.url : "#";
const live = url && url !== "#";
return (
);
}
function EnrollApp() {
const [tweaks, setTweak] = useTweaks(ENROLL_DEFAULTS);
useLucideIcons([tweaks]);
useTweakBodyClasses(tweaks);
const modules = SITE.MODULES;
const initial = (() => {
const p = new URLSearchParams(window.location.search).get("module");
const n = parseInt(p, 10);
return (n >= 1 && n <= modules.length) ? n : 1;
})();
const [modNum, setModNum] = useState(initial);
const mod = modules.find(m => m.num === modNum) || modules[0];
const prod = SITE.MODULE_PRODUCTS.find(p => p.num === modNum) || {};
const cat = SITE.CATALOG_OFFERS;
const options = [
{ key: "video", icon: "play-circle", title: t("enroll.optVideo"), desc: t("enroll.optVideoDesc"), product: prod.video },
{ key: "ebook", icon: "book-open", title: t("enroll.optEbook"), desc: t("enroll.optEbookDesc"), product: prod.ebook },
{ key: "bundle", icon: "layers", title: t("enroll.optBundle"), desc: t("enroll.optBundleDesc"), product: prod.bundle },
{ key: "templates", icon: "layout-template", title: t("enroll.optTemplates"), desc: t("enroll.optTemplatesDesc"), product: prod.templates },
{ key: "full", icon: "package", title: t("enroll.optFull"), desc: t("enroll.optFullDesc"), product: prod.full, popular: true },
];
return (
<>
{t("enroll.eyebrow")}
{t("enroll.title")}
{t("enroll.sub")}
{/* Catalog-wide offers */}
{t("enroll.catalogHeading")}
{/* Per-module picker */}
{t("enroll.moduleHeading")}
{t("enroll.moduleSub")}
{options.map(o => (
))}
{t("enroll.localNote")}
setTweak("themeColor", v)}
options={[
{ value: "navy", label: "Navy" },
{ value: "graphite", label: "Graphite" },
{ value: "emerald", label: "Emerald" },
{ value: "gold", label: "Gold" }]
} />
>);
}
window.EnrollApp = EnrollApp;