@ssgc/alert-console 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import { jsx as i, jsxs as d, Fragment as ws } from "react/jsx-runtime";
2
2
  import * as ce from "react";
3
- import { useMemo as ue, createContext as xs, useContext as Is, useState as I, useEffect as fe, useRef as Cs } from "react";
4
- import { Select as pe, Table as gt, Row as ge, Col as _, Input as Ts, Tag as Ve, Space as Ae, Tooltip as Rs, Button as ye, Progress as ks, Dropdown as Os, Typography as qe, Spin as vt, Checkbox as Be, Divider as je, TimePicker as Dt, Tabs as bt, Card as at, Steps as Ps, Modal as Es, Carousel as Ds } from "antd";
5
- import { MessageOutlined as Ms, MailOutlined as Fs, MoreOutlined as Us, EditOutlined as Ls, LeftOutlined as $s, RightOutlined as Bs } from "@ant-design/icons";
6
- import { toast as ie } from "react-toastify";
3
+ import { useMemo as ue, createContext as xs, useContext as Cs, useState as I, useEffect as he, useRef as Is } from "react";
4
+ import { Select as me, Table as yt, Row as ye, Col as H, Input as Ts, Tag as Ve, Space as Se, Tooltip as Rs, Button as pe, Progress as ks, Dropdown as Os, Typography as _e, Spin as gt, Checkbox as je, Divider as Qe, TimePicker as Dt, Tabs as vt, Card as it, Steps as Ps, Modal as Es, Carousel as Ds } from "antd";
5
+ import { MessageOutlined as Fs, MailOutlined as Ms, MoreOutlined as Us, EditOutlined as Ls, LeftOutlined as $s, RightOutlined as Bs } from "@ant-design/icons";
6
+ import { toast as ne } from "react-toastify";
7
7
  const js = "#FF3B30", Qs = "#FF9500", qs = "#FFCC00", _s = "#34C759", He = {
8
8
  critical: js,
9
9
  high: Qs,
10
10
  medium: qs,
11
11
  low: _s
12
- }, Mt = {
12
+ }, Ft = {
13
13
  Critical: He.critical,
14
14
  High: He.high,
15
15
  Medium: He.medium,
16
16
  Low: He.low
17
17
  };
18
18
  function Hs(e) {
19
- return Mt[e] || Mt.Low;
19
+ return Ft[e] || Ft.Low;
20
20
  }
