import{E as a,a as o}from"./authorManager.f2a35532.js";import"./outputWidgets.90a37dfb.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="587cc03d-36a3-4a57-ac48-e271cf78e1ba",n._sentryDebugIdIdentifier="sentry-dbid-587cc03d-36a3-4a57-ac48-e271cf78e1ba")}catch{}})();class c extends Error{constructor(t,e){super(t),this.status=e}static async fromResponse(t){const e=await t.text();return new c(e,t.status)}}class f{static async get(t){const s=await(await fetch(`${a.cloudApi}/console/${t}`,{headers:{...o.headers}})).text();return s?JSON.parse(s):null}static async getBlob(t){return await(await fetch(`${a.cloudApi}/console/${t}`,{headers:{...o.headers}})).blob()}static async post(t,e,s){const r=!!(s!=null&&s["Content-Type"])&&s["Content-Type"]!=="application/json",i=await fetch(`${a.cloudApi}/console/${t}`,{method:"POST",headers:{"Content-Type":"application/json",...o.headers,...s},body:r?e:JSON.stringify(e)});if(!i.ok)throw await c.fromResponse(i);const p=await i.text();return p?JSON.parse(p):null}static async patch(t,e){const s=await fetch(`${a.cloudApi}/console/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json",...o.headers},body:JSON.stringify(e)});if(!s.ok)throw await c.fromResponse(s);const r=await s.text();return r?JSON.parse(r):null}static async delete(t){const e=await fetch(`${a.cloudApi}/console/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",...o.headers}});if(!e.ok)throw await c.fromResponse(e)}}export{f as C};
//# sourceMappingURL=gateway.6f30a6bf.js.map
