PageSourceSearch

https://recipefix.app/assets/SubscribeSuccess-7z49OEAe.js

js recipefix.app collected 2026-09-24 14:08:58 UTC 2,575 bytes, 1 lines download raw bytes

1import{f as b,r as l,j as s}from"./vendor-react-WTlcpp_v.js";import{u as x,t as k,c as n,Q as D,B as P,aI as F,s as i,ac as j}from"./index-CfbuGyp0.js";import{u as A}from"./vendor-query-D9r2JgXi.js";import"./vendor-shell-BcsIXhhh.js";import"./vendor-radix-Dg0RGC_0.js";import"./vendor-supabase-CsMrTuoW.js";import"./vendor-icons-Zl1GJZx9.js";const U=()=>{const[p]=b(),o=p.get("plan"),r=o==="trial",{toast:g}=x(),[m,f]=l.useState(!1),v=A(),c=new Date;c.setDate(c.getDate()+7);const h=c.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),[d]=l.useState(()=>k());l.useEffect(()=>{document.title=r?"Free Trial Started · RecipeFix":"Subscription Active · RecipeFix",n("subscribe_success_page_viewed",{plan:o||"unknown"}),(async()=>{try{const{data:{session:t}}=await i.auth.getSession();t!=null&&t.user&&r&&n("trial_started",{source:"upgrade_modal"})}catch{}try{await i.functions.invoke("check-subscription")}catch{}if(j(),await v.invalidateQueries({queryKey:["subscription"]}),n("subscription_cache_refreshed",{plan:o||"unknown"}),localStorage.removeItem("rf_checkout_initiated"),!m){f(!0);try{const t=localStorage.getItem("rf_pending_save");if(t){const e=JSON.parse(t),S=new Date(e.savedAt),_=new Date(Date.now()-2*60*60*1e3);if(S<_){localStorage.removeItem("rf_pending_save");return}let{data:{session:a}}=await i.auth.getSession();if(!(a!=null&&a.user)&&(await new Promise(u=>setTimeout(u,1e3)),{data:{session:a}}=await i.auth.getSession(),!(a!=null&&a.user)))return;await new Promise(u=>setTimeout(u,2e3));const{error:y}=await i.from("saved_recipes").insert({user_id:a.user.id,recipe_name:e.recipeName,servings:e.servings,modifications:e.activeModifications||[],ingredients:e.ingredients||[],steps:e.steps||[],explanations:e.explanations||[],original_url:e.originalUrl||null,original_servings:e.originalServings??e.servings,dietary_needs:e.dietaryNeeds||[],ingredient_swaps:e.ingredientSwaps||null});
1y||(g({description:"Your recipe has been saved to your cookbook ✓",duration:4e3}),n("pending_save_recovered")),localStorage.removeItem("rf_pending_save")}}catch(t){console.error("Failed to auto-save pending recipe:",t)}}})()},[]);const w=()=>{window.location.href=`https://recipefix.app${d??"/adapt"}`};return s.jsx(D,{eyebrow:"RecipeFix Plus",title:r?"Your 7-day free trial has started":"You're all set",description:r?s.jsxs(s.Fragment,{children:["You have full Plus access until ",h,"."]}):"Your RecipeFix subscription is active.",children:s.jsx(P,{variant:"hero",size:"xl",className:"rounded-full",onClick:w,children:F(d)})})};export{U 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.