1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];if(null!=r)for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:blabber-web":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="652686d3-b1bf-445b-b9a9-68334fe8ca04",e._sentryDebugIdIdentifier="sentry-dbid-652686d3-b1bf-445b-b9a9-68334fe8ca04")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8150],{18150:(e,t,r)=>{r.r(t),r.d(t,{SubscribeModal:()=>A});var s=r(95155),a=r(30285),i=r(56671),n=r(12115),o=r(52866),c=r(63537),l=r(34477);let d=(0,l.createServerReference)("6055eb7c9e43d9666bacd0295668fe316dd5ca005f",l.callServer,void 0,l.findSourceMapURL,"createNewSubscriptionNotification");var u=r(85339),p=r(38564),m=r(51154),b=r(81586),f=r(39785),h=r(75525),y=r(32919),x=r(75902),g=r(78697),w=r(59434),_=r(71167),v=r(6277),j=r(59980),S=r(27634),k=r(55855),N=r(31149);function C(e){let{creatorId:t,onSuccess:r,subscriptionId:o,onBack:c}=e,l=(0,k.useStripe)(),d=(0,k.useElements)(),[u,p]=(0,n.useState)(!1),m=async e=>{if(e.preventDefault(),l&&d){p(!0);try{let{error:e}=await l.confirmPayment({elements:d,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(e)return void i.toast.error(e.message||"An error occurred during payment");i.toast.success("Successfully subscribed!"),r()}catch(e){console.error("Error processing payment:",e),i.toast.error("An error occurred while processing your payment")}finally{p(!1)}}};return(0,s.jsxs)("form",{onSubmit:m,className:"w-full p-4 space-y-4",children:[(0,s.jsx)(k.PaymentElement,{}),(0,s.jsx)(a.$,{type:"submit",disabled:!l||!d||u,className:"w-full h-11",children:u?"Processing...":"Subscribe Now"}),c&&(0,s.jsx)(a.$,{type:"button",variant:"outline",className:"w-full h-11",onClick:c,disabled:u,children:"Back"})]})}function P(e){let{clientSecret:t,creatorId:r,subscriptionId:a,onSuccess:i,onBack:o}=e,c=(0,n.useMemo)(()=>(0,N.C)(),[]);return c?(0,s.jsx)(k.Elements,{stripe:c,options:{clientSecret:t},children:(0,s.jsx)(C,{creatorId:r,subscriptionId:a,onSuccess:i,onBack:o})}):(0,s.jsx)("p",{className:"text-sm text-destructive",children:"Stripe publishable key is not configured (NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY)."})}var I=r(79935);function E(e){let t=new Date,r=new Date(t);return"month"===e?r.setMonth(r.getMonth()+1):r.setFullYear(r.getFullYear()+1),r.getTime()-t.getTime()}function A(e){let{isOpen:t,onClose:r,creator:l,isDemo:k,onSubscriptionSuccess:N}
1=e,[C,A]=(0,n.useState)(!1),[T,F]=(0,n.useState)(!1),[M,O]=(0,n.useState)(!1),[D,U]=(0,n.useState)("onyx"),[L,B]=(0,n.useState)(!1),[Y,J]=(0,n.useState)(null),[q,R]=(0,n.useState)(null),[$,z]=(0,n.useState)(null),[V,W]=(0,n.useState)([]),[H,X]=(0,n.useState)(!1),[K,G]=(0,n.useState)(!1),Q=(0,o.createClient)(),{profile:Z,refreshProfile:ee}=(0,_.J)(),{fiatPaymentProcessor:et,loaded:er}=(0,v.e)(),es=(0,n.useRef)(!1),ea=async()=>{let e=await fetch("/api/admin/bypass-subscription",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({creatorId:l.id,subscription_price_cents:l.subscription_price_cents,subscription_interval:l.subscription_interval})});if(!e.ok)throw Error((await e.json().catch(()=>({}))).error||"Admin test subscribe failed");i.toast.success("Admin test subscription active (no charge)"),eh()},ei=async()=>{let e,{data:{session:t}}=await Q.auth.getSession();if(!(null==t?void 0:t.user))throw Error("No user session found");let{data:r,error:s}=await Q.from("subscriptions").select("*").eq("follower_id",t.user.id).eq("following_id",l.id).single();if(r){let{data:t,error:s}=await Q.from("subscriptions").update({status:"active",current_period_ends_at:new Date(Date.now()+E(l.subscription_interval)).toISOString(),provider_subscription_id:"demo_".concat(Date.now()),price_at_time_of_subscription_cents:l.subscription_price_cents,interval_at_time_of_subscription:l.subscription_interval,payment_provider:"demo",canceled_at:null}).eq("id",r.id).select().single();if(s)throw Error("Failed to update subscription record");e=t}else{let{data:r,error:s}=await Q.from("subscriptions").insert({follower_id:t.user.id,following_id:l.id,status:"active",current_period_ends_at:new Date(Date.now()+E(l.subscription_interval)).toISOString(),provider_subscription_id:"demo_".concat(Date.now()),price_at_time_of_subscription_cents:l.subscription_price_cents,interval_at_time_of_subscription:l.subscription_interval,payment_provider:"demo"}).select().single();if(s)throw Error("Failed to create subscription record");e=r}let{error:a}=await Q.from("subscription_payments").insert({subscription_id:e.id,user_id:t.user.id,creator_profile_id:l.id,amount_cents:l.subscription_price_cents,currency:"usd",payment_provider:"demo",payment_intent_id:"demo_".concat(Date.now()),status:"succeeded",period_starts_at:new Date().toISOString(),period_ends_at:new Date(Date.now()+E(l.subscription_interval)).toISOString(),creator_share_cents:Math.round(.7*l.subscription_price_cents),platform_share_cents:Math.round(.3*l.subscription_price_cents)});if(a)throw Error("Failed to create payment record");i.toast.success("Successfully subscribed to demo creator!"),eh();try{let{data:e}=await Q.from("profiles").select("username").eq("id",t.user.id).single();(null==e?void 0:e.username)&&await d({creatorId:l.id,subscriberId:t.user.id,subscriberUsername:e.username})}catch(e){console.error("Failed to create subscription notification:",e)}},en=async()=>{if(k){try{A(!0),await ei()}catch(e){console.error("Error creating demo subscription:",e),i.toast.error("Failed to create demo subscription.")}finally{A(!1)}return}er&&F(!0)};(0,n.useEffect)(()=>{if(!t||k){X(!1),G(!!k);return}let e=!1;return G(!1),(async()=>{let{data:{session:t}}=await Q.auth.getSession();if(!(null==t?void 0:t.user)){e||(X(!1),G(!0));return}let{data:r}=await Q.from("subscriptions").select("status").eq("follower_id",t.user.id).eq("following_id",l.id).maybeSingle();e||(X((null==r?void 0:r.status)==="past_due"),G(!0))})(),()=>{e=!0}},[t,k,l.id]),(0,n.useLayoutEffect)(()=>{if(!t){es.current=!1;return}if(k||er&&K){if(k){if(es.current)return;es.current=!0,(async()=>{try{A(!0),await ei()}catch(e){console.error("Error creating demo subscription:",e),i.toast.error("Failed to create demo subscription.")}finally{A(!1)}})();return}!H&&(es.current||(es.current=!0,F(!0)))}},[t,k,er,K,H,l.id]);let eo=async(e,t,r)=>{let{data:{session:s}}=await Q.auth.getSession();if(!(null==s?void 0:s.user))return void i.toast.error("You must be logged in to subscribe");A(!0);try{let a=window.location.href,{data:n}=await Q.from("subscriptions").select("id").eq("follower_id",s.user.id).eq("following_id",l.id).single(),o={transactionType:"subscription",amountCents:l.subscription_price_cents,metadata:{userId:s.user.id,transactionType:"subscription",creatorId:l.id,amountCents:l.subscription_price_cents,subscriptionId:null==n?void 0:n.id},card:e,billing:t,returnUrl:a};"onyx"===D&&(o.save_card=!!r);let c=await fetch("goat"===D?"/api/goat/process-payment":"/api/onyx/process-payment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),d=await c.json();if(!c.ok){i.toast.error(d.error||"Payment failed"),A(!1);return}if("redirect"===d.status&&d.redirect_url){window.location.href=d.redirect_url;return}if("pending"===d.status){i.toast.info(d.message||"Subscription is processing. Youâll get access as soon as it settles."),ef();return}"success"===d.status&&(i.toast.success("Subscribed successfully"),d.saved_card_error&&i.toast.warning(d.saved_card_error),eh())}catch(e){i.toast.error("Payment failed")}finally{A(!1)}},ec=async e=>{let{data:{session:t}}=await Q.auth.getSession();if(!(null==t?void 0:t.user))return void i.toast.error("You must be logged in to subscribe");A(!0);try{let r=window.location.href,{data:s}=await Q.from("subscriptions").select("id").eq("follower_id",t.user.id).eq("following_id",l.id).single(),a=await fetch("/api/onyx/process-payment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({transactionType:"subscription",amountCents:l.subscription_price_cents,metadata:{userId:t.user.id,transactionType:"subscription",creatorId:l.id,amountCents:l.subscription_price_cents,subscriptionId:null==s?void 0:s.id},payment_method_id:e,returnUrl:r})}),n=await a.json();if(!a.ok){i.toast.error(n.error||"Payment failed"),A(!1);return}if("redirect"===n.status&&n.redirect_url){window.location.href=n.redirect_url;return}"success"===n.status&&(i.toast.success("Subscribed successfully"),eh())}catch(e){i.toast.error("Payment failed")}finally{A(!1)}};(0,n.useEffect)(()=>{T&&t&&(async()=>{let{data:{session:e}}=await Q.auth.getSession();if(!(null==e?void 0:e.user))return;let{data:t}=await Q.from("user_payment_methods").select("id, last4, brand, is_default, onyx_payment_method_id, uspaymate_payment_method_id").eq("user_id",e.user.id).order("is_default",{ascending:!1});W(t||[])})()},[T,t]),(0,n.useEffect)(()=>{M&&t&&(async()=>{let{data:{session:e}}=await Q.auth.getSession();if(!(null==e?void 0:e.user))return;let{data:t}=await Q.from("profiles").select("full_name").eq("id",e.user.id).single(),r=((null==t?void 0:t.full_name)||"").trim().split(/\s+/);z({first_name:r[0]||"",last_name:r.slice(1).join(" ")||"",email:e.user.email||""})})()},[M,t]);let el=async()=>{A(!0);try{let e=(0,o.createClient)(),{data:{session:t}}=await e.auth.getSession();if(!(null==t?void 0:t.user))return void i.toast.error("You must be logged in to subscribe");let r=await fetch("/api/moonpay/create-subscription-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amount:l.subscription_price_cents,userId:t.user.id,creatorId:l.id})});if(!r.ok)throw Error("Failed to create checkout session");let s=await r.json(),a=new URLSearchParams({type:"subscription",paymentId:s.paymentId});window.location.href="/crypto-payment?".concat(a.toString())}catch(t){console.error("Error creating checkout session:",t);let e=t instanceof Error?t.message:"Failed to create checkout session";i.toast.error(e),e.includes("Transaction still pending")&&(ef(),window.location.href="/transactions")}finally{A(!1)}},ed=async()=>{A(!0);try{let{data:{session:e}}=await Q.auth.getSession();if(!(null==e?void 0:e.user))return void i.toast.error("You must be logged in to subscribe");let t=await fetch("/api/epoch/create-subscription-payment-link",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({creatorId:l.id,returnUrl:window.location.href})}),r=await t.json();if(!t.ok)return void i.toast.error(r.error||"Failed to create payment link");r.paymentUrl&&(window.location.href=r.paymentUrl)}catch(e){console.error(e),i.toast.error("Failed to start checkout")}finally{A(!1)}},eu=async()=>{A(!0);try{let{data:{session:e}}=await Q.auth.getSession();if(!(null==e?void 0:e.user))return void i.toast.error("You must be logged in to subscribe");let t=await fetch("/api/uspaymate/create-subscription-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({creatorId:l.id,returnUrl:window.location.href})}),r=await t.json();if(!t.ok)return void i.toast.error(r.error||"Failed to create checkout session");if("success"===r.status){i.toast.success("Subscribed successfully"),eh();return}r.paymentUrl&&(window.location.href=r.paymentUrl)}catch(e){console.error(e),i.toast.error("Failed to start checkout")}finally{A(!1)}},ep=async e=>{A(!0);try{let{data:{session:t}}=await Q.auth.getSession();if(!(null==t?void 0:t.user))return void i.toast.error("You must be logged in to subscribe");let r=await fetch("/api/uspaymate/create-subscription-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({creatorId:l.id,returnUrl:window.location.href,paymentMethodId:e})}),s=await r.json();if(!r.ok)return void i.toast.error(s.error||"Payment failed");if("success"===s.status){i.toast.success("Subscribed successfully"),eh();return}s.paymentUrl&&(window.location.href=s.paymentUrl)}catch(e){console.error(e),i.toast.error("Payment failed")}finally{A(!1)}},em=async()=>{A(!0);try{let{data:{session:e}}=await Q.auth.getSession();if(!(null==e?void 0:e.user))return void i.toast.error("You must be logged in to subscribe");let t=await fetch("/api/blitz/create-subscription-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({creatorId:l.id,returnUrl:window.location.href})}),r=await t.json();if(!t.ok)return void i.toast.error(r.error||"Failed to create checkout session");r.paymentUrl&&((0,I.Og)(window.location.href),window.location.href=r.paymentUrl)}catch(e){console.error(e),i.toast.error("Failed to start checkout")}finally{A(!1)}},eb=async()=>{A(!0);try{let e=await fetch("/api/stripe/create-subscription-intent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({creatorId:l.id})});if(!e.ok){let t=await e.text();i.toast.error(t||"Failed to start card subscription");return}let t=await e.json();t.clientSecret&&t.subscriptionId&&(J(t.clientSecret),R(t.subscriptionId),B(!0))}catch(e){console.error(e),i.toast.error("Failed to start card subscription")}finally{A(!1)}},ef=()=>{F(!1),O(!1),B(!1),J(null),R(null),X(!1),G(!1),r()},eh=()=>{(0,c.Ao)(l.id),ef(),null==N||N()},ey=e=>(0,j.vB)(e),ex=e=>"month"===e?"monthly":"yearly",eg="".concat(ey(l.subscription_price_cents),"/").concat(ex(l.subscription_interval)),ew=L||M,e_=!H||T||ew?T?"Choose payment method":L?"Card payment":M?"Enter card":"Subscribe to ".concat(l.name||"Creator"):"Payment failed",ev=!H||T||ew?T?"You're subscribing for ".concat(eg,". Pick how you'd like to pay."):"Unlock exclusive posts, videos, and shorts from ".concat(l.name||"this creator","."):"Your last payment didnât go through, so ".concat(l.name||"this creator","âs subscriber content is locked."),ej=!T&&!ew&&(k||er)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.$,{type:"button",variant:"outline",className:x.gT,onClick:ef,children:"Cancel"}),(0,s.jsx)(a.$,{type:"button",className:x.So,onClick:H?()=>{if("blitz"===et)return void em();en()}:en,disabled:C||!k&&!K,children:C?"Please waitâ¦":H?"Update billing":"Continue"})]}):T&&!ew?(0,s.jsx)(a.$,{type:"button",variant:"outline",className:(0,w.cn)(x.gT,"w-full sm:w-auto"),onClick:()=>{F(!1),B(!1),J(null),R(null)},children:"Back"}):void 0;return(0,s.jsx)(x.eM,{open:t,onOpenChange:e=>!e&&ef(),icon:H?u.A:p.A,title:e_,description:ev,size:T?"wide":"default",footer:ej,children:k||er&&K?(0,s.jsx)(s.Fragment,{children:L&&Y&&q?(0,s.jsx)(P,{clientSecret:Y,creatorId:l.id,subscriptionId:q,onSuccess:()=>{B(!1),J(null),R(null),eh()},onBack:()=>{B(!1),J(null),R(null)}}):M?(0,s.jsx)(S.d,{amountLabel:"".concat(ey(l.subscription_price_cents),"/").concat(ex(l.subscription_interval)),billing:$,showSaveCard:"onyx"===D,onSubmit:eo,onCancel:()=>O(!1),isLoading:C}):H&&!T?(0,s.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Update your billing to restore access. Youâll complete a new card checkout, then subscriber content unlocks again."}
1):T?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(g.T$,{icon:p.A,priceLabel:eg,subtitle:"Billed ".concat(ex(l.subscription_interval)," \xb7 Cancel anytime")}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"text-xs font-bold uppercase tracking-widest text-muted-foreground",children:"Payment method"}),"onyx"===et&&(0,s.jsxs)(s.Fragment,{children:[V.filter(e=>e.onyx_payment_method_id).map(e=>(0,s.jsx)(g.kM,{variant:"saved",icon:(0,s.jsx)(b.A,{className:"h-[18px] w-[18px]"}),title:"â¢â¢â¢â¢ ".concat(e.last4).concat(e.is_default?" \xb7 Default":""),subtitle:"".concat(e.brand||"Card"," â saved payment method"),onClick:()=>ec(e.onyx_payment_method_id||""),disabled:C},e.id)),(0,s.jsx)(g.kM,{icon:(0,s.jsx)(b.A,{className:"h-[18px] w-[18px]"}),title:V.length>0?"Pay with new card":"Pay with card",subtitle:"Onyx â credit or debit card",onClick:()=>{U("onyx"),O(!0)},disabled:C})]}),"moonpay"===et&&(0,s.jsx)(g.kM,{icon:(0,s.jsx)(f.A,{className:"h-[18px] w-[18px]"}),title:"Pay with MoonPay",subtitle:"USDC, ETH, SOL & more (30 days)",onClick:el,disabled:C}),"stripe"===et&&(0,s.jsx)(g.kM,{icon:(0,s.jsx)(b.A,{className:"h-[18px] w-[18px]"}),title:"Pay with card",subtitle:"Stripe â credit or debit card",onClick:eb,disabled:C}),"epoch"===et&&(0,s.jsx)(g.kM,{icon:(0,s.jsx)(b.A,{className:"h-[18px] w-[18px]"}),title:"Continue to checkout",subtitle:"Epoch secure checkout",onClick:ed,disabled:C}),"uspaymate"===et&&(0,s.jsxs)(s.Fragment,{children:[V.filter(e=>e.uspaymate_payment_method_id).map(e=>(0,s.jsx)(g.kM,{variant:"saved",icon:(0,s.jsx)(b.A,{className:"h-[18px] w-[18px]"}),title:"â¢â¢â¢â¢ ".concat(e.last4).concat(e.is_default?" \xb7 Default":""),subtitle:"".concat(e.brand||"Card"," â saved payment method"),onClick:()=>ep(e.uspaymate_payment_method_id||""),disabled:C},e.id)),(0,s.jsx)(g.kM,{icon:(0,s.jsx)(b.A,{className:"h-[18px] w-[18px]"}),title:"Continue to checkout",subtitle:"Pay by Card",onClick:eu,disabled:C})]}),"blitz"===et&&(0,s.jsx)(g.kM,{icon:(0,s.jsx)(b.A,{className:"h-[18px] w-[18px]"}),title:"Continue to checkout",subtitle:"Pay by Card",onClick:em,disabled:C}),(null==Z?void 0:Z.isAdmin)&&(0,s.jsx)(g.kM,{variant:"admin",icon:(0,s.jsx)(h.A,{className:"h-[18px] w-[18px]"}),title:"Admin test (no charge)",subtitle:"Bypass payment for testing",onClick:async()=>{try{A(!0),await ea()}catch(e){console.error(e),i.toast.error(e instanceof Error?e.message:"Admin test subscribe failed")}finally{A(!1)}},disabled:C})]}),"moonpay"===et&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:"Crypto subscriptions expire in 30 days and cannot be automatically renewed."}),(0,s.jsxs)("p",{className:"flex items-center justify-center gap-1.5 text-center text-[11px] text-muted-foreground",children:[(0,s.jsx)(y.A,{className:"h-3 w-3 shrink-0"}),"Secure checkout \xb7 Access unlocks instantly"]})]}):(0,s.jsx)(g.T$,{icon:p.A,priceLabel:eg,subtitle:"Billed ".concat(ex(l.subscription_interval)," \xb7 Cancel anytime")})}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-10 text-muted-foreground",children:[(0,s.jsx)(m.A,{className:"h-8 w-8 animate-spin","aria-hidden":!0}),(0,s.jsx)("p",{className:"text-sm",children:"Loading checkoutâ¦"})]})})}},27634:(e,t,r)=>{r.d(t,{d:()=>b});var s=r(95155),a=r(12115),i=r(62523),n=r(85057),o=r(81586),c=r(51154),l=r(32919),d=r(47262),u=r(59434);let p={first_name:"Customer",last_name:"User",email:"",phone_number:"1",address:"N/A",city:"N/A",state:"N/A",zip:"00000"},m="h-11 rounded-[12px] border-border/70 bg-background focus-visible:border-[var(--brand-pink)] focus-visible:ring-[var(--brand-pink)]/20";function b(e){let{amountLabel:t,billing:r,showSaveCard:b=!1,onSubmit:f,onCancel:h,isLoading:y,variant:x="default",hideAmountLabel:g=!1,hideCancel:w=!1}=e,[_,v]=(0,a.useState)(""),[j,S]=(0,a.useState)(""),[k,N]=(0,a.useState)(""),[C,P]=(0,a.useState)(!0),[I,E]=(0,a.useState)(null),A="branded"===x,T=async e=>{var t,s,a;e.preventDefault(),E(null);let i=_.replace(/\s/g,"");if(i.length<13)return void E("Enter a valid card number");
1let[n,o]=j.split("/");if(!n||!o||2!==n.length||2!==o.length)return void E("Enter expiry as MM/YY");if(k.length<3)return void E("Enter a valid CVV");let c={number:i,exp_month:n,exp_year:2===o.length?o:o.slice(-2),cvc:k},l={...p,first_name:(null==r||null==(t=r.first_name)?void 0:t.trim())||p.first_name,last_name:(null==r||null==(s=r.last_name)?void 0:s.trim())||p.last_name,email:(null==r||null==(a=r.email)?void 0:a.trim())||p.email};try{await f(c,l,b?C:void 0)}catch(e){E(e instanceof Error?e.message:"Payment failed")}};return(0,s.jsxs)("form",{onSubmit:T,className:(0,u.cn)("space-y-4",A&&"space-y-3.5"),children:[!g&&(0,s.jsx)("p",{className:(0,u.cn)("text-sm text-muted-foreground",A&&"sr-only"),children:t}),A&&(0,s.jsx)("p",{className:"text-xs font-bold uppercase tracking-widest text-muted-foreground",children:"Card details"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.J,{htmlFor:"onyx-card-number",className:(0,u.cn)(A&&"text-xs font-semibold text-muted-foreground"),children:"Card number"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(o.A,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,s.jsx)(i.p,{id:"onyx-card-number",placeholder:"1234 5678 9012 3456",value:_,onChange:e=>v(e.target.value.replace(/\s/g,"").replace(/\D/g,"").slice(0,19).replace(/(\d{4})(?=\d)/g,"$1 ").trim()),maxLength:19,autoComplete:"cc-number",className:(0,u.cn)(A&&m,A&&"pl-10 font-mono tracking-wide")})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2.5",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.J,{htmlFor:"onyx-exp",className:(0,u.cn)(A&&"text-xs font-semibold text-muted-foreground"),children:"Expiry"}),(0,s.jsx)(i.p,{id:"onyx-exp",placeholder:"MM/YY",value:j,onChange:e=>S(function(e){let t=e.replace(/\D/g,"").slice(0,4);return t.length>=2?"".concat(t.slice(0,2),"/").concat(t.slice(2)):t}(e.target.value)),maxLength:5,autoComplete:"cc-exp",className:(0,u.cn)(A&&m,A&&"font-mono")})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.J,{htmlFor:"onyx-cvc",className:(0,u.cn)(A&&"text-xs font-semibold text-muted-foreground"),children:"CVV"}),(0,s.jsx)(i.p,{id:"onyx-cvc",placeholder:"123",value:k,onChange:e=>N(e.target.value.replace(/\D/g,"").slice(0,4)),maxLength:4,autoComplete:"cc-csc",className:(0,u.cn)(A&&m,A&&"font-mono")})]})]}),b&&(0,s.jsxs)("div",{className:(0,u.cn)("flex items-start gap-2.5",A&&"rounded-[12px] border border-border/60 bg-secondary/40 px-3.5 py-3"),children:[(0,s.jsx)(d.S,{id:"onyx-save-card",checked:C,onCheckedChange:e=>P(!0===e),className:"mt-0.5"}),(0,s.jsx)(n.J,{htmlFor:"onyx-save-card",className:"cursor-pointer text-sm font-normal leading-snug",children:"Save card for faster checkout next time"})]}),I&&(0,s.jsx)("p",{className:"rounded-[10px] bg-destructive/10 px-3 py-2 text-sm text-destructive",children:I}),(0,s.jsx)("div",{className:(0,u.cn)("flex gap-2",A&&"flex-col gap-2.5 pt-0.5"),children:A?(0,s.jsx)("button",{type:"submit",disabled:y,className:(0,u.cn)("flex h-12 w-full items-center justify-center gap-2 rounded-full text-sm font-semibold text-white transition-[filter,transform]","disabled:pointer-events-none disabled:opacity-50","hover:brightness-110 active:scale-[0.98]"),style:{background:"var(--brand-grad)",boxShadow:"var(--brand-ring-money)"},children:y?(0,s.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.A,{className:"h-3.5 w-3.5"}),"Pay securely"]})}):(0,s.jsxs)(s.Fragment,{children:[!w&&(0,s.jsx)("button",{type:"button",onClick:h,disabled:y,className:"inline-flex h-9 flex-1 items-center justify-center rounded-md border bg-background px-4 text-sm font-medium shadow-xs hover:bg-accent disabled:opacity-50",children:"Back"}),(0,s.jsx)("button",{type:"submit",disabled:y,className:"inline-flex h-9 flex-1 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow-xs hover:bg-primary/90 disabled:opacity-50",children:y?(0,s.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):"Pay"})]})}),A&&(0,s.jsxs)("p",{className:"flex items-center justify-center gap-1.5 text-center text-[11px] text-muted-foreground",children:[(0,s.jsx)(l.A,{className:"h-3 w-3 shrink-0"}),"Encrypted & secure \xb7 Credits added instantly"]})]})}},31149:(e,t,r)=>{r.d(t,{C:()=>a});let s=null;function a(){let e="pk_live_51TW7mJCElt2LSUndlFFnn4VGjwc7RSoRPmoi6uaBQRPwBIF5d5I23rDR5s6k3ABpabwMzlRFNHrwB4q6Ba6PpADu00vRg2jDJh";return e?(s||(s=(async()=>{let{loadStripe:t}=await r.e(4064).then(r.bind(r,34064));return t.setLoadParameters({advancedFraudSignals:!1}),t(e)})()),s):null}},47262:(e,t,r)=>{r.d(t,{S:()=>o});var s=r(95155),a=r(12115),i=r(5196),n=r(59434);let o=a.forwardRef((e,t)=>
1{let{className:r,checked:a,onCheckedChange:o,onChange:c,...l}=e;return(0,s.jsxs)("div",{className:"relative inline-flex items-center",children:[(0,s.jsx)("input",{type:"checkbox",ref:t,checked:a,onChange:e=>{o&&o(e.target.checked),c&&c(e)},className:(0,n.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 appearance-none checked:bg-primary checked:border-primary",r),...l}),a&&(0,s.jsx)(i.A,{className:"absolute h-4 w-4 text-primary-foreground pointer-events-none"})]})});o.displayName="Checkbox"},63537:(e,t,r)=>{r.d(t,{Ao:()=>i,Xx:()=>a,gg:()=>s});let s="blabber:credit-motion",a="blabber:subscribe-button-pulse";function i(e){window.dispatchEvent(new CustomEvent(a,{detail:{creatorProfileId:e}}))}},79935:(e,t,r)=>{r.d(t,{Og:()=>o,gm:()=>c,si:()=>i,tX:()=>n});var s=r(34439);let a="blitz_buyer_return_url";function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/home",r=t.startsWith("/")&&!t.startsWith("//")?t:"/home";if(!e)return r;try{let t=new URL(e,"https://blabber.ai"),a="".concat(t.pathname).concat(t.search);if(!a.startsWith("/")||a.startsWith("//"))return r;let i=(0,s.du)(t.hostname)&&(0,s.bC)(t.origin);if("/"===t.pathname||""===t.pathname)return i?"".concat(t.origin,"/tv"):r;if(i)return"".concat(t.origin).concat(a);return a}catch(e){return r}}function n(e,t){let r=new URL(e,"https://blabber.ai");for(let[e,s]of Object.entries(t))s&&r.searchParams.set(e,s);return/^https?:\/\//i.test(e)?r.toString():"".concat(r.pathname).concat(r.search)}function o(e){try{sessionStorage.setItem(a,e)}catch(e){}}function c(){try{let e=sessionStorage.getItem(a);return sessionStorage.removeItem(a),e}catch(e){return null}}},85057:(e,t,r)=>{r.d(t,{J:()=>n});var s=r(95155);r(12115);var a=r(72797),i=r(59434);function n(e){let{className:t,...r}=e;return(0,s.jsx)(a.b,{"data-slot":"label",className:(0,i.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...r})}}}]);
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.