PageSourceSearch

https://modrinth.com/_nuxt/CY2uaPiw.js

js modrinth.com collected 2026-09-24 09:08:36 UTC 34,013 bytes, 1 lines download raw bytes

1import{d as fe,o,a as p,bl as Fe,b_ as ut,b as l,v as c,n as v,q as g,Q as S,ai as pt,c0 as Ae,u as Ne,cy as Ie,m as P,k as e,_ as $,c1 as Ue,j as r,a7 as oe,l as b,R as yt,U as de,bQ as Ye,bW as Ke,aW as mt,aU as gt,e as vt,aX as Te,aV as ft,b2 as K,c as N,fb as bt,w as ht,F as U,p as x,bc as _t,y as Le,b9 as re,ba as le,bn as xt,b6 as wt,bS as Mt,bw as O,a8 as kt,dn as $e,b$ as St,cp as Pt,aL as ve,aw as Ct,fc as It,de as Tt,H as Lt,J as $t,c2 as X,T as Rt,E as Bt,bV as Dt}from"./DvgxvNL0.js";import{a as qt,c as Et,_ as Ft,g as Re}from"./C2YHD9Vv.js";import{M as At}from"./CwfuRisP.js";import{_ as Nt}from"./BsTWhYdC.js";import{u as Ut}from"./CnZsaRAz.js";import{_ as Yt,S as Kt,i as Be}from"./DVu2goyA.js";import{_ as De}from"./Bg3NgDeQ.js";import{_ as qe}from"./BEQ0QmdP.js";import{_ as Ee}from"./CdqRIBwd.js";import{M as Ot}from"./C14nEj1e.js";import{N as jt}from"./BuVIxg8d.js";import{u as Vt,h as Gt}from"./B12ZWPOP.js";import{u as zt}from"./CNUV96Ln.js";import{u as Qt}from"./C0jx6QEY.js";import{b as Wt}from"./BYO7PYqm.js";import"./B0nhbelq.js";import"./DG1csYqL.js";import"./DQoYOIvj.js";import"./CAEf2ok7.js";import"./BT-X2sQH.js";import"./CWgfPVMP.js";import"./D4OQamVJ.js";import"./B1OzpWTP.js";import"./Dt8Hubkr.js";import"./BnYmAWDS.js";import"./DipdT6yZ.js";import"./DQSAL0As.js";const Ht={class:"min-h-[16rem] flex flex-col gap-2 justify-center items-center"},Xt=fe({__name:"AddPaymentMethod",props:{publishableKey:{},createSetupIntent:{type:Function},returnUrl:{},onError:{type:Function}},emits:["startLoading","stopLoading"],setup(Q,{expose:R,emit:T}){const w=Ae(),L=T,m=Q,B=S(0),D=S(),F=S(),q=S(!1);function a(C){m.onError(C),C.value=!0}async function M(C){try{B.value=0,q.value=!1;const h=await m.createSetupIntent(),{loadStripe:i}=await pt(async()=>{const{loadStripe:W}=await import("./BaaRmHWU.js");return{loadStripe:W}},[],import.meta.url);D.value=await i(m.publishableKey);const{elements:j,addressElement:V,paymentElement:I}=qt(D.value,C,{clientSecret:h.client_secret});F.value=j,I.on("ready",()=>{B.value+=1}),V.on("ready",()=>{B.value+=1})}catch(h){a(h)}}async function E(){L("startLoading");const C=await D.value.confirmSetup({elements:F.value,confirmParams:{return_url:m.returnUrl}});w(C);const{error:h}=C;if(L("stopLoading"),h&&h.type!=="validation_error")return a(h.message),!1;if(!h)return!0}return R({reload:M,submit:E}),(C,h)=>(o(),p("div",Ht,[Fe(l("div",null,[c(Ot,{error:q.value},{error:v(()=>[...h[0]||(h[0]=[g(" Error loading Stripe payment UI. ",-1)])]),default:v(()=>[h[1]||(h[1]=g(" Loading... ",-1))]),_:1},8,["error"])],512),[[ut,B.value<2]]),h[2]||(h[2]=l("div",{class:"w-full"},[l("div",{id:"address-element"}),l("div",{id:"payment-element",class:"mt-4"})],-1))]))}}),Jt={class:"text-lg font-extrabold text-contrast"},Zt={class:"w-[40rem] max-w-full"},ea={class:"input-group mt-auto pt-4"},ta=fe({__name:"AddPaymentMethodModal",props:{publishableKey:{},createSetupIntent:{type:Function},returnUrl:{},onError:{type:Function}},setup(Q,{expose:R}){const{formatMessage:T}=Ne(),w=Ie("modal"),L=Ie("addPaymentMethod"),m=Q,B=S(!1);async function D(q){w.value?.show(),await yt(),await L.value?.reload(q)}const F=de({addingPaymentMethod:{id:"modal.add-payment-method.title",defaultMessage:"Adding a payment method"},paymentMethodAdd:{id:"modal.add-payment-method.action",defaultMessage:"Add payment method"}});return R({show:D}),(q,a)=>(o(),P(e(jt),{ref_key:"modal",ref:w},{title:v(()=>[l("span",Jt,r(e(T)(e(F).addingPaymentMethod)),1)]),default:v(()=>[l("div",Zt,[c(Xt,{ref_key:"addPaymentMethod",ref:L,"publishable-key":m.publishableKey,"return-url":m.returnUrl,"create-setup-intent":m.createSetupIntent,"on-error":m.onError,onStartLoading:a[0]||(a[0]=M=>B.value=!0),onStopLoading:a[1]||(a[1]=M=>B.value=!1)},null,8,["publishable-key","return-url","create-setup-intent","on-error"]),l("div",ea,[c(e($),{type:"colored",color:"brand",disabled:B.value,onClick:a[2]||(a[2]=M=>L.value.submit())},{default:v(()=>[c(e(Ue)),g(" "+r(e(T)(e(F).paymentMethodAdd)),1)]),_:1},8,["disabled"]),c(e($),{onClick:a[3]||(a[3]=M=>w.value.hide())},{default:v(()=>[c(e(oe)),g(" "+r(e(T)(e(b).cancelButton)),1)]),_:1})])])]),_:1},512))}}),aa=fe({__name:"ServersUpgradeModalWrapper",setup(Q,{expose:R}){const T=Ke(),w=S(null);return R({open:L=>w.value?.open(L)}),(L,m)=>(o(),P(e(Nt),{ref_key:"wrapperRef",ref:w,"stripe-publishable-key":e(T).public.stripePublishableKey,"site-url":e(T).public.siteUrl,products:e(Ye)??[]},null,8,["stripe-publishable-key","site-url","products"]))}}),sa={class:"universal-card"},na={class:"universal-card recessed"},ia={class:"flex flex-wrap justify-between gap-4"},ra={class:"flex flex-col gap-4"},la={key:0},oa={key:1,class:"text-orange"},da={key:2},ca={key:3,class:"text-red"},ua={key:1},pa={class:"flex flex-col gap-2"},ya={class:"font-bold"},ma={class:"flex items-center gap-2"},ga={class:"flex items-center gap-2"},va={class:"flex items-center gap-2"},fa={class:"flex w-full flex-wrap justify-between gap-4 xl:w-auto xl:flex-col"},ba={class:"flex flex-col gap-1 xl:ml-auto xl:text-right"},ha={class:"text-2xl font-bold text-dark"},_a={key:0,class:"-mt-1 flex items-baseline gap-2 text-sm text-secondary"},xa={class:"opacity-70"},wa={class:"font-semibold text-contrast"},Ma={key:0,class:"text-sm text-purple"},ka={class:"text-sm text-secondary"},Sa={key:1,class:"text-sm text-secondary"},Pa={key:2,class:"text-sm text-secondary"},Ca={key:3,class:"text-sm text-secondary"},Ia={key:2,class:"text-sm text-secondary"},Ta={key:0,class:"ml-auto flex flex-row-reverse items-center gap-2"},La={key:1,class:"ml-auto flex gap-2"},$a={key:0},Ra={class:"flex flex-col justify-between gap-4"},Ba={class:"flex flex-col gap-4"},Da={class:"flex flex-col gap-6"},qa={key:1,class:"w-fit"},Ea={class:"flex w-full flex-col gap-2"},Fa={class:"flex flex-row justify-between"},Aa={class:"flex flex-col gap-2"},Na={class:"m-0 mb-1 text-xl font-semibold leading-none"},Ua={class:"flex items-center gap-2"},Ya={class:"flex items-center gap-2"},Ka={class:"flex items-center gap-2"},Oa={class:"flex items-center gap-2"},ja={class:"flex flex-col items-end justify-between"},Va={class:"flex flex-col items-end gap-2"},Ga={class:"m-0 flex text-lg font-semibold text-contrast"},za={class:"leading-none text-contrast"},Qa={key:0,class:"-mt-1 flex items-baseline gap-2 text-sm text-secondary"},Wa={class:"opacity-70"},Ha={class:"font-semibold text-contrast"},Xa={key:1,class:"text-sm text-secondary"},Ja={key:2,class:"mb-4 flex flex-col items-end"},Za={class:"text-sm text-secondary"},es={key:0,class:"text-sm text-secondary"},ts={key:1,class:"text-sm text-secondary"},as={key:2,class:"text-sm text-orange"},ss={key:3,class:"text-sm text-secondary"},ns={key:4,class:"text-sm text-red"},is={class:"flex gap-2"},rs={class:"universal-card"},ls={class:"header__row"},os={class:"header__title"},ds={class:"text-2xl"}
1,cs={key:1,class:"universal-card recessed !mb-0"},us={key:2,class:"flex flex-col gap-4"},ps={class:"flex gap-2"},ys={class:"flex flex-col"},ms={class:"flex items-center gap-2"},gs={class:"font-bold text-contrast"},vs={key:0,class:"border-r-ma rounded-full bg-button-bg px-2 py-0.5 text-sm font-bold text-secondary"},fs={key:0,class:"text-secondary"},bs={key:1,class:"text-secondary"},hs={key:2,class:"text-secondary"},_s=2e4,Qs={__name:"index",async setup(Q){let R,T;const{addNotification:w,handleError:L}=mt(),m=gt(),{getWorldDownload:B}=Vt(),D=Ae(),F=([R,T]=vt(()=>wt()),R=await R,T(),R);Te({script:[{src:"https://js.stripe.com/v3/",defer:!0,async:!0}]});const q=Ke(),{formatMessage:a}=Ne(),M=zt(),E=Qt({year:"numeric",month:"long",day:"numeric"}),C=de({title:{id:"settings.billing.modal.delete.title",defaultMessage:"Are you sure you want to remove this payment method?"},description:{id:"settings.billing.modal.delete.description",defaultMessage:"This will remove this payment method forever (like really forever)."},action:{id:"settings.billing.modal.delete.action",defaultMessage:"Remove this payment method"}}),h=de({title:{id:"settings.billing.modal.cancel.title",defaultMessage:"Are you sure you want to cancel your subscription?"},description:{id:"settings.billing.modal.cancel.description",defaultMessage:"This will cancel your subscription. You will retain your perks until the end of the current billing cycle."},action:{id:"settings.billing.modal.cancel.action",defaultMessage:"Cancel subscription"}}),i=de({subscriptionTitle:{id:"settings.billing.subscription.title",defaultMessage:"Subscriptions"},subscriptionDescription:{id:"settings.billing.subscription.description",defaultMessage:"Manage your Modrinth subscriptions."},paymentMethodTitle:{id:"settings.billing.payment_method.title",defaultMessage:"Payment methods"},paymentMethodNone:{id:"settings.billing.payment_method.none",defaultMessage:"You have not added any payment methods."},paymentMethodHistory:{id:"settings.billing.payment_method.action.history",defaultMessage:"View past charges"},paymentMethodAdd:{id:"settings.billing.payment_method.action.add",defaultMessage:"Add payment method"},paymentMethodPrimary:{id:"settings.billing.payment_method.primary",defaultMessage:"Primary"},paymentMethodMakePrimary:{id:"settings.billing.payment_method.action.primary",defaultMessage:"Make primary"},paymentMethodCardExpiry:{id:"settings.billing.payment_method.card_expiry",defaultMessage:"Expires {month}/{year}"},pyroSubscriptionTitle:{id:"settings.billing.pyro_subscription.title",defaultMessage:"Modrinth Server Subscriptions"},pyroSubscriptionDescription:{id:"settings.billing.pyro_subscription.description",defaultMessage:"Manage your Modrinth Server subscriptions."},intervalMonth:{id:"settings.billing.interval.month",defaultMessage:"month"},intervalYear:{id:"settings.billing.interval.year",defaultMessage:"year"},intervalQuarter:{id:"settings.billing.interval.quarter",defaultMessage:"quarter"},pricePerInterval:{id:"settings.billing.price.per-interval",defaultMessage:"{price} / {interval}"},includesTax:{id:"settings.billing.price.includes-tax",defaultMessage:"Includes {amount} tax"},nextLabel:{id:"settings.billing.next",defaultMessage:"Next:"},midasStatusOpen:{id:"settings.billing.midas.status.open",defaultMessage:"You're currently subscribed to:"},midasStatusProcessing:{id:"settings.billing.midas.status.processing",defaultMessage:"Your payment is being processed. Perks will activate once payment is complete."},midasStatusCancelledLine1:{id:"settings.billing.midas.status.cancelled.line1",defaultMessage:"You've cancelled your subscription."},midasStatusCancelledLine2:{id:"settings.billing.midas.status.cancelled.line2",defaultMessage:"You will retain your perks until the end of the current billing cycle."},midasStatusFailed:{id:"settings.billing.midas.status.failed",defaultMessage:"Your subscription payment failed. Please update your payment method."},midasUpsell:{id:"settings.billing.midas.upsell",defaultMessage:"Become a subscriber to Modrinth Plus!"}
1,midasBenefitsTitle:{id:"settings.billing.midas.benefits.title",defaultMessage:"Benefits"},midasBenefitAdFree:{id:"settings.billing.midas.benefits.ad-free",defaultMessage:"Ad-free browsing on modrinth.com and Modrinth App"},midasBenefitBadge:{id:"settings.billing.midas.benefits.badge",defaultMessage:"Modrinth+ badge on your profile"},midasBenefitSupport:{id:"settings.billing.midas.benefits.support",defaultMessage:"Support Modrinth and creators directly"},savePerYearBySwitchingToYearly:{id:"settings.billing.midas.save-per-year",defaultMessage:"Save {amount}/year by switching to yearly billing!"},sinceDate:{id:"settings.billing.since",defaultMessage:"Since {date}"},renewsDate:{id:"settings.billing.renews",defaultMessage:"Renews {date}"},expiresDate:{id:"settings.billing.expires",defaultMessage:"Expires {date}"},switchesToBillingOn:{id:"settings.billing.switches-to-billing-on",defaultMessage:"Switches to {interval, select, monthly {monthly} yearly {yearly} other {{interval}}} billing on {date}"},orYearlySave:{id:"settings.billing.or-yearly-save",defaultMessage:"Or {price} / year (save {percent}%)!"},updateMethod:{id:"settings.billing.update-method",defaultMessage:"Update method"},switchToInterval:{id:"settings.billing.switch.to-interval",defaultMessage:"Switch to {interval, select, monthly {monthly} yearly {yearly} other {{interval}}}"},switchingToInterval:{id:"settings.billing.switch.switching-to-interval",defaultMessage:"Switching to {interval, select, monthly {monthly} yearly {yearly} other {{interval}}}"},monthlyBillingAdditionalPerYearTooltip:{id:"settings.billing.switch.tooltip.monthly-additional-per-year",defaultMessage:"Monthly billing will cost you an additional {amount} per year"},resubscribe:{id:"settings.billing.resubscribe",defaultMessage:"Resubscribe"},subscribe:{id:"settings.billing.subscribe",defaultMessage:"Subscribe"},upgrade:{id:"settings.billing.upgrade",defaultMessage:"Upgrade"},pyroLinkedServerNotFound:{id:"settings.billing.pyro.linked-server.not-found",defaultMessage:"A linked server couldn't be found for this subscription. There are a few possible explanations for this. If you just purchased your server, this is normal. It could take up to an hour for your server to be provisioned. Otherwise, if you purchased this server a while ago, it has likely since been suspended. If this is not what you were expecting, please contact Modrinth Support with the following information:"},pyroServerIdLabel:{id:"settings.billing.pyro.linked-server.server-id",defaultMessage:"Server ID: {id}"},pyroStripeIdLabel:{id:"settings.billing.pyro.linked-server.stripe-id",defaultMessage:"Stripe ID: {id}"},planTitle:{id:"settings.billing.plan.title",defaultMessage:"{size} Plan"},pyroCpuLine:{id:"settings.billing.pyro.cpu",defaultMessage:"{shared} Shared CPUs (Bursts up to {bursts} CPUs)"},pyroRamLine:{id:"settings.billing.pyro.ram",defaultMessage:"{gb} GB RAM"},pyroSwapLine:{id:"settings.billing.pyro.swap",defaultMessage:"{gb} GB Swap"},pyroStorageLine:{id:"settings.billing.pyro.storage",defaultMessage:"{gb} GB SSD"},pyroStatusProcessing:{id:"settings.billing.pyro.status.processing",defaultMessage:"Your payment is being processed. Your server will activate once payment is complete."},pyroStatusFailed:{id:"settings.billing.pyro.status.failed",defaultMessage:"Your subscription payment failed. Please update your payment method, then resubscribe."},pyroResubscribeRequestSubmittedTitle:{id:"settings.billing.pyro.resubscribe.request-submitted.title",defaultMessage:"Resubscription request submitted"},pyroResubscribeRequestSubmittedText:{id:"settings.billing.pyro.resubscribe.request-submitted.text",defaultMessage:"If the server is currently cancelled, it may take 10-15 minutes to set up the server."},pyroResubscribeSuccessText:{id:"settings.billing.pyro.resubscribe.success.text",defaultMessage:"Server subscription resubscribed successfully"},pyroResubscribeErrorTitle:{id:"settings.billing.pyro.resubscribe.error.title",defaultMessage:"Error resubscribing"},pyroResubscribeErrorText:{id:"settings.billing.pyro.resubscribe.error.text",defaultMessage:"An error occurred while resubscribing to your Modrinth server."}});function j(t){return a(t==="yearly"?i.intervalYear:t==="quarterly"?i.intervalQuarter:i.intervalMonth)}const V=ft(),{data:I}=K({queryKey:["billing","payment_methods"],queryFn:()=>m.labrinth.billing_internal.getPaymentMethods()}),{data:W}=K({queryKey:["billing","payments"],queryFn:()=>m.labrinth.billing_internal.getPayments()}),{data:J}=K({queryKey:["billing","customer"],queryFn:()=>m.labrinth.billing_internal.getCustomer()}),{data:be}=K({queryKey:["billing","subscriptions"],queryFn:()=>m.labrinth.billing_internal.getSubscriptions()}),{data:Z}=K({queryKey:["billing","products"],queryFn:()=>m.labrinth.billing_internal.getProducts()}),{data:Oe}=K({queryKey:["servers"],queryFn:()=>m.archon.servers_v0.list()}),{data:ce}=K({queryKey:["servers","v1"],queryFn:()=>m.archon.servers_v1.list()}),H=S(Ye.find(t=>t.metadata?.type==="midas")),_=N(()=>be.value?.find(t=>t.status==="provisioned"&&H.value?.prices?.find(n=>n.id===t.price_id))),he=N(()=>_.value?H.value?.prices?.find(t=>
1t.id===_.value.price_id):null),u=N(()=>_.value?W.value?.find(t=>t.subscription_id===_.value.id):null),ue=N(()=>_.value?H.value?.prices?.find(t=>t.id===_.value.price_id)?.prices?.intervals?.[ee.value]:void 0),pe=N(()=>{const t=be.value?.filter(d=>d?.metadata?.type==="pyro")||[],n=Oe.value?.servers||[];return t.map(d=>{const s=n.find(A=>A.server_id===d.metadata.id),k=y(d);return{...d,serverInfo:{...s,isProvisioning:d.status==="unprovisioned"&&(k?.status==="processing"||k?.status==="open")}}}).filter(d=>{if(d.serverInfo?.status!=="suspended"||d.serverInfo?.suspension_reason!=="cancelled")return!0;const s=Se(d);return!s||!ce.value?!0:Be(s)||Gt(d.serverInfo.server_id,ce.value)})}),je=S(),_e=S(),ye=Ut(),G=N(()=>H.value?.prices?.find(t=>t.currency_code===Re(ye.value))),xe=N(()=>J.value?.invoice_settings?.default_payment_method?J.value.invoice_settings.default_payment_method:I.value?.[0]?.id?I.value[0].id:null),we=S();function Ve(){we.value.show(I.value)}async function Ge(){return await m.labrinth.billing_internal.addPaymentMethodFlow()}const Me=S(),z=S(!1),ee=N(()=>u.value?.subscription_interval==="yearly"?"monthly":"yearly");async function ze(t){z.value=!0,re();try{await m.labrinth.billing_internal.editSubscription(_.value.id,{interval:t}),await ne()}catch(n){console.error("Error switching Modrinth+ payment interval:",n)}le(),z.value=!1}async function Qe(t,n){re();try{await m.labrinth.billing_internal.editPaymentMethod(I.value[t].id,{primary:n}),await ne()}catch(d){w({title:a(b.errorNotificationTitle),text:d.data?d.data.description:d,type:"error"})}le()}async function We(t){re();try{await m.labrinth.billing_internal.removePaymentMethod(I.value[t].id),await ne()}catch(n){w({title:a(b.errorNotificationTitle),text:n.data?n.data.description:n,type:"error"})}le()}const me=S(null);async function te(t,n){re();try{await m.labrinth.billing_internal.editSubscription(t,{cancelled:n}),await ne()}catch(d){w({title:a(b.errorNotificationTitle),text:d.data?d.data.description:d,type:"error"})}le()}const f=t=>!t||!Z.value?null:Z.value.find(n=>n.prices?.some(d=>d.id===t.price_id)),He=t=>!t||!Z.value?null:Z.value.find(n=>n.prices?.some(d=>d.id===t));function y(t){return!t||!W.value?null:W.value.find(n=>n.subscription_id===t.id&&n.status!=="succeeded")}function ke(t){const n=y(t);return n?.status==="open"&&(n.price_id&&n.price_id!==t.price_id||n.subscription_interval&&n.subscription_interval!==t.interval)}function Xe(t){const d=se(f(t),t.interval)?.prices?.intervals?.[t.interval];return d==null?d:d+(ke(t)?0:t.next_charge_tax_amount??0)}function ge(t){return y(t)?.currency_code??se(f(t),t.interval)?.currency_code}function Je(t){const n=y(t);return n?n.amount+(t.next_charge_tax_amount??0):0}function Se(t){const n=y(t);return n&&n.status==="cancelled"?n.due:null}function Ze(t){const n=y(t);return n?n.status==="failed"?!0:n.status==="cancelled"&&Be(n.due):!1}const ae=t=>{if(!t||!t.metadata)return a(b.planUnknownLabel);const n=t.metadata.ram;return a(n===4096?b.planSmallLabel:n===6144?b.planMediumLabel:n===8192?b.planLargeLabel:b.planCustomLabel)},se=(t,n)=>{if(!t||!t.prices)return null;const d=ye.value;return t.prices.find(s=>s.currency_code===Re(d)&&s.prices?.intervals?.[n])??t.prices.find(s=>s.currency_code==="USD"&&s.prices?.intervals?.[n])??t.prices[0]},et=(t,n)=>{const d=t?.metadata?.ram??0;return(n?.metadata?.ram??0)<d?"downgrade":"upgrade"},tt=S(null),Pe=S(null),at=t=>{Pe.value?.open(t?.metadata?.id)},st=N(()=>pe.value?.some(t=>t.serverInfo?.isProvisioning)),{pause:nt,resume:it}=bt(()=>{V.invalidateQueries({queryKey:["billing","payments"]}),V.invalidateQueries({queryKey:["billing","subscriptions"]})},_s,{immediate:!1});ht(st,t=>{t?it():nt()},{immediate:!0});const rt=async(t,n)=>{try{await m.labrinth.billing_internal.editSubscription(t,{cancelled:!1}),w(n?{title:a(i.pyroResubscribeRequestSubmittedTitle),text:a(i.pyroResubscribeRequestSubmittedText),type:"success"}:{title:a(b.successLabel),text:a(i.pyroResubscribeSuccessText),type:"success"})}catch{w({title:a(i.pyroResubscribeErrorTitle),text:a(i.pyroResubscribeErrorText),type:"error"})}};function lt(t){const n=y(t),d=f(t),s=n?.subscription_interval||t?.interval,k=se(d,s);_e.value?.show({subscriptionId:t?.id??"",wasSuspended:n?.due?new Date(n.due).getTime()<Date.now():!1,serverName:t?.serverInfo?.name??"this server",planName:`${ae(d)} plan`,ramGb:d?.metadata?.ram?d.metadata.ram/1024:void 0,storageGb:d?.metadata?.storage?d.metadata.storage/1024:void 0,sharedCpus:d?.metadata?.cpu?d.metadata.cpu/2:void 0,priceCents:n?.amount??k?.prices?.intervals?.[s],currencyCode:n?.currency_code??k?.currency_code,interval:s,nextChargeDate:n?.due})}function ot({subscriptionId:t,wasSuspended:n}){return rt(t,n)}const ne=async()=>{await Promise.all([V.invalidateQueries({queryKey:["billing"]}),V.invalidateQueries({queryKey:["servers"]}
1)])};function dt(t){if(!t){console.warn("No survey notice to open");return}const n=f(t),d=n?.prices?.find(Y=>Y.id===t.price_id),s=d?.prices?.intervals?.[t.interval],k=d?.currency_code,A={layout:"modal",width:700,autoClose:2e3,hideTitle:!0,hiddenFields:{username:F.value?.user?.username,user_id:F.value?.user?.id,user_email:F.value?.user?.email,subscription_id:t.id,price_id:t.price_id,interval:t.interval,started:t.created,plan_ram:n?.metadata.ram/1024,plan_cpu:n?.metadata.cpu,price:s?`${s/100}`:"unknown",currency:k??"unknown"},onOpen:()=>D(`Opened cancellation survey for: ${t.id}`),onClose:()=>D(`Closed cancellation survey for: ${t.id}`),onSubmit:Y=>{D("Form submitted, cancelling server.",Y),te(t.id,!0)}},ie="mOr7lM";try{window.Tally?.openPopup?(D(`Opening Tally popup for servers subscription ${t.id} (form ID: ${ie})`),window.Tally.openPopup(ie,A)):(console.warn("Tally script not yet loaded"),te(t.id,!0))}catch(Y){console.error("Error opening Tally popup:",Y)}}Te({script:[{src:"https://tally.so/widgets/embed.js",defer:!0}]});const ct=t=>{const n=y(t);if(!n||n.status!=="open")return null;const d=He(n.price_id);if(!d||n.price_id===t.price_id)return n.subscription_interval&&n.subscription_interval!==t.interval?{planSize:ae(f(t)),cpu:f(t)?.metadata?.cpu/2,cpuBurst:f(t)?.metadata?.cpu,ramGb:(f(t)?.metadata?.ram||0)/1024,swapGb:(f(t)?.metadata?.swap||0)/1024||void 0,storageGb:(f(t)?.metadata?.storage||0)/1024||void 0,date:n.due,intervalChange:n.subscription_interval,verb:"Switches"}:null;const s=f(t),k=et(s,d),A=d?.metadata?.cpu??0,ie=d?.metadata?.ram??0,Y=d?.metadata?.swap??0,Ce=d?.metadata?.storage??0;return{planSize:ae(d),cpu:A/2,cpuBurst:A,ramGb:ie/1024,swapGb:Y?Y/1024:void 0,storageGb:Ce?Ce/1024:void 0,date:n.due,intervalChange:n.subscription_interval&&n.subscription_interval!==t.interval?n.subscription_interval:null,verb:k}};return(t,n)=>{const d=xt("tooltip");return o(),p(U,null,[c(aa,{ref_key:"upgradeModal",ref:Pe},null,512),c(e(Yt),{ref_key:"pyroResubscribeModal",ref:_e,onResubscribe:ot},null,512),l("section",sa,[l("h2",null,r(e(a)(e(i).subscriptionTitle)),1),l("p",null,r(e(a)(e(i).subscriptionDescription)),1),l("div",na,[c(e(De),{ref_key:"modalCancel",ref:tt,title:e(a)(e(h).title),description:e(a
1)(e(h).description),"proceed-label":e(a)(e(h).action),onProceed:n[0]||(n[0]=s=>te(me.value,!0))},null,8,["title","description","proceed-label"]),l("div",ia,[l("div",ra,[u.value?(o(),p(U,{key:0},[u.value.status==="open"?(o(),p("span",la,r(e(a)(e(i).midasStatusOpen)),1)):u.value.status==="processing"?(o(),p("span",oa,r(e(a)(e(i).midasStatusProcessing)),1)):u.value.status==="cancelled"?(o(),p("span",da,[g(r(e(a)(e(i).midasStatusCancelledLine1))+" ",1),n[7]||(n[7]=l("br",null,null,-1)),g(" "+r(e(a)(e(i).midasStatusCancelledLine2)),1)])):u.value.status==="failed"?(o(),p("span",ca,r(e(a)(e(i).midasStatusFailed)),1)):x("",!0)],64)):(o(),p("span",ua,r(e(a)(e(i).midasUpsell)),1)),c(e(Mt),{class:"h-8 w-min"}),l("div",pa,[l("span",ya,r(e(a)(e(i).midasBenefitsTitle)),1),l("div",ma,[c(e(O),{class:"h-5 w-5 shrink-0 text-brand"}),l("span",null,r(e(a)(e(i).midasBenefitAdFree)),1)]),l("div",ga,[c(e(O),{class:"h-5 w-5 shrink-0 text-brand"}),l("span",null,r(e(a)(e(i).midasBenefitBadge)),1)]),l("div",va,[c(e(O),{class:"h-5 w-5 shrink-0 text-brand"}),l("span",null,r(e(a)(e(i).midasBenefitSupport)),1)])])]),l("div",fa,[l("div",ba,[l("span",ha,[u.value?(o(),p(U,{key:0},[g(r(e(a)(e(i).pricePerInterval,{price:e(M)(he.value.prices.intervals[_.value.interval],he.value.currency_code),interval:j(_.value.interval)})),1)],64)):(o(),p(U,{key:1},[g(r(e(a)(e(i).pricePerInterval,{price:e(M)(G.value.prices.intervals.monthly,G.value.currency_code),interval:e(a)(e(i).intervalMonth)})),1)],64))]),u.value&&u.value.status==="open"&&_.value&&_.value.interval&&u.value.subscription_interval!==_.value.interval?(o(),p("div",_a,[l("span",xa,r(e(a)(e(i).nextLabel)),1),l("span",wa,r(e(a)(e(i).pricePerInterval,{price:e(M)(u.value.amount,u.value.currency_code),interval:j(u.value.subscription_interval)})),1)])):x("",!0),u.value?(o(),p(U,{key:1},[u.value.status==="open"&&u.value.subscription_interval==="monthly"&&ue.value!=null?(o(),p("span",Ma,r(e(a)(e(i).savePerYearBySwitchingToYearly,{amount:e(M)(u.value.amount*12-ue.value,u.value.currency_code)})),1)):x("",!0),l("span",ka,r(e(a)(e(i).sinceDate,{date:e(E)(_.value.created)})),1),u.value.status==="open"?(o(),p("span",Sa,r(e(a)(e(i).renewsDate,{date:e(E)(u.value.due)})),1)):u.value.status==="cancelled"?(o(),p("span",Pa,r(e(a)(e(i).expiresDate,{date:e(E)(u.value.due)})),1)):x("",!0),u.value.status==="open"&&_.value&&_.value.interval&&u.value.subscription_interval!==_.value.interval?(o(),p("span",Ca,r(e(a)(e(i).switchesToBillingOn,{interval:u.value.subscription_interval,date:e(E)(u.value.due)})),1)):x("",!0)],64)):(o(),p("span",Ia,r(e(a)(e(i).orYearlySave,{price:e(M)(G.value.prices.intervals.yearly,G.value.currency_code),percent:e(Et)(G.value.prices.intervals.monthly,G.value.prices.intervals.yearly)})),1))]),u.value&&u.value.status==="failed"?(o(),p("div",Ta,[u.value&&u.value.status==="failed"?(o(),P(e($),{key:0,onClick:n[1]||(n[1]=()=>{t.$refs.midasPurchaseModal.show()})},{default:v(()=>[c(e(kt)),g(" "+r(e(a)(e(i).updateMethod)),1)]),_:1})):x("",!0),c(e(qe),{type:"quiet",label:e(a)(e(b).moreOptionsButton),options:[{id:"cancel",label:e(a)(e(b).cancelButton),action:()=>{me.value=_.value.id,t.$refs.modalCancel.show()}}]},{cancel:v(()=>[c(e(oe)),g(" "+r(e(a)(e(b).cancelButton)),1)]),default:v(()=>[c(e($e))]),_:1},8,["label","options"])])):u.value&&u.value.status!=="cancelled"?(o(),p("div",La,[c(e($),{disabled:z.value,onClick:n[2]||(n[2]=()=>{me.value=_.value.id,t.$refs.modalCancel.show()})},{default:v(()=>[c(e(oe)),g(" "+r(e(a)(e(b).cancelButton)),1)]),_:1},8,["disabled"]),Fe((o(),P(e($),{type:"quiet",color:u.value.subscription_interval==="yearly"?void 0:"purple",disabled:z.value,style:_t({"--legacy-button-color":(u.value.subscription_interval==="yearly"||!0)&&(u.value.subscription_interval==="yearly"?"standard":"purple")!="standard"?`var(--color-${u.value.subscription_interval==="yearly"?"standard":"purple"})`:void 0}),class:"!text-[var(--legacy-button-color,var(--color-base))] [&>svg]:!text-[var(--legacy-button-color,var(--color-primary))]",onClick:n[3]||(n[3]=s=>ze(ee.value))},{default:v(()=>[z.value?(o(),P(e(St),{key:0,class:"animate-spin"})):(o(),P(e(Pt),{key:1})),g(" "+r(z.value?e(a)(e(i).switchingToInterval,{interval:ee.value}):e(a)(e(i).switchToInterval,{interval:ee.value})),1)]),_:1},8,["color","disabled","style"])),[[d,u.value.subscription_interval==="yearly"?e(a)(e(i).monthlyBillingAdditionalPerYearTooltip,{amount:e(M)(ue.value*12-u.value.amount,u.value.currency_code)}):void 0]])])):u.value&&u.value.status==="cancelled"?(o(),P(e($),{key:2,type:"colored",color:"purple",size:"xl",class:"ml-auto",onClick:n[4]||(n[4]=s=>
1te(_.value.id,!1))},{default:v(()=>[g(r(e(a)(e(i).resubscribe))+" ",1),c(e(ve))]),_:1})):(o(),P(e($),{key:3,type:"colored",color:"purple",size:"xl",class:"ml-auto",onClick:n[5]||(n[5]=()=>{t.$refs.midasPurchaseModal.show()})},{default:v(()=>[g(r(e(a)(e(i).subscribe))+" ",1),c(e(ve))]),_:1}))])])]),pe.value.length>0?(o(),p("div",$a,[(o(!0),p(U,null,Le(pe.value,(s,k)=>(o(),p("div",{key:k,class:"universal-card recessed mt-4"},[l("div",Ra,[l("div",Ba,[c(At,{class:"flex h-8 w-fit"}),l("div",Da,[s.serverInfo?(o(),P(e(Kt),Ct({key:0,ref_for:!0},s.serverInfo,{"pending-change":ct(s),"cancellation-date":Se(s),"on-download-world":e(B)(s.serverInfo.server_id,e(ce))}),null,16,["pending-change","cancellation-date","on-download-world"])):(o(),p("div",qa,[l("p",null,r(e(a)(e(i).pyroLinkedServerNotFound)),1),l("div",Ea,[c(e(Ee),{class:"whitespace-nowrap",text:e(a)(e(i).pyroServerIdLabel,{id:s.metadata.id})},null,8,["text"]),c(e(Ee),{class:"whitespace-nowrap",text:e(a)(e(i).pyroStripeIdLabel,{id:s.id})},null,8,["text"])])])),l("div",Fa,[l("div",Aa,[l("h3",Na,r(e(a)(e(i).planTitle,{size:ae(f(s))})),1),l("div",Ua,[c(e(O),{class:"h-5 w-5 text-brand"}),l("span",null,r(e(a)(e(i).pyroCpuLine,{shared:f(s)?.metadata?.cpu/2,bursts:f(s)?.metadata?.cpu})),1)]),l("div",Ya,[c(e(O),{class:"h-5 w-5 text-brand"}),l("span",null,r(f(s)?.metadata?.ram?e(a)(e(i).pyroRamLine,{gb:f(s).metadata.ram/1024}):""),1)]),l("div",Ka,[c(e(O),{class:"h-5 w-5 text-brand"}),l("span",null,r(f(s)?.metadata?.swap?e(a)(e(i).pyroSwapLine,{gb:f(s).metadata.swap/1024}):""),1)]),l("div",Oa,[c(e(O),{class:"h-5 w-5 text-brand"}),l("span",null,r(f(s)?.metadata?.storage?e(a)(e(i).pyroStorageLine,{gb:f(s).metadata.storage/1024}):""),1)])]),l("div",ja,[l("div",Va,[l("h3",Ga,[l("span",za,r(se(f(s),s.interval)?e(a)(e(i).pricePerInterval,{price:e(M)(Xe(s),ge(s)),interval:j(s.interval)}):""),1)]),ke(s)?(o(),p("div",Qa,[l("span",Wa,r(e(a)(e(i).nextLabel)),1),l("span",Ha,r(e(a)(e(i).pricePerInterval,{price:e(M)(Je(s),ge(s)),interval:j(y(s).subscription_interval||s.interval)})),1)])):x("",!0),s.next_charge_tax_amount!=null?(o(),p("span",Xa,r(e(a)(e(i).includesTax,{amount:e(M)(s.next_charge_tax_amount,ge(s))})),1)):x("",!0),y(s)?(o(),p("div",Ja,[l("span",Za,r(e(a)(e(i).sinceDate,{date:e(E)(s.created)})),1),y(s).status==="open"?(o(),p("span",es,r(e(a)(e(i).renewsDate,{date:e(E)(y(s).due)})),1)):x("",!0),y(s).status==="open"&&y(s).subscription_interval&&y(s).subscription_interval!==s.interval?(o(),p("span",ts,r(e(a)(e(i).switchesToBillingOn,{interval:y(s).subscription_interval,date:e(E)(y(s).due)})),1)):y(s).status==="processing"?(o(),p("span",as,r(e(a)(e(i).pyroStatusProcessing)),1)):y(s).status==="cancelled"?(o(),p("span",ss,r(e(a)(e(i).expiresDate,{date:e(E)(y(s).due)})),1)):y(s).status==="failed"?(o(),p("span",ns,r(e(a)(e(i).pyroStatusFailed)),1)):x("",!0)])):x("",!0)]),l("div",is,[y(s)&&y(s).status!=="cancelled"?(o(),P(e($),{key:0,onClick:A=>dt(s)},{default:v(()=>[c(e(oe)),g(" "+r(e(a)(e(b).cancelButton)),1)]),_:1},8,["onClick"])):x("",!0),y(s)&&y(s).status!=="cancelled"&&y(s).status!=="failed"?(o(),P(e($),{key:1,type:"quiet",color:"green",class:"!text-green [&>svg]:!text-green",onClick:A=>at(s)},{default:v(()=>[c(e(It)),g(" "+r(e(a)(e(i).upgrade)),1)]),_:1},8,["onClick"])):Ze(s)?(o(),P(e($),{key:2,type:"colored",color:"green",size:"xl",onClick:A=>lt(s)},{default:v(()=>[g(r(e(a)(e(i).resubscribe))+" ",1),c(e(ve))]),_:1},8,["onClick"])):x("",!0)])])])])])])]))),128))])):x("",!0)]),l("section",rs,[c(e(De),{ref:"modal_confirm",title:e(a)(e(C).title),description:e(a
1)(e(C).description),"proceed-label":e(a)(e(C).action),onProceed:n[6]||(n[6]=s=>We(Me.value))},null,8,["title","description","proceed-label"]),e(J)&&e(I)?(o(),P(e(Ft),{key:0,ref_key:"midasPurchaseModal",ref:je,product:H.value,country:e(ye),"publishable-key":e(q).public.stripePublishableKey,"send-billing-request":async s=>await e(m).labrinth.billing_internal.initiatePayment(s),"on-error":s=>e(w)({title:e(a)(e(b).errorNotificationTitle),type:"error",text:s.message??(s.data?s.data.description:s)}),customer:e(J),"payment-methods":e(I),"return-url":`${e(q).public.siteUrl}/settings/billing`},null,8,["product","country","publishable-key","send-billing-request","on-error","customer","payment-methods","return-url"])):x("",!0),c(e(ta),{ref_key:"addPaymentMethodModal",ref:we,"publishable-key":e(q).public.stripePublishableKey,"return-url":`${e(q).public.siteUrl}/settings/billing`,"create-setup-intent":Ge,"on-error":e(L)},null,8,["publishable-key","return-url","on-error"]),l("div",ls,[l("div",os,[l("h2",ds,r(e(a)(e(i).paymentMethodTitle)),1)]),c(e(Lt),{to:"/settings/billing/charges"},{default:v(()=>[c(e(Tt)),g(" "+r(e(a)(e(i).paymentMethodHistory)),1)]),_:1}),c(e($),{onClick:Ve},{default:v(()=>[c(e(Ue)),g(" "+r(e(a)(e(i).paymentMethodAdd)),1)]),_:1})]),!e(I)||e(I).length===0?(o(),p("div",cs,r(e(a)(e(i).paymentMethodNone)),1)):(o(),p("div",us,[(o(!0),p(U,null,Le(e(I),(s,k)=>(o(),p("div",{key:k,class:"universal-card recessed !mb-0 flex items-center justify-between"},[l("div",ps,[(o(),P($t(e(Wt)(s.type)),{class:"h-8 w-8"})),l("div",ys,[l("div",ms,[l("div",gs,[s.type==="card"?(o(),p(U,{key:0},[g(r(e(a)(e(X).paymentMethodCardDisplay,{card_brand:e(a)(e(X)[s.card.brand])??e(a)(e(X).unknown),last_four:s.card.last4})),1)],64)):(o(),p(U,{key:1},[g(r(e(a)(e(X)[s.type])??e(a)(e(X).unknown)),1)],64))]),xe.value===s.id?(o(),p("div",vs,r(e(a)(e(i).paymentMethodPrimary)),1)):x("",!0)]),s.type==="card"?(o(),p("div",fs,r(e(a)(e(i).paymentMethodCardExpiry,{month:s.card.exp_month,year:s.card.exp_year})),1)):s.type==="cashapp"?(o(),p("div",bs,r(s.cashapp.cashtag),1)):s.type==="paypal"?(o(),p("div",hs,r(s.paypal.payer_email),1)):x("",!0)])]),c(e(qe),{type:"quiet",label:e(a)(e(b).moreOptionsButton),class:"btn-dropdown-animation !w-10",options:[{id:"primary",label:e(a)(e(i).paymentMethodMakePrimary),action:()=>Qe(k,!0)},{id:"remove",label:e(a)(e(b).deleteLabel),action:()=>{Me.value=k,t.$refs.modal_confirm.show()},tone:"red"}].slice(xe.value===s.id?1:0,2)},{primary:v(()=>[c(e(Dt)),g(" "+r(e(a)(e(i).paymentMethodMakePrimary)),1)]),edit:v(()=>[c(e(Bt)),g(" "+r(e(a)(e(b).editButton)),1)]),remove:v(()=>[c(e(Rt)),g(" "+r(e(a)(e(b).deleteLabel)),1)]),default:v(()=>[c(e($e))]),_:1},8,["label","options"])]))),128))]))])],64)}}};export{Qs 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.