21
- function Ft(e) {
21
+ function Mt(e) {
22
22
  if (!e || typeof e != "string") return 0;
23
23
  const t = e.trim().split(":");
24
24
  if (t.length !== 3) return 0;
25
- const [s, r, n] = t, a = Number.parseInt(s, 10), o = Number.parseInt(r, 10), l = Number.parseFloat(n || "0"), h = Number.isFinite(a) ? a : 0, u = Number.isFinite(o) ? o : 0, f = Number.isFinite(l) ? l : 0;
26
- return h * 3600 + u * 60 + f;
25
+ const [s, r, n] = t, a = Number.parseInt(s, 10), o = Number.parseInt(r, 10), l = Number.parseFloat(n || "0"), h = Number.isFinite(a) ? a : 0, u = Number.isFinite(o) ? o : 0, c = Number.isFinite(l) ? l : 0;
26
+ return h * 3600 + u * 60 + c;
27
27
  }
28
- function ot(e) {
28
+ function at(e) {
29
29
  const t = e.thirdPartyIds ?? e.ThirdPartyIds ?? e.thirdPartyId ?? e.ThirdPartyId ?? "", s = Array.isArray(t) ? t.join(",") : String(t ?? "");
30
30
  if (!s || !s.trim()) return [];
31
31
  const r = s.split(",").map((o) => parseInt(String(o).trim(), 10)).filter((o) => Number.isFinite(o)), n = /* @__PURE__ */ new Set(), a = [];
@@ -43,7 +43,7 @@ const ss = "", Gs = ss, Ws = "", Ks = "", Ut = {
43
43
  rules: Ks
44
44
  }
45
45
  };
46
- function be(e, t) {
46
+ function ve(e, t) {
47
47
  const s = (e || "").replace(/\/+$/, ""), r = t.startsWith("/") ? t : `/${t}`;
48
48
  return `${s}${r}`;
49
49
  }
@@ -62,7 +62,7 @@ function Ge(e, t) {
62
62
  n != null && String(n).length > 0 && s.searchParams.set(r, String(n));
63
63
  }), s.toString();
64
64
  }
65
- async function Se(e, t) {
65
+ async function be(e, t) {
66
66
  const s = {
67
67
  ...t.headers,
68
68
  ...Ys()
@@ -85,43 +85,42 @@ async function Se(e, t) {
85
85
  return a;
86
86
  }
87
87
  function zs(e) {
88
- console.log("baseurl", e);
89
88
  const t = {
90
89
  "Content-Type": "application/json",
91
90
  ...e.headers || {}
92
91
  };
93
92
  return {
94
93
  async listAlerts() {
95
- const s = be(e.baseUrl, "/api/Alert"), r = await Se(s, {
94
+ const s = ve(e.baseUrl, "/api/Alert"), r = await be(s, {
96
95
  method: "GET",
97
96
  headers: t
98
97
  });
99
98
  return Array.isArray(r) ? r : [];
100
99
  },
101
100
  async getAlertStatusList() {
102
- const s = be(e.baseUrl, "/api/Alert/AlertStatusList"), r = await Se(s, {
101
+ const s = ve(e.baseUrl, "/api/Alert/AlertStatusList"), r = await be(s, {
103
102
  method: "GET",
104
103
  headers: t
105
104
  });
106
105
  return Array.isArray(r) ? r : r && typeof r == "object" && Array.isArray(r.data) ? r.data : [];
107
106
  },
108
107
  async getAlertsReport(s) {
109
- const r = be(e.baseUrl, "/Alerts/GetAlertsReport"), n = Ge(r, s), a = await Se(n, {
108
+ const r = ve(e.baseUrl, "/Alerts/GetAlertsReport"), n = Ge(r, s), a = await be(n, {
110
109
  method: "GET",
111
110
  headers: t
112
111
  });
113
112
  return Array.isArray(a) ? a : [];
114
113
  },
115
114
  async updateAlertStatus(s) {
116
- const r = be(e.baseUrl, "/api/Alert/status");
117
- return Se(r, {
115
+ const r = ve(e.baseUrl, "/api/Alert/status");
116
+ return be(r, {
118
117
  method: "PUT",
119
118
  headers: t,
120
119
  body: JSON.stringify(s ?? {})
121
120
  });
122
121
  },
123
122
  async getAdminSettings() {
124
- const s = be(e.baseUrl, "/api/Alert/GetAdminSettings"), r = await Se(s, {
123
+ const s = ve(e.baseUrl, "/api/Alert/GetAdminSettings"), r = await be(s, {
125
124
  method: "GET",
126
125
  headers: t
127
126
  });
@@ -132,20 +131,20 @@ function zs(e) {
132
131
  return null;
133
132
  },
134
133
  async setAdminSettings(s) {
135
- const r = be(e.baseUrl, "/api/Alert/SetAdminSettings"), n = {
134
+ const r = ve(e.baseUrl, "/api/Alert/SetAdminSettings"), n = {
136
135
  userId: 0,
137
136
  isAdminSetting: !0,
138
137
  sortBy: s?.sortBy ?? "",
139
138
  groupBy: s?.groupBy ?? null
140
139
  };
141
- return Se(r, {
140
+ return be(r, {
142
141
  method: "POST",
143
142
  headers: t,
144
143
  body: JSON.stringify(n)
145
144
  });
146
145
  },
147
146
  async getPreferenceSettings() {
148
- const s = be(e.baseUrl, "/api/Alert/GetPreferenceSettings"), r = await Se(s, {
147
+ const s = ve(e.baseUrl, "/api/Alert/GetPreferenceSettings"), r = await be(s, {
149
148
  method: "GET",
150
149
  headers: t
151
150
  });
@@ -156,7 +155,7 @@ function zs(e) {
156
155
  return null;
157
156
  },
158
157
  async setPreferenceSettings(s) {
159
- const r = be(e.baseUrl, "/api/Alert/SetPreferenceSettings"), n = await Se(r, {
158
+ const r = ve(e.baseUrl, "/api/Alert/SetPreferenceSettings"), n = await be(r, {
160
159
  method: "POST",
161
160
  headers: t,
162
161
  body: JSON.stringify(s ?? {})
@@ -169,22 +168,22 @@ function zs(e) {
169
168
  };
170
169
  },
171
170
  async getAlertNotifications(s) {
172
- const r = be(e.baseUrl, "/api/Alert/GetNotifications"), n = Ge(r, { alertId: s }), a = await Se(n, {
171
+ const r = ve(e.baseUrl, "/api/Alert/GetNotifications"), n = Ge(r, { alertId: s }), a = await be(n, {
173
172
  method: "GET",
174
173
  headers: t
175
174
  });
176
175
  return Array.isArray(a) ? a : a && typeof a == "object" && Array.isArray(a.data) ? a.data : [];
177
176
  },
178
177
  async notifyFamilyMembers(s) {
179
- const r = be(e.baseUrl, "/api/Alert/NotificationToFamilyMembers"), n = Ge(r, { alertId: s });
180
- return Se(n, {
178
+ const r = ve(e.baseUrl, "/api/Alert/NotificationToFamilyMembers"), n = Ge(r, { alertId: s });
179
+ return be(n, {
181
180
  method: "POST",
182
181
  headers: t
183
182
  });
184
183
  },
185
184
  async sendSMSorEmailNotifications(s, r, n) {
186
- const a = be(e.baseUrl, "/api/Alert/SendSMSorEmailNotifications"), o = Ge(a, { alertId: s, isEmail: r, isSMS: n });
187
- return Se(o, {
185
+ const a = ve(e.baseUrl, "/api/Alert/SendSMSorEmailNotifications"), o = Ge(a, { alertId: s, isEmail: r, isSMS: n });
186
+ return be(o, {
188
187
  method: "POST",
189
188
  headers: t
190
189
  });
@@ -264,256 +263,256 @@ function er() {
264
263
  (function(s, r) {
265
264
  e.exports = r();
266
265
  })(Zs, (function() {
267
- var s = 1e3, r = 6e4, n = 36e5, a = "millisecond", o = "second", l = "minute", h = "hour", u = "day", f = "week", b = "month", p = "quarter", R = "year", x = "date", m = "Invalid Date", A = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, L = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, $ = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(O) {
268
- var g = ["th", "st", "nd", "rd"], y = O % 100;
269
- return "[" + O + (g[(y - 20) % 10] || g[y] || g[0]) + "]";
270
- } }, B = function(O, g, y) {
271
- var S = String(O);
272
- return !S || S.length >= g ? O : "" + Array(g + 1 - S.length).join(y) + O;
273
- }, F = { s: B, z: function(O) {
274
- var g = -O.utcOffset(), y = Math.abs(g), S = Math.floor(y / 60), c = y % 60;
275
- return (g <= 0 ? "+" : "-") + B(S, 2, "0") + ":" + B(c, 2, "0");
276
- }, m: function O(g, y) {
277
- if (g.date() < y.date()) return -O(y, g);
278
- var S = 12 * (y.year() - g.year()) + (y.month() - g.month()), c = g.clone().add(S, b), v = y - c < 0, w = g.clone().add(S + (v ? -1 : 1), b);
279
- return +(-(S + (y - c) / (v ? c - w : w - c)) || 0);
280
- }, a: function(O) {
281
- return O < 0 ? Math.ceil(O) || 0 : Math.floor(O);
282
- }, p: function(O) {
283
- return { M: b, y: R, w: f, d: u, D: x, h, m: l, s: o, ms: a, Q: p }[O] || String(O || "").toLowerCase().replace(/s$/, "");
284
- }, u: function(O) {
285
- return O === void 0;
286
- } }, z = "en", V = {};
287
- V[z] = $;
288
- var H = "$isDayjsObject", W = function(O) {
289
- return O instanceof te || !(!O || !O[H]);
290
- }, C = function O(g, y, S) {
291
- var c;
292
- if (!g) return z;
266
+ var s = 1e3, r = 6e4, n = 36e5, a = "millisecond", o = "second", l = "minute", h = "hour", u = "day", c = "week", N = "month", f = "quarter", O = "year", w = "date", p = "Invalid Date", S = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, $ = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, L = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(k) {
267
+ var g = ["th", "st", "nd", "rd"], m = k % 100;
268
+ return "[" + k + (g[(m - 20) % 10] || g[m] || g[0]) + "]";
269
+ } }, B = function(k, g, m) {
270
+ var A = String(k);
271
+ return !A || A.length >= g ? k : "" + Array(g + 1 - A.length).join(m) + k;
272
+ }, U = { s: B, z: function(k) {
273
+ var g = -k.utcOffset(), m = Math.abs(g), A = Math.floor(m / 60), y = m % 60;
274
+ return (g <= 0 ? "+" : "-") + B(A, 2, "0") + ":" + B(y, 2, "0");
275
+ }, m: function k(g, m) {
276
+ if (g.date() < m.date()) return -k(m, g);
277
+ var A = 12 * (m.year() - g.year()) + (m.month() - g.month()), y = g.clone().add(A, N), v = m - y < 0, b = g.clone().add(A + (v ? -1 : 1), N);
278
+ return +(-(A + (m - y) / (v ? y - b : b - y)) || 0);
279
+ }, a: function(k) {
280
+ return k < 0 ? Math.ceil(k) || 0 : Math.floor(k);
281
+ }, p: function(k) {
282
+ return { M: N, y: O, w: c, d: u, D: w, h, m: l, s: o, ms: a, Q: f }[k] || String(k || "").toLowerCase().replace(/s$/, "");
283
+ }, u: function(k) {
284
+ return k === void 0;
285
+ } }, Y = "en", J = {};
286
+ J[Y] = L;
287
+ var G = "$isDayjsObject", W = function(k) {
288
+ return k instanceof se || !(!k || !k[G]);
289
+ }, T = function k(g, m, A) {
290
+ var y;
291
+ if (!g) return Y;
293
292
  if (typeof g == "string") {
294
293
  var v = g.toLowerCase();
295
- V[v] && (c = v), y && (V[v] = y, c = v);
296
- var w = g.split("-");
297
- if (!c && w.length > 1) return O(w[0]);
294
+ J[v] && (y = v), m && (J[v] = m, y = v);
295
+ var b = g.split("-");
296
+ if (!y && b.length > 1) return k(b[0]);
298
297
  } else {
299
- var E = g.name;
300
- V[E] = g, c = E;
298
+ var P = g.name;
299
+ J[P] = g, y = P;
301
300
  }
302
- return !S && c && (z = c), c || !S && z;
303
- }, N = function(O, g) {
304
- if (W(O)) return O.clone();
305
- var y = typeof g == "object" ? g : {};
306
- return y.date = O, y.args = arguments, new te(y);
307
- }, T = F;
308
- T.l = C, T.i = W, T.w = function(O, g) {
309
- return N(O, { locale: g.$L, utc: g.$u, x: g.$x, $offset: g.$offset });
301
+ return !A && y && (Y = y), y || !A && Y;
302
+ }, x = function(k, g) {
303
+ if (W(k)) return k.clone();
304
+ var m = typeof g == "object" ? g : {};
305
+ return m.date = k, m.args = arguments, new se(m);
306
+ }, R = U;
307
+ R.l = T, R.i = W, R.w = function(k, g) {
308
+ return x(k, { locale: g.$L, utc: g.$u, x: g.$x, $offset: g.$offset });
310
309
  };
311
- var te = (function() {
312
- function O(y) {
313
- this.$L = C(y.locale, null, !0), this.parse(y), this.$x = this.$x || y.x || {}, this[H] = !0;
310
+ var se = (function() {
311
+ function k(m) {
312
+ this.$L = T(m.locale, null, !0), this.parse(m), this.$x = this.$x || m.x || {}, this[G] = !0;
314
313
  }
315
- var g = O.prototype;
316
- return g.parse = function(y) {
317
- this.$d = (function(S) {
318
- var c = S.date, v = S.utc;
319
- if (c === null) return /* @__PURE__ */ new Date(NaN);
320
- if (T.u(c)) return /* @__PURE__ */ new Date();
321
- if (c instanceof Date) return new Date(c);
322
- if (typeof c == "string" && !/Z$/i.test(c)) {
323
- var w = c.match(A);
324
- if (w) {
325
- var E = w[2] - 1 || 0, k = (w[7] || "0").substring(0, 3);
326
- return v ? new Date(Date.UTC(w[1], E, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, k)) : new Date(w[1], E, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, k);
314
+ var g = k.prototype;
315
+ return g.parse = function(m) {
316
+ this.$d = (function(A) {
317
+ var y = A.date, v = A.utc;
318
+ if (y === null) return /* @__PURE__ */ new Date(NaN);
319
+ if (R.u(y)) return /* @__PURE__ */ new Date();
320
+ if (y instanceof Date) return new Date(y);
321
+ if (typeof y == "string" && !/Z$/i.test(y)) {
322
+ var b = y.match(S);
323
+ if (b) {
324
+ var P = b[2] - 1 || 0, M = (b[7] || "0").substring(0, 3);
325
+ return v ? new Date(Date.UTC(b[1], P, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, M)) : new Date(b[1], P, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, M);
327
326
  }
328
327
  }
329
- return new Date(c);
330
- })(y), this.init();
328
+ return new Date(y);
329
+ })(m), this.init();
331
330
  }, g.init = function() {
332
- var y = this.$d;
333
- this.$y = y.getFullYear(), this.$M = y.getMonth(), this.$D = y.getDate(), this.$W = y.getDay(), this.$H = y.getHours(), this.$m = y.getMinutes(), this.$s = y.getSeconds(), this.$ms = y.getMilliseconds();
331
+ var m = this.$d;
332
+ this.$y = m.getFullYear(), this.$M = m.getMonth(), this.$D = m.getDate(), this.$W = m.getDay(), this.$H = m.getHours(), this.$m = m.getMinutes(), this.$s = m.getSeconds(), this.$ms = m.getMilliseconds();
334
333
  }, g.$utils = function() {
335
- return T;
334
+ return R;
336
335
  }, g.isValid = function() {
337
- return this.$d.toString() !== m;
338
- }, g.isSame = function(y, S) {
339
- var c = N(y);
340
- return this.startOf(S) <= c && c <= this.endOf(S);
341
- }, g.isAfter = function(y, S) {
342
- return N(y) < this.startOf(S);
343
- }, g.isBefore = function(y, S) {
344
- return this.endOf(S) < N(y);
345
- }, g.$g = function(y, S, c) {
346
- return T.u(y) ? this[S] : this.set(c, y);
336
+ return this.$d.toString() !== p;
337
+ }, g.isSame = function(m, A) {
338
+ var y = x(m);
339
+ return this.startOf(A) <= y && y <= this.endOf(A);
340
+ }, g.isAfter = function(m, A) {
341
+ return x(m) < this.startOf(A);
342
+ }, g.isBefore = function(m, A) {
343
+ return this.endOf(A) < x(m);
344
+ }, g.$g = function(m, A, y) {
345
+ return R.u(m) ? this[A] : this.set(y, m);
347
346
  }, g.unix = function() {
348
347
  return Math.floor(this.valueOf() / 1e3);
349
348
  }, g.valueOf = function() {
350
349
  return this.$d.getTime();
351
- }, g.startOf = function(y, S) {
352
- var c = this, v = !!T.u(S) || S, w = T.p(y), E = function(Y, se) {
353
- var re = T.w(c.$u ? Date.UTC(c.$y, se, Y) : new Date(c.$y, se, Y), c);
354
- return v ? re : re.endOf(u);
355
- }, k = function(Y, se) {
356
- return T.w(c.toDate()[Y].apply(c.toDate("s"), (v ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(se)), c);
357
- }, U = this.$W, Q = this.$M, j = this.$D, M = "set" + (this.$u ? "UTC" : "");
358
- switch (w) {
359
- case R:
360
- return v ? E(1, 0) : E(31, 11);
361
- case b:
362
- return v ? E(1, Q) : E(0, Q + 1);
363
- case f:
364
- var K = this.$locale().weekStart || 0, ee = (U < K ? U + 7 : U) - K;
365
- return E(v ? j - ee : j + (6 - ee), Q);
350
+ }, g.startOf = function(m, A) {
351
+ var y = this, v = !!R.u(A) || A, b = R.p(m), P = function(le, re) {
352
+ var C = R.w(y.$u ? Date.UTC(y.$y, re, le) : new Date(y.$y, re, le), y);
353
+ return v ? C : C.endOf(u);
354
+ }, M = function(le, re) {
355
+ return R.w(y.toDate()[le].apply(y.toDate("s"), (v ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(re)), y);
356
+ }, D = this.$W, j = this.$M, Q = this.$D, z = "set" + (this.$u ? "UTC" : "");
357
+ switch (b) {
358
+ case O:
359
+ return v ? P(1, 0) : P(31, 11);
360
+ case N:
361
+ return v ? P(1, j) : P(0, j + 1);
362
+ case c:
363
+ var ie = this.$locale().weekStart || 0, fe = (D < ie ? D + 7 : D) - ie;
364
+ return P(v ? Q - fe : Q + (6 - fe), j);
366
365
  case u:
367
- case x:
368
- return k(M + "Hours", 0);
366
+ case w:
367
+ return M(z + "Hours", 0);
369
368
  case h:
370
- return k(M + "Minutes", 1);
369
+ return M(z + "Minutes", 1);
371
370
  case l:
372
- return k(M + "Seconds", 2);
371
+ return M(z + "Seconds", 2);
373
372
  case o:
374
- return k(M + "Milliseconds", 3);
373
+ return M(z + "Milliseconds", 3);
375
374
  default:
376
375
  return this.clone();
377
376
  }
378
- }, g.endOf = function(y) {
379
- return this.startOf(y, !1);
380
- }, g.$set = function(y, S) {
381
- var c, v = T.p(y), w = "set" + (this.$u ? "UTC" : ""), E = (c = {}, c[u] = w + "Date", c[x] = w + "Date", c[b] = w + "Month", c[R] = w + "FullYear", c[h] = w + "Hours", c[l] = w + "Minutes", c[o] = w + "Seconds", c[a] = w + "Milliseconds", c)[v], k = v === u ? this.$D + (S - this.$W) : S;
382
- if (v === b || v === R) {
383
- var U = this.clone().set(x, 1);
384
- U.$d[E](k), U.init(), this.$d = U.set(x, Math.min(this.$D, U.daysInMonth())).$d;
385
- } else E && this.$d[E](k);
377
+ }, g.endOf = function(m) {
378
+ return this.startOf(m, !1);
379
+ }, g.$set = function(m, A) {
380
+ var y, v = R.p(m), b = "set" + (this.$u ? "UTC" : ""), P = (y = {}, y[u] = b + "Date", y[w] = b + "Date", y[N] = b + "Month", y[O] = b + "FullYear", y[h] = b + "Hours", y[l] = b + "Minutes", y[o] = b + "Seconds", y[a] = b + "Milliseconds", y)[v], M = v === u ? this.$D + (A - this.$W) : A;
381
+ if (v === N || v === O) {
382
+ var D = this.clone().set(w, 1);
383
+ D.$d[P](M), D.init(), this.$d = D.set(w, Math.min(this.$D, D.daysInMonth())).$d;
384
+ } else P && this.$d[P](M);
386
385
  return this.init(), this;
387
- }, g.set = function(y, S) {
388
- return this.clone().$set(y, S);
389
- }, g.get = function(y) {
390
- return this[T.p(y)]();
391
- }, g.add = function(y, S) {
392
- var c, v = this;
393
- y = Number(y);
394
- var w = T.p(S), E = function(Q) {
395
- var j = N(v);
396
- return T.w(j.date(j.date() + Math.round(Q * y)), v);
386
+ }, g.set = function(m, A) {
387
+ return this.clone().$set(m, A);
388
+ }, g.get = function(m) {
389
+ return this[R.p(m)]();
390
+ }, g.add = function(m, A) {
391
+ var y, v = this;
392
+ m = Number(m);
393
+ var b = R.p(A), P = function(j) {
394
+ var Q = x(v);
395
+ return R.w(Q.date(Q.date() + Math.round(j * m)), v);
397
396
  };
398
- if (w === b) return this.set(b, this.$M + y);
399
- if (w === R) return this.set(R, this.$y + y);
400
- if (w === u) return E(1);
401
- if (w === f) return E(7);
402
- var k = (c = {}, c[l] = r, c[h] = n, c[o] = s, c)[w] || 1, U = this.$d.getTime() + y * k;
403
- return T.w(U, this);
404
- }, g.subtract = function(y, S) {
405
- return this.add(-1 * y, S);
406
- }, g.format = function(y) {
407
- var S = this, c = this.$locale();
408
- if (!this.isValid()) return c.invalidDate || m;
409
- var v = y || "YYYY-MM-DDTHH:mm:ssZ", w = T.z(this), E = this.$H, k = this.$m, U = this.$M, Q = c.weekdays, j = c.months, M = c.meridiem, K = function(se, re, me, de) {
410
- return se && (se[re] || se(S, v)) || me[re].slice(0, de);
411
- }, ee = function(se) {
412
- return T.s(E % 12 || 12, se, "0");
413
- }, Y = M || function(se, re, me) {
414
- var de = se < 12 ? "AM" : "PM";
415
- return me ? de.toLowerCase() : de;
397
+ if (b === N) return this.set(N, this.$M + m);
398
+ if (b === O) return this.set(O, this.$y + m);
399
+ if (b === u) return P(1);
400
+ if (b === c) return P(7);
401
+ var M = (y = {}, y[l] = r, y[h] = n, y[o] = s, y)[b] || 1, D = this.$d.getTime() + m * M;
402
+ return R.w(D, this);
403
+ }, g.subtract = function(m, A) {
404
+ return this.add(-1 * m, A);
405
+ }, g.format = function(m) {
406
+ var A = this, y = this.$locale();
407
+ if (!this.isValid()) return y.invalidDate || p;
408
+ var v = m || "YYYY-MM-DDTHH:mm:ssZ", b = R.z(this), P = this.$H, M = this.$m, D = this.$M, j = y.weekdays, Q = y.months, z = y.meridiem, ie = function(re, C, _, V) {
409
+ return re && (re[C] || re(A, v)) || _[C].slice(0, V);
410
+ }, fe = function(re) {
411
+ return R.s(P % 12 || 12, re, "0");
412
+ }, le = z || function(re, C, _) {
413
+ var V = re < 12 ? "AM" : "PM";
414
+ return _ ? V.toLowerCase() : V;
416
415
  };
417
- return v.replace(L, (function(se, re) {
418
- return re || (function(me) {
419
- switch (me) {
416
+ return v.replace($, (function(re, C) {
417
+ return C || (function(_) {
418
+ switch (_) {
420
419
  case "YY":
421
- return String(S.$y).slice(-2);
420
+ return String(A.$y).slice(-2);
422
421
  case "YYYY":
423
- return T.s(S.$y, 4, "0");
422
+ return R.s(A.$y, 4, "0");
424
423
  case "M":
425
- return U + 1;
424
+ return D + 1;
426
425
  case "MM":
427
- return T.s(U + 1, 2, "0");
426
+ return R.s(D + 1, 2, "0");
428
427
  case "MMM":
429
- return K(c.monthsShort, U, j, 3);
428
+ return ie(y.monthsShort, D, Q, 3);
430
429
  case "MMMM":
431
- return K(j, U);
430
+ return ie(Q, D);
432
431
  case "D":
433
- return S.$D;
432
+ return A.$D;
434
433
  case "DD":
435
- return T.s(S.$D, 2, "0");
434
+ return R.s(A.$D, 2, "0");
436
435
  case "d":
437
- return String(S.$W);
436
+ return String(A.$W);
438
437
  case "dd":
439
- return K(c.weekdaysMin, S.$W, Q, 2);
438
+ return ie(y.weekdaysMin, A.$W, j, 2);
440
439
  case "ddd":
441
- return K(c.weekdaysShort, S.$W, Q, 3);
440
+ return ie(y.weekdaysShort, A.$W, j, 3);
442
441
  case "dddd":
443
- return Q[S.$W];
442
+ return j[A.$W];
444
443
  case "H":
445
- return String(E);
444
+ return String(P);
446
445
  case "HH":
447
- return T.s(E, 2, "0");
446
+ return R.s(P, 2, "0");
448
447
  case "h":
449
- return ee(1);
448
+ return fe(1);
450
449
  case "hh":
451
- return ee(2);
450
+ return fe(2);
452
451
  case "a":
453
- return Y(E, k, !0);
452
+ return le(P, M, !0);
454
453
  case "A":
455
- return Y(E, k, !1);
454
+ return le(P, M, !1);
456
455
  case "m":
457
- return String(k);
456
+ return String(M);
458
457
  case "mm":
459
- return T.s(k, 2, "0");
458
+ return R.s(M, 2, "0");
460
459
  case "s":
461
- return String(S.$s);
460
+ return String(A.$s);
462
461
  case "ss":
463
- return T.s(S.$s, 2, "0");
462
+ return R.s(A.$s, 2, "0");
464
463
  case "SSS":
465
- return T.s(S.$ms, 3, "0");
464
+ return R.s(A.$ms, 3, "0");
466
465
  case "Z":
467
- return w;
466
+ return b;
468
467
  }
469
468
  return null;
470
- })(se) || w.replace(":", "");
469
+ })(re) || b.replace(":", "");
471
470
  }));
472
471
  }, g.utcOffset = function() {
473
472
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
474
- }, g.diff = function(y, S, c) {
475
- var v, w = this, E = T.p(S), k = N(y), U = (k.utcOffset() - this.utcOffset()) * r, Q = this - k, j = function() {
476
- return T.m(w, k);
473
+ }, g.diff = function(m, A, y) {
474
+ var v, b = this, P = R.p(A), M = x(m), D = (M.utcOffset() - this.utcOffset()) * r, j = this - M, Q = function() {
475
+ return R.m(b, M);
477
476
  };
478
- switch (E) {
479
- case R:
480
- v = j() / 12;
477
+ switch (P) {
478
+ case O:
479
+ v = Q() / 12;
481
480
  break;
482
- case b:
483
- v = j();
484
- break;
485
- case p:
486
- v = j() / 3;
481
+ case N:
482
+ v = Q();
487
483
  break;
488
484
  case f:
489
- v = (Q - U) / 6048e5;
485
+ v = Q() / 3;
486
+ break;
487
+ case c:
488
+ v = (j - D) / 6048e5;
490
489
  break;
491
490
  case u:
492
- v = (Q - U) / 864e5;
491
+ v = (j - D) / 864e5;
493
492
  break;
494
493
  case h:
495
- v = Q / n;
494
+ v = j / n;
496
495
  break;
497
496
  case l:
498
- v = Q / r;
497
+ v = j / r;
499
498
  break;
500
499
  case o:
501
- v = Q / s;
500
+ v = j / s;
502
501
  break;
503
502
  default:
504
- v = Q;
503
+ v = j;
505
504
  }
506
- return c ? v : T.a(v);
505
+ return y ? v : R.a(v);
507
506
  }, g.daysInMonth = function() {
508
- return this.endOf(b).$D;
507
+ return this.endOf(N).$D;
509
508
  }, g.$locale = function() {
510
- return V[this.$L];
511
- }, g.locale = function(y, S) {
512
- if (!y) return this.$L;
513
- var c = this.clone(), v = C(y, S, !0);
514
- return v && (c.$L = v), c;
509
+ return J[this.$L];
510
+ }, g.locale = function(m, A) {
511
+ if (!m) return this.$L;
512
+ var y = this.clone(), v = T(m, A, !0);
513
+ return v && (y.$L = v), y;
515
514
  }, g.clone = function() {
516
- return T.w(this.$d, this);
515
+ return R.w(this.$d, this);
517
516
  }, g.toDate = function() {
518
517
  return new Date(this.valueOf());
519
518
  }, g.toJSON = function() {
@@ -522,17 +521,17 @@ function er() {
522
521
  return this.$d.toISOString();
523
522
  }, g.toString = function() {
524
523
  return this.$d.toUTCString();
525
- }, O;
526
- })(), ne = te.prototype;
527
- return N.prototype = ne, [["$ms", a], ["$s", o], ["$m", l], ["$H", h], ["$W", u], ["$M", b], ["$y", R], ["$D", x]].forEach((function(O) {
528
- ne[O[1]] = function(g) {
529
- return this.$g(g, O[0], O[1]);
524
+ }, k;
525
+ })(), te = se.prototype;
526
+ return x.prototype = te, [["$ms", a], ["$s", o], ["$m", l], ["$H", h], ["$W", u], ["$M", N], ["$y", O], ["$D", w]].forEach((function(k) {
527
+ te[k[1]] = function(g) {
528
+ return this.$g(g, k[0], k[1]);
530
529
  };
531
- })), N.extend = function(O, g) {
532
- return O.$i || (O(g, te, N), O.$i = !0), N;
533
- }, N.locale = C, N.isDayjs = W, N.unix = function(O) {
534
- return N(1e3 * O);
535
- }, N.en = V[z], N.Ls = V, N.p = {}, N;
530
+ })), x.extend = function(k, g) {
531
+ return k.$i || (k(g, se, x), k.$i = !0), x;
532
+ }, x.locale = T, x.isDayjs = W, x.unix = function(k) {
533
+ return x(1e3 * k);
534
+ }, x.en = J[Y], x.Ls = J, x.p = {}, x;
536
535
  }));
537
536
  })(ze)), ze.exports;
538
537
  }
@@ -552,7 +551,7 @@ function Bt(e) {
552
551
  const { hours: t, minutes: s, seconds: r } = ns(e);
553
552
  return sr().hour(t).minute(s).second(r).millisecond(0);
554
553
  }
555
- function Ie(e, t) {
554
+ function xe(e, t) {
556
555
  const s = (e || "").replace(/\/+$/, ""), r = t.startsWith("/") ? t : `/${t}`;
557
556
  return `${s}${r}`;
558
557
  }
@@ -624,28 +623,28 @@ function ir(e) {
624
623
  };
625
624
  return {
626
625
  async listAlerts() {
627
- const s = Ie(e.baseUrl, "/api/detectionpolicy/alerts?customerId=99e5c8b5-b9d4-4d35-8885-7f121c532664"), r = await Ce(s, {
626
+ const s = xe(e.baseUrl, "/api/detectionpolicy/alerts?customerId=99e5c8b5-b9d4-4d35-8885-7f121c532664"), r = await Ce(s, {
628
627
  method: "GET",
629
628
  headers: t
630
629
  });
631
630
  return Array.isArray(r?.Items) ? (r?.Items).map(nr) : [];
632
631
  },
633
632
  async getAlertStatusList() {
634
- const s = Ie(e.baseUrl, "/api/detectionpolicy/alerts/StatusList"), r = await Ce(s, {
633
+ const s = xe(e.baseUrl, "/api/detectionpolicy/alerts/StatusList"), r = await Ce(s, {
635
634
  method: "GET",
636
635
  headers: t
637
636
  });
638
637
  return Array.isArray(r) ? r : [];
639
638
  },
640
639
  async getAlertsReport(s) {
641
- const r = Ie(e.baseUrl, "/api/detectionpolicy/alerts/GetAlertsReport"), n = jt(r, s), a = await Ce(n, {
640
+ const r = xe(e.baseUrl, "/api/detectionpolicy/alerts/GetAlertsReport"), n = jt(r, s), a = await Ce(n, {
642
641
  method: "GET",
643
642
  headers: t
644
643
  });
645
644
  return Array.isArray(a) ? a : [];
646
645
  },
647
646
  async updateAlertStatus(s) {
648
- const r = Ie(e.baseUrl, "/api/detectionpolicy/alerts/Log"), n = {
647
+ const r = xe(e.baseUrl, "/api/detectionpolicy/alerts/Log"), n = {
649
648
  AlertId: s.alertId ?? s.alertUniqueId ?? s.AlertId,
650
649
  Status: s.status ?? s.Status ?? "",
651
650
  Notes: s.notes ?? s.Notes ?? ""
@@ -657,7 +656,7 @@ function ir(e) {
657
656
  });
658
657
  },
659
658
  async getAdminSettings() {
660
- const s = Ie(e.baseUrl, "/api/detectionpolicy/alerts/GetAdminSettings"), r = await Ce(s, {
659
+ const s = xe(e.baseUrl, "/api/detectionpolicy/alerts/GetAdminSettings"), r = await Ce(s, {
661
660
  method: "GET",
662
661
  headers: t
663
662
  });
@@ -668,7 +667,7 @@ function ir(e) {
668
667
  return null;
669
668
  },
670
669
  async setAdminSettings(s) {
671
- const r = Ie(e.baseUrl, "/api/detectionpolicy/alerts/SetAdminSettings"), n = {
670
+ const r = xe(e.baseUrl, "/api/detectionpolicy/alerts/SetAdminSettings"), n = {
672
671
  userId: 0,
673
672
  isAdminSetting: !0,
674
673
  sortBy: s?.sortBy ?? ""
@@ -680,7 +679,7 @@ function ir(e) {
680
679
  });
681
680
  },
682
681
  async getPreferenceSettings() {
683
- const s = Ie(e.baseUrl, "/api/detectionpolicy/alerts/GetPreferenceSettings"), r = await Ce(s, {
682
+ const s = xe(e.baseUrl, "/api/detectionpolicy/alerts/GetPreferenceSettings"), r = await Ce(s, {
684
683
  method: "GET",
685
684
  headers: t
686
685
  });
@@ -691,9 +690,9 @@ function ir(e) {
691
690
  return null;
692
691
  },
693
692
  async setPreferenceSettings(s) {
694
- const r = Ie(e.baseUrl, "/api/detectionpolicy/alerts/SetPreferenceSettings"), n = (u) => {
695
- const { hours: f, minutes: b, seconds: p } = ns(u);
696
- return (f * 3600 + b * 60 + p) * 1e7;
693
+ const r = xe(e.baseUrl, "/api/detectionpolicy/alerts/SetPreferenceSettings"), n = (u) => {
694
+ const { hours: c, minutes: N, seconds: f } = ns(u);
695
+ return (c * 3600 + N * 60 + f) * 1e7;
697
696
  }, a = {
698
697
  Settings: {
699
698
  UserId: 0,
@@ -718,7 +717,7 @@ function ir(e) {
718
717
  };
719
718
  },
720
719
  async getAlertNotifications(s) {
721
- const r = Ie(e.baseUrl, "/api/detectionpolicy/alerts/GetNotifications"), n = jt(r, { alertId: s }), a = await Ce(n, {
720
+ const r = xe(e.baseUrl, "/api/detectionpolicy/alerts/GetNotifications"), n = jt(r, { alertId: s }), a = await Ce(n, {
722
721
  method: "GET",
723
722
  headers: t
724
723
  });
@@ -734,7 +733,7 @@ function ar() {
734
733
  return {};
735
734
  }
736
735
  }
737
- async function Re(e, t) {
736
+ async function Oe(e, t) {
738
737
  const s = {
739
738
  ...t.headers,
740
739
  ...ar()
@@ -763,48 +762,48 @@ function or(e) {
763
762
  }, s = new URL("/api/detectionpolicy/rules", e.baseUrl).toString();
764
763
  return {
765
764
  async getRules() {
766
- const r = await Re(s, { method: "GET", headers: t });
765
+ const r = await Oe(s, { method: "GET", headers: t });
767
766
  return Array.isArray(r) ? r : [];
768
767
  },
769
768
  async setEscalationSettings(r) {
770
- return Re(s, {
769
+ return Oe(s, {
771
770
  method: "POST",
772
771
  headers: t,
773
772
  body: JSON.stringify(r ?? {})
774
773
  });
775
774
  },
776
775
  async getLookups() {
777
- const r = (F) => new URL(F, e.baseUrl).toString(), n = [
778
- Re(r("/api/detectionpolicy/lookups/actiontypes"), { method: "GET", headers: t }),
779
- Re(r("/api/detectionpolicy/lookups/anomalies"), { method: "GET", headers: t }),
780
- Re(r("/api/detectionpolicy/lookups/thirdparty"), { method: "GET", headers: t }),
781
- Re(r("/api/detectionpolicy/lookups/severity"), { method: "GET", headers: t }),
782
- Re(r("/api/detectionpolicy/lookups/scheduletypes"), { method: "GET", headers: t })
776
+ const r = (U) => new URL(U, e.baseUrl).toString(), n = [
777
+ Oe(r("/api/detectionpolicy/lookups/actiontypes"), { method: "GET", headers: t }),
778
+ Oe(r("/api/detectionpolicy/lookups/anomalies"), { method: "GET", headers: t }),
779
+ Oe(r("/api/detectionpolicy/lookups/thirdparty"), { method: "GET", headers: t }),
780
+ Oe(r("/api/detectionpolicy/lookups/severity"), { method: "GET", headers: t }),
781
+ Oe(r("/api/detectionpolicy/lookups/scheduletypes"), { method: "GET", headers: t })
783
782
  ], [
784
783
  a,
785
784
  o,
786
785
  l,
787
786
  h,
788
787
  u
789
- ] = await Promise.allSettled(n), f = (F) => F.status === "fulfilled" && Array.isArray(F.value) ? F.value : [], b = f(a), p = f(o), R = f(l), x = f(h), m = f(u), A = b.map((F) => ({
790
- actionTypeId: Number(F?.ActionTypeId),
791
- name: F?.DisplayName ?? F?.Name ?? ""
792
- })), L = p.map((F) => ({
793
- recordId: F?.AnomalyId,
794
- anomalyName: F?.DisplayName ?? F?.Name ?? ""
795
- })), $ = R.map((F) => ({
796
- thirdPartyId: Number(F?.ThirdPartyId),
797
- thirdPartyName: F?.ThirdPartyName ?? F?.Name ?? ""
788
+ ] = await Promise.allSettled(n), c = (U) => U.status === "fulfilled" && Array.isArray(U.value) ? U.value : [], N = c(a), f = c(o), O = c(l), w = c(h), p = c(u), S = N.map((U) => ({
789
+ actionTypeId: Number(U?.ActionTypeId),
790
+ name: U?.DisplayName ?? U?.Name ?? ""
791
+ })), $ = f.map((U) => ({
792
+ recordId: U?.AnomalyId,
793
+ anomalyName: U?.DisplayName ?? U?.Name ?? ""
794
+ })), L = O.map((U) => ({
795
+ thirdPartyId: Number(U?.ThirdPartyId),
796
+ thirdPartyName: U?.ThirdPartyName ?? U?.Name ?? ""
798
797
  })), B = {
799
- actionTypes: A,
800
- anomalies: L,
801
- thirdParties: $
798
+ actionTypes: S,
799
+ anomalies: $,
800
+ thirdParties: L
802
801
  };
803
- return x.length && (B.severities = x), m.length && (B.scheduleTypes = m), B;
802
+ return w.length && (B.severities = w), p.length && (B.scheduleTypes = p), B;
804
803
  },
805
804
  async updateRule(r, n) {
806
805
  const a = `${s}/${r}`;
807
- return Re(a, {
806
+ return Oe(a, {
808
807
  method: "PUT",
809
808
  headers: t,
810
809
  body: JSON.stringify(n ?? {})
@@ -835,8 +834,8 @@ function lr({
835
834
  }, [r]);
836
835
  return /* @__PURE__ */ i(is.Provider, { value: n, children: s });
837
836
  }
838
- function Ne() {
839
- const e = Is(is);
837
+ function Ae() {
838
+ const e = Cs(is);
840
839
  if (!e) throw new Error("useApi must be used inside ApiProvider");
841
840
  return e;
842
841
  }
@@ -850,9 +849,9 @@ const cr = {
850
849
  High: "#FFB86A",
851
850
  Medium: "#FFCC00",
852
851
  Low: "#007AFF"
853
- }, St = 6, At = 7;
852
+ }, bt = 6, St = 7;
854
853
  function dr(e, t, s) {
855
- const r = e === St, n = e === At, a = !t.isEmailSent, o = !t.isSMSSent, l = r && a || n && o, h = r ? "Send Email" : n ? "Send SMS" : s, u = r && a ? "Email already sent" : n && o ? "SMS already sent" : `Click to ${h.toLowerCase()}`;
854
+ const r = e === bt, n = e === St, a = t.isEmailSent, o = t.isSMSSent, l = r && a || n && o, h = r ? "Send Email" : n ? "Send SMS" : s, u = r && a ? "Email already sent" : n && o ? "SMS already sent" : `Click to ${h.toLowerCase()}`;
856
855
  return { isDisabled: l, buttonText: h, tooltipTitle: u };
857
856
  }
858
857
  function hr(e) {
@@ -877,11 +876,11 @@ function Qt(e, t) {
877
876
  return `${e}-${t ? "email" : "sms"}`;
878
877
  }
879
878
  function qt(e) {
880
- return e === St || e === At;
879
+ return e === bt || e === St;
881
880
  }
882
881
  function et({ value: e, onChange: t, options: s, className: r, dropdownWidth: n }) {
883
882
  return /* @__PURE__ */ i(
884
- pe,
883
+ me,
885
884
  {
886
885
  className: r,
887
886
  options: s,
@@ -936,7 +935,7 @@ function Ar({
936
935
  return /* @__PURE__ */ d("div", { children: [
937
936
  a,
938
937
  /* @__PURE__ */ i(
939
- gt,
938
+ yt,
940
939
  {
941
940
  rowKey: n,
942
941
  dataSource: t,
@@ -953,50 +952,50 @@ function Ar({
953
952
  )
954
953
  ] });
955
954
  }
956
- function as({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOptions: n, spaceOptions: a, renderActions: o, onAlertIdClick: l, onRefetch: h }) {
957
- const [u, f] = I("All"), [b, p] = I("All"), [R, x] = I("All"), [m, A] = I("All"), [L, $] = I(""), [B, F] = I([{ label: "All", value: "All" }]), [z, V] = I(/* @__PURE__ */ new Set()), { rules: H, alerts: W } = Ne(), C = {
958
- 6: { title: "Email", kind: "icon", icon: /* @__PURE__ */ i(Fs, {}) },
959
- 7: { title: "SMS", kind: "icon", icon: /* @__PURE__ */ i(Ms, {}) }
960
- }, N = ue(() => hr(e), [e]), T = ue(() => fr(e), [e]);
961
- fe(() => {
962
- let c = !0;
955
+ function as({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOptions: n, spaceOptions: a, renderActions: o, onAlertIdClick: l, onRefetch: h, excludeCompleted: u = !0 }) {
956
+ const [c, N] = I("All"), [f, O] = I("All"), [w, p] = I("All"), [S, $] = I("All"), [L, B] = I(""), [U, Y] = I([{ label: "All", value: "All" }]), [J, G] = I(/* @__PURE__ */ new Set()), { rules: W, alerts: T } = Ae(), x = {
957
+ 6: { title: "Email", kind: "icon", icon: /* @__PURE__ */ i(Ms, {}) },
958
+ 7: { title: "SMS", kind: "icon", icon: /* @__PURE__ */ i(Fs, {}) }
959
+ }, R = ue(() => hr(e), [e]), se = ue(() => fr(e), [e]);
960
+ he(() => {
961
+ let v = !0;
963
962
  return (async () => {
964
963
  try {
965
- const v = await H.getLookups(), E = (Array.isArray(v.thirdParties) ? v.thirdParties : []).map((k) => ({
966
- label: k.thirdPartyName,
967
- value: String(k.thirdPartyId)
964
+ const b = await W.getLookups(), M = (Array.isArray(b.thirdParties) ? b.thirdParties : []).map((D) => ({
965
+ label: D.thirdPartyName,
966
+ value: String(D.thirdPartyId)
968
967
  }));
969
- c && F([{ label: "All", value: "All" }, ...E]);
970
- } catch (v) {
971
- console.error("Error loading third party options", v);
968
+ v && Y([{ label: "All", value: "All" }, ...M]);
969
+ } catch (b) {
970
+ console.error("Error loading third party options", b);
972
971
  }
973
972
  })(), () => {
974
- c = !1;
973
+ v = !1;
975
974
  };
976
- }, [H]);
975
+ }, [W]);
977
976
  const te = ue(
978
- () => (e || []).some((c) => ot(c).length > 0),
977
+ () => (e || []).some((v) => at(v).length > 0),
979
978
  [e]
980
- ), ne = ue(() => (e || []).filter((c) => {
981
- const v = u === "All" || c.priority === u, w = `${c.id} ${c.description} ${c.statusType}`.toLowerCase(), E = !L || w.includes(L.toLowerCase()), k = b === "All" || (c.anomalyName || "").toLowerCase() === b.toLowerCase(), U = R === "All" || (c.spaceName || "").toLowerCase() === R.toLowerCase(), Q = !te || m === "All" || ot(c).includes(Number(m));
982
- return v && E && k && U && Q;
983
- }), [e, u, L, b, R, m, te]), O = N, g = a && a.length ? a : T, y = [
979
+ ), k = ue(() => (e || []).filter((v) => {
980
+ const b = c === "All" || v.priority === c, P = `${v.id} ${v.description} ${v.statusType}`.toLowerCase(), M = !L || P.includes(L.toLowerCase()), D = f === "All" || (v.anomalyName || "").toLowerCase() === f.toLowerCase(), j = w === "All" || (v.spaceName || "").toLowerCase() === w.toLowerCase(), Q = !te || S === "All" || at(v).includes(Number(S)), z = !u || String(v.statusType || "").toLowerCase() !== "completed";
981
+ return b && M && D && j && Q && z;
982
+ }), [e, c, L, f, w, S, te, u]), g = R, m = a && a.length ? a : se, A = [
984
983
  {
985
984
  title: "Severity",
986
985
  dataIndex: "priority",
987
986
  key: "priority",
988
987
  width: 120,
989
- render: (c) => /* @__PURE__ */ i(Ve, { className: "px-[10px] py-[2px]", style: { border: `2px solid ${ur[c]}`, backgroundColor: cr[c] }, children: c })
988
+ render: (v) => /* @__PURE__ */ i(Ve, { className: "px-[10px] py-[2px]", style: { border: `2px solid ${ur[v]}`, backgroundColor: cr[v] }, children: v })
990
989
  },
991
990
  {
992
991
  title: "Tracker",
993
992
  key: "tracker",
994
993
  width: 140,
995
- render: (c, v) => /* @__PURE__ */ i(
994
+ render: (v, b) => /* @__PURE__ */ i(
996
995
  "a",
997
996
  {
998
- onClick: (w) => {
999
- w.preventDefault(), l?.(v, { tab: "track" });
997
+ onClick: (P) => {
998
+ P.preventDefault(), l?.(b, { tab: "track" });
1000
999
  },
1001
1000
  className: "text-blue-600 hover:underline",
1002
1001
  children: "Tracker"
@@ -1007,44 +1006,44 @@ function as({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
1007
1006
  title: "Call to action/Human in the loop",
1008
1007
  key: "actions",
1009
1008
  width: 320,
1010
- render: (c, v) => {
1011
- if (o) return /* @__PURE__ */ i(ws, { children: o(v) });
1012
- const w = ot(v);
1013
- if (!w.length) return null;
1014
- const E = async (k, U) => {
1015
- const Q = Qt(v.id, k);
1016
- V((j) => new Set(j).add(Q));
1009
+ render: (v, b) => {
1010
+ if (o) return /* @__PURE__ */ i(ws, { children: o(b) });
1011
+ const P = at(b);
1012
+ if (!P.length) return null;
1013
+ const M = async (D, j) => {
1014
+ const Q = Qt(b.id, D);
1015
+ G((z) => new Set(z).add(Q));
1017
1016
  try {
1018
- const j = await W.sendSMSorEmailNotifications?.(v.id, k, U);
1019
- j?.responseStatus ? (ie.success(j.data || (k ? "Email sent successfully" : "SMS sent successfully")), h?.()) : ie.error(j?.data || j?.errorMessage || "Failed to send notification");
1020
- } catch (j) {
1021
- ie.error(j?.message || "Failed to send notification");
1017
+ const z = await T.sendSMSorEmailNotifications?.(b.id, D, j);
1018
+ z?.responseStatus ? (ne.success(z.data || (D ? "Email sent successfully" : "SMS sent successfully")), h?.()) : ne.error(z?.data || z?.errorMessage || "Failed to send notification");
1019
+ } catch (z) {
1020
+ ne.error(z?.message || "Failed to send notification");
1022
1021
  } finally {
1023
- V((j) => {
1024
- const M = new Set(j);
1025
- return M.delete(Q), M;
1022
+ G((z) => {
1023
+ const ie = new Set(z);
1024
+ return ie.delete(Q), ie;
1026
1025
  });
1027
1026
  }
1028
1027
  };
1029
- return /* @__PURE__ */ i(Ae, { size: "middle", children: w.map((k) => {
1030
- const U = C[k];
1031
- if (!U) return null;
1032
- const Q = k === St, j = k === At, { isDisabled: M, buttonText: K, tooltipTitle: ee } = dr(k, v, U.title), Y = Qt(v.id, Q), se = qt(k) && z.has(Y), re = () => {
1033
- E(Q, j);
1028
+ return /* @__PURE__ */ i(Se, { size: "middle", children: P.map((D) => {
1029
+ const j = x[D];
1030
+ if (!j) return null;
1031
+ const Q = D === bt, z = D === St, { isDisabled: ie, buttonText: fe, tooltipTitle: le } = dr(D, b, j.title), re = Qt(b.id, Q), C = qt(D) && J.has(re), _ = () => {
1032
+ M(Q, z);
1034
1033
  };
1035
- return /* @__PURE__ */ i(Rs, { title: ee, children: /* @__PURE__ */ i(
1036
- ye,
1034
+ return /* @__PURE__ */ i(Rs, { title: le, children: /* @__PURE__ */ i(
1035
+ pe,
1037
1036
  {
1038
1037
  size: "small",
1039
- disabled: M,
1040
- loading: se,
1041
- onClick: qt(k) ? re : void 0,
1042
- icon: !se && (U.kind === "img" && U.src ? /* @__PURE__ */ i("img", { src: U.src, alt: U.alt || U.title }) : U.icon),
1038
+ disabled: ie,
1039
+ loading: C,
1040
+ onClick: qt(D) ? _ : void 0,
1041
+ icon: !C && (j.kind === "img" && j.src ? /* @__PURE__ */ i("img", { src: j.src, alt: j.alt || j.title }) : j.icon),
1043
1042
  className: "flex flex-col items-center justify-center gap-1",
1044
1043
  style: { height: "fit-content" },
1045
- children: K
1044
+ children: fe
1046
1045
  }
1047
- ) }, k);
1046
+ ) }, D);
1048
1047
  }) });
1049
1048
  }
1050
1049
  },
@@ -1053,17 +1052,17 @@ function as({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
1053
1052
  dataIndex: "timestamp",
1054
1053
  key: "timestamp",
1055
1054
  width: 220,
1056
- render: (c, v) => {
1057
- const w = v.timeElapsed ? v.timeElapsed : void 0, E = v.timeRemaining ? v.timeRemaining : void 0, k = w ? Ft(w) : 0, U = E ? Ft(E) : 0, Q = Math.round(k / (k + U) * 100);
1055
+ render: (v, b) => {
1056
+ const P = b?.timeElapsed, M = b?.timeRemaining, D = P ? Mt(P) : 0, j = M ? Mt(M) : 0, Q = Math.round(D / (D + j) * 100);
1058
1057
  return /* @__PURE__ */ d("div", { children: [
1059
1058
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1060
1059
  /* @__PURE__ */ i("span", { className: "w-[70px]", children: "Elapsed:" }),
1061
- /* @__PURE__ */ i("span", { className: "font-medium", children: w ?? "-" })
1060
+ /* @__PURE__ */ i("span", { className: "font-medium", children: P ?? "-" })
1062
1061
  ] }),
1063
- /* @__PURE__ */ i(ks, { percent: Q, showInfo: !1, size: "small", strokeColor: Hs(v.priority) }),
1062
+ /* @__PURE__ */ i(ks, { percent: Q, showInfo: !1, size: "small", strokeColor: Hs(b.priority) }),
1064
1063
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1065
1064
  /* @__PURE__ */ i("span", { className: "w-[70px]", children: "Remaining" }),
1066
- /* @__PURE__ */ i("span", { className: "font-medium", children: E ?? "-" })
1065
+ /* @__PURE__ */ i("span", { className: "font-medium", children: M ?? "-" })
1067
1066
  ] })
1068
1067
  ] });
1069
1068
  }
@@ -1078,54 +1077,54 @@ function as({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
1078
1077
  title: "Description",
1079
1078
  dataIndex: "description",
1080
1079
  key: "description",
1081
- render: (c, v) => /* @__PURE__ */ d("div", { children: [
1080
+ render: (v, b) => /* @__PURE__ */ d("div", { children: [
1082
1081
  /* @__PURE__ */ i(
1083
1082
  "a",
1084
1083
  {
1085
- onClick: (w) => {
1086
- w.preventDefault(), l?.(v);
1084
+ onClick: (P) => {
1085
+ P.preventDefault(), l?.(b);
1087
1086
  },
1088
1087
  className: "inline-block mb-1 text-blue-600",
1089
- children: v.alertNumber
1088
+ children: b.alertNumber
1090
1089
  }
1091
1090
  ),
1092
- /* @__PURE__ */ i("div", { className: "text-black/65", children: c })
1091
+ /* @__PURE__ */ i("div", { className: "text-black/65", children: v })
1093
1092
  ] })
1094
1093
  }
1095
- ], S = r && r.length ? r : y;
1094
+ ], y = r && r.length ? r : A;
1096
1095
  return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
1097
1096
  Ar,
1098
1097
  {
1099
1098
  rowKey: "id",
1100
- data: ne,
1101
- columns: S,
1099
+ data: k,
1100
+ columns: y,
1102
1101
  loading: t,
1103
1102
  pageSize: s,
1104
- toolbar: /* @__PURE__ */ d(ge, { gutter: [12, 12], className: "mb-3", align: "middle", children: [
1105
- /* @__PURE__ */ i(_, { flex: "none", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1103
+ toolbar: /* @__PURE__ */ d(ye, { gutter: [12, 12], className: "mb-3", align: "middle", children: [
1104
+ /* @__PURE__ */ i(H, { flex: "none", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1106
1105
  /* @__PURE__ */ i("span", { children: "Severity" }),
1107
- /* @__PURE__ */ i(pr, { value: u, onChange: f, options: n })
1106
+ /* @__PURE__ */ i(pr, { value: c, onChange: N, options: n })
1108
1107
  ] }) }),
1109
- /* @__PURE__ */ i(_, { flex: "none", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1108
+ /* @__PURE__ */ i(H, { flex: "none", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1110
1109
  /* @__PURE__ */ i("span", { children: "Anomaly type" }),
1111
- /* @__PURE__ */ i(gr, { value: b, onChange: p, options: O })
1110
+ /* @__PURE__ */ i(gr, { value: f, onChange: O, options: g })
1112
1111
  ] }) }),
1113
- /* @__PURE__ */ i(_, { flex: "none", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1112
+ /* @__PURE__ */ i(H, { flex: "none", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1114
1113
  /* @__PURE__ */ i("span", { children: "Space" }),
1115
- /* @__PURE__ */ i(vr, { value: R, onChange: x, options: g })
1114
+ /* @__PURE__ */ i(vr, { value: w, onChange: p, options: m })
1116
1115
  ] }) }),
1117
- /* @__PURE__ */ i(_, { flex: "none", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1116
+ /* @__PURE__ */ i(H, { flex: "none", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1118
1117
  /* @__PURE__ */ i("span", { children: "Action Taken" }),
1119
- /* @__PURE__ */ i(Sr, { value: m, onChange: A, options: B })
1118
+ /* @__PURE__ */ i(Sr, { value: S, onChange: $, options: U })
1120
1119
  ] }) }),
1121
- /* @__PURE__ */ i(_, { flex: "auto" }),
1122
- /* @__PURE__ */ i(_, { flex: "none", children: /* @__PURE__ */ i(
1120
+ /* @__PURE__ */ i(H, { flex: "auto" }),
1121
+ /* @__PURE__ */ i(H, { flex: "none", children: /* @__PURE__ */ i(
1123
1122
  Ts.Search,
1124
1123
  {
1125
1124
  allowClear: !0,
1126
1125
  placeholder: "Search",
1127
- onSearch: $,
1128
- onChange: (c) => $(c.target.value),
1126
+ onSearch: B,
1127
+ onChange: (v) => B(v.target.value),
1129
1128
  className: "w-[260px] ",
1130
1129
  enterButton: !0
1131
1130
  }
@@ -1134,7 +1133,7 @@ function as({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
1134
1133
  }
1135
1134
  ) });
1136
1135
  }
1137
- var Le = class {
1136
+ var Be = class {
1138
1137
  constructor() {
1139
1138
  this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
1140
1139
  }
@@ -1192,26 +1191,26 @@ var Le = class {
1192
1191
  clearInterval(e) {
1193
1192
  this.#e.clearInterval(e);
1194
1193
  }
1195
- }, Pe = new wr();
1194
+ }, Fe = new wr();
1196
1195
  function xr(e) {
1197
1196
  setTimeout(e, 0);
1198
1197
  }
1199
- var Ee = typeof window > "u" || "Deno" in globalThis;
1200
- function he() {
1198
+ var Me = typeof window > "u" || "Deno" in globalThis;
1199
+ function de() {
1201
1200
  }
1202
- function Ir(e, t) {
1201
+ function Cr(e, t) {
1203
1202
  return typeof e == "function" ? e(t) : e;
1204
1203
  }
1205
- function ut(e) {
1204
+ function lt(e) {
1206
1205
  return typeof e == "number" && e >= 0 && e !== 1 / 0;
1207
1206
  }
1208
1207
  function os(e, t) {
1209
1208
  return Math.max(e + (t || 0) - Date.now(), 0);
1210
1209
  }
1211
- function ke(e, t) {
1210
+ function Pe(e, t) {
1212
1211
  return typeof e == "function" ? e(t) : e;
1213
1212
  }
1214
- function ve(e, t) {
1213
+ function ge(e, t) {
1215
1214
  return typeof e == "function" ? e(t) : e;
1216
1215
  }
1217
1216
  function _t(e, t) {
@@ -1225,9 +1224,9 @@ function _t(e, t) {
1225
1224
  } = e;
1226
1225
  if (o) {
1227
1226
  if (r) {
1228
- if (t.queryHash !== Nt(o, t.options))
1227
+ if (t.queryHash !== At(o, t.options))
1229
1228
  return !1;
1230
- } else if (!Qe(t.queryKey, o))
1229
+ } else if (!qe(t.queryKey, o))
1231
1230
  return !1;
1232
1231
  }
1233
1232
  if (s !== "all") {
@@ -1243,45 +1242,45 @@ function Ht(e, t) {
1243
1242
  if (!t.options.mutationKey)
1244
1243
  return !1;
1245
1244
  if (s) {
1246
- if (De(t.options.mutationKey) !== De(a))
1245
+ if (Ue(t.options.mutationKey) !== Ue(a))
1247
1246
  return !1;
1248
- } else if (!Qe(t.options.mutationKey, a))
1247
+ } else if (!qe(t.options.mutationKey, a))
1249
1248
  return !1;
1250
1249
  }
1251
1250
  return !(r && t.state.status !== r || n && !n(t));
1252
1251
  }
1253
- function Nt(e, t) {
1254
- return (t?.queryKeyHashFn || De)(e);
1252
+ function At(e, t) {
1253
+ return (t?.queryKeyHashFn || Ue)(e);
1255
1254
  }
1256
- function De(e) {
1255
+ function Ue(e) {
1257
1256
  return JSON.stringify(
1258
1257
  e,
1259
- (t, s) => ht(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
1258
+ (t, s) => ut(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
1260
1259
  );
1261
1260
  }
1262
- function Qe(e, t) {
1263
- return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => Qe(e[s], t[s])) : !1;
1261
+ function qe(e, t) {
1262
+ return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => qe(e[s], t[s])) : !1;
1264
1263
  }
1265
- var Cr = Object.prototype.hasOwnProperty;
1266
- function dt(e, t) {
1264
+ var Ir = Object.prototype.hasOwnProperty;
1265
+ function ct(e, t) {
1267
1266
  if (e === t)
1268
1267
  return e;
1269
1268
  const s = Gt(e) && Gt(t);
1270
- if (!s && !(ht(e) && ht(t))) return t;
1269
+ if (!s && !(ut(e) && ut(t))) return t;
1271
1270
  const n = (s ? e : Object.keys(e)).length, a = s ? t : Object.keys(t), o = a.length, l = s ? new Array(o) : {};
1272
1271
  let h = 0;
1273
1272
  for (let u = 0; u < o; u++) {
1274
- const f = s ? u : a[u], b = e[f], p = t[f];
1275
- if (b === p) {
1276
- l[f] = b, (s ? u < n : Cr.call(e, f)) && h++;
1273
+ const c = s ? u : a[u], N = e[c], f = t[c];
1274
+ if (N === f) {
1275
+ l[c] = N, (s ? u < n : Ir.call(e, c)) && h++;
1277
1276
  continue;
1278
1277
  }
1279
- if (b === null || p === null || typeof b != "object" || typeof p != "object") {
1280
- l[f] = p;
1278
+ if (N === null || f === null || typeof N != "object" || typeof f != "object") {
1279
+ l[c] = f;
1281
1280
  continue;
1282
1281
  }
1283
- const R = dt(b, p);
1284
- l[f] = R, R === b && h++;
1282
+ const O = ct(N, f);
1283
+ l[c] = O, O === N && h++;
1285
1284
  }
1286
1285
  return n === o && h === n ? e : l;
1287
1286
  }
@@ -1296,7 +1295,7 @@ function Je(e, t) {
1296
1295
  function Gt(e) {
1297
1296
  return Array.isArray(e) && e.length === Object.keys(e).length;
1298
1297
  }
1299
- function ht(e) {
1298
+ function ut(e) {
1300
1299
  if (!Wt(e))
1301
1300
  return !1;
1302
1301
  const t = e.constructor;
@@ -1310,22 +1309,22 @@ function Wt(e) {
1310
1309
  }
1311
1310
  function Tr(e) {
1312
1311
  return new Promise((t) => {
1313
- Pe.setTimeout(t, e);
1312
+ Fe.setTimeout(t, e);
1314
1313
  });
1315
1314
  }
1316
- function ft(e, t, s) {
1315
+ function dt(e, t, s) {
1317
1316
  if (typeof s.structuralSharing == "function")
1318
1317
  return s.structuralSharing(e, t);
1319
1318
  if (s.structuralSharing !== !1) {
1320
1319
  if (process.env.NODE_ENV !== "production")
1321
1320
  try {
1322
- return dt(e, t);
1321
+ return ct(e, t);
1323
1322
  } catch (r) {
1324
1323
  throw console.error(
1325
1324
  `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
1326
1325
  ), r;
1327
1326
  }
1328
- return dt(e, t);
1327
+ return ct(e, t);
1329
1328
  }
1330
1329
  return t;
1331
1330
  }
@@ -1343,7 +1342,7 @@ function ls(e, t) {
1343
1342
  `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
1344
1343
  ), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === Xe ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
1345
1344
  }
1346
- function wt(e, t) {
1345
+ function Nt(e, t) {
1347
1346
  return typeof e == "function" ? e(...t) : !!e;
1348
1347
  }
1349
1348
  function Or(e, t, s) {
@@ -1353,13 +1352,13 @@ function Or(e, t, s) {
1353
1352
  get: () => (n ??= t(), r || (r = !0, n.aborted ? s() : n.addEventListener("abort", s, { once: !0 })), n)
1354
1353
  }), e;
1355
1354
  }
1356
- var Pr = class extends Le {
1355
+ var Pr = class extends Be {
1357
1356
  #e;
1358
1357
  #t;
1359
1358
  #s;
1360
1359
  constructor() {
1361
1360
  super(), this.#s = (e) => {
1362
- if (!Ee && window.addEventListener) {
1361
+ if (!Me && window.addEventListener) {
1363
1362
  const t = () => e();
1364
1363
  return window.addEventListener("visibilitychange", t, !1), () => {
1365
1364
  window.removeEventListener("visibilitychange", t);
@@ -1390,8 +1389,8 @@ var Pr = class extends Le {
1390
1389
  isFocused() {
1391
1390
  return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
1392
1391
  }
1393
- }, xt = new Pr();
1394
- function mt() {
1392
+ }, wt = new Pr();
1393
+ function ht() {
1395
1394
  let e, t;
1396
1395
  const s = new Promise((n, a) => {
1397
1396
  e = n, t = a;
@@ -1473,13 +1472,13 @@ function Dr() {
1473
1472
  }
1474
1473
  };
1475
1474
  }
1476
- var ae = Dr(), Mr = class extends Le {
1475
+ var ae = Dr(), Fr = class extends Be {
1477
1476
  #e = !0;
1478
1477
  #t;
1479
1478
  #s;
1480
1479
  constructor() {
1481
1480
  super(), this.#s = (e) => {
1482
- if (!Ee && window.addEventListener) {
1481
+ if (!Me && window.addEventListener) {
1483
1482
  const t = () => e(!0), s = () => e(!1);
1484
1483
  return window.addEventListener("online", t, !1), window.addEventListener("offline", s, !1), () => {
1485
1484
  window.removeEventListener("online", t), window.removeEventListener("offline", s);
@@ -1504,59 +1503,59 @@ var ae = Dr(), Mr = class extends Le {
1504
1503
  isOnline() {
1505
1504
  return this.#e;
1506
1505
  }
1507
- }, Ze = new Mr();
1508
- function Fr(e) {
1506
+ }, Ze = new Fr();
1507
+ function Mr(e) {
1509
1508
  return Math.min(1e3 * 2 ** e, 3e4);
1510
1509
  }
1511
1510
  function cs(e) {
1512
1511
  return (e ?? "online") === "online" ? Ze.isOnline() : !0;
1513
1512
  }
1514
- var pt = class extends Error {
1513
+ var ft = class extends Error {
1515
1514
  constructor(e) {
1516
1515
  super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
1517
1516
  }
1518
1517
  };
1519
1518
  function us(e) {
1520
1519
  let t = !1, s = 0, r;
1521
- const n = mt(), a = () => n.status !== "pending", o = (m) => {
1520
+ const n = ht(), a = () => n.status !== "pending", o = (p) => {
1522
1521
  if (!a()) {
1523
- const A = new pt(m);
1524
- p(A), e.onCancel?.(A);
1522
+ const S = new ft(p);
1523
+ f(S), e.onCancel?.(S);
1525
1524
  }
1526
1525
  }, l = () => {
1527
1526
  t = !0;
1528
1527
  }, h = () => {
1529
1528
  t = !1;
1530
- }, u = () => xt.isFocused() && (e.networkMode === "always" || Ze.isOnline()) && e.canRun(), f = () => cs(e.networkMode) && e.canRun(), b = (m) => {
1531
- a() || (r?.(), n.resolve(m));
1532
- }, p = (m) => {
1533
- a() || (r?.(), n.reject(m));
1534
- }, R = () => new Promise((m) => {
1535
- r = (A) => {
1536
- (a() || u()) && m(A);
1529
+ }, u = () => wt.isFocused() && (e.networkMode === "always" || Ze.isOnline()) && e.canRun(), c = () => cs(e.networkMode) && e.canRun(), N = (p) => {
1530
+ a() || (r?.(), n.resolve(p));
1531
+ }, f = (p) => {
1532
+ a() || (r?.(), n.reject(p));
1533
+ }, O = () => new Promise((p) => {
1534
+ r = (S) => {
1535
+ (a() || u()) && p(S);
1537
1536
  }, e.onPause?.();
1538
1537
  }).then(() => {
1539
1538
  r = void 0, a() || e.onContinue?.();
1540
- }), x = () => {
1539
+ }), w = () => {
1541
1540
  if (a())
1542
1541
  return;
1543
- let m;
1544
- const A = s === 0 ? e.initialPromise : void 0;
1542
+ let p;
1543
+ const S = s === 0 ? e.initialPromise : void 0;
1545
1544
  try {
1546
- m = A ?? e.fn();
1547
- } catch (L) {
1548
- m = Promise.reject(L);
1545
+ p = S ?? e.fn();
1546
+ } catch ($) {
1547
+ p = Promise.reject($);
1549
1548
  }
1550
- Promise.resolve(m).then(b).catch((L) => {
1549
+ Promise.resolve(p).then(N).catch(($) => {
1551
1550
  if (a())
1552
1551
  return;
1553
- const $ = e.retry ?? (Ee ? 0 : 3), B = e.retryDelay ?? Fr, F = typeof B == "function" ? B(s, L) : B, z = $ === !0 || typeof $ == "number" && s < $ || typeof $ == "function" && $(s, L);
1554
- if (t || !z) {
1555
- p(L);
1552
+ const L = e.retry ?? (Me ? 0 : 3), B = e.retryDelay ?? Mr, U = typeof B == "function" ? B(s, $) : B, Y = L === !0 || typeof L == "number" && s < L || typeof L == "function" && L(s, $);
1553
+ if (t || !Y) {
1554
+ f($);
1556
1555
  return;
1557
1556
  }
1558
- s++, e.onFail?.(s, L), Tr(F).then(() => u() ? void 0 : R()).then(() => {
1559
- t ? p(L) : x();
1557
+ s++, e.onFail?.(s, $), Tr(U).then(() => u() ? void 0 : O()).then(() => {
1558
+ t ? f($) : w();
1560
1559
  });
1561
1560
  });
1562
1561
  };
@@ -1567,8 +1566,8 @@ function us(e) {
1567
1566
  continue: () => (r?.(), n),
1568
1567
  cancelRetry: l,
1569
1568
  continueRetry: h,
1570
- canStart: f,
1571
- start: () => (f() ? x() : R().then(x), n)
1569
+ canStart: c,
1570
+ start: () => (c() ? w() : O().then(w), n)
1572
1571
  };
1573
1572
  }
1574
1573
  var ds = class {
@@ -1577,18 +1576,18 @@ var ds = class {
1577
1576
  this.clearGcTimeout();
1578
1577
  }
1579
1578
  scheduleGc() {
1580
- this.clearGcTimeout(), ut(this.gcTime) && (this.#e = Pe.setTimeout(() => {
1579
+ this.clearGcTimeout(), lt(this.gcTime) && (this.#e = Fe.setTimeout(() => {
1581
1580
  this.optionalRemove();
1582
1581
  }, this.gcTime));
1583
1582
  }
1584
1583
  updateGcTime(e) {
1585
1584
  this.gcTime = Math.max(
1586
1585
  this.gcTime || 0,
1587
- e ?? (Ee ? 1 / 0 : 300 * 1e3)
1586
+ e ?? (Me ? 1 / 0 : 300 * 1e3)
1588
1587
  );
1589
1588
  }
1590
1589
  clearGcTimeout() {
1591
- this.#e && (Pe.clearTimeout(this.#e), this.#e = void 0);
1590
+ this.#e && (Fe.clearTimeout(this.#e), this.#e = void 0);
1592
1591
  }
1593
1592
  }, Ur = class extends ds {
1594
1593
  #e;
@@ -1619,7 +1618,7 @@ var ds = class {
1619
1618
  !this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
1620
1619
  }
1621
1620
  setData(e, t) {
1622
- const s = ft(this.state.data, e, this.options);
1621
+ const s = dt(this.state.data, e, this.options);
1623
1622
  return this.#i({
1624
1623
  data: s,
1625
1624
  type: "success",
@@ -1632,7 +1631,7 @@ var ds = class {
1632
1631
  }
1633
1632
  cancel(e) {
1634
1633
  const t = this.#r?.promise;
1635
- return this.#r?.cancel(e), t ? t.then(he).catch(he) : Promise.resolve();
1634
+ return this.#r?.cancel(e), t ? t.then(de).catch(de) : Promise.resolve();
1636
1635
  }
1637
1636
  destroy() {
1638
1637
  super.destroy(), this.cancel({ silent: !0 });
@@ -1642,7 +1641,7 @@ var ds = class {
1642
1641
  }
1643
1642
  isActive() {
1644
1643
  return this.observers.some(
1645
- (e) => ve(e.options.enabled, this) !== !1
1644
+ (e) => ge(e.options.enabled, this) !== !1
1646
1645
  );
1647
1646
  }
1648
1647
  isDisabled() {
@@ -1650,7 +1649,7 @@ var ds = class {
1650
1649
  }
1651
1650
  isStatic() {
1652
1651
  return this.getObserversCount() > 0 ? this.observers.some(
1653
- (e) => ke(e.options.staleTime, this) === "static"
1652
+ (e) => Pe(e.options.staleTime, this) === "static"
1654
1653
  ) : !1;
1655
1654
  }
1656
1655
  isStale() {
@@ -1703,12 +1702,12 @@ var ds = class {
1703
1702
  });
1704
1703
  }, n = () => {
1705
1704
  const l = ls(this.options, t), u = (() => {
1706
- const f = {
1705
+ const c = {
1707
1706
  client: this.#n,
1708
1707
  queryKey: this.queryKey,
1709
1708
  meta: this.meta
1710
1709
  };
1711
- return r(f), f;
1710
+ return r(c), c;
1712
1711
  })();
1713
1712
  return this.#o = !1, this.options.persister ? this.options.persister(
1714
1713
  l,
@@ -1730,7 +1729,7 @@ var ds = class {
1730
1729
  initialPromise: t?.initialPromise,
1731
1730
  fn: o.fetchFn,
1732
1731
  onCancel: (l) => {
1733
- l instanceof pt && l.revert && this.setState({
1732
+ l instanceof ft && l.revert && this.setState({
1734
1733
  ...this.#t,
1735
1734
  fetchStatus: "idle"
1736
1735
  }), s.abort();
@@ -1761,7 +1760,7 @@ var ds = class {
1761
1760
  this
1762
1761
  ), l;
1763
1762
  } catch (l) {
1764
- if (l instanceof pt) {
1763
+ if (l instanceof ft) {
1765
1764
  if (l.silent)
1766
1765
  return this.#r.promise;
1767
1766
  if (l.revert) {
@@ -1893,9 +1892,9 @@ function Yt(e) {
1893
1892
  fetchStatus: "idle"
1894
1893
  };
1895
1894
  }
1896
- var Lr = class extends Le {
1895
+ var Lr = class extends Be {
1897
1896
  constructor(e, t) {
1898
- super(), this.options = t, this.#e = e, this.#i = null, this.#o = mt(), this.bindMethods(), this.setOptions(t);
1897
+ super(), this.options = t, this.#e = e, this.#i = null, this.#o = ht(), this.bindMethods(), this.setOptions(t);
1899
1898
  }
1900
1899
  #e;
1901
1900
  #t = void 0;
@@ -1924,14 +1923,14 @@ var Lr = class extends Le {
1924
1923
  this.hasListeners() || this.destroy();
1925
1924
  }
1926
1925
  shouldFetchOnReconnect() {
1927
- return yt(
1926
+ return mt(
1928
1927
  this.#t,
1929
1928
  this.options,
1930
1929
  this.options.refetchOnReconnect
1931
1930
  );
1932
1931
  }
1933
1932
  shouldFetchOnWindowFocus() {
1934
- return yt(
1933
+ return mt(
1935
1934
  this.#t,
1936
1935
  this.options,
1937
1936
  this.options.refetchOnWindowFocus
@@ -1942,7 +1941,7 @@ var Lr = class extends Le {
1942
1941
  }
1943
1942
  setOptions(e) {
1944
1943
  const t = this.options, s = this.#t;
1945
- if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof ve(this.options.enabled, this.#t) != "boolean")
1944
+ if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof ge(this.options.enabled, this.#t) != "boolean")
1946
1945
  throw new Error(
1947
1946
  "Expected enabled to be a boolean or a callback that returns a boolean"
1948
1947
  );
@@ -1957,9 +1956,9 @@ var Lr = class extends Le {
1957
1956
  s,
1958
1957
  this.options,
1959
1958
  t
1960
- ) && this.#d(), this.updateResult(), r && (this.#t !== s || ve(this.options.enabled, this.#t) !== ve(t.enabled, this.#t) || ke(this.options.staleTime, this.#t) !== ke(t.staleTime, this.#t)) && this.#y();
1959
+ ) && this.#d(), this.updateResult(), r && (this.#t !== s || ge(this.options.enabled, this.#t) !== ge(t.enabled, this.#t) || Pe(this.options.staleTime, this.#t) !== Pe(t.staleTime, this.#t)) && this.#y();
1961
1960
  const n = this.#g();
1962
- r && (this.#t !== s || ve(this.options.enabled, this.#t) !== ve(t.enabled, this.#t) || n !== this.#l) && this.#v(n);
1961
+ r && (this.#t !== s || ge(this.options.enabled, this.#t) !== ge(t.enabled, this.#t) || n !== this.#l) && this.#v(n);
1963
1962
  }
1964
1963
  getOptimisticResult(e) {
1965
1964
  const t = this.#e.getQueryCache().build(this.#e, e), s = this.createResult(t, e);
@@ -2004,18 +2003,18 @@ var Lr = class extends Le {
2004
2003
  this.options,
2005
2004
  e
2006
2005
  );
2007
- return e?.throwOnError || (t = t.catch(he)), t;
2006
+ return e?.throwOnError || (t = t.catch(de)), t;
2008
2007
  }
2009
2008
  #y() {
2010
2009
  this.#S();
2011
- const e = ke(
2010
+ const e = Pe(
2012
2011
  this.options.staleTime,
2013
2012
  this.#t
2014
2013
  );
2015
- if (Ee || this.#n.isStale || !ut(e))
2014
+ if (Me || this.#n.isStale || !lt(e))
2016
2015
  return;
2017
2016
  const s = os(this.#n.dataUpdatedAt, e) + 1;
2018
- this.#c = Pe.setTimeout(() => {
2017
+ this.#c = Fe.setTimeout(() => {
2019
2018
  this.#n.isStale || this.updateResult();
2020
2019
  }, s);
2021
2020
  }
@@ -2023,101 +2022,101 @@ var Lr = class extends Le {
2023
2022
  return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
2024
2023
  }
2025
2024
  #v(e) {
2026
- this.#A(), this.#l = e, !(Ee || ve(this.options.enabled, this.#t) === !1 || !ut(this.#l) || this.#l === 0) && (this.#u = Pe.setInterval(() => {
2027
- (this.options.refetchIntervalInBackground || xt.isFocused()) && this.#d();
2025
+ this.#A(), this.#l = e, !(Me || ge(this.options.enabled, this.#t) === !1 || !lt(this.#l) || this.#l === 0) && (this.#u = Fe.setInterval(() => {
2026
+ (this.options.refetchIntervalInBackground || wt.isFocused()) && this.#d();
2028
2027
  }, this.#l));
2029
2028
  }
2030
2029
  #b() {
2031
2030
  this.#y(), this.#v(this.#g());
2032
2031
  }
2033
2032
  #S() {
2034
- this.#c && (Pe.clearTimeout(this.#c), this.#c = void 0);
2033
+ this.#c && (Fe.clearTimeout(this.#c), this.#c = void 0);
2035
2034
  }
2036
2035
  #A() {
2037
- this.#u && (Pe.clearInterval(this.#u), this.#u = void 0);
2036
+ this.#u && (Fe.clearInterval(this.#u), this.#u = void 0);
2038
2037
  }
2039
2038
  createResult(e, t) {
2040
2039
  const s = this.#t, r = this.options, n = this.#n, a = this.#r, o = this.#a, h = e !== s ? e.state : this.#s, { state: u } = e;
2041
- let f = { ...u }, b = !1, p;
2040
+ let c = { ...u }, N = !1, f;
2042
2041
  if (t._optimisticResults) {
2043
- const W = this.hasListeners(), C = !W && zt(e, t), N = W && Vt(e, s, t, r);
2044
- (C || N) && (f = {
2045
- ...f,
2042
+ const W = this.hasListeners(), T = !W && zt(e, t), x = W && Vt(e, s, t, r);
2043
+ (T || x) && (c = {
2044
+ ...c,
2046
2045
  ...hs(u.data, e.options)
2047
- }), t._optimisticResults === "isRestoring" && (f.fetchStatus = "idle");
2046
+ }), t._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
2048
2047
  }
2049
- let { error: R, errorUpdatedAt: x, status: m } = f;
2050
- p = f.data;
2051
- let A = !1;
2052
- if (t.placeholderData !== void 0 && p === void 0 && m === "pending") {
2048
+ let { error: O, errorUpdatedAt: w, status: p } = c;
2049
+ f = c.data;
2050
+ let S = !1;
2051
+ if (t.placeholderData !== void 0 && f === void 0 && p === "pending") {
2053
2052
  let W;
2054
- n?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (W = n.data, A = !0) : W = typeof t.placeholderData == "function" ? t.placeholderData(
2053
+ n?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (W = n.data, S = !0) : W = typeof t.placeholderData == "function" ? t.placeholderData(
2055
2054
  this.#f?.state.data,
2056
2055
  this.#f
2057
- ) : t.placeholderData, W !== void 0 && (m = "success", p = ft(
2056
+ ) : t.placeholderData, W !== void 0 && (p = "success", f = dt(
2058
2057
  n?.data,
2059
2058
  W,
2060
2059
  t
2061
- ), b = !0);
2060
+ ), N = !0);
2062
2061
  }
2063
- if (t.select && p !== void 0 && !A)
2064
- if (n && p === a?.data && t.select === this.#p)
2065
- p = this.#h;
2062
+ if (t.select && f !== void 0 && !S)
2063
+ if (n && f === a?.data && t.select === this.#p)
2064
+ f = this.#h;
2066
2065
  else
2067
2066
  try {
2068
- this.#p = t.select, p = t.select(p), p = ft(n?.data, p, t), this.#h = p, this.#i = null;
2067
+ this.#p = t.select, f = t.select(f), f = dt(n?.data, f, t), this.#h = f, this.#i = null;
2069
2068
  } catch (W) {
2070
2069
  this.#i = W;
2071
2070
  }
2072
- this.#i && (R = this.#i, p = this.#h, x = Date.now(), m = "error");
2073
- const L = f.fetchStatus === "fetching", $ = m === "pending", B = m === "error", F = $ && L, z = p !== void 0, H = {
2074
- status: m,
2075
- fetchStatus: f.fetchStatus,
2076
- isPending: $,
2077
- isSuccess: m === "success",
2071
+ this.#i && (O = this.#i, f = this.#h, w = Date.now(), p = "error");
2072
+ const $ = c.fetchStatus === "fetching", L = p === "pending", B = p === "error", U = L && $, Y = f !== void 0, G = {
2073
+ status: p,
2074
+ fetchStatus: c.fetchStatus,
2075
+ isPending: L,
2076
+ isSuccess: p === "success",
2078
2077
  isError: B,
2079
- isInitialLoading: F,
2080
- isLoading: F,
2081
- data: p,
2082
- dataUpdatedAt: f.dataUpdatedAt,
2083
- error: R,
2084
- errorUpdatedAt: x,
2085
- failureCount: f.fetchFailureCount,
2086
- failureReason: f.fetchFailureReason,
2087
- errorUpdateCount: f.errorUpdateCount,
2088
- isFetched: f.dataUpdateCount > 0 || f.errorUpdateCount > 0,
2089
- isFetchedAfterMount: f.dataUpdateCount > h.dataUpdateCount || f.errorUpdateCount > h.errorUpdateCount,
2090
- isFetching: L,
2091
- isRefetching: L && !$,
2092
- isLoadingError: B && !z,
2093
- isPaused: f.fetchStatus === "paused",
2094
- isPlaceholderData: b,
2095
- isRefetchError: B && z,
2096
- isStale: It(e, t),
2078
+ isInitialLoading: U,
2079
+ isLoading: U,
2080
+ data: f,
2081
+ dataUpdatedAt: c.dataUpdatedAt,
2082
+ error: O,
2083
+ errorUpdatedAt: w,
2084
+ failureCount: c.fetchFailureCount,
2085
+ failureReason: c.fetchFailureReason,
2086
+ errorUpdateCount: c.errorUpdateCount,
2087
+ isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
2088
+ isFetchedAfterMount: c.dataUpdateCount > h.dataUpdateCount || c.errorUpdateCount > h.errorUpdateCount,
2089
+ isFetching: $,
2090
+ isRefetching: $ && !L,
2091
+ isLoadingError: B && !Y,
2092
+ isPaused: c.fetchStatus === "paused",
2093
+ isPlaceholderData: N,
2094
+ isRefetchError: B && Y,
2095
+ isStale: xt(e, t),
2097
2096
  refetch: this.refetch,
2098
2097
  promise: this.#o,
2099
- isEnabled: ve(t.enabled, e) !== !1
2098
+ isEnabled: ge(t.enabled, e) !== !1
2100
2099
  };
2101
2100
  if (this.options.experimental_prefetchInRender) {
2102
- const W = (T) => {
2103
- H.status === "error" ? T.reject(H.error) : H.data !== void 0 && T.resolve(H.data);
2104
- }, C = () => {
2105
- const T = this.#o = H.promise = mt();
2106
- W(T);
2107
- }, N = this.#o;
2108
- switch (N.status) {
2101
+ const W = (R) => {
2102
+ G.status === "error" ? R.reject(G.error) : G.data !== void 0 && R.resolve(G.data);
2103
+ }, T = () => {
2104
+ const R = this.#o = G.promise = ht();
2105
+ W(R);
2106
+ }, x = this.#o;
2107
+ switch (x.status) {
2109
2108
  case "pending":
2110
- e.queryHash === s.queryHash && W(N);
2109
+ e.queryHash === s.queryHash && W(x);
2111
2110
  break;
2112
2111
  case "fulfilled":
2113
- (H.status === "error" || H.data !== N.value) && C();
2112
+ (G.status === "error" || G.data !== x.value) && T();
2114
2113
  break;
2115
2114
  case "rejected":
2116
- (H.status !== "error" || H.error !== N.reason) && C();
2115
+ (G.status !== "error" || G.error !== x.reason) && T();
2117
2116
  break;
2118
2117
  }
2119
2118
  }
2120
- return H;
2119
+ return G;
2121
2120
  }
2122
2121
  updateResult() {
2123
2122
  const e = this.#n, t = this.createResult(this.#t, this.options);
@@ -2162,23 +2161,23 @@ var Lr = class extends Le {
2162
2161
  }
2163
2162
  };
2164
2163
  function $r(e, t) {
2165
- return ve(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
2164
+ return ge(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
2166
2165
  }
2167
2166
  function zt(e, t) {
2168
- return $r(e, t) || e.state.data !== void 0 && yt(e, t, t.refetchOnMount);
2167
+ return $r(e, t) || e.state.data !== void 0 && mt(e, t, t.refetchOnMount);
2169
2168
  }
2170
- function yt(e, t, s) {
2171
- if (ve(t.enabled, e) !== !1 && ke(t.staleTime, e) !== "static") {
2169
+ function mt(e, t, s) {
2170
+ if (ge(t.enabled, e) !== !1 && Pe(t.staleTime, e) !== "static") {
2172
2171
  const r = typeof s == "function" ? s(e) : s;
2173
- return r === "always" || r !== !1 && It(e, t);
2172
+ return r === "always" || r !== !1 && xt(e, t);
2174
2173
  }
2175
2174
  return !1;
2176
2175
  }
2177
2176
  function Vt(e, t, s, r) {
2178
- return (e !== t || ve(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && It(e, s);
2177
+ return (e !== t || ge(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && xt(e, s);
2179
2178
  }
2180
- function It(e, t) {
2181
- return ve(t.enabled, e) !== !1 && e.isStaleByTime(ke(t.staleTime, e));
2179
+ function xt(e, t) {
2180
+ return ge(t.enabled, e) !== !1 && e.isStaleByTime(Pe(t.staleTime, e));
2182
2181
  }
2183
2182
  function Br(e, t) {
2184
2183
  return !Je(e.getCurrentResult(), t);
@@ -2189,47 +2188,47 @@ function Jt(e) {
2189
2188
  const r = t.options, n = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [];
2190
2189
  let l = { pages: [], pageParams: [] }, h = 0;
2191
2190
  const u = async () => {
2192
- let f = !1;
2193
- const b = (x) => {
2191
+ let c = !1;
2192
+ const N = (w) => {
2194
2193
  Or(
2195
- x,
2194
+ w,
2196
2195
  () => t.signal,
2197
- () => f = !0
2196
+ () => c = !0
2198
2197
  );
2199
- }, p = ls(t.options, t.fetchOptions), R = async (x, m, A) => {
2200
- if (f)
2198
+ }, f = ls(t.options, t.fetchOptions), O = async (w, p, S) => {
2199
+ if (c)
2201
2200
  return Promise.reject();
2202
- if (m == null && x.pages.length)
2203
- return Promise.resolve(x);
2204
- const $ = (() => {
2205
- const V = {
2201
+ if (p == null && w.pages.length)
2202
+ return Promise.resolve(w);
2203
+ const L = (() => {
2204
+ const J = {
2206
2205
  client: t.client,
2207
2206
  queryKey: t.queryKey,
2208
- pageParam: m,
2209
- direction: A ? "backward" : "forward",
2207
+ pageParam: p,
2208
+ direction: S ? "backward" : "forward",
2210
2209
  meta: t.options.meta
2211
2210
  };
2212
- return b(V), V;
2213
- })(), B = await p($), { maxPages: F } = t.options, z = A ? kr : Rr;
2211
+ return N(J), J;
2212
+ })(), B = await f(L), { maxPages: U } = t.options, Y = S ? kr : Rr;
2214
2213
  return {
2215
- pages: z(x.pages, B, F),
2216
- pageParams: z(x.pageParams, m, F)
2214
+ pages: Y(w.pages, B, U),
2215
+ pageParams: Y(w.pageParams, p, U)
2217
2216
  };
2218
2217
  };
2219
2218
  if (n && a.length) {
2220
- const x = n === "backward", m = x ? jr : Xt, A = {
2219
+ const w = n === "backward", p = w ? jr : Xt, S = {
2221
2220
  pages: a,
2222
2221
  pageParams: o
2223
- }, L = m(r, A);
2224
- l = await R(A, L, x);
2222
+ }, $ = p(r, S);
2223
+ l = await O(S, $, w);
2225
2224
  } else {
2226
- const x = e ?? a.length;
2225
+ const w = e ?? a.length;
2227
2226
  do {
2228
- const m = h === 0 ? o[0] ?? r.initialPageParam : Xt(r, l);
2229
- if (h > 0 && m == null)
2227
+ const p = h === 0 ? o[0] ?? r.initialPageParam : Xt(r, l);
2228
+ if (h > 0 && p == null)
2230
2229
  break;
2231
- l = await R(l, m), h++;
2232
- } while (h < x);
2230
+ l = await O(l, p), h++;
2231
+ } while (h < w);
2233
2232
  }
2234
2233
  return l;
2235
2234
  };
@@ -2490,7 +2489,7 @@ function fs() {
2490
2489
  submittedAt: 0
2491
2490
  };
2492
2491
  }
2493
- var qr = class extends Le {
2492
+ var qr = class extends Be {
2494
2493
  constructor(e = {}) {
2495
2494
  super(), this.config = e, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#s = 0;
2496
2495
  }
@@ -2574,7 +2573,7 @@ var qr = class extends Le {
2574
2573
  const e = this.getAll().filter((t) => t.state.isPaused);
2575
2574
  return ae.batch(
2576
2575
  () => Promise.all(
2577
- e.map((t) => t.continue().catch(he))
2576
+ e.map((t) => t.continue().catch(de))
2578
2577
  )
2579
2578
  );
2580
2579
  }
@@ -2582,7 +2581,7 @@ var qr = class extends Le {
2582
2581
  function Ke(e) {
2583
2582
  return e.options.scope?.id;
2584
2583
  }
2585
- var _r = class extends Le {
2584
+ var _r = class extends Be {
2586
2585
  #e;
2587
2586
  #t = void 0;
2588
2587
  #s;
@@ -2599,7 +2598,7 @@ var _r = class extends Le {
2599
2598
  type: "observerOptionsUpdated",
2600
2599
  mutation: this.#s,
2601
2600
  observer: this
2602
- }), t?.mutationKey && this.options.mutationKey && De(t.mutationKey) !== De(this.options.mutationKey) ? this.reset() : this.#s?.state.status === "pending" && this.#s.setOptions(this.options);
2601
+ }), t?.mutationKey && this.options.mutationKey && Ue(t.mutationKey) !== Ue(this.options.mutationKey) ? this.reset() : this.#s?.state.status === "pending" && this.#s.setOptions(this.options);
2603
2602
  }
2604
2603
  onUnsubscribe() {
2605
2604
  this.hasListeners() || this.#s?.removeObserver(this);
@@ -2687,13 +2686,13 @@ var _r = class extends Le {
2687
2686
  });
2688
2687
  });
2689
2688
  }
2690
- }, Hr = class extends Le {
2689
+ }, Hr = class extends Be {
2691
2690
  constructor(e = {}) {
2692
2691
  super(), this.config = e, this.#e = /* @__PURE__ */ new Map();
2693
2692
  }
2694
2693
  #e;
2695
2694
  build(e, t, s) {
2696
- const r = t.queryKey, n = t.queryHash ?? Nt(r, t);
2695
+ const r = t.queryKey, n = t.queryHash ?? At(r, t);
2697
2696
  let a = this.get(n);
2698
2697
  return a || (a = new Ur({
2699
2698
  client: e,
@@ -2771,7 +2770,7 @@ var _r = class extends Le {
2771
2770
  this.#e = e.queryCache || new Hr(), this.#t = e.mutationCache || new qr(), this.#s = e.defaultOptions || {}, this.#n = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#a = 0;
2772
2771
  }
2773
2772
  mount() {
2774
- this.#a++, this.#a === 1 && (this.#o = xt.subscribe(async (e) => {
2773
+ this.#a++, this.#a === 1 && (this.#o = wt.subscribe(async (e) => {
2775
2774
  e && (await this.resumePausedMutations(), this.#e.onFocus());
2776
2775
  }), this.#i = Ze.subscribe(async (e) => {
2777
2776
  e && (await this.resumePausedMutations(), this.#e.onOnline());
@@ -2799,7 +2798,7 @@ var _r = class extends Le {
2799
2798
  }
2800
2799
  ensureQueryData(e) {
2801
2800
  const t = this.defaultQueryOptions(e), s = this.#e.build(this, t), r = s.state.data;
2802
- return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(ke(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(r));
2801
+ return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(Pe(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(r));
2803
2802
  }
2804
2803
  getQueriesData(e) {
2805
2804
  return this.#e.findAll(e).map(({ queryKey: t, state: s }) => {
@@ -2810,7 +2809,7 @@ var _r = class extends Le {
2810
2809
  setQueryData(e, t, s) {
2811
2810
  const r = this.defaultQueryOptions({ queryKey: e }), a = this.#e.get(
2812
2811
  r.queryHash
2813
- )?.state.data, o = Ir(t, a);
2812
+ )?.state.data, o = Cr(t, a);
2814
2813
  if (o !== void 0)
2815
2814
  return this.#e.build(this, r).setData(o, { ...s, manual: !0 });
2816
2815
  }
@@ -2852,7 +2851,7 @@ var _r = class extends Le {
2852
2851
  const s = { revert: !0, ...t }, r = ae.batch(
2853
2852
  () => this.#e.findAll(e).map((n) => n.cancel(s))
2854
2853
  );
2855
- return Promise.all(r).then(he).catch(he);
2854
+ return Promise.all(r).then(de).catch(de);
2856
2855
  }
2857
2856
  invalidateQueries(e, t = {}) {
2858
2857
  return ae.batch(() => (this.#e.findAll(e).forEach((s) => {
@@ -2872,27 +2871,27 @@ var _r = class extends Le {
2872
2871
  }, r = ae.batch(
2873
2872
  () => this.#e.findAll(e).filter((n) => !n.isDisabled() && !n.isStatic()).map((n) => {
2874
2873
  let a = n.fetch(void 0, s);
2875
- return s.throwOnError || (a = a.catch(he)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
2874
+ return s.throwOnError || (a = a.catch(de)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
2876
2875
  })
2877
2876
  );
2878
- return Promise.all(r).then(he);
2877
+ return Promise.all(r).then(de);
2879
2878
  }
2880
2879
  fetchQuery(e) {
2881
2880
  const t = this.defaultQueryOptions(e);
2882
2881
  t.retry === void 0 && (t.retry = !1);
2883
2882
  const s = this.#e.build(this, t);
2884
2883
  return s.isStaleByTime(
2885
- ke(t.staleTime, s)
2884
+ Pe(t.staleTime, s)
2886
2885
  ) ? s.fetch(t) : Promise.resolve(s.state.data);
2887
2886
  }
2888
2887
  prefetchQuery(e) {
2889
- return this.fetchQuery(e).then(he).catch(he);
2888
+ return this.fetchQuery(e).then(de).catch(de);
2890
2889
  }
2891
2890
  fetchInfiniteQuery(e) {
2892
2891
  return e.behavior = Jt(e.pages), this.fetchQuery(e);
2893
2892
  }
2894
2893
  prefetchInfiniteQuery(e) {
2895
- return this.fetchInfiniteQuery(e).then(he).catch(he);
2894
+ return this.fetchInfiniteQuery(e).then(de).catch(de);
2896
2895
  }
2897
2896
  ensureInfiniteQueryData(e) {
2898
2897
  return e.behavior = Jt(e.pages), this.ensureQueryData(e);
@@ -2913,7 +2912,7 @@ var _r = class extends Le {
2913
2912
  this.#s = e;
2914
2913
  }
2915
2914
  setQueryDefaults(e, t) {
2916
- this.#n.set(De(e), {
2915
+ this.#n.set(Ue(e), {
2917
2916
  queryKey: e,
2918
2917
  defaultOptions: t
2919
2918
  });
@@ -2921,11 +2920,11 @@ var _r = class extends Le {
2921
2920
  getQueryDefaults(e) {
2922
2921
  const t = [...this.#n.values()], s = {};
2923
2922
  return t.forEach((r) => {
2924
- Qe(e, r.queryKey) && Object.assign(s, r.defaultOptions);
2923
+ qe(e, r.queryKey) && Object.assign(s, r.defaultOptions);
2925
2924
  }), s;
2926
2925
  }
2927
2926
  setMutationDefaults(e, t) {
2928
- this.#r.set(De(e), {
2927
+ this.#r.set(Ue(e), {
2929
2928
  mutationKey: e,
2930
2929
  defaultOptions: t
2931
2930
  });
@@ -2933,7 +2932,7 @@ var _r = class extends Le {
2933
2932
  getMutationDefaults(e) {
2934
2933
  const t = [...this.#r.values()], s = {};
2935
2934
  return t.forEach((r) => {
2936
- Qe(e, r.mutationKey) && Object.assign(s, r.defaultOptions);
2935
+ qe(e, r.mutationKey) && Object.assign(s, r.defaultOptions);
2937
2936
  }), s;
2938
2937
  }
2939
2938
  defaultQueryOptions(e) {
@@ -2945,7 +2944,7 @@ var _r = class extends Le {
2945
2944
  ...e,
2946
2945
  _defaulted: !0
2947
2946
  };
2948
- return t.queryHash || (t.queryHash = Nt(
2947
+ return t.queryHash || (t.queryHash = At(
2949
2948
  t.queryKey,
2950
2949
  t
2951
2950
  )), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === Xe && (t.enabled = !1), t;
@@ -2988,7 +2987,7 @@ function Yr() {
2988
2987
  };
2989
2988
  }
2990
2989
  var zr = ce.createContext(Yr()), Vr = () => ce.useContext(zr), Jr = (e, t, s) => {
2991
- const r = s?.state.error && typeof e.throwOnError == "function" ? wt(e.throwOnError, [s.state.error, s]) : e.throwOnError;
2990
+ const r = s?.state.error && typeof e.throwOnError == "function" ? Nt(e.throwOnError, [s.state.error, s]) : e.throwOnError;
2992
2991
  (e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
2993
2992
  }, Xr = (e) => {
2994
2993
  ce.useEffect(() => {
@@ -3000,7 +2999,7 @@ var zr = ce.createContext(Yr()), Vr = () => ce.useContext(zr), Jr = (e, t, s) =>
3000
2999
  throwOnError: s,
3001
3000
  query: r,
3002
3001
  suspense: n
3003
- }) => e.isError && !t.isReset() && !e.isFetching && r && (n && e.data === void 0 || wt(s, [e.error, r])), en = (e) => {
3002
+ }) => e.isError && !t.isReset() && !e.isFetching && r && (n && e.data === void 0 || Nt(s, [e.error, r])), en = (e) => {
3004
3003
  if (e.suspense) {
3005
3004
  const s = (n) => n === "static" ? n : Math.max(n ?? 1e3, 1e3), r = e.staleTime;
3006
3005
  e.staleTime = typeof r == "function" ? (...n) => s(r(...n)) : s(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(
@@ -3029,43 +3028,43 @@ function rn(e, t, s) {
3029
3028
  a,
3030
3029
  o
3031
3030
  )
3032
- ), f = u.getOptimisticResult(o), b = !r && e.subscribed !== !1;
3031
+ ), c = u.getOptimisticResult(o), N = !r && e.subscribed !== !1;
3033
3032
  if (ce.useSyncExternalStore(
3034
3033
  ce.useCallback(
3035
- (p) => {
3036
- const R = b ? u.subscribe(ae.batchCalls(p)) : he;
3037
- return u.updateResult(), R;
3034
+ (f) => {
3035
+ const O = N ? u.subscribe(ae.batchCalls(f)) : de;
3036
+ return u.updateResult(), O;
3038
3037
  },
3039
- [u, b]
3038
+ [u, N]
3040
3039
  ),
3041
3040
  () => u.getCurrentResult(),
3042
3041
  () => u.getCurrentResult()
3043
3042
  ), ce.useEffect(() => {
3044
3043
  u.setOptions(o);
3045
- }, [o, u]), sn(o, f))
3044
+ }, [o, u]), sn(o, c))
3046
3045
  throw Zt(o, u, n);
3047
3046
  if (Zr({
3048
- result: f,
3047
+ result: c,
3049
3048
  errorResetBoundary: n,
3050
3049
  throwOnError: o.throwOnError,
3051
3050
  query: l,
3052
3051
  suspense: o.suspense
3053
3052
  }))
3054
- throw f.error;
3053
+ throw c.error;
3055
3054
  return a.getDefaultOptions().queries?._experimental_afterQuery?.(
3056
3055
  o,
3057
- f
3058
- ), o.experimental_prefetchInRender && !Ee && tn(f, r) && (h ? (
3056
+ c
3057
+ ), o.experimental_prefetchInRender && !Me && tn(c, r) && (h ? (
3059
3058
  // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
3060
3059
  Zt(o, u, n)
3061
3060
  ) : (
3062
3061
  // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
3063
3062
  l?.promise
3064
- ))?.catch(he).finally(() => {
3063
+ ))?.catch(de).finally(() => {
3065
3064
  u.updateResult();
3066
- }), o.notifyOnChangeProps ? f : u.trackResult(f);
3065
+ }), o.notifyOnChangeProps ? c : u.trackResult(c);
3067
3066
  }
3068
- function Tt(e, t) {
3067
+ function It(e, t) {
3069
3068
  return rn(e, Lr);
3070
3069
  }
3071
3070
  function nn(e, t) {
@@ -3087,16 +3086,16 @@ function nn(e, t) {
3087
3086
  () => r.getCurrentResult()
3088
3087
  ), a = ce.useCallback(
3089
3088
  (o, l) => {
3090
- r.mutate(o, l).catch(he);
3089
+ r.mutate(o, l).catch(de);
3091
3090
  },
3092
3091
  [r]
3093
3092
  );
3094
- if (n.error && wt(r.options.throwOnError, [n.error]))
3093
+ if (n.error && Nt(r.options.throwOnError, [n.error]))
3095
3094
  throw n.error;
3096
3095
  return { ...n, mutate: a, mutateAsync: n.mutate };
3097
3096
  }
3098
3097
  function ys() {
3099
- const { alerts: e } = Ne(), t = Ct();
3098
+ const { alerts: e } = Ae(), t = Ct();
3100
3099
  return nn({
3101
3100
  mutationFn: (s) => e.updateAlertStatus(s),
3102
3101
  onSuccess: () => {
@@ -3136,7 +3135,7 @@ function ln(e) {
3136
3135
  return "-";
3137
3136
  }
3138
3137
  }
3139
- function lt(e) {
3138
+ function pt(e) {
3140
3139
  if (!e) return "-";
3141
3140
  try {
3142
3141
  return new Date(e).toLocaleString("en-US", {
@@ -3172,40 +3171,40 @@ function dn({
3172
3171
  spaceOptions: o,
3173
3172
  onAlertIdClick: l
3174
3173
  }) {
3175
- const h = ys(), u = async (p) => {
3174
+ const h = ys(), u = async (f) => {
3176
3175
  try {
3177
- const R = await h.mutateAsync({
3178
- alertUniqueId: p.alertId ?? p.id,
3179
- alertId: p.id,
3176
+ const O = await h.mutateAsync({
3177
+ alertUniqueId: f.alertId ?? f.id,
3178
+ alertId: f.id,
3180
3179
  status: "Reopen",
3181
3180
  notes: "Reopened",
3182
3181
  modifiedBy: 0
3183
3182
  });
3184
- if (R?.responseStatus) {
3185
- const x = R?.data || "Alert reopened successfully.";
3186
- ie.success(x);
3183
+ if (O?.responseStatus) {
3184
+ const w = O?.data || "Alert reopened successfully.";
3185
+ ne.success(w);
3187
3186
  } else {
3188
- const x = R?.errorMessage || "Failed to reopen alert";
3189
- ie.error(x);
3187
+ const w = O?.errorMessage || "Failed to reopen alert";
3188
+ ne.error(w);
3190
3189
  }
3191
3190
  } catch {
3192
- ie.error("Failed to reopen alert. Please try again.");
3191
+ ne.error("Failed to reopen alert. Please try again.");
3193
3192
  }
3194
- }, f = [
3193
+ }, c = [
3195
3194
  {
3196
3195
  title: "Severity",
3197
3196
  dataIndex: "priority",
3198
3197
  key: "priority",
3199
3198
  width: 120,
3200
- render: (p) => /* @__PURE__ */ i(
3199
+ render: (f) => /* @__PURE__ */ i(
3201
3200
  Ve,
3202
3201
  {
3203
3202
  className: "px-[10px] py-[2px]",
3204
3203
  style: {
3205
- border: `2px solid ${cn[p]}`,
3206
- backgroundColor: un[String(p)]
3204
+ border: `2px solid ${cn[f]}`,
3205
+ backgroundColor: un[String(f)]
3207
3206
  },
3208
- children: p
3207
+ children: f
3209
3208
  }
3210
3209
  )
3211
3210
  },
@@ -3214,7 +3213,7 @@ function dn({
3214
3213
  dataIndex: "timestamp",
3215
3214
  key: "timestamp",
3216
3215
  width: 200,
3217
- render: (p) => ln(p)
3216
+ render: (f) => ln(f)
3218
3217
  },
3219
3218
  {
3220
3219
  title: "Status",
@@ -3226,18 +3225,18 @@ function dn({
3226
3225
  title: "Description",
3227
3226
  dataIndex: "description",
3228
3227
  key: "description",
3229
- render: (p, R) => /* @__PURE__ */ d("div", { children: [
3228
+ render: (f, O) => /* @__PURE__ */ d("div", { children: [
3230
3229
  /* @__PURE__ */ i(
3231
3230
  "a",
3232
3231
  {
3233
- onClick: (x) => {
3234
- x.preventDefault(), l?.(R);
3232
+ onClick: (w) => {
3233
+ w.preventDefault(), l?.(O);
3235
3234
  },
3236
3235
  className: "inline-block mb-1 text-blue-600",
3237
- children: R.alertNumber
3236
+ children: O.alertNumber
3238
3237
  }
3239
3238
  ),
3240
- /* @__PURE__ */ i("div", { className: "text-black/65", children: p })
3239
+ /* @__PURE__ */ i("div", { className: "text-black/65", children: f })
3241
3240
  ] })
3242
3241
  },
3243
3242
  {
@@ -3245,7 +3244,7 @@ function dn({
3245
3244
  key: "menu",
3246
3245
  width: 60,
3247
3246
  align: "right",
3248
- render: (p, R) => /* @__PURE__ */ i(
3247
+ render: (f, O) => /* @__PURE__ */ i(
3249
3248
  Os,
3250
3249
  {
3251
3250
  trigger: ["click"],
@@ -3253,29 +3252,30 @@ function dn({
3253
3252
  items: [
3254
3253
  { key: "reopen", label: "Reopen" }
3255
3254
  ],
3256
- onClick: ({ key: x }) => {
3257
- x === "reopen" && u(R);
3255
+ onClick: ({ key: w }) => {
3256
+ w === "reopen" && u(O);
3258
3257
  }
3259
3258
  },
3260
- children: /* @__PURE__ */ i(ye, { type: "text", icon: /* @__PURE__ */ i(Us, {}) })
3259
+ children: /* @__PURE__ */ i(pe, { type: "text", icon: /* @__PURE__ */ i(Us, {}) })
3261
3260
  }
3262
3261
  )
3263
3262
  }
3264
- ], b = (e || []).filter(
3265
- (p) => (p.statusType || "").toLowerCase() === r.toLowerCase()
3263
+ ], N = (e || []).filter(
3264
+ (f) => (f.statusType || "").toLowerCase() === r.toLowerCase()
3266
3265
  );
3267
3266
  return /* @__PURE__ */ i(
3268
3267
  as,
3269
3268
  {
3270
- data: b,
3269
+ data: N,
3271
3270
  loading: t,
3272
3271
  pageSize: s,
3273
- columns: f,
3272
+ columns: c,
3274
3273
  severityOptions: n,
3275
3274
  anomalyOptions: a,
3276
3275
  spaceOptions: o,
3277
3276
  renderActions: void 0,
3278
- onAlertIdClick: l
3277
+ onAlertIdClick: l,
3278
+ excludeCompleted: !1
3279
3279
  }
3280
3280
  );
3281
3281
  }
@@ -3285,7 +3285,7 @@ function hn({
3285
3285
  timeZone: s = "America/New_York"
3286
3286
  }) {
3287
3287
  const { hours: r, minutes: n, seconds: a } = ue(() => {
3288
- const b = new Intl.DateTimeFormat("en-US", {
3288
+ const N = new Intl.DateTimeFormat("en-US", {
3289
3289
  timeZone: s,
3290
3290
  hour: "numeric",
3291
3291
  minute: "numeric",
@@ -3293,9 +3293,9 @@ function hn({
3293
3293
  hour12: !1
3294
3294
  }).formatToParts(t);
3295
3295
  return {
3296
- hours: parseInt(b.find((p) => p.type === "hour")?.value || "0", 10),
3297
- minutes: parseInt(b.find((p) => p.type === "minute")?.value || "0", 10),
3298
- seconds: parseInt(b.find((p) => p.type === "second")?.value || "0", 10)
3296
+ hours: parseInt(N.find((f) => f.type === "hour")?.value || "0", 10),
3297
+ minutes: parseInt(N.find((f) => f.type === "minute")?.value || "0", 10),
3298
+ seconds: parseInt(N.find((f) => f.type === "second")?.value || "0", 10)
3299
3299
  };
3300
3300
  }, [t, s]), o = a * 6, l = n * 6 + a * 0.1, h = r % 12 * 30 + n * 0.5, u = e / 2;
3301
3301
  return /* @__PURE__ */ d(
@@ -3306,8 +3306,8 @@ function hn({
3306
3306
  role: "img",
3307
3307
  "aria-label": "Analog Clock",
3308
3308
  children: [
3309
- [...Array(12)].map((f, b) => {
3310
- const p = b * 30, R = 6, x = u - 4, m = x - R, A = (p - 90) * (Math.PI / 180), L = u + m * Math.cos(A), $ = u + m * Math.sin(A), B = u + x * Math.cos(A), F = u + x * Math.sin(A);
3309
+ [...Array(12)].map((c, N) => {
3310
+ const f = N * 30, O = 6, w = u - 4, p = w - O, S = (f - 90) * (Math.PI / 180), $ = u + p * Math.cos(S), L = u + p * Math.sin(S), B = u + w * Math.cos(S), U = u + w * Math.sin(S);
3311
3311
  return /* @__PURE__ */ i(
3312
3312
  "svg",
3313
3313
  {
@@ -3317,17 +3317,17 @@ function hn({
3317
3317
  children: /* @__PURE__ */ i(
3318
3318
  "line",
3319
3319
  {
3320
- x1: L,
3321
- y1: $,
3320
+ x1: $,
3321
+ y1: L,
3322
3322
  x2: B,
3323
- y2: F,
3323
+ y2: U,
3324
3324
  stroke: "#9CA3AF",
3325
- strokeWidth: b % 3 === 0 ? 2 : 1,
3325
+ strokeWidth: N % 3 === 0 ? 2 : 1,
3326
3326
  strokeLinecap: "round"
3327
3327
  }
3328
3328
  )
3329
3329
  },
3330
- b
3330
+ N
3331
3331
  );
3332
3332
  }),
3333
3333
  /* @__PURE__ */ i(
@@ -3411,7 +3411,7 @@ function hn({
3411
3411
  }
3412
3412
  function fn({ label: e = "USA", timeZone: t = "America/New_York", updateIntervalMs: s = 1e3, className: r }) {
3413
3413
  const [n, a] = I(/* @__PURE__ */ new Date());
3414
- fe(() => {
3414
+ he(() => {
3415
3415
  const u = setInterval(() => a(/* @__PURE__ */ new Date()), s);
3416
3416
  return () => clearInterval(u);
3417
3417
  }, [s]);
@@ -3428,17 +3428,17 @@ function fn({ label: e = "USA", timeZone: t = "America/New_York", updateInterval
3428
3428
  ] })
3429
3429
  ] });
3430
3430
  }
3431
- const mn = [{ SeverityId: 1, Code: "LOW", DisplayName: "Low", SortOrder: 10, IsActive: !0 }, { SeverityId: 2, Code: "MEDIUM", DisplayName: "Medium", SortOrder: 20, IsActive: !0 }, { SeverityId: 3, Code: "HIGH", DisplayName: "High", SortOrder: 30, IsActive: !0 }, { SeverityId: 4, Code: "CRITICAL", DisplayName: "Critical", SortOrder: 40, IsActive: !0 }], pn = [{ RuleId: "0938aa00-dfa7-4258-805a-67396366c776", RuleVersionId: "36d2d581-57c3-45c3-8705-8235935fdf96", Name: "License Plate Recognition", Description: "License Plate Recognition", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 3, AnomalyId: "915976ef-4eb6-4f7b-bbe6-e53862517fc9", Level: "global" }, { RuleId: "2437286a-db6a-4d35-814e-9ac49f158dde", RuleVersionId: "00000000-0000-0000-0000-000000000000", Name: "Monitor And Track Onsite Vehicle timelog", Description: "Monitor And Track Onsite Vehicle timelog", VersionCount: 0, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 3, AnomalyId: "9fd651ab-4312-4826-84b6-94d735894477", Level: "global" }, { RuleId: "b99120ba-7a83-4ade-b5d9-a420550fe351", RuleVersionId: "d7b14dae-a7b1-474e-a357-199182c02ac3", Name: "Watchlist person detected", Description: "Watchlist person detected", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 4, AnomalyId: "bb3a3d3a-73a3-4f5a-8804-1baadbd0d412", Level: "global" }, { RuleId: "ffc2c24f-adb7-4aba-ace7-f19c54e21530", RuleVersionId: "6ab3178f-bf77-4a1e-898d-1d5dbef749c5", Name: "Weapon Detection", Description: "Weapon Detection", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 4, AnomalyId: "ac82c3a2-72e6-4f9c-88fb-851a3ca3c4de", Level: "global" }], yn = [{ userRoleId: 1, userRoleName: "Super Admin" }, { userRoleId: 2, userRoleName: "Security Officer" }, { userRoleId: 3, userRoleName: "Security Admin" }, { userRoleId: 4, userRoleName: "Regulatory Officer/First Responder" }, { userRoleId: 5, userRoleName: "User" }], Ue = {
3431
+ const mn = [{ SeverityId: 1, Code: "LOW", DisplayName: "Low", SortOrder: 10, IsActive: !0 }, { SeverityId: 2, Code: "MEDIUM", DisplayName: "Medium", SortOrder: 20, IsActive: !0 }, { SeverityId: 3, Code: "HIGH", DisplayName: "High", SortOrder: 30, IsActive: !0 }, { SeverityId: 4, Code: "CRITICAL", DisplayName: "Critical", SortOrder: 40, IsActive: !0 }], pn = [{ RuleId: "0938aa00-dfa7-4258-805a-67396366c776", RuleVersionId: "36d2d581-57c3-45c3-8705-8235935fdf96", Name: "License Plate Recognition", Description: "License Plate Recognition", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 3, AnomalyId: "915976ef-4eb6-4f7b-bbe6-e53862517fc9", Level: "global" }, { RuleId: "2437286a-db6a-4d35-814e-9ac49f158dde", RuleVersionId: "00000000-0000-0000-0000-000000000000", Name: "Monitor And Track Onsite Vehicle timelog", Description: "Monitor And Track Onsite Vehicle timelog", VersionCount: 0, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 3, AnomalyId: "9fd651ab-4312-4826-84b6-94d735894477", Level: "global" }, { RuleId: "b99120ba-7a83-4ade-b5d9-a420550fe351", RuleVersionId: "d7b14dae-a7b1-474e-a357-199182c02ac3", Name: "Watchlist person detected", Description: "Watchlist person detected", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 4, AnomalyId: "bb3a3d3a-73a3-4f5a-8804-1baadbd0d412", Level: "global" }, { RuleId: "ffc2c24f-adb7-4aba-ace7-f19c54e21530", RuleVersionId: "6ab3178f-bf77-4a1e-898d-1d5dbef749c5", Name: "Weapon Detection", Description: "Weapon Detection", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 4, AnomalyId: "ac82c3a2-72e6-4f9c-88fb-851a3ca3c4de", Level: "global" }], yn = [{ userRoleId: 1, userRoleName: "Super Admin" }, { userRoleId: 2, userRoleName: "Security Officer" }, { userRoleId: 3, userRoleName: "Security Admin" }, { userRoleId: 4, userRoleName: "Regulatory Officer/First Responder" }, { userRoleId: 5, userRoleName: "User" }], $e = {
3432
3432
  severities: mn,
3433
3433
  rules: pn,
3434
3434
  userRoles: yn
3435
- }, { Text: gn } = qe;
3435
+ }, { Text: gn } = _e;
3436
3436
  function vn({ sortBy: e, onChange: t, showActions: s, onSave: r, onClear: n, saving: a }) {
3437
- return /* @__PURE__ */ d(ge, { gutter: [16, 16], align: "middle", children: [
3438
- /* @__PURE__ */ i(_, { xs: 24, md: 8, lg: 5, children: /* @__PURE__ */ d(Ae, { className: "w-full items-center", direction: "horizontal", size: 12, children: [
3437
+ return /* @__PURE__ */ d(ye, { gutter: [16, 16], align: "middle", children: [
3438
+ /* @__PURE__ */ i(H, { xs: 24, md: 8, lg: 5, children: /* @__PURE__ */ d(Se, { className: "w-full items-center", direction: "horizontal", size: 12, children: [
3439
3439
  /* @__PURE__ */ i(gn, { className: "text-gray-600", children: "Sort by:" }),
3440
3440
  /* @__PURE__ */ i(
3441
- pe,
3441
+ me,
3442
3442
  {
3443
3443
  placeholder: "By Severity",
3444
3444
  value: e,
@@ -3452,13 +3452,13 @@ function vn({ sortBy: e, onChange: t, showActions: s, onSave: r, onClear: n, sav
3452
3452
  }
3453
3453
  )
3454
3454
  ] }) }),
3455
- /* @__PURE__ */ i(_, { xs: 24, md: 8, style: { alignSelf: "end" }, children: s ? /* @__PURE__ */ d(Ae, { className: "w-full", direction: "horizontal", size: 8, children: [
3456
- /* @__PURE__ */ i(ye, { onClick: n, disabled: a, children: "Clear" }),
3457
- /* @__PURE__ */ i(ye, { type: "primary", onClick: r, loading: a, children: "Save" })
3455
+ /* @__PURE__ */ i(H, { xs: 24, md: 8, style: { alignSelf: "end" }, children: s ? /* @__PURE__ */ d(Se, { className: "w-full", direction: "horizontal", size: 8, children: [
3456
+ /* @__PURE__ */ i(pe, { onClick: n, disabled: a, children: "Clear" }),
3457
+ /* @__PURE__ */ i(pe, { type: "primary", onClick: r, loading: a, children: "Save" })
3458
3458
  ] }) : null })
3459
3459
  ] });
3460
3460
  }
3461
- const { Text: Te } = qe;
3461
+ const { Text: Ie } = _e;
3462
3462
  function bn(e) {
3463
3463
  const {
3464
3464
  // escBasis, setEscBasis,
@@ -3472,52 +3472,52 @@ function bn(e) {
3472
3472
  setL1mins: l,
3473
3473
  l1role: h,
3474
3474
  setL1role: u,
3475
- l2mins: f,
3476
- setL2mins: b,
3477
- l2role: p,
3478
- setL2role: R,
3479
- l3mins: x,
3480
- setL3mins: m,
3481
- l3role: A,
3482
- setL3role: L,
3483
- actions: $,
3475
+ l2mins: c,
3476
+ setL2mins: N,
3477
+ l2role: f,
3478
+ setL2role: O,
3479
+ l3mins: w,
3480
+ setL3mins: p,
3481
+ l3role: S,
3482
+ setL3role: $,
3483
+ actions: L,
3484
3484
  setActions: B,
3485
- thirdPartyIds: F,
3486
- setThirdPartyIds: z,
3487
- humanLoop: V,
3488
- setHumanLoop: H,
3485
+ thirdPartyIds: U,
3486
+ setThirdPartyIds: Y,
3487
+ humanLoop: J,
3488
+ setHumanLoop: G,
3489
3489
  onClear: W,
3490
- onSave: C,
3491
- saving: N,
3492
- onActionTypesLoaded: T
3493
- } = e, { rules: te } = Ne(), [ne, O] = I([]), [g, y] = I([]), [S, c] = I(!1);
3494
- fe(() => {
3495
- let E = !1;
3490
+ onSave: T,
3491
+ saving: x,
3492
+ onActionTypesLoaded: R
3493
+ } = e, { rules: se } = Ae(), [te, k] = I([]), [g, m] = I([]), [A, y] = I(!1);
3494
+ he(() => {
3495
+ let P = !1;
3496
3496
  return (async () => {
3497
3497
  try {
3498
- c(!0);
3499
- const k = await te.getLookups();
3500
- if (E || !k || !Array.isArray(k.actionTypes)) return;
3501
- const U = k.actionTypes.map((j) => ({ label: j.name, value: String(j.actionTypeId) }));
3502
- O(U), T && T(k.actionTypes);
3503
- const Q = Array.isArray(k.thirdParties) ? k.thirdParties.map((j) => ({ label: j.thirdPartyName, value: j.thirdPartyId })) : [];
3504
- y(Q);
3505
- } catch (k) {
3506
- console.error("Error loading lookups", k);
3498
+ y(!0);
3499
+ const M = await se.getLookups();
3500
+ if (P || !M || !Array.isArray(M.actionTypes)) return;
3501
+ const D = M.actionTypes.map((Q) => ({ label: Q.name, value: String(Q.actionTypeId) }));
3502
+ k(D), R && R(M.actionTypes);
3503
+ const j = Array.isArray(M.thirdParties) ? M.thirdParties.map((Q) => ({ label: Q.thirdPartyName, value: Q.thirdPartyId })) : [];
3504
+ m(j);
3505
+ } catch (M) {
3506
+ console.error("Error loading lookups", M);
3507
3507
  } finally {
3508
- E || c(!1);
3508
+ P || y(!1);
3509
3509
  }
3510
3510
  })(), () => {
3511
- E = !0;
3511
+ P = !0;
3512
3512
  };
3513
3513
  }, []);
3514
- const v = typeof o == "number" || typeof h == "number" || typeof f == "number" || typeof p == "number" || typeof x == "number" || typeof A == "number" || Array.isArray($) && $.length > 0 || Array.isArray(F) && F.length > 0 || !!V;
3515
- return /* @__PURE__ */ d(vt, { spinning: !!N || S, children: [
3516
- /* @__PURE__ */ d(ge, { gutter: [16, 16], align: "bottom", children: [
3517
- /* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ d("div", { children: [
3518
- /* @__PURE__ */ i(Te, { className: "text-gray-700 font-medium block mb-1", children: "Rules" }),
3514
+ const v = typeof o == "number" || typeof h == "number" || typeof c == "number" || typeof f == "number" || typeof w == "number" || typeof S == "number" || Array.isArray(L) && L.length > 0 || Array.isArray(U) && U.length > 0 || !!J;
3515
+ return /* @__PURE__ */ d(gt, { spinning: !!x || A, children: [
3516
+ /* @__PURE__ */ d(ye, { gutter: [16, 16], align: "bottom", children: [
3517
+ /* @__PURE__ */ i(H, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ d("div", { children: [
3518
+ /* @__PURE__ */ i(Ie, { className: "text-gray-700 font-medium block mb-1", children: "Rules" }),
3519
3519
  /* @__PURE__ */ i(
3520
- pe,
3520
+ me,
3521
3521
  {
3522
3522
  placeholder: "Rules",
3523
3523
  value: t,
@@ -3527,14 +3527,14 @@ function bn(e) {
3527
3527
  }
3528
3528
  )
3529
3529
  ] }) }),
3530
- /* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ d("div", { children: [
3531
- /* @__PURE__ */ d(ge, { gutter: 8, children: [
3532
- /* @__PURE__ */ i(_, { span: 10, children: /* @__PURE__ */ i(Te, { className: "text-gray-700 font-medium block mb-1", children: "Level 1 (mins)" }) }),
3533
- /* @__PURE__ */ i(_, { span: 14, children: /* @__PURE__ */ i(Te, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
3530
+ /* @__PURE__ */ i(H, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ d("div", { children: [
3531
+ /* @__PURE__ */ d(ye, { gutter: 8, children: [
3532
+ /* @__PURE__ */ i(H, { span: 10, children: /* @__PURE__ */ i(Ie, { className: "text-gray-700 font-medium block mb-1", children: "Level 1 (mins)" }) }),
3533
+ /* @__PURE__ */ i(H, { span: 14, children: /* @__PURE__ */ i(Ie, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
3534
3534
  ] }),
3535
- /* @__PURE__ */ d(ge, { gutter: 8, children: [
3536
- /* @__PURE__ */ i(_, { span: 10, children: /* @__PURE__ */ i(
3537
- pe,
3535
+ /* @__PURE__ */ d(ye, { gutter: 8, children: [
3536
+ /* @__PURE__ */ i(H, { span: 10, children: /* @__PURE__ */ i(
3537
+ me,
3538
3538
  {
3539
3539
  className: "w-full",
3540
3540
  placeholder: "Mins",
@@ -3543,8 +3543,8 @@ function bn(e) {
3543
3543
  options: n
3544
3544
  }
3545
3545
  ) }),
3546
- /* @__PURE__ */ i(_, { span: 14, children: /* @__PURE__ */ i(
3547
- pe,
3546
+ /* @__PURE__ */ i(H, { span: 14, children: /* @__PURE__ */ i(
3547
+ me,
3548
3548
  {
3549
3549
  placeholder: "Escalate to",
3550
3550
  className: "w-full",
@@ -3555,96 +3555,96 @@ function bn(e) {
3555
3555
  ) })
3556
3556
  ] })
3557
3557
  ] }) }),
3558
- /* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ d("div", { children: [
3559
- /* @__PURE__ */ d(ge, { gutter: 8, children: [
3560
- /* @__PURE__ */ i(_, { span: 10, children: /* @__PURE__ */ i(Te, { className: "text-gray-700 font-medium block mb-1", children: "Level 2 (mins)" }) }),
3561
- /* @__PURE__ */ i(_, { span: 14, children: /* @__PURE__ */ i(Te, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
3558
+ /* @__PURE__ */ i(H, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ d("div", { children: [
3559
+ /* @__PURE__ */ d(ye, { gutter: 8, children: [
3560
+ /* @__PURE__ */ i(H, { span: 10, children: /* @__PURE__ */ i(Ie, { className: "text-gray-700 font-medium block mb-1", children: "Level 2 (mins)" }) }),
3561
+ /* @__PURE__ */ i(H, { span: 14, children: /* @__PURE__ */ i(Ie, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
3562
3562
  ] }),
3563
- /* @__PURE__ */ d(ge, { gutter: 8, children: [
3564
- /* @__PURE__ */ i(_, { span: 10, children: /* @__PURE__ */ i(
3565
- pe,
3563
+ /* @__PURE__ */ d(ye, { gutter: 8, children: [
3564
+ /* @__PURE__ */ i(H, { span: 10, children: /* @__PURE__ */ i(
3565
+ me,
3566
3566
  {
3567
3567
  className: "w-full",
3568
3568
  placeholder: "Mins",
3569
- value: f,
3570
- onChange: b,
3569
+ value: c,
3570
+ onChange: N,
3571
3571
  options: n
3572
3572
  }
3573
3573
  ) }),
3574
- /* @__PURE__ */ i(_, { span: 14, children: /* @__PURE__ */ i(
3575
- pe,
3574
+ /* @__PURE__ */ i(H, { span: 14, children: /* @__PURE__ */ i(
3575
+ me,
3576
3576
  {
3577
3577
  placeholder: "Escalate to",
3578
3578
  className: "w-full",
3579
- value: p,
3580
- onChange: R,
3579
+ value: f,
3580
+ onChange: O,
3581
3581
  options: a
3582
3582
  }
3583
3583
  ) })
3584
3584
  ] })
3585
3585
  ] }) }),
3586
- /* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ d("div", { children: [
3587
- /* @__PURE__ */ d(ge, { gutter: 8, children: [
3588
- /* @__PURE__ */ i(_, { span: 10, children: /* @__PURE__ */ i(Te, { className: "text-gray-700 font-medium block mb-1", children: "Level 3 (mins)" }) }),
3589
- /* @__PURE__ */ i(_, { span: 14, children: /* @__PURE__ */ i(Te, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
3586
+ /* @__PURE__ */ i(H, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ d("div", { children: [
3587
+ /* @__PURE__ */ d(ye, { gutter: 8, children: [
3588
+ /* @__PURE__ */ i(H, { span: 10, children: /* @__PURE__ */ i(Ie, { className: "text-gray-700 font-medium block mb-1", children: "Level 3 (mins)" }) }),
3589
+ /* @__PURE__ */ i(H, { span: 14, children: /* @__PURE__ */ i(Ie, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
3590
3590
  ] }),
3591
- /* @__PURE__ */ d(ge, { gutter: 8, children: [
3592
- /* @__PURE__ */ i(_, { span: 10, children: /* @__PURE__ */ i(
3593
- pe,
3591
+ /* @__PURE__ */ d(ye, { gutter: 8, children: [
3592
+ /* @__PURE__ */ i(H, { span: 10, children: /* @__PURE__ */ i(
3593
+ me,
3594
3594
  {
3595
3595
  className: "w-full",
3596
3596
  placeholder: "Mins",
3597
- value: x,
3598
- onChange: m,
3597
+ value: w,
3598
+ onChange: p,
3599
3599
  options: n
3600
3600
  }
3601
3601
  ) }),
3602
- /* @__PURE__ */ i(_, { span: 14, children: /* @__PURE__ */ i(
3603
- pe,
3602
+ /* @__PURE__ */ i(H, { span: 14, children: /* @__PURE__ */ i(
3603
+ me,
3604
3604
  {
3605
3605
  placeholder: "Escalate to",
3606
3606
  className: "w-full",
3607
- value: A,
3608
- onChange: L,
3607
+ value: S,
3608
+ onChange: $,
3609
3609
  options: a
3610
3610
  }
3611
3611
  ) })
3612
3612
  ] })
3613
3613
  ] }) }),
3614
- /* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, lg: 5, children: /* @__PURE__ */ d("div", { children: [
3615
- /* @__PURE__ */ i(Te, { className: "text-gray-700 font-medium block mb-1", children: "Pick Actions" }),
3614
+ /* @__PURE__ */ i(H, { xs: 24, sm: 12, md: 8, lg: 5, children: /* @__PURE__ */ d("div", { children: [
3615
+ /* @__PURE__ */ i(Ie, { className: "text-gray-700 font-medium block mb-1", children: "Pick Actions" }),
3616
3616
  /* @__PURE__ */ i(
3617
- pe,
3617
+ me,
3618
3618
  {
3619
3619
  mode: "multiple",
3620
3620
  placeholder: "Select response actions",
3621
3621
  className: "w-full",
3622
- value: $,
3622
+ value: L,
3623
3623
  onChange: B,
3624
- options: ne
3624
+ options: te
3625
3625
  }
3626
3626
  )
3627
3627
  ] }) }),
3628
- /* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, lg: 3, children: /* @__PURE__ */ i("div", { className: "flex items-end h-full", children: /* @__PURE__ */ i(Be, { checked: V, onChange: (E) => H(E.target.checked), children: "Human-In-The-Loop" }) }) })
3628
+ /* @__PURE__ */ i(H, { xs: 24, sm: 12, md: 8, lg: 3, children: /* @__PURE__ */ i("div", { className: "flex items-end h-full", children: /* @__PURE__ */ i(je, { checked: J, onChange: (P) => G(P.target.checked), children: "Human-In-The-Loop" }) }) })
3629
3629
  ] }),
3630
- /* @__PURE__ */ d(ge, { gutter: [16, 16], align: "bottom", className: "mt-4", children: [
3631
- /* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, lg: 5, children: /* @__PURE__ */ d("div", { children: [
3632
- /* @__PURE__ */ i(Te, { className: "text-gray-700 font-medium block mb-1", children: "Third Party App" }),
3630
+ /* @__PURE__ */ d(ye, { gutter: [16, 16], align: "bottom", className: "mt-4", children: [
3631
+ /* @__PURE__ */ i(H, { xs: 24, sm: 12, md: 8, lg: 5, children: /* @__PURE__ */ d("div", { children: [
3632
+ /* @__PURE__ */ i(Ie, { className: "text-gray-700 font-medium block mb-1", children: "Third Party App" }),
3633
3633
  /* @__PURE__ */ i(
3634
- pe,
3634
+ me,
3635
3635
  {
3636
3636
  mode: "multiple",
3637
3637
  placeholder: "Third Party app",
3638
3638
  className: "w-full",
3639
- value: F,
3640
- onChange: z,
3639
+ value: U,
3640
+ onChange: Y,
3641
3641
  options: g
3642
3642
  }
3643
3643
  )
3644
3644
  ] }) }),
3645
- /* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
3646
- /* @__PURE__ */ i(ye, { onClick: W, children: "Clear" }),
3647
- /* @__PURE__ */ i(ye, { type: "primary", onClick: C, loading: !!N, disabled: !(!!t && v && !N), children: "Save" })
3645
+ /* @__PURE__ */ i(H, { xs: 24, sm: 12, md: 8, children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
3646
+ /* @__PURE__ */ i(pe, { onClick: W, children: "Clear" }),
3647
+ /* @__PURE__ */ i(pe, { type: "primary", onClick: T, loading: !!x, disabled: !(!!t && v && !x), children: "Save" })
3648
3648
  ] }) })
3649
3649
  ] })
3650
3650
  ] });
@@ -3652,7 +3652,7 @@ function bn(e) {
3652
3652
  function Sn({ entries: e, userRoles: t, onEdit: s, loading: r }) {
3653
3653
  const n = new Map(t.map((o) => [o.userRoleId, o.userRoleName])), a = (o) => o.map((l) => n.get(l) || String(l)).join(", ");
3654
3654
  return /* @__PURE__ */ i(
3655
- gt,
3655
+ yt,
3656
3656
  {
3657
3657
  rowKey: "id",
3658
3658
  dataSource: e,
@@ -3702,59 +3702,59 @@ function Sn({ entries: e, userRoles: t, onEdit: s, loading: r }) {
3702
3702
  {
3703
3703
  title: "Actions",
3704
3704
  key: "ops",
3705
- render: (o, l) => /* @__PURE__ */ i(ye, { type: "text", onClick: () => s(l.id), children: /* @__PURE__ */ i(Ls, {}) })
3705
+ render: (o, l) => /* @__PURE__ */ i(pe, { type: "text", onClick: () => s(l.id), children: /* @__PURE__ */ i(Ls, {}) })
3706
3706
  }
3707
3707
  ]
3708
3708
  }
3709
3709
  );
3710
3710
  }
3711
- const { Title: An } = qe;
3711
+ const { Title: An } = _e;
3712
3712
  function Nn({ userRoles: e, rules: t, rawRules: s }) {
3713
- const { rules: r } = Ne(), [n, a] = I(!1), [o, l] = I(s), [h, u] = I({}), f = ue(() => e.map((m) => ({ label: m.userRoleName, value: m.userRoleId })), [e]), b = ue(
3714
- () => (t || []).map((m, A) => ({
3715
- key: m.RuleId || m.Name || String(A),
3716
- ruleName: m.Name || "-",
3717
- ruleDesc: m.Description || ""
3713
+ const { rules: r } = Ae(), [n, a] = I(!1), [o, l] = I(s), [h, u] = I({}), c = ue(() => e.map((p) => ({ label: p.userRoleName, value: p.userRoleId })), [e]), N = ue(
3714
+ () => (t || []).map((p, S) => ({
3715
+ key: p.RuleId || p.Name || String(S),
3716
+ ruleName: p.Name || "-",
3717
+ ruleDesc: p.Description || ""
3718
3718
  })),
3719
3719
  [t]
3720
3720
  );
3721
- fe(() => {
3722
- let m = !1;
3721
+ he(() => {
3722
+ let p = !1;
3723
3723
  return (async () => {
3724
3724
  try {
3725
3725
  a(!0);
3726
- const A = await r.getRules();
3727
- m || (l(Array.isArray(A) ? A : []), u({}));
3726
+ const S = await r.getRules();
3727
+ p || (l(Array.isArray(S) ? S : []), u({}));
3728
3728
  } catch {
3729
- !m && Array.isArray(s) && l(s);
3729
+ !p && Array.isArray(s) && l(s);
3730
3730
  } finally {
3731
- m || a(!1);
3731
+ p || a(!1);
3732
3732
  }
3733
3733
  })(), () => {
3734
- m = !0;
3734
+ p = !0;
3735
3735
  };
3736
- }, []), fe(() => {
3736
+ }, []), he(() => {
3737
3737
  !o && Array.isArray(s) && l(s);
3738
3738
  }, [s]);
3739
- const p = ue(() => {
3739
+ const f = ue(() => {
3740
3740
  if (!Array.isArray(o) || !o.length) return {};
3741
- const m = {};
3742
- for (const A of b) {
3743
- const L = o.find(
3744
- (B) => B?.ruleId === A.key || B?.ruleName === A.key || B?.RuleId === A.key || B?.ruleName === A.ruleName || // fallback by name
3745
- B?.Name === A.ruleName
3746
- ), $ = Array.isArray(L?.userRoleIds) ? L.userRoleIds : [];
3747
- $.length && (m[A.key] = $);
3741
+ const p = {};
3742
+ for (const S of N) {
3743
+ const $ = o.find(
3744
+ (B) => B?.ruleId === S.key || B?.ruleName === S.key || B?.RuleId === S.key || B?.ruleName === S.ruleName || // fallback by name
3745
+ B?.Name === S.ruleName
3746
+ ), L = Array.isArray($?.userRoleIds) ? $.userRoleIds : [];
3747
+ L.length && (p[S.key] = L);
3748
3748
  }
3749
- return m;
3750
- }, [o, b]);
3749
+ return p;
3750
+ }, [o, N]);
3751
3751
  return /* @__PURE__ */ d("div", { className: "w-full", children: [
3752
3752
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ i(An, { level: 4, className: "!mb-4", children: "Alert Assignment" }) }),
3753
3753
  /* @__PURE__ */ i(
3754
- gt,
3754
+ yt,
3755
3755
  {
3756
3756
  rowKey: "key",
3757
- dataSource: b,
3757
+ dataSource: N,
3758
3758
  loading: n,
3759
3759
  pagination: !1,
3760
3760
  columns: [
@@ -3763,54 +3763,54 @@ function Nn({ userRoles: e, rules: t, rawRules: s }) {
3763
3763
  {
3764
3764
  title: "Alert Notification To",
3765
3765
  key: "assign",
3766
- render: (m, A) => /* @__PURE__ */ i(
3767
- pe,
3766
+ render: (p, S) => /* @__PURE__ */ i(
3767
+ me,
3768
3768
  {
3769
3769
  mode: "multiple",
3770
3770
  placeholder: "Dropdown with Multi select",
3771
3771
  className: "w-full",
3772
- value: h[A.key] ?? p[A.key] ?? [],
3773
- onChange: (L) => u(($) => ({ ...$, [A.key]: L })),
3774
- options: f
3772
+ value: h[S.key] ?? f[S.key] ?? [],
3773
+ onChange: ($) => u((L) => ({ ...L, [S.key]: $ })),
3774
+ options: c
3775
3775
  }
3776
3776
  )
3777
3777
  }
3778
3778
  ]
3779
3779
  }
3780
3780
  ),
3781
- /* @__PURE__ */ d(Ae, { className: "mt-4", children: [
3782
- /* @__PURE__ */ i(ye, { onClick: () => {
3781
+ /* @__PURE__ */ d(Se, { className: "mt-4", children: [
3782
+ /* @__PURE__ */ i(pe, { onClick: () => {
3783
3783
  u({});
3784
3784
  }, disabled: n, children: "Clear" }),
3785
3785
  /* @__PURE__ */ i(
3786
- ye,
3786
+ pe,
3787
3787
  {
3788
3788
  type: "primary",
3789
3789
  onClick: async () => {
3790
3790
  try {
3791
3791
  if (!o || !Array.isArray(o) || Object.keys(h).length === 0) {
3792
- ie.info("No changes to save");
3792
+ ne.info("No changes to save");
3793
3793
  return;
3794
3794
  }
3795
3795
  a(!0);
3796
- const m = Object.entries(h).map(async ([A, L]) => {
3797
- const $ = o.find(
3798
- (H) => H?.ruleId === A || H?.ruleName === A || H?.RuleId === A
3799
- ), B = typeof $?.recordId == "number" ? $.recordId : void 0;
3800
- if (!$ || typeof B != "number")
3801
- throw new Error(`Unable to find recordId for rule ${A}`);
3802
- const F = Array.isArray(L) ? L : [], z = F.map((H) => {
3803
- const W = e.find((C) => C.userRoleId === H);
3796
+ const p = Object.entries(h).map(async ([S, $]) => {
3797
+ const L = o.find(
3798
+ (G) => G?.ruleId === S || G?.ruleName === S || G?.RuleId === S
3799
+ ), B = typeof L?.recordId == "number" ? L.recordId : void 0;
3800
+ if (!L || typeof B != "number")
3801
+ throw new Error(`Unable to find recordId for rule ${S}`);
3802
+ const U = Array.isArray($) ? $ : [], Y = U.map((G) => {
3803
+ const W = e.find((T) => T.userRoleId === G);
3804
3804
  return {
3805
- id: H,
3806
- name: W?.userRoleName ?? String(H)
3805
+ id: G,
3806
+ name: W?.userRoleName ?? String(G)
3807
3807
  };
3808
- }), V = {
3809
- ...$,
3810
- ruleId: A,
3808
+ }), J = {
3809
+ ...L,
3810
+ ruleId: S,
3811
3811
  // ensure ruleId matches the selected rule
3812
- userRoleIds: F,
3813
- userRoles: z,
3812
+ userRoleIds: U,
3813
+ userRoles: Y,
3814
3814
  actions: [
3815
3815
  {
3816
3816
  actionTypeId: 4,
@@ -3825,17 +3825,17 @@ function Nn({ userRoles: e, rules: t, rawRules: s }) {
3825
3825
  }
3826
3826
  ]
3827
3827
  };
3828
- return r.updateRule(B, V);
3828
+ return r.updateRule(B, J);
3829
3829
  });
3830
- await Promise.all(m), ie.success("Alert assignment saved");
3830
+ await Promise.all(p), ne.success("Alert assignment saved");
3831
3831
  try {
3832
- const A = await r.getRules();
3833
- l(Array.isArray(A) ? A : []), u({});
3834
- } catch (A) {
3835
- console.error("Failed to refresh rules after save", A);
3832
+ const S = await r.getRules();
3833
+ l(Array.isArray(S) ? S : []), u({});
3834
+ } catch (S) {
3835
+ console.error("Failed to refresh rules after save", S);
3836
3836
  }
3837
- } catch (m) {
3838
- console.error("Failed to save alert assignment", m);
3837
+ } catch (p) {
3838
+ console.error("Failed to save alert assignment", p);
3839
3839
  } finally {
3840
3840
  a(!1);
3841
3841
  }
@@ -3848,132 +3848,130 @@ function Nn({ userRoles: e, rules: t, rawRules: s }) {
3848
3848
  ] })
3849
3849
  ] });
3850
3850
  }
3851
- const { Title: es } = qe;
3851
+ const { Title: es } = _e;
3852
3852
  function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
3853
- const { rules: a, alerts: o } = Ne(), [l, h] = I("By Severity"), [u, f] = I("By severity"), [b, p] = I("By Severity"), [R, x] = I(!1), [m, A] = I(!1), [L, $] = I(!1), [B, F] = I(null), [z, V] = I("rules"), [H, W] = I(), [C, N] = I();
3854
- console.log("usr", s);
3855
- const [T, te] = I(), [ne, O] = I(), [g, y] = I(), [S, c] = I(), [v, w] = I(), [E, k] = I(), [U, Q] = I([]), [j, M] = I([]), [K, ee] = I(!1), [Y, se] = I({}), [re, me] = I({}), [de, tt] = I(s || []), [$e, Me] = I([]), [st, le] = I(!1), [Fe, _e] = I(!1), [rt, Rt] = I(r || []);
3856
- fe(() => {
3853
+ const { rules: a, alerts: o } = Ae(), [l, h] = I("By Severity"), [u, c] = I("By severity"), [N, f] = I("By Severity"), [O, w] = I(!1), [p, S] = I(!1), [$, L] = I(!1), [B, U] = I(null), [Y, J] = I("rules"), [G, W] = I(), [T, x] = I(), [R, se] = I(), [te, k] = I(), [g, m] = I(), [A, y] = I(), [v, b] = I(), [P, M] = I(), [D, j] = I([]), [Q, z] = I([]), [ie, fe] = I(!1), [le, re] = I({}), [C, _] = I({}), [V, Te] = I(s || []), [Re, Le] = I([]), [tt, ke] = I(!1), [st, Tt] = I(!1), [Ee, Rt] = I(r || []);
3854
+ he(() => {
3857
3855
  r && r.length && Rt(r);
3858
- }, [r]), fe(() => {
3859
- if (!r || !r.length) return;
3860
- const P = Object.keys(Y).length > 0 || Object.keys(re).length > 0;
3861
- if ($e.length && !P) return;
3862
- const X = r.map((q, D) => {
3863
- const J = t.find((xe) => xe.RuleId === (q.ruleId || q.ruleName))?.Name || q.ruleName || q.Name || "-", G = q.escalationSettings || {}, Z = typeof G.level1UserRoleId == "number" && G.level1UserRoleId > 0 ? [G.level1UserRoleId] : [], we = typeof G.level2UserRoleId == "number" && G.level2UserRoleId > 0 ? [G.level2UserRoleId] : [], nt = typeof G.level3UserRoleId == "number" && G.level3UserRoleId > 0 ? [G.level3UserRoleId] : [], Ot = (Array.isArray(G.escalationSettingsActionTypeIds) ? G.escalationSettingsActionTypeIds : []).map((xe) => Y[xe] || String(xe)), Et = (Array.isArray(G.thirdPartyId) ? G.thirdPartyId : []).map((xe) => re[xe] || String(xe)), it = typeof G.humanLoop == "boolean" ? G.humanLoop : null;
3856
+ }, [r]), he(() => {
3857
+ if (!Ee || !Ee.length) return;
3858
+ const E = Object.keys(le).length > 0 || Object.keys(C).length > 0;
3859
+ if (Re.length && !E) return;
3860
+ const Z = Ee.map((q, F) => {
3861
+ const X = t.find((we) => we.RuleId === (q.ruleId || q.ruleName))?.Name || q.ruleName || q.Name || "-", K = q.escalationSettings || {}, ee = typeof K.level1UserRoleId == "number" && K.level1UserRoleId > 0 ? [K.level1UserRoleId] : [], Ne = typeof K.level2UserRoleId == "number" && K.level2UserRoleId > 0 ? [K.level2UserRoleId] : [], rt = typeof K.level3UserRoleId == "number" && K.level3UserRoleId > 0 ? [K.level3UserRoleId] : [], Ot = (Array.isArray(K.escalationSettingsActionTypeIds) ? K.escalationSettingsActionTypeIds : []).map((we) => le[we] || String(we)), Et = (Array.isArray(K.thirdPartyId) ? K.thirdPartyId : []).map((we) => C[we] || String(we)), nt = typeof K.humanLoop == "boolean" ? K.humanLoop : null;
3864
3862
  return {
3865
- id: String(q.ruleId || q.ruleName || D),
3866
- ruleOrSeverityLabel: J,
3867
- l1: { minutes: G.level1PostAssistTime ?? void 0, roles: Z },
3868
- l2: { minutes: G.level2PostAssistTime ?? void 0, roles: we },
3869
- l3: { minutes: G.level3PostAssistTime ?? void 0, roles: nt },
3863
+ id: String(q.ruleId || q.ruleName || F),
3864
+ ruleOrSeverityLabel: X,
3865
+ l1: { minutes: K.level1PostAssistTime ?? void 0, roles: ee },
3866
+ l2: { minutes: K.level2PostAssistTime ?? void 0, roles: Ne },
3867
+ l3: { minutes: K.level3PostAssistTime ?? void 0, roles: rt },
3870
3868
  actions: Ot,
3871
3869
  notify: Et,
3872
- humanLoop: it
3870
+ humanLoop: nt
3873
3871
  };
3874
3872
  });
3875
- Me(X);
3876
- }, [r, t, Y, re]);
3873
+ Le(Z);
3874
+ }, [Ee, t, le, C]);
3877
3875
  const vs = ue(
3878
- () => e.map((P) => ({ label: P.DisplayName, value: P.SeverityId })),
3876
+ () => e.map((E) => ({ label: E.DisplayName, value: E.SeverityId })),
3879
3877
  [e]
3880
3878
  ), bs = ue(
3881
- () => t.map((P) => ({ label: P.Name, value: P.RuleId })),
3879
+ () => t.map((E) => ({ label: E.Name, value: E.RuleId })),
3882
3880
  [t]
3883
3881
  ), Ss = ue(
3884
- () => de.map((P) => ({ label: P.userRoleName, value: P.userRoleId })),
3885
- [de]
3886
- ), As = ue(() => [1, 3, 5, 10, 15, 20, 30, 45, 60].map((P) => ({ label: `${P}`, value: P })), []);
3887
- fe(() => {
3888
- let P = !1;
3889
- async function X() {
3882
+ () => V.map((E) => ({ label: E.userRoleName, value: E.userRoleId })),
3883
+ [V]
3884
+ ), As = ue(() => [1, 3, 5, 10, 15, 20, 30, 45, 60].map((E) => ({ label: `${E}`, value: E })), []);
3885
+ he(() => {
3886
+ let E = !1;
3887
+ async function Z() {
3890
3888
  try {
3891
- $(!0), F(null);
3889
+ L(!0), U(null);
3892
3890
  const q = await o.getAdminSettings();
3893
- if (!P && q) {
3894
- const D = rs(q.sortBy);
3895
- h(D), p(D), x(!1);
3891
+ if (!E && q) {
3892
+ const F = rs(q.sortBy);
3893
+ h(F), f(F), w(!1);
3896
3894
  }
3897
3895
  } catch (q) {
3898
- if (!P) {
3899
- const D = q instanceof Error ? q.message : "Failed to load admin settings";
3900
- F(D);
3896
+ if (!E) {
3897
+ const F = q instanceof Error ? q.message : "Failed to load admin settings";
3898
+ U(F);
3901
3899
  }
3902
3900
  } finally {
3903
- P || $(!1);
3901
+ E || L(!1);
3904
3902
  }
3905
3903
  }
3906
- return X(), () => {
3907
- P = !0;
3904
+ return Z(), () => {
3905
+ E = !0;
3908
3906
  };
3909
- }, []), fe(() => {
3910
- if (!C) return;
3911
- const P = (J) => {
3912
- const G = Number(J);
3913
- return !isNaN(G) && G > 0 ? G : void 0;
3914
- }, X = (J) => {
3915
- const G = Number(J);
3916
- return !isNaN(G) && G > 0 ? G : void 0;
3917
- }, D = (rt || []).find(
3918
- (J) => J?.ruleId === C || J?.ruleName === C || J?.RuleId === C
3907
+ }, []), he(() => {
3908
+ if (!T) return;
3909
+ const E = (X) => {
3910
+ const K = Number(X);
3911
+ return !isNaN(K) && K > 0 ? K : void 0;
3912
+ }, Z = (X) => {
3913
+ const K = Number(X);
3914
+ return !isNaN(K) && K > 0 ? K : void 0;
3915
+ }, F = (Ee || []).find(
3916
+ (X) => X?.ruleId === T || X?.ruleName === T || X?.RuleId === T
3919
3917
  )?.escalationSettings;
3920
- if (D && typeof D == "object") {
3921
- te(X(D.level1PostAssistTime)), O(P(D.level1UserRoleId)), y(X(D.level2PostAssistTime)), c(P(D.level2UserRoleId)), w(X(D.level3PostAssistTime)), k(P(D.level3UserRoleId));
3922
- const J = Array.isArray(D.escalationSettingsActionTypeIds) ? D.escalationSettingsActionTypeIds : [];
3923
- Q(J.map((G) => String(G))), M(Array.isArray(D.thirdPartyId) ? D.thirdPartyId : []), ee(!!D.humanLoop);
3918
+ if (F && typeof F == "object") {
3919
+ se(Z(F.level1PostAssistTime)), k(E(F.level1UserRoleId)), m(Z(F.level2PostAssistTime)), y(E(F.level2UserRoleId)), b(Z(F.level3PostAssistTime)), M(E(F.level3UserRoleId));
3920
+ const X = Array.isArray(F.escalationSettingsActionTypeIds) ? F.escalationSettingsActionTypeIds : [];
3921
+ j(X.map((K) => String(K))), z(Array.isArray(F.thirdPartyId) ? F.thirdPartyId : []), fe(!!F.humanLoop);
3924
3922
  }
3925
- }, [z, C, rt]);
3923
+ }, [Y, T, Ee]);
3926
3924
  const Ns = async () => {
3927
3925
  try {
3928
- _e(!0);
3929
- const P = await a.getRules(), X = Array.isArray(P) ? P : Array.isArray(P?.data) ? P.data : [];
3930
- Rt(X);
3931
- const q = X.map((D, J) => {
3932
- const G = t.find((Oe) => Oe.RuleId === (D.ruleId || D.ruleName))?.Name || D.ruleName || D.Name || "-", Z = D.escalationSettings || {}, we = typeof Z.level1UserRoleId == "number" && Z.level1UserRoleId > 0 ? [Z.level1UserRoleId] : [], nt = typeof Z.level2UserRoleId == "number" && Z.level2UserRoleId > 0 ? [Z.level2UserRoleId] : [], kt = typeof Z.level3UserRoleId == "number" && Z.level3UserRoleId > 0 ? [Z.level3UserRoleId] : [], Pt = (Array.isArray(Z.escalationSettingsActionTypeIds) ? Z.escalationSettingsActionTypeIds : []).map((Oe) => Y[Oe] || String(Oe)), it = (Array.isArray(Z.thirdPartyId) ? Z.thirdPartyId : []).map((Oe) => re[Oe] || String(Oe)), xe = typeof Z.humanLoop == "boolean" ? Z.humanLoop : null;
3926
+ Tt(!0);
3927
+ const E = await a.getRules(), Z = Array.isArray(E) ? E : Array.isArray(E?.data) ? E.data : [];
3928
+ Rt(Z);
3929
+ const q = Z.map((F, X) => {
3930
+ const K = t.find((De) => De.RuleId === (F.ruleId || F.ruleName))?.Name || F.ruleName || F.Name || "-", ee = F.escalationSettings || {}, Ne = typeof ee.level1UserRoleId == "number" && ee.level1UserRoleId > 0 ? [ee.level1UserRoleId] : [], rt = typeof ee.level2UserRoleId == "number" && ee.level2UserRoleId > 0 ? [ee.level2UserRoleId] : [], kt = typeof ee.level3UserRoleId == "number" && ee.level3UserRoleId > 0 ? [ee.level3UserRoleId] : [], Pt = (Array.isArray(ee.escalationSettingsActionTypeIds) ? ee.escalationSettingsActionTypeIds : []).map((De) => le[De] || String(De)), nt = (Array.isArray(ee.thirdPartyId) ? ee.thirdPartyId : []).map((De) => C[De] || String(De)), we = typeof ee.humanLoop == "boolean" ? ee.humanLoop : null;
3933
3931
  return {
3934
- id: String(D.ruleId || D.ruleName || J),
3935
- ruleOrSeverityLabel: G,
3936
- l1: { minutes: Z.level1PostAssistTime ?? void 0, roles: we },
3937
- l2: { minutes: Z.level2PostAssistTime ?? void 0, roles: nt },
3938
- l3: { minutes: Z.level3PostAssistTime ?? void 0, roles: kt },
3932
+ id: String(F.ruleId || F.ruleName || X),
3933
+ ruleOrSeverityLabel: K,
3934
+ l1: { minutes: ee.level1PostAssistTime ?? void 0, roles: Ne },
3935
+ l2: { minutes: ee.level2PostAssistTime ?? void 0, roles: rt },
3936
+ l3: { minutes: ee.level3PostAssistTime ?? void 0, roles: kt },
3939
3937
  actions: Pt,
3940
- notify: it,
3941
- humanLoop: xe
3938
+ notify: nt,
3939
+ humanLoop: we
3942
3940
  };
3943
3941
  });
3944
- Me(q);
3945
- } catch (P) {
3946
- console.error("Failed to refetch entries", P);
3942
+ Le(q);
3943
+ } catch (E) {
3944
+ console.error("Failed to refetch entries", E);
3947
3945
  } finally {
3948
- _e(!1);
3946
+ Tt(!1);
3949
3947
  }
3950
3948
  };
3951
- return fe(() => {
3952
- let P = !1;
3949
+ return he(() => {
3950
+ let E = !1;
3953
3951
  return (async () => {
3954
3952
  try {
3955
- const X = await a.getLookups();
3956
- if (P || !X) return;
3953
+ const Z = await a.getLookups();
3954
+ if (E || !Z) return;
3957
3955
  const q = {};
3958
- if (Array.isArray(X.thirdParties))
3959
- for (const J of X.thirdParties)
3960
- typeof J.thirdPartyId == "number" && (q[J.thirdPartyId] = J.thirdPartyName);
3961
- me(q);
3962
- const D = Array.isArray(X.userRoles) ? X.userRoles.map((J) => ({
3963
- userRoleId: J.userRoleId ?? J.id,
3964
- userRoleName: J.userRoleName ?? J.name
3956
+ if (Array.isArray(Z.thirdParties))
3957
+ for (const X of Z.thirdParties)
3958
+ typeof X.thirdPartyId == "number" && (q[X.thirdPartyId] = X.thirdPartyName);
3959
+ _(q);
3960
+ const F = Array.isArray(Z.userRoles) ? Z.userRoles.map((X) => ({
3961
+ userRoleId: X.userRoleId ?? X.id,
3962
+ userRoleName: X.userRoleName ?? X.name
3965
3963
  })) : [];
3966
- P || tt(D.length ? D : s || []);
3967
- } catch (X) {
3968
- console.error("Error loading lookups", X);
3964
+ E || Te(F.length ? F : s || []);
3965
+ } catch (Z) {
3966
+ console.error("Error loading lookups", Z);
3969
3967
  }
3970
3968
  })(), () => {
3971
- P = !0;
3969
+ E = !0;
3972
3970
  };
3973
3971
  }, []), /* @__PURE__ */ d("div", { className: "w-full", children: [
3974
3972
  /* @__PURE__ */ d("div", { className: "mb-6", children: [
3975
3973
  /* @__PURE__ */ i(es, { level: 4, className: "!mb-2", children: "Admin Settings" }),
3976
- /* @__PURE__ */ d(vt, { spinning: L, children: [
3974
+ /* @__PURE__ */ d(gt, { spinning: $, children: [
3977
3975
  B ? /* @__PURE__ */ d("div", { className: "text-sm text-red-600 mb-2", children: [
3978
3976
  "Failed to load settings: ",
3979
3977
  B
@@ -3983,89 +3981,89 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
3983
3981
  {
3984
3982
  sortBy: l,
3985
3983
  groupBy: u,
3986
- onChange: (P) => {
3987
- P.sortBy && (h(P.sortBy), x(!0)), P.groupBy && (f(P.groupBy), x(!0));
3984
+ onChange: (E) => {
3985
+ E.sortBy && (h(E.sortBy), w(!0)), E.groupBy && (c(E.groupBy), w(!0));
3988
3986
  },
3989
- showActions: R,
3987
+ showActions: O,
3990
3988
  onSave: async () => {
3991
- A(!0);
3989
+ S(!0);
3992
3990
  try {
3993
- const P = await o.setAdminSettings({ sortBy: l, groupBy: "string" });
3994
- P?.responseStatus && P?.data && ie.success(P.data), p(l), x(!1);
3995
- } catch (P) {
3996
- console.error("Error saving admin settings", P);
3991
+ const E = await o.setAdminSettings({ sortBy: l, groupBy: "string" });
3992
+ E?.responseStatus && E?.data && ne.success(E.data), f(l), w(!1);
3993
+ } catch (E) {
3994
+ console.error("Error saving admin settings", E);
3997
3995
  } finally {
3998
- A(!1);
3996
+ S(!1);
3999
3997
  }
4000
3998
  },
4001
3999
  onClear: () => {
4002
- h(b), x(!1);
4000
+ h(N), w(!1);
4003
4001
  },
4004
- saving: m
4002
+ saving: p
4005
4003
  }
4006
4004
  )
4007
4005
  ] })
4008
4006
  ] }),
4009
- /* @__PURE__ */ i(je, { className: "my-6" }),
4007
+ /* @__PURE__ */ i(Qe, { className: "my-6" }),
4010
4008
  /* @__PURE__ */ d("div", { children: [
4011
4009
  /* @__PURE__ */ i(es, { level: 4, className: "!mb-4", children: "Escalation Settings" }),
4012
4010
  /* @__PURE__ */ i(
4013
4011
  bn,
4014
4012
  {
4015
- escBasis: z,
4016
- setEscBasis: V,
4017
- selectedSeverity: H,
4013
+ escBasis: Y,
4014
+ setEscBasis: J,
4015
+ selectedSeverity: G,
4018
4016
  setSelectedSeverity: W,
4019
- selectedRule: C,
4020
- setSelectedRule: N,
4017
+ selectedRule: T,
4018
+ setSelectedRule: x,
4021
4019
  severityOptions: vs,
4022
4020
  ruleOptions: bs,
4023
4021
  minsOptions: As,
4024
4022
  roleOptions: Ss,
4025
- l1mins: T,
4026
- setL1mins: te,
4027
- l1role: ne,
4028
- setL1role: O,
4023
+ l1mins: R,
4024
+ setL1mins: se,
4025
+ l1role: te,
4026
+ setL1role: k,
4029
4027
  l2mins: g,
4030
- setL2mins: y,
4031
- l2role: S,
4032
- setL2role: c,
4028
+ setL2mins: m,
4029
+ l2role: A,
4030
+ setL2role: y,
4033
4031
  l3mins: v,
4034
- setL3mins: w,
4035
- l3role: E,
4036
- setL3role: k,
4037
- actions: U,
4038
- setActions: Q,
4039
- thirdPartyIds: j,
4040
- setThirdPartyIds: M,
4041
- humanLoop: K,
4042
- setHumanLoop: ee,
4032
+ setL3mins: b,
4033
+ l3role: P,
4034
+ setL3role: M,
4035
+ actions: D,
4036
+ setActions: j,
4037
+ thirdPartyIds: Q,
4038
+ setThirdPartyIds: z,
4039
+ humanLoop: ie,
4040
+ setHumanLoop: fe,
4043
4041
  onClear: () => {
4044
- h("By Severity"), f("By severity"), V("rules"), W(void 0), N(void 0), te(void 0), O(void 0), y(void 0), c(void 0), w(void 0), k(void 0), Q([]), M([]), ee(!1);
4042
+ h("By Severity"), c("By severity"), J("rules"), W(void 0), x(void 0), se(void 0), k(void 0), m(void 0), y(void 0), b(void 0), M(void 0), j([]), z([]), fe(!1);
4045
4043
  },
4046
4044
  onSave: async () => {
4047
- le(!0), n?.({
4048
- ruleId: C,
4045
+ ke(!0), n?.({
4046
+ ruleId: T,
4049
4047
  levels: [
4050
- { minutes: T, role: ne },
4051
- { minutes: g, role: S },
4052
- { minutes: v, role: E }
4048
+ { minutes: R, role: te },
4049
+ { minutes: g, role: A },
4050
+ { minutes: v, role: P }
4053
4051
  ],
4054
- actions: U,
4055
- thirdPartyIds: j,
4056
- humanLoop: K
4052
+ actions: D,
4053
+ thirdPartyIds: Q,
4054
+ humanLoop: ie
4057
4055
  });
4058
4056
  try {
4059
- if (C) {
4060
- const q = Array.isArray(U) ? U.map((we) => Number(we)) : [], D = (rt || []).find(
4061
- (we) => we?.ruleId === C || we?.ruleName === C || we?.RuleId === C
4062
- ), J = typeof D?.recordId == "number" ? D.recordId : void 0;
4063
- if (!D || typeof J != "number") {
4064
- ie.error("Unable to find rule recordId for update");
4057
+ if (T) {
4058
+ const q = Array.isArray(D) ? D.map((Ne) => Number(Ne)) : [], F = (Ee || []).find(
4059
+ (Ne) => Ne?.ruleId === T || Ne?.ruleName === T || Ne?.RuleId === T
4060
+ ), X = typeof F?.recordId == "number" ? F.recordId : void 0;
4061
+ if (!F || typeof X != "number") {
4062
+ ne.error("Unable to find rule recordId for update");
4065
4063
  return;
4066
4064
  }
4067
- const G = {
4068
- ...D,
4065
+ const K = {
4066
+ ...F,
4069
4067
  actions: [
4070
4068
  //this will definitely be remoed
4071
4069
  {
@@ -4081,192 +4079,192 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
4081
4079
  }
4082
4080
  ],
4083
4081
  escalationSettings: {
4084
- level1UserRoleId: ne ?? 0,
4085
- level1PostAssistTime: T ?? 0,
4086
- level2UserRoleId: S ?? 0,
4082
+ level1UserRoleId: te ?? 0,
4083
+ level1PostAssistTime: R ?? 0,
4084
+ level2UserRoleId: A ?? 0,
4087
4085
  level2PostAssistTime: g ?? 0,
4088
- level3UserRoleId: E ?? 0,
4086
+ level3UserRoleId: P ?? 0,
4089
4087
  level3PostAssistTime: v ?? 0,
4090
4088
  escalationSettingsActionTypeIds: q,
4091
- thirdPartyId: Array.isArray(j) ? j : [],
4092
- humanLoop: K
4089
+ thirdPartyId: Array.isArray(Q) ? Q : [],
4090
+ humanLoop: ie
4093
4091
  }
4094
- }, Z = await a.updateRule(J, G);
4095
- if (Z?.responseStatus || Z?.ok || Z) {
4096
- ie.success("Escalation settings saved"), await Ns(), N(void 0), te(void 0), O(void 0), y(void 0), c(void 0), w(void 0), k(void 0), Q([]), M([]), ee(!1);
4092
+ }, ee = await a.updateRule(X, K);
4093
+ if (ee?.responseStatus || ee?.ok || ee) {
4094
+ ne.success("Escalation settings saved"), await Ns(), x(void 0), se(void 0), k(void 0), m(void 0), y(void 0), b(void 0), M(void 0), j([]), z([]), fe(!1);
4097
4095
  return;
4098
4096
  }
4099
4097
  }
4100
4098
  } catch (q) {
4101
4099
  console.error("Error saving escalation settings", q);
4102
4100
  } finally {
4103
- le(!1);
4101
+ ke(!1);
4104
4102
  }
4105
- const X = t.find((q) => q.RuleId === C)?.Name || "-";
4106
- Me((q) => [
4103
+ const Z = t.find((q) => q.RuleId === T)?.Name || "-";
4104
+ Le((q) => [
4107
4105
  ...q,
4108
4106
  {
4109
4107
  id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
4110
- ruleOrSeverityLabel: X,
4111
- l1: { minutes: T, roles: ne ? [ne] : [] },
4112
- l2: { minutes: g, roles: S ? [S] : [] },
4113
- l3: { minutes: v, roles: E ? [E] : [] },
4114
- actions: (Array.isArray(U) ? U : []).map((D) => {
4115
- const J = Number(D);
4116
- return Y[J] || String(D);
4108
+ ruleOrSeverityLabel: Z,
4109
+ l1: { minutes: R, roles: te ? [te] : [] },
4110
+ l2: { minutes: g, roles: A ? [A] : [] },
4111
+ l3: { minutes: v, roles: P ? [P] : [] },
4112
+ actions: (Array.isArray(D) ? D : []).map((F) => {
4113
+ const X = Number(F);
4114
+ return le[X] || String(F);
4117
4115
  }),
4118
- notify: (Array.isArray(j) ? j : []).map((D) => re[D] || String(D)),
4119
- humanLoop: !!K
4116
+ notify: (Array.isArray(Q) ? Q : []).map((F) => C[F] || String(F)),
4117
+ humanLoop: !!ie
4120
4118
  }
4121
4119
  ]);
4122
4120
  },
4123
- saving: st,
4124
- onActionTypesLoaded: (P) => {
4125
- const X = {};
4126
- for (const q of P)
4127
- typeof q.actionTypeId == "number" && (X[q.actionTypeId] = q.name);
4128
- se(X);
4121
+ saving: tt,
4122
+ onActionTypesLoaded: (E) => {
4123
+ const Z = {};
4124
+ for (const q of E)
4125
+ typeof q.actionTypeId == "number" && (Z[q.actionTypeId] = q.name);
4126
+ re(Z);
4129
4127
  }
4130
4128
  }
4131
4129
  )
4132
4130
  ] }),
4133
- /* @__PURE__ */ i(je, { className: "my-6" }),
4131
+ /* @__PURE__ */ i(Qe, { className: "my-6" }),
4134
4132
  /* @__PURE__ */ i(
4135
4133
  Sn,
4136
4134
  {
4137
- entries: $e,
4138
- userRoles: de,
4139
- loading: Fe,
4140
- onEdit: (P) => {
4141
- V("rules");
4142
- const X = $e.find((D) => D.id === P), q = t.find((D) => D.RuleId === P) || (X ? t.find((D) => D.Name === X.ruleOrSeverityLabel) : void 0);
4143
- N(q ? q.RuleId : P);
4135
+ entries: Re,
4136
+ userRoles: V,
4137
+ loading: st,
4138
+ onEdit: (E) => {
4139
+ J("rules");
4140
+ const Z = Re.find((F) => F.id === E), q = t.find((F) => F.RuleId === E) || (Z ? t.find((F) => F.Name === Z.ruleOrSeverityLabel) : void 0);
4141
+ x(q ? q.RuleId : E);
4144
4142
  }
4145
4143
  }
4146
4144
  ),
4147
- /* @__PURE__ */ i(je, { className: "my-6" }),
4148
- /* @__PURE__ */ i(Nn, { userRoles: de, rules: t, rawRules: r }),
4149
- /* @__PURE__ */ i(je, {})
4145
+ /* @__PURE__ */ i(Qe, { className: "my-6" }),
4146
+ /* @__PURE__ */ i(Nn, { userRoles: V, rules: t, rawRules: r }),
4147
+ /* @__PURE__ */ i(Qe, {})
4150
4148
  ] });
4151
4149
  }
4152
- const { Title: ts, Text: Ye } = qe;
4150
+ const { Title: ts, Text: Ye } = _e;
4153
4151
  function xn({ severities: e, rules: t, onSave: s, onCancel: r }) {
4154
- const { rules: n, alerts: a } = Ne(), o = [
4152
+ const { rules: n, alerts: a } = Ae(), o = [
4155
4153
  { label: "By Severity", value: "By Severity" },
4156
4154
  { label: "By Created Date", value: "By Created Date" }
4157
- ], [l, h] = I("By Severity"), [u, f] = I(/* @__PURE__ */ new Set()), [b, p] = I(null), [R, x] = I(null), [m, A] = I({ inApp: !1, sms: !1, email: !1 }), [L, $] = I([]), [B, F] = I(!0), [z, V] = I(!1);
4158
- fe(() => {
4159
- let C = !1;
4155
+ ], [l, h] = I("By Severity"), [u, c] = I(/* @__PURE__ */ new Set()), [N, f] = I(null), [O, w] = I(null), [p, S] = I({ inApp: !1, sms: !1, email: !1 }), [$, L] = I([]), [B, U] = I(!0), [Y, J] = I(!1);
4156
+ he(() => {
4157
+ let T = !1;
4160
4158
  return (async () => {
4161
4159
  try {
4162
- const N = await a.getPreferenceSettings();
4163
- if (C || !N) return;
4164
- A({
4165
- inApp: !!N.inApp,
4160
+ const x = await a.getPreferenceSettings();
4161
+ if (T || !x) return;
4162
+ S({
4163
+ inApp: !!x.inApp,
4166
4164
  //convert to bool - as the resp is str
4167
- sms: !!N.sms,
4168
- email: !!N.email
4165
+ sms: !!x.sms,
4166
+ email: !!x.email
4169
4167
  });
4170
- const T = rs(N.sortBy);
4171
- h(T === "By Created Date" ? "By Created Date" : "By Severity"), p(Bt(N.doNotDisturbStart)), x(Bt(N.doNotDisturbEnd)), Array.isArray(N.anomalyIds) && f(new Set(N.anomalyIds.map((te) => String(te))));
4172
- } catch (N) {
4173
- console.error("Error in loading my preferences: ", N);
4168
+ const R = rs(x.sortBy);
4169
+ h(R === "By Created Date" ? "By Created Date" : "By Severity"), f(Bt(x.doNotDisturbStart)), w(Bt(x.doNotDisturbEnd)), Array.isArray(x.anomalyIds) && c(new Set(x.anomalyIds.map((se) => String(se))));
4170
+ } catch (x) {
4171
+ console.error("Error in loading my preferences: ", x);
4174
4172
  }
4175
4173
  })(), () => {
4176
- C = !0;
4174
+ T = !0;
4177
4175
  };
4178
- }, []), fe(() => {
4179
- let C = !1;
4176
+ }, []), he(() => {
4177
+ let T = !1;
4180
4178
  return (async () => {
4181
4179
  try {
4182
- F(!0);
4183
- const N = await n.getLookups();
4184
- if (C || !N) return;
4185
- const T = Array.isArray(N.anomalies) ? N.anomalies : [];
4186
- $(T);
4187
- } catch (N) {
4188
- console.error("Failed to load anomalies lookups", N);
4180
+ U(!0);
4181
+ const x = await n.getLookups();
4182
+ if (T || !x) return;
4183
+ const R = Array.isArray(x.anomalies) ? x.anomalies : [];
4184
+ L(R);
4185
+ } catch (x) {
4186
+ console.error("Failed to load anomalies lookups", x);
4189
4187
  } finally {
4190
- C || F(!1);
4188
+ T || U(!1);
4191
4189
  }
4192
4190
  })(), () => {
4193
- C = !0;
4191
+ T = !0;
4194
4192
  };
4195
4193
  }, []);
4196
- const H = (C) => {
4197
- f((N) => {
4198
- const T = new Set(N);
4199
- return T.has(C) ? T.delete(C) : T.add(C), T;
4194
+ const G = (T) => {
4195
+ c((x) => {
4196
+ const R = new Set(x);
4197
+ return R.has(T) ? R.delete(T) : R.add(T), R;
4200
4198
  });
4201
4199
  }, W = async () => {
4202
4200
  s?.({
4203
4201
  sortBy: l,
4204
4202
  subscribedRuleIds: Array.from(u),
4205
4203
  dnd: {
4206
- from: b,
4207
- to: R
4204
+ from: N,
4205
+ to: O
4208
4206
  },
4209
- channels: m
4207
+ channels: p
4210
4208
  });
4211
4209
  try {
4212
- V(!0);
4213
- const C = b ? b.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", N = R ? R.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", T = Array.from(u).map((ne) => Number(ne)).filter((ne) => Number.isFinite(ne)), te = await a.setPreferenceSettings({
4214
- anomalyIds: T,
4215
- doNotDisturbStart: C,
4216
- doNotDisturbEnd: N,
4217
- inApp: !!m.inApp,
4218
- sms: !!m.sms,
4219
- email: !!m.email,
4210
+ J(!0);
4211
+ const T = N ? N.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", x = O ? O.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", R = Array.from(u).map((te) => Number(te)).filter((te) => Number.isFinite(te)), se = await a.setPreferenceSettings({
4212
+ anomalyIds: R,
4213
+ doNotDisturbStart: T,
4214
+ doNotDisturbEnd: x,
4215
+ inApp: !!p.inApp,
4216
+ sms: !!p.sms,
4217
+ email: !!p.email,
4220
4218
  sortBy: l
4221
4219
  });
4222
- console.log("resp", te), te?.responseStatus && ie.success(te?.data || "Preferences updated successfully.");
4223
- } catch (C) {
4224
- console.error("Error in saving my preferences: ", C);
4220
+ se?.responseStatus && ne.success(se?.data || "Preferences updated successfully.");
4221
+ } catch (T) {
4222
+ console.error("Error in saving my preferences: ", T);
4225
4223
  } finally {
4226
- V(!1);
4224
+ J(!1);
4227
4225
  }
4228
4226
  };
4229
4227
  return /* @__PURE__ */ d("div", { className: "w-full", children: [
4230
- /* @__PURE__ */ i(ge, { gutter: [16, 16], align: "middle", className: "mb-4", children: /* @__PURE__ */ i(_, { xs: 24, md: 8, children: /* @__PURE__ */ d(Ae, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
4228
+ /* @__PURE__ */ i(ye, { gutter: [16, 16], align: "middle", className: "mb-4", children: /* @__PURE__ */ i(H, { xs: 24, md: 8, children: /* @__PURE__ */ d(Se, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
4231
4229
  /* @__PURE__ */ i(Ye, { className: "text-gray-600", children: "Sort By:" }),
4232
- /* @__PURE__ */ i(pe, { className: "w-[240px]", value: l, options: o, onChange: h })
4230
+ /* @__PURE__ */ i(me, { className: "w-[240px]", value: l, options: o, onChange: h })
4233
4231
  ] }) }) }),
4234
4232
  /* @__PURE__ */ d("div", { className: "mb-4", children: [
4235
4233
  /* @__PURE__ */ i(ts, { level: 5, className: "!mb-2", children: "Anomalies" }),
4236
- B ? /* @__PURE__ */ i("div", { className: "py-4", children: /* @__PURE__ */ i(vt, {}) }) : /* @__PURE__ */ i(Ae, { direction: "vertical", size: 10, className: "w-full", children: (Array.isArray(L) ? L : []).map((C) => {
4237
- const N = String(C.recordId), T = C.anomalyName;
4238
- return /* @__PURE__ */ i(Be, { checked: u.has(N), onChange: () => H(N), children: T }, N);
4234
+ B ? /* @__PURE__ */ i("div", { className: "py-4", children: /* @__PURE__ */ i(gt, {}) }) : /* @__PURE__ */ i(Se, { direction: "vertical", size: 10, className: "w-full", children: (Array.isArray($) ? $ : []).map((T) => {
4235
+ const x = String(T.recordId), R = T.anomalyName;
4236
+ return /* @__PURE__ */ i(je, { checked: u.has(x), onChange: () => G(x), children: R }, x);
4239
4237
  }) })
4240
4238
  ] }),
4241
4239
  /* @__PURE__ */ d("div", { className: "mb-4", children: [
4242
4240
  /* @__PURE__ */ i(ts, { level: 5, className: "!mb-2", children: "Notification Timing & Channels" }),
4243
- /* @__PURE__ */ i(ge, { gutter: [16, 16], align: "middle", className: "mb-3", children: /* @__PURE__ */ i(_, { xs: 24, md: 12, children: /* @__PURE__ */ d(Ae, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
4241
+ /* @__PURE__ */ i(ye, { gutter: [16, 16], align: "middle", className: "mb-3", children: /* @__PURE__ */ i(H, { xs: 24, md: 12, children: /* @__PURE__ */ d(Se, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
4244
4242
  /* @__PURE__ */ i(Ye, { children: "Do Not Disturb mode:" }),
4245
- /* @__PURE__ */ d(Ae, { size: 12, className: "w-full", children: [
4246
- /* @__PURE__ */ d(Ae, { direction: "horizontal", size: 8, className: "items-center", children: [
4243
+ /* @__PURE__ */ d(Se, { size: 12, className: "w-full", children: [
4244
+ /* @__PURE__ */ d(Se, { direction: "horizontal", size: 8, className: "items-center", children: [
4247
4245
  /* @__PURE__ */ i(Ye, { children: "From" }),
4248
- /* @__PURE__ */ i(Dt, { value: b, onChange: (C) => p(C), format: "HH:mm" })
4246
+ /* @__PURE__ */ i(Dt, { value: N, onChange: (T) => f(T), format: "HH:mm" })
4249
4247
  ] }),
4250
- /* @__PURE__ */ d(Ae, { direction: "horizontal", size: 8, className: "items-center", children: [
4248
+ /* @__PURE__ */ d(Se, { direction: "horizontal", size: 8, className: "items-center", children: [
4251
4249
  /* @__PURE__ */ i(Ye, { children: "To" }),
4252
- /* @__PURE__ */ i(Dt, { value: R, onChange: (C) => x(C), format: "HH:mm" })
4250
+ /* @__PURE__ */ i(Dt, { value: O, onChange: (T) => w(T), format: "HH:mm" })
4253
4251
  ] })
4254
4252
  ] })
4255
4253
  ] }) }) }),
4256
- /* @__PURE__ */ d(ge, { gutter: [24, 12], children: [
4257
- /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(Be, { checked: m.inApp, onChange: (C) => A({ ...m, inApp: C.target.checked }), children: "In-app" }) }),
4258
- /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(Be, { checked: m.sms, onChange: (C) => A({ ...m, sms: C.target.checked }), children: "SMS" }) }),
4259
- /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(Be, { checked: m.email, onChange: (C) => A({ ...m, email: C.target.checked }), children: "Email" }) })
4254
+ /* @__PURE__ */ d(ye, { gutter: [24, 12], children: [
4255
+ /* @__PURE__ */ i(H, { children: /* @__PURE__ */ i(je, { checked: p.inApp, onChange: (T) => S({ ...p, inApp: T.target.checked }), children: "In-app" }) }),
4256
+ /* @__PURE__ */ i(H, { children: /* @__PURE__ */ i(je, { checked: p.sms, onChange: (T) => S({ ...p, sms: T.target.checked }), children: "SMS" }) }),
4257
+ /* @__PURE__ */ i(H, { children: /* @__PURE__ */ i(je, { checked: p.email, onChange: (T) => S({ ...p, email: T.target.checked }), children: "Email" }) })
4260
4258
  ] })
4261
4259
  ] }),
4262
- /* @__PURE__ */ i(je, {}),
4263
- /* @__PURE__ */ d(Ae, { className: "gap-3", children: [
4264
- /* @__PURE__ */ i(ye, { onClick: r, disabled: z, children: "Cancel" }),
4265
- /* @__PURE__ */ i(ye, { type: "primary", onClick: W, loading: z, children: "Save" })
4260
+ /* @__PURE__ */ i(Qe, {}),
4261
+ /* @__PURE__ */ d(Se, { className: "gap-3", children: [
4262
+ /* @__PURE__ */ i(pe, { onClick: r, disabled: Y, children: "Cancel" }),
4263
+ /* @__PURE__ */ i(pe, { type: "primary", onClick: W, loading: Y, children: "Save" })
4266
4264
  ] })
4267
4265
  ] });
4268
4266
  }
4269
- function In({ severities: e, rules: t, userRoles: s, rawRules: r }) {
4267
+ function Cn({ severities: e, rules: t, userRoles: s, rawRules: r }) {
4270
4268
  const [n, a] = I("global");
4271
4269
  return /* @__PURE__ */ d("div", { className: "w-full", children: [
4272
4270
  /* @__PURE__ */ d("div", { className: "inline-flex rounded-xl overflow-hidden border border-gray-200 mb-4", children: [
@@ -4291,9 +4289,9 @@ function In({ severities: e, rules: t, userRoles: s, rawRules: r }) {
4291
4289
  n === "global" ? /* @__PURE__ */ i(wn, { severities: e, rules: t, userRoles: s, rawRules: r }) : /* @__PURE__ */ i(xn, { severities: e, rules: t })
4292
4290
  ] });
4293
4291
  }
4294
- const Cn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIZSURBVHgBnZW/b9NAFMe/z3H6i1ZNJUBFQsL/QQkLCFBtRhhKF1ibhBmpXbtgFlYqsTG0gRGWwgAjMb8EYmjYGN0pCCrVVaX+SBxf37PiqHWcOu5Xsux79+6j77vz3RH66IbdsDTQPCFngmBwqMCPBwVXoe204Fd/2ZfrSWMpHrDshtGCvsY9FlKkFNYD+Es/7EtuX+itp1sLnLrScTWoPMYsfnty/lUPtAOs4syiUgQOoWHJpG9kdBiX11Z+UaZCk1YT+vOzACuzYxgf7hZbyBGvhTi9af+7SkQbyKi7M8N4ZJ5D+eU2dg9UN07KvyNOS8io6UkNFXMMj1/vnACKAuTmNXZpIqME+LF+iIbX7ukjkClODWTQw+ujuGYMYfXzXnICbxSBDrxAUvYDhkrZp6ggUC8+sDI7mpj9YmESb3/uJ5Z9TJ5A3eORvzsBpgs6lufGT2TKPNY3fbxh6Knis0FTSjnx+LP3u5DJicDi/t7MCFadPaRJQTl02/5vKcKnpITluYkwrWjksebs48Pvg3SoUkXtq32hxt+1pITI8Zc/zcGACN59ty/WdWnklV5ukZ+49wU8MUJIF3mBGlqUr3Dv1+wpl20v9UuP75pElyrgc3XK7UJFbLvK4DJiv9ggDmWcjO9G4imWvW00yV/hjvtpOFnpQOVLkcO+0EhyevGrROG1ol1hREFc8ZGxyddIje+v9c4i9+gI5z7MozLxclgAAAAASUVORK5CYII=", Tn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKeSURBVHgBjVVdbtpAEJ5ZmygPfTBSaVWpUt0bwFuURgJOUG5QeoLACbw+QeAEwA3SGxgJokh9CDeI+xSpTRU/Imw8nbFZx6QQGAl5d2fm229+dkDYI2f6oaUAOwhWExBcPnL4FwFBSLCexpCMf+qPi12++PKgpR/cGOwRa1pwQIjgOoWkf6s/hOVzVd588R+/xWjf5YAY8Y0+ErQrZFfnXg3lK3uGm7A+RISOxfbit5NprqBxxgBoeEIVHehqtI9lSz+5McaaITaA2J17bycFaBayMOS8IaT+zHuv4Ui58P9oAvB4Ga0paUgqbFGswL5idIcIx3P9DCiXrQB7iJawcTiCkMMIUlj7Jo8zr6Yv/EfRXXIqRnzUxnP9u46Id8Q5Sslq3+pqWErHAPKqvxROC/ZMuJwKJ8bkPouUkrYUqgt5IgMDKAxfAYT8nAZnmR2A5J47YSjrFKyOYpZN2SiIJ8YjRqVfASyAFVg9s2F2gXwRsClMXdnYcFpq5PyiQ8KEilaywc79+aEow2i7fdCF46SIpuTvCGi2kWSXjCM4QqS4Zl3yjwQ0UySwrBfGRJNjQKW4ZrmEpL45CxUDTGWdgmoZgxOoDA6zxYgr7ZudhWk3x6Sp4kl0nZmgujQhcH5Cvqy/Hxi5hdL+dgsWxR2rma4FkLeDw+PMM243+t2YB0jDDI9nMBquyWqI3tjmLYguQfqDzxebty/DIcnePr9jfePVfDhSzv2/Hs8LAY3kMmFfTCl+rl3uu1GWF6Jx+X3vkpa+58jeeNyXvY3Pd8N+a0hvgK9ge3hMTmG5CPTnSICWcFpXaDfZUcAck99yOnZM/id3hcmAFV/hgEilU6p0TcH2gpZYS98xc/kXUJ8YImPFzfeLh0cgXbMp8n/yD3ySPZSK0MWKAAAAAElFTkSuQmCC";
4292
+ const In = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIZSURBVHgBnZW/b9NAFMe/z3H6i1ZNJUBFQsL/QQkLCFBtRhhKF1ibhBmpXbtgFlYqsTG0gRGWwgAjMb8EYmjYGN0pCCrVVaX+SBxf37PiqHWcOu5Xsux79+6j77vz3RH66IbdsDTQPCFngmBwqMCPBwVXoe204Fd/2ZfrSWMpHrDshtGCvsY9FlKkFNYD+Es/7EtuX+itp1sLnLrScTWoPMYsfnty/lUPtAOs4syiUgQOoWHJpG9kdBiX11Z+UaZCk1YT+vOzACuzYxgf7hZbyBGvhTi9af+7SkQbyKi7M8N4ZJ5D+eU2dg9UN07KvyNOS8io6UkNFXMMj1/vnACKAuTmNXZpIqME+LF+iIbX7ukjkClODWTQw+ujuGYMYfXzXnICbxSBDrxAUvYDhkrZp6ggUC8+sDI7mpj9YmESb3/uJ5Z9TJ5A3eORvzsBpgs6lufGT2TKPNY3fbxh6Knis0FTSjnx+LP3u5DJicDi/t7MCFadPaRJQTl02/5vKcKnpITluYkwrWjksebs48Pvg3SoUkXtq32hxt+1pITI8Zc/zcGACN59ty/WdWnklV5ukZ+49wU8MUJIF3mBGlqUr3Dv1+wpl20v9UuP75pElyrgc3XK7UJFbLvK4DJiv9ggDmWcjO9G4imWvW00yV/hjvtpOFnpQOVLkcO+0EhyevGrROG1ol1hREFc8ZGxyddIje+v9c4i9+gI5z7MozLxclgAAAAASUVORK5CYII=", Tn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKeSURBVHgBjVVdbtpAEJ5ZmygPfTBSaVWpUt0bwFuURgJOUG5QeoLACbw+QeAEwA3SGxgJokh9CDeI+xSpTRU/Imw8nbFZx6QQGAl5d2fm229+dkDYI2f6oaUAOwhWExBcPnL4FwFBSLCexpCMf+qPi12++PKgpR/cGOwRa1pwQIjgOoWkf6s/hOVzVd588R+/xWjf5YAY8Y0+ErQrZFfnXg3lK3uGm7A+RISOxfbit5NprqBxxgBoeEIVHehqtI9lSz+5McaaITaA2J17bycFaBayMOS8IaT+zHuv4Ui58P9oAvB4Ga0paUgqbFGswL5idIcIx3P9DCiXrQB7iJawcTiCkMMIUlj7Jo8zr6Yv/EfRXXIqRnzUxnP9u46Id8Q5Sslq3+pqWErHAPKqvxROC/ZMuJwKJ8bkPouUkrYUqgt5IgMDKAxfAYT8nAZnmR2A5J47YSjrFKyOYpZN2SiIJ8YjRqVfASyAFVg9s2F2gXwRsClMXdnYcFpq5PyiQ8KEilaywc79+aEow2i7fdCF46SIpuTvCGi2kWSXjCM4QqS4Zl3yjwQ0UySwrBfGRJNjQKW4ZrmEpL45CxUDTGWdgmoZgxOoDA6zxYgr7ZudhWk3x6Sp4kl0nZmgujQhcH5Cvqy/Hxi5hdL+dgsWxR2rma4FkLeDw+PMM243+t2YB0jDDI9nMBquyWqI3tjmLYguQfqDzxebty/DIcnePr9jfePVfDhSzv2/Hs8LAY3kMmFfTCl+rl3uu1GWF6Jx+X3vkpa+58jeeNyXvY3Pd8N+a0hvgK9ge3hMTmG5CPTnSICWcFpXaDfZUcAck99yOnZM/id3hcmAFV/hgEilU6p0TcH2gpZYS98xc/kXUJ8YImPFzfeLh0cgXbMp8n/yD3ySPZSK0MWKAAAAAElFTkSuQmCC";
4295
4293
  function Rn(e) {
4296
- const t = (e.status || "").toLowerCase() === "completed" ? /* @__PURE__ */ i("img", { src: Cn, alt: "completed", style: { width: 20, height: 20 } }) : /* @__PURE__ */ i("img", { src: Tn, alt: "pending", style: { width: 20, height: 20 } });
4294
+ const t = (e.status || "").toLowerCase() === "completed" ? /* @__PURE__ */ i("img", { src: In, alt: "completed", style: { width: 20, height: 20 } }) : /* @__PURE__ */ i("img", { src: Tn, alt: "pending", style: { width: 20, height: 20 } });
4297
4295
  return {
4298
4296
  title: /* @__PURE__ */ d("div", { className: "flex flex-col gap-0 min-w-0", children: [
4299
4297
  /* @__PURE__ */ d("div", { className: "flex flex-col", children: [
@@ -4308,7 +4306,7 @@ function Rn(e) {
4308
4306
  }
4309
4307
  function kn({ data: e }) {
4310
4308
  return /* @__PURE__ */ i("div", { className: "w-full", children: /* @__PURE__ */ i(
4311
- bt,
4309
+ vt,
4312
4310
  {
4313
4311
  type: "card",
4314
4312
  items: [
@@ -4316,7 +4314,7 @@ function kn({ data: e }) {
4316
4314
  key: "action",
4317
4315
  label: "Action Taken",
4318
4316
  children: /* @__PURE__ */ d("div", { className: "w-full", children: [
4319
- /* @__PURE__ */ i(at, { className: "mb-4 rounded-md", bordered: !0, children: /* @__PURE__ */ d("div", { className: "grid grid-cols-4 gap-6 text-xs", children: [
4317
+ /* @__PURE__ */ i(it, { className: "mb-4 rounded-md p-4", bordered: !0, children: /* @__PURE__ */ d("div", { className: "grid grid-cols-4 gap-6 text-xs", children: [
4320
4318
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
4321
4319
  /* @__PURE__ */ i("span", { className: "text-gray-500", children: "Alert ID" }),
4322
4320
  /* @__PURE__ */ i("span", { className: "text-black", children: e.summary.alertNumber })
@@ -4334,7 +4332,7 @@ function kn({ data: e }) {
4334
4332
  /* @__PURE__ */ i("span", { className: "text-black", children: e.summary.location })
4335
4333
  ] })
4336
4334
  ] }) }),
4337
- /* @__PURE__ */ d(at, { className: "rounded-md", bordered: !0, children: [
4335
+ /* @__PURE__ */ d(it, { className: "rounded-md p-4", bordered: !0, children: [
4338
4336
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ i("h4", { className: "text-sm text-black font-medium", children: "Response Timeline/ Audit trail/log" }) }),
4339
4337
  /* @__PURE__ */ i("div", { className: "mt-2", children: /* @__PURE__ */ i(
4340
4338
  Ps,
@@ -4352,7 +4350,7 @@ function kn({ data: e }) {
4352
4350
  key: "notification",
4353
4351
  label: "Notification Sent",
4354
4352
  children: /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-4", children: [
4355
- (e.notifications || []).map((t, s) => /* @__PURE__ */ d(at, { className: "rounded-md p-4", bordered: !0, children: [
4353
+ (e.notifications || []).map((t, s) => /* @__PURE__ */ d(it, { className: "rounded-md p-4", bordered: !0, children: [
4356
4354
  /* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
4357
4355
  /* @__PURE__ */ d("div", { className: "flex flex-col", children: [
4358
4356
  /* @__PURE__ */ i("h4", { className: "text-sm text-black font-medium", children: t.channelLabel }),
@@ -4416,140 +4414,170 @@ function kn({ data: e }) {
4416
4414
  }
4417
4415
  ) });
4418
4416
  }
4419
- function On(e) {
4417
+ const On = ({
4418
+ alertId: e,
4419
+ id: t,
4420
+ priority: s,
4421
+ spaceName: r,
4422
+ alertNumber: n,
4423
+ statusHistory: a,
4424
+ notifGroups: o
4425
+ }) => {
4426
+ const l = {
4427
+ alertId: e ?? String(t ?? ""),
4428
+ incidentId: "-",
4429
+ severity: s || "",
4430
+ location: r || "",
4431
+ alertNumber: n ?? ""
4432
+ }, h = a?.length ? a.map((c) => {
4433
+ const N = (c?.status || c?.eventStatus || "").toLowerCase() === "completed" ? "Completed" : "Inprogress", f = c?.createdDate ? pt(c.createdDate) : c?.timestamp ? pt(c.timestamp) : "";
4434
+ return {
4435
+ status: N,
4436
+ title: c?.status || c?.eventStatus || "Status Update",
4437
+ description: c?.description || c?.actionNotes || "",
4438
+ timestamp: f
4439
+ };
4440
+ }) : [];
4441
+ return /* @__PURE__ */ i(kn, { data: {
4442
+ summary: l,
4443
+ timeline: h,
4444
+ notifications: o ?? []
4445
+ } });
4446
+ };
4447
+ function Pn(e) {
4420
4448
  if (!e || typeof e != "string") return !1;
4421
4449
  const t = e.split("?")[0].toLowerCase();
4422
4450
  return t.endsWith(".mp4") || t.endsWith(".webm") || t.endsWith(".ogg") || t.endsWith(".m3u8");
4423
4451
  }
4424
- function Pn(e) {
4452
+ function En(e) {
4425
4453
  const t = (e?.mediaType || e?.type || "").toString().toLowerCase();
4426
- return t === "video" || t === "mp4" ? !0 : On(e?.mediaUrl || e);
4454
+ return t === "video" || t === "mp4" ? !0 : Pn(e?.mediaUrl || e);
4427
4455
  }
4428
- function ct(e) {
4456
+ function ot(e) {
4429
4457
  const t = e;
4430
4458
  return t ? Array.isArray(t) ? t : [t] : [];
4431
4459
  }
4432
- const En = {
4460
+ const Dn = {
4433
4461
  Critical: "#FF3B30",
4434
4462
  High: "#FFB86A",
4435
4463
  Medium: "#FFCC00",
4436
4464
  Low: "#007AFF"
4437
- }, Dn = {
4465
+ }, Fn = {
4438
4466
  Critical: "#FFE2E2",
4439
4467
  High: "#FF95004D",
4440
4468
  Medium: "#FEF9C2",
4441
4469
  Low: "#E0EDFF"
4442
4470
  }, Mn = ({ isModalOpen: e, handleModalClose: t, selectedRow: s, fetchAlertLogs: r, alertStatusList: n = [], alertStatusLoading: a = !1, initialTab: o = "details" }) => {
4443
- const [l, h] = I(), [u, f] = I(""), [b, p] = I(!1), R = Cs(null), [x, m] = I("details"), [A, L] = I(void 0), [$, B] = I(!1), F = ys(), { alerts: z, config: V } = Ne(), H = V?.tenant === "schools", W = s?.originalData || {}, {
4444
- eventName: C,
4445
- alertId: N,
4446
- timestamp: T,
4447
- description: te,
4448
- spaceName: ne,
4449
- assignTeam: O,
4471
+ const [l, h] = I(), [u, c] = I(""), [N, f] = I(!1), O = Is(null), [w, p] = I("details"), [S, $] = I(void 0), [L, B] = I(!1), U = ys(), { alerts: Y, config: J } = Ae(), G = J?.tenant === "schools", W = s?.originalData || {}, {
4472
+ eventName: T,
4473
+ alertId: x,
4474
+ timestamp: R,
4475
+ description: se,
4476
+ spaceName: te,
4477
+ assignTeam: k,
4450
4478
  priority: g,
4451
- statusType: y,
4452
- id: S,
4453
- alertDetails: c,
4479
+ statusType: m,
4480
+ id: A,
4481
+ alertDetails: y,
4454
4482
  statusHistory: v,
4455
- mediaDetails: w,
4456
- alertNumber: E
4457
- } = W, k = !H && typeof W?.anomalyName == "string" && String(W?.anomalyName || "").toLowerCase().includes("elopement");
4458
- fe(() => {
4459
- const M = S;
4460
- if (x !== "track" || !M) return;
4461
- let K = !1;
4462
- return (async () => {
4463
- try {
4464
- const ee = await z.getAlertNotifications(M);
4465
- if (K) return;
4466
- const Y = /* @__PURE__ */ new Map();
4467
- (ee || []).forEach((re) => {
4468
- const me = String(re?.notificationType || "Unknown"), de = Y.get(me) || [];
4469
- de.push(re), Y.set(me, de);
4470
- });
4471
- const se = Array.from(Y.entries()).map(([re, me]) => {
4472
- const de = me.map((le) => {
4473
- const Fe = String(le?.messageStatus || "").toLowerCase(), _e = Fe === "delivered" ? "Delivered" : Fe === "failed" ? "Failed" : "Queued";
4474
- return {
4475
- name: le?.receipientName || le?.recipientName || "-",
4476
- role: le?.receipientRoleName || "",
4477
- phone: le?.receipentPhoneNumber || le?.recipientPhoneNumber || le?.receipientEmail || le?.recipientEmail || "",
4478
- status: _e
4479
- };
4480
- }), tt = de.filter((le) => le.status === "Delivered").length, $e = me.map((le) => le?.sentAt).filter(Boolean).sort((le, Fe) => new Date(Fe).getTime() - new Date(le).getTime())[0], Me = me[0] || {}, st = [Me?.severityName, Me?.anomalyName].filter(Boolean).join(" - ") || `${re} Notification`;
4481
- return {
4482
- channelLabel: `${re} Notification`,
4483
- sentAt: $e || "",
4484
- messageTitle: st,
4485
- messageBody: "",
4486
- total: de.length,
4487
- delivered: tt,
4488
- recipients: de
4489
- };
4490
- });
4491
- L(se);
4492
- } catch {
4493
- L(void 0);
4494
- }
4495
- })(), () => {
4496
- K = !0;
4483
+ mediaDetails: b,
4484
+ alertNumber: P
4485
+ } = W, M = !G && typeof W?.anomalyName == "string" && String(W?.anomalyName || "").toLowerCase().includes("elopement"), D = (C) => {
4486
+ const _ = String(C || "").toLowerCase();
4487
+ return _ === "delivered" ? "Delivered" : _ === "failed" ? "Failed" : "Queued";
4488
+ }, j = (C) => ({
4489
+ name: C?.receipientName || C?.recipientName || "-",
4490
+ role: C?.receipientRoleName || "",
4491
+ phone: C?.receipentPhoneNumber || C?.recipientPhoneNumber || C?.receipientEmail || C?.recipientEmail || "",
4492
+ status: D(C?.messageStatus)
4493
+ }), Q = (C, _) => {
4494
+ const V = _.map(j), Te = V.filter((ke) => ke.status === "Delivered").length, Re = _.map((ke) => ke?.sentAt).filter(Boolean).sort((ke, st) => new Date(st).getTime() - new Date(ke).getTime())[0], Le = _[0] || {}, tt = [Le?.severityName, Le?.anomalyName].filter(Boolean).join(" - ") || `${C} Notification`;
4495
+ return {
4496
+ channelLabel: `${C} Notification`,
4497
+ sentAt: Re || "",
4498
+ messageTitle: tt,
4499
+ messageBody: "",
4500
+ total: V.length,
4501
+ delivered: Te,
4502
+ recipients: V
4497
4503
  };
4498
- }, [x, S]), fe(() => {
4499
- e && m(o);
4504
+ }, z = (C) => {
4505
+ const _ = /* @__PURE__ */ new Map();
4506
+ return (C || []).forEach((V) => {
4507
+ const Te = String(V?.notificationType || "Unknown"), Re = _.get(Te) || [];
4508
+ Re.push(V), _.set(Te, Re);
4509
+ }), Array.from(_.entries()).map(([V, Te]) => Q(V, Te));
4510
+ }, ie = async (C) => {
4511
+ try {
4512
+ const _ = await Y.getAlertNotifications(C), V = z(_);
4513
+ $(V);
4514
+ } catch {
4515
+ $(void 0);
4516
+ }
4517
+ };
4518
+ he(() => {
4519
+ if (w !== "track" || !A) return;
4520
+ let C = !1;
4521
+ return ie(A).then(() => {
4522
+ C && $(void 0);
4523
+ }), () => {
4524
+ C = !0;
4525
+ };
4526
+ }, [w, A]), he(() => {
4527
+ e && p(o);
4500
4528
  }, [e, o]);
4501
- const U = (n || []).map((M) => ({
4502
- value: M.value,
4503
- label: M.statusName
4504
- })), Q = async () => {
4529
+ const fe = (n || []).map((C) => ({
4530
+ value: C.value,
4531
+ label: C.statusName
4532
+ })), le = async () => {
4505
4533
  try {
4506
- p(!0);
4507
- const M = {
4508
- alertUniqueId: N,
4509
- alertId: S,
4510
- status: l !== void 0 ? String(l) : void 0,
4534
+ f(!0);
4535
+ const C = {
4536
+ alertUniqueId: x,
4537
+ alertId: A,
4538
+ status: l ? String(l) : void 0,
4511
4539
  notes: u.trim(),
4512
4540
  modifiedBy: 0
4513
- }, K = await F.mutateAsync(M);
4514
- if (K?.responseStatus) {
4515
- const ee = K?.data || "Alert updated successfully.";
4516
- ie.success(ee, {
4541
+ }, _ = await U.mutateAsync(C);
4542
+ if (_?.responseStatus) {
4543
+ const V = _?.data || "Alert updated successfully.";
4544
+ ne.success(V, {
4517
4545
  autoClose: 1500,
4518
4546
  onClose: () => {
4519
4547
  r(), t();
4520
4548
  }
4521
- }), h(void 0), f("");
4549
+ }), h(void 0), c("");
4522
4550
  } else {
4523
- const ee = K?.errorMessage || "Failed to update alert status";
4524
- ie.error(ee);
4551
+ const V = _?.errorMessage || "Failed to update alert status";
4552
+ ne.error(V);
4525
4553
  }
4526
- } catch (M) {
4527
- console.error("Error updating alert status:", M), ie.error("Failed to update alert status. Please try again.");
4554
+ } catch (C) {
4555
+ console.error("Error updating alert status:", C), ne.error("Failed to update alert status. Please try again.");
4528
4556
  } finally {
4529
- p(!1);
4557
+ f(!1);
4530
4558
  }
4531
- }, j = async () => {
4559
+ }, re = async () => {
4532
4560
  try {
4533
- if (!S) {
4534
- ie.error("Alert ID is missing.");
4561
+ if (!A) {
4562
+ ne.error("Alert ID is missing.");
4535
4563
  return;
4536
4564
  }
4537
4565
  B(!0);
4538
- const M = S;
4539
- if (!z.notifyFamilyMembers) {
4540
- ie.error("Notify Family is not supported.");
4566
+ const C = A;
4567
+ if (!Y.notifyFamilyMembers) {
4568
+ ne.error("Notify Family is not supported.");
4541
4569
  return;
4542
4570
  }
4543
- const K = await z.notifyFamilyMembers(M);
4544
- if (K?.responseStatus) {
4545
- const ee = K?.data || "Alert Notifications sent to Family Members.";
4546
- ie.success(ee);
4571
+ const _ = await Y.notifyFamilyMembers(C);
4572
+ if (_?.responseStatus) {
4573
+ const V = _?.data || "Alert Notifications sent to Family Members.";
4574
+ ne.success(V);
4547
4575
  } else {
4548
- const ee = K?.errorMessage || "Failed to send notifications.";
4549
- ie.error(ee);
4576
+ const V = _?.errorMessage || "Failed to send notifications.";
4577
+ ne.error(V);
4550
4578
  }
4551
- } catch (M) {
4552
- console.error("Error notifying family members:", M), ie.error("Failed to send notifications. Please try again.");
4579
+ } catch (C) {
4580
+ console.error("Error notifying family members:", C), ne.error("Failed to send notifications. Please try again.");
4553
4581
  } finally {
4554
4582
  B(!1);
4555
4583
  }
@@ -4560,54 +4588,60 @@ const En = {
4560
4588
  open: e,
4561
4589
  onCancel: t,
4562
4590
  width: 1e3,
4563
- footer: x === "details" ? /* @__PURE__ */ d("div", { className: "flex flex-row gap-2 justify-start", children: [
4564
- /* @__PURE__ */ i(ye, { onClick: t, className: "bg-[#6C757D] text-white", children: "Cancel" }),
4591
+ styles: {
4592
+ body: {
4593
+ maxHeight: "70vh",
4594
+ overflowY: "auto"
4595
+ }
4596
+ },
4597
+ footer: w === "details" ? /* @__PURE__ */ d("div", { className: "flex flex-row gap-2 justify-start", children: [
4598
+ /* @__PURE__ */ i(pe, { onClick: t, className: "bg-[#6C757D] text-white", children: "Cancel" }),
4565
4599
  /* @__PURE__ */ i(
4566
- ye,
4600
+ pe,
4567
4601
  {
4568
4602
  type: "primary",
4569
- onClick: Q,
4570
- loading: b,
4571
- children: b ? "Saving..." : "Save Changes"
4603
+ onClick: le,
4604
+ loading: N,
4605
+ children: N ? "Saving..." : "Save Changes"
4572
4606
  }
4573
4607
  )
4574
4608
  ] }) : null,
4575
4609
  children: s && /* @__PURE__ */ i(
4576
- bt,
4610
+ vt,
4577
4611
  {
4578
- activeKey: x,
4579
- onChange: (M) => m(M),
4612
+ activeKey: w,
4613
+ onChange: (C) => p(C),
4580
4614
  items: [
4581
4615
  {
4582
4616
  key: "details",
4583
4617
  label: "Alert Detail",
4584
4618
  children: /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2", children: [
4585
4619
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-2", children: [
4586
- /* @__PURE__ */ i("div", { className: "text-sm font-bold", children: C || "Alert Event" }),
4587
- c?.firstName ? /* @__PURE__ */ d("div", { className: "text-sm text-gray-500", children: [
4620
+ /* @__PURE__ */ i("div", { className: "text-sm font-bold", children: T || "Alert Event" }),
4621
+ y?.firstName ? /* @__PURE__ */ d("div", { className: "text-sm text-gray-500", children: [
4588
4622
  "Resident ID/Name: ",
4589
- c?.firstName,
4623
+ y?.firstName,
4590
4624
  " ",
4591
- c?.lastName || "",
4625
+ y?.lastName || "",
4592
4626
  "   ",
4593
- c?.residentId || ""
4627
+ y?.residentId || ""
4594
4628
  ] }) : null,
4595
4629
  /* @__PURE__ */ d("div", { className: "text-sm text-gray-500", children: [
4596
4630
  "Timestamp: ",
4597
- lt(T)
4631
+ pt(R)
4598
4632
  ] }),
4599
4633
  /* @__PURE__ */ d("div", { className: "font-sm text-gray-500", children: [
4600
4634
  /* @__PURE__ */ i("b", { className: "text-black text-sm/6", children: "Description:" }),
4601
4635
  " ",
4602
- te || "No description available"
4636
+ se || "No description available"
4603
4637
  ] }),
4604
- ne && /* @__PURE__ */ d("div", { className: "font-sm text-gray-500", children: [
4638
+ te && /* @__PURE__ */ d("div", { className: "font-sm text-gray-500", children: [
4605
4639
  "Space: ",
4606
- ne
4640
+ te
4607
4641
  ] }),
4608
- O && /* @__PURE__ */ d("div", { className: "font-sm text-gray-500", children: [
4642
+ k && /* @__PURE__ */ d("div", { className: "font-sm text-gray-500", children: [
4609
4643
  "Assigned to: ",
4610
- O
4644
+ k
4611
4645
  ] }),
4612
4646
  /* @__PURE__ */ d("div", { className: "flex gap-2 justify-start mt-3", children: [
4613
4647
  /* @__PURE__ */ d(
@@ -4615,8 +4649,8 @@ const En = {
4615
4649
  {
4616
4650
  className: "font-sm text-gray-500 rounded-[8px] py-2 px-3",
4617
4651
  style: {
4618
- border: `2px solid ${En[String(g)] || "#DFE4EA"}`,
4619
- backgroundColor: Dn[String(g)]
4652
+ border: `2px solid ${Dn[String(g)] || "#DFE4EA"}`,
4653
+ backgroundColor: Fn[String(g)]
4620
4654
  },
4621
4655
  children: [
4622
4656
  "Severity: ",
@@ -4628,28 +4662,28 @@ const En = {
4628
4662
  Ve,
4629
4663
  {
4630
4664
  className: "font-sm text-gray-500 rounded-[8px] py-2 px-3",
4631
- style: String(y || "").toLowerCase() === "completed" ? { background: "#E7F6EC", border: "0.68px solid var(--Green, #34C759)" } : { background: "#E0EDFF", border: "1px solid var(--Grays-Gray-4, #D1D1D6)" },
4665
+ style: String(m || "").toLowerCase() === "completed" ? { background: "#E7F6EC", border: "0.68px solid var(--Green, #34C759)" } : { background: "#E0EDFF", border: "1px solid var(--Grays-Gray-4, #D1D1D6)" },
4632
4666
  children: [
4633
4667
  "Status: ",
4634
- y || "N/A"
4668
+ m || "N/A"
4635
4669
  ]
4636
4670
  }
4637
4671
  )
4638
4672
  ] }),
4639
4673
  /* @__PURE__ */ i("div", { className: "w-full flex flex-col justify-start items-start mt-2 font-bold", children: /* @__PURE__ */ d("div", { className: "w-full mt-4", children: [
4640
4674
  /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ i(
4641
- pe,
4675
+ me,
4642
4676
  {
4643
4677
  placeholder: "Change Status",
4644
4678
  className: "w-full text-gray-500",
4645
- onChange: (M) => h(M),
4679
+ onChange: (C) => h(C),
4646
4680
  value: l,
4647
- options: U,
4681
+ options: fe,
4648
4682
  loading: a
4649
4683
  }
4650
4684
  ) }),
4651
4685
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-2 mt-3", children: [
4652
- /* @__PURE__ */ i("label", { className: "text-xs text-gray-500 font-medium", children: "Action Taken (Comments)" }),
4686
+ /* @__PURE__ */ i("label", { htmlFor: "action-details-input", className: "text-xs text-gray-500 font-medium", children: "Action Taken (Comments)" }),
4653
4687
  /* @__PURE__ */ i(
4654
4688
  "textarea",
4655
4689
  {
@@ -4657,18 +4691,18 @@ const En = {
4657
4691
  placeholder: "Enter details...",
4658
4692
  className: "w-full text-gray-500 h-20 border border-grey-500 rounded-md p-2",
4659
4693
  value: u,
4660
- onChange: (M) => f(M.target.value)
4694
+ onChange: (C) => c(C.target.value)
4661
4695
  }
4662
4696
  )
4663
4697
  ] }),
4664
- k && /* @__PURE__ */ d("div", { className: "border border-[#DFE4EA] rounded-md px-4 py-2 flex flex-row justify-between items-center mt-4 mb-8", children: [
4665
- /* @__PURE__ */ i("label", { className: "text-xs font-medium", children: "Alert notification will be sent to all Family Members." }),
4698
+ M && /* @__PURE__ */ d("div", { className: "border border-[#DFE4EA] rounded-md px-4 py-2 flex flex-row justify-between items-center mt-4 mb-8", children: [
4699
+ /* @__PURE__ */ i("label", { htmlFor: "notify-family-button", className: "text-xs font-medium", children: "Alert notification will be sent to all Family Members." }),
4666
4700
  /* @__PURE__ */ i(
4667
- ye,
4701
+ pe,
4668
4702
  {
4669
- loading: $,
4670
- onClick: j,
4671
- disabled: $,
4703
+ loading: L,
4704
+ onClick: re,
4705
+ disabled: L,
4672
4706
  className: "bg-black text-white rounded-md px-4 py-2 text-xs disabled:opacity-60 disabled:cursor-not-allowed",
4673
4707
  children: "Notify Family"
4674
4708
  }
@@ -4679,12 +4713,12 @@ const En = {
4679
4713
  /* @__PURE__ */ i("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ d("div", { className: "w-full mt-1", children: [
4680
4714
  /* @__PURE__ */ d("div", { className: "w-full flex items-center justify-between", children: [
4681
4715
  /* @__PURE__ */ i("h3", { className: "text-black font-bold text-sm", children: "Camera Footage" }),
4682
- ct(w).length ? /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
4716
+ ot(b).length ? /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
4683
4717
  /* @__PURE__ */ i(
4684
4718
  "button",
4685
4719
  {
4686
4720
  type: "button",
4687
- onClick: () => R.current?.prev?.(),
4721
+ onClick: () => O.current?.prev?.(),
4688
4722
  className: "w-6 h-6 flex items-center justify-center rounded-full bg-gray-200 hover:bg-gray-300 text-gray-600",
4689
4723
  "aria-label": "Previous media",
4690
4724
  children: /* @__PURE__ */ i($s, { style: { fontSize: 12 } })
@@ -4694,7 +4728,7 @@ const En = {
4694
4728
  "button",
4695
4729
  {
4696
4730
  type: "button",
4697
- onClick: () => R.current?.next?.(),
4731
+ onClick: () => O.current?.next?.(),
4698
4732
  className: "w-6 h-6 flex items-center justify-center rounded-full bg-gray-200 hover:bg-gray-300 text-gray-600",
4699
4733
  "aria-label": "Next media",
4700
4734
  children: /* @__PURE__ */ i(Bs, { style: { fontSize: 12 } })
@@ -4702,8 +4736,8 @@ const En = {
4702
4736
  )
4703
4737
  ] }) : null
4704
4738
  ] }),
4705
- ct(w).length ? /* @__PURE__ */ i("div", { className: "w-full", children: /* @__PURE__ */ i(Ds, { ref: R, dots: !0, className: "w-full", children: ct(w).map((M, K) => /* @__PURE__ */ d("div", { className: "flex justify-center items-center", children: [
4706
- Pn(M) ? /* @__PURE__ */ d(
4739
+ ot(b).length ? /* @__PURE__ */ i("div", { className: "w-full", children: /* @__PURE__ */ i(Ds, { ref: O, dots: !0, className: "w-full", children: ot(b).map((C, _) => /* @__PURE__ */ d("div", { className: "flex justify-center items-center", children: [
4740
+ En(C) ? /* @__PURE__ */ d(
4707
4741
  "video",
4708
4742
  {
4709
4743
  width: "240",
@@ -4711,45 +4745,38 @@ const En = {
4711
4745
  controls: !0,
4712
4746
  className: "max-w-full max-h-[90vh] object-contain rounded-lg shadow-lg",
4713
4747
  children: [
4714
- /* @__PURE__ */ i("source", { src: M.mediaUrl || M }),
4748
+ /* @__PURE__ */ i("source", { src: C.mediaUrl || C }),
4715
4749
  "Your browser does not support the video tag."
4716
4750
  ]
4717
4751
  }
4718
4752
  ) : /* @__PURE__ */ i(
4719
4753
  "img",
4720
4754
  {
4721
- src: M.mediaUrl || M,
4722
- alt: M.caption || `media-${K}`,
4755
+ src: C.mediaUrl || C,
4756
+ alt: C.caption || `media-${_}`,
4723
4757
  className: "max-w-full max-h-[90vh] object-contain rounded-lg shadow-lg"
4724
4758
  }
4725
4759
  ),
4726
- M.caption && /* @__PURE__ */ i("p", { className: "text-xs text-gray-500 mt-1", children: M.caption })
4727
- ] }, K)) }) }) : null
4760
+ C.caption && /* @__PURE__ */ i("p", { className: "text-xs text-gray-500 mt-1", children: C.caption })
4761
+ ] }, _)) }) }) : null
4728
4762
  ] }) })
4729
4763
  ] })
4730
4764
  },
4731
4765
  {
4732
4766
  key: "track",
4733
4767
  label: "Track Incident",
4734
- children: (() => {
4735
- const M = {
4736
- alertId: N ?? S ?? "",
4737
- incidentId: "-",
4738
- severity: g || "",
4739
- location: ne || "",
4740
- alertNumber: E ?? ""
4741
- }, K = v && v.length ? v.map((Y) => ({
4742
- status: (Y?.status || Y?.eventStatus || "").toLowerCase() === "completed" ? "Completed" : "Inprogress",
4743
- title: Y?.status || Y?.eventStatus || "Status Update",
4744
- description: Y?.description || Y?.actionNotes || "",
4745
- timestamp: Y?.createdDate ? `${lt(Y?.createdDate)}` : Y?.timestamp ? `${lt(Y?.timestamp)}` : ""
4746
- })) : [];
4747
- return /* @__PURE__ */ i(kn, { data: {
4748
- summary: M,
4749
- timeline: K,
4750
- notifications: A ?? []
4751
- } });
4752
- })()
4768
+ children: /* @__PURE__ */ i(
4769
+ On,
4770
+ {
4771
+ alertId: x,
4772
+ id: A,
4773
+ priority: g,
4774
+ spaceName: te,
4775
+ alertNumber: P,
4776
+ statusHistory: v,
4777
+ notifGroups: S
4778
+ }
4779
+ )
4753
4780
  }
4754
4781
  ]
4755
4782
  }
@@ -4757,8 +4784,8 @@ const En = {
4757
4784
  }
4758
4785
  );
4759
4786
  };
4760
- function Fn() {
4761
- const { alerts: e } = Ne(), t = Tt({
4787
+ function Un() {
4788
+ const { alerts: e } = Ae(), t = It({
4762
4789
  queryKey: ["alerts", "statusList"],
4763
4790
  queryFn: () => e.getAlertStatusList(),
4764
4791
  staleTime: 5 * 6e4
@@ -4771,14 +4798,14 @@ function Fn() {
4771
4798
  };
4772
4799
  }
4773
4800
  function gs({ alerts: e, loading: t = !1, columns: s, onRefetch: r }) {
4774
- const [n, a] = I(!1), [o, l] = I(null), [h, u] = I("details"), { list: f, loading: b } = Fn();
4775
- function p(m, A) {
4776
- l(m), u(A?.tab ?? "details"), a(!0);
4801
+ const [n, a] = I(!1), [o, l] = I(null), [h, u] = I("details"), { list: c, loading: N } = Un();
4802
+ function f(p, S) {
4803
+ l(p), u(S?.tab ?? "details"), a(!0);
4777
4804
  }
4778
- function R() {
4805
+ function O() {
4779
4806
  a(!1);
4780
4807
  }
4781
- const x = o ? {
4808
+ const w = o ? {
4782
4809
  originalData: {
4783
4810
  // include the full selected alert so alll modal fieldsare present
4784
4811
  ...o,
@@ -4793,29 +4820,29 @@ function gs({ alerts: e, loading: t = !1, columns: s, onRefetch: r }) {
4793
4820
  /* @__PURE__ */ i(fn, { label: "USA", timeZone: "America/New_York" })
4794
4821
  ] }),
4795
4822
  /* @__PURE__ */ i(
4796
- bt,
4823
+ vt,
4797
4824
  {
4798
4825
  defaultActiveKey: "active",
4799
4826
  className: "w-full",
4800
4827
  tabBarStyle: { fontSize: "medium" },
4801
- onChange: (m) => {
4802
- m === "active" && r?.();
4828
+ onChange: (p) => {
4829
+ p === "active" && r?.();
4803
4830
  },
4804
4831
  items: [
4805
4832
  {
4806
4833
  key: "active",
4807
4834
  label: "Active",
4808
- children: /* @__PURE__ */ i(as, { data: e, loading: t, pageSize: 10, columns: s || [], onAlertIdClick: p, onRefetch: r })
4835
+ children: /* @__PURE__ */ i(as, { data: e, loading: t, pageSize: 10, columns: s || [], onAlertIdClick: f, onRefetch: r })
4809
4836
  },
4810
4837
  {
4811
4838
  key: "archived",
4812
4839
  label: "Archived",
4813
- children: /* @__PURE__ */ i(dn, { alerts: e, loading: t, columns: s || [], onAlertIdClick: p })
4840
+ children: /* @__PURE__ */ i(dn, { alerts: e, loading: t, columns: s || [], onAlertIdClick: f })
4814
4841
  },
4815
4842
  {
4816
4843
  key: "settings",
4817
4844
  label: "Settings",
4818
- children: /* @__PURE__ */ i(Un, {})
4845
+ children: /* @__PURE__ */ i(Ln, {})
4819
4846
  }
4820
4847
  // {
4821
4848
  // key: "reports",
@@ -4829,60 +4856,60 @@ function gs({ alerts: e, loading: t = !1, columns: s, onRefetch: r }) {
4829
4856
  Mn,
4830
4857
  {
4831
4858
  isModalOpen: n,
4832
- handleModalClose: R,
4833
- selectedRow: x,
4859
+ handleModalClose: O,
4860
+ selectedRow: w,
4834
4861
  fetchAlertLogs: () => {
4835
4862
  },
4836
- alertStatusList: f,
4837
- alertStatusLoading: b,
4863
+ alertStatusList: c,
4864
+ alertStatusLoading: N,
4838
4865
  initialTab: h
4839
4866
  }
4840
4867
  )
4841
4868
  ] });
4842
4869
  }
4843
- function Un() {
4844
- const [e, t] = I([]), [s, r] = I([]), [n, a] = I([]), { rules: o } = Ne();
4845
- return fe(() => {
4870
+ function Ln() {
4871
+ const [e, t] = I([]), [s, r] = I([]), [n, a] = I([]), { rules: o } = Ae();
4872
+ return he(() => {
4846
4873
  let l = !0;
4847
4874
  return (async () => {
4848
4875
  try {
4849
4876
  const h = await o.getRules();
4850
4877
  if (!l) return;
4851
4878
  a(Array.isArray(h) ? h : []);
4852
- const u = (h || []).map((f, b) => ({
4853
- RuleId: f.ruleId || f.ruleName || String(b),
4854
- Name: f.ruleName || f.Name || "-",
4855
- Description: f.ruleDesc || f.Description || "",
4879
+ const u = (h || []).map((c, N) => ({
4880
+ RuleId: c.ruleId || c.ruleName || String(N),
4881
+ Name: c.ruleName || c.Name || "-",
4882
+ Description: c.ruleDesc || c.Description || "",
4856
4883
  SeverityId: 0
4857
4884
  }));
4858
- t(u.length ? u : Ue.rules);
4885
+ t(u.length ? u : $e.rules);
4859
4886
  try {
4860
- const f = await o.getLookups(), b = Array.isArray(f?.userRoles) ? f.userRoles.map((p) => ({
4861
- userRoleId: p.userRoleId ?? p.id,
4862
- userRoleName: p.userRoleName ?? p.name
4887
+ const c = await o.getLookups(), N = Array.isArray(c?.userRoles) ? c.userRoles.map((f) => ({
4888
+ userRoleId: f.userRoleId ?? f.id,
4889
+ userRoleName: f.userRoleName ?? f.name
4863
4890
  })) : [];
4864
- r(b.length ? b : Ue.userRoles);
4891
+ r(N.length ? N : $e.userRoles);
4865
4892
  } catch {
4866
- r(Ue.userRoles);
4893
+ r($e.userRoles);
4867
4894
  }
4868
4895
  } catch {
4869
- t(Ue.rules), r(Ue.userRoles);
4896
+ t($e.rules), r($e.userRoles);
4870
4897
  }
4871
4898
  })(), () => {
4872
4899
  l = !1;
4873
4900
  };
4874
4901
  }, []), /* @__PURE__ */ i(
4875
- In,
4902
+ Cn,
4876
4903
  {
4877
- severities: Ue.severities,
4904
+ severities: $e.severities,
4878
4905
  rules: e,
4879
4906
  userRoles: s,
4880
4907
  rawRules: n
4881
4908
  }
4882
4909
  );
4883
4910
  }
4884
- function Ln() {
4885
- const { alerts: e } = Ne(), t = Tt({
4911
+ function $n() {
4912
+ const { alerts: e } = Ae(), t = It({
4886
4913
  queryKey: ["alerts", "list"],
4887
4914
  queryFn: () => e.listAlerts(),
4888
4915
  staleTime: 3e4
@@ -4894,11 +4921,11 @@ function Ln() {
4894
4921
  refetch: t.refetch
4895
4922
  };
4896
4923
  }
4897
- function $n(e) {
4898
- const { alerts: t, loading: s, refetch: r } = Ln();
4924
+ function Bn(e) {
4925
+ const { alerts: t, loading: s, refetch: r } = $n();
4899
4926
  return /* @__PURE__ */ i(gs, { alerts: t, loading: s, columns: e.columns, onRefetch: r });
4900
4927
  }
4901
- function Yn({
4928
+ function zn({
4902
4929
  tenant: e,
4903
4930
  apiDomain: t,
4904
4931
  rulesDomain: s,
@@ -4915,10 +4942,10 @@ function Yn({
4915
4942
  }),
4916
4943
  [t, s, r]
4917
4944
  );
4918
- return /* @__PURE__ */ i(Wr, { client: l, children: /* @__PURE__ */ i(lr, { tenant: e, override: h, children: Array.isArray(n) ? /* @__PURE__ */ i(gs, { alerts: n, loading: !!a, columns: o }) : /* @__PURE__ */ i($n, { columns: o }) }) });
4945
+ return /* @__PURE__ */ i(Wr, { client: l, children: /* @__PURE__ */ i(lr, { tenant: e, override: h, children: Array.isArray(n) ? /* @__PURE__ */ i(gs, { alerts: n, loading: !!a, columns: o }) : /* @__PURE__ */ i(Bn, { columns: o }) }) });
4919
4946
  }
4920
- function zn(e) {
4921
- const { alerts: t } = Ne(), s = Tt({
4947
+ function Vn(e) {
4948
+ const { alerts: t } = Ae(), s = It({
4922
4949
  queryKey: ["alerts", "report", e],
4923
4950
  queryFn: () => t.getAlertsReport(e),
4924
4951
  staleTime: 6e4
@@ -4930,7 +4957,7 @@ function zn(e) {
4930
4957
  refetch: s.refetch
4931
4958
  };
4932
4959
  }
4933
- const Vn = [
4960
+ const Jn = [
4934
4961
  { title: "ID", dataIndex: "id", key: "id", width: 120 },
4935
4962
  { title: "Priority", dataIndex: "priority", key: "priority", width: 120 },
4936
4963
  { title: "Timestamp", dataIndex: "timestamp", key: "timestamp", width: 220 },
@@ -4940,7 +4967,7 @@ const Vn = [
4940
4967
  export {
4941
4968
  Nn as AlertAssignment,
4942
4969
  gs as AlertConsole,
4943
- Yn as AlertConsoleWidget,
4970
+ zn as AlertConsoleWidget,
4944
4971
  as as AlertsTable,
4945
4972
  lr as ApiProvider,
4946
4973
  dn as ArchivedTable,
@@ -4948,12 +4975,12 @@ export {
4948
4975
  Ar as DataTable,
4949
4976
  xn as MyPreferencesPanel,
4950
4977
  wn as SettingsPanel,
4951
- In as SettingsTabs,
4952
- Vn as exampleAlertColumns,
4953
- Fn as useAlertStatusList,
4954
- Ln as useAlerts,
4955
- zn as useAlertsReport,
4956
- Ne as useApi,
4978
+ Cn as SettingsTabs,
4979
+ Jn as exampleAlertColumns,
4980
+ Un as useAlertStatusList,
4981
+ $n as useAlerts,
4982
+ Vn as useAlertsReport,
4983
+ Ae as useApi,
4957
4984
  ys as useUpdateAlertStatus
4958
4985
  };
4959
4986
  //# sourceMappingURL=index.es.js.map