1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,351735,958877,e=>{"use strict";var t=e.i(991865),a=e.i(120786),n=e.i(92808),r=e.i(651682),u=e.i(540316),s=e.i(296137),c=e.i(160966),i=e.i(271645),l=i.default.createContext({});e.s(["OnboardingContext",0,l],958877),e.i(101967);var o=e.i(571836),d=e.i(611814);e.i(982285);var p=e.i(274466),v=e.i(25258),h=e.i(618566),f=e.i(9021),g=function(e){var t=e.pathname,a=e.planUID,n=e.actionType,r=e.flow,u=e.reactivation,s=new URLSearchParams({modal:"payment",type:"planSubscription"});return a&&s.set("planUID",a),n&&s.set("actionType",n),r&&s.set("flow",r),u&&s.set("reactivation","true"),"".concat(t,"?").concat(s.toString())},m=function(e){try{return window.history.pushState(null,"",g(e)),!0}catch(e){return!1}};e.s(["default",0,function(e){var U=(0,h.useRouter)(),b=(0,o.useDispatch)(),y=(0,h.usePathname)(),S=(0,h.useSearchParams)(),_=(0,h.useParams)().actionType,D=Object.fromEntries(S.entries()),w=D.nextStep,C=D.userType,k=D.providerCredentialUUID,I=D.userPlan,P=D.flow,R=D.modal,T=D.type,B=D.subscriptionID,L=(0,i.useContext)(l),N=L.onboardingState,A=L.serverData,W=L.next,O=(0,r._)((0,i.useState)(!1),2),x=O[0],Q=O[1],j=(0,d.useSelector)(function(e){return e.UserReducer.activeWorkspace}),E=(0,d.useSelector)(function(e){return e.UserReducer.geolocation}),M=(0,d.useSelector)(function(e){return e.UserReducer.serverLists});(0,i.useEffect)(function(){w&&(U.replace(y),b((0,v.getAllWorkspaceRelatedData)()))},[w]),(0,i.useEffect)(function(){if(A){var e,t,a=null==M||null==(e=M.clusters)?void 0:e.find(function(e){return e.name===A.Name});(0,u._)(c.availableClusterStatus).concat(["created"]).includes(null==a||null==(t=a.status)?void 0:t.toLowerCase())&&!I&&W()}},[M,I,A]);var Y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,t._)(function(){var t,r,u,i,l,o,d,h,g,m,S,_,D,w,k,I,B,L,N,A,O,x;return(0,s._)(this,function(s){switch(s.label){case 0:if(!(null==j?void 0:j.UUID))return console.error("[useSubscribeToPlan] Cannot subscribe: activeWorkspace.UUID is missing",{activeWorkspace:j}),(0,f.showErrorToast)("You need to create a workspace first. Redirecting..."),U.replace("/auth/workspace"),[2];t=n.shldSaveCard,r=n.cardId,u=n.location,i=n.applyCredit,l=n.plan,d=(o=JSON.parse(sessionStorage.getItem("checkoutDetails")||"{}")).Name,h=o.Slug,g=o.Period,m=o.payload,S=g||(null==l?void 0:l.Period),_=h||(null==l?void 0:l.Slug),D={Workspace:null==j?void 0:j.UUID,Plan:null==l?void 0:l.UID,CallBackURL:"".concat(c.PipeOpsDashboard_URL).concat(y)}
1,w=[],(k="stripe"===e?"us":"paystack"===e?"ng":u||E)&&w.push("location=".concat(k)),S&&w.push("period=".concat(S)),_&&w.push("tier=".concat(_)),I=(0,a._)({ApplyCreditBalance:i},m||{},r?{SelectedCard:r}:{},l?D:{},(null==j?void 0:j.teamUUID)?{team_uuid:j.teamUUID}:{}),t&&w.push("save_payment_option=true"),Q(!0),s.label=1;case 1:return s.trys.push([1,,8,9]),[4,I.Server?(0,p.checkout)(w.join("&"),I):b((0,p.subscribeToPlatform)(w.join("&"),I,(null==e?void 0:e.includes("card"))?"card":""))];case 2:if(!(null==(L=s.sent())?void 0:L.success))return[3,5];if(sessionStorage.removeItem("SelectServer"),null==L||null==(N=L.data)?void 0:N.checkout_url)return(0,f.showSuccessToast)("You will be redirected shortly to proceed with selected payment provider."),window.location.assign(null==L||null==(O=L.data)?void 0:O.checkout_url),[2];return sessionStorage.removeItem("checkoutDetails"),[4,new Promise(function(e){return setTimeout(e,1e3)})];case 3:return s.sent(),[4,b((0,v.getAllWorkspaceRelatedData)())];case 4:return s.sent(),(R||C)&&!P?U.replace(y):y.includes("choose-server")&&m.Server||T?U.replace("/dashboard/clusters"):W(),(0,f.showSuccessToast)((null==L||null==(A=L.data)?void 0:A.message)||"Successfully subscribed to the ".concat(d," plan.")),[3,7];case 5:if(!(null==L||null==(B=L.data)?void 0:B.message.includes("nova")))return[3,7];return[4,b((0,v.getOutstandingNovaUsageBilling)())];case 6:(null==(x=s.sent())?void 0:x.success)&&(sessionStorage.setItem("novaDebtData",JSON.stringify(null==x?void 0:x.data)),U.push("".concat(y,"?modal=nova-usage-debt"))),s.label=7;case 7:return[3,9];case 8:return Q(!1),[7];case 9:return[2]}})})()};return{handleSubscribeUser:Y,handleInitiateSubscription:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!(null==j?void 0:j.UUID))return console.error("[useSubscribeToPlan] Cannot initiate subscription: activeWorkspace.UUID is missing",{activeWorkspace:j}),(0,f.showErrorToast)("You need to create a workspace first. Redirecting..."),U.replace("/auth/workspace"),!1;var r=(0,a._)({},A||{},t),u=r.Name,s=r.CanCreateForFree,i=r.Plan,l=r.Price,o=r.Period,d=r.Slug,p=r.PlanRenewal,v=!(null==A?void 0:A.Server),h=(0,a._)({Plan:i,CallBackURL:y.includes("choose-server")?"".concat(c.PipeOpsDashboard_URL,"/dashboard/clusters"):y.includes("billing")?"".concat(c.PipeOpsDashboard_URL,"/dashboard/billing"):y.includes("usage")?"".concat(c.PipeOpsDashboard_URL,"/dashboard/usage"):"".concat(c.PipeOpsDashboard_URL).concat(y,"?modal=redirectModal&redirectBack=true&planTier=").concat(v?"startup":"developer","&nextStep=").concat(v?2:N.step+1).concat(k?"&providerCredentialUUID=".concat(k):"")},0===l?{Price:l}:{});if(e=v?(0,n._)((0,a._)({},h),{Workspace:null==j?void 0:j.UUID}):I?(0,n._)((0,a._)({},h),{Workspace:null==j?void 0:j.UUID,Server:A.Server}):(0,a._)((0,n._)((0,a._)({},h),{Workspace:null==j?void 0:j.UUID}),A),(s||0===l)&&(e.CanCreateForFree=!0),sessionStorage.setItem("checkoutDetails",JSON.stringify({isNewSubscription:!I,Name:u,Slug:d,Period:o,payload:I?(0,a._)({prevSubId:B},e):e})),0===Number(l)||s||!i)return Y(),!0;var b={pathname:y,planUID:i,actionType:_,flow:P,reactivation:!!p},S=g(b),D=m(b);return D||U.push(S),D},loading:x}}],351735)},822539,e=>{"use strict";var t=e.i(991865),a=e.i(651682),n=e.i(296137),r=e.i(160966),u=e.i(618566),s=e.i(271645);e.i(101967);var c=e.i(571836),i=e.i(611814),l=e.i(9021);e.i(982285);var o=e.i(274466),d=e.i(25258);e.s(["default",0,function(){var e=(0,u.usePathname)(),p=(0,c.useDispatch)(),v=(0,i.useSelector)(function(e){return e.UserReducer.geolocation}),h=(0,i.useSelector)(function(e){return e.UserReducer.activeWorkspace}),f=(0,a._)((0,s.useState)(null),2),g=f[0],m=f[1],U=(0,a._)((0,s.useState)(!1),2),b=U[0],y=U[1];(0,s.useEffect)(function(){g||S()},[]);var S=function(){return(0,t._)(function(){var e;return(0,n._)(this,function(t){switch(t.label){case 0:return t.trys.push([0,,2,3]),[4,p((0,o.getBillingCard)())];case 1:return m(Array.isArray(e=t.sent())?e:(null==e?void 0:e.data)||[]),[2,e];case 2:return[7];case 3:return[2]}})})()};return{loading:b,billingCards:g,handleDeleteACard:function(e,a){return(0,t._)(function(){var t,r;return(0,n._)(this,function(n){switch(n.label){case 0:y(!0),t=[],(null==h?void 0:h.UUID)&&t.pu
1sh("workspace_uuid=".concat(null==h?void 0:h.UUID)),(null==h?void 0:h.teamUUID)&&t.push("team_uuid=".concat(null==h?void 0:h.teamUUID)),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,(0,o.deleteBillingCard)(e,null==t?void 0:t.join("&"))];case 2:return(null==(r=n.sent())?void 0:r.success)&&(m(function(t){return t.filter(function(t){return t.UID!==e})}),(0,l.showSuccessToast)(r.message),"function"==typeof a&&a()),[3,4];case 3:return y(!1),[7];case 4:return[2]}})})()},handleAddBillingCard:function(a){return(0,t._)(function(){var t,u,s,c,i,l;return(0,n._)(this,function(n){switch(n.label){case 0:return n.trys.push([0,,2,3]),y(!0),u=sessionStorage.getItem("callbackPath")||"".concat(e,"?modal=topUpWallet"),s=["location=".concat(a||v),"save_payment_option=true"],(null==h?void 0:h.teamUUID)&&s.push("team_uuid=".concat(null==h?void 0:h.teamUUID)),c=s.join("&"),[4,(0,o.addBillingCard)({CallBackURL:"".concat(r.PipeOpsDashboard_URL).concat(u),Workspace:null==h?void 0:h.UUID},c)];case 1:return(null==(i=n.sent())||null==(t=i.data)?void 0:t.checkout_url)?window.location.href=null==i||null==(l=i.data)?void 0:l.checkout_url:(null==i?void 0:i.success)&&(null==h?void 0:h.UUID)&&p((0,d.getPlatformAccess)(h.UUID)),[2,i];case 2:return y(!1),[7];case 3:return[2]}})})()},handleGetBillingCards:S,setBillingCards:m}}])},477482,e=>{"use strict";e.s(["default",0,function(e){var t=new Date,a=t.getFullYear(),n=t.getMonth()+1,r=parseInt(e.ExpiryYear,10),u=parseInt(e.ExpiryMonth,10);return!!(r<a)||r===a&&!!(u<n)}])},127875,e=>{"use strict";e.i(271645),e.i(101967);var t=e.i(611814);e.s(["default",0,function(e){var a=(0,t.useSelector)(function(e){return e.UserReducer.geolocation});return{paymentProviderLocation:["ng","ngn","paystack"].includes(null==e?void 0:e.toLowerCase())?"ng":["us","usd","stripe"].includes(null==e?void 0:e.toLowerCase())?"us":a}}])},469670,262123,e=>{"use strict";var t=e.i(991865),a=e.i(120786),n=e.i(92808),r=e.i(651682),u=e.i(296137),s=e.i(160966),c=e.i(271645),i=e.i(822539),l=e.i(856119),o=e.i(351735);let d=function(e,t){var a=String(e||"").toUpperCase();return"NGN"===a||"NG"===a?"â¦":"USD"===a||"US"===a?"$":"paystack"===String(t||"").toLowerCase()?"â¦":"$"};var p=e.i(9021),v=e.i(127875);e.i(101967);var h=e.i(571836),f=e.i(611814),g=e.i(618566);e.i(982285);var m=e.i(25258),U=e.i(274466),b=e.i(771467),y=e.i(420461),S=e.i(60470),_=e.i(477482),D=e.i(843476),w=e.i(138917),C=e.i(868127),k=(0,w.lazyIconSSR)(function(){return e.A(281130)}),I=(0,w.lazyIconSSR)(function(){return e.A(270048)}),P=function(e){var t=e.provider,a=e.color,n=void 0===a?"#a3a3a3":a;return({visa:(0,D.jsx)(C.SiVisa,{color:n,size:24}),verve:(0,D.jsx)(I,{width:24,height:24}),mastercard:(0,D.jsx)(k,{width:24,height:24})})[t]||(0,D.jsx)(C.SiVisa,{color:n,size:24})};e.s(["getCardIcon",0,P],262123),e.s(["default",0,function(){var e=(0,g.useRouter)(),D=(0,h.useDispatch)(),w=(0,g.usePathname)(),C=(0,g.useSearchParams)(),k=Object.fromEntries(C.entries()),I=k.type,R=k.cardUID,T=k.planUID,B=k.invoiceUID,L=k.reactivation,N=k.amount,A=k.amount_usd,W=k.currency,O=k.storage_gb,x=(0,f.useSelector)(function(e){return e.UserReducer.activeWorkspace}),Q=(0,f.useSelector)(function(e){return e.UserReducer.appData}),j=(0,f.useSelector)(function(e){return e.UserReducer.conversionRate}),E=(0,f.useSelector)(function(e){return e.UserReducer.plans}),M=(0,f.useSelector)(function(e){return e.UserReducer.workspacesBillingHistory}),Y=(0,i.default)(),F=Y.billingCards,G=Y.handleAddBillingCard,z=Y.setBillingCards,J=(0,l.default)(),H=J.novaUsageDebtData,V=J.activeWorkspacePlatformSub,$=(0,r._)((0,c.useState)({}),2),q=$[0],K=$[1],X=(0,r._)((0,c.useState)(!1),2),Z=X[0],ee=X[1],et=(0,r._)((0,c.useState)(!0),2),ea=et[0],en=et[1],er=(0,r._)((0,c.useState)(null),2),eu=er[0],es=er[1],ec=(0,r._)((0,c.useState)("teamTopUp"===I?5:100),2),ei=ec[0],el=ec[1],eo=(0,r._)((0,c.useState)({Amount:2e3}),2),ed=eo[0],ep=eo[1],ev=(null==E?void 0:E.find(function(e){return e.UID===T}))||{},eh=(0,c.useMemo)(function(){var e,t;return{invoiceMetaData:null==M?void 0:M[null==x?void 0:x.UUID],invoiceData:null==M||null==(t=M[null==x?void 0:x.UUID])||null==(e=t.data)?void 0:e.find(function(e){return e.UID===B})}},[M,null==x?void 0:x.UUID,B]),ef=eh.invoiceData,eg=eh.invoiceMetaData,em=(0,r._)((0,c.useState)(R?"card~".concat(R):(null==Q?void 0:Q.wallet_currency)==="NGN"?"paystack":"stripe"),2),eU=em[0],eb=em[1],ey=(0,r._)((0,c.useState)(!1),2),eS=ey[0],e_=ey[1];(0,c.useEffect)(function(){null==F||eS||(!R&&F.length>0&&eb("card~".concat(F[0].UID)),e_(!0))},[F,R,eS]);var eD=(null==F?void 0:F.length)>0?F.map(function(e){return(0,n._)((0,a._)({},e),{Title:"**** ".concat(e.Last4Digit),Value:"card~".concat(e.UID),Expired:(0,_.default)(e),Icon:P({provider:e.Provider,color:"visa"===e.CardType?"#1434CB":"#a3a3a3"})})}):[],ew=(0,c.useMemo)(function(){var e;return null==F||null==(e=F.find(function(e){return(null==e?void 0:e.UID
1)===(null==eU?void 0:eU.split("~")[1])}))?void 0:e.Provider},[F,eU]),eC=eU.includes("card")?ew:eU,ek=(0,v.default)(eC).paymentProviderLocation,eI=(0,o.default)(eC).handleSubscribeUser,eP=(0,c.useCallback)(function(){return(0,t._)(function(){var e,t;return(0,u._)(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,D((0,y.getDeploymentQuotaPrice)())];case 1:return e=r.sent(),[4,D((0,S.getTeamSeatQuotaPrice)())];case 2:return t=r.sent(),K(function(r){var u,s;return(0,n._)((0,a._)({},r),{deploymentQuota:(null==e||null==(u=e.data)?void 0:u.price)||0,teamQuota:(null==t||null==(s=t.data)?void 0:s.price)||0})}),[3,4];case 3:return r.sent(),[3,4];case 4:return[2]}})})()},[D]),eR=(0,c.useCallback)(function(){return(0,t._)(function(){return(0,u._)(this,function(e){switch(e.label){case 0:return[4,Promise.allSettled([D((0,m.fetchWorkspace)()),D((0,m.getUserActiveWorkspacePlans)()),D((0,m.getPlatformAccess)(null==x?void 0:x.UUID)),D((0,m.getOutstandingNovaUsageBilling)()),D((0,b.getAppData)())])];case 1:if(e.sent(),!(null==x?void 0:x.teamUUID))return[3,3];return[4,D((0,U.getWalletBalance)())];case 2:e.sent(),e.label=3;case 3:return[2]}})})()},[D,null==x?void 0:x.teamUUID,null==x?void 0:x.UUID]),eT=(0,c.useMemo)(function(){return d(null==Q?void 0:Q.wallet_currency,eC)},[null==Q?void 0:Q.wallet_currency,eC]),eB=q["teamTopUp"===I?"teamQuota":"deploymentQuota"],eL=Number(ei)*Number(eB),eN=(0,c.useMemo)(function(){if("registryStorageUpgrade"!==I)return 0;var e=Number(A),t=Number(N),a=String(W||"").toUpperCase(),n=Number(j)>0?Number(j):0,r=Number.isFinite(e)&&e>0?e:0;return(!r&&Number.isFinite(t)&&t>0&&(r="NGN"===a&&n>0?t/n:t),r)?"â¦"===eT&&n>0?r*n:r:0},[I,N,A,W,j,eT]),eA="registryStorageUpgrade"===I?eN:eL||(null==ev?void 0:ev.Price)||N,eW=(0,c.useMemo)(function(){return(null==Q?void 0:Q.wallet_credit_balance)>eA},[null==Q?void 0:Q.wallet_credit_balance,eA]),eO="paystack"===eU;return{loading:Z,setLoading:ee,quantity:ei,applyCredit:ea,handleAddCardProviderClick:function(e){return(0,t._)(function(){var t;return(0,u._)(this,function(a){switch(a.label){case 0:return a.trys.push([0,,2,3]),ee(e),[4,G((null==e?void 0:e.toLowerCase())==="paystack"?"ng":"us")];case 1:return(null==(t=a.sent())?void 0:t.success)&&(0,p.showSuccessToast)("Checkout url generated. Redirecting to ".concat(e," now ")),[3,3];case 2:return ee(!1),[7];case 3:return[2]}})})()},setQuantity:el,setApplyCredit:en,activePaymentCard:eu,setActivePaymentCard:es,topUp:ed,billingCards:F,isInitialPaymentProviderReady:eS,handleTopUp:function(){return(0,t._)(function(){var t,a,n,r,c,i;return(0,u._)(this,function(u){switch(u.label){case 0:t="teamTopUp"===I,a={Quantity:ei,workspace:null==x?void 0:x.UUID,CallBackURL:"".concat(s.PipeOpsDashboard_URL,"/dashboard/usage"),ApplyCreditBalance:ea},(null==eU?void 0:eU.includes("card"))&&(a.SelectedCard=null==eU?void 0:eU.split("~")[1]),u.label=1;case 1:return u.trys.push([1,,8,9]),ee(!0),[4,"teamTopUp"===I?D((0,S.altTeamSeatQuota)(ek,a,(null==eU?void 0:eU.includes("card"))?"card":"")):D((0,y.altDeploymentQuote)(ek,a,(null==eU?void 0:eU.includes("card"))?"card":""))];case 2:if(!(null==(n=u.sent())?void 0:n.success))return[3,7];if(c=1e3*(null!=eU&&!!eU.includes("card")),!(null==n||null==(r=n.data)?void 0:r.checkout_url))return[3,3];return(0,p.showSuccessToast)("Checkout url generated. Redirecting to ".concat(eU," now ")),e.push(null==n||null==(i=n.data)?void 0:i.checkout_url),[3,7];case 3:if(!(c>0))return[3,5];return[4,new Promise(function(e){return setTimeout(e,c)})];case 4:u.sent(),u.label=5;case 5:return[4,eR()];case 6:u.sent(),(0,p.showSuccessToast)("Successfully increased your ".concat(t?"team seat":"deployment"," quota")),e.replace(w),u.label=7;case 7:return[3,9];case 8:return ee(!1),[7];case 9:return[2]}})})()},handleRegistryStorageUpgrade:function(){return(0,t._)(function(){var t,a,n,r,c,i,l,o;return(0,u._)(this,function(u){switch(u.label){case 0:if(!(t=Number(O))||t<=0)return[2,(0,p.showWarningToast)("Select a storage plan first")];a=new URLSearchParams(C.toString()),["modal","type","storage_gb","amount","amount_usd","amount_local","currency","display_currency","cardUID","planUID","invoiceUID","reactivation","addNewCard"].forEach(function(e){return a.delete(e)}),(null==w?void 0:w.includes("/projects"))&&a.set("tab","registry"),r=(n=a.toString())?"".concat(w,"?").concat(n):w,c={storage_gb:t,CallBackURL:"".concat(s.PipeOpsDashboard_URL).concat(r),ApplyCreditBalance:ea},(null==eU?void 0:eU.includes("card"))&&(c.SelectedCard=null==eU?void 0:eU.split("~")[1]),u.label=1;case 1:return u.trys.push([1,,7,8]),ee(!0),[4,D((0,y.registryStorageUpgrade)(ek,c
1))];case 2:if(!(null==(i=u.sent())?void 0:i.success))return[3,6];if(o=1e3*(null!=eU&&!!eU.includes("card")),!(null==i||null==(l=i.data)?void 0:l.checkout_url))return[3,3];return(0,p.showSuccessToast)("Checkout url generated. Redirecting to payment provider now"),e.push(i.data.checkout_url),[3,6];case 3:if(!(o>0))return[3,5];return[4,new Promise(function(e){return setTimeout(e,o)})];case 4:u.sent(),u.label=5;case 5:(0,p.showSuccessToast)("Registry storage upgraded to ".concat(t," GB")),e.replace(r||"/dashboard/registry"),u.label=6;case 6:return[3,8];case 7:return ee(!1),[7];case 8:return[2]}})})()},type:I,storageGbParam:O,activeCardUID:R,activePlanUID:T,plan:ev,setTopUpAmount:ep,handlePayNovaUsage:function(){return(0,t._)(function(){var t,r,c,i;return(0,u._)(this,function(u){switch(u.label){case 0:t=(0,n._)((0,a._)({},eU.includes("card")?{SelectedCard:null==eU?void 0:eU.split("~")[1]}:{}),{BillingUid:null==H?void 0:H.UID,ApplyCreditBalance:ea,CallBackURL:"".concat(s.PipeOpsDashboard_URL).concat(w)}),ee(!0),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,D((0,m.payOffWorkspaceNovaUsage)(t,ek,(null==eU?void 0:eU.includes("card"))?"card":""))];case 2:return(null==(r=u.sent())?void 0:r.success)&&((null==r?void 0:r.checkout_url)||(null==r||null==(c=r.data)?void 0:c.checkout_url)?e.push((null==r?void 0:r.checkout_url)||(null==r||null==(i=r.data)?void 0:i.checkout_url)):e.back()),[3,4];case 3:return ee(!1),[7];case 4:return[2]}})})()},invoiceData:ef,handlePayForInvoice:function(){return(0,t._)(function(){var t,r,c,i,l;return(0,u._)(this,function(u){switch(u.label){case 0:t=(0,n._)((0,a._)({},eU.includes("card")?{SelectedCard:null==eU?void 0:eU.split("~")[1]}:{}),{InvoiceUUID:B,ApplyCreditBalance:ea,CallBackURL:"".concat(s.PipeOpsDashboard_URL).concat(w)}),u.label=1;case 1:return u.trys.push([1,,9,10]),ee(!0),[4,D((0,U.payPendingInvoice)(t))];case 2:if(!(null==(r=u.sent())?void 0:r.success))return[3,8];if(i=5e3*(null!=eU&&!!eU.includes("card")),!(null==r||null==(c=r.data)?void 0:c.checkout_url))return[3,3];return sessionStorage.setItem("refreshBillingHistory","true"),(0,p.showSuccessToast)("You will be redirected shortly to proceed with selected payment provider."),e.push(null==r||null==(l=r.data)?void 0:l.checkout_url),[3,8];case 3:if(!(null==r?void 0:r.success))return[3,8];if(!(i>0))return[3,5];return[4,new Promise(function(e){return setTimeout(e,i)})];case 4:u.sent(),u.label=5;case 5:return[4,D((0,U.getBillingHistory)(null==V?void 0:V.PlanUID,{page:(null==eg?void 0:eg.page)||1,pageSize:(null==eg?void 0:eg.pageSize)||10}))];case 6:return u.sent(),[4,eR()];case 7:u.sent(),(null==r?void 0:r.message)&&(0,p.showSuccessToast)(null==r?void 0:r.message),e.back(),u.label=8;case 8:return[3,10];case 9:return ee(!1),[7];case 10:return[2]}})})()},handleCancelSubWithUsageBill:function(){return(0,t._)(function(){var t,r,c,i;return(0,u._)(this,function(u){switch(u.label){case 0:if(t=JSON.parse(sessionStorage.getItem("cancelSubCloudUsageData")),r=function(){var e,a,n,r;return(!eW||!ea)&&("stripe"===eU?null==t||null==(a=t.payment_methods)||null==(e=a.find(function(e){return"usd"===e.currency.toLowerCase()}))?void 0:e.checkout_url:"paystack"===eU?null==t||null==(r=t.payment_methods)||null==(n=r.find(function(e){return"ngn"===e.currency.toLowerCase()}))?void 0:n.checkout_url:null)},c=(0,n._)((0,a._)({},eU.includes("card")?{SelectedCard:null==eU?void 0:eU.split("~")[1]}:{}),{ApplyCreditBalance:ea,PaymentId:null==t?void 0:t.payment_id,CallBackURL:"".concat(s.PipeOpsDashboard_URL).concat(w)}),r())return(0,p.showSuccessToast)("Redirecting to ".concat(eU)),e.push(r()),[2];ee(!0),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,D((0,m.cancelActiveWorkspaceSubscription)({payload:c,hasUsage:!0,paymentMethod:(null==eU?void 0:eU.includes("card"))?"card":""}))];case 2:return(null==(i=u.sent())?void 0:i.success)&&((0,p.showSuccessToast)(null==i?void 0:i.message),e.replace(w)),[3,4];case 3:return ee(!1),[7];case 4:return[2]}})})()},novaUsageDebtData:H,handlePlanSubscription:function(){return(0,t._)(function(){return(0,u._)(this,function(e){switch(e.label){case 0:return e.trys.push([0,,2,3]),ee(!0),[4,eI((0,a._)({applyCredit:ea},eU.includes("card")?{cardId:eU.split("~")[1]}:{},L?{plan:ev}:{}))];case 1:return e.sent(),[3,3];case 2:return ee(!1),[7];case 3:return[2]}})})()},totalQuotaCost:eL,paymentProvider:eU,modifiedBillingCardsData:eD,paymentProviderLocation:ek,paymentCurrency:eT,amountDue:eA,reactivation:L,setPaymentProvider:eb,isWalletBalanceSufficient:eW,specificQuotaPrice:eB,handleGetQuotaCost:eP,refreshUsageData:eR,handleTopUpWallet:function(){return(0,t._)(function(){var t,a,n,r;return(0,u._)(this,function(u){switch(u.label){case 0:if(isNaN(ed.Amount))return[3,8];if(eO&&1e3>Number(null==ed?void 0:ed.Amount))return[2,(0,p.showWarningToast)("You can only deposit a minimum of â¦1000")];if(10>Number(null==ed?void 0:ed.Amount))return[2,(0,p.showWarningToast)("You can only deposit a minimum of $10")];t={Amount:Number(ed.Amount),CallBackURL:w.includes("billing")?localStorage.getItem("topUpRedirectBackUrl"):"".concat(s.PipeOpsDashboard_URL).concat(w)},(null==eU?void 0:eU.includes("card"))&&(t.SelectedCard=null==eU?void 0:eU.split("~")[1]),u.label=1;case 1:return u.trys.push([1,,6,7]),ee(!0),[4,D((0,U.topUpWallet)(ek,t,(null==eU?void 0:eU.includes("card"))?"card":""))];case 2:if(!(null==(n=u.sent())||null==(a=n.data)?void 0:a.checkout_url))return[3,3];return(0,p.showSuccessToast)("You will be redirected shortly to proceed with selected payment provider."),e.push(null==n||null==(r=n.data)?void 0:r.checkout_url),[3,5];case 3:if(!(null==n?void 0:n.success))return[3,5];return[4,eR()];case 4:u.sent(),(0,p.showSuccessToast)("Successfully topped up wallet"),sessionStorage.removeItem("paymentRedirectData"),e.back(),u.label=5;case 5:return[3,7];case 6:return ee(!1),[7];case 7:return[3,9];case 8:(0,p.showWarningToast)("You have entered a wrong number"),u.label=9;case 9:return[2]}})})()},setBillingCards:z}}],469670)}]);
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.