1import{j as e,d as y,B as a,u as h,g as p,r as f,S as c}from"./index-DSd_KA67.js";import{a as i}from"./api-DEjVNANO.js";import{F as S}from"./Footer-DL92FGRM.js";import{U as v,A as k}from"./auth_helpers-B4M_Ro5M.js";import{C as r}from"./index-DU87hghX.js";import"./surface-CXiMNM_t.js";const P=[{label:"Race Schedule",free:!1,pro:!0},{label:"Sessions / Week",free:"2",pro:"Unlimited"},{label:"Services & Storefront",free:!1,pro:!0},{label:"Track Canvas",free:!1,pro:!0},{label:"Race Day Alerts",free:!1,pro:!0},{label:"All Future Features",free:!1,pro:!0}];function g({value:t}){return t===!0?e.jsx("span",{className:"text-green-500 text-lg",children:"â"}):t===!1?e.jsx("span",{className:"text-neutral-600",children:"â"}):e.jsx("span",{className:"text-sm font-medium",children:t})}function U(){return e.jsxs("div",{className:"min-h-dvh bg-background flex flex-col",children:[e.jsx(v,{children:e.jsx(C,{})}),e.jsx(k,{children:e.jsx(A,{})}),e.jsx(S,{})]})}function C(){const{signIn:t}=y();return e.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:e.jsxs(r,{className:"max-w-md w-full p-8 bg-content1",children:[e.jsxs(r.Header,{className:"flex flex-col items-center gap-2",children:[e.jsx("img",{src:"/img/logos/gokanic_logo_1.svg",alt:"GoKanic",className:"w-48"}),e.jsx("h1",{className:"text-xl font-bold mt-4",children:"Sign in to subscribe"}),e.jsx("p",{className:"text-muted text-sm text-center",children:"Sign in with your GoKanic account to manage your subscription."})]}),e.jsxs(r.Footer,{className:"flex flex-col gap-3 mt-4",children:[e.jsxs(a,{className:"w-full bg-blue-800",onPress:()=>t("google",{redirectTo:`${window.location.origin}/pro`}),children:[e.jsx("img",{className:"w-4 h-4",src:"/img/logos/misc/google_logo.svg",alt:""}),"Sign In with Google"]}),e.jsxs(a,{className:"w-full text-white bg-[#4267B2] font-medium hover:bg-[#1b3d81]",onPress:()=>t("facebook",{redirectTo:`${window.location.origin}/pro`}),children:[e.jsx("img",{className:"w-4 h-4",src:"/img/logos/misc/facebook_logo.svg",alt:""}),"Sign In with Facebook"]})]})]})})}function A(){const t=h(i.auth.loggedInUser),o=h(i.subscriptions.getSubscriptionStatus),b=p(i.subscriptions.createCheckoutSession),j=p(i.subscriptions.createPortalSession),[l,x]=f.useState(null),[m,d]=f.useState(!1);if(t===void 0||o===void 0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(c,{size:"lg"})});const N=o?.isActive??!1,u=async s=>{try{x(`pro-${s}`);const n=await b({tier:"pro",interval:s,source:"web"});n.url&&(window.location.href=n.url)}catch(n){console.error("Checkout error:",n),x(null)}},w=async()=>{try{d(!0);const s=await j({source:"web"});s.url&&(window.location.href=s.url)}catch(s){console.error("Portal error:",s),d(!1)}};return e.jsxs("div",{className:"flex-1 max-w-4xl w-full mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsxs("h1",{className:"text-5xl font-black uppercase tracking-tight",children:[e.jsx("span",{className:"text-white",children:"Know the Track."})," ",e.jsx("span",{className:"text-green-500",children:"Own the Day."})]}),e.jsx("p",{className:"text-neutral-400 mt-4 text-lg",children:"Unlock the full GoKanic experience with Pro."})]}),e.jsx("div",{className:"mb-12 overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-neutral-800",children:[e.jsx("th",{className:"py-3 pr-4 text-neutral-400 text-sm font-medium",children:"Feature"}),e.jsx("th",{className:"py-3 px-4 text-center text-neutral-500 text-xs font-bold uppercase tracking-wider",children:"Free"}),e.jsx("th",{className:"py-3 px-4 text-center text-green-500 text-xs font-bold uppercase tracking-wider",children:"Pro"})]})}),e.jsx("tbody",{children:P.map(s=>e.jsxs("tr",{className:"border-b border-neutral-800/50",children:[e.jsx("td",{className:"py-3 pr-4 text-neutral-300 text-sm",children:s.label}),e.jsx("td",{className:"py-3 px-4 text-center",children:e.jsx(g,{value:s.free})}),e.jsx("td",{className:"py-3 px-4 text-center",children:e.jsx(g,{value:s.pro})})]},s.label))})]})}),N?e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-neutral-400 mb-4",children:["You're subscribed to ",e.jsx("span",{className:"text-green-500 font-bold",children:"Pro"}),"."]}),e.jsx(a,{variant:"outline",className:"px-8 py-3",onPress:w,isDisabled:m,children:m?e.jsx(c,{size:"sm"}):"Manage Subscription"})]}):e.jsx("div",{className:"max-w-sm mx-auto",children:e.jsxs(r,{className:"p-6 bg-content1 border border-neutral-800",children:[e.jsxs(r.Header,{className:"flex flex-col gap-1",children:[e.jsx("h2",{className:"text-2xl font-black uppercase text-green-500",children:"Pro"}),e.jsx("p",{className:"text-neutral-400 text-sm",children:"For dedicated racers"})]}),e.jsxs(r.Content,{className:"flex flex-col gap-4 mt-4",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-4xl font-black text-white",children:"$4.99"}),e.jsx("span",{className:"text-neutral-500",children:"/month"})]}),e.jsx(a,{className:"w-full font-bold bg-green-600 text-white hover:bg-green-700",onPress:()=>u("month"),isDisabled:!!l,children:l==="pro-month"?e.jsx(c,{size:"sm"}):"Subscribe Monthly"}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-4xl font-black text-white",children:"$48"}),e.jsx("span",{className:"text-neutral-500",children:"/year"}),e.jsx("span",{className:"text-green-500 text-sm font-semibold",children:"20% off"})]}),e.jsx(a,{variant:"outline",className:"w-full font-bold border-green-600 text-green-500 hover:bg-green-600/10",onPress:()=>u("year"),isDisabled:!!l,children:l==="pro-year"?e.jsx(c,{size:"sm"}):"Subscribe Yearly"})]})]})}),e.jsx("p",{className:"text-center text-neutral-600 text-sm mt-8",children:"Secure payment via Stripe. Cancel anytime."})]})}
1export{U as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.