import{K as i}from"./jwt-decode.esm-CX61wVx3.js";import{C as a}from"./router-C3xfRTQ9.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="65d0b85c-a74b-43c9-8eb3-0821260fa060",r._sentryDebugIdIdentifier="sentry-dbid-65d0b85c-a74b-43c9-8eb3-0821260fa060")}catch{}})();class o{base(t){if(!t)throw new Error("TemplateAPI: missing organizationId");return`organizations/${t}/templates`}async list(t,e={}){const s=new URLSearchParams;s.set("limit",String(e.limit??50)),s.set("offset",String(e.offset??0)),e.search?.trim()&&s.set("search",e.search.trim()),e.language?(s.set("language",e.language),s.set("acceptOtherLanguages","false")):(s.set("language",i.getLocale()),s.set("acceptOtherLanguages","true"));for(const n of e.tags??[])s.append("tags",n);return a.get(`${this.base(t)}?${s.toString()}`,void 0,{redirectOnForbidden:!1})}async getByProject(t,e){try{return await a.get(`${this.base(t)}/by-project/${e}`,void 0,{redirectOnForbidden:!1})}catch(s){if(s.status===404)return null;throw s}}async create(t,e){return a.post(this.base(t),e)}async update(t,e,s){return a.patch(`${this.base(t)}/${e}`,s)}async remove(t,e){await a.delete(`${this.base(t)}/${e}`)}}const g=new o;export{g as T};
//# sourceMappingURL=template-Bt-8rk-e.js.map
