import{a as _}from"./asyncComputed.1713f27a.js";import{d as w,ea as b,k as h,u as e,a as l,a5 as k,f as o,b as a,h as I,o as n,A as f,g as d,ec as C,bR as x,de as c,e as N}from"./jwt-decode.esm.d9ea36e7.js";import{l as g,c as v}from"./router.c145c879.js";import{a as z}from"./organization.19e83fd9.js";import"./tables.9252b559.js";import{L as B}from"./LoadingContainer.b49df39c.js";import"./index.b64d16c3.js";import"./record.1ddc779b.js";import"./string.9882ea16.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="394f9505-9ac4-451e-9570-3a6b3ef86ea2",t._sentryDebugIdIdentifier="sentry-dbid-394f9505-9ac4-451e-9570-3a6b3ef86ea2")}catch{}})();const D={key:1},U=["src"],O=w({__name:"Billing",setup(t){const u=b().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(),l(B,{key:0})):e(r)?(n(),k("div",D,[o(e(c),{justify:"space-between",align:"center"},{default:a(()=>[o(e(f),{level:3},{default:a(()=>[d("Current plan: "+C(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:a(()=>[d("Upgrade")]),_:1})]),_:1}),o(e(v),{style:{"margin-top":"0"}}),e(r).organization.hasUsageReport?(n(),l(e(c),{key:0,align:"center",justify:"center"},{default:a(()=>[N("iframe",{src:e(r).reportUrl,frameborder:"0",style:{width:"1000px",height:"1700px"}},null,8,U)]),_:1})):(n(),l(e(c),{key:1,align:"center",justify:"center"},{default:a(()=>[o(e(f),{level:4},{default:a(()=>[d("No usage report available")]),_:1})]),_:1}))])):I("",!0)}});export{O as default};
//# sourceMappingURL=Billing.8cfac42c.js.map
