The only tool you need to know what is happening and how to fix it.
Go alertingexception-trackerissue-trackinglogsmetricsmonitoringobservability-platformopen-telemetryotelsession-replaytelemetrytraces
import{j as i,k as n,g as r,l as o}from"./BKFspo1J.js";import{a,p as h}from"./BrdmM8Kw.js";import{a as l}from"./h7yRWCtK.js";function w(){const c=l.token;if(!c)return null;try{const e=JSON.parse(atob(c.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")));return typeof e.userId!="number"?null:{userId:e.userId,email:e.email??""}}catch{return null}}class d{#e=i(n([]));get teams(){return r(this.#e)}set teams(e){o(this.#e,e,!0)}#t=i(!1);get teamsLoading(){return r(this.#t)}set teamsLoading(e){o(this.#t,e,!0)}#s=i("");get teamsError(){return r(this.#s)}set teamsError(e){o(this.#s,e,!0)}#a=i(n([]));get schedules(){return r(this.#a)}set schedules(e){o(this.#a,e,!0)}#i=i(!1);get schedulesLoading(){return r(this.#i)}set schedulesLoading(e){o(this.#i,e,!0)}#r=i("");get schedulesError(){return r(this.#r)}set schedulesError(e){o(this.#r,e,!0)}#o=i(n([]));get overview(){return r(this.#o)}set overview(e){o(this.#o,e,!0)}#n=i(!1);get overviewLoading(){return r(this.#n)}set overviewLoading(e){o(this.#n,e,!0)}#c=i("");get overviewError(){return r(this.#c)}set overviewError(e){o(this.#c,e,!0)}#l=i(n([]));get policies(){return r(this.#l)}set policies(e){o(this.#l,e,!0)}#u=i(!1);get policiesLoading(){return r(this.#u)}set policiesLoading(e){o(this.#u,e,!0)}#h=i("");get policiesError(){return r(this.#h)}set policiesError(e){o(this.#h,e,!0)}#d=i(0);get openPagesCount(){return r(this.#d)}set openPagesCount(e){o(this.#d,e,!0)}canManage(e){return l.canManageOrganization(e)}async refreshOpenCount(){try{const e=await a.get("/pages/open-count",{projectId:h.currentProjectId??void 0});this.openPagesCount=e.count??0}catch{}}async loadTeams(e){this.teamsLoading=!0,this.teamsError="";try{const t=await a.get(`/organizations/${e}/teams`);this.teams=t.teams||[]}catch(t){this.teamsError=t instanceof Error?t.message:"Failed to load teams",this.teams=[]}finally{this.teamsLoading=!1}}async loadSchedules(e){this.schedulesLoading=!0,this.schedulesError="";try{const t=await a.get(`/organizations/${e}/schedules`);this.schedules=t.schedules||[]}catch(t){this.schedulesError=t instanceof Error?t.message:"Failed to load schedules",this.schedules=[]}finally{this.schedulesLoading=!1}}async loadOverview(e){this.overviewLoading=!0,this.overviewError="";try{const t=await a.get(`/organizations/${e}/oncall/now`);this.overview=t.teams||[]}catch(t){this.overviewError=t instanceof Error?t.message:"Failed to load who is on call",this.overview=[]}finally{this.overviewLoading=!1}}async createTeam(e,t){const s=await a.post(`/organizations/${e}/teams`,t);return await this.loadTeams(e),s}async updateTeam(e,t,s){await a.put(`/organizations/${e}/teams/${t}`,s)}async updateTeamMembers(e,t,s){await a.put(`/organizations/${e}/teams/${t}/members`,{userIds:s})}async updateTeamProjects(e,t,s){await a.put(`/organizations/${e}/teams/${t}/projects`,{projectIds:s})}async deleteTeam(e,t){await a.delete(`/organizations/${e}/teams/${t}`),await this.loadTeams(e)}async createSchedule(e,t){const s=await a.post(`/organizations/${e}/schedules`,t);return await this.loadSchedules(e),s}async updateSchedule(e,t,s){await a.put(`/organizations/${e}/schedules/${t}`,s),await this.loadSchedules(e)}async deleteSchedule(e,t){await a.delete(`/organizations/${e}/schedules/${t}`),await this.loadSchedules(e)}async getSchedule(e,t){return await a.get(`/organizations/${e}/schedules/${t}`)}async getTimeline(e,t,s,u){return await a.get(`/organizations/${e}/schedules/${t}/timeline?from=${encodeURIComponent(s)}&to=${encodeURIComponent(u)}`)}async createOverride(e,t,s){return await a.post(`/organizations/${e}/schedules/${t}/overrides`,s)}async deleteOverride(e,t,s){await a.delete(`/organizations/${e}/schedules/${t}/overrides/${s}`)}async getMembers(e){return await a.get(`/organizations/${e}/members`)}async loadPolicies(e){this.policiesLoading=!0,this.policiesError="";try{const t=await a.get(`/organizations/${e}/escalation-policies`);this.policies=t.policies||[]}catch(t){this.policiesError=t instanceof Error?t.message:"Failed to load escalation policies",this.policies=[]}finally{this.policiesLoading=!1}}async createPolicy(e,t){const s=await a.post(`/organizations/${e}/escalation-policies`,t);return await this.loadPolicies(e),s}async updatePolicy(e,t,s){await a.put(`/organizations/${e}/escalation-policies/${t}`,s),await this.loadPolicies(e)}async deletePolicy(e,t){await a.delete(`/organizations/${e}/escalation-policies/${t}`),await this.loadPolicies(e)}}const y=new d;export{w as g,y as o};