PageSourceSearch

https://gonexl.ai/assets/AcademyTierPlans-D7T9zYXJ.js

js gonexl.ai collected 2026-10-09 22:18:09 UTC 9,458 bytes, 1 lines download raw bytes

1import{r as l,j as e}from"./vendor-react-CIi57Twg.js";import{Q as W,L as Z,S as q,c as z,e as K,b as E,an as X,C as A,A as ee,s as te}from"./index-HqOtYtG3.js";import{g as se,C as ne}from"./countries-BYBEOThf.js";import{u as ae,G as re}from"./GuestCheckoutPanel-BKBHf8TC.js";const V={GBP:"£",USD:"$"};function le(s){const n=V[s.currency]||"",a=s.amountMinor/100,c=a.toLocaleString("en-GB",{minimumFractionDigits:a%1===0?0:2,maximumFractionDigits:2});return`${n}${c}`}function oe(s){return s.intervalCount===1?`/${s.interval}`:` every ${s.intervalCount} ${s.interval}s`}function p(s){const n=Math.max(1,s.intervalCount||1);switch(s.interval){case"year":return 12*n;case"month":return n;case"week":return n/4.345;case"day":return n/30.44;default:return null}}function ce(s){const n=p(s);if(!n||n<=1)return null;const a=V[s.currency]||"",o=(s.amountMinor/100/n).toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2});return`${a}${o}/month`}function ie(s,n){const a=p(s),c=p(n);if(!a||!c)return null;const o=s.amountMinor/a*12,f=n.amountMinor/c*12;return o<=0||f>=o?null:Math.round((o-f)/o*100)}function he(){const s=W(),n=ae(),[a,c]=l.useState([]),[o,f]=l.useState(!0),[Y,O]=l.useState("USD"),[i,I]=l.useState(""),[G,R]=l.useState(""),[H,M]=l.useState(null),[T,h]=l.useState(""),[_,U]=l.useState({});l.useEffect(()=>{fetch("/api/tiers").then(t=>t.json()).then(t=>c(t.tiers||[])).catch(()=>{}).finally(()=>f(!1)),fetch("/api/geo/currency").then(t=>t.ok?t.json():null).then(t=>{(t?.currency==="GBP"||t?.currency==="USD")&&O(t.currency)}).catch(()=>{})},[]);const J=async(t,N)=>{if(h(""),!i){h("Please choose your country so we can apply the correct VAT.");return}const u=await n.guestPayload();if(u!==null){M(t.id);try{const m=await te(`/api/subscriptions/checkout/tier/${t.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({buyerCountry:i,buyerVatNumber:G.trim()||void 0,...N?{cadence:N}:{},...u?{guest:u}:{}})}),r=await m.json().catch(()=>({}));if(!m.ok&&n.handleErrorResponse(m.status,r)==="handled")return;if(r.checkoutUrl){window.location.href=r.checkoutUrl;return}h(r.error||"Failed to start checkout. Please try again.")}catch{h("Something went wrong. Please try again.")}finally{M(null)}}},Q=i&&i!=="GB",P=n.active&&/^[A-Z]{2}$/.test(i),j=P?se(i):Y,B=s.slug||null;return e.jsxs(Z,{children:[e.jsx(q,{title:"NexL Academy Subscription Plans",description:"Subscribe to NexL Academy tiers and unlock structured AI learning paths, certifications and exam access.",canonical:"https://gonexl.ai/academy/tiers",jsonLd:z([{name:"Home",url:"https://gonexl.ai/"},{name:"NexL Academy",url:"https://gonexl.ai/academy"},{name:"Plans",url:"https://gonexl.ai/academy/tiers"}])}),e.jsx("section",{className:"py-20 hero-gradient",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-orange-500/10 border border-orange-500/20 mb-4",children:[e.jsx(K,{className:"w-4 h-4 text-orange-400"}),e.jsx("span",{className:"text-xs text-orange-400 font-medium",children:"NexL Academy Subscriptions"})]}),e.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-white mb-3 font-heading",children:"Choose your tier"}),e.jsx("p",{className:"text-gray-400 max-w-2xl mx-auto",children:"Pick the certification tier that matches your goals. Each subscription unlocks the tier's curriculum, practice exams and verified credential when you pass."})]}),e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl p-6 mb-8 max-w-xl mx-auto",children:[e.jsx("h2",{className:"text-sm font-semibold text-white mb-3",children:"Billing details"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Country (for VAT)"}),e.jsxs("select",{value:i,onChange:t=>{I(t.target.value),h("")},className:"w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-sm text-white focus:border-orange-500 focus:outline-none",children:[e.jsx("option",{value:"",children:"Select country…"}),ne.map(t=>e.jsx("option",{value:t.code,children:t.name},t.code))]})]}),Q&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"VAT number (optional, for B2B reverse charge)"}),e.jsx("input",{type:"text",value:G,onChange:t=>R(t.target.value),placeholder:"e.g. DE123456789",className:"w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-sm text-white placeholder:text-gray-500 focus:border-orange-500 focus:outline-none"})]}),e.jsx(re,{guest:n,returnTo:B?`/academy/tiers/${B}`:"/academy/tiers",tone:"dark",testIdPrefix:"tier-guest"}),e.jsx("p",{className:"text-xs text-gray-500",children:"We use this at every renewal to apply the correct VAT treatment on your invoice."})]})]}),T&&e.jsx("div",{className:"max-w-xl mx-auto mb-6 px-4 py-3 rounded-lg bg-red-500/10 border border-red-500/20 text-sm text-red-400 text-center",children:T}),o?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(E,{className:"w-8 h-8 animate-spin text-orange-500"})}):a.length===0?e.jsx("p",{className:"text-center text-gray-400",children:"No subscription tiers are available right now."}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:a.map(t=>{const N=B===t.slug,u=H===t.id,m=j,r=m==="GBP"?t.priceGbp:t.priceUsd,w=m==="GBP"?t.priceGbpYearly:t.priceUsdYearly,v=y=>{const x=y?p(y):null;return x==null?null:x<=1.05?"monthly":x>=11?"yearly":null},C=v(r)==="monthly"?r:v(w)==="monthly"?w:null,S=v(r)==="yearly"?r:v(w)==="yearly"?w:null,k=!!C&&!!S,d=k?_[t.id]??"yearly":null;return e.jsxs("div",{className:`bg-white/5 border rounded-xl p-6 flex flex-col transition-colors ${N?"border-orange-500/60 ring-1 ring-orange-500/40":"border-white/10"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.iconUrl?e.jsx("img",{src:X(t.iconUrl)||void 0,alt:`${t.name} badge`,className:"inline-block h-6 w-6 object-contain"}):e.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{backgroundColor:t.themeColor||"#f97316"}}
1),e.jsx("h3",{className:"text-lg font-bold text-white",children:t.name})]}),t.shortName&&e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:t.shortName}),t.description&&e.jsx("p",{className:"text-sm text-gray-400 mb-4 flex-1",children:t.description}),(()=>{const y=j==="GBP"?t.priceGbp:t.priceUsd,x=P?y??(j==="GBP"?t.priceGbpYearly:t.priceUsdYearly):y??t.priceUsd??t.priceGbp,g=k?(d==="monthly"?C:S)??x:x;if(!g)return e.jsx("div",{className:"mb-4",children:e.jsx("p",{className:"text-sm text-gray-500",children:P?`Not available for billing in ${j}.`:"Pricing available at checkout."})});const L=p(g),D=L!=null&&L>=12,F=D?ce(g):null,b=C&&S?ie(C,S):null;return e.jsxs("div",{className:"mb-4",children:[k&&e.jsxs("div",{role:"tablist","aria-label":"Billing cadence",className:"inline-flex p-0.5 mb-3 rounded-lg bg-white/5 border border-white/10",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":d==="monthly",onClick:()=>U($=>({...$,[t.id]:"monthly"})),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${d==="monthly"?"bg-orange-500 text-white":"text-gray-300 hover:text-white"}`,"data-testid":`button-cadence-monthly-${t.id}`,children:"Monthly"}),e.jsxs("button",{type:"button",role:"tab","aria-selected":d==="yearly",onClick:()=>U($=>({...$,[t.id]:"yearly"})),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors flex items-center gap-1 ${d==="yearly"?"bg-orange-500 text-white":"text-gray-300 hover:text-white"}`,"data-testid":`button-cadence-yearly-${t.id}`,children:["Yearly",b!==null&&e.jsxs("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full ${d==="yearly"?"bg-white/20":"bg-orange-500/20 text-orange-300"}`,children:["-",b,"%"]})]})]}),e.jsxs("div",{className:"flex items-baseline gap-1 flex-wrap",children:[e.jsx("span",{className:"text-3xl font-bold text-white",children:le(g)}),e.jsx("span",{className:"text-sm text-gray-400",children:oe(g)}),F&&e.jsxs("span",{className:"text-sm text-gray-300 ml-1",children:["just ",F]})]}),b!==null&&!k&&e.jsx("p",{className:"text-xs font-semibold text-orange-400 mt-1",children:D?`Save ${b}% vs monthly`:`Save ${b}% with annual billing`}),e.jsx("p",{className:"text-[11px] text-gray-500 mt-1",children:"+ VAT where applicable"})]})})(),e.jsxs("ul",{className:"text-xs text-gray-400 space-y-1 mb-5",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-3.5 h-3.5 text-orange-400 mt-0.5 flex-shrink-0"}),"Full access to ",t.name," learning content"]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-3.5 h-3.5 text-orange-400 mt-0.5 flex-shrink-0"}),"Certification valid for ",t.validityMonths," months"]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-3.5 h-3.5 text-orange-400 mt-0.5 flex-shrink-0"}),"Cancel any time from your dashboard"]})]}),e.jsx("button",{onClick:()=>J(t,d),disabled:u,className:"mt-auto inline-flex items-center justify-center gap-2 bg-orange-500 hover:bg-orange-600 disabled:opacity-50 text-white px-4 py-2.5 rounded-lg text-sm font-semibold transition-colors",children:u?e.jsx(E,{className:"w-4 h-4 animate-spin"}):e.jsxs(e.Fragment,{children:["Subscribe",e.jsx(ee,{className:"w-4 h-4"})]})})]},t.id)})})]})})]})}export{he 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.