"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[631],{58631:function(e,t,a){a.d(t,{default:function(){return J},z:function(){return G}});var r=a(57437),s=a(2265),n=a(92940),l=a(50495),i=a(37440);let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",a),...s})});o.displayName="Card";let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",a),...s})});c.displayName="CardHeader";let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("h3",{ref:t,className:(0,i.cn)("text-2xl font-semibold leading-none tracking-tight",a),...s})});d.displayName="CardTitle";let u=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("p",{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...s})});u.displayName="CardDescription";let m=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("p-6 pt-0",a),...s})});m.displayName="CardContent";let x=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex items-center p-6 pt-0",a),...s})});x.displayName="CardFooter";var p=a(12218);let g=(0,p.j)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function f(e){let{className:t,variant:a,...s}=e;return(0,r.jsx)("div",{className:(0,i.cn)(g({variant:a}),t),...s})}var h=a(9646);let y=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(h.fC,{className:(0,i.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...s,ref:t,children:(0,r.jsx)(h.bU,{className:(0,i.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});y.displayName=h.fC.displayName;var b=a(64756),j=a(42421);let N=b.fC,w=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(b.ck,{ref:t,className:(0,i.cn)("border-b",a),...s})});w.displayName="AccordionItem";let v=s.forwardRef((e,t)=>{let{className:a,children:s,...n}=e;return(0,r.jsx)(b.h4,{className:"flex",children:(0,r.jsxs)(b.xz,{ref:t,className:(0,i.cn)("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[s,(0,r.jsx)(j.Z,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});v.displayName=b.xz.displayName;let P=s.forwardRef((e,t)=>{let{className:a,children:s,...n}=e;return(0,r.jsx)(b.VY,{ref:t,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:(0,r.jsx)("div",{className:(0,i.cn)("pb-4 pt-0",a),children:s})})});P.displayName=b.VY.displayName;var k=a(13537),C=a(7345),S=a(90837),F=a(62447);let I=F.fC,E=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(F.aV,{ref:t,className:(0,i.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",a),...s})});E.displayName=F.aV.displayName;let A=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(F.xz,{ref:t,className:(0,i.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",a),...s})});A.displayName=F.xz.displayName;let R=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(F.VY,{ref:t,className:(0,i.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...s})});function Y(e){var t,a;let{plan:s,currentPlan:i,isAnnual:o,onConfirm:c,onCancel:d,plans:u,hasValidPaymentMethod:m}=e,x=i&&("Pro"===i.title&&"Pro"!==s.title||"Basic"===i.title&&"Free"===s.title),p=i&&("Free"===i.title&&"Free"!==s.title||"Basic"===i.title&&"Pro"===s.title);return(0,r.jsx)(S.Vq,{open:!0,onOpenChange:d,children:(0,r.jsxs)(S.cZ,{className:"sm:max-w-[600px] bg-gray-950 text-gray-100 border border-gray-700 !rounded-2xl overflow-hidden",children:[(0,r.jsxs)(S.fK,{children:[(0,r.jsx)(S.$N,{className:"text-2xl font-bold",children:x?"Confirm Plan Downgrade":p?"Confirm Plan Upgrade":"Confirm Your Plan"}),(0,r.jsx)(S.Be,{className:"text-gray-400",children:x?"You're about to downgrade to the ".concat(s.title," plan. This change will take effect at the end of your current billing cycle."):p?"You're about to upgrade to the ".concat(s.title," plan. This change will take effect immediately."):"You're about to subscribe to the ".concat(s.title," plan ").concat(o?"annually":"monthly",".")})]}),(0,r.jsxs)(I,{defaultValue:"comparison",className:"w-full",children:[(0,r.jsxs)(E,{className:"grid w-full grid-cols-2 bg-gray-900",children:[(0,r.jsx)(A,{value:"comparison",className:"data-[state=active]:bg-gray-800 text-white data-[state=active]:text-white",children:"Plan Comparison"}),(0,r.jsx)(A,{value:"details",className:"data-[state=active]:bg-gray-800 text-white data-[state=active]:text-white",children:"Plan Details"})]}),(0,r.jsx)(R,{value:"comparison",className:"mt-4",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"bg-gray-900 p-4 rounded-lg",children:[(0,r.jsxs)("h3",{className:"font-semibold mb-2 text-gray-100 flex items-center",children:[s.title," Plan",(p||!i&&"Free"!==s.title)&&(0,r.jsx)(f,{variant:"secondary",className:"ml-3 bg-teal-500 bg-opacity-20 text-teal-300 border border-teal-900 px-2 py-0.5 text-xs font-semibold no-hover",children:"New Plan"})]}),(0,r.jsx)("ul",{className:"space-y-2",children:s.features.map((e,t)=>(0,r.jsxs)("li",{className:"flex items-center text-gray-300",children:[(0,r.jsx)(n.Z,{className:"h-4 w-4 mr-2 text-teal-500"}),(0,r.jsx)("span",{children:e})]},t))})]}),(0,r.jsxs)("div",{className:"bg-gray-900 p-4 rounded-lg",children:[(0,r.jsxs)("h3",{className:"font-semibold mb-2 text-gray-100 flex items-center",children:[i?i.title:"Free"," Plan",(0,r.jsx)(f,{variant:"secondary",className:"ml-3 bg-teal-500 bg-opacity-20 text-teal-300 border border-teal-900 px-2 py-0.5 text-xs font-semibold no-hover",children:"Current Plan"})]}),(0,r.jsx)("ul",{className:"space-y-2",children:null===(t=i?i.features:null===(a=u.find(e=>"Free"===e.title))||void 0===a?void 0:a.features)||void 0===t?void 0:t.map((e,t)=>(0,r.jsxs)("li",{className:"flex items-center text-gray-300",children:[(0,r.jsx)(n.Z,{className:"h-4 w-4 mr-2 text-teal-500"}),(0,r.jsx)("span",{children:e})]},t))})]})]})}),(0,r.jsx)(R,{value:"details",className:"mt-4",children:(0,r.jsxs)("div",{className:"bg-gray-900 p-4 rounded-lg",children:[(0,r.jsxs)("h3",{className:"font-semibold mb-2 text-gray-100",children:[s.title," Plan Details"]}),(0,r.jsx)("p",{className:"text-gray-300 mb-2",children:s.description}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsx)("div",{children:(0,r.jsxs)("p",{className:"text-gray-300",children:[(0,r.jsx)("strong",{children:"Price:"})," ",o&&s.annualPrice?s.annualPrice:s.price,o?"/year":"/month"]})}),(0,r.jsx)("div",{children:(0,r.jsxs)("p",{className:"text-gray-300",children:[(0,r.jsx)("strong",{children:"Billing:"})," ",o?"Annual":"Monthly"]})})]}),(0,r.jsx)("h4",{className:"font-semibold mt-4 mb-2 text-gray-100",children:"Features:"}),(0,r.jsx)("ul",{className:"space-y-2",children:s.features.map((e,t)=>(0,r.jsxs)("li",{className:"flex items-center text-gray-300",children:[(0,r.jsx)(n.Z,{className:"h-4 w-4 mr-2 text-teal-500"}),(0,r.jsx)("span",{children:e})]},t))})]})})]}),(0,r.jsxs)(S.cN,{className:"mt-6 space-x-2",children:[(0,r.jsx)(l.z,{variant:"outline",onClick:d,className:"flex-1 bg-gray-800 text-gray-100 hover:bg-gray-700 hover:text-white border-0",children:"Cancel"}),(0,r.jsx)(l.z,{onClick:c,className:"flex-1 bg-white text-gray-900 hover:bg-gray-100",children:x?"Downgrade Plan":p?"Upgrade Plan":m?"Confirm Subscription":"Proceed to Payment"})]})]})})}R.displayName=F.VY.displayName;var Z=a(38364);let _=(0,p.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),B=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(Z.f,{ref:t,className:(0,i.cn)(_(),a),...s})});function D(e){let{plan:t,isAnnual:a,onClose:n,onSuccessWithData:i,isUpgrade:o,isNewSubscription:c,isDowngrade:d,prorataPrice:u,credit:m}=e,x=(0,C.useStripe)(),p=(0,C.useElements)(),[g,f]=(0,s.useState)(null),[h,y]=(0,s.useState)(!1);(0,s.useEffect)(()=>{console.log("Pro-rata price:",u)},[u]);let b=async e=>{e.preventDefault(),y(!0);try{if(console.log("Submitting form:",{isDowngrade:d,planTitle:t.title}),"Free"===t.title){console.log("Initiating downgrade to free plan");let e=await fetch("/api/downgrade-to-free",{method:"POST",headers:{"Content-Type":"application/json"}}),t=await e.json();if(console.log("Downgrade response:",t),!e.ok)throw Error(t.error||"Failed to downgrade to free plan");console.log("Downgrade successful:",t.message),i(t)}else{console.log("Initiating subscription creation/update");let e=await fetch("/api/create-subscription",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({priceId:a?t.annualPriceId:t.monthlyPriceId,isUpgrade:o,isNewSubscription:c,isDowngrade:d})});if(!e.ok){let t=await e.json();throw console.error("Error response:",t),Error(t.error||"Failed to create or update subscription")}let{client_secret:s,subscription_id:n}=await e.json();if(console.log("Subscription created/updated:",{subscription_id:n,client_secret:s}),s&&(c||o)){if(!x||!p){f("Stripe not initialized");return}let e=p.getElement(C.CardElement);if(!e){f("Card element not found");return}let{error:t,paymentIntent:a}=await x.confirmCardPayment(s,{payment_method:{card:e}});if(t){var r;f(null!==(r=t.message)&&void 0!==r?r:"An unknown error occurred")}else"succeeded"===a.status?(console.log("Payment succeeded"),i({subscription_id:n,status:"active"})):f("Payment failed. Please try again.")}else console.log("Subscription updated successfully"),i({subscription_id:n,status:"active"})}}catch(e){console.error("Error in handleSubmit:",e),f(e instanceof Error?e.message:"Failed to process request. Please try again.")}y(!1)};return(0,r.jsx)(S.Vq,{open:!0,onOpenChange:n,children:(0,r.jsxs)(S.cZ,{className:"sm:max-w-[600px] bg-gray-950 text-gray-100 border border-gray-700 !rounded-2xl overflow-hidden",children:[(0,r.jsx)(S.fK,{children:(0,r.jsx)(S.$N,{className:"text-2xl font-bold",children:c?"Add a payment method":o?"Upgrade your plan":d?"Downgrade your plan":"Update your subscription"})}),(0,r.jsxs)("form",{onSubmit:b,className:"space-y-4",children:[(c||o)&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(B,{htmlFor:"card-element",children:"Card information"}),(0,r.jsx)("div",{className:"w-full bg-gray-900 border border-gray-700 rounded-md text-gray-100 h-10 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-gray-600 focus:border-transparent placeholder-[#f3f4f6]",children:(0,r.jsx)(C.CardElement,{options:{style:{base:{fontSize:"16px",color:"#f3f4f6","::placeholder":{color:"#9ca3af"},":-webkit-autofill":{color:"#f3f4f6"}},invalid:{color:"#ef4444"}}}})})]}),g&&(0,r.jsx)("div",{className:"text-red-500",children:g}),(0,r.jsx)(l.z,{type:"submit",disabled:h||!x&&(c||o),className:"w-full bg-white text-gray-900 hover:bg-gray-100",children:h?"Processing...":d?"Confirm Downgrade":c?"Subscribe and pay ".concat(a&&t.annualPrice?t.annualPrice:t.price):o?u?"Upgrade and pay ".concat(u):"Upgrade to ".concat(t.title):"Confirm changes"})]}),(0,r.jsx)("div",{className:"mt-4 text-sm text-gray-400 text-center",children:c?(0,r.jsxs)(r.Fragment,{children:["By confirming your subscription, you allow ZackGPT to charge your card for this payment and future payments in accordance with their terms. You are signing up for a ",a?"yearly":"monthly"," subscription."]}):o?m>0?(0,r.jsxs)(r.Fragment,{children:["By confirming this upgrade, you agree to the new pricing terms. The pro rata amount will be deducted from your existing payment, and your account will be credited the balance of ",(0,r.jsxs)("span",{className:"font-medium text-white",children:["$",m.toFixed(2)]}),"."]}):(0,r.jsx)(r.Fragment,{children:"By confirming this upgrade, you agree to the new pricing terms. Your card will be charged the prorated difference for the remainder of your current billing cycle."}):d?(0,r.jsx)(r.Fragment,{children:"Your plan will be downgraded at the end of your current billing cycle. You'll continue to have access to your current plan's features until then."}):(0,r.jsx)(r.Fragment,{children:"Your subscription changes will take effect at the end of your current billing cycle. No immediate charges will be made to your card."})})]})})}B.displayName=Z.f.displayName;var T=a(19666),O=a(16463),V=a(93073),z=a(6881),U=a(27776),q=a(23787);function $(e){let{plan:t,currentPlan:a,isAnnual:s,onClose:i,onReload:o,portalUrl:c,cancelAt:d}=e,u=a&&("Pro"===a.title&&"Pro"!==t.title||"Basic"===a.title&&"Free"===t.title);return(0,r.jsx)(S.Vq,{open:!0,onOpenChange:i,children:(0,r.jsxs)(S.cZ,{className:"sm:max-w-[500px] bg-gray-950 text-gray-100 border border-gray-700 !rounded-2xl overflow-hidden",children:[(0,r.jsxs)(S.fK,{children:[(0,r.jsx)("div",{className:"flex items-center justify-center mb-4",children:(0,r.jsx)(n.Z,{className:"w-16 h-16 text-teal-500"})}),(0,r.jsx)(S.$N,{className:"text-2xl font-bold text-center",children:u?"Plan downgraded to ".concat(t.title):"Plan upgraded to ".concat(t.title)})]}),(0,r.jsxs)("div",{className:"text-center mb-6",children:[(0,r.jsx)("p",{className:"text-gray-400",children:u?"Your downgrade is scheduled for ".concat(d?new Date(1e3*d).toLocaleDateString():"the end of your billing cycle"):"Enjoy the benefits of your new plan!"}),u&&(0,r.jsxs)("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center mt-2 text-sm text-teal-500 hover:text-teal-400",children:["Review your downgrade status",(0,r.jsx)(q.Z,{className:"w-4 h-4 ml-1"})]})]}),(0,r.jsxs)("div",{className:"bg-gray-900 p-6 rounded-lg mb-6",children:[(0,r.jsx)("h3",{className:"font-semibold mb-4 text-gray-100",children:u?"Your new features will be":"Now available to you"}),(0,r.jsx)("ul",{className:"space-y-3",children:t.features.map((e,t)=>(0,r.jsxs)("li",{className:"flex items-center text-gray-300",children:[(0,r.jsx)(n.Z,{className:"h-5 w-5 mr-3 text-teal-500"}),(0,r.jsx)("span",{children:e}),!u&&(0,r.jsx)(f,{variant:"secondary",className:"ml-2 bg-teal-500 bg-opacity-20 text-teal-300 border border-teal-900",children:"New"})]},t))})]}),(0,r.jsx)(l.z,{onClick:()=>{i(),o()},className:"w-full bg-white text-gray-900 hover:bg-gray-100 rounded-xl",children:"Continue"})]})})}let G=[{title:"Free",price:"$0",description:"For personal use",features:["1 Project","5GB Storage","Community Support"],cta:"Get Started",productId:"",monthlyPriceId:"",annualPriceId:""},{title:"Basic",price:"$10",annualPrice:"$72",description:"For individuals and small teams",features:["5 Projects","10GB Storage","Basic Support"],cta:"Get Started",productId:"prod_QlQiX8pSmLFyLi",monthlyPriceId:"price_1PttrGBEYZItAy82VfPshJE2",annualPriceId:"price_1PttrGBEYZItAy82cqHJKOdD"},{title:"Pro",price:"$29",annualPrice:"$209",description:"For growing businesses",features:["Unlimited Projects","100GB Storage","Priority Support","Advanced Analytics"],cta:"Upgrade to Pro",recommended:!0,productId:"prod_QlQjgrPw7y8V59",monthlyPriceId:"price_1Ptts4BEYZItAy82flZQBj5p",annualPriceId:"price_1Ptts4BEYZItAy82PNxFXWDr"}],H=(0,k.J)("pk_test_bRkhrJh5NfOeHMs6TPUUzvSw00hErk2ZLD");function J(){let e=(0,O.useRouter)(),{user:t,isSignedIn:a}=(0,V.aF)(),[i,p]=(0,s.useState)(null),[g,h]=(0,s.useState)(!1),[b,j]=(0,s.useState)(!1),[k,S]=(0,s.useState)(!1),[F,I]=(0,s.useState)(null),[E,A]=(0,s.useState)(!1),[R,Z]=(0,s.useState)(null),[_,B]=(0,s.useState)(null),[q,J]=(0,s.useState)(void 0),[M,Q]=(0,s.useState)(0);(0,s.useEffect)(()=>{(async()=>{if(a&&t){let{data:e,error:a}=await z.O.from("users").select("id").eq("clerkid",t.id).single();if(a){console.error("Error fetching user:",a);return}if(!e){console.error("User not found in Supabase");return}let{data:r,error:s}=await z.O.from("subscriptions").select("*").eq("user_id",e.id).order("created_at",{ascending:!1}).limit(1);s?console.error("Error fetching subscription:",s):r&&r.length>0?I(r[0]):I(null)}})()},[a,t]);let W=async t=>{if(!a){e.push("/sign-in");return}let r=G.find(e=>X(e));if(r&&"Basic"===r.title&&"Pro"===t.title)try{let e=await fetch("/api/calculate-proration",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newPriceId:k?t.annualPriceId:t.monthlyPriceId})});if(!e.ok)throw Error("Failed to calculate proration: ".concat(e.status));let{proratedAmount:a,credit:r,daysRemaining:s}=await e.json();console.log("Calculated pro-rata amount:",a),console.log("Credit from current plan:",r),console.log("Days remaining in billing cycle:",s),J(a>0?"$".concat(a.toFixed(2)):void 0),Q(r)}catch(e){console.error("Error calculating pro-rata price:",e),U.Am.error("Failed to calculate pro-rata price. Please try again."),J(void 0),Q(0)}else J(void 0),Q(0);p(t),h(!0)},K=async()=>{h(!1),a&&i&&(k?i.annualPriceId:i.monthlyPriceId,j(!0))},L=async e=>{j(!1);try{await et();let t=await fetch("/api/create-portal-session",{method:"POST"});if(!t.ok)throw Error("Failed to create portal session");let a=await t.json();Z(a.url),A(!0),B(e.cancelAt)}catch(e){console.error("Error creating portal session:",e),U.Am.error("Failed to create portal session. Please try again.")}},X=e=>F?"Free"!==e.title&&(F.plan===e.monthlyPriceId||F.plan===e.annualPriceId):"Free"===e.title,ee=async()=>{try{console.log("Initiating subscription management process");let e=await fetch("/api/create-portal-session",{method:"POST"});if(console.log("Response status:",e.status),!e.ok){let t=await e.json();throw console.error("Error response:",t),Error("Failed to create portal session: ".concat(t.error||"Unknown error"))}let t=await e.json();if(console.log("Portal session created successfully:",t),t.url)console.log("Redirecting to Stripe portal:",t.url),window.location.href=t.url;else throw Error("No URL returned from create-portal-session")}catch(e){console.error("Error in handleManageSubscription:",e),U.Am.error("Failed to open subscription management. Please try again.")}},et=async()=>{if(a&&t){let{data:e,error:a}=await z.O.from("users").select("id").eq("clerkid",t.id).single();if(a||!e){console.error("Error fetching user:",a);return}let{data:r,error:s}=await z.O.from("subscriptions").select("*").eq("user_id",e.id).order("created_at",{ascending:!1}).limit(1);s?console.error("Error fetching subscription:",s):r&&r.length>0?I(r[0]):I(null)}};return(0,r.jsx)("section",{className:"w-full py-12 md:py-24 lg:py-32",children:(0,r.jsxs)("div",{className:"container px-4 md:px-6",children:[(0,r.jsx)("div",{className:"flex flex-col items-center justify-center space-y-8 text-center mb-12",children:(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl text-white",children:"Choose Your Plan"}),(0,r.jsx)("p",{className:"max-w-[600px] text-gray-400 text-sm sm:text-base md:text-lg",children:"Select the perfect plan for your needs. Upgrade or downgrade at any time."})]})}),(0,r.jsx)("div",{className:"flex justify-center mb-8",children:(0,r.jsxs)("div",{className:"flex items-center space-x-2 bg-gray-800 rounded-full p-1",children:[(0,r.jsx)("span",{className:"text-sm px-3 py-1 rounded-full transition-colors duration-200 ".concat(k?"text-gray-400":"bg-teal-500 text-white"),children:"Monthly"}),(0,r.jsx)(y,{checked:k,onCheckedChange:S,className:"data-[state=checked]:bg-teal-500"}),(0,r.jsx)("span",{className:"text-sm px-3 py-1 rounded-full transition-colors duration-200 ".concat(k?"bg-teal-500 text-white":"text-gray-400"),children:"Annual (40% off)"})]})}),(0,r.jsx)("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-8 max-w-full mx-auto mb-32",children:G.map(e=>(0,r.jsxs)(o,{className:"flex flex-col rounded-2xl ".concat(e.recommended?"border-teal-500 shadow-xl scale-105 bg-gray-800":"bg-gray-900 border-gray-700"," transition-all duration-200"),children:[(0,r.jsxs)(c,{children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)(d,{className:"text-xl text-white",children:e.title}),e.recommended&&(0,r.jsx)(f,{variant:"secondary",className:"bg-teal-500 bg-opacity-20 text-teal-300 border border-teal-900 px-2 py-0.5 text-xs font-semibold no-hover",children:"Recommended"})]}),(0,r.jsx)(u,{className:"text-gray-400 text-sm",children:e.description})]}),(0,r.jsxs)(m,{className:"flex-grow",children:[(0,r.jsx)("div",{className:"mt-2 text-3xl font-bold text-white flex items-center",children:k&&e.annualPrice?(0,r.jsxs)(r.Fragment,{children:[e.annualPrice,(0,r.jsxs)("span",{className:"ml-2 text-lg text-gray-400 line-through",children:["$",12*parseInt(e.price.replace("$",""))]})]}):e.price}),"Enterprise"!==e.title&&"Free"!==e.title&&(0,r.jsx)("div",{className:"text-xs text-gray-400",children:k?"per year":"per month"}),(0,r.jsx)("ul",{className:"mt-4 space-y-2",children:e.features.map(e=>(0,r.jsxs)("li",{className:"flex items-center text-gray-300 text-sm",children:[(0,r.jsx)(n.Z,{className:"mr-2 h-4 w-4 text-white"}),(0,r.jsx)("span",{children:e})]},e))})]}),(0,r.jsxs)(x,{className:"flex flex-col",children:[(0,r.jsx)(T.pn,{children:(0,r.jsxs)(T.u,{children:[(0,r.jsx)(T.aJ,{asChild:!0,children:(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(l.z,{className:"w-full py-5 text-base rounded-full transition-all duration-300 ease-in-out ".concat(e.recommended?"bg-white text-teal-500 hover:bg-teal-50 hover:text-teal-600 hover:shadow-[0_0_15px_rgba(20,184,166,0.5)]":X(e)?"bg-gray-600 text-white cursor-not-allowed opacity-50":"bg-gray-700 text-white hover:bg-gray-600"),onClick:()=>W(e),disabled:X(e),children:X(e)?"Current Plan":F?"Choose ".concat(e.title):e.cta})})}),X(e)&&(0,r.jsx)(T._v,{side:"top",className:"bg-gray-800 text-gray-200 border border-gray-700",children:(0,r.jsx)("p",{children:"You're currently on this plan"})})]})}),X(e)&&F&&"Free"!==e.title&&(0,r.jsx)("div",{className:"mt-3 text-center",children:(0,r.jsx)("button",{onClick:ee,className:"text-sm text-gray-300 hover:text-gray-100 transition-colors underline hover:no-underline",children:"Manage your subscription"})})]})]},e.title))}),(0,r.jsxs)("div",{className:"max-w-[800px] mx-auto",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-white text-center mb-4",children:"Frequently Asked Questions"}),(0,r.jsx)("p",{className:"text-gray-400 text-center mb-12",children:"Find answers to common questions about ZackGPT."}),(0,r.jsxs)(N,{type:"single",collapsible:!0,className:"w-full space-y-4",children:[(0,r.jsxs)(w,{value:"item-1",className:"border border-gray-700 rounded-lg",children:[(0,r.jsx)(v,{className:"text-white px-6 py-4 hover:no-underline hover:bg-gray-800",children:"What is ZackGPT?"}),(0,r.jsx)(P,{className:"text-gray-300 px-6 py-4",children:"ZackGPT is an advanced conversational AI platform that uses state-of-the-art language models to provide intelligent responses and assist users with various tasks, from answering questions to helping with complex problem-solving."})]}),(0,r.jsxs)(w,{value:"item-2",className:"border border-gray-700 rounded-lg",children:[(0,r.jsx)(v,{className:"text-white px-6 py-4 hover:no-underline hover:bg-gray-800",children:"How accurate are the AI's responses?"}),(0,r.jsx)(P,{className:"text-gray-300 px-6 py-4",children:"Our AI model is highly accurate and constantly improving. However, as with any AI system, there may be occasional errors or misunderstandings. We recommend users to verify important information and use critical thinking when interacting with the AI."})]}),(0,r.jsxs)(w,{value:"item-3",className:"border border-gray-700 rounded-lg",children:[(0,r.jsx)(v,{className:"text-white px-6 py-4 hover:no-underline hover:bg-gray-800",children:"Can I use the AI for coding assistance?"}),(0,r.jsx)(P,{className:"text-gray-300 px-6 py-4",children:"Yes, our AI is capable of providing coding assistance across various programming languages. It can help with code explanations, debugging, and even suggest improvements to your code. However, always review and test the code before using it in production environments."})]}),(0,r.jsxs)(w,{value:"item-4",className:"border border-gray-700 rounded-lg",children:[(0,r.jsx)(v,{className:"text-white px-6 py-4 hover:no-underline hover:bg-gray-800",children:"How do you handle data privacy and security?"}),(0,r.jsx)(P,{className:"text-gray-300 px-6 py-4",children:"We take data privacy and security very seriously. All conversations are encrypted, and we do not store personal information unless explicitly required for the service. Our systems comply with industry-standard security practices to protect your data."})]}),(0,r.jsxs)(w,{value:"item-5",className:"border border-gray-700 rounded-lg",children:[(0,r.jsx)(v,{className:"text-white px-6 py-4 hover:no-underline hover:bg-gray-800",children:"What's the difference between the pricing plans?"}),(0,r.jsx)(P,{className:"text-gray-300 px-6 py-4",children:"Our pricing plans differ in features, usage limits, and support levels. The Basic plan is great for individuals, while the Pro plan offers more advanced features and higher usage limits. The Enterprise plan provides custom solutions for large-scale usage and dedicated support."})]}),(0,r.jsxs)(w,{value:"item-6",className:"border border-gray-700 rounded-lg",children:[(0,r.jsx)(v,{className:"text-white px-6 py-4 hover:no-underline hover:bg-gray-800",children:"Can I upgrade or downgrade my plan at any time?"}),(0,r.jsx)(P,{className:"text-gray-300 px-6 py-4",children:"Yes, you can upgrade or downgrade your plan at any time. Changes will be reflected in your next billing cycle. If you upgrade mid-cycle, you'll be charged the prorated difference for the remainder of the current cycle."})]})]})]}),g&&i&&(0,r.jsx)(Y,{plan:i,currentPlan:G.find(e=>X(e))||null,isAnnual:k,onConfirm:K,onCancel:()=>h(!1),plans:G,hasValidPaymentMethod:!!F}),b&&i&&(0,r.jsx)(C.Elements,{stripe:H,children:(0,r.jsx)(D,{plan:i,isAnnual:k,onClose:()=>{j(!1)},onSuccessWithData:L,isUpgrade:!!F&&"Free"!==i.title&&i.title!==F.plan,isNewSubscription:!F,isDowngrade:!!F&&("Pro"===F.plan&&"Pro"!==i.title||"Basic"===F.plan&&"Free"===i.title),prorataPrice:q,credit:M})}),E&&i&&(0,r.jsx)($,{plan:i,currentPlan:G.find(e=>X(e))||null,isAnnual:k,onClose:()=>{A(!1),p(null)},onReload:et,portalUrl:R||"",cancelAt:_})]})})}},90837:function(e,t,a){a.d(t,{$N:function(){return p},Be:function(){return g},Vq:function(){return o},cN:function(){return x},cZ:function(){return u},fK:function(){return m}});var r=a(57437),s=a(2265),n=a(13304),l=a(74697),i=a(37440);let o=n.fC;n.xz;let c=n.h_;n.x8;let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.aV,{ref:t,className:(0,i.cn)("fixed inset-0 z-50 bg-black/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s})});d.displayName=n.aV.displayName;let u=s.forwardRef((e,t)=>{let{className:a,children:s,hideCloseButton:o=!1,...u}=e;return(0,r.jsxs)(c,{children:[(0,r.jsx)(d,{}),(0,r.jsxs)(n.VY,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...u,children:[s,!o&&(0,r.jsxs)(n.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,r.jsx)(l.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});u.displayName=n.VY.displayName;let m=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};m.displayName="DialogHeader";let x=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};x.displayName="DialogFooter";let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.Dx,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",a),...s})});p.displayName=n.Dx.displayName;let g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.dk,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...s})});g.displayName=n.dk.displayName}}]);