import{r as n}from"./vendor-react-wBh_31cN.js";import{W as a}from"./index-BKr2rJhV.js";import{u as r}from"./alertManagerConfUtil-D4yp8Ca8.js";const E=e=>e.alerts,v=e=>e.loading.effects.alerts.fetch,g=e=>e.loading.effects.alerts.fetchValues,l=e=>e.loading.effects.alerts.fetchRoutes,D=e=>e.loading.effects.alerts.fetchReceivers,m=["job success","job fail","job killed","job long running"],o=["data validation success","data validation warning","data validation fail"],c=["data shift undetected","data shift detected","empty detection window"],R=()=>{const{data:e}=a();return n.useCallback(s=>{const i=s==="validation-fg"?o:[];return e?i.concat(c):i},[e])};var u=(e=>(e[e.ADD=0]="ADD",e[e.EDIT=1]="EDIT",e[e.DELETE=2]="DELETE",e[e.EDIT_PROJECT=3]="EDIT_PROJECT",e[e.DELETE_PROJECT=4]="DELETE_PROJECT",e))(u||{});const L=e=>{const s=[],i=new Map;return e&&e.length>0?(e.forEach(t=>{(!t.receiver||t.receiver.length<1)&&s.push("Receiver is required"),(!t.severity||t.severity.length<1)&&s.push("Severity is required"),(!t.status||t.status.length<1)&&s.push("Trigger is required"),t.status&&i.set(t.status,t)}),e.length>i.size&&s.push("You can not create multiple alerts for the same trigger."),s.length>0?s[0]:null):null},j=(e=[])=>e.filter(s=>s.status&&s.status.length>0||s.severity&&s.severity.length>0||s.receiver&&s.receiver.length>0||s.threshold&&s.threshold>0).map(s=>({status:r(s.status),severity:s.severity,receiver:s.receiver,threshold:s.threshold}));export{u as A,v as a,g as b,l as c,D as d,j as g,L as i,m as j,E as s,R as u};
