PageSourceSearch

https://trains.fyi/_next/static/chunks/pages/pro-1d6d99163fb6a344.js

js trains.fyi collected 2026-09-24 09:55:12 UTC 6,823 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6945],{2001:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var a=s(37876),l=s(48230),n=s.n(l),r=s(89099),i=s(14232),c=s(85392),o=s(74),d=s(93408),u=s(25620),m=s(21081),h=s(8715);function x(){let e=(0,r.useRouter)(),{user:t,loading:s}=(0,u.A)(),{isPremium:l,entitlementLoading:x,refreshPremium:p}=(0,m.x)(),[b,f]=(0,i.useState)(null),[g,j]=(0,i.useState)(""),[y,w]=(0,i.useState)(!1),[N,v]=(0,i.useState)(null),[k,P]=(0,i.useState)(0),A=t?.uid||null,C=!!A&&N===A;(0,i.useEffect)(()=>{if(s||!h.ym)return;let e=!0;return j(""),(0,h.PC)(A).then(t=>{e&&f({uid:A,plans:t})}).catch(()=>{e&&j("Unable to load plans. Please try again.")}),()=>{e=!1}},[A,s,k]),(0,i.useEffect)(()=>{let t;if(!C)return;let s=!0,a=0,l=async()=>{try{let t=await p();if(s&&t.isPremium)return void e.replace("/account/?upgraded=1")}catch{}s&&(++a<10?t=setTimeout(l,3e3):j("Your payment is still being confirmed. Check your account status before starting another purchase."))};return l(),()=>{s=!1,clearTimeout(t)}},[C,p,e]);let S=async s=>{if(!t)return void e.push(`/login/?returnUrl=${encodeURIComponent("/pro/")}`);w(!0),j("");try{(await (0,h.Je)(t.uid,s)).cancelled||v(t.uid)}catch(e){j(e.message||"Unable to start checkout. Please try again.")}finally{w(!1)}},E=b?.uid===A?b.plans:null;return(0,a.jsxs)("div",{className:"min-h-screen flex flex-col bg-slate-50",children:[(0,a.jsx)(d.A,{title:"trains.fyi Pro",description:"Go Pro with a monthly or annual subscription. One account for web, iOS and Android.",canonical:"/pro/"}),(0,a.jsx)(o.A,{}),(0,a.jsxs)("main",{className:"flex-1",children:[(0,a.jsxs)("section",{className:"bg-blue-800 text-white px-6 pt-16 pb-24 text-center",children:[(0,a.jsx)("p",{className:"text-sm font-semibold uppercase tracking-widest text-blue-200",children:"trains.fyi Pro"}),(0,a.jsx)("h1",{className:"mt-4 text-4xl sm:text-5xl font-bold tracking-tight",children:"More of the journey."}),(0,a.jsx)("p",{className:"mx-auto mt-5 max-w-xl text-lg text-blue-100",children:"Follow your trains without ads, with Pro features across the web, iOS and Android."})]}),(0,a.jsxs)("div",{className:"max-w-4xl mx-auto px-6 pb-16 -mt-10 relative",children:[(0,a.jsxs)("div",{className:"rounded-2xl bg-white shadow-lg border border-slate-200 p-6 sm:p-10",children:[C?(0,a.jsxs)("div",{className:"text-center space-y-4",role:"status",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold",children:"Activating Pro"}),(0,a.jsx)("p",{children:"We’re confirming your subscription. Your access will follow you to every platform."}),(0,a.jsx)(n(),{href:"/account/",className:"inline-block text-blue-700 underline",children:"Check account status"})]}):l?(0,a.jsxs)("div",{className:"text-center space-y-4",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold",children:"You already have Pro"}),(0,a.jsx)("p",{children:"Your account has access on the web, iOS and Android."}),(0,a.jsx)(n(),{href:"/account/",className:"inline-block rounded-lg bg-blue-700 text-white px-6 py-3 font-semibold",children:"Manage your subscription"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-2xl font-bold text-slate-900",children:"Choose your plan"}),(0,a.jsx)("p",{className:"text-slate-600 mt-2",children:"The same Pro access, billed monthly or annually. Cancel renewal anytime."}),h.ym?E||g?E?.length===0?(0,a.jsx)("p",{className:"mt-6",role:"status",children:"Plans are currently unavailable. Please check back soon."}):(0,a.jsx)("div",{className:"grid sm:grid-cols-2 gap-5 mt-7",children:E?.map(e=>(0,a.jsxs)("div",{className:"rounded-xl border border-slate-200 p-6 flex flex-col",children:[(0,a.jsx)("h3",{className:"text-xl font-semibold",children:e.label}),(0,a.jsxs)("p",{className:"mt-4",children:[(0,a.jsx)("span",{className:"text-3xl font-bold",children:e.package.webBillingProduct.price.formattedPrice}),(0,a.jsxs)("span",{className:"text-slate-600",children:[" / ",e.period]})]}),(0,a.jsxs)("p",{className:"mt-2 text-sm text-slate-600",children:["Billed ","annual"===e.id?"annually":"monthly",". Renews automatically until cancelled."]}),(0,a.jsx)("button",{onClick:()=>S(e.id),disabled:y||s||x,className:"mt-6 w-full rounded-lg bg-blue-700 text-white font-semibold px-4 py-3 hover:bg-blue-800 disabled:opacity-50",children:y?"Opening checkout…":t?`Choose ${e.label.toLowerCase()}`:"Sign in to subscribe"})]},e.id))}):(0,a.jsx)("p",{className:"mt-6",role:"status",children:"Loading plans…"}):(0,a.jsx)("p",{className:"mt-6 rounded-lg bg-blue-50 p-4 text-blue-900",role:"status",children:"Web subscriptions are coming soon. You can still sign in to access Pro purchased in the app."}),(0,a.jsxs)("p",{className:"mt-6 text-sm text-slate-500",children:["Any applicable taxes and introductory offers are shown at checkout. Your purchase is linked to the account you sign in with. ",(0,a.jsx)(n(),{href:"/terms/",className:"underline",children:"Terms"})," \xb7 ",(0,a.jsx)(n(),{href:"/privacy/",className:"underline",children:"Privacy"}),"."]})]}),g&&(0,a.jsxs)("div",{role:"alert",className:"mt-5 rounded-lg bg-red-50 p-4 text-red-800",children:[g," ",!C&&(0,a.jsx)("button",{onClick:()=>{f(null),P(e=>e+1)},className:"ml-2 underline",children:"Retry"})]})]}),(0,a.jsx)("div",{className:"grid sm:grid-cols-3 gap-8 mt-12",children:[["An ad-free experience","Enjoy trains.fyi without ads when you’re signed in to Pro."],["Premium web maps","Explore Satellite, Hybrid, Terrain, and our TrainsFYI network map."],["Pro in the mobile apps","Use train alerts and premium map features in the iOS and Android apps."],["One subscription","Sign in with the same account on every device. Your Pro access comes with you."]].map(([e,t])=>(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"font-semibold text-lg text-slate-900",children:e}),(0,a.jsx)("p",{className:"mt-2 text-slate-600",children:t})]},e))}),!t&&(0,a.jsxs)("p",{className:"mt-12 text-center text-slate-600",children:["Already subscribed 
1in the app? ",(0,a.jsx)(n(),{href:"/login/?returnUrl=%2Faccount%2F",className:"text-blue-700 underline",children:"Sign in with the same account"}),"."]})]})]}),(0,a.jsx)(c.A,{})]})}},8302:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/pro",function(){return s(2001)}])},77808:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var a=s(14232);let l=a.forwardRef(function({title:e,titleId:t,...s},l){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},s),e?a.createElement("title",{id:t},e):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"}))})}},e=>{e.O(0,[6701,3927,2325,3990,8447,5392,636,6593,8792],()=>e(e.s=8302)),_N_E=e.O()}]);

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.