PageSourceSearch

https://app.8figures.com/chunk-6HSVW4W4.js

js 8figures.com collected 2026-09-24 21:59:29 UTC 9,733 bytes, 1 lines download raw bytes

1import{i as w}from"./chunk-XMLIQQ63.js";import"./chunk-FPLE6GVG.js";import"./chunk-2RIEXAHN.js";import"./chunk-5LWPAKFP.js";import{d as ie}from"./chunk-GVVB3OBD.js";import"./chunk-BF2XFCWJ.js";import"./chunk-FGR5ZMWF.js";import{a as te}from"./chunk-2YMCZXOH.js";import{a as ee}from"./chunk-BDXCO4SD.js";import"./chunk-FCJ4KHG6.js";import{b as j}from"./chunk-S37UWWBK.js";import{h as q,i as k,r as W,w as z,x as m}from"./chunk-PIBTSWWP.js";import"./chunk-RX4QMHD5.js";import{c as K}from"./chunk-IOJHRE7N.js";import{C as J,D as Q,E as Z,q as b,r as u,u as E,w as H,x as R,y as G}from"./chunk-JJOIM4NJ.js";import{m as X,o as V}from"./chunk-CSNJOHYL.js";import"./chunk-3CE3QAUK.js";import"./chunk-UTRZTJIB.js";import"./chunk-CN47FKJ2.js";import"./chunk-FG5FK2MT.js";import{C as x,Fb as $,Hb as B,Jb as A,Qa as c,T as U,Ub as C,Vb as M,Wb as I,Y as n,ba as Y,ca as F,db as O,gc as _,hc as v,n as T,pb as S,qb as g,vb as D,wb as s,xb as p,yb as P}from"./chunk-ETJYMCWV.js";import"./chunk-M6FDUCGJ.js";import{f as a}from"./chunk-SE5JAREP.js";var re=(()=>{class t{http=n(G);analyticsService=n(W);appLog=n(R);apiPath=H.STRIPE;createCheckoutSession(e=!1){return a(this,null,function*(){let i=yield m.isAnonymous(),o=yield m.getReferenceUserData(),d=e?"allowPromoCode=true":"";if(i&&o){let l=o.userReferenceUid;if(l){let y=[`userReferenceUid=${l}`,d].filter(Boolean).join("&");return T((yield this.http.get(this.apiPath+`createCheckoutSession?${y}`)).pipe(x(h=>{throw this.appLog.log("[StripeService] createCheckoutSession (anonymous) failed","StripeService.createCheckoutSession()",{feature:"Payments",error:u(h)},null,E.Error),h})))}}let f=d?this.apiPath+`createCheckoutSession?${d}`:this.apiPath+"createCheckoutSession";return T((yield this.http.get(f)).pipe(x(l=>{throw this.appLog.log("[StripeService] createCheckoutSession failed","StripeService.createCheckoutSession()",{feature:"Payments",error:u(l)},null,E.Error),l})))})}processPurchase(e=!1){return a(this,null,function*(){let i=yield this.createCheckoutSession(e);if(yield this.appLog.log("Stripe checkout session response received","StripeService.processPurchase()",{code:i?.code,hasPayload:!!i?.payload,hasStripeSubscription:i?.payload?.hasStripeSubscription,hasPortalUrl:!!i?.payload?.stripeCustomerPortalUrl,hasCheckoutUrl:!!i?.payload?.url},b(window.location.href),E.Info),i?.code!==0)throw yield this.appLog.log(`Stripe checkout session returned error code ${i?.code}`,"StripeService.processPurchase()",{code:i?.code,message:i?.message},window.location.pathname,E.Error),new Error(`Stripe checkout failed with code ${i?.code}`);i.payload.hasStripeSubscription?(yield this.analyticsService.addSubscriberEvent(k.UserSubscriptionFlow),window.open(i.payload.stripeCustomerPortalUrl,"_blank")):(yield this.analyticsService.addSubscriberEvent(k.NativeSubscriptionScreen,"Redirect to Stripe checkout URL",q.SubscriptionScreen),window.location.replace(i.payload.url))})}getPurchaseEventDetails(e){return a(this,null,function*(){if(!e?.trim())throw new Error("Session ID is required for purchase event details");return T((yield this.http.get(`${this.apiPath}PurchaseEventDetails/${e}`)).pipe(x(i=>{throw this.appLog.log("[StripeService] Failed to get purchase event details","StripeService.getPurchaseEventDetails()",{feature:"Payments",error:u(i)},null,E.Error),i})))})}static \u0275fac=function(i){return new(i||t)};static \u0275prov=U({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function L(t){let r=t?.status;if(typeof r=="number")return r;let e=t?.error?.status;return typeof e=="number"?e:void 0}function N(t){let r=t?.name;return typeof r=="string"&&r?r:"Error"}function se(t,r){t&1&&P(0,"app-progress-spinner-wrapper",1),t&2&&D("processing",!0)("ignoreTimeout",!0)}function ce(t,r){t&1&&(s(0,"h1"),C(1),_(2,"translate"),p()),t&2&&(c(),M(v(2,1,"STRIPE.PAYMENT_SUCCESS")))}function pe(t,r){t&1&&(s(0,"h1"),C(1),_(2,"translate"),p()),t&2&&(c(),M(v(2,1,"STRIPE.PAYMENT_CANCELLED")))}function le(t,r){t&1&&(s(0,"p",5),C(1),_(2,"translate"),p()),t&2&&(c(),I(" ",v(2,1,"UI.DONE")," "))}function ue(t,r){t&1&&(s(0,"p",5),C(1),_(2,"translate"),p()),t&2&&(c(),I(" ",v(2,1,"STRIPE.PAYMENT_CANCELLED_OR_FAILED")," "))}function me(t,r){t&1&&P(0,"img",10)}function de(t,r){t&1&&P(0,"img",11)}function fe(t,r){if(t&1&&S(0,me,1,0,"img",10)(1,de,1,0,"img",11),t&2){let e=A(2);g(e.resultCode===e.resultEnum.DONE?0:1)}}function he(t,r){if(t&1){let e=$();s(0,"div",2),P(1,"ui-header"),s(2,"div",3)(3,"div",4),S(4,ce,3,3,"h1")(5,pe,3,3,"h1"),p(),s(6,"div"),S(7,le,3,3,"p",5)(8,ue,3,3,"p",5),p(),s(9,"div",6),S(10,fe,2,1),p(),s(11,"div",7)(12,"div",8)(13,"ui-button",9),_(14,"translate"),B("onClick",function(){Y(e);let o=A();return F(o.continue())}),p()()()()()}if(t&2){let e=A();c(4),g(e.resultCode===e.resultEnum.DONE?4:5),c(3),g(e.resultCode===e.resultEnum.DONE?7:8),c(3),g(e.processing?-1:10),c(3),D("text",v(14,5,"UI.CONTINUE"))("disabled",e.processing)}}var qe=(()=>{class t{router=n(V);route=n(X);userService=n(m);logService=n(R);stripeService=n(re);metaPixelService=n(z);processing=!1;resultCode=w.UNKNOWN;isDestroyed=!1;resultEnum=w;MAX_RETRY_ATTEMPTS=10;BASE_RETRY_DELAY_MS=1e3;MAX_DELAY_MS=1e4;subscriptionVerified=!1;get isSuccess(){return this.router.url.includes("stripe/success")}ngOnInit(){return a(this,null,function*(){try{this.processing=!0,this.isSuccess?(yield Z.set(Q(J.demoModeBeenDisabled),"true",!0),this.resultCode=w.DONE,(yield m.isAnonymous())||(yield this.waitForSubscription()),this.trackPurchaseEvent().catch(()=>{})):this.resultCode=w.CANCELED}catch(e){yield this.logSafely("Stripe Error",`${this.constructor.name}.ngOnInit()`,{feature:"Payments",error:u(e),errorName:N(e),errorStatus:L(e)})}finally{this.processing=!1}})}ngOnDestroy(){this.isDestroyed=!0}waitForSubscription(){return a(this,null,function*(){for(let e=0;e<this.MAX_RETRY_ATTEMPTS;e++){if(this.isDestroyed||(yield this.userService.loadUserInfo(),this.isDestroyed))return;if(m.userInfo?.hasSubscriptionOrFreeDays){this.subscriptionVerified=!0,yield this.logSafely("Stripe subscription verified",`${this.constructor.name}.waitForSubscription()`,{feature:"Payments",attempt:e+1});return}if(e<this.MAX_RETRY_ATTEMPTS-1){let i=Math.min(Math.pow(2,e)*this.BASE_RETRY_DELAY_MS,this.MAX_DELAY_MS);if(yield new Promise(o=>setTimeout(o,i)),this.isDestroyed)return}}yield this.logSafely("Stripe subscription not verified after max retries",`${this.constructor.name}.waitForSubscription()`,{feature:"Payments",attempts:this.MAX_RETRY_ATTEMPTS,user:this.getSubscriptionLogSnapshot()})})}getSubscriptionLogSnapshot(){let e=m.userInfo;return{hasUserInfo:!!e,hasSubscriptionOrFreeDays:e?.hasSubscriptionOrFreeDays??null,subscriptionActivated:e?.subscriptionActivated??null}}trackEventIfAvailable(e,i,o,d,f){return a(this,null,function*(){i?yield this.metaPixelService.trackEvent(e,{value:o,currency:d,eventID:i},!1):yield this.logSafely(`[Meta Pixel] No eventId returned from backend for ${e} event`,`${this.constructor.name}.trackPurchaseEvent()`,{feature:"Payments",response:u(f)})})}trackPurchaseEvent(){return a(this,null,function*(){try{let e=this.route.
1snapshot.queryParams.session_id;if(!e){yield this.logSafely("[Meta Pixel] No session_id in query params, cannot track purchase event",`${this.constructor.name}.trackPurchaseEvent()`,{feature:"Payments",url:b(window.location.href)});return}let i=null;for(let h=0;h<this.MAX_RETRY_ATTEMPTS;h++){if(this.isDestroyed||(i=yield this.stripeService.getPurchaseEventDetails(e),this.isDestroyed))return;if(i?.payload?.eventFired)break;if(h<this.MAX_RETRY_ATTEMPTS-1){let oe=Math.min(Math.pow(2,h)*this.BASE_RETRY_DELAY_MS,this.MAX_DELAY_MS);if(yield new Promise(ae=>setTimeout(ae,oe)),this.isDestroyed)return}}if(!i?.payload?.eventFired){yield this.logSafely("Meta Pixel Warning",`${this.constructor.name}.trackPurchaseEvent()`,{feature:"Payments",message:"Purchase event not ready after max retries",attempts:this.MAX_RETRY_ATTEMPTS,lastResponse:u(i?.payload)});return}let{eventId:o,subscribeEventId:d,startTrialEventId:f,value:l,currency:y}=i.payload;(o||!f)&&(yield this.trackEventIfAvailable("Purchase",o,l,y,i.payload)),(d||!f)&&(yield this.trackEventIfAvailable("Subscribe",d,l,y,i.payload)),yield this.trackEventIfAvailable("StartTrial",f,l,y,i.payload)}catch(e){yield this.logSafely("Meta Pixel Error",`${this.constructor.name}.trackPurchaseEvent()`,{feature:"Payments",error:u(e),errorName:N(e),errorStatus:L(e)})}})}logSafely(...e){return a(this,null,function*(){yield Promise.resolve().then(()=>this.logService.log(...e)).catch(()=>{})})}continue(){return a(this,null,function*(){(yield m.isAnonymous())||(yield this.userService.loadUserInfo()),yield this.router.navigate(["/"])})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=O({type:t,selectors:[["app-stripe-redirect-page"]],decls:3,vars:1,consts:[[1,"ui-page"],[3,"processing","ignoreTimeout"],[1,"ui-main"],[1,"flex","flex-column","flex-1"],[1,"ui-screen-title"],[1,"ui-complete-description"],[1,"flex","flex-1","flex-center"],[1,"flex","flex-column","flex-end"],[1,"ui-buttons-container","flex","flex-column"],[3,"onClick","text","disabled"],["imageSrc","/assets/images/ui/screens/sign-up/check-circle.svg","alt","",1,"animate__animated","animate__rotateIn",2,"width","20rem","height","20rem"],["imageSrc","/assets/images/ui/screens/sign-up/circle-error.svg","alt","",1,"animate__animated","animate__fadeIn",2,"width","20rem","height","20rem"]],template:function(i,o){i&1&&(s(0,"div",0),S(1,se,1,2,"app-progress-spinner-wrapper",1)(2,he,15,7,"div",2),p()),i&2&&(c(),g(o.processing?1:2))},dependencies:[j,te,ie,ee,K],styles:[".content[_ngcontent-%COMP%]{min-height:100%;padding:1.5625rem 1.25rem 1.25rem}"]})}return t})();export{qe as StripeRedirectPageComponent};

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.