1import{r as i,j as e,av as J}from"./vendor-_ezZoJiD.js";import{C as $,a as K,b as Z,c as O}from"./card-CREZV1r6.js";import{B}from"./button-DatArJX-.js";import{B as D}from"./badge-TvqE-Pbx.js";import{S as X}from"./switch-Cy_6nX3c.js";import{d as ee,u as q}from"./index-DJLK6UyP.js";import{L as te}from"./LandingLayout-dmgb-oP9.js";import{b as se}from"./tanstack-CMznP40l.js";import{p as I,a0 as re,a7 as W,a8 as ae,Z as ne,U as ie,s as le,w as oe,a9 as ce,G as de}from"./icons-BvJ5U55O.js";import"./radix-ui-CF92MDW-.js";import"./pdf-utils-B8cFOiHv.js";import"./router-ToXy81Ol.js";import"./animation-DJYEBcdM.js";const V=(s,a)=>{const r=new Date(s);return r.setDate(r.getDate()+a),r},U=(s,a)=>{const r=new Date(s);return r.setMonth(r.getMonth()+a),r},_=(s,a)=>{const r=new Date(s);return r.setFullYear(r.getFullYear()+a),r},A=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),M=new Date,R=V(M,15),me=V(R,-7),xe=()=>{try{const s=new Uint8Array(16);return crypto.getRandomValues(s),Array.from(s).map(a=>a.toString(16).padStart(2,"0")).join("")}catch{return Math.random().toString(36).slice(2)}},he=()=>{let s=[];return{check(){const a=Date.now();return s=s.filter(r=>a-r<1e4),s.length>=3?!1:(s.push(a),!0)}}},L=()=>e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"10",cy:"10",r:"10",fill:"#22c55e"}),e.jsx("path",{d:"M6 10.5l3 3 5-5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ue=()=>e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",fill:"white"}),e.jsx("rect",{x:"5",y:"12",width:"14",height:"9",rx:"1",fill:"white",opacity:"0.8"}),e.jsx("path",{d:"M12 8V21",stroke:"#136fb0",strokeWidth:"1.5"}),e.jsx("path",{d:"M9 8C9 8 7 6 9 4C11 2 12 5 12 8",stroke:"white",strokeWidth:"1.5",fill:"none"}),e.jsx("path",{d:"M15 8C15 8 17 6 15 4C13 2 12 5 12 8",stroke:"white",strokeWidth:"1.5",fill:"none"})]}),pe=()=>e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"11",stroke:"#94a3b8",strokeWidth:"1.5",fill:"white"}),e.jsx("path",{d:"M12 7a4 4 0 014 4v3l1 1H7l1-1v-3a4 4 0 014-4z",fill:"#94a3b8"}),e.jsx("path",{d:"M10.5 17.5a1.5 1.5 0 003 0",fill:"#94a3b8"})]}),fe=()=>e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"11",stroke:"#f59e0b",strokeWidth:"1.5",fill:"white"}),e.jsx("path",{d:"M5 14l2.5-3 2.5 2.5 2-4 2 4 2.5-2.5L19 14l-1 3H6l-1-3z",fill:"#f59e0b"})]}),z=()=>e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{display:"inline",marginRight:3,verticalAlign:"middle"},children:[e.jsx("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2",fill:"#94a3b8"}),e.jsx("path",{d:"M8 11V7a4 4 0 018 0v4",stroke:"#94a3b8",strokeWidth:"2",fill:"none"})]}),ge=()=>e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{display:"inline",marginRight:4,verticalAlign:"middle"},children:[e.jsx("path",{d:"M12 3L4 7v5c0 4.4 3.4 8.5 8 9.5 4.6-1 8-5.1 8-9.5V7l-8-4z",fill:"#22c55e",opacity:"0.25",stroke:"#22c55e",strokeWidth:"1.5"}),e.jsx("path",{d:"M9 12l2 2 4-4",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round"})]}),H=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{display:"inline",marginRight:6,verticalAlign:"middle",animation:"spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"white",strokeWidth:"3",opacity:"0.3"}),e.jsx("path",{d:"M12 2a10 10 0 0110 10",stroke:"white",strokeWidth:"3",strokeLinecap:"round"}),e.jsx("style",{children:"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"})]}),ye=()=>e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"#6b7280",strokeWidth:"2",strokeLinecap:"round"})}),je=({planInfo:s,onBack:a})=>{const[r,v]=i.useState(""),[h,p]=i.useState(""),[o,f]=i.useState(""),[g,w]=i.useState(""),[d,P]=i.useState(!1),[F,S]=i.useState(!1),[y,k]=i.useState(""),m=i.useRef(!1),C=i.useRef(0),t=n=>v(n.replace(/\D/g,"").slice(0,16).replace(/(.{4})/g,"$1 ").trim()),c=n=>{const N=n.replace(/\D/g,"").slice(0,4);p(N.length>2?N.slice(0,2)+"/"+N.slice(2):N)},u=()=>{const n=Date.now();if(!(n-C.current<800||m.current)){if(C.current=n,m.current=!0,k(""),!g.trim()){k("Please enter cardholder name."),m.current=!1;return}if(r.replace(/\s/g,"").length<16){k("Please enter a valid 16-digit card number."),m.current=!1;return}if(h.length<5){k("Please enter a valid expiry (MM/YY)."),m.current=!1;return}if(o.length<3){k("Please enter a valid CVV."),m.current=!1;return}P(!0),setTimeout(()=>{P(!1),S(!0),m.current=!1},2200)}},j=n=>{n.target.style.boxShadow="0 0 0 2px #136fb033",n.target.style.borderColor="#136fb0"},b=n=>{n.target.style.boxShadow="none",n.target.style.borderColor="#e5e7eb"};return F?e.jsx("div",{className:"flex items-center justify-center p-4 min-h-[400px]",children:e.jsxs("div",{className:"text-center w-full max-w-sm",children:[e.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",style:{background:"#e8f5e9"},children:e.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{cx:"12",cy:"12",r:"12",fill:"#22c55e"}),e.jsx("path",{d:"M7 12.5l3.5 3.5 6-7",stroke:"white",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}
1),e.jsx("h2",{className:"text-2xl font-bold text-gray-800 mb-2",children:"Payment Successful!"}),e.jsx("p",{className:"text-gray-500 text-sm mb-1",children:"You're now subscribed to"}),e.jsx("p",{className:"font-bold text-gray-700 mb-5",children:s.label}),e.jsx("p",{className:"text-xs text-gray-400 mb-6",children:"A confirmation email has been sent to your registered address."}),e.jsx("button",{onClick:a,className:"text-sm underline",style:{color:"#136fb0"},children:"â Back to Plans"})]})}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-5 py-4 flex-shrink-0",style:{background:"#136fb0"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("button",{onClick:a,className:"flex items-center gap-1 text-white opacity-80 hover:opacity-100 text-sm transition-opacity",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M15 19l-7-7 7-7",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})}),"Back"]}),e.jsx("span",{className:"text-white font-bold text-sm",children:"OptraFlow"})]}),e.jsxs("div",{className:"text-white",children:[e.jsx("div",{className:"text-xs opacity-80 mb-0.5",children:"Amount to pay"}),e.jsx("div",{className:"text-3xl font-bold",children:s.amount}),e.jsx("div",{className:"text-xs opacity-70 mt-0.5",children:s.label})]})]}),e.jsxs("div",{className:"px-5 py-5 overflow-y-auto flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-green-600 bg-green-50 px-3 py-2 rounded-lg mb-5 border border-green-100",children:[e.jsx(ge,{}),"256-bit SSL encrypted · PCI DSS compliant payment"]}),e.jsx("div",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider mb-3",children:"Card Details"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-xs text-gray-500 mb-1",htmlFor:"cc-name",children:"Cardholder Name"}),e.jsx("input",{id:"cc-name",type:"text",value:g,onChange:n=>w(n.target.value),placeholder:"Name on card",maxLength:60,autoComplete:"cc-name",className:"w-full border border-gray-200 rounded-lg px-3 py-2.5 text-sm outline-none transition-all",onFocus:j,onBlur:b})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-xs text-gray-500 mb-1",htmlFor:"cc-number",children:"Card Number"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"cc-number",type:"text",inputMode:"numeric",value:r,onChange:n=>t(n.target.value),placeholder:"1234 5678 9012 3456",autoComplete:"cc-number",className:"w-full border border-gray-200 rounded-lg px-3 py-2.5 text-sm outline-none pr-14 transition-all",onFocus:j,onBlur:b}),e.jsxs("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex gap-1",children:[e.jsx("div",{className:"w-7 h-4 rounded bg-blue-700 opacity-50"}),e.jsx("div",{className:"w-7 h-4 rounded bg-red-400 opacity-50"})]})]})]}),e.jsxs("div",{className:"flex gap-3 mb-5",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"block text-xs text-gray-500 mb-1",htmlFor:"cc-exp",children:"Expiry"}),e.jsx("input",{id:"cc-exp",type:"text",inputMode:"numeric",value:h,onChange:n=>c(n.target.value),placeholder:"MM/YY",autoComplete:"cc-exp",className:"w-full border border-gray-200 rounded-lg px-3 py-2.5 text-sm outline-none transition-all",onFocus:j,onBlur:b})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"block text-xs text-gray-500 mb-1",htmlFor:"cc-csc",children:"CVV"}),e.jsx("input",{id:"cc-csc",type:"password",inputMode:"numeric",value:o,onChange:n=>f(n.target.value.replace(/\D/g,"").slice(0,4)),placeholder:"â¢â¢â¢",autoComplete:"cc-csc",className:"w-full border border-gray-200 rounded-lg px-3 py-2.5 text-sm outline-none transition-all",onFocus:j,onBlur:b})]})]}),y&&e.jsx("div",{className:"text-red-500 text-xs mb-4 bg-red-50 border border-red-100 rounded-lg px-3 py-2",children:y}),e.jsx("button",{onClick:u,disabled:d,className:"w-full py-3 rounded-xl text-white font-bold text-base transition-all",style:{background:d?"#94a3b8":"#136fb0",cursor:d?"not-allowed":"pointer"},children:d?e.jsxs(e.Fragment,{children:[e.jsx(H,{}),"Processingâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(z,{}),"Pay ",s.amount]})}),e.jsxs("p",{className:"text-center text-xs text-gray-400 mt-4",children:["Powered by ",e.jsx("strong",{className:"text-gray-500",children:"Razorpay"})]})]})]})},be=({onClose:s,freeTrialConsumed:a=!1})=>{const[r,v]=i.useState("recurring"),[h,p]=i.useState("monthly"),[o,f]=i.useState("12months"),[g,w]=i.useState("plan"),[d,P]=i.useState(!1),[F,S]=i.useState(""),y=a,k=i.useRef(xe()),m=i.useRef(he()),C=i.useRef(!1),t=i.useRef(0);i.useEffect(()=>{const l=T=>{T.key==="Escape"&&s()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[s]),i.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=r==="recurring",u=c&&!y;let j,b,n,N,E;if(c){const l=h==="monthly";b=l?"$29":"$290",E=l?"OptraFlow Monthly â $29/mo":"OptraFlow Yearly â $290/yr",y?(j=A(l?U(M,1):_(M,1)),n=b,N=""):(j=A(R),n="$0",N="(15 days free)")}else{const l=o==="12months";b=l?"$290":"$29",n=b,N="",j=A(l?_(M,1):U(M,1)),E=l?"OptraFlow 12 Months â $290":"OptraFlow 1 Month â $29"}const Q=i.useCallback(()=>{const l=Date.now();if(!(l-t.current<800)&&(t.current=l,!C.current)){if(C.current=!0,!m.current.check()){S("Too many attempts. Please wait a moment."),C.current=!1,setTimeout(()=>S(""),6e3);return}S(""),P(!0),setTimeout(()=>{P(!1),C.current=!1,w("payment")},420)}},[]);return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-6",style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(2px)"},onClick:l=>{l.target===l.currentTarget&&s()},role:"dialog","aria-modal":"true","aria-label":"Upgrade to Pro",children:[e.jsx("input",{type:"hidden",value:k.current,readOnly:!0,"aria-hidden":"true"}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl w-full overflow-hidden flex flex-col",style:{maxWidth:g==="payment"?440:680,maxHeight:"95vh"},children:[g==="plan"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-5 pb-0 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("span",{className:"font-bold text-gray-800 text-lg",children:"OptraFlow Pro"}),e.jsx("button",{onClick:s,className:"p-1.5 rounded-lg hover:bg-gray-100 transition-colors","aria-label":"Close",children:e.jsx(ye,{})})]}
1),e.jsx("h2",{className:"text-xl font-bold text-gray-800 mb-4",children:"Choose plan"}),y&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded-lg px-3 py-2 mb-4",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{cx:"12",cy:"12",r:"11",stroke:"#d97706",strokeWidth:"1.5",fill:"white"}),e.jsx("path",{d:"M12 8v5M12 15.5v1",stroke:"#d97706",strokeWidth:"2",strokeLinecap:"round"})]}),"Your free trial has already been used. Billing starts immediately upon checkout."]}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mb-4",children:[["recurring","Recurring"],["onetime","One-time"]].map(([l,T])=>e.jsx("button",{onClick:()=>v(l),className:"flex-1 rounded-xl border-2 font-semibold text-sm transition-all py-2.5 px-4",style:{borderColor:r===l?"#136fb0":"#e5e7eb",color:r===l?"#136fb0":"#6b7280",background:r===l?"#eff7ff":"white"},children:e.jsxs("span",{className:"flex flex-col items-center gap-1",children:[e.jsx("span",{children:T}),l==="recurring"&&!y&&e.jsx("span",{className:"text-white font-bold rounded-full leading-none",style:{background:"#136fb0",fontSize:9,padding:"2px 8px"},children:"Free Trial"})]})},l))})]}),e.jsxs("div",{className:"flex flex-col md:flex-row flex-1 overflow-y-auto",children:[e.jsxs("div",{className:"flex-1 px-5 pb-5",children:[c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 mb-4",children:u?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:[e.jsx(L,{}),e.jsx("span",{children:"Free 15 day trial, cancel any time"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:[e.jsx(L,{}),e.jsx("span",{children:"We'll remind you before your trial ends"})]})]}):e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:[e.jsx(L,{}),e.jsx("span",{children:"Auto-renews monthly or yearly · Cancel anytime"})]})}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer mb-4 group",children:[e.jsx("input",{type:"radio",name:"rec",value:"monthly",checked:h==="monthly",onChange:()=>p("monthly"),className:"mt-1",style:{accentColor:"#136fb0"}}),e.jsxs("div",{children:[e.jsx("div",{className:"font-bold text-gray-800",children:"Monthly"}),e.jsx("div",{className:"text-gray-500 text-sm",children:"$29/month"})]})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer mb-5 group",children:[e.jsx("input",{type:"radio",name:"rec",value:"yearly",checked:h==="yearly",onChange:()=>p("yearly"),className:"mt-1",style:{accentColor:"#136fb0"}}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-bold text-gray-800",children:"Yearly"}),e.jsx("span",{className:"text-white text-xs font-semibold px-2 py-0.5 rounded-full",style:{background:"#136fb0"},children:"Best value · Save 17%"}),e.jsxs("span",{className:"w-full text-gray-500 text-sm",children:["$290/year"," ",e.jsx("span",{className:"text-gray-400",children:"($24.17/mo)"})]})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-2 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:[e.jsx(L,{}),e.jsx("span",{children:"No auto-renewal. Top-up anytime"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:[e.jsx(L,{}),e.jsx("span",{children:y?"Full access starts immediately":"You won't lose your 15-day free trial."})]})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer mb-4",children:[e.jsx("input",{type:"radio",name:"ot",value:"12months",checked:o==="12months",onChange:()=>f("12months"),className:"mt-1",style:{accentColor:"#136fb0"}}),e.jsxs("div",{children:[e.jsx("div",{className:"font-bold text-gray-800",children:"12 months"}),e.jsx("div",{className:"text-gray-500 text-sm",children:"$290"})]})]}),e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer mb-5",children:[e.jsx("input",{type:"radio",name:"ot",value:"1month",checked:o==="1month",onChange:()=>f("1month"),className:"mt-1",style:{accentColor:"#136fb0"}}),e.jsxs("div",{children:[e.jsx("div",{className:"font-bold text-gray-800",children:"1 month"}),e.jsx("div",{className:"text-gray-500 text-sm",children:"$29"})]})]})]}),e.jsx("div",{className:"border-t pt-4 mb-4",children:c?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between text-sm text-gray-600 mb-1",children:[e.jsxs("span",{children:["Due ",j]}),e.jsx("span",{className:"font-semibold text-gray-800",children:b})]}),e.jsxs("div",{className:"flex justify-between text-sm font-semibold",children:[e.jsxs("span",{className:"text-gray-800",children:["Due today"," ",N&&e.jsx("span",{style:{color:"#136fb0"},children:N})]}),e.jsx("span",{className:"text-gray-800",children:n})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between text-sm text-gray-600 mb-1",children:[e.jsx("span",{children:"Ends on"}),e.jsx("span",{className:"font-semibold text-gray-800",children:j})]}),e.jsxs("div",{className:"flex justify-between text-sm font-semibold",children:[e.jsx("span",{className:"text-gray-800",children:"Due today"}),e.jsx("span",{className:"text-gray-800",children:n})]})]})}),F&&e.jsx("div",{className:"text-xs text-red-600 bg-red-50 border border-red-100 rounded-lg px-3 py-2 mb-3",children:F}),e.jsx("button",{onClick:Q,disabled:d,"aria-busy":d,className:"w-full py-3 rounded-xl text-white font-bold text-base transition-all select-none",style:{background:d?"#94a3b8":"#136fb0",cursor:d?"not-allowed":"pointer"},children:d?e.jsxs(e.Fragment,{children:[e.jsx(H,{}),"Processingâ¦"]}):"Next â"}),e.jsxs("p",{className:"text-center text-xs text-gray-400 mt-3",children:[e.jsx(z,{}),"Secured by Razorpay · 256-bit SSL"]})]}),u&&e.jsx("div",{className:"md:w-64 bg-gray-50 px-5 py-5 border-t md:border-t-0 md:border-l border-gray-100 flex-shrink-0",children:e.jsxs("div",{className:"flex flex-col gap-0",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center z-10 flex-shrink-0",style:{background:"#136fb0"},children:e.jsx(ue,{})}),e.jsx("div",{className:"w-0.5 flex-1 bg-gray-200 my-1",style:{minHeight:32}})]}),e.jsxs("div",{className:"pb-5",children:[e.jsx("div",{className:"font-bold text-gray-800 text-sm",children:"Today â Free trial for 15 days. Cancel anytime."}),e.jsx("div",{className:"text-gray-500 text-xs mt-0.5",children:"Start your free OptraFlow trial and access all features."})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx(pe,{}),e.jsx("div",{className:"w-0.5 flex-1 bg-gray-200 my-1",style:{minHeight:32}})]}),e.jsxs("div",{className:"pb-5",children:[e.jsx("div",{className:"font-bold text-gray-700 text-sm",children:A(me)}),e.jsx("div",{className:"text-gray-500 text-xs mt-0.5",children:"Reminder email 7 days before your trial ends"})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex flex-col items-center flex-shrink-0",children:e.jsx(fe,{})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-bold text-gray-700 text-sm",children:A(R)}),e.jsx("div",{className:"text-gray-500 text-xs mt-0.5",children:"Subscription starts unless you cancel during trial."})]})]})]})})]}),e.jsxs("div",{className:"px-5 pb-4 text-xs text-gray-400 border-t pt-3 flex-shrink-0",children:["By continuing, you agree to the"," ",e.jsx("a",{href:"https://optraflow.com/terms",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-gray-600",children:"Terms of Service"})," ","applicable to OptraFlow and confirm you have read our"," ",e.jsx("a",{href:"https://optraflow.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-gray-600",children:"Privacy Policy"}),"."]})]}),g==="payment"&&e.jsx(je,{planInfo:{amount:n==="$0"?"$0 today":n,label:E},onBack:()=>w("plan")})]})]})};function Ne(s){if(!s)return null;const a=s.PlanName.toLowerCase();return a==="free"?"free":a==="pro"&&s.IsTrial?"pro_trial":a==="pro"&&!s.IsTrial?"pro_paid":null}async function ve(s){try{const a=await fetch(`${ee}/current-plan`,{method:"GET",headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{}}});if(!a.ok)return console.warn("[Pricing] fetchCurrentPlan failed:",a.status),null;const r=await a.json();return(r==null?void 0:r[0])??null}catch(a){return console.error("[Pricing] fetchCurrentPlan error:",a),null}}const G={all:["pricing"],currentPlan:s=>[...G.all,"currentPlan",s]};function we(){const{isAuthenticated:s,isLoading:a,token:r,user:v}=q(),{data:h=null,isLoading:p,isFetching:o,isError:f,error:g,refetch:w}=se({queryKey:G.currentPlan(v==null?void 0:v.id),queryFn:()=>ve(r??void 0),enabled:!a&&s&&!!r,staleTime:300*1e3,gcTime:600*1e3,retry:1}),d=s?Ne(h):null;return{currentPlan:h,planState:d,isLoading:a||p,isFetching:o,isError:f,error:g??null,refetch:w}}const x={title:"Pricing â OptraFlow | API Testing & Automation Platform",description:"Choose the right OptraFlow plan. Free plan available. Pro at $29/month with unlimited API calls, automated scheduling, and team collaboration. Enterprise with CI/CD, SSO, and dedicated support.",canonical:"https://optraflow.com/pricing",og:{title:"OptraFlow Pricing â Free, Pro & Enterprise Plans",description:"Start free, upgrade when you need. OptraFlow helps engineering teams ship faster with automated API testing, request chains, and CI
1/CD integration."}},Y=[{question:"Can I change plans anytime?",answer:"Yes, you can upgrade or downgrade your plan at any time. Changes take effect immediately, and we'll prorate any charges."},{question:"What payment methods do you accept?",answer:"We accept all major credit cards, PayPal, and can arrange invoice billing for Enterprise customers."},{question:"Is there a free trial?",answer:"Yes! All paid plans come with a 15-day free trial. No credit card required to start."},{question:"What happens to my data if I cancel?",answer:"Your data is retained for 30 days after cancellation, giving you time to export it or reactivate your account."}],Re=()=>{const{isAuthenticated:s,isLoading:a}=q(),[r,v]=i.useState(!1),[h,p]=i.useState(!1),{planState:o,currentPlan:f,isLoading:g}=we(),w=a||g,d=t=>s?t==="Free"?o==="free":t==="Pro"?o==="pro_trial"||o==="pro_paid":!1:!1,P=()=>{if(o!=="pro_paid")return null;const t=f==null?void 0:f.ExpiresAt;return t?`Renews ${new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`:null},F=s&&o==="free"?"Upgrade to Pro":"Start Free Trial",S=[{name:"Free",description:"Perfect for getting started with API testing",price:{monthly:0,yearly:0},features:["Up to 100 API calls per month","Basic request builder","Request chains","Test suites","Email notifications","Community support","30-day data retention"],buttonVariant:"outline",icon:e.jsx(W,{className:"w-6 h-6"}),limits:{apiCalls:"100/month",users:"1 user",schedules:"0",retention:"30 days"}},{name:"Pro",description:"For teams that need advanced testing capabilities",price:{monthly:29,yearly:290},features:["Unlimited API calls","Advanced request builder","Request chains & test suites","Automated scheduling","Test execution monitoring","Data management tools","Advanced reporting & analytics","Email & Slack notifications","Teams integration","Priority support","90-day data retention"],highlighted:!0,buttonVariant:"default",icon:e.jsx(ae,{className:"w-6 h-6"}),badge:"Most Popular",limits:{apiCalls:"Unlimited",users:"Up to 10 users",schedules:"Unlimited",retention:"90 days"}},{name:"Enterprise",description:"For large teams with advanced security and compliance needs",price:{monthly:99,yearly:990},features:["Everything in Pro","CI/CD pipeline integrations","Custom webhook triggers","Advanced security controls","Custom integrations","Dedicated support manager","99.9% uptime SLA","Custom data retention","On-premise deployment option"],buttonVariant:"outline",icon:e.jsx(ne,{className:"w-6 h-6"}),limits:{apiCalls:"Unlimited",users:"Unlimited",schedules:"Unlimited",retention:"Custom"}}],y=[{name:"Request Builder",description:"Visual interface for building API requests",icon:e.jsx(W,{className:"w-5 h-5"}),plans:["free","pro","enterprise"]},{name:"Team Collaboration",description:"Invite team members and collaborate",icon:e.jsx(ie,{className:"w-5 h-5"}),plans:["pro","enterprise"]},{name:"Automated Scheduling",description:"Schedule tests to run automatically",icon:e.jsx(le,{className:"w-5 h-5"}),plans:["pro","enterprise"]},{name:"Advanced Analytics",description:"Detailed reports and performance insights",icon:e.jsx(oe,{className:"w-5 h-5"}),plans:["pro","enterprise"]},{name:"Enterprise Security",description:"SSO, SAML, and advanced security controls",icon:e.jsx(ce,{className:"w-5 h-5"}),plans:["enterprise"]},{name:"CI/CD Integration",description:"Jenkins, GitHub Actions, GitLab CI/CD",icon:e.jsx(de,{className:"w-5 h-5"}),plans:["enterprise"]}],k=(t,c)=>t===0?0:Math.round((t*12-c)/(t*12)*100),m=t=>{if(t==="Enterprise"){window.location.href="/contact-us";return}if(t==="Pro"){if(!s){window.location.href="/signup";return}p(!0);return}s||(window.location.href="/signup")},C=t=>t.name==="Enterprise"?"Contact Sales":t.name==="Free"?s?o==="free"?"Current Plan":"Downgrade to Free":"Get Started":w?"Loading...":F;return e.jsxs(te,{children:[e.jsxs(J,{children:[e.jsx("title",{children:x.title}),e.jsx("meta",{name:"description",content:x.description}),e.jsx("link",{rel:"canonical",href:x.canonical}),e.jsx("meta",{property:"og:type",content:"website"}
1),e.jsx("meta",{property:"og:url",content:x.canonical}),e.jsx("meta",{property:"og:title",content:x.og.title}),e.jsx("meta",{property:"og:description",content:x.og.description}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:x.og.title}),e.jsx("meta",{name:"twitter:description",content:x.og.description}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:Y.map(({question:t,answer:c})=>({"@type":"Question",name:t,acceptedAnswer:{"@type":"Answer",text:c}}))})}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"WebPage",name:x.og.title,description:x.description,url:x.canonical,breadcrumb:{"@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://optraflow.com"},{"@type":"ListItem",position:2,name:"Pricing",item:x.canonical}]}})})]}),e.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-blue-50 to-white",children:[e.jsxs("div",{className:"container mx-auto px-4 pt-16 pb-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(D,{variant:"secondary",className:"mb-4",children:"Pricing Plans"}),e.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Choose the right plan for your team"}),e.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Start with our free plan and upgrade as your API testing needs grow. All plans include our core testing features."})]}),e.jsxs("div",{className:"flex items-center justify-center space-x-4 mb-12",children:[e.jsx("span",{className:`text-sm ${r?"text-muted-foreground":"font-medium"}`,children:"Monthly"}),e.jsx(X,{checked:r,onCheckedChange:v}),e.jsx("span",{className:`text-sm ${r?"font-medium":"text-muted-foreground"}`,children:"Yearly"}),r&&e.jsx(D,{className:"bg-green-100 text-green-700",children:"Save up to 17%"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 mb-16",children:S.map(t=>e.jsxs($,{className:`relative ${t.highlighted?"border-primary shadow-xl scale-105":"border-gray-200"}`,children:[t.badge&&e.jsx("div",{className:"absolute -top-4 left-1/2 transform -translate-x-1/2",children:e.jsx(D,{className:"bg-primary text-primary-foreground",children:t.badge})}),e.jsxs(K,{className:"text-center pb-4",children:[e.jsx("div",{className:"flex items-center justify-center mb-4",children:e.jsx("div",{className:`w-12 h-12 rounded-lg flex items-center justify-center ${t.highlighted?"bg-primary text-primary-foreground":"bg-gray-100 text-gray-600"}`,children:t.icon})}),e.jsx(Z,{className:"text-2xl",children:t.name}),e.jsx("p",{className:"text-muted-foreground text-sm",children:t.description}),e.jsxs("div",{className:"mt-4",children:[e.jsx("div",{className:"flex items-baseline justify-center",children:t.name==="Enterprise"?e.jsx(B,{className:"w-full",variant:t.buttonVariant,size:"lg",onClick:()=>m(t.name),children:"Contact us for pricing"}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-4xl font-bold",children:["$",r?t.price.yearly:t.price.monthly]}),t.price.monthly>0&&e.jsxs("span",{className:"text-muted-foreground ml-2",children:["/",r?"year":"month"]})]})}),r&&t.price.monthly>0&&e.jsxs("p",{className:"text-sm text-green-600 mt-1",children:["Save"," ",k(t.price.monthly,t.price.yearly),"% vs monthly billing"]})]})]}),e.jsxs(O,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm text-muted-foreground uppercase tracking-wide",children:"What's included"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"API Calls:"}),e.jsx("div",{className:"font-medium",children:t.limits.apiCalls})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Users:"}),e.jsx("div",{className:"font-medium",children:t.limits.users})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Schedules:"}),e.jsx("div",{className:"font-medium",children:t.limits.schedules})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Retention:"}),e.jsx("div",{className:"font-medium",children:t.limits.retention})]})]})]}),e.jsx("div",{className:"space-y-3",children:t.features.map((c,u)=>e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(I,{className:"w-4 h-4 text-green-500 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-sm",children:c})]},u))}),d(t.name)?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:`w-full flex items-center justify-center gap-2 rounded-lg border-2 px-4 py-3 text-sm font-semibold cursor-default select-none ${o==="pro_trial"?"border-blue-400 bg-blue-50 text-blue-700":"border-green-500 bg-green-50 text-green-700"}`,children:[e.jsx(I,{className:`w-4 h-4 flex-shrink-0 ${o==="pro_trial"?"text-blue-500":"text-green-500"}`}),o==="pro_trial"?"Current Plan (Trial)":"Current Plan"]}),o==="pro_paid"&&P()&&e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:P()}),o==="pro_paid"&&e.jsx(B,{className:"w-full",variant:"outline",size:"lg",onClick:()=>p(!0),children:"Renew / Upgrade"})]}):e.jsx(B,{className:"w-full",variant:t.buttonVariant,size:"lg",disabled:w&&t.name==="Pro"||t.name==="Free"&&s&&o!=="free",onClick:()=>m(t.name),children:C(t)})]})]},t.name))}),e.jsxs("div",{className:"mb-16",children:[e.jsx("h2",{className:"text-3xl font-bold text-center mb-8",children:"Compare Features"}),e.jsx($,{children:e.jsx(O,{className:"p-0",children:e.jsx("div",{className:"overflow-x-auto scrollbar-thin",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-left p-4 font-semibold",children:"Features"}),e.jsx("th",{className:"text-center p-4 font-semibold",children:"Free"}),e.jsx("th",{className:"text-center p-4 font-semibold",children:"Pro"}),e.jsx("th",{className:"text-center p-4 font-semibold",children:"Enterprise"})]})}),e.jsx("tbody",{children:y.map((t,c)=>e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center space-x-3",children:[t.icon,e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-sm text-muted-foreground",children:t.description})]})]})}),["free","pro","enterprise"].map(u=>e.jsx("td",{className:"text-center p-4",children:t.plans.includes(u)?e.jsx(I,{className:"w-5 h-5 text-green-500 mx-auto"}):e.jsx("span",{className:"text-muted-foreground",children:"-"})},u))]},c))})]})})})})]}),e.jsxs("div",{className:"mb-16",children:[e.jsx("h2",{className:"text-3xl font-bold text-center mb-8",children:"Frequently Asked Questions"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 max-w-4xl mx-auto",children:Y.map(({question:t,answer:c},u)=>e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-2",children:t}),e.jsx("p",{className:"text-muted-foreground text-sm",children:c})]},u))})]})]}),e.jsx("section",{className:"mx-auto max-w-[1120px] px-6 pb-20 sm:px-7 sm:pb-24",children:e.jsxs("div",{className:"rounded-[22px] border border-line bg-white p-8 text-center shadow-[0_1px_2px_rgba(16,24,40,0.03)] sm:p-12",children:[e.jsx("h2",{className:"font-display text-2xl font-bold sm:text-[30px]",children:"Start testing APIs faster with OptraFlow"}),e.jsx("p",{className:"mx-auto mt-3 max-w-[520px] text-[15.5px] text-body-muted",children:"Register and start testing in minutes. No credit card required. E
1xplore all Optraflow features during your free trial period."}),e.jsxs("div",{className:"mt-7 flex flex-wrap justify-center gap-3",children:[e.jsxs("a",{href:"/signup",className:"inline-flex items-center gap-2 rounded-full bg-brand px-5 py-2.5 font-display text-[14.5px] font-bold text-white transition-transform duration-200 hover:-translate-y-0.5",children:["Get started free",e.jsx(re,{className:"h-4 w-4"})]}),e.jsx("a",{href:"/howitworks",className:"inline-flex items-center gap-2 rounded-full border border-line bg-white px-5 py-2.5 font-display text-[14.5px] font-bold text-ink transition-colors duration-200 hover:border-brand hover:text-brand",children:"See how OptraFlow works"})]})]})})]}),h&&e.jsx(be,{onClose:()=>p(!1),freeTrialConsumed:!1})]})};export{Re 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.