import{a as _}from"./asyncComputed.c4333d47.js";import{d as w,ea as b,k 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 c,ec as C,bR as x,dc as l,e as N}from"./jwt-decode.esm.c1356de1.js";import{n as g,c as v}from"./router.10a36819.js";import{a as z}from"./organization.45fb3cc4.js";import"./tables.356ea1ca.js";import{L as B}from"./LoadingContainer.cd304a5d.js";import"./index.70806805.js";import"./record.6e317d8b.js";import"./string.dbe1a2f4.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]="ee08946a-876b-41c4-a0de-cf10461f795f",a._sentryDebugIdIdentifier="sentry-dbid-ee08946a-876b-41c4-a0de-cf10461f795f")}catch{}})();const D={key:1},U=["src"],O=w({__name:"Billing",setup(a){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(),d(B,{key:0})):e(r)?(n(),k("div",D,[o(e(l),{justify:"space-between",align:"center"},{default:t(()=>[o(e(f),{level:3},{default:t(()=>[c("Current plan: "+C(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:t(()=>[c("Upgrade")]),_:1})]),_:1}),o(e(v),{style:{"margin-top":"0"}}),e(r).organization.hasUsageReport?(n(),d(e(l),{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(l),{key:1,align:"center",justify:"center"},{default:t(()=>[o(e(f),{level:4},{default:t(()=>[c("No usage report available")]),_:1})]),_:1}))])):I("",!0)}});export{O as default};
//# sourceMappingURL=Billing.3d3fdcf3.js.map
