import{a as _}from"./asyncComputed.25309626.js";import{d as b,eb as w,J as h,u as e,a as d,a5 as k,f as o,b as t,h as I,o as n,A as f,g as l,ed as C,bR as x,de as c,e as N}from"./jwt-decode.esm.7f2ef0df.js";import{l as g,c as v}from"./router.8fd5b2ad.js";import{a as z}from"./organization.a877b653.js";import"./tables.be1c51f8.js";import{L as B}from"./LoadingContainer.6e2b63e4.js";import"./index.9021ba5d.js";import"./record.4ffc477c.js";import"./string.2ed1cde3.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[s]="a8fbd888-dd64-498e-b6cf-683818bc356b",a._sentryDebugIdIdentifier="sentry-dbid-a8fbd888-dd64-498e-b6cf-683818bc356b")}catch{}})();const D={key:1},U=["src"],J=b({__name:"Billing",setup(a){const u=w().params.organizationId,{loading:m,result:r}=_(async()=>{const i=await z.get(u),p=await i.getUsageReportUrl();return{organization:i,reportUrl:p}});h(()=>{location.search.includes("upgrade")&&g.showNewMessage("I want to upgrade my plan")});const y=()=>g.showNewMessage("I want to upgrade my plan");return(i,p)=>e(m)?(n(),d(B,{key:0})):e(r)?(n(),k("div",D,[o(e(c),{justify:"space-between",align:"center"},{default:t(()=>[o(e(f),{level:3},{default:t(()=>[l("Current plan: "+C(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:t(()=>[l("Upgrade")]),_:1})]),_:1}),o(e(v),{style:{"margin-top":"0"}}),e(r).organization.hasUsageReport?(n(),d(e(c),{key:0,align:"center",justify:"center"},{default:t(()=>[N("iframe",{src:e(r).reportUrl,frameborder:"0",style:{width:"1000px",height:"1700px"}},null,8,U)]),_:1})):(n(),d(e(c),{key:1,align:"center",justify:"center"},{default:t(()=>[o(e(f),{level:4},{default:t(()=>[l("No usage report available")]),_:1})]),_:1}))])):I("",!0)}});export{J as default};
//# sourceMappingURL=Billing.461db3ef.js.map
