PageSourceSearch

https://recipefix.app/assets/Success-DBMa5-Mv.js

js recipefix.app collected 2026-09-24 14:08:23 UTC 7,985 bytes, 9 lines download raw bytes

1import{r as s,f as $,j as e,L as b}from"./vendor-react-WTlcpp_v.js";import{B as j,c as a,s as o,a4 as z}from"./index-CfbuGyp0.js";import{N as B}from"./Navbar-D0zY8wrD.js";import{F as D}from"./Footer-pcEK-Owo.js";import{l as q,aa as T}from"./vendor-icons-Zl1GJZx9.js";import"./vendor-shell-BcsIXhhh.js";import"./vendor-radix-Dg0RGC_0.js";import"./vendor-query-D9r2JgXi.js";import"./vendor-supabase-CsMrTuoW.js";import"./DarkModeToggle-xhxrSBsu.js";import"./bottom-sheet-D0XX9brW.js";import"./vendor-ui-Ciej6rkM.js";import"./iapAuth-BDL-LEJA.js";const oe=()=>{const[M,_]=s.useState(!1),[k]=$(),[w,v]=s.useState(!1),[S,N]=s.useState(!1),[n,x]=s.useState(null),[C,h]=s.useState(0),[R,g]=s.useState(!1),[Y,U]=s.useState(null),[H,F]=s.useState(null),u=k.get("plan"),l=u==="trial",m=new Date;m.setDate(m.getDate()+7);const P=m.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});s.useEffect(()=>{document.title=l?"Free Trial Started · RecipeFix":"Welcome to Plus · RecipeFix"},[l]),s.useEffect(()=>{(async()=>{try{const{data:{session:t}}=await o.auth.getSession();if(t!=null&&t.user){U(t.user.id),F(t.user.email||null);const{data:r}=await o.from("profiles").select("subscription_status, is_pro").eq("user_id",t.user.id).maybeSingle();((r==null?void 0:r.subscription_status)==="expired"||(r==null?void 0:r.subscription_status)==="cancelled")&&v(!0),l&&a("trial_started",{source:"upgrade_modal"})}if(await o.functions.invoke("check-subscription"),t!=null&&t.user){const{data:r}=await o.from("profiles").select("is_pro").eq("user_id",t.user.id).maybeSingle();N((r==null?void 0:r.is_pro)===!0);const{data:c}=await o.from("referrals").select("referral_code, total_uses").eq("referrer_user_id",t.user.id);if(c&&c.length>0){x(c[0].referral_code);const d=c.reduce((p,f)=>p+(f.total_uses||0),0);h(d)}else{const d=Array.from(crypto.getRandomValues(new Uint8Array(4))).map(f=>f.toString(36).padStart(2,"0")).join("").slice(0,8).toUpperCase(),{error:p}=await o.from("referrals").insert({referrer_user_id:t.user.id,referrer_email:t.user.email||"",referral_code:d});p||(x(d),h(0))}}}catch{}a("upgrade_completed",{plan:u||"unknown"}),a("subscription_activated",{plan:u||"unknown",source:"stripe"}),_(!0)})()},[]);const i=n?`https://recipefix.app/?ref=${n}`:"",E=async()=>{if(i)try{await navigator.clipboard.writeText(i),g(!0),a("referral_link_copied",{source:"success_page"}),setTimeout(()=>g(!1),2e3)}catch{a("referral_link_copy_failed",{source:"success_page"}),z({description:"Couldn't copy automatically — select the link above and copy it.",variant:"destructive"})}},I=n?encodeURIComponent(`Hey! I've been using RecipeFix to adapt recipes for my diet and it's genuinely great. Use my link to sign up and you'll get 7 days of Plus free · just create your account and adapt one recipe to unlock it:
2
3${i}`):"",L=encodeURIComponent("7 days of RecipeFix Plus · on me"),W=n?encodeURIComponent(`Hey,
4
5I've been using RecipeFix to adapt recipes for dietary restrictions · it rewrites the whole recipe including instructions in seconds.
6
7Use my link to sign up and you'll get 7 days of Plus completely free. Just create your account and adapt one recipe:
8
9${i}`):"",A=S&&n&&C<3;return e.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[e.jsx(B,{}),e.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-6 text-center",children:[l?e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"font-heading text-4xl font-semibold text-foreground",children:"Your 7-day free trial has started 🎉"}),e.jsxs("p",{className:"mt-4 font-body text-base text-muted-foreground max-w-md",children:["You have full Plus access until ",P,". We'll remind you before your trial ends."]})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"font-heading text-4xl font-semibold text-foreground",children:w?"Welcome back to Plus! 🎉":"Welcome to Plus! 🎉"}),e.jsx("p",{className:"mt-4 font-body text-base text-muted-foreground",children:"Unlimited adaptations, unlimited cookbook saves, higher refinement limits · all yours now."})]}),e.jsx(j,{asChild:!0,variant:"hero",size:"xl",className:"mt-8 rounded-full",children:e.jsx(b,{to:"/adapt",children:"Start Adapting"})}),e.jsxs("p",{className:"mt-4 font-body text-xs text-muted-foreground",children:["Subscription questions?"," ",e.jsx("a",{href:"mailto:[email protected]?subject=RecipeFix%20Support",className:"text-primary underline hover:text-foreground",children:"[email protected]"})]}),A&&e.jsxs("div",{className:"mt-10 w-full max-w-md",children:[e.jsx("div",{className:"h-px bg-border"}),e.jsxs("div",{className:"mt-8 text-left",children:[e.jsx("h2",{className:"font-heading text-lg font-bold text-foreground",children:"Get a free month · refer a friend"}),e.jsx("p",{className:"mt-2 font-body text-sm text-muted-foreground",children:"Share your link with someone who cooks with dietary restrictions. When they adapt their first recipe, you get one month free."}),e.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[e.jsx("input",{type:"text",readOnly:!0,value:i,className:"flex-1 rounded-lg border border-border bg-secondary px-3 py-2 font-body text-sm text-foreground select-all",onClick:y=>y.target.select()}),e.jsx(j,{variant:"outline",size:"sm",className:"rounded-full gap-1.5 shrink-0",onClick:E,children:R?e.jsxs(e.Fragment,{children:[e.jsx(q,{size:14}),"Copied! ✓"]}):e.jsxs(e.Fragment,{children:[e.jsx(T,{size:14}),"Copy Link"]})})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[e.jsxs("a",{href:`https://wa.me/?text=${I}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>a("referral_share_opened",{method:"whatsapp",source:"success_page"}),className:"inline-flex items-center justify-center gap-2 rounded-full border border-border px-4 py-2 font-body text-sm text-foreground hover:bg-secondary transition-colors",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"
9currentColor",children:e.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})}),"WhatsApp"]}),e.jsxs("a",{href:`mailto:?subject=${L}&body=${W}`,onClick:()=>a("referral_share_opened",{method:"email",source:"success_page"}),className:"inline-flex items-center justify-center gap-2 rounded-full border border-border px-4 py-2 font-body text-sm text-foreground hover:bg-secondary transition-colors",children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),"Email"]})]}),e.jsxs("p",{className:"mt-4 font-body text-xs text-muted-foreground",children:["Your link works for up to 3 people. Manage your referrals in"," ",e.jsx(b,{to:"/account",className:"text-primary hover:underline",children:"Account →"})]})]})]})]}),e.jsx(D,{})]})};export{oe as default};

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.