@ssgc/alert-console 2.4.0 → 2.4.1
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +1060 -1054
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useContext as
|
|
4
|
-
import { Select as
|
|
5
|
-
import { MessageOutlined as
|
|
6
|
-
import { toast as
|
|
7
|
-
const
|
|
8
|
-
critical:
|
|
9
|
-
high:
|
|
10
|
-
medium:
|
|
11
|
-
low:
|
|
12
|
-
},
|
|
13
|
-
Critical:
|
|
14
|
-
High:
|
|
15
|
-
Medium:
|
|
16
|
-
Low:
|
|
1
|
+
import { jsx as i, jsxs as u, Fragment as Ds } from "react/jsx-runtime";
|
|
2
|
+
import * as me from "react";
|
|
3
|
+
import { useContext as Fs, useMemo as ue, createContext as Us, useState as w, useEffect as de, forwardRef as us, createElement as yt, useRef as Ls } from "react";
|
|
4
|
+
import { Select as Ae, Table as Ct, Row as Ne, Col as W, Input as $s, Tag as Ke, Space as ke, Tooltip as Bt, Button as Se, Progress as Bs, Dropdown as js, Typography as ze, Spin as Tt, Checkbox as Qe, Divider as We, TimePicker as jt, Tabs as It, Card as ft, Steps as qs, Modal as _s, Carousel as Qs } from "antd";
|
|
5
|
+
import { MessageOutlined as Hs, MailOutlined as Gs, MoreOutlined as Ws, PlusOutlined as Ks, EditOutlined as Ys, LeftOutlined as zs, RightOutlined as Zs } from "@ant-design/icons";
|
|
6
|
+
import { toast as ve } from "react-toastify";
|
|
7
|
+
const Vs = "#FF3B30", Js = "#FF9500", Xs = "#FFCC00", er = "#34C759", Ve = {
|
|
8
|
+
critical: Vs,
|
|
9
|
+
high: Js,
|
|
10
|
+
medium: Xs,
|
|
11
|
+
low: er
|
|
12
|
+
}, qt = {
|
|
13
|
+
Critical: Ve.critical,
|
|
14
|
+
High: Ve.high,
|
|
15
|
+
Medium: Ve.medium,
|
|
16
|
+
Low: Ve.low
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function tr(e) {
|
|
19
|
+
return qt[e] || qt.Low;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function _t(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,
|
|
26
|
-
return h * 3600 +
|
|
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, d = Number.isFinite(o) ? o : 0, c = Number.isFinite(l) ? l : 0;
|
|
26
|
+
return h * 3600 + d * 60 + c;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Qt(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 = [];
|
|
@@ -33,21 +33,21 @@ function ft(e) {
|
|
|
33
33
|
n.has(o) || (n.add(o), a.push(o));
|
|
34
34
|
}), a;
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const ds = "", sr = ds, rr = "", nr = "", Ht = {
|
|
37
37
|
snl: {
|
|
38
|
-
alerts:
|
|
39
|
-
rules:
|
|
38
|
+
alerts: ds,
|
|
39
|
+
rules: sr
|
|
40
40
|
},
|
|
41
41
|
schools: {
|
|
42
|
-
alerts:
|
|
43
|
-
rules:
|
|
42
|
+
alerts: rr,
|
|
43
|
+
rules: nr
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
function
|
|
46
|
+
function Ce(e, t) {
|
|
47
47
|
const s = (e || "").replace(/\/+$/, ""), r = t.startsWith("/") ? t : `/${t}`;
|
|
48
48
|
return `${s}${r}`;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function ir() {
|
|
51
51
|
try {
|
|
52
52
|
const e = localStorage.getItem("authToken");
|
|
53
53
|
return e ? { Authorization: `Bearer ${e}` } : {};
|
|
@@ -55,17 +55,17 @@ function nr() {
|
|
|
55
55
|
return {};
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Je(e, t) {
|
|
59
59
|
if (!t) return e;
|
|
60
60
|
const s = new URL(e);
|
|
61
61
|
return Object.entries(t).forEach(([r, n]) => {
|
|
62
62
|
n != null && String(n).length > 0 && s.searchParams.set(r, String(n));
|
|
63
63
|
}), s.toString();
|
|
64
64
|
}
|
|
65
|
-
async function
|
|
65
|
+
async function Te(e, t) {
|
|
66
66
|
const s = {
|
|
67
67
|
...t.headers,
|
|
68
|
-
...
|
|
68
|
+
...ir()
|
|
69
69
|
}, r = await fetch(e, { ...t, headers: s });
|
|
70
70
|
if (r.status === 401)
|
|
71
71
|
throw window.location.href = "/login", new Error("Unauthorized");
|
|
@@ -84,43 +84,43 @@ async function xe(e, t) {
|
|
|
84
84
|
}
|
|
85
85
|
return a;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function ar(e) {
|
|
88
88
|
const t = {
|
|
89
89
|
"Content-Type": "application/json",
|
|
90
90
|
...e.headers || {}
|
|
91
91
|
};
|
|
92
92
|
return {
|
|
93
93
|
async listAlerts() {
|
|
94
|
-
const s =
|
|
94
|
+
const s = Ce(e.baseUrl, "/api/Alert"), r = await Te(s, {
|
|
95
95
|
method: "GET",
|
|
96
96
|
headers: t
|
|
97
97
|
});
|
|
98
98
|
return Array.isArray(r) ? r : [];
|
|
99
99
|
},
|
|
100
100
|
async getAlertStatusList() {
|
|
101
|
-
const s =
|
|
101
|
+
const s = Ce(e.baseUrl, "/api/Alert/AlertStatusList"), r = await Te(s, {
|
|
102
102
|
method: "GET",
|
|
103
103
|
headers: t
|
|
104
104
|
});
|
|
105
105
|
return Array.isArray(r) ? r : r && typeof r == "object" && Array.isArray(r.data) ? r.data : [];
|
|
106
106
|
},
|
|
107
107
|
async getAlertsReport(s) {
|
|
108
|
-
const r =
|
|
108
|
+
const r = Ce(e.baseUrl, "/Alerts/GetAlertsReport"), n = Je(r, s), a = await Te(n, {
|
|
109
109
|
method: "GET",
|
|
110
110
|
headers: t
|
|
111
111
|
});
|
|
112
112
|
return Array.isArray(a) ? a : [];
|
|
113
113
|
},
|
|
114
114
|
async updateAlertStatus(s) {
|
|
115
|
-
const r =
|
|
116
|
-
return
|
|
115
|
+
const r = Ce(e.baseUrl, "/api/Alert/status");
|
|
116
|
+
return Te(r, {
|
|
117
117
|
method: "PUT",
|
|
118
118
|
headers: t,
|
|
119
119
|
body: JSON.stringify(s ?? {})
|
|
120
120
|
});
|
|
121
121
|
},
|
|
122
122
|
async getAdminSettings() {
|
|
123
|
-
const s =
|
|
123
|
+
const s = Ce(e.baseUrl, "/api/Alert/GetAdminSettings"), r = await Te(s, {
|
|
124
124
|
method: "GET",
|
|
125
125
|
headers: t
|
|
126
126
|
});
|
|
@@ -131,20 +131,20 @@ function ir(e) {
|
|
|
131
131
|
return null;
|
|
132
132
|
},
|
|
133
133
|
async setAdminSettings(s) {
|
|
134
|
-
const r =
|
|
134
|
+
const r = Ce(e.baseUrl, "/api/Alert/SetAdminSettings"), n = {
|
|
135
135
|
userId: 0,
|
|
136
136
|
isAdminSetting: !0,
|
|
137
137
|
sortBy: s?.sortBy ?? "",
|
|
138
138
|
groupBy: s?.groupBy ?? null
|
|
139
139
|
};
|
|
140
|
-
return
|
|
140
|
+
return Te(r, {
|
|
141
141
|
method: "POST",
|
|
142
142
|
headers: t,
|
|
143
143
|
body: JSON.stringify(n)
|
|
144
144
|
});
|
|
145
145
|
},
|
|
146
146
|
async getPreferenceSettings() {
|
|
147
|
-
const s =
|
|
147
|
+
const s = Ce(e.baseUrl, "/api/Alert/GetPreferenceSettings"), r = await Te(s, {
|
|
148
148
|
method: "GET",
|
|
149
149
|
headers: t
|
|
150
150
|
});
|
|
@@ -155,7 +155,7 @@ function ir(e) {
|
|
|
155
155
|
return null;
|
|
156
156
|
},
|
|
157
157
|
async setPreferenceSettings(s) {
|
|
158
|
-
const r =
|
|
158
|
+
const r = Ce(e.baseUrl, "/api/Alert/SetPreferenceSettings"), n = await Te(r, {
|
|
159
159
|
method: "POST",
|
|
160
160
|
headers: t,
|
|
161
161
|
body: JSON.stringify(s ?? {})
|
|
@@ -168,28 +168,28 @@ function ir(e) {
|
|
|
168
168
|
};
|
|
169
169
|
},
|
|
170
170
|
async getAlertNotifications(s) {
|
|
171
|
-
const r =
|
|
171
|
+
const r = Ce(e.baseUrl, "/api/Alert/GetNotifications"), n = Je(r, { alertId: s }), a = await Te(n, {
|
|
172
172
|
method: "GET",
|
|
173
173
|
headers: t
|
|
174
174
|
});
|
|
175
175
|
return Array.isArray(a) ? a : a && typeof a == "object" && Array.isArray(a.data) ? a.data : [];
|
|
176
176
|
},
|
|
177
177
|
async notifyFamilyMembers(s) {
|
|
178
|
-
const r =
|
|
179
|
-
return
|
|
178
|
+
const r = Ce(e.baseUrl, "/api/Alert/NotificationToFamilyMembers"), n = Je(r, { alertId: s });
|
|
179
|
+
return Te(n, {
|
|
180
180
|
method: "POST",
|
|
181
181
|
headers: t
|
|
182
182
|
});
|
|
183
183
|
},
|
|
184
184
|
async sendSMSorEmailNotifications(s, r, n) {
|
|
185
|
-
const a =
|
|
186
|
-
return
|
|
185
|
+
const a = Ce(e.baseUrl, "/api/Alert/SendSMSorEmailNotifications"), o = Je(a, { alertId: s, isEmail: r, isSMS: n });
|
|
186
|
+
return Te(o, {
|
|
187
187
|
method: "POST",
|
|
188
188
|
headers: t
|
|
189
189
|
});
|
|
190
190
|
},
|
|
191
191
|
async getTimeZoneMasters() {
|
|
192
|
-
const s =
|
|
192
|
+
const s = Ce(e.baseUrl, "/api/UserPreference/GetTimeZoneMasters"), r = await Te(s, {
|
|
193
193
|
method: "GET",
|
|
194
194
|
headers: t
|
|
195
195
|
});
|
|
@@ -197,11 +197,11 @@ function ir(e) {
|
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function Gt(e, t) {
|
|
201
201
|
const s = (e || "").replace(/\/+$/, ""), r = t.startsWith("/") ? t : `/${t}`;
|
|
202
202
|
return `${s}${r}`;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function or() {
|
|
205
205
|
try {
|
|
206
206
|
const e = localStorage.getItem("authToken");
|
|
207
207
|
return e ? { Authorization: `Bearer ${e}` } : {};
|
|
@@ -209,10 +209,10 @@ function ar() {
|
|
|
209
209
|
return {};
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
async function
|
|
212
|
+
async function Xe(e, t) {
|
|
213
213
|
const s = {
|
|
214
214
|
...t.headers,
|
|
215
|
-
...
|
|
215
|
+
...or()
|
|
216
216
|
}, r = await fetch(e, { ...t, headers: s });
|
|
217
217
|
if (r.status === 401)
|
|
218
218
|
throw window.location.href = "/login", new Error("Unauthorized");
|
|
@@ -231,29 +231,29 @@ async function Je(e, t) {
|
|
|
231
231
|
}
|
|
232
232
|
return a;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function lr(e) {
|
|
235
235
|
const t = {
|
|
236
236
|
"Content-Type": "application/json",
|
|
237
237
|
...e.headers || {}
|
|
238
|
-
}, s =
|
|
238
|
+
}, s = Gt(e.baseUrl, "/api/Rules"), r = Gt(e.baseUrl, "/api/Rules/lookups");
|
|
239
239
|
return {
|
|
240
240
|
async getRules() {
|
|
241
|
-
const n = await
|
|
241
|
+
const n = await Xe(s, { method: "GET", headers: t });
|
|
242
242
|
return Array.isArray(n) ? n : [];
|
|
243
243
|
},
|
|
244
244
|
async setEscalationSettings(n) {
|
|
245
|
-
return
|
|
245
|
+
return Xe(s, {
|
|
246
246
|
method: "POST",
|
|
247
247
|
headers: t,
|
|
248
248
|
body: JSON.stringify(n ?? {})
|
|
249
249
|
});
|
|
250
250
|
},
|
|
251
251
|
async getLookups() {
|
|
252
|
-
return
|
|
252
|
+
return Xe(r, { method: "GET", headers: t });
|
|
253
253
|
},
|
|
254
254
|
async updateRule(n, a) {
|
|
255
255
|
const o = `${s}/${n}`;
|
|
256
|
-
return
|
|
256
|
+
return Xe(o, {
|
|
257
257
|
method: "PUT",
|
|
258
258
|
headers: t,
|
|
259
259
|
body: JSON.stringify(a ?? {})
|
|
@@ -261,24 +261,24 @@ function or(e) {
|
|
|
261
261
|
}
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function cr(e) {
|
|
265
265
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
266
266
|
}
|
|
267
|
-
var
|
|
268
|
-
function
|
|
269
|
-
return
|
|
267
|
+
var rt = { exports: {} }, ur = rt.exports, Wt;
|
|
268
|
+
function dr() {
|
|
269
|
+
return Wt || (Wt = 1, (function(e, t) {
|
|
270
270
|
(function(s, r) {
|
|
271
271
|
e.exports = r();
|
|
272
|
-
})(
|
|
273
|
-
var s = 1e3, r = 6e4, n = 36e5, a = "millisecond", o = "second", l = "minute", h = "hour",
|
|
272
|
+
})(ur, (function() {
|
|
273
|
+
var s = 1e3, r = 6e4, n = 36e5, a = "millisecond", o = "second", l = "minute", h = "hour", d = "day", c = "week", S = "month", f = "quarter", R = "year", N = "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+)?$/, B = /\[([^\]]+)]|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, U = { 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(E) {
|
|
274
274
|
var v = ["th", "st", "nd", "rd"], p = E % 100;
|
|
275
275
|
return "[" + E + (v[(p - 20) % 10] || v[p] || v[0]) + "]";
|
|
276
|
-
} },
|
|
276
|
+
} }, L = function(E, v, p) {
|
|
277
277
|
var x = String(E);
|
|
278
278
|
return !x || x.length >= v ? E : "" + Array(v + 1 - x.length).join(p) + E;
|
|
279
|
-
}, O = { s:
|
|
279
|
+
}, O = { s: L, z: function(E) {
|
|
280
280
|
var v = -E.utcOffset(), p = Math.abs(v), x = Math.floor(p / 60), y = p % 60;
|
|
281
|
-
return (v <= 0 ? "+" : "-") +
|
|
281
|
+
return (v <= 0 ? "+" : "-") + L(x, 2, "0") + ":" + L(y, 2, "0");
|
|
282
282
|
}, m: function E(v, p) {
|
|
283
283
|
if (v.date() < p.date()) return -E(p, v);
|
|
284
284
|
var x = 12 * (p.year() - v.year()) + (p.month() - v.month()), y = v.clone().add(x, S), b = p - y < 0, g = v.clone().add(x + (b ? -1 : 1), S);
|
|
@@ -286,11 +286,11 @@ function ur() {
|
|
|
286
286
|
}, a: function(E) {
|
|
287
287
|
return E < 0 ? Math.ceil(E) || 0 : Math.floor(E);
|
|
288
288
|
}, p: function(E) {
|
|
289
|
-
return { M: S, y: R, w: c, d
|
|
289
|
+
return { M: S, y: R, w: c, d, D: N, h, m: l, s: o, ms: a, Q: f }[E] || String(E || "").toLowerCase().replace(/s$/, "");
|
|
290
290
|
}, u: function(E) {
|
|
291
291
|
return E === void 0;
|
|
292
|
-
} }, Z = "en",
|
|
293
|
-
|
|
292
|
+
} }, Z = "en", H = {};
|
|
293
|
+
H[Z] = U;
|
|
294
294
|
var K = "$isDayjsObject", z = function(E) {
|
|
295
295
|
return E instanceof Y || !(!E || !E[K]);
|
|
296
296
|
}, I = function E(v, p, x) {
|
|
@@ -298,12 +298,12 @@ function ur() {
|
|
|
298
298
|
if (!v) return Z;
|
|
299
299
|
if (typeof v == "string") {
|
|
300
300
|
var b = v.toLowerCase();
|
|
301
|
-
|
|
301
|
+
H[b] && (y = b), p && (H[b] = p, y = b);
|
|
302
302
|
var g = v.split("-");
|
|
303
303
|
if (!y && g.length > 1) return E(g[0]);
|
|
304
304
|
} else {
|
|
305
|
-
var
|
|
306
|
-
|
|
305
|
+
var M = v.name;
|
|
306
|
+
H[M] = v, y = M;
|
|
307
307
|
}
|
|
308
308
|
return !x && y && (Z = y), y || !x && Z;
|
|
309
309
|
}, T = function(E, v) {
|
|
@@ -328,8 +328,8 @@ function ur() {
|
|
|
328
328
|
if (typeof y == "string" && !/Z$/i.test(y)) {
|
|
329
329
|
var g = y.match(A);
|
|
330
330
|
if (g) {
|
|
331
|
-
var
|
|
332
|
-
return b ? new Date(Date.UTC(g[1],
|
|
331
|
+
var M = g[2] - 1 || 0, F = (g[7] || "0").substring(0, 3);
|
|
332
|
+
return b ? new Date(Date.UTC(g[1], M, g[3] || 1, g[4] || 0, g[5] || 0, g[6] || 0, F)) : new Date(g[1], M, g[3] || 1, g[4] || 0, g[5] || 0, g[6] || 0, F);
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
return new Date(y);
|
|
@@ -355,40 +355,40 @@ function ur() {
|
|
|
355
355
|
}, v.valueOf = function() {
|
|
356
356
|
return this.$d.getTime();
|
|
357
357
|
}, v.startOf = function(p, x) {
|
|
358
|
-
var y = this, b = !!k.u(x) || x, g = k.p(p),
|
|
359
|
-
var le = k.w(y.$u ? Date.UTC(y.$y,
|
|
360
|
-
return b ? le : le.endOf(
|
|
361
|
-
},
|
|
362
|
-
return k.w(y.toDate()[
|
|
363
|
-
},
|
|
358
|
+
var y = this, b = !!k.u(x) || x, g = k.p(p), M = function(pe, te) {
|
|
359
|
+
var le = k.w(y.$u ? Date.UTC(y.$y, te, pe) : new Date(y.$y, te, pe), y);
|
|
360
|
+
return b ? le : le.endOf(d);
|
|
361
|
+
}, F = function(pe, te) {
|
|
362
|
+
return k.w(y.toDate()[pe].apply(y.toDate("s"), (b ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(te)), y);
|
|
363
|
+
}, $ = this.$W, j = this.$M, q = this.$D, re = "set" + (this.$u ? "UTC" : "");
|
|
364
364
|
switch (g) {
|
|
365
365
|
case R:
|
|
366
|
-
return b ?
|
|
366
|
+
return b ? M(1, 0) : M(31, 11);
|
|
367
367
|
case S:
|
|
368
|
-
return b ?
|
|
368
|
+
return b ? M(1, j) : M(0, j + 1);
|
|
369
369
|
case c:
|
|
370
|
-
var
|
|
371
|
-
return
|
|
372
|
-
case
|
|
370
|
+
var ae = this.$locale().weekStart || 0, oe = ($ < ae ? $ + 7 : $) - ae;
|
|
371
|
+
return M(b ? q - oe : q + (6 - oe), j);
|
|
372
|
+
case d:
|
|
373
373
|
case N:
|
|
374
|
-
return
|
|
374
|
+
return F(re + "Hours", 0);
|
|
375
375
|
case h:
|
|
376
|
-
return
|
|
376
|
+
return F(re + "Minutes", 1);
|
|
377
377
|
case l:
|
|
378
|
-
return
|
|
378
|
+
return F(re + "Seconds", 2);
|
|
379
379
|
case o:
|
|
380
|
-
return
|
|
380
|
+
return F(re + "Milliseconds", 3);
|
|
381
381
|
default:
|
|
382
382
|
return this.clone();
|
|
383
383
|
}
|
|
384
384
|
}, v.endOf = function(p) {
|
|
385
385
|
return this.startOf(p, !1);
|
|
386
386
|
}, v.$set = function(p, x) {
|
|
387
|
-
var y, b = k.p(p), g = "set" + (this.$u ? "UTC" : ""),
|
|
387
|
+
var y, b = k.p(p), g = "set" + (this.$u ? "UTC" : ""), M = (y = {}, y[d] = g + "Date", y[N] = g + "Date", y[S] = g + "Month", y[R] = g + "FullYear", y[h] = g + "Hours", y[l] = g + "Minutes", y[o] = g + "Seconds", y[a] = g + "Milliseconds", y)[b], F = b === d ? this.$D + (x - this.$W) : x;
|
|
388
388
|
if (b === S || b === R) {
|
|
389
|
-
var
|
|
390
|
-
|
|
391
|
-
} else
|
|
389
|
+
var $ = this.clone().set(N, 1);
|
|
390
|
+
$.$d[M](F), $.init(), this.$d = $.set(N, Math.min(this.$D, $.daysInMonth())).$d;
|
|
391
|
+
} else M && this.$d[M](F);
|
|
392
392
|
return this.init(), this;
|
|
393
393
|
}, v.set = function(p, x) {
|
|
394
394
|
return this.clone().$set(p, x);
|
|
@@ -397,44 +397,44 @@ function ur() {
|
|
|
397
397
|
}, v.add = function(p, x) {
|
|
398
398
|
var y, b = this;
|
|
399
399
|
p = Number(p);
|
|
400
|
-
var g = k.p(x),
|
|
400
|
+
var g = k.p(x), M = function(j) {
|
|
401
401
|
var q = T(b);
|
|
402
|
-
return k.w(q.date(q.date() + Math.round(
|
|
402
|
+
return k.w(q.date(q.date() + Math.round(j * p)), b);
|
|
403
403
|
};
|
|
404
404
|
if (g === S) return this.set(S, this.$M + p);
|
|
405
405
|
if (g === R) return this.set(R, this.$y + p);
|
|
406
|
-
if (g ===
|
|
407
|
-
if (g === c) return
|
|
408
|
-
var
|
|
409
|
-
return k.w(
|
|
406
|
+
if (g === d) return M(1);
|
|
407
|
+
if (g === c) return M(7);
|
|
408
|
+
var F = (y = {}, y[l] = r, y[h] = n, y[o] = s, y)[g] || 1, $ = this.$d.getTime() + p * F;
|
|
409
|
+
return k.w($, this);
|
|
410
410
|
}, v.subtract = function(p, x) {
|
|
411
411
|
return this.add(-1 * p, x);
|
|
412
412
|
}, v.format = function(p) {
|
|
413
413
|
var x = this, y = this.$locale();
|
|
414
414
|
if (!this.isValid()) return y.invalidDate || m;
|
|
415
|
-
var b = p || "YYYY-MM-DDTHH:mm:ssZ", g = k.z(this),
|
|
416
|
-
return
|
|
417
|
-
}, oe = function(
|
|
418
|
-
return k.s(
|
|
419
|
-
},
|
|
420
|
-
var
|
|
421
|
-
return
|
|
415
|
+
var b = p || "YYYY-MM-DDTHH:mm:ssZ", g = k.z(this), M = this.$H, F = this.$m, $ = this.$M, j = y.weekdays, q = y.months, re = y.meridiem, ae = function(te, le, xe, be) {
|
|
416
|
+
return te && (te[le] || te(x, b)) || xe[le].slice(0, be);
|
|
417
|
+
}, oe = function(te) {
|
|
418
|
+
return k.s(M % 12 || 12, te, "0");
|
|
419
|
+
}, pe = re || function(te, le, xe) {
|
|
420
|
+
var be = te < 12 ? "AM" : "PM";
|
|
421
|
+
return xe ? be.toLowerCase() : be;
|
|
422
422
|
};
|
|
423
|
-
return b.replace(
|
|
424
|
-
return le || (function(
|
|
425
|
-
switch (
|
|
423
|
+
return b.replace(B, (function(te, le) {
|
|
424
|
+
return le || (function(xe) {
|
|
425
|
+
switch (xe) {
|
|
426
426
|
case "YY":
|
|
427
427
|
return String(x.$y).slice(-2);
|
|
428
428
|
case "YYYY":
|
|
429
429
|
return k.s(x.$y, 4, "0");
|
|
430
430
|
case "M":
|
|
431
|
-
return
|
|
431
|
+
return $ + 1;
|
|
432
432
|
case "MM":
|
|
433
|
-
return k.s(
|
|
433
|
+
return k.s($ + 1, 2, "0");
|
|
434
434
|
case "MMM":
|
|
435
|
-
return
|
|
435
|
+
return ae(y.monthsShort, $, q, 3);
|
|
436
436
|
case "MMMM":
|
|
437
|
-
return
|
|
437
|
+
return ae(q, $);
|
|
438
438
|
case "D":
|
|
439
439
|
return x.$D;
|
|
440
440
|
case "DD":
|
|
@@ -442,27 +442,27 @@ function ur() {
|
|
|
442
442
|
case "d":
|
|
443
443
|
return String(x.$W);
|
|
444
444
|
case "dd":
|
|
445
|
-
return
|
|
445
|
+
return ae(y.weekdaysMin, x.$W, j, 2);
|
|
446
446
|
case "ddd":
|
|
447
|
-
return
|
|
447
|
+
return ae(y.weekdaysShort, x.$W, j, 3);
|
|
448
448
|
case "dddd":
|
|
449
|
-
return
|
|
449
|
+
return j[x.$W];
|
|
450
450
|
case "H":
|
|
451
|
-
return String(
|
|
451
|
+
return String(M);
|
|
452
452
|
case "HH":
|
|
453
|
-
return k.s(
|
|
453
|
+
return k.s(M, 2, "0");
|
|
454
454
|
case "h":
|
|
455
455
|
return oe(1);
|
|
456
456
|
case "hh":
|
|
457
457
|
return oe(2);
|
|
458
458
|
case "a":
|
|
459
|
-
return
|
|
459
|
+
return pe(M, F, !0);
|
|
460
460
|
case "A":
|
|
461
|
-
return
|
|
461
|
+
return pe(M, F, !1);
|
|
462
462
|
case "m":
|
|
463
|
-
return String(
|
|
463
|
+
return String(F);
|
|
464
464
|
case "mm":
|
|
465
|
-
return k.s(
|
|
465
|
+
return k.s(F, 2, "0");
|
|
466
466
|
case "s":
|
|
467
467
|
return String(x.$s);
|
|
468
468
|
case "ss":
|
|
@@ -473,15 +473,15 @@ function ur() {
|
|
|
473
473
|
return g;
|
|
474
474
|
}
|
|
475
475
|
return null;
|
|
476
|
-
})(
|
|
476
|
+
})(te) || g.replace(":", "");
|
|
477
477
|
}));
|
|
478
478
|
}, v.utcOffset = function() {
|
|
479
479
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
480
480
|
}, v.diff = function(p, x, y) {
|
|
481
|
-
var b, g = this,
|
|
482
|
-
return k.m(g,
|
|
481
|
+
var b, g = this, M = k.p(x), F = T(p), $ = (F.utcOffset() - this.utcOffset()) * r, j = this - F, q = function() {
|
|
482
|
+
return k.m(g, F);
|
|
483
483
|
};
|
|
484
|
-
switch (
|
|
484
|
+
switch (M) {
|
|
485
485
|
case R:
|
|
486
486
|
b = q() / 12;
|
|
487
487
|
break;
|
|
@@ -492,28 +492,28 @@ function ur() {
|
|
|
492
492
|
b = q() / 3;
|
|
493
493
|
break;
|
|
494
494
|
case c:
|
|
495
|
-
b = (
|
|
495
|
+
b = (j - $) / 6048e5;
|
|
496
496
|
break;
|
|
497
|
-
case
|
|
498
|
-
b = (
|
|
497
|
+
case d:
|
|
498
|
+
b = (j - $) / 864e5;
|
|
499
499
|
break;
|
|
500
500
|
case h:
|
|
501
|
-
b =
|
|
501
|
+
b = j / n;
|
|
502
502
|
break;
|
|
503
503
|
case l:
|
|
504
|
-
b =
|
|
504
|
+
b = j / r;
|
|
505
505
|
break;
|
|
506
506
|
case o:
|
|
507
|
-
b =
|
|
507
|
+
b = j / s;
|
|
508
508
|
break;
|
|
509
509
|
default:
|
|
510
|
-
b =
|
|
510
|
+
b = j;
|
|
511
511
|
}
|
|
512
512
|
return y ? b : k.a(b);
|
|
513
513
|
}, v.daysInMonth = function() {
|
|
514
514
|
return this.endOf(S).$D;
|
|
515
515
|
}, v.$locale = function() {
|
|
516
|
-
return
|
|
516
|
+
return H[this.$L];
|
|
517
517
|
}, v.locale = function(p, x) {
|
|
518
518
|
if (!p) return this.$L;
|
|
519
519
|
var y = this.clone(), b = I(p, x, !0);
|
|
@@ -529,40 +529,40 @@ function ur() {
|
|
|
529
529
|
}, v.toString = function() {
|
|
530
530
|
return this.$d.toUTCString();
|
|
531
531
|
}, E;
|
|
532
|
-
})(),
|
|
533
|
-
return T.prototype =
|
|
534
|
-
|
|
532
|
+
})(), ee = Y.prototype;
|
|
533
|
+
return T.prototype = ee, [["$ms", a], ["$s", o], ["$m", l], ["$H", h], ["$W", d], ["$M", S], ["$y", R], ["$D", N]].forEach((function(E) {
|
|
534
|
+
ee[E[1]] = function(v) {
|
|
535
535
|
return this.$g(v, E[0], E[1]);
|
|
536
536
|
};
|
|
537
537
|
})), T.extend = function(E, v) {
|
|
538
538
|
return E.$i || (E(v, Y, T), E.$i = !0), T;
|
|
539
539
|
}, T.locale = I, T.isDayjs = z, T.unix = function(E) {
|
|
540
540
|
return T(1e3 * E);
|
|
541
|
-
}, T.en =
|
|
541
|
+
}, T.en = H[Z], T.Ls = H, T.p = {}, T;
|
|
542
542
|
}));
|
|
543
|
-
})(
|
|
543
|
+
})(rt)), rt.exports;
|
|
544
544
|
}
|
|
545
|
-
var
|
|
546
|
-
const
|
|
547
|
-
function
|
|
545
|
+
var hr = dr();
|
|
546
|
+
const hs = /* @__PURE__ */ cr(hr);
|
|
547
|
+
function fs(e) {
|
|
548
548
|
if (!e) return "By Severity";
|
|
549
549
|
const t = e.trim().toLowerCase();
|
|
550
550
|
return t.includes("created") ? "By Created Date" : t.includes("updated") || t.includes("modified") ? "By Updated Date" : "By Severity";
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function ms(e) {
|
|
553
553
|
if (!e || typeof e != "string") return { hours: 0, minutes: 0, seconds: 0 };
|
|
554
554
|
const t = e.split(":").map((a) => parseInt(a, 10)), s = Number.isFinite(t[0]) ? t[0] : 0, r = Number.isFinite(t[1]) ? t[1] : 0, n = Number.isFinite(t[2]) ? t[2] : 0;
|
|
555
555
|
return { hours: s, minutes: r, seconds: n };
|
|
556
556
|
}
|
|
557
|
-
function
|
|
558
|
-
const { hours: t, minutes: s, seconds: r } =
|
|
559
|
-
return
|
|
557
|
+
function Kt(e) {
|
|
558
|
+
const { hours: t, minutes: s, seconds: r } = ms(e);
|
|
559
|
+
return hs().hour(t).minute(s).second(r).millisecond(0);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Pe(e, t) {
|
|
562
562
|
const s = (e || "").replace(/\/+$/, ""), r = t.startsWith("/") ? t : `/${t}`;
|
|
563
563
|
return `${s}${r}`;
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function fr() {
|
|
566
566
|
try {
|
|
567
567
|
const e = localStorage.getItem("authToken");
|
|
568
568
|
return e ? { Authorization: `Bearer ${e}` } : {};
|
|
@@ -570,17 +570,17 @@ function hr() {
|
|
|
570
570
|
return {};
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function Yt(e, t) {
|
|
574
574
|
if (!t) return e;
|
|
575
575
|
const s = new URL(e);
|
|
576
576
|
return Object.entries(t).forEach(([r, n]) => {
|
|
577
577
|
n != null && String(n).length > 0 && s.searchParams.set(r, String(n));
|
|
578
578
|
}), s.toString();
|
|
579
579
|
}
|
|
580
|
-
async function
|
|
580
|
+
async function De(e, t) {
|
|
581
581
|
const s = {
|
|
582
582
|
...t.headers,
|
|
583
|
-
...
|
|
583
|
+
...fr()
|
|
584
584
|
}, r = await fetch(e, { ...t, headers: s });
|
|
585
585
|
if (r.status === 401)
|
|
586
586
|
throw window.location.href = "/login", new Error("Unauthorized");
|
|
@@ -599,74 +599,74 @@ async function Pe(e, t) {
|
|
|
599
599
|
}
|
|
600
600
|
return a;
|
|
601
601
|
}
|
|
602
|
-
const
|
|
603
|
-
function
|
|
602
|
+
const ie = (...e) => e.find((t) => t != null);
|
|
603
|
+
function mr(e) {
|
|
604
604
|
return {
|
|
605
605
|
// important: do not fall back to `id` here; only AlertId/alertId are considered the Alert ID
|
|
606
|
-
id: String(
|
|
607
|
-
priority:
|
|
608
|
-
timestamp:
|
|
609
|
-
statusType:
|
|
610
|
-
description:
|
|
611
|
-
eventName:
|
|
612
|
-
ruleName:
|
|
613
|
-
spaceName:
|
|
614
|
-
assignTeam:
|
|
615
|
-
cameraName:
|
|
616
|
-
type:
|
|
617
|
-
mediaDetails:
|
|
618
|
-
additionalMedia:
|
|
619
|
-
timeElapsed:
|
|
620
|
-
timeRemaining:
|
|
621
|
-
anomalyName:
|
|
622
|
-
alertDetails:
|
|
623
|
-
statusHistory:
|
|
624
|
-
isEmailSent:
|
|
625
|
-
isSMSSent:
|
|
626
|
-
timeZoneUniqueId:
|
|
606
|
+
id: String(ie(e?.AlertId, e?.alertId) ?? ""),
|
|
607
|
+
priority: ie(e?.Priority, e?.priority, "Low"),
|
|
608
|
+
timestamp: ie(e?.Timestamp, e?.timestamp, ""),
|
|
609
|
+
statusType: ie(e?.Status, e?.statusType, ""),
|
|
610
|
+
description: ie(e?.Description, e?.description, ""),
|
|
611
|
+
eventName: ie(e?.EventName, e?.eventName),
|
|
612
|
+
ruleName: ie(e?.RuleName, e?.ruleName),
|
|
613
|
+
spaceName: ie(e?.SpaceName, e?.spaceName),
|
|
614
|
+
assignTeam: ie(e?.AssignTeam, e?.assignTeam),
|
|
615
|
+
cameraName: ie(e?.CameraName, e?.cameraName),
|
|
616
|
+
type: ie(e?.Type, e?.type),
|
|
617
|
+
mediaDetails: ie(e?.MediaDetails, e?.mediaDetails),
|
|
618
|
+
additionalMedia: ie(e?.AdditionalMedia, e?.additionalMedia),
|
|
619
|
+
timeElapsed: ie(e?.TimeElapsed, e?.timeElapsed),
|
|
620
|
+
timeRemaining: ie(e?.TimeRemaining, e?.timeRemaining),
|
|
621
|
+
anomalyName: ie(e?.AnomalyName, e?.anomalyName),
|
|
622
|
+
alertDetails: ie(e?.AlertDetails, e?.alertDetails),
|
|
623
|
+
statusHistory: ie(e?.StatusHistory, e?.statusHistory),
|
|
624
|
+
isEmailSent: ie(e?.IsEmailSent, e?.isEmailSent),
|
|
625
|
+
isSMSSent: ie(e?.IsSMSSent, e?.isSMSSent),
|
|
626
|
+
timeZoneUniqueId: ie(e?.TimeZoneUniqueId, e?.timeZoneUniqueId)
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function pr(e) {
|
|
630
630
|
const t = {
|
|
631
631
|
"Content-Type": "application/json",
|
|
632
632
|
...e.headers || {}
|
|
633
633
|
};
|
|
634
634
|
return {
|
|
635
635
|
async listAlerts() {
|
|
636
|
-
const s =
|
|
636
|
+
const s = Pe(e.baseUrl, "/api/detectionpolicy/alerts?customerId=99e5c8b5-b9d4-4d35-8885-7f121c532664"), r = await De(s, {
|
|
637
637
|
method: "GET",
|
|
638
638
|
headers: t
|
|
639
639
|
});
|
|
640
|
-
return Array.isArray(r?.Items) ? (r?.Items).map(
|
|
640
|
+
return Array.isArray(r?.Items) ? (r?.Items).map(mr) : [];
|
|
641
641
|
},
|
|
642
642
|
async getAlertStatusList() {
|
|
643
|
-
const s =
|
|
643
|
+
const s = Pe(e.baseUrl, "/api/detectionpolicy/alerts/StatusList"), r = await De(s, {
|
|
644
644
|
method: "GET",
|
|
645
645
|
headers: t
|
|
646
646
|
});
|
|
647
647
|
return Array.isArray(r) ? r : [];
|
|
648
648
|
},
|
|
649
649
|
async getAlertsReport(s) {
|
|
650
|
-
const r =
|
|
650
|
+
const r = Pe(e.baseUrl, "/api/detectionpolicy/alerts/GetAlertsReport"), n = Yt(r, s), a = await De(n, {
|
|
651
651
|
method: "GET",
|
|
652
652
|
headers: t
|
|
653
653
|
});
|
|
654
654
|
return Array.isArray(a) ? a : [];
|
|
655
655
|
},
|
|
656
656
|
async updateAlertStatus(s) {
|
|
657
|
-
const r =
|
|
657
|
+
const r = Pe(e.baseUrl, "/api/detectionpolicy/alerts/Log"), n = {
|
|
658
658
|
AlertId: s.alertId ?? s.alertUniqueId ?? s.AlertId,
|
|
659
659
|
Status: s.status ?? s.Status ?? "",
|
|
660
660
|
Notes: s.notes ?? s.Notes ?? ""
|
|
661
661
|
};
|
|
662
|
-
return
|
|
662
|
+
return De(r, {
|
|
663
663
|
method: "POST",
|
|
664
664
|
headers: t,
|
|
665
665
|
body: JSON.stringify(n)
|
|
666
666
|
});
|
|
667
667
|
},
|
|
668
668
|
async getAdminSettings() {
|
|
669
|
-
const s =
|
|
669
|
+
const s = Pe(e.baseUrl, "/api/detectionpolicy/alerts/GetAdminSettings"), r = await De(s, {
|
|
670
670
|
method: "GET",
|
|
671
671
|
headers: t
|
|
672
672
|
});
|
|
@@ -677,19 +677,19 @@ function mr(e) {
|
|
|
677
677
|
return null;
|
|
678
678
|
},
|
|
679
679
|
async setAdminSettings(s) {
|
|
680
|
-
const r =
|
|
680
|
+
const r = Pe(e.baseUrl, "/api/detectionpolicy/alerts/SetAdminSettings"), n = {
|
|
681
681
|
userId: 0,
|
|
682
682
|
isAdminSetting: !0,
|
|
683
683
|
sortBy: s?.sortBy ?? ""
|
|
684
684
|
};
|
|
685
|
-
return
|
|
685
|
+
return De(r, {
|
|
686
686
|
method: "POST",
|
|
687
687
|
headers: t,
|
|
688
688
|
body: JSON.stringify(n)
|
|
689
689
|
});
|
|
690
690
|
},
|
|
691
691
|
async getPreferenceSettings() {
|
|
692
|
-
const s =
|
|
692
|
+
const s = Pe(e.baseUrl, "/api/detectionpolicy/alerts/GetPreferenceSettings"), r = await De(s, {
|
|
693
693
|
method: "GET",
|
|
694
694
|
headers: t
|
|
695
695
|
});
|
|
@@ -700,13 +700,13 @@ function mr(e) {
|
|
|
700
700
|
return null;
|
|
701
701
|
},
|
|
702
702
|
async setPreferenceSettings(s) {
|
|
703
|
-
const r =
|
|
704
|
-
const { hours: c, minutes: S, seconds: f } =
|
|
703
|
+
const r = Pe(e.baseUrl, "/api/detectionpolicy/alerts/SetPreferenceSettings"), n = (d) => {
|
|
704
|
+
const { hours: c, minutes: S, seconds: f } = ms(d);
|
|
705
705
|
return (c * 3600 + S * 60 + f) * 1e7;
|
|
706
706
|
}, a = {
|
|
707
707
|
Settings: {
|
|
708
708
|
UserId: 0,
|
|
709
|
-
AnomalyIds: Array.isArray(s?.anomalyIds) ? s.anomalyIds.map((
|
|
709
|
+
AnomalyIds: Array.isArray(s?.anomalyIds) ? s.anomalyIds.map((d) => String(d)) : [],
|
|
710
710
|
DoNotDisturbStart: { Ticks: n(s?.doNotDisturbStart) },
|
|
711
711
|
DoNotDisturbEnd: { Ticks: n(s?.doNotDisturbEnd) },
|
|
712
712
|
InApp: !!s?.inApp,
|
|
@@ -714,7 +714,7 @@ function mr(e) {
|
|
|
714
714
|
Email: !!s?.email,
|
|
715
715
|
SortBy: s?.sortBy ?? ""
|
|
716
716
|
}
|
|
717
|
-
}, o = await
|
|
717
|
+
}, o = await De(r, {
|
|
718
718
|
method: "POST",
|
|
719
719
|
headers: t,
|
|
720
720
|
body: JSON.stringify(a)
|
|
@@ -727,7 +727,7 @@ function mr(e) {
|
|
|
727
727
|
};
|
|
728
728
|
},
|
|
729
729
|
async getAlertNotifications(s) {
|
|
730
|
-
const r =
|
|
730
|
+
const r = Pe(e.baseUrl, "/api/detectionpolicy/alerts/GetNotifications"), n = Yt(r, { alertId: s }), a = await De(n, {
|
|
731
731
|
method: "GET",
|
|
732
732
|
headers: t
|
|
733
733
|
});
|
|
@@ -735,7 +735,7 @@ function mr(e) {
|
|
|
735
735
|
}
|
|
736
736
|
};
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function yr() {
|
|
739
739
|
try {
|
|
740
740
|
const e = localStorage.getItem("authToken");
|
|
741
741
|
return e ? { Authorization: `Bearer ${e}` } : {};
|
|
@@ -743,10 +743,10 @@ function pr() {
|
|
|
743
743
|
return {};
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
async function
|
|
746
|
+
async function Ue(e, t) {
|
|
747
747
|
const s = {
|
|
748
748
|
...t.headers,
|
|
749
|
-
...
|
|
749
|
+
...yr()
|
|
750
750
|
}, r = await fetch(e, { ...t, headers: s });
|
|
751
751
|
if (r.status === 401)
|
|
752
752
|
throw window.location.href = "/login", new Error("Unauthorized");
|
|
@@ -765,18 +765,18 @@ async function De(e, t) {
|
|
|
765
765
|
}
|
|
766
766
|
return a;
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function gr(e) {
|
|
769
769
|
const t = {
|
|
770
770
|
"Content-Type": "application/json",
|
|
771
771
|
...e.headers || {}
|
|
772
772
|
}, s = new URL("/api/detectionpolicy/rules", e.baseUrl).toString();
|
|
773
773
|
return {
|
|
774
774
|
async getRules() {
|
|
775
|
-
const r = await
|
|
775
|
+
const r = await Ue(s, { method: "GET", headers: t });
|
|
776
776
|
return Array.isArray(r) ? r : [];
|
|
777
777
|
},
|
|
778
778
|
async setEscalationSettings(r) {
|
|
779
|
-
return
|
|
779
|
+
return Ue(s, {
|
|
780
780
|
method: "POST",
|
|
781
781
|
headers: t,
|
|
782
782
|
body: JSON.stringify(r ?? {})
|
|
@@ -784,36 +784,36 @@ function yr(e) {
|
|
|
784
784
|
},
|
|
785
785
|
async getLookups() {
|
|
786
786
|
const r = (O) => new URL(O, e.baseUrl).toString(), n = [
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
787
|
+
Ue(r("/api/detectionpolicy/lookups/actiontypes"), { method: "GET", headers: t }),
|
|
788
|
+
Ue(r("/api/detectionpolicy/lookups/anomalies"), { method: "GET", headers: t }),
|
|
789
|
+
Ue(r("/api/detectionpolicy/lookups/thirdparty"), { method: "GET", headers: t }),
|
|
790
|
+
Ue(r("/api/detectionpolicy/lookups/severity"), { method: "GET", headers: t }),
|
|
791
|
+
Ue(r("/api/detectionpolicy/lookups/scheduletypes"), { method: "GET", headers: t })
|
|
792
792
|
], [
|
|
793
793
|
a,
|
|
794
794
|
o,
|
|
795
795
|
l,
|
|
796
796
|
h,
|
|
797
|
-
|
|
798
|
-
] = await Promise.allSettled(n), c = (O) => O.status === "fulfilled" && Array.isArray(O.value) ? O.value : [], S = c(a), f = c(o), R = c(l), N = c(h), m = c(
|
|
797
|
+
d
|
|
798
|
+
] = await Promise.allSettled(n), c = (O) => O.status === "fulfilled" && Array.isArray(O.value) ? O.value : [], S = c(a), f = c(o), R = c(l), N = c(h), m = c(d), A = S.map((O) => ({
|
|
799
799
|
actionTypeId: Number(O?.ActionTypeId),
|
|
800
800
|
name: O?.DisplayName ?? O?.Name ?? ""
|
|
801
|
-
})),
|
|
801
|
+
})), B = f.map((O) => ({
|
|
802
802
|
recordId: O?.AnomalyId,
|
|
803
803
|
anomalyName: O?.DisplayName ?? O?.Name ?? ""
|
|
804
|
-
})),
|
|
804
|
+
})), U = R.map((O) => ({
|
|
805
805
|
thirdPartyId: Number(O?.ThirdPartyId),
|
|
806
806
|
thirdPartyName: O?.ThirdPartyName ?? O?.Name ?? ""
|
|
807
|
-
})),
|
|
807
|
+
})), L = {
|
|
808
808
|
actionTypes: A,
|
|
809
|
-
anomalies:
|
|
810
|
-
thirdParties:
|
|
809
|
+
anomalies: B,
|
|
810
|
+
thirdParties: U
|
|
811
811
|
};
|
|
812
|
-
return N.length && (
|
|
812
|
+
return N.length && (L.severities = N), m.length && (L.scheduleTypes = m), L;
|
|
813
813
|
},
|
|
814
814
|
async updateRule(r, n) {
|
|
815
815
|
const a = `${s}/${r}`;
|
|
816
|
-
return
|
|
816
|
+
return Ue(a, {
|
|
817
817
|
method: "PUT",
|
|
818
818
|
headers: t,
|
|
819
819
|
body: JSON.stringify(n ?? {})
|
|
@@ -821,15 +821,15 @@ function yr(e) {
|
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
823
|
}
|
|
824
|
-
const
|
|
825
|
-
function
|
|
824
|
+
const ps = Us(null);
|
|
825
|
+
function vr({
|
|
826
826
|
tenant: e = "snl",
|
|
827
827
|
override: t,
|
|
828
828
|
children: s
|
|
829
829
|
}) {
|
|
830
830
|
const r = ue(() => {
|
|
831
|
-
const a = t?.alertsBaseUrl?.trim() ||
|
|
832
|
-
let o = t?.rulesBaseUrl?.trim() ||
|
|
831
|
+
const a = t?.alertsBaseUrl?.trim() || Ht[e]?.alerts || "";
|
|
832
|
+
let o = t?.rulesBaseUrl?.trim() || Ht[e]?.rules || "";
|
|
833
833
|
e === "snl" && (o = a);
|
|
834
834
|
const l = t?.headers;
|
|
835
835
|
return { tenant: e, alertsBaseUrl: a, rulesBaseUrl: o, headers: l };
|
|
@@ -839,30 +839,30 @@ function gr({
|
|
|
839
839
|
t?.rulesBaseUrl,
|
|
840
840
|
JSON.stringify(t?.headers || {})
|
|
841
841
|
]), n = ue(() => {
|
|
842
|
-
const a = r.tenant === "schools" ?
|
|
842
|
+
const a = r.tenant === "schools" ? pr({ baseUrl: r.alertsBaseUrl, headers: r.headers }) : ar({ baseUrl: r.alertsBaseUrl, headers: r.headers }), o = r.tenant === "schools" ? gr({ baseUrl: r.rulesBaseUrl, headers: r.headers }) : lr({ baseUrl: r.alertsBaseUrl, headers: r.headers });
|
|
843
843
|
return { config: r, alerts: a, rules: o };
|
|
844
844
|
}, [r]);
|
|
845
|
-
return /* @__PURE__ */ i(
|
|
845
|
+
return /* @__PURE__ */ i(ps.Provider, { value: n, children: s });
|
|
846
846
|
}
|
|
847
|
-
function
|
|
848
|
-
const e =
|
|
847
|
+
function Re() {
|
|
848
|
+
const e = Fs(ps);
|
|
849
849
|
if (!e) throw new Error("useApi must be used inside ApiProvider");
|
|
850
850
|
return e;
|
|
851
851
|
}
|
|
852
|
-
const
|
|
852
|
+
const br = {
|
|
853
853
|
Critical: "#FFE2E2",
|
|
854
854
|
High: "#FF95004D",
|
|
855
855
|
Medium: "#FEF9C2",
|
|
856
856
|
Low: "#E0EDFF"
|
|
857
|
-
},
|
|
857
|
+
}, Ar = {
|
|
858
858
|
Critical: "#FF3B30",
|
|
859
859
|
High: "#FFB86A",
|
|
860
860
|
Medium: "#FFCC00",
|
|
861
861
|
Low: "#007AFF"
|
|
862
|
-
},
|
|
863
|
-
function
|
|
864
|
-
const r = e ===
|
|
865
|
-
return { isDisabled: l, buttonText:
|
|
862
|
+
}, Rt = 6, kt = 7;
|
|
863
|
+
function zt(e, t, s) {
|
|
864
|
+
const r = e === Rt, n = e === kt, a = t.isEmailSent ?? !1, o = t.isSMSSent ?? !1, l = r && a || n && o, h = r ? "Send Email" : n ? "Send SMS" : s, d = r && a ? "Email sent" : n && o ? "SMS sent" : h, c = r && a ? "Email sent" : n && o ? "SMS sent" : `Click to ${h}`;
|
|
865
|
+
return { isDisabled: l, buttonText: d, tooltipTitle: c };
|
|
866
866
|
}
|
|
867
867
|
function Sr(e) {
|
|
868
868
|
const t = /* @__PURE__ */ new Set();
|
|
@@ -882,15 +882,15 @@ function wr(e) {
|
|
|
882
882
|
const s = Array.from(t).map((r) => ({ label: r, value: r }));
|
|
883
883
|
return [{ label: "All", value: "All" }, ...s];
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function mt(e, t) {
|
|
886
886
|
return `${e}-${t ? "email" : "sms"}`;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
return e ===
|
|
888
|
+
function et(e) {
|
|
889
|
+
return e === Rt || e === kt;
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function ot({ value: e, onChange: t, options: s, className: r, dropdownWidth: n }) {
|
|
892
892
|
return /* @__PURE__ */ i(
|
|
893
|
-
|
|
893
|
+
Ae,
|
|
894
894
|
{
|
|
895
895
|
className: r,
|
|
896
896
|
options: s,
|
|
@@ -908,7 +908,7 @@ const Nr = [
|
|
|
908
908
|
{ label: "Low", value: "Low" }
|
|
909
909
|
];
|
|
910
910
|
function xr({ value: e, onChange: t, options: s }) {
|
|
911
|
-
return /* @__PURE__ */ i(
|
|
911
|
+
return /* @__PURE__ */ i(ot, { className: "w-[140px]", value: e, onChange: t, options: s || Nr });
|
|
912
912
|
}
|
|
913
913
|
const Cr = [
|
|
914
914
|
{ label: "All Types", value: "All" },
|
|
@@ -917,10 +917,10 @@ const Cr = [
|
|
|
917
917
|
{ label: "Aggressive Behavior", value: "Aggressive" }
|
|
918
918
|
];
|
|
919
919
|
function Tr({ value: e, onChange: t, options: s }) {
|
|
920
|
-
return /* @__PURE__ */ i(
|
|
920
|
+
return /* @__PURE__ */ i(ot, { className: "w-[220px]", dropdownWidth: 280, value: e, onChange: t, options: s || Cr });
|
|
921
921
|
}
|
|
922
922
|
function Ir({ value: e, onChange: t, options: s }) {
|
|
923
|
-
return /* @__PURE__ */ i(
|
|
923
|
+
return /* @__PURE__ */ i(ot, { className: "w-[100px]", value: e, onChange: t, options: s || [] });
|
|
924
924
|
}
|
|
925
925
|
const Rr = [
|
|
926
926
|
{ label: "All", value: "All" },
|
|
@@ -931,7 +931,7 @@ const Rr = [
|
|
|
931
931
|
{ label: "Skydio", value: "Skydio" }
|
|
932
932
|
];
|
|
933
933
|
function kr({ value: e, onChange: t, options: s }) {
|
|
934
|
-
return /* @__PURE__ */ i(
|
|
934
|
+
return /* @__PURE__ */ i(ot, { className: "w-[130px]", value: e, onChange: t, options: s || Rr });
|
|
935
935
|
}
|
|
936
936
|
function Er({
|
|
937
937
|
columns: e,
|
|
@@ -942,10 +942,10 @@ function Er({
|
|
|
942
942
|
toolbar: a,
|
|
943
943
|
tableProps: o
|
|
944
944
|
}) {
|
|
945
|
-
return /* @__PURE__ */
|
|
945
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
946
946
|
a,
|
|
947
947
|
/* @__PURE__ */ i(
|
|
948
|
-
|
|
948
|
+
Ct,
|
|
949
949
|
{
|
|
950
950
|
rowKey: n,
|
|
951
951
|
dataSource: t,
|
|
@@ -962,20 +962,20 @@ function Er({
|
|
|
962
962
|
)
|
|
963
963
|
] });
|
|
964
964
|
}
|
|
965
|
-
function
|
|
966
|
-
const [c, S] = w("All"), [f, R] = w("All"), [N, m] = w("All"), [A,
|
|
967
|
-
6: { title: "Email", kind: "icon", icon: /* @__PURE__ */ i(
|
|
968
|
-
7: { title: "SMS", kind: "icon", icon: /* @__PURE__ */ i(
|
|
965
|
+
function ys({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOptions: n, spaceOptions: a, renderActions: o, onAlertIdClick: l, onRefetch: h, excludeCompleted: d = !0 }) {
|
|
966
|
+
const [c, S] = w("All"), [f, R] = w("All"), [N, m] = w("All"), [A, B] = w("All"), [U, L] = w(""), [O, Z] = w([{ label: "All", value: "All" }]), [H, K] = w(/* @__PURE__ */ new Set()), { rules: z, alerts: I } = Re(), T = {
|
|
967
|
+
6: { title: "Email", kind: "icon", icon: /* @__PURE__ */ i(Gs, {}) },
|
|
968
|
+
7: { title: "SMS", kind: "icon", icon: /* @__PURE__ */ i(Hs, {}) }
|
|
969
969
|
}, k = ue(() => Sr(e), [e]), Y = ue(() => wr(e), [e]);
|
|
970
970
|
de(() => {
|
|
971
971
|
let b = !0;
|
|
972
972
|
return (async () => {
|
|
973
973
|
try {
|
|
974
|
-
const g = await z.getLookups(),
|
|
975
|
-
label:
|
|
976
|
-
value: String(
|
|
974
|
+
const g = await z.getLookups(), F = (Array.isArray(g.thirdParties) ? g.thirdParties : []).map(($) => ({
|
|
975
|
+
label: $.thirdPartyName,
|
|
976
|
+
value: String($.thirdPartyId)
|
|
977
977
|
}));
|
|
978
|
-
b && Z([{ label: "All", value: "All" }, ...
|
|
978
|
+
b && Z([{ label: "All", value: "All" }, ...F]);
|
|
979
979
|
} catch (g) {
|
|
980
980
|
console.error("Error loading third party options", g);
|
|
981
981
|
}
|
|
@@ -983,19 +983,19 @@ function ms({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
|
|
|
983
983
|
b = !1;
|
|
984
984
|
};
|
|
985
985
|
}, [z]);
|
|
986
|
-
const
|
|
987
|
-
() => (e || []).some((b) =>
|
|
986
|
+
const ee = ue(
|
|
987
|
+
() => (e || []).some((b) => Qt(b).length > 0),
|
|
988
988
|
[e]
|
|
989
989
|
), E = ue(() => (e || []).filter((b) => {
|
|
990
|
-
const g = c === "All" || b.priority === c,
|
|
991
|
-
return g &&
|
|
992
|
-
}), [e, c,
|
|
990
|
+
const g = c === "All" || b.priority === c, M = `${b.id} ${b.description} ${b.statusType}`.toLowerCase(), F = !U || M.includes(U.toLowerCase()), $ = f === "All" || (b.anomalyName || "").toLowerCase() === f.toLowerCase(), j = N === "All" || (b.spaceName || "").toLowerCase() === N.toLowerCase(), q = !ee || A === "All" || Qt(b).includes(Number(A)), re = !d || !["completed", "false positive"].includes(String(b.statusType || "").toLowerCase());
|
|
991
|
+
return g && F && $ && j && q && re;
|
|
992
|
+
}), [e, c, U, f, N, A, ee, d]), v = k, p = a && a.length ? a : Y, x = [
|
|
993
993
|
{
|
|
994
994
|
title: "Severity",
|
|
995
995
|
dataIndex: "priority",
|
|
996
996
|
key: "priority",
|
|
997
997
|
width: 120,
|
|
998
|
-
render: (b) => /* @__PURE__ */ i(
|
|
998
|
+
render: (b) => /* @__PURE__ */ i(Ke, { className: "px-[10px] py-[2px]", style: { border: `2px solid ${Ar[b]}`, backgroundColor: br[b] }, children: b })
|
|
999
999
|
},
|
|
1000
1000
|
{
|
|
1001
1001
|
title: "Tracker",
|
|
@@ -1004,8 +1004,8 @@ function ms({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
|
|
|
1004
1004
|
render: (b, g) => /* @__PURE__ */ i(
|
|
1005
1005
|
"a",
|
|
1006
1006
|
{
|
|
1007
|
-
onClick: (
|
|
1008
|
-
|
|
1007
|
+
onClick: (M) => {
|
|
1008
|
+
M.preventDefault(), l?.(g, { tab: "track", sourceTab: "active" });
|
|
1009
1009
|
},
|
|
1010
1010
|
className: "text-blue-600 hover:underline",
|
|
1011
1011
|
children: "Tracker"
|
|
@@ -1017,44 +1017,50 @@ function ms({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
|
|
|
1017
1017
|
key: "actions",
|
|
1018
1018
|
width: 320,
|
|
1019
1019
|
render: (b, g) => {
|
|
1020
|
-
if (o) return /* @__PURE__ */ i(
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
const q = Wt(g.id, M);
|
|
1025
|
-
K((V) => new Set(V).add(q));
|
|
1020
|
+
if (o) return /* @__PURE__ */ i(Ds, { children: o(g) });
|
|
1021
|
+
const M = async (xe, be) => {
|
|
1022
|
+
const qe = mt(g.id, xe);
|
|
1023
|
+
K((he) => new Set(he).add(qe));
|
|
1026
1024
|
try {
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1029
|
-
} catch (
|
|
1030
|
-
|
|
1025
|
+
const he = await I.sendSMSorEmailNotifications?.(g.id, xe, be);
|
|
1026
|
+
he?.responseStatus ? (ve.success(he.data || (xe ? "Email sent successfully" : "SMS sent successfully")), h?.()) : ve.error(he?.data || he?.errorMessage || "Failed to send notification");
|
|
1027
|
+
} catch (he) {
|
|
1028
|
+
ve.error(he?.message || "Failed to send notification");
|
|
1031
1029
|
} finally {
|
|
1032
|
-
K((
|
|
1033
|
-
const
|
|
1034
|
-
return
|
|
1030
|
+
K((he) => {
|
|
1031
|
+
const Ee = new Set(he);
|
|
1032
|
+
return Ee.delete(qe), Ee;
|
|
1035
1033
|
});
|
|
1036
1034
|
}
|
|
1037
|
-
};
|
|
1038
|
-
return /* @__PURE__ */
|
|
1039
|
-
|
|
1040
|
-
if (!U) return null;
|
|
1041
|
-
const q = M === It, V = M === Rt, { isDisabled: ne, buttonText: oe, tooltipTitle: me } = Ar(M, g, U?.title), re = Wt(g.id, q), le = Kt(M) && W.has(re), Re = () => {
|
|
1042
|
-
B(q, V);
|
|
1043
|
-
};
|
|
1044
|
-
return /* @__PURE__ */ i(Ls, { title: me, children: /* @__PURE__ */ i(
|
|
1035
|
+
}, F = Rt, $ = kt, j = T[F], q = T[$], re = zt(F, g, j?.title), ae = zt($, g, q?.title), oe = mt(g.id, !0), pe = mt(g.id, !1), te = et(F) && H.has(oe), le = et($) && H.has(pe);
|
|
1036
|
+
return /* @__PURE__ */ u(ke, { size: "middle", children: [
|
|
1037
|
+
/* @__PURE__ */ i(Bt, { title: re.tooltipTitle, children: /* @__PURE__ */ i(
|
|
1045
1038
|
Se,
|
|
1046
1039
|
{
|
|
1047
1040
|
size: "small",
|
|
1048
|
-
disabled:
|
|
1041
|
+
disabled: re.isDisabled,
|
|
1042
|
+
loading: te,
|
|
1043
|
+
onClick: et(F) ? () => M(!0, !1) : void 0,
|
|
1044
|
+
icon: !te && j?.icon,
|
|
1045
|
+
className: "flex flex-col items-center justify-center gap-1",
|
|
1046
|
+
style: { height: "fit-content" },
|
|
1047
|
+
children: re.buttonText
|
|
1048
|
+
}
|
|
1049
|
+
) }, String(F)),
|
|
1050
|
+
/* @__PURE__ */ i(Bt, { title: ae.tooltipTitle, children: /* @__PURE__ */ i(
|
|
1051
|
+
Se,
|
|
1052
|
+
{
|
|
1053
|
+
size: "small",
|
|
1054
|
+
disabled: ae.isDisabled,
|
|
1049
1055
|
loading: le,
|
|
1050
|
-
onClick:
|
|
1051
|
-
icon: !le &&
|
|
1056
|
+
onClick: et($) ? () => M(!1, !0) : void 0,
|
|
1057
|
+
icon: !le && q?.icon,
|
|
1052
1058
|
className: "flex flex-col items-center justify-center gap-1",
|
|
1053
1059
|
style: { height: "fit-content" },
|
|
1054
|
-
children:
|
|
1060
|
+
children: ae.buttonText
|
|
1055
1061
|
}
|
|
1056
|
-
) },
|
|
1057
|
-
|
|
1062
|
+
) }, String($))
|
|
1063
|
+
] });
|
|
1058
1064
|
}
|
|
1059
1065
|
},
|
|
1060
1066
|
{
|
|
@@ -1063,16 +1069,16 @@ function ms({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
|
|
|
1063
1069
|
key: "timestamp",
|
|
1064
1070
|
width: 220,
|
|
1065
1071
|
render: (b, g) => {
|
|
1066
|
-
const
|
|
1067
|
-
return /* @__PURE__ */
|
|
1068
|
-
/* @__PURE__ */
|
|
1072
|
+
const M = g?.timeElapsed, F = g?.timeRemaining, $ = M ? _t(M) : 0, j = F ? _t(F) : 0, q = Math.round($ / ($ + j) * 100);
|
|
1073
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
1074
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
1069
1075
|
/* @__PURE__ */ i("span", { className: "w-[70px]", children: "Elapsed:" }),
|
|
1070
|
-
/* @__PURE__ */ i("span", { className: "font-medium", children:
|
|
1076
|
+
/* @__PURE__ */ i("span", { className: "font-medium", children: M ?? "-" })
|
|
1071
1077
|
] }),
|
|
1072
|
-
/* @__PURE__ */ i(
|
|
1073
|
-
/* @__PURE__ */
|
|
1078
|
+
/* @__PURE__ */ i(Bs, { percent: q, showInfo: !1, size: "small", strokeColor: tr(g.priority) }),
|
|
1079
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
1074
1080
|
/* @__PURE__ */ i("span", { className: "w-[70px]", children: "Remaining" }),
|
|
1075
|
-
/* @__PURE__ */ i("span", { className: "font-medium", children:
|
|
1081
|
+
/* @__PURE__ */ i("span", { className: "font-medium", children: F ?? "-" })
|
|
1076
1082
|
] })
|
|
1077
1083
|
] });
|
|
1078
1084
|
}
|
|
@@ -1087,12 +1093,12 @@ function ms({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
|
|
|
1087
1093
|
title: "Description",
|
|
1088
1094
|
dataIndex: "description",
|
|
1089
1095
|
key: "description",
|
|
1090
|
-
render: (b, g) => /* @__PURE__ */
|
|
1096
|
+
render: (b, g) => /* @__PURE__ */ u("div", { children: [
|
|
1091
1097
|
/* @__PURE__ */ i(
|
|
1092
1098
|
"a",
|
|
1093
1099
|
{
|
|
1094
|
-
onClick: (
|
|
1095
|
-
|
|
1100
|
+
onClick: (M) => {
|
|
1101
|
+
M.preventDefault(), l?.(g, { sourceTab: "active" });
|
|
1096
1102
|
},
|
|
1097
1103
|
className: "inline-block mb-1 text-blue-600",
|
|
1098
1104
|
children: g.alertNumber
|
|
@@ -1110,31 +1116,31 @@ function ms({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
|
|
|
1110
1116
|
columns: y,
|
|
1111
1117
|
loading: t,
|
|
1112
1118
|
pageSize: s,
|
|
1113
|
-
toolbar: /* @__PURE__ */
|
|
1114
|
-
/* @__PURE__ */ i(
|
|
1119
|
+
toolbar: /* @__PURE__ */ u(Ne, { gutter: [12, 12], className: "mb-3", align: "middle", children: [
|
|
1120
|
+
/* @__PURE__ */ i(W, { flex: "none", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
1115
1121
|
/* @__PURE__ */ i("span", { children: "Severity" }),
|
|
1116
1122
|
/* @__PURE__ */ i(xr, { value: c, onChange: S, options: n })
|
|
1117
1123
|
] }) }),
|
|
1118
|
-
/* @__PURE__ */ i(
|
|
1124
|
+
/* @__PURE__ */ i(W, { flex: "none", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
1119
1125
|
/* @__PURE__ */ i("span", { children: "Anomaly type" }),
|
|
1120
1126
|
/* @__PURE__ */ i(Tr, { value: f, onChange: R, options: v })
|
|
1121
1127
|
] }) }),
|
|
1122
|
-
/* @__PURE__ */ i(
|
|
1128
|
+
/* @__PURE__ */ i(W, { flex: "none", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
1123
1129
|
/* @__PURE__ */ i("span", { children: "Space" }),
|
|
1124
1130
|
/* @__PURE__ */ i(Ir, { value: N, onChange: m, options: p })
|
|
1125
1131
|
] }) }),
|
|
1126
|
-
/* @__PURE__ */ i(
|
|
1132
|
+
/* @__PURE__ */ i(W, { flex: "none", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
1127
1133
|
/* @__PURE__ */ i("span", { children: "Action Taken" }),
|
|
1128
|
-
/* @__PURE__ */ i(kr, { value: A, onChange:
|
|
1134
|
+
/* @__PURE__ */ i(kr, { value: A, onChange: B, options: O })
|
|
1129
1135
|
] }) }),
|
|
1130
|
-
/* @__PURE__ */ i(
|
|
1131
|
-
/* @__PURE__ */ i(
|
|
1132
|
-
|
|
1136
|
+
/* @__PURE__ */ i(W, { flex: "auto" }),
|
|
1137
|
+
/* @__PURE__ */ i(W, { flex: "none", children: /* @__PURE__ */ i(
|
|
1138
|
+
$s.Search,
|
|
1133
1139
|
{
|
|
1134
1140
|
allowClear: !0,
|
|
1135
1141
|
placeholder: "Search",
|
|
1136
|
-
onSearch:
|
|
1137
|
-
onChange: (b) =>
|
|
1142
|
+
onSearch: L,
|
|
1143
|
+
onChange: (b) => L(b.target.value),
|
|
1138
1144
|
className: "w-[260px] ",
|
|
1139
1145
|
enterButton: !0
|
|
1140
1146
|
}
|
|
@@ -1143,7 +1149,7 @@ function ms({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
|
|
|
1143
1149
|
}
|
|
1144
1150
|
) });
|
|
1145
1151
|
}
|
|
1146
|
-
var
|
|
1152
|
+
var He = class {
|
|
1147
1153
|
constructor() {
|
|
1148
1154
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
1149
1155
|
}
|
|
@@ -1174,7 +1180,7 @@ var Qe = class {
|
|
|
1174
1180
|
clearTimeout: (e) => clearTimeout(e),
|
|
1175
1181
|
setInterval: (e, t) => setInterval(e, t),
|
|
1176
1182
|
clearInterval: (e) => clearInterval(e)
|
|
1177
|
-
},
|
|
1183
|
+
}, Mr = class {
|
|
1178
1184
|
// We cannot have TimeoutManager<T> as we must instantiate it with a concrete
|
|
1179
1185
|
// type at app boot; and if we leave that type, then any new timer provider
|
|
1180
1186
|
// would need to support ReturnType<typeof setTimeout>, which is infeasible.
|
|
@@ -1201,29 +1207,29 @@ var Qe = class {
|
|
|
1201
1207
|
clearInterval(e) {
|
|
1202
1208
|
this.#e.clearInterval(e);
|
|
1203
1209
|
}
|
|
1204
|
-
},
|
|
1205
|
-
function
|
|
1210
|
+
}, $e = new Mr();
|
|
1211
|
+
function Pr(e) {
|
|
1206
1212
|
setTimeout(e, 0);
|
|
1207
1213
|
}
|
|
1208
|
-
var
|
|
1209
|
-
function
|
|
1214
|
+
var Be = typeof window > "u" || "Deno" in globalThis;
|
|
1215
|
+
function ge() {
|
|
1210
1216
|
}
|
|
1211
1217
|
function Dr(e, t) {
|
|
1212
1218
|
return typeof e == "function" ? e(t) : e;
|
|
1213
1219
|
}
|
|
1214
|
-
function
|
|
1220
|
+
function gt(e) {
|
|
1215
1221
|
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
1216
1222
|
}
|
|
1217
|
-
function
|
|
1223
|
+
function gs(e, t) {
|
|
1218
1224
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
1219
1225
|
}
|
|
1220
|
-
function
|
|
1226
|
+
function Le(e, t) {
|
|
1221
1227
|
return typeof e == "function" ? e(t) : e;
|
|
1222
1228
|
}
|
|
1223
|
-
function
|
|
1229
|
+
function Ie(e, t) {
|
|
1224
1230
|
return typeof e == "function" ? e(t) : e;
|
|
1225
1231
|
}
|
|
1226
|
-
function
|
|
1232
|
+
function Zt(e, t) {
|
|
1227
1233
|
const {
|
|
1228
1234
|
type: s = "all",
|
|
1229
1235
|
exact: r,
|
|
@@ -1234,9 +1240,9 @@ function Yt(e, t) {
|
|
|
1234
1240
|
} = e;
|
|
1235
1241
|
if (o) {
|
|
1236
1242
|
if (r) {
|
|
1237
|
-
if (t.queryHash !==
|
|
1243
|
+
if (t.queryHash !== Et(o, t.options))
|
|
1238
1244
|
return !1;
|
|
1239
|
-
} else if (!
|
|
1245
|
+
} else if (!Ye(t.queryKey, o))
|
|
1240
1246
|
return !1;
|
|
1241
1247
|
}
|
|
1242
1248
|
if (s !== "all") {
|
|
@@ -1246,56 +1252,56 @@ function Yt(e, t) {
|
|
|
1246
1252
|
}
|
|
1247
1253
|
return !(typeof l == "boolean" && t.isStale() !== l || n && n !== t.state.fetchStatus || a && !a(t));
|
|
1248
1254
|
}
|
|
1249
|
-
function
|
|
1255
|
+
function Vt(e, t) {
|
|
1250
1256
|
const { exact: s, status: r, predicate: n, mutationKey: a } = e;
|
|
1251
1257
|
if (a) {
|
|
1252
1258
|
if (!t.options.mutationKey)
|
|
1253
1259
|
return !1;
|
|
1254
1260
|
if (s) {
|
|
1255
|
-
if (
|
|
1261
|
+
if (je(t.options.mutationKey) !== je(a))
|
|
1256
1262
|
return !1;
|
|
1257
|
-
} else if (!
|
|
1263
|
+
} else if (!Ye(t.options.mutationKey, a))
|
|
1258
1264
|
return !1;
|
|
1259
1265
|
}
|
|
1260
1266
|
return !(r && t.state.status !== r || n && !n(t));
|
|
1261
1267
|
}
|
|
1262
|
-
function
|
|
1263
|
-
return (t?.queryKeyHashFn ||
|
|
1268
|
+
function Et(e, t) {
|
|
1269
|
+
return (t?.queryKeyHashFn || je)(e);
|
|
1264
1270
|
}
|
|
1265
|
-
function
|
|
1271
|
+
function je(e) {
|
|
1266
1272
|
return JSON.stringify(
|
|
1267
1273
|
e,
|
|
1268
|
-
(t, s) =>
|
|
1274
|
+
(t, s) => bt(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
|
|
1269
1275
|
);
|
|
1270
1276
|
}
|
|
1271
|
-
function
|
|
1272
|
-
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) =>
|
|
1277
|
+
function Ye(e, t) {
|
|
1278
|
+
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => Ye(e[s], t[s])) : !1;
|
|
1273
1279
|
}
|
|
1274
1280
|
var Fr = Object.prototype.hasOwnProperty;
|
|
1275
|
-
function
|
|
1281
|
+
function vt(e, t, s = 0) {
|
|
1276
1282
|
if (e === t)
|
|
1277
1283
|
return e;
|
|
1278
1284
|
if (s > 500) return t;
|
|
1279
|
-
const r =
|
|
1280
|
-
if (!r && !(
|
|
1285
|
+
const r = Jt(e) && Jt(t);
|
|
1286
|
+
if (!r && !(bt(e) && bt(t))) return t;
|
|
1281
1287
|
const a = (r ? e : Object.keys(e)).length, o = r ? t : Object.keys(t), l = o.length, h = r ? new Array(l) : {};
|
|
1282
|
-
let
|
|
1288
|
+
let d = 0;
|
|
1283
1289
|
for (let c = 0; c < l; c++) {
|
|
1284
1290
|
const S = r ? c : o[c], f = e[S], R = t[S];
|
|
1285
1291
|
if (f === R) {
|
|
1286
|
-
h[S] = f, (r ? c < a : Fr.call(e, S)) &&
|
|
1292
|
+
h[S] = f, (r ? c < a : Fr.call(e, S)) && d++;
|
|
1287
1293
|
continue;
|
|
1288
1294
|
}
|
|
1289
1295
|
if (f === null || R === null || typeof f != "object" || typeof R != "object") {
|
|
1290
1296
|
h[S] = R;
|
|
1291
1297
|
continue;
|
|
1292
1298
|
}
|
|
1293
|
-
const N =
|
|
1294
|
-
h[S] = N, N === f &&
|
|
1299
|
+
const N = vt(f, R, s + 1);
|
|
1300
|
+
h[S] = N, N === f && d++;
|
|
1295
1301
|
}
|
|
1296
|
-
return a === l &&
|
|
1302
|
+
return a === l && d === a ? e : h;
|
|
1297
1303
|
}
|
|
1298
|
-
function
|
|
1304
|
+
function nt(e, t) {
|
|
1299
1305
|
if (!t || Object.keys(e).length !== Object.keys(t).length)
|
|
1300
1306
|
return !1;
|
|
1301
1307
|
for (const s in e)
|
|
@@ -1303,39 +1309,39 @@ function st(e, t) {
|
|
|
1303
1309
|
return !1;
|
|
1304
1310
|
return !0;
|
|
1305
1311
|
}
|
|
1306
|
-
function
|
|
1312
|
+
function Jt(e) {
|
|
1307
1313
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
1308
1314
|
}
|
|
1309
|
-
function
|
|
1310
|
-
if (!
|
|
1315
|
+
function bt(e) {
|
|
1316
|
+
if (!Xt(e))
|
|
1311
1317
|
return !1;
|
|
1312
1318
|
const t = e.constructor;
|
|
1313
1319
|
if (t === void 0)
|
|
1314
1320
|
return !0;
|
|
1315
1321
|
const s = t.prototype;
|
|
1316
|
-
return !(!
|
|
1322
|
+
return !(!Xt(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
1317
1323
|
}
|
|
1318
|
-
function
|
|
1324
|
+
function Xt(e) {
|
|
1319
1325
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
1320
1326
|
}
|
|
1321
1327
|
function Ur(e) {
|
|
1322
1328
|
return new Promise((t) => {
|
|
1323
|
-
|
|
1329
|
+
$e.setTimeout(t, e);
|
|
1324
1330
|
});
|
|
1325
1331
|
}
|
|
1326
|
-
function
|
|
1332
|
+
function At(e, t, s) {
|
|
1327
1333
|
if (typeof s.structuralSharing == "function")
|
|
1328
1334
|
return s.structuralSharing(e, t);
|
|
1329
1335
|
if (s.structuralSharing !== !1) {
|
|
1330
1336
|
if (process.env.NODE_ENV !== "production")
|
|
1331
1337
|
try {
|
|
1332
|
-
return
|
|
1338
|
+
return vt(e, t);
|
|
1333
1339
|
} catch (r) {
|
|
1334
1340
|
throw console.error(
|
|
1335
1341
|
`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}`
|
|
1336
1342
|
), r;
|
|
1337
1343
|
}
|
|
1338
|
-
return
|
|
1344
|
+
return vt(e, t);
|
|
1339
1345
|
}
|
|
1340
1346
|
return t;
|
|
1341
1347
|
}
|
|
@@ -1347,13 +1353,13 @@ function $r(e, t, s = 0) {
|
|
|
1347
1353
|
const r = [t, ...e];
|
|
1348
1354
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
1349
1355
|
}
|
|
1350
|
-
var
|
|
1351
|
-
function
|
|
1352
|
-
return process.env.NODE_ENV !== "production" && e.queryFn ===
|
|
1356
|
+
var it = /* @__PURE__ */ Symbol();
|
|
1357
|
+
function vs(e, t) {
|
|
1358
|
+
return process.env.NODE_ENV !== "production" && e.queryFn === it && console.error(
|
|
1353
1359
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
|
|
1354
|
-
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn ===
|
|
1360
|
+
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === it ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
1355
1361
|
}
|
|
1356
|
-
function
|
|
1362
|
+
function Ot(e, t) {
|
|
1357
1363
|
return typeof e == "function" ? e(...t) : !!e;
|
|
1358
1364
|
}
|
|
1359
1365
|
function Br(e, t, s) {
|
|
@@ -1363,13 +1369,13 @@ function Br(e, t, s) {
|
|
|
1363
1369
|
get: () => (n ??= t(), r || (r = !0, n.aborted ? s() : n.addEventListener("abort", s, { once: !0 })), n)
|
|
1364
1370
|
}), e;
|
|
1365
1371
|
}
|
|
1366
|
-
var jr = class extends
|
|
1372
|
+
var jr = class extends He {
|
|
1367
1373
|
#e;
|
|
1368
1374
|
#t;
|
|
1369
1375
|
#s;
|
|
1370
1376
|
constructor() {
|
|
1371
1377
|
super(), this.#s = (e) => {
|
|
1372
|
-
if (
|
|
1378
|
+
if (!Be && window.addEventListener) {
|
|
1373
1379
|
const t = () => e();
|
|
1374
1380
|
return window.addEventListener("visibilitychange", t, !1), () => {
|
|
1375
1381
|
window.removeEventListener("visibilitychange", t);
|
|
@@ -1400,8 +1406,8 @@ var jr = class extends Qe {
|
|
|
1400
1406
|
isFocused() {
|
|
1401
1407
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
1402
1408
|
}
|
|
1403
|
-
},
|
|
1404
|
-
function
|
|
1409
|
+
}, Mt = new jr();
|
|
1410
|
+
function St() {
|
|
1405
1411
|
let e, t;
|
|
1406
1412
|
const s = new Promise((n, a) => {
|
|
1407
1413
|
e = n, t = a;
|
|
@@ -1423,7 +1429,7 @@ function At() {
|
|
|
1423
1429
|
}), t(n);
|
|
1424
1430
|
}, s;
|
|
1425
1431
|
}
|
|
1426
|
-
var qr =
|
|
1432
|
+
var qr = Pr;
|
|
1427
1433
|
function _r() {
|
|
1428
1434
|
let e = [], t = 0, s = (l) => {
|
|
1429
1435
|
l();
|
|
@@ -1483,13 +1489,13 @@ function _r() {
|
|
|
1483
1489
|
}
|
|
1484
1490
|
};
|
|
1485
1491
|
}
|
|
1486
|
-
var ce = _r(), Qr = class extends
|
|
1492
|
+
var ce = _r(), Qr = class extends He {
|
|
1487
1493
|
#e = !0;
|
|
1488
1494
|
#t;
|
|
1489
1495
|
#s;
|
|
1490
1496
|
constructor() {
|
|
1491
1497
|
super(), this.#s = (e) => {
|
|
1492
|
-
if (
|
|
1498
|
+
if (!Be && window.addEventListener) {
|
|
1493
1499
|
const t = () => e(!0), s = () => e(!1);
|
|
1494
1500
|
return window.addEventListener("online", t, !1), window.addEventListener("offline", s, !1), () => {
|
|
1495
1501
|
window.removeEventListener("online", t), window.removeEventListener("offline", s);
|
|
@@ -1514,36 +1520,36 @@ var ce = _r(), Qr = class extends Qe {
|
|
|
1514
1520
|
isOnline() {
|
|
1515
1521
|
return this.#e;
|
|
1516
1522
|
}
|
|
1517
|
-
},
|
|
1523
|
+
}, at = new Qr();
|
|
1518
1524
|
function Hr(e) {
|
|
1519
1525
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
1520
1526
|
}
|
|
1521
|
-
function
|
|
1522
|
-
return (e ?? "online") === "online" ?
|
|
1527
|
+
function bs(e) {
|
|
1528
|
+
return (e ?? "online") === "online" ? at.isOnline() : !0;
|
|
1523
1529
|
}
|
|
1524
|
-
var
|
|
1530
|
+
var wt = class extends Error {
|
|
1525
1531
|
constructor(e) {
|
|
1526
1532
|
super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
|
|
1527
1533
|
}
|
|
1528
1534
|
};
|
|
1529
|
-
function
|
|
1535
|
+
function As(e) {
|
|
1530
1536
|
let t = !1, s = 0, r;
|
|
1531
|
-
const n =
|
|
1537
|
+
const n = St(), a = () => n.status !== "pending", o = (m) => {
|
|
1532
1538
|
if (!a()) {
|
|
1533
|
-
const A = new
|
|
1539
|
+
const A = new wt(m);
|
|
1534
1540
|
f(A), e.onCancel?.(A);
|
|
1535
1541
|
}
|
|
1536
1542
|
}, l = () => {
|
|
1537
1543
|
t = !0;
|
|
1538
1544
|
}, h = () => {
|
|
1539
1545
|
t = !1;
|
|
1540
|
-
},
|
|
1546
|
+
}, d = () => Mt.isFocused() && (e.networkMode === "always" || at.isOnline()) && e.canRun(), c = () => bs(e.networkMode) && e.canRun(), S = (m) => {
|
|
1541
1547
|
a() || (r?.(), n.resolve(m));
|
|
1542
1548
|
}, f = (m) => {
|
|
1543
1549
|
a() || (r?.(), n.reject(m));
|
|
1544
1550
|
}, R = () => new Promise((m) => {
|
|
1545
1551
|
r = (A) => {
|
|
1546
|
-
(a() ||
|
|
1552
|
+
(a() || d()) && m(A);
|
|
1547
1553
|
}, e.onPause?.();
|
|
1548
1554
|
}).then(() => {
|
|
1549
1555
|
r = void 0, a() || e.onContinue?.();
|
|
@@ -1554,19 +1560,19 @@ function vs(e) {
|
|
|
1554
1560
|
const A = s === 0 ? e.initialPromise : void 0;
|
|
1555
1561
|
try {
|
|
1556
1562
|
m = A ?? e.fn();
|
|
1557
|
-
} catch (
|
|
1558
|
-
m = Promise.reject(
|
|
1563
|
+
} catch (B) {
|
|
1564
|
+
m = Promise.reject(B);
|
|
1559
1565
|
}
|
|
1560
|
-
Promise.resolve(m).then(S).catch((
|
|
1566
|
+
Promise.resolve(m).then(S).catch((B) => {
|
|
1561
1567
|
if (a())
|
|
1562
1568
|
return;
|
|
1563
|
-
const
|
|
1569
|
+
const U = e.retry ?? (Be ? 0 : 3), L = e.retryDelay ?? Hr, O = typeof L == "function" ? L(s, B) : L, Z = U === !0 || typeof U == "number" && s < U || typeof U == "function" && U(s, B);
|
|
1564
1570
|
if (t || !Z) {
|
|
1565
|
-
f(
|
|
1571
|
+
f(B);
|
|
1566
1572
|
return;
|
|
1567
1573
|
}
|
|
1568
|
-
s++, e.onFail?.(s,
|
|
1569
|
-
t ? f(
|
|
1574
|
+
s++, e.onFail?.(s, B), Ur(O).then(() => d() ? void 0 : R()).then(() => {
|
|
1575
|
+
t ? f(B) : N();
|
|
1570
1576
|
});
|
|
1571
1577
|
});
|
|
1572
1578
|
};
|
|
@@ -1581,26 +1587,26 @@ function vs(e) {
|
|
|
1581
1587
|
start: () => (c() ? N() : R().then(N), n)
|
|
1582
1588
|
};
|
|
1583
1589
|
}
|
|
1584
|
-
var
|
|
1590
|
+
var Ss = class {
|
|
1585
1591
|
#e;
|
|
1586
1592
|
destroy() {
|
|
1587
1593
|
this.clearGcTimeout();
|
|
1588
1594
|
}
|
|
1589
1595
|
scheduleGc() {
|
|
1590
|
-
this.clearGcTimeout(),
|
|
1596
|
+
this.clearGcTimeout(), gt(this.gcTime) && (this.#e = $e.setTimeout(() => {
|
|
1591
1597
|
this.optionalRemove();
|
|
1592
1598
|
}, this.gcTime));
|
|
1593
1599
|
}
|
|
1594
1600
|
updateGcTime(e) {
|
|
1595
1601
|
this.gcTime = Math.max(
|
|
1596
1602
|
this.gcTime || 0,
|
|
1597
|
-
e ?? (
|
|
1603
|
+
e ?? (Be ? 1 / 0 : 300 * 1e3)
|
|
1598
1604
|
);
|
|
1599
1605
|
}
|
|
1600
1606
|
clearGcTimeout() {
|
|
1601
|
-
this.#e && (
|
|
1607
|
+
this.#e && ($e.clearTimeout(this.#e), this.#e = void 0);
|
|
1602
1608
|
}
|
|
1603
|
-
}, Gr = class extends
|
|
1609
|
+
}, Gr = class extends Ss {
|
|
1604
1610
|
#e;
|
|
1605
1611
|
#t;
|
|
1606
1612
|
#s;
|
|
@@ -1609,7 +1615,7 @@ var bs = class {
|
|
|
1609
1615
|
#a;
|
|
1610
1616
|
#o;
|
|
1611
1617
|
constructor(e) {
|
|
1612
|
-
super(), this.#o = !1, this.#a = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#n = e.client, this.#s = this.#n.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#e =
|
|
1618
|
+
super(), this.#o = !1, this.#a = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#n = e.client, this.#s = this.#n.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#e = ts(this.options), this.state = e.state ?? this.#e, this.scheduleGc();
|
|
1613
1619
|
}
|
|
1614
1620
|
get meta() {
|
|
1615
1621
|
return this.options.meta;
|
|
@@ -1619,9 +1625,9 @@ var bs = class {
|
|
|
1619
1625
|
}
|
|
1620
1626
|
setOptions(e) {
|
|
1621
1627
|
if (this.options = { ...this.#a, ...e }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
|
|
1622
|
-
const t =
|
|
1628
|
+
const t = ts(this.options);
|
|
1623
1629
|
t.data !== void 0 && (this.setState(
|
|
1624
|
-
|
|
1630
|
+
es(t.data, t.dataUpdatedAt)
|
|
1625
1631
|
), this.#e = t);
|
|
1626
1632
|
}
|
|
1627
1633
|
}
|
|
@@ -1629,7 +1635,7 @@ var bs = class {
|
|
|
1629
1635
|
!this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
|
|
1630
1636
|
}
|
|
1631
1637
|
setData(e, t) {
|
|
1632
|
-
const s =
|
|
1638
|
+
const s = At(this.state.data, e, this.options);
|
|
1633
1639
|
return this.#i({
|
|
1634
1640
|
data: s,
|
|
1635
1641
|
type: "success",
|
|
@@ -1642,7 +1648,7 @@ var bs = class {
|
|
|
1642
1648
|
}
|
|
1643
1649
|
cancel(e) {
|
|
1644
1650
|
const t = this.#r?.promise;
|
|
1645
|
-
return this.#r?.cancel(e), t ? t.then(
|
|
1651
|
+
return this.#r?.cancel(e), t ? t.then(ge).catch(ge) : Promise.resolve();
|
|
1646
1652
|
}
|
|
1647
1653
|
destroy() {
|
|
1648
1654
|
super.destroy(), this.cancel({ silent: !0 });
|
|
@@ -1652,15 +1658,15 @@ var bs = class {
|
|
|
1652
1658
|
}
|
|
1653
1659
|
isActive() {
|
|
1654
1660
|
return this.observers.some(
|
|
1655
|
-
(e) =>
|
|
1661
|
+
(e) => Ie(e.options.enabled, this) !== !1
|
|
1656
1662
|
);
|
|
1657
1663
|
}
|
|
1658
1664
|
isDisabled() {
|
|
1659
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
1665
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === it || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
1660
1666
|
}
|
|
1661
1667
|
isStatic() {
|
|
1662
1668
|
return this.getObserversCount() > 0 ? this.observers.some(
|
|
1663
|
-
(e) =>
|
|
1669
|
+
(e) => Le(e.options.staleTime, this) === "static"
|
|
1664
1670
|
) : !1;
|
|
1665
1671
|
}
|
|
1666
1672
|
isStale() {
|
|
@@ -1669,7 +1675,7 @@ var bs = class {
|
|
|
1669
1675
|
) : this.state.data === void 0 || this.state.isInvalidated;
|
|
1670
1676
|
}
|
|
1671
1677
|
isStaleByTime(e = 0) {
|
|
1672
|
-
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !
|
|
1678
|
+
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !gs(this.state.dataUpdatedAt, e);
|
|
1673
1679
|
}
|
|
1674
1680
|
onFocus() {
|
|
1675
1681
|
this.observers.find((t) => t.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
|
|
@@ -1712,7 +1718,7 @@ var bs = class {
|
|
|
1712
1718
|
get: () => (this.#o = !0, s.signal)
|
|
1713
1719
|
});
|
|
1714
1720
|
}, n = () => {
|
|
1715
|
-
const l =
|
|
1721
|
+
const l = vs(this.options, t), d = (() => {
|
|
1716
1722
|
const c = {
|
|
1717
1723
|
client: this.#n,
|
|
1718
1724
|
queryKey: this.queryKey,
|
|
@@ -1722,9 +1728,9 @@ var bs = class {
|
|
|
1722
1728
|
})();
|
|
1723
1729
|
return this.#o = !1, this.options.persister ? this.options.persister(
|
|
1724
1730
|
l,
|
|
1725
|
-
|
|
1731
|
+
d,
|
|
1726
1732
|
this
|
|
1727
|
-
) : l(
|
|
1733
|
+
) : l(d);
|
|
1728
1734
|
}, o = (() => {
|
|
1729
1735
|
const l = {
|
|
1730
1736
|
fetchOptions: t,
|
|
@@ -1736,11 +1742,11 @@ var bs = class {
|
|
|
1736
1742
|
};
|
|
1737
1743
|
return r(l), l;
|
|
1738
1744
|
})();
|
|
1739
|
-
this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#i({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r =
|
|
1745
|
+
this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#i({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r = As({
|
|
1740
1746
|
initialPromise: t?.initialPromise,
|
|
1741
1747
|
fn: o.fetchFn,
|
|
1742
1748
|
onCancel: (l) => {
|
|
1743
|
-
l instanceof
|
|
1749
|
+
l instanceof wt && l.revert && this.setState({
|
|
1744
1750
|
...this.#t,
|
|
1745
1751
|
fetchStatus: "idle"
|
|
1746
1752
|
}), s.abort();
|
|
@@ -1771,7 +1777,7 @@ var bs = class {
|
|
|
1771
1777
|
this
|
|
1772
1778
|
), l;
|
|
1773
1779
|
} catch (l) {
|
|
1774
|
-
if (l instanceof
|
|
1780
|
+
if (l instanceof wt) {
|
|
1775
1781
|
if (l.silent)
|
|
1776
1782
|
return this.#r.promise;
|
|
1777
1783
|
if (l.revert) {
|
|
@@ -1817,13 +1823,13 @@ var bs = class {
|
|
|
1817
1823
|
case "fetch":
|
|
1818
1824
|
return {
|
|
1819
1825
|
...s,
|
|
1820
|
-
...
|
|
1826
|
+
...ws(s.data, this.options),
|
|
1821
1827
|
fetchMeta: e.meta ?? null
|
|
1822
1828
|
};
|
|
1823
1829
|
case "success":
|
|
1824
1830
|
const r = {
|
|
1825
1831
|
...s,
|
|
1826
|
-
...
|
|
1832
|
+
...es(e.data, e.dataUpdatedAt),
|
|
1827
1833
|
dataUpdateCount: s.dataUpdateCount + 1,
|
|
1828
1834
|
...!e.manual && {
|
|
1829
1835
|
fetchStatus: "idle",
|
|
@@ -1866,18 +1872,18 @@ var bs = class {
|
|
|
1866
1872
|
});
|
|
1867
1873
|
}
|
|
1868
1874
|
};
|
|
1869
|
-
function
|
|
1875
|
+
function ws(e, t) {
|
|
1870
1876
|
return {
|
|
1871
1877
|
fetchFailureCount: 0,
|
|
1872
1878
|
fetchFailureReason: null,
|
|
1873
|
-
fetchStatus:
|
|
1879
|
+
fetchStatus: bs(t.networkMode) ? "fetching" : "paused",
|
|
1874
1880
|
...e === void 0 && {
|
|
1875
1881
|
error: null,
|
|
1876
1882
|
status: "pending"
|
|
1877
1883
|
}
|
|
1878
1884
|
};
|
|
1879
1885
|
}
|
|
1880
|
-
function
|
|
1886
|
+
function es(e, t) {
|
|
1881
1887
|
return {
|
|
1882
1888
|
data: e,
|
|
1883
1889
|
dataUpdatedAt: t ?? Date.now(),
|
|
@@ -1886,7 +1892,7 @@ function Jt(e, t) {
|
|
|
1886
1892
|
status: "success"
|
|
1887
1893
|
};
|
|
1888
1894
|
}
|
|
1889
|
-
function
|
|
1895
|
+
function ts(e) {
|
|
1890
1896
|
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
1891
1897
|
return {
|
|
1892
1898
|
data: t,
|
|
@@ -1903,9 +1909,9 @@ function Xt(e) {
|
|
|
1903
1909
|
fetchStatus: "idle"
|
|
1904
1910
|
};
|
|
1905
1911
|
}
|
|
1906
|
-
var Wr = class extends
|
|
1912
|
+
var Wr = class extends He {
|
|
1907
1913
|
constructor(e, t) {
|
|
1908
|
-
super(), this.options = t, this.#e = e, this.#i = null, this.#o =
|
|
1914
|
+
super(), this.options = t, this.#e = e, this.#i = null, this.#o = St(), this.bindMethods(), this.setOptions(t);
|
|
1909
1915
|
}
|
|
1910
1916
|
#e;
|
|
1911
1917
|
#t = void 0;
|
|
@@ -1928,20 +1934,20 @@ var Wr = class extends Qe {
|
|
|
1928
1934
|
this.refetch = this.refetch.bind(this);
|
|
1929
1935
|
}
|
|
1930
1936
|
onSubscribe() {
|
|
1931
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
1937
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), ss(this.#t, this.options) ? this.#d() : this.updateResult(), this.#b());
|
|
1932
1938
|
}
|
|
1933
1939
|
onUnsubscribe() {
|
|
1934
1940
|
this.hasListeners() || this.destroy();
|
|
1935
1941
|
}
|
|
1936
1942
|
shouldFetchOnReconnect() {
|
|
1937
|
-
return
|
|
1943
|
+
return Nt(
|
|
1938
1944
|
this.#t,
|
|
1939
1945
|
this.options,
|
|
1940
1946
|
this.options.refetchOnReconnect
|
|
1941
1947
|
);
|
|
1942
1948
|
}
|
|
1943
1949
|
shouldFetchOnWindowFocus() {
|
|
1944
|
-
return
|
|
1950
|
+
return Nt(
|
|
1945
1951
|
this.#t,
|
|
1946
1952
|
this.options,
|
|
1947
1953
|
this.options.refetchOnWindowFocus
|
|
@@ -1952,24 +1958,24 @@ var Wr = class extends Qe {
|
|
|
1952
1958
|
}
|
|
1953
1959
|
setOptions(e) {
|
|
1954
1960
|
const t = this.options, s = this.#t;
|
|
1955
|
-
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof
|
|
1961
|
+
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof Ie(this.options.enabled, this.#t) != "boolean")
|
|
1956
1962
|
throw new Error(
|
|
1957
1963
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
1958
1964
|
);
|
|
1959
|
-
this.#w(), this.#t.setOptions(this.options), t._defaulted && !
|
|
1965
|
+
this.#w(), this.#t.setOptions(this.options), t._defaulted && !nt(this.options, t) && this.#e.getQueryCache().notify({
|
|
1960
1966
|
type: "observerOptionsUpdated",
|
|
1961
1967
|
query: this.#t,
|
|
1962
1968
|
observer: this
|
|
1963
1969
|
});
|
|
1964
1970
|
const r = this.hasListeners();
|
|
1965
|
-
r &&
|
|
1971
|
+
r && rs(
|
|
1966
1972
|
this.#t,
|
|
1967
1973
|
s,
|
|
1968
1974
|
this.options,
|
|
1969
1975
|
t
|
|
1970
|
-
) && this.#d(), this.updateResult(), r && (this.#t !== s ||
|
|
1976
|
+
) && this.#d(), this.updateResult(), r && (this.#t !== s || Ie(this.options.enabled, this.#t) !== Ie(t.enabled, this.#t) || Le(this.options.staleTime, this.#t) !== Le(t.staleTime, this.#t)) && this.#y();
|
|
1971
1977
|
const n = this.#g();
|
|
1972
|
-
r && (this.#t !== s ||
|
|
1978
|
+
r && (this.#t !== s || Ie(this.options.enabled, this.#t) !== Ie(t.enabled, this.#t) || n !== this.#l) && this.#v(n);
|
|
1973
1979
|
}
|
|
1974
1980
|
getOptimisticResult(e) {
|
|
1975
1981
|
const t = this.#e.getQueryCache().build(this.#e, e), s = this.createResult(t, e);
|
|
@@ -2014,18 +2020,18 @@ var Wr = class extends Qe {
|
|
|
2014
2020
|
this.options,
|
|
2015
2021
|
e
|
|
2016
2022
|
);
|
|
2017
|
-
return e?.throwOnError || (t = t.catch(
|
|
2023
|
+
return e?.throwOnError || (t = t.catch(ge)), t;
|
|
2018
2024
|
}
|
|
2019
2025
|
#y() {
|
|
2020
2026
|
this.#A();
|
|
2021
|
-
const e =
|
|
2027
|
+
const e = Le(
|
|
2022
2028
|
this.options.staleTime,
|
|
2023
2029
|
this.#t
|
|
2024
2030
|
);
|
|
2025
|
-
if (
|
|
2031
|
+
if (Be || this.#n.isStale || !gt(e))
|
|
2026
2032
|
return;
|
|
2027
|
-
const s =
|
|
2028
|
-
this.#c =
|
|
2033
|
+
const s = gs(this.#n.dataUpdatedAt, e) + 1;
|
|
2034
|
+
this.#c = $e.setTimeout(() => {
|
|
2029
2035
|
this.#n.isStale || this.updateResult();
|
|
2030
2036
|
}, s);
|
|
2031
2037
|
}
|
|
@@ -2033,27 +2039,27 @@ var Wr = class extends Qe {
|
|
|
2033
2039
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
2034
2040
|
}
|
|
2035
2041
|
#v(e) {
|
|
2036
|
-
this.#S(), this.#l = e, !(
|
|
2037
|
-
(this.options.refetchIntervalInBackground ||
|
|
2042
|
+
this.#S(), this.#l = e, !(Be || Ie(this.options.enabled, this.#t) === !1 || !gt(this.#l) || this.#l === 0) && (this.#u = $e.setInterval(() => {
|
|
2043
|
+
(this.options.refetchIntervalInBackground || Mt.isFocused()) && this.#d();
|
|
2038
2044
|
}, this.#l));
|
|
2039
2045
|
}
|
|
2040
2046
|
#b() {
|
|
2041
2047
|
this.#y(), this.#v(this.#g());
|
|
2042
2048
|
}
|
|
2043
2049
|
#A() {
|
|
2044
|
-
this.#c && (
|
|
2050
|
+
this.#c && ($e.clearTimeout(this.#c), this.#c = void 0);
|
|
2045
2051
|
}
|
|
2046
2052
|
#S() {
|
|
2047
|
-
this.#u && (
|
|
2053
|
+
this.#u && ($e.clearInterval(this.#u), this.#u = void 0);
|
|
2048
2054
|
}
|
|
2049
2055
|
createResult(e, t) {
|
|
2050
|
-
const s = this.#t, r = this.options, n = this.#n, a = this.#r, o = this.#a, h = e !== s ? e.state : this.#s, { state:
|
|
2051
|
-
let c = { ...
|
|
2056
|
+
const s = this.#t, r = this.options, n = this.#n, a = this.#r, o = this.#a, h = e !== s ? e.state : this.#s, { state: d } = e;
|
|
2057
|
+
let c = { ...d }, S = !1, f;
|
|
2052
2058
|
if (t._optimisticResults) {
|
|
2053
|
-
const z = this.hasListeners(), I = !z &&
|
|
2059
|
+
const z = this.hasListeners(), I = !z && ss(e, t), T = z && rs(e, s, t, r);
|
|
2054
2060
|
(I || T) && (c = {
|
|
2055
2061
|
...c,
|
|
2056
|
-
...
|
|
2062
|
+
...ws(d.data, e.options)
|
|
2057
2063
|
}), t._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
|
|
2058
2064
|
}
|
|
2059
2065
|
let { error: R, errorUpdatedAt: N, status: m } = c;
|
|
@@ -2064,7 +2070,7 @@ var Wr = class extends Qe {
|
|
|
2064
2070
|
n?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (z = n.data, A = !0) : z = typeof t.placeholderData == "function" ? t.placeholderData(
|
|
2065
2071
|
this.#f?.state.data,
|
|
2066
2072
|
this.#f
|
|
2067
|
-
) : t.placeholderData, z !== void 0 && (m = "success", f =
|
|
2073
|
+
) : t.placeholderData, z !== void 0 && (m = "success", f = At(
|
|
2068
2074
|
n?.data,
|
|
2069
2075
|
z,
|
|
2070
2076
|
t
|
|
@@ -2075,17 +2081,17 @@ var Wr = class extends Qe {
|
|
|
2075
2081
|
f = this.#h;
|
|
2076
2082
|
else
|
|
2077
2083
|
try {
|
|
2078
|
-
this.#p = t.select, f = t.select(f), f =
|
|
2084
|
+
this.#p = t.select, f = t.select(f), f = At(n?.data, f, t), this.#h = f, this.#i = null;
|
|
2079
2085
|
} catch (z) {
|
|
2080
2086
|
this.#i = z;
|
|
2081
2087
|
}
|
|
2082
2088
|
this.#i && (R = this.#i, f = this.#h, N = Date.now(), m = "error");
|
|
2083
|
-
const
|
|
2089
|
+
const B = c.fetchStatus === "fetching", U = m === "pending", L = m === "error", O = U && B, Z = f !== void 0, K = {
|
|
2084
2090
|
status: m,
|
|
2085
2091
|
fetchStatus: c.fetchStatus,
|
|
2086
|
-
isPending:
|
|
2092
|
+
isPending: U,
|
|
2087
2093
|
isSuccess: m === "success",
|
|
2088
|
-
isError:
|
|
2094
|
+
isError: L,
|
|
2089
2095
|
isInitialLoading: O,
|
|
2090
2096
|
isLoading: O,
|
|
2091
2097
|
data: f,
|
|
@@ -2097,23 +2103,23 @@ var Wr = class extends Qe {
|
|
|
2097
2103
|
errorUpdateCount: c.errorUpdateCount,
|
|
2098
2104
|
isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
|
|
2099
2105
|
isFetchedAfterMount: c.dataUpdateCount > h.dataUpdateCount || c.errorUpdateCount > h.errorUpdateCount,
|
|
2100
|
-
isFetching:
|
|
2101
|
-
isRefetching:
|
|
2102
|
-
isLoadingError:
|
|
2106
|
+
isFetching: B,
|
|
2107
|
+
isRefetching: B && !U,
|
|
2108
|
+
isLoadingError: L && !Z,
|
|
2103
2109
|
isPaused: c.fetchStatus === "paused",
|
|
2104
2110
|
isPlaceholderData: S,
|
|
2105
|
-
isRefetchError:
|
|
2111
|
+
isRefetchError: L && Z,
|
|
2106
2112
|
isStale: Pt(e, t),
|
|
2107
2113
|
refetch: this.refetch,
|
|
2108
2114
|
promise: this.#o,
|
|
2109
|
-
isEnabled:
|
|
2115
|
+
isEnabled: Ie(t.enabled, e) !== !1
|
|
2110
2116
|
};
|
|
2111
2117
|
if (this.options.experimental_prefetchInRender) {
|
|
2112
|
-
const z = K.data !== void 0, I = K.status === "error" && !z, T = (
|
|
2113
|
-
I ?
|
|
2118
|
+
const z = K.data !== void 0, I = K.status === "error" && !z, T = (ee) => {
|
|
2119
|
+
I ? ee.reject(K.error) : z && ee.resolve(K.data);
|
|
2114
2120
|
}, k = () => {
|
|
2115
|
-
const
|
|
2116
|
-
T(
|
|
2121
|
+
const ee = this.#o = K.promise = St();
|
|
2122
|
+
T(ee);
|
|
2117
2123
|
}, Y = this.#o;
|
|
2118
2124
|
switch (Y.status) {
|
|
2119
2125
|
case "pending":
|
|
@@ -2131,7 +2137,7 @@ var Wr = class extends Qe {
|
|
|
2131
2137
|
}
|
|
2132
2138
|
updateResult() {
|
|
2133
2139
|
const e = this.#n, t = this.createResult(this.#t, this.options);
|
|
2134
|
-
if (this.#r = this.#t.state, this.#a = this.options, this.#r.data !== void 0 && (this.#f = this.#t),
|
|
2140
|
+
if (this.#r = this.#t.state, this.#a = this.options, this.#r.data !== void 0 && (this.#f = this.#t), nt(t, e))
|
|
2135
2141
|
return;
|
|
2136
2142
|
this.#n = t;
|
|
2137
2143
|
const s = () => {
|
|
@@ -2172,33 +2178,33 @@ var Wr = class extends Qe {
|
|
|
2172
2178
|
}
|
|
2173
2179
|
};
|
|
2174
2180
|
function Kr(e, t) {
|
|
2175
|
-
return
|
|
2181
|
+
return Ie(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
2176
2182
|
}
|
|
2177
|
-
function
|
|
2178
|
-
return Kr(e, t) || e.state.data !== void 0 &&
|
|
2183
|
+
function ss(e, t) {
|
|
2184
|
+
return Kr(e, t) || e.state.data !== void 0 && Nt(e, t, t.refetchOnMount);
|
|
2179
2185
|
}
|
|
2180
|
-
function
|
|
2181
|
-
if (
|
|
2186
|
+
function Nt(e, t, s) {
|
|
2187
|
+
if (Ie(t.enabled, e) !== !1 && Le(t.staleTime, e) !== "static") {
|
|
2182
2188
|
const r = typeof s == "function" ? s(e) : s;
|
|
2183
2189
|
return r === "always" || r !== !1 && Pt(e, t);
|
|
2184
2190
|
}
|
|
2185
2191
|
return !1;
|
|
2186
2192
|
}
|
|
2187
|
-
function
|
|
2188
|
-
return (e !== t ||
|
|
2193
|
+
function rs(e, t, s, r) {
|
|
2194
|
+
return (e !== t || Ie(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && Pt(e, s);
|
|
2189
2195
|
}
|
|
2190
2196
|
function Pt(e, t) {
|
|
2191
|
-
return
|
|
2197
|
+
return Ie(t.enabled, e) !== !1 && e.isStaleByTime(Le(t.staleTime, e));
|
|
2192
2198
|
}
|
|
2193
2199
|
function Yr(e, t) {
|
|
2194
|
-
return !
|
|
2200
|
+
return !nt(e.getCurrentResult(), t);
|
|
2195
2201
|
}
|
|
2196
|
-
function
|
|
2202
|
+
function ns(e) {
|
|
2197
2203
|
return {
|
|
2198
2204
|
onFetch: (t, s) => {
|
|
2199
2205
|
const r = t.options, n = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [];
|
|
2200
2206
|
let l = { pages: [], pageParams: [] }, h = 0;
|
|
2201
|
-
const
|
|
2207
|
+
const d = async () => {
|
|
2202
2208
|
let c = !1;
|
|
2203
2209
|
const S = (N) => {
|
|
2204
2210
|
Br(
|
|
@@ -2206,36 +2212,36 @@ function ss(e) {
|
|
|
2206
2212
|
() => t.signal,
|
|
2207
2213
|
() => c = !0
|
|
2208
2214
|
);
|
|
2209
|
-
}, f =
|
|
2215
|
+
}, f = vs(t.options, t.fetchOptions), R = async (N, m, A) => {
|
|
2210
2216
|
if (c)
|
|
2211
2217
|
return Promise.reject();
|
|
2212
2218
|
if (m == null && N.pages.length)
|
|
2213
2219
|
return Promise.resolve(N);
|
|
2214
|
-
const
|
|
2215
|
-
const
|
|
2220
|
+
const U = (() => {
|
|
2221
|
+
const H = {
|
|
2216
2222
|
client: t.client,
|
|
2217
2223
|
queryKey: t.queryKey,
|
|
2218
2224
|
pageParam: m,
|
|
2219
2225
|
direction: A ? "backward" : "forward",
|
|
2220
2226
|
meta: t.options.meta
|
|
2221
2227
|
};
|
|
2222
|
-
return S(
|
|
2223
|
-
})(),
|
|
2228
|
+
return S(H), H;
|
|
2229
|
+
})(), L = await f(U), { maxPages: O } = t.options, Z = A ? $r : Lr;
|
|
2224
2230
|
return {
|
|
2225
|
-
pages: Z(N.pages,
|
|
2231
|
+
pages: Z(N.pages, L, O),
|
|
2226
2232
|
pageParams: Z(N.pageParams, m, O)
|
|
2227
2233
|
};
|
|
2228
2234
|
};
|
|
2229
2235
|
if (n && a.length) {
|
|
2230
|
-
const N = n === "backward", m = N ? zr :
|
|
2236
|
+
const N = n === "backward", m = N ? zr : is, A = {
|
|
2231
2237
|
pages: a,
|
|
2232
2238
|
pageParams: o
|
|
2233
|
-
},
|
|
2234
|
-
l = await R(A,
|
|
2239
|
+
}, B = m(r, A);
|
|
2240
|
+
l = await R(A, B, N);
|
|
2235
2241
|
} else {
|
|
2236
2242
|
const N = e ?? a.length;
|
|
2237
2243
|
do {
|
|
2238
|
-
const m = h === 0 ? o[0] ?? r.initialPageParam :
|
|
2244
|
+
const m = h === 0 ? o[0] ?? r.initialPageParam : is(r, l);
|
|
2239
2245
|
if (h > 0 && m == null)
|
|
2240
2246
|
break;
|
|
2241
2247
|
l = await R(l, m), h++;
|
|
@@ -2244,7 +2250,7 @@ function ss(e) {
|
|
|
2244
2250
|
return l;
|
|
2245
2251
|
};
|
|
2246
2252
|
t.options.persister ? t.fetchFn = () => t.options.persister?.(
|
|
2247
|
-
|
|
2253
|
+
d,
|
|
2248
2254
|
{
|
|
2249
2255
|
client: t.client,
|
|
2250
2256
|
queryKey: t.queryKey,
|
|
@@ -2252,11 +2258,11 @@ function ss(e) {
|
|
|
2252
2258
|
signal: t.signal
|
|
2253
2259
|
},
|
|
2254
2260
|
s
|
|
2255
|
-
) : t.fetchFn =
|
|
2261
|
+
) : t.fetchFn = d;
|
|
2256
2262
|
}
|
|
2257
2263
|
};
|
|
2258
2264
|
}
|
|
2259
|
-
function
|
|
2265
|
+
function is(e, { pages: t, pageParams: s }) {
|
|
2260
2266
|
const r = t.length - 1;
|
|
2261
2267
|
return t.length > 0 ? e.getNextPageParam(
|
|
2262
2268
|
t[r],
|
|
@@ -2268,13 +2274,13 @@ function rs(e, { pages: t, pageParams: s }) {
|
|
|
2268
2274
|
function zr(e, { pages: t, pageParams: s }) {
|
|
2269
2275
|
return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, s[0], s) : void 0;
|
|
2270
2276
|
}
|
|
2271
|
-
var Zr = class extends
|
|
2277
|
+
var Zr = class extends Ss {
|
|
2272
2278
|
#e;
|
|
2273
2279
|
#t;
|
|
2274
2280
|
#s;
|
|
2275
2281
|
#n;
|
|
2276
2282
|
constructor(e) {
|
|
2277
|
-
super(), this.#e = e.client, this.mutationId = e.mutationId, this.#s = e.mutationCache, this.#t = [], this.state = e.state ||
|
|
2283
|
+
super(), this.#e = e.client, this.mutationId = e.mutationId, this.#s = e.mutationCache, this.#t = [], this.state = e.state || Ns(), this.setOptions(e.options), this.scheduleGc();
|
|
2278
2284
|
}
|
|
2279
2285
|
setOptions(e) {
|
|
2280
2286
|
this.options = e, this.updateGcTime(this.options.gcTime);
|
|
@@ -2311,7 +2317,7 @@ var Zr = class extends bs {
|
|
|
2311
2317
|
meta: this.options.meta,
|
|
2312
2318
|
mutationKey: this.options.mutationKey
|
|
2313
2319
|
};
|
|
2314
|
-
this.#n =
|
|
2320
|
+
this.#n = As({
|
|
2315
2321
|
fn: () => this.options.mutationFn ? this.options.mutationFn(e, s) : Promise.reject(new Error("No mutationFn found")),
|
|
2316
2322
|
onFail: (a, o) => {
|
|
2317
2323
|
this.#r({ type: "failed", failureCount: a, error: o });
|
|
@@ -2487,7 +2493,7 @@ var Zr = class extends bs {
|
|
|
2487
2493
|
});
|
|
2488
2494
|
}
|
|
2489
2495
|
};
|
|
2490
|
-
function
|
|
2496
|
+
function Ns() {
|
|
2491
2497
|
return {
|
|
2492
2498
|
context: void 0,
|
|
2493
2499
|
data: void 0,
|
|
@@ -2500,7 +2506,7 @@ function Ss() {
|
|
|
2500
2506
|
submittedAt: 0
|
|
2501
2507
|
};
|
|
2502
2508
|
}
|
|
2503
|
-
var Vr = class extends
|
|
2509
|
+
var Vr = class extends He {
|
|
2504
2510
|
constructor(e = {}) {
|
|
2505
2511
|
super(), this.config = e, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#s = 0;
|
|
2506
2512
|
}
|
|
@@ -2519,7 +2525,7 @@ var Vr = class extends Qe {
|
|
|
2519
2525
|
}
|
|
2520
2526
|
add(e) {
|
|
2521
2527
|
this.#e.add(e);
|
|
2522
|
-
const t =
|
|
2528
|
+
const t = tt(e);
|
|
2523
2529
|
if (typeof t == "string") {
|
|
2524
2530
|
const s = this.#t.get(t);
|
|
2525
2531
|
s ? s.push(e) : this.#t.set(t, [e]);
|
|
@@ -2528,7 +2534,7 @@ var Vr = class extends Qe {
|
|
|
2528
2534
|
}
|
|
2529
2535
|
remove(e) {
|
|
2530
2536
|
if (this.#e.delete(e)) {
|
|
2531
|
-
const t =
|
|
2537
|
+
const t = tt(e);
|
|
2532
2538
|
if (typeof t == "string") {
|
|
2533
2539
|
const s = this.#t.get(t);
|
|
2534
2540
|
if (s)
|
|
@@ -2541,7 +2547,7 @@ var Vr = class extends Qe {
|
|
|
2541
2547
|
this.notify({ type: "removed", mutation: e });
|
|
2542
2548
|
}
|
|
2543
2549
|
canRun(e) {
|
|
2544
|
-
const t =
|
|
2550
|
+
const t = tt(e);
|
|
2545
2551
|
if (typeof t == "string") {
|
|
2546
2552
|
const r = this.#t.get(t)?.find(
|
|
2547
2553
|
(n) => n.state.status === "pending"
|
|
@@ -2551,7 +2557,7 @@ var Vr = class extends Qe {
|
|
|
2551
2557
|
return !0;
|
|
2552
2558
|
}
|
|
2553
2559
|
runNext(e) {
|
|
2554
|
-
const t =
|
|
2560
|
+
const t = tt(e);
|
|
2555
2561
|
return typeof t == "string" ? this.#t.get(t)?.find((r) => r !== e && r.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
|
|
2556
2562
|
}
|
|
2557
2563
|
clear() {
|
|
@@ -2567,11 +2573,11 @@ var Vr = class extends Qe {
|
|
|
2567
2573
|
find(e) {
|
|
2568
2574
|
const t = { exact: !0, ...e };
|
|
2569
2575
|
return this.getAll().find(
|
|
2570
|
-
(s) =>
|
|
2576
|
+
(s) => Vt(t, s)
|
|
2571
2577
|
);
|
|
2572
2578
|
}
|
|
2573
2579
|
findAll(e = {}) {
|
|
2574
|
-
return this.getAll().filter((t) =>
|
|
2580
|
+
return this.getAll().filter((t) => Vt(e, t));
|
|
2575
2581
|
}
|
|
2576
2582
|
notify(e) {
|
|
2577
2583
|
ce.batch(() => {
|
|
@@ -2584,15 +2590,15 @@ var Vr = class extends Qe {
|
|
|
2584
2590
|
const e = this.getAll().filter((t) => t.state.isPaused);
|
|
2585
2591
|
return ce.batch(
|
|
2586
2592
|
() => Promise.all(
|
|
2587
|
-
e.map((t) => t.continue().catch(
|
|
2593
|
+
e.map((t) => t.continue().catch(ge))
|
|
2588
2594
|
)
|
|
2589
2595
|
);
|
|
2590
2596
|
}
|
|
2591
2597
|
};
|
|
2592
|
-
function
|
|
2598
|
+
function tt(e) {
|
|
2593
2599
|
return e.options.scope?.id;
|
|
2594
2600
|
}
|
|
2595
|
-
var Jr = class extends
|
|
2601
|
+
var Jr = class extends He {
|
|
2596
2602
|
#e;
|
|
2597
2603
|
#t = void 0;
|
|
2598
2604
|
#s;
|
|
@@ -2605,11 +2611,11 @@ var Jr = class extends Qe {
|
|
|
2605
2611
|
}
|
|
2606
2612
|
setOptions(e) {
|
|
2607
2613
|
const t = this.options;
|
|
2608
|
-
this.options = this.#e.defaultMutationOptions(e),
|
|
2614
|
+
this.options = this.#e.defaultMutationOptions(e), nt(this.options, t) || this.#e.getMutationCache().notify({
|
|
2609
2615
|
type: "observerOptionsUpdated",
|
|
2610
2616
|
mutation: this.#s,
|
|
2611
2617
|
observer: this
|
|
2612
|
-
}), t?.mutationKey && this.options.mutationKey &&
|
|
2618
|
+
}), t?.mutationKey && this.options.mutationKey && je(t.mutationKey) !== je(this.options.mutationKey) ? this.reset() : this.#s?.state.status === "pending" && this.#s.setOptions(this.options);
|
|
2613
2619
|
}
|
|
2614
2620
|
onUnsubscribe() {
|
|
2615
2621
|
this.hasListeners() || this.#s?.removeObserver(this);
|
|
@@ -2627,7 +2633,7 @@ var Jr = class extends Qe {
|
|
|
2627
2633
|
return this.#n = t, this.#s?.removeObserver(this), this.#s = this.#e.getMutationCache().build(this.#e, this.options), this.#s.addObserver(this), this.#s.execute(e);
|
|
2628
2634
|
}
|
|
2629
2635
|
#r() {
|
|
2630
|
-
const e = this.#s?.state ??
|
|
2636
|
+
const e = this.#s?.state ?? Ns();
|
|
2631
2637
|
this.#t = {
|
|
2632
2638
|
...e,
|
|
2633
2639
|
isPending: e.status === "pending",
|
|
@@ -2697,13 +2703,13 @@ var Jr = class extends Qe {
|
|
|
2697
2703
|
});
|
|
2698
2704
|
});
|
|
2699
2705
|
}
|
|
2700
|
-
}, Xr = class extends
|
|
2706
|
+
}, Xr = class extends He {
|
|
2701
2707
|
constructor(e = {}) {
|
|
2702
2708
|
super(), this.config = e, this.#e = /* @__PURE__ */ new Map();
|
|
2703
2709
|
}
|
|
2704
2710
|
#e;
|
|
2705
2711
|
build(e, t, s) {
|
|
2706
|
-
const r = t.queryKey, n = t.queryHash ??
|
|
2712
|
+
const r = t.queryKey, n = t.queryHash ?? Et(r, t);
|
|
2707
2713
|
let a = this.get(n);
|
|
2708
2714
|
return a || (a = new Gr({
|
|
2709
2715
|
client: e,
|
|
@@ -2740,12 +2746,12 @@ var Jr = class extends Qe {
|
|
|
2740
2746
|
find(e) {
|
|
2741
2747
|
const t = { exact: !0, ...e };
|
|
2742
2748
|
return this.getAll().find(
|
|
2743
|
-
(s) =>
|
|
2749
|
+
(s) => Zt(t, s)
|
|
2744
2750
|
);
|
|
2745
2751
|
}
|
|
2746
2752
|
findAll(e = {}) {
|
|
2747
2753
|
const t = this.getAll();
|
|
2748
|
-
return Object.keys(e).length > 0 ? t.filter((s) =>
|
|
2754
|
+
return Object.keys(e).length > 0 ? t.filter((s) => Zt(e, s)) : t;
|
|
2749
2755
|
}
|
|
2750
2756
|
notify(e) {
|
|
2751
2757
|
ce.batch(() => {
|
|
@@ -2781,9 +2787,9 @@ var Jr = class extends Qe {
|
|
|
2781
2787
|
this.#e = e.queryCache || new Xr(), this.#t = e.mutationCache || new Vr(), this.#s = e.defaultOptions || {}, this.#n = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#a = 0;
|
|
2782
2788
|
}
|
|
2783
2789
|
mount() {
|
|
2784
|
-
this.#a++, this.#a === 1 && (this.#o =
|
|
2790
|
+
this.#a++, this.#a === 1 && (this.#o = Mt.subscribe(async (e) => {
|
|
2785
2791
|
e && (await this.resumePausedMutations(), this.#e.onFocus());
|
|
2786
|
-
}), this.#i =
|
|
2792
|
+
}), this.#i = at.subscribe(async (e) => {
|
|
2787
2793
|
e && (await this.resumePausedMutations(), this.#e.onOnline());
|
|
2788
2794
|
}));
|
|
2789
2795
|
}
|
|
@@ -2809,7 +2815,7 @@ var Jr = class extends Qe {
|
|
|
2809
2815
|
}
|
|
2810
2816
|
ensureQueryData(e) {
|
|
2811
2817
|
const t = this.defaultQueryOptions(e), s = this.#e.build(this, t), r = s.state.data;
|
|
2812
|
-
return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(
|
|
2818
|
+
return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(Le(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(r));
|
|
2813
2819
|
}
|
|
2814
2820
|
getQueriesData(e) {
|
|
2815
2821
|
return this.#e.findAll(e).map(({ queryKey: t, state: s }) => {
|
|
@@ -2862,7 +2868,7 @@ var Jr = class extends Qe {
|
|
|
2862
2868
|
const s = { revert: !0, ...t }, r = ce.batch(
|
|
2863
2869
|
() => this.#e.findAll(e).map((n) => n.cancel(s))
|
|
2864
2870
|
);
|
|
2865
|
-
return Promise.all(r).then(
|
|
2871
|
+
return Promise.all(r).then(ge).catch(ge);
|
|
2866
2872
|
}
|
|
2867
2873
|
invalidateQueries(e, t = {}) {
|
|
2868
2874
|
return ce.batch(() => (this.#e.findAll(e).forEach((s) => {
|
|
@@ -2882,33 +2888,33 @@ var Jr = class extends Qe {
|
|
|
2882
2888
|
}, r = ce.batch(
|
|
2883
2889
|
() => this.#e.findAll(e).filter((n) => !n.isDisabled() && !n.isStatic()).map((n) => {
|
|
2884
2890
|
let a = n.fetch(void 0, s);
|
|
2885
|
-
return s.throwOnError || (a = a.catch(
|
|
2891
|
+
return s.throwOnError || (a = a.catch(ge)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
|
|
2886
2892
|
})
|
|
2887
2893
|
);
|
|
2888
|
-
return Promise.all(r).then(
|
|
2894
|
+
return Promise.all(r).then(ge);
|
|
2889
2895
|
}
|
|
2890
2896
|
fetchQuery(e) {
|
|
2891
2897
|
const t = this.defaultQueryOptions(e);
|
|
2892
2898
|
t.retry === void 0 && (t.retry = !1);
|
|
2893
2899
|
const s = this.#e.build(this, t);
|
|
2894
2900
|
return s.isStaleByTime(
|
|
2895
|
-
|
|
2901
|
+
Le(t.staleTime, s)
|
|
2896
2902
|
) ? s.fetch(t) : Promise.resolve(s.state.data);
|
|
2897
2903
|
}
|
|
2898
2904
|
prefetchQuery(e) {
|
|
2899
|
-
return this.fetchQuery(e).then(
|
|
2905
|
+
return this.fetchQuery(e).then(ge).catch(ge);
|
|
2900
2906
|
}
|
|
2901
2907
|
fetchInfiniteQuery(e) {
|
|
2902
|
-
return e.behavior =
|
|
2908
|
+
return e.behavior = ns(e.pages), this.fetchQuery(e);
|
|
2903
2909
|
}
|
|
2904
2910
|
prefetchInfiniteQuery(e) {
|
|
2905
|
-
return this.fetchInfiniteQuery(e).then(
|
|
2911
|
+
return this.fetchInfiniteQuery(e).then(ge).catch(ge);
|
|
2906
2912
|
}
|
|
2907
2913
|
ensureInfiniteQueryData(e) {
|
|
2908
|
-
return e.behavior =
|
|
2914
|
+
return e.behavior = ns(e.pages), this.ensureQueryData(e);
|
|
2909
2915
|
}
|
|
2910
2916
|
resumePausedMutations() {
|
|
2911
|
-
return
|
|
2917
|
+
return at.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
|
|
2912
2918
|
}
|
|
2913
2919
|
getQueryCache() {
|
|
2914
2920
|
return this.#e;
|
|
@@ -2923,7 +2929,7 @@ var Jr = class extends Qe {
|
|
|
2923
2929
|
this.#s = e;
|
|
2924
2930
|
}
|
|
2925
2931
|
setQueryDefaults(e, t) {
|
|
2926
|
-
this.#n.set(
|
|
2932
|
+
this.#n.set(je(e), {
|
|
2927
2933
|
queryKey: e,
|
|
2928
2934
|
defaultOptions: t
|
|
2929
2935
|
});
|
|
@@ -2931,11 +2937,11 @@ var Jr = class extends Qe {
|
|
|
2931
2937
|
getQueryDefaults(e) {
|
|
2932
2938
|
const t = [...this.#n.values()], s = {};
|
|
2933
2939
|
return t.forEach((r) => {
|
|
2934
|
-
|
|
2940
|
+
Ye(e, r.queryKey) && Object.assign(s, r.defaultOptions);
|
|
2935
2941
|
}), s;
|
|
2936
2942
|
}
|
|
2937
2943
|
setMutationDefaults(e, t) {
|
|
2938
|
-
this.#r.set(
|
|
2944
|
+
this.#r.set(je(e), {
|
|
2939
2945
|
mutationKey: e,
|
|
2940
2946
|
defaultOptions: t
|
|
2941
2947
|
});
|
|
@@ -2943,7 +2949,7 @@ var Jr = class extends Qe {
|
|
|
2943
2949
|
getMutationDefaults(e) {
|
|
2944
2950
|
const t = [...this.#r.values()], s = {};
|
|
2945
2951
|
return t.forEach((r) => {
|
|
2946
|
-
|
|
2952
|
+
Ye(e, r.mutationKey) && Object.assign(s, r.defaultOptions);
|
|
2947
2953
|
}), s;
|
|
2948
2954
|
}
|
|
2949
2955
|
defaultQueryOptions(e) {
|
|
@@ -2955,10 +2961,10 @@ var Jr = class extends Qe {
|
|
|
2955
2961
|
...e,
|
|
2956
2962
|
_defaulted: !0
|
|
2957
2963
|
};
|
|
2958
|
-
return t.queryHash || (t.queryHash =
|
|
2964
|
+
return t.queryHash || (t.queryHash = Et(
|
|
2959
2965
|
t.queryKey,
|
|
2960
2966
|
t
|
|
2961
|
-
)), 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 ===
|
|
2967
|
+
)), 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 === it && (t.enabled = !1), t;
|
|
2962
2968
|
}
|
|
2963
2969
|
defaultMutationOptions(e) {
|
|
2964
2970
|
return e?._defaulted ? e : {
|
|
@@ -2971,20 +2977,20 @@ var Jr = class extends Qe {
|
|
|
2971
2977
|
clear() {
|
|
2972
2978
|
this.#e.clear(), this.#t.clear();
|
|
2973
2979
|
}
|
|
2974
|
-
},
|
|
2980
|
+
}, xs = me.createContext(
|
|
2975
2981
|
void 0
|
|
2976
|
-
),
|
|
2977
|
-
const t =
|
|
2982
|
+
), Dt = (e) => {
|
|
2983
|
+
const t = me.useContext(xs);
|
|
2978
2984
|
if (!t)
|
|
2979
2985
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
2980
2986
|
return t;
|
|
2981
2987
|
}, tn = ({
|
|
2982
2988
|
client: e,
|
|
2983
2989
|
children: t
|
|
2984
|
-
}) => (
|
|
2990
|
+
}) => (me.useEffect(() => (e.mount(), () => {
|
|
2985
2991
|
e.unmount();
|
|
2986
|
-
}), [e]), /* @__PURE__ */ i(
|
|
2987
|
-
|
|
2992
|
+
}), [e]), /* @__PURE__ */ i(xs.Provider, { value: e, children: t })), Cs = me.createContext(!1), sn = () => me.useContext(Cs);
|
|
2993
|
+
Cs.Provider;
|
|
2988
2994
|
function rn() {
|
|
2989
2995
|
let e = !1;
|
|
2990
2996
|
return {
|
|
@@ -2997,11 +3003,11 @@ function rn() {
|
|
|
2997
3003
|
isReset: () => e
|
|
2998
3004
|
};
|
|
2999
3005
|
}
|
|
3000
|
-
var nn =
|
|
3001
|
-
const r = s?.state.error && typeof e.throwOnError == "function" ?
|
|
3006
|
+
var nn = me.createContext(rn()), an = () => me.useContext(nn), on = (e, t, s) => {
|
|
3007
|
+
const r = s?.state.error && typeof e.throwOnError == "function" ? Ot(e.throwOnError, [s.state.error, s]) : e.throwOnError;
|
|
3002
3008
|
(e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
3003
3009
|
}, ln = (e) => {
|
|
3004
|
-
|
|
3010
|
+
me.useEffect(() => {
|
|
3005
3011
|
e.clearReset();
|
|
3006
3012
|
}, [e]);
|
|
3007
3013
|
}, cn = ({
|
|
@@ -3010,7 +3016,7 @@ var nn = fe.createContext(rn()), an = () => fe.useContext(nn), on = (e, t, s) =>
|
|
|
3010
3016
|
throwOnError: s,
|
|
3011
3017
|
query: r,
|
|
3012
3018
|
suspense: n
|
|
3013
|
-
}) => e.isError && !t.isReset() && !e.isFetching && r && (n && e.data === void 0 ||
|
|
3019
|
+
}) => e.isError && !t.isReset() && !e.isFetching && r && (n && e.data === void 0 || Ot(s, [e.error, r])), un = (e) => {
|
|
3014
3020
|
if (e.suspense) {
|
|
3015
3021
|
const s = (n) => n === "static" ? n : Math.max(n ?? 1e3, 1e3), r = e.staleTime;
|
|
3016
3022
|
e.staleTime = typeof r == "function" ? (...n) => s(r(...n)) : s(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(
|
|
@@ -3018,7 +3024,7 @@ var nn = fe.createContext(rn()), an = () => fe.useContext(nn), on = (e, t, s) =>
|
|
|
3018
3024
|
1e3
|
|
3019
3025
|
));
|
|
3020
3026
|
}
|
|
3021
|
-
}, dn = (e, t) => e.isLoading && e.isFetching && !t, hn = (e, t) => e?.suspense && t.isPending,
|
|
3027
|
+
}, dn = (e, t) => e.isLoading && e.isFetching && !t, hn = (e, t) => e?.suspense && t.isPending, as = (e, t, s) => t.fetchOptimistic(e).catch(() => {
|
|
3022
3028
|
s.clearReset();
|
|
3023
3029
|
});
|
|
3024
3030
|
function fn(e, t, s) {
|
|
@@ -3026,7 +3032,7 @@ function fn(e, t, s) {
|
|
|
3026
3032
|
throw new Error(
|
|
3027
3033
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
3028
3034
|
);
|
|
3029
|
-
const r = sn(), n = an(), a =
|
|
3035
|
+
const r = sn(), n = an(), a = Dt(), o = a.defaultQueryOptions(e);
|
|
3030
3036
|
a.getDefaultOptions().queries?._experimental_beforeQuery?.(
|
|
3031
3037
|
o
|
|
3032
3038
|
);
|
|
@@ -3034,26 +3040,26 @@ function fn(e, t, s) {
|
|
|
3034
3040
|
process.env.NODE_ENV !== "production" && (o.queryFn || console.error(
|
|
3035
3041
|
`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
3036
3042
|
)), o._optimisticResults = r ? "isRestoring" : "optimistic", un(o), on(o, n, l), ln(n);
|
|
3037
|
-
const h = !a.getQueryCache().get(o.queryHash), [
|
|
3043
|
+
const h = !a.getQueryCache().get(o.queryHash), [d] = me.useState(
|
|
3038
3044
|
() => new t(
|
|
3039
3045
|
a,
|
|
3040
3046
|
o
|
|
3041
3047
|
)
|
|
3042
|
-
), c =
|
|
3043
|
-
if (
|
|
3044
|
-
|
|
3048
|
+
), c = d.getOptimisticResult(o), S = !r && e.subscribed !== !1;
|
|
3049
|
+
if (me.useSyncExternalStore(
|
|
3050
|
+
me.useCallback(
|
|
3045
3051
|
(f) => {
|
|
3046
|
-
const R = S ?
|
|
3047
|
-
return
|
|
3052
|
+
const R = S ? d.subscribe(ce.batchCalls(f)) : ge;
|
|
3053
|
+
return d.updateResult(), R;
|
|
3048
3054
|
},
|
|
3049
|
-
[
|
|
3055
|
+
[d, S]
|
|
3050
3056
|
),
|
|
3051
|
-
() =>
|
|
3052
|
-
() =>
|
|
3053
|
-
),
|
|
3054
|
-
|
|
3055
|
-
}, [o,
|
|
3056
|
-
throw
|
|
3057
|
+
() => d.getCurrentResult(),
|
|
3058
|
+
() => d.getCurrentResult()
|
|
3059
|
+
), me.useEffect(() => {
|
|
3060
|
+
d.setOptions(o);
|
|
3061
|
+
}, [o, d]), hn(o, c))
|
|
3062
|
+
throw as(o, d, n);
|
|
3057
3063
|
if (cn({
|
|
3058
3064
|
result: c,
|
|
3059
3065
|
errorResetBoundary: n,
|
|
@@ -3065,48 +3071,48 @@ function fn(e, t, s) {
|
|
|
3065
3071
|
return a.getDefaultOptions().queries?._experimental_afterQuery?.(
|
|
3066
3072
|
o,
|
|
3067
3073
|
c
|
|
3068
|
-
), o.experimental_prefetchInRender &&
|
|
3074
|
+
), o.experimental_prefetchInRender && !Be && dn(c, r) && (h ? (
|
|
3069
3075
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
3070
|
-
|
|
3076
|
+
as(o, d, n)
|
|
3071
3077
|
) : (
|
|
3072
3078
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
3073
3079
|
l?.promise
|
|
3074
|
-
))?.catch(
|
|
3075
|
-
|
|
3076
|
-
}), o.notifyOnChangeProps ? c :
|
|
3080
|
+
))?.catch(ge).finally(() => {
|
|
3081
|
+
d.updateResult();
|
|
3082
|
+
}), o.notifyOnChangeProps ? c : d.trackResult(c);
|
|
3077
3083
|
}
|
|
3078
|
-
function
|
|
3084
|
+
function lt(e, t) {
|
|
3079
3085
|
return fn(e, Wr);
|
|
3080
3086
|
}
|
|
3081
3087
|
function mn(e, t) {
|
|
3082
|
-
const s =
|
|
3088
|
+
const s = Dt(), [r] = me.useState(
|
|
3083
3089
|
() => new Jr(
|
|
3084
3090
|
s,
|
|
3085
3091
|
e
|
|
3086
3092
|
)
|
|
3087
3093
|
);
|
|
3088
|
-
|
|
3094
|
+
me.useEffect(() => {
|
|
3089
3095
|
r.setOptions(e);
|
|
3090
3096
|
}, [r, e]);
|
|
3091
|
-
const n =
|
|
3092
|
-
|
|
3097
|
+
const n = me.useSyncExternalStore(
|
|
3098
|
+
me.useCallback(
|
|
3093
3099
|
(o) => r.subscribe(ce.batchCalls(o)),
|
|
3094
3100
|
[r]
|
|
3095
3101
|
),
|
|
3096
3102
|
() => r.getCurrentResult(),
|
|
3097
3103
|
() => r.getCurrentResult()
|
|
3098
|
-
), a =
|
|
3104
|
+
), a = me.useCallback(
|
|
3099
3105
|
(o, l) => {
|
|
3100
|
-
r.mutate(o, l).catch(
|
|
3106
|
+
r.mutate(o, l).catch(ge);
|
|
3101
3107
|
},
|
|
3102
3108
|
[r]
|
|
3103
3109
|
);
|
|
3104
|
-
if (n.error &&
|
|
3110
|
+
if (n.error && Ot(r.options.throwOnError, [n.error]))
|
|
3105
3111
|
throw n.error;
|
|
3106
3112
|
return { ...n, mutate: a, mutateAsync: n.mutate };
|
|
3107
3113
|
}
|
|
3108
|
-
function
|
|
3109
|
-
const { alerts: e } =
|
|
3114
|
+
function Ts() {
|
|
3115
|
+
const { alerts: e } = Re(), t = Dt();
|
|
3110
3116
|
return mn({
|
|
3111
3117
|
mutationFn: (s) => e.updateAlertStatus(s),
|
|
3112
3118
|
onSuccess: () => {
|
|
@@ -3140,13 +3146,13 @@ function yn(e, t) {
|
|
|
3140
3146
|
function gn(e) {
|
|
3141
3147
|
if (!e) return "-";
|
|
3142
3148
|
try {
|
|
3143
|
-
const t = new Date(e), s = (
|
|
3149
|
+
const t = new Date(e), s = (d) => String(d).padStart(2, "0"), r = s(t.getMonth() + 1), n = s(t.getDate()), a = t.getFullYear(), o = s(t.getHours()), l = s(t.getMinutes()), h = s(t.getSeconds());
|
|
3144
3150
|
return `${r}/${n}/${a} ${o}:${l}:${h}`;
|
|
3145
3151
|
} catch {
|
|
3146
3152
|
return "-";
|
|
3147
3153
|
}
|
|
3148
3154
|
}
|
|
3149
|
-
function
|
|
3155
|
+
function xt(e) {
|
|
3150
3156
|
if (!e) return "-";
|
|
3151
3157
|
try {
|
|
3152
3158
|
return new Date(e).toLocaleString("en-US", {
|
|
@@ -3181,7 +3187,7 @@ function An({
|
|
|
3181
3187
|
spaceOptions: a,
|
|
3182
3188
|
onAlertIdClick: o
|
|
3183
3189
|
}) {
|
|
3184
|
-
const l =
|
|
3190
|
+
const l = Ts(), h = ["completed", "false positive"], d = async (f) => {
|
|
3185
3191
|
try {
|
|
3186
3192
|
const R = await l.mutateAsync({
|
|
3187
3193
|
alertUniqueId: f.alertId ?? f.id,
|
|
@@ -3192,13 +3198,13 @@ function An({
|
|
|
3192
3198
|
});
|
|
3193
3199
|
if (R?.responseStatus) {
|
|
3194
3200
|
const N = R?.data || "Alert reopened successfully.";
|
|
3195
|
-
|
|
3201
|
+
ve.success(N);
|
|
3196
3202
|
} else {
|
|
3197
3203
|
const N = R?.errorMessage || "Failed to reopen alert";
|
|
3198
|
-
|
|
3204
|
+
ve.error(N);
|
|
3199
3205
|
}
|
|
3200
3206
|
} catch {
|
|
3201
|
-
|
|
3207
|
+
ve.error("Failed to reopen alert. Please try again.");
|
|
3202
3208
|
}
|
|
3203
3209
|
}, c = [
|
|
3204
3210
|
{
|
|
@@ -3207,7 +3213,7 @@ function An({
|
|
|
3207
3213
|
key: "priority",
|
|
3208
3214
|
width: 120,
|
|
3209
3215
|
render: (f) => /* @__PURE__ */ i(
|
|
3210
|
-
|
|
3216
|
+
Ke,
|
|
3211
3217
|
{
|
|
3212
3218
|
className: "px-[10px] py-[2px]",
|
|
3213
3219
|
style: {
|
|
@@ -3235,7 +3241,7 @@ function An({
|
|
|
3235
3241
|
title: "Description",
|
|
3236
3242
|
dataIndex: "description",
|
|
3237
3243
|
key: "description",
|
|
3238
|
-
render: (f, R) => /* @__PURE__ */
|
|
3244
|
+
render: (f, R) => /* @__PURE__ */ u("div", { children: [
|
|
3239
3245
|
/* @__PURE__ */ i(
|
|
3240
3246
|
"a",
|
|
3241
3247
|
{
|
|
@@ -3255,7 +3261,7 @@ function An({
|
|
|
3255
3261
|
width: 60,
|
|
3256
3262
|
align: "right",
|
|
3257
3263
|
render: (f, R) => /* @__PURE__ */ i(
|
|
3258
|
-
|
|
3264
|
+
js,
|
|
3259
3265
|
{
|
|
3260
3266
|
trigger: ["click"],
|
|
3261
3267
|
menu: {
|
|
@@ -3263,10 +3269,10 @@ function An({
|
|
|
3263
3269
|
{ key: "reopen", label: "Reopen" }
|
|
3264
3270
|
],
|
|
3265
3271
|
onClick: ({ key: N }) => {
|
|
3266
|
-
N === "reopen" &&
|
|
3272
|
+
N === "reopen" && d(R);
|
|
3267
3273
|
}
|
|
3268
3274
|
},
|
|
3269
|
-
children: /* @__PURE__ */ i(Se, { type: "text", icon: /* @__PURE__ */ i(
|
|
3275
|
+
children: /* @__PURE__ */ i(Se, { type: "text", icon: /* @__PURE__ */ i(Ws, {}) })
|
|
3270
3276
|
}
|
|
3271
3277
|
)
|
|
3272
3278
|
}
|
|
@@ -3274,7 +3280,7 @@ function An({
|
|
|
3274
3280
|
(f) => h.includes((f.statusType || "").toLowerCase())
|
|
3275
3281
|
);
|
|
3276
3282
|
return /* @__PURE__ */ i(
|
|
3277
|
-
|
|
3283
|
+
ys,
|
|
3278
3284
|
{
|
|
3279
3285
|
data: S,
|
|
3280
3286
|
loading: t,
|
|
@@ -3307,8 +3313,8 @@ function Sn({
|
|
|
3307
3313
|
minutes: parseInt(S.find((f) => f.type === "minute")?.value || "0", 10),
|
|
3308
3314
|
seconds: parseInt(S.find((f) => f.type === "second")?.value || "0", 10)
|
|
3309
3315
|
};
|
|
3310
|
-
}, [t, s]), o = a * 6, l = n * 6 + a * 0.1, h = r % 12 * 30 + n * 0.5,
|
|
3311
|
-
return /* @__PURE__ */
|
|
3316
|
+
}, [t, s]), o = a * 6, l = n * 6 + a * 0.1, h = r % 12 * 30 + n * 0.5, d = e / 2;
|
|
3317
|
+
return /* @__PURE__ */ u(
|
|
3312
3318
|
"div",
|
|
3313
3319
|
{
|
|
3314
3320
|
className: "relative rounded-full border border-gray-300 bg-white",
|
|
@@ -3317,7 +3323,7 @@ function Sn({
|
|
|
3317
3323
|
"aria-label": "Analog Clock",
|
|
3318
3324
|
children: [
|
|
3319
3325
|
[...Array(12)].map((c, S) => {
|
|
3320
|
-
const f = S * 30, R = 6, N =
|
|
3326
|
+
const f = S * 30, R = 6, N = d - 4, m = N - R, A = (f - 90) * (Math.PI / 180), B = d + m * Math.cos(A), U = d + m * Math.sin(A), L = d + N * Math.cos(A), O = d + N * Math.sin(A);
|
|
3321
3327
|
return /* @__PURE__ */ i(
|
|
3322
3328
|
"svg",
|
|
3323
3329
|
{
|
|
@@ -3327,9 +3333,9 @@ function Sn({
|
|
|
3327
3333
|
children: /* @__PURE__ */ i(
|
|
3328
3334
|
"line",
|
|
3329
3335
|
{
|
|
3330
|
-
x1:
|
|
3331
|
-
y1:
|
|
3332
|
-
x2:
|
|
3336
|
+
x1: B,
|
|
3337
|
+
y1: U,
|
|
3338
|
+
x2: L,
|
|
3333
3339
|
y2: O,
|
|
3334
3340
|
stroke: "#9CA3AF",
|
|
3335
3341
|
strokeWidth: S % 3 === 0 ? 2 : 1,
|
|
@@ -3350,10 +3356,10 @@ function Sn({
|
|
|
3350
3356
|
children: /* @__PURE__ */ i(
|
|
3351
3357
|
"line",
|
|
3352
3358
|
{
|
|
3353
|
-
x1:
|
|
3354
|
-
y1:
|
|
3355
|
-
x2:
|
|
3356
|
-
y2:
|
|
3359
|
+
x1: d,
|
|
3360
|
+
y1: d,
|
|
3361
|
+
x2: d,
|
|
3362
|
+
y2: d - e * 0.25,
|
|
3357
3363
|
stroke: "#1F2937",
|
|
3358
3364
|
strokeWidth: 4,
|
|
3359
3365
|
strokeLinecap: "round"
|
|
@@ -3371,10 +3377,10 @@ function Sn({
|
|
|
3371
3377
|
children: /* @__PURE__ */ i(
|
|
3372
3378
|
"line",
|
|
3373
3379
|
{
|
|
3374
|
-
x1:
|
|
3375
|
-
y1:
|
|
3376
|
-
x2:
|
|
3377
|
-
y2:
|
|
3380
|
+
x1: d,
|
|
3381
|
+
y1: d,
|
|
3382
|
+
x2: d,
|
|
3383
|
+
y2: d - e * 0.35,
|
|
3378
3384
|
stroke: "#374151",
|
|
3379
3385
|
strokeWidth: 3,
|
|
3380
3386
|
strokeLinecap: "round"
|
|
@@ -3392,10 +3398,10 @@ function Sn({
|
|
|
3392
3398
|
children: /* @__PURE__ */ i(
|
|
3393
3399
|
"line",
|
|
3394
3400
|
{
|
|
3395
|
-
x1:
|
|
3396
|
-
y1:
|
|
3397
|
-
x2:
|
|
3398
|
-
y2:
|
|
3401
|
+
x1: d,
|
|
3402
|
+
y1: d + e * 0.08,
|
|
3403
|
+
x2: d,
|
|
3404
|
+
y2: d - e * 0.38,
|
|
3399
3405
|
stroke: "#EF4444",
|
|
3400
3406
|
strokeWidth: 1.5,
|
|
3401
3407
|
strokeLinecap: "round"
|
|
@@ -3410,8 +3416,8 @@ function Sn({
|
|
|
3410
3416
|
style: {
|
|
3411
3417
|
width: 8,
|
|
3412
3418
|
height: 8,
|
|
3413
|
-
left:
|
|
3414
|
-
top:
|
|
3419
|
+
left: d - 4,
|
|
3420
|
+
top: d - 4
|
|
3415
3421
|
}
|
|
3416
3422
|
}
|
|
3417
3423
|
)
|
|
@@ -3422,14 +3428,14 @@ function Sn({
|
|
|
3422
3428
|
function wn({ label: e = "USA", timeZone: t = "America/New_York", updateIntervalMs: s = 1e3, className: r }) {
|
|
3423
3429
|
const [n, a] = w(/* @__PURE__ */ new Date());
|
|
3424
3430
|
de(() => {
|
|
3425
|
-
const
|
|
3426
|
-
return () => clearInterval(
|
|
3431
|
+
const d = setInterval(() => a(/* @__PURE__ */ new Date()), s);
|
|
3432
|
+
return () => clearInterval(d);
|
|
3427
3433
|
}, [s]);
|
|
3428
3434
|
const o = ue(() => pn(n, t), [n, t]), { abbr: l, offset: h } = ue(() => yn(n, t), [n, t]);
|
|
3429
|
-
return /* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ u("div", { className: `flex items-center gap-3 ${r || ""}`, children: [
|
|
3430
3436
|
/* @__PURE__ */ i(Sn, { time: n, timeZone: t, size: 80 }),
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3437
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col items-baseline gap-1", children: [
|
|
3438
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2 text-sm text-gray-600", children: [
|
|
3433
3439
|
/* @__PURE__ */ i("span", { className: "uppercase", children: e }),
|
|
3434
3440
|
l && /* @__PURE__ */ i("span", { className: "px-1.5 py-0.5 rounded-md border text-[10px] leading-none text-gray-600 bg-gray-50", children: l }),
|
|
3435
3441
|
h && /* @__PURE__ */ i("span", { className: "text-xs text-gray-500", children: h })
|
|
@@ -3438,17 +3444,17 @@ function wn({ label: e = "USA", timeZone: t = "America/New_York", updateInterval
|
|
|
3438
3444
|
] })
|
|
3439
3445
|
] });
|
|
3440
3446
|
}
|
|
3441
|
-
const Nn = [{ 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 }], xn = [{ 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" }], Cn = [{ 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" }],
|
|
3447
|
+
const Nn = [{ 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 }], xn = [{ 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" }], Cn = [{ 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 = {
|
|
3442
3448
|
severities: Nn,
|
|
3443
3449
|
rules: xn,
|
|
3444
3450
|
userRoles: Cn
|
|
3445
|
-
}, { Text: Tn } =
|
|
3451
|
+
}, { Text: Tn } = ze;
|
|
3446
3452
|
function In({ sortBy: e, onChange: t, showActions: s, onSave: r, onClear: n, saving: a }) {
|
|
3447
|
-
return /* @__PURE__ */
|
|
3448
|
-
/* @__PURE__ */ i(
|
|
3453
|
+
return /* @__PURE__ */ u(Ne, { gutter: [16, 16], align: "middle", children: [
|
|
3454
|
+
/* @__PURE__ */ i(W, { xs: 24, md: 8, lg: 5, children: /* @__PURE__ */ u(ke, { className: "w-full items-center", direction: "horizontal", size: 12, children: [
|
|
3449
3455
|
/* @__PURE__ */ i(Tn, { className: "text-gray-600 whitespace-nowrap", children: "Sort By:" }),
|
|
3450
3456
|
/* @__PURE__ */ i(
|
|
3451
|
-
|
|
3457
|
+
Ae,
|
|
3452
3458
|
{
|
|
3453
3459
|
placeholder: "By Severity",
|
|
3454
3460
|
value: e,
|
|
@@ -3462,13 +3468,13 @@ function In({ sortBy: e, onChange: t, showActions: s, onSave: r, onClear: n, sav
|
|
|
3462
3468
|
}
|
|
3463
3469
|
)
|
|
3464
3470
|
] }) }),
|
|
3465
|
-
/* @__PURE__ */ i(
|
|
3471
|
+
/* @__PURE__ */ i(W, { xs: 24, md: 8, style: { alignSelf: "end" }, children: s ? /* @__PURE__ */ u(ke, { className: "w-full", direction: "horizontal", size: 8, children: [
|
|
3466
3472
|
/* @__PURE__ */ i(Se, { onClick: n, disabled: a, children: "Clear" }),
|
|
3467
3473
|
/* @__PURE__ */ i(Se, { type: "primary", onClick: r, loading: a, children: "Save" })
|
|
3468
3474
|
] }) : null })
|
|
3469
3475
|
] });
|
|
3470
3476
|
}
|
|
3471
|
-
const { Text:
|
|
3477
|
+
const { Text: Fe } = ze;
|
|
3472
3478
|
function Rn(e) {
|
|
3473
3479
|
const {
|
|
3474
3480
|
// escBasis, setEscBasis,
|
|
@@ -3481,7 +3487,7 @@ function Rn(e) {
|
|
|
3481
3487
|
l1mins: o,
|
|
3482
3488
|
setL1mins: l,
|
|
3483
3489
|
l1role: h,
|
|
3484
|
-
setL1role:
|
|
3490
|
+
setL1role: d,
|
|
3485
3491
|
l2mins: c,
|
|
3486
3492
|
setL2mins: S,
|
|
3487
3493
|
l2role: f,
|
|
@@ -3489,52 +3495,52 @@ function Rn(e) {
|
|
|
3489
3495
|
l3mins: N,
|
|
3490
3496
|
setL3mins: m,
|
|
3491
3497
|
l3role: A,
|
|
3492
|
-
setL3role:
|
|
3493
|
-
actions:
|
|
3494
|
-
setActions:
|
|
3498
|
+
setL3role: B,
|
|
3499
|
+
actions: U,
|
|
3500
|
+
setActions: L,
|
|
3495
3501
|
thirdPartyIds: O,
|
|
3496
3502
|
setThirdPartyIds: Z,
|
|
3497
|
-
humanLoop:
|
|
3503
|
+
humanLoop: H,
|
|
3498
3504
|
setHumanLoop: K,
|
|
3499
3505
|
isAutoExpire: z,
|
|
3500
3506
|
setAutoExpire: I,
|
|
3501
3507
|
onClear: T,
|
|
3502
3508
|
onSave: k,
|
|
3503
3509
|
saving: Y,
|
|
3504
|
-
onActionTypesLoaded:
|
|
3505
|
-
} = e, { rules: E } =
|
|
3510
|
+
onActionTypesLoaded: ee
|
|
3511
|
+
} = e, { rules: E } = Re(), [v, p] = w([]), [x, y] = w([]), [b, g] = w(!1);
|
|
3506
3512
|
de(() => {
|
|
3507
|
-
let
|
|
3513
|
+
let j = !1;
|
|
3508
3514
|
return (async () => {
|
|
3509
3515
|
try {
|
|
3510
3516
|
g(!0);
|
|
3511
3517
|
const q = await E.getLookups();
|
|
3512
|
-
if (
|
|
3513
|
-
const
|
|
3514
|
-
p(
|
|
3515
|
-
const
|
|
3516
|
-
y(
|
|
3518
|
+
if (j || !q || !Array.isArray(q.actionTypes)) return;
|
|
3519
|
+
const re = q.actionTypes.map((oe) => ({ label: oe.name, value: String(oe.actionTypeId) }));
|
|
3520
|
+
p(re), ee && ee(q.actionTypes);
|
|
3521
|
+
const ae = Array.isArray(q.thirdParties) ? q.thirdParties.map((oe) => ({ label: oe.thirdPartyName, value: oe.thirdPartyId })) : [];
|
|
3522
|
+
y(ae);
|
|
3517
3523
|
} catch (q) {
|
|
3518
3524
|
console.error("Error loading lookups", q);
|
|
3519
3525
|
} finally {
|
|
3520
|
-
|
|
3526
|
+
j || g(!1);
|
|
3521
3527
|
}
|
|
3522
3528
|
})(), () => {
|
|
3523
|
-
|
|
3529
|
+
j = !0;
|
|
3524
3530
|
};
|
|
3525
3531
|
}, []);
|
|
3526
|
-
const
|
|
3527
|
-
/* @__PURE__ */ i(
|
|
3532
|
+
const M = (j) => /* @__PURE__ */ u(Ke, { children: [
|
|
3533
|
+
/* @__PURE__ */ i(Ks, {}),
|
|
3528
3534
|
" ",
|
|
3529
|
-
|
|
3535
|
+
j.length,
|
|
3530
3536
|
" more"
|
|
3531
|
-
] }),
|
|
3532
|
-
return /* @__PURE__ */
|
|
3533
|
-
/* @__PURE__ */
|
|
3534
|
-
/* @__PURE__ */ i(
|
|
3535
|
-
/* @__PURE__ */ i(
|
|
3537
|
+
] }), F = typeof o == "number" || typeof h == "number" || typeof c == "number" || typeof f == "number" || typeof N == "number" || typeof A == "number" || Array.isArray(U) && U.length > 0 || Array.isArray(O) && O.length > 0 || !!H || !!z;
|
|
3538
|
+
return /* @__PURE__ */ u(Tt, { spinning: !!Y || b, children: [
|
|
3539
|
+
/* @__PURE__ */ u(Ne, { gutter: [16, 16], align: "bottom", children: [
|
|
3540
|
+
/* @__PURE__ */ i(W, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ u("div", { children: [
|
|
3541
|
+
/* @__PURE__ */ i(Fe, { className: "text-gray-700 font-medium block mb-1", children: "Rules" }),
|
|
3536
3542
|
/* @__PURE__ */ i(
|
|
3537
|
-
|
|
3543
|
+
Ae,
|
|
3538
3544
|
{
|
|
3539
3545
|
placeholder: "Rules",
|
|
3540
3546
|
value: t,
|
|
@@ -3544,14 +3550,14 @@ function Rn(e) {
|
|
|
3544
3550
|
}
|
|
3545
3551
|
)
|
|
3546
3552
|
] }) }),
|
|
3547
|
-
/* @__PURE__ */ i(
|
|
3548
|
-
/* @__PURE__ */
|
|
3549
|
-
/* @__PURE__ */ i(
|
|
3550
|
-
/* @__PURE__ */ i(
|
|
3553
|
+
/* @__PURE__ */ i(W, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ u("div", { children: [
|
|
3554
|
+
/* @__PURE__ */ u(Ne, { gutter: 8, children: [
|
|
3555
|
+
/* @__PURE__ */ i(W, { span: 10, children: /* @__PURE__ */ i(Fe, { className: "text-gray-700 font-medium block mb-1", children: "Level 1 (mins)" }) }),
|
|
3556
|
+
/* @__PURE__ */ i(W, { span: 14, children: /* @__PURE__ */ i(Fe, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
|
|
3551
3557
|
] }),
|
|
3552
|
-
/* @__PURE__ */
|
|
3553
|
-
/* @__PURE__ */ i(
|
|
3554
|
-
|
|
3558
|
+
/* @__PURE__ */ u(Ne, { gutter: 8, children: [
|
|
3559
|
+
/* @__PURE__ */ i(W, { span: 10, children: /* @__PURE__ */ i(
|
|
3560
|
+
Ae,
|
|
3555
3561
|
{
|
|
3556
3562
|
className: "w-full",
|
|
3557
3563
|
placeholder: "Mins",
|
|
@@ -3560,26 +3566,26 @@ function Rn(e) {
|
|
|
3560
3566
|
options: n
|
|
3561
3567
|
}
|
|
3562
3568
|
) }),
|
|
3563
|
-
/* @__PURE__ */ i(
|
|
3564
|
-
|
|
3569
|
+
/* @__PURE__ */ i(W, { span: 14, children: /* @__PURE__ */ i(
|
|
3570
|
+
Ae,
|
|
3565
3571
|
{
|
|
3566
3572
|
placeholder: "Escalate to",
|
|
3567
3573
|
className: "w-full",
|
|
3568
3574
|
value: h,
|
|
3569
|
-
onChange:
|
|
3575
|
+
onChange: d,
|
|
3570
3576
|
options: a
|
|
3571
3577
|
}
|
|
3572
3578
|
) })
|
|
3573
3579
|
] })
|
|
3574
3580
|
] }) }),
|
|
3575
|
-
/* @__PURE__ */ i(
|
|
3576
|
-
/* @__PURE__ */
|
|
3577
|
-
/* @__PURE__ */ i(
|
|
3578
|
-
/* @__PURE__ */ i(
|
|
3581
|
+
/* @__PURE__ */ i(W, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ u("div", { children: [
|
|
3582
|
+
/* @__PURE__ */ u(Ne, { gutter: 8, children: [
|
|
3583
|
+
/* @__PURE__ */ i(W, { span: 10, children: /* @__PURE__ */ i(Fe, { className: "text-gray-700 font-medium block mb-1", children: "Level 2 (mins)" }) }),
|
|
3584
|
+
/* @__PURE__ */ i(W, { span: 14, children: /* @__PURE__ */ i(Fe, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
|
|
3579
3585
|
] }),
|
|
3580
|
-
/* @__PURE__ */
|
|
3581
|
-
/* @__PURE__ */ i(
|
|
3582
|
-
|
|
3586
|
+
/* @__PURE__ */ u(Ne, { gutter: 8, children: [
|
|
3587
|
+
/* @__PURE__ */ i(W, { span: 10, children: /* @__PURE__ */ i(
|
|
3588
|
+
Ae,
|
|
3583
3589
|
{
|
|
3584
3590
|
className: "w-full",
|
|
3585
3591
|
placeholder: "Mins",
|
|
@@ -3588,8 +3594,8 @@ function Rn(e) {
|
|
|
3588
3594
|
options: n
|
|
3589
3595
|
}
|
|
3590
3596
|
) }),
|
|
3591
|
-
/* @__PURE__ */ i(
|
|
3592
|
-
|
|
3597
|
+
/* @__PURE__ */ i(W, { span: 14, children: /* @__PURE__ */ i(
|
|
3598
|
+
Ae,
|
|
3593
3599
|
{
|
|
3594
3600
|
placeholder: "Escalate to",
|
|
3595
3601
|
className: "w-full",
|
|
@@ -3600,14 +3606,14 @@ function Rn(e) {
|
|
|
3600
3606
|
) })
|
|
3601
3607
|
] })
|
|
3602
3608
|
] }) }),
|
|
3603
|
-
/* @__PURE__ */ i(
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
/* @__PURE__ */ i(
|
|
3606
|
-
/* @__PURE__ */ i(
|
|
3609
|
+
/* @__PURE__ */ i(W, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ u("div", { children: [
|
|
3610
|
+
/* @__PURE__ */ u(Ne, { gutter: 8, children: [
|
|
3611
|
+
/* @__PURE__ */ i(W, { span: 10, children: /* @__PURE__ */ i(Fe, { className: "text-gray-700 font-medium block mb-1", children: "Level 3 (mins)" }) }),
|
|
3612
|
+
/* @__PURE__ */ i(W, { span: 14, children: /* @__PURE__ */ i(Fe, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
|
|
3607
3613
|
] }),
|
|
3608
|
-
/* @__PURE__ */
|
|
3609
|
-
/* @__PURE__ */ i(
|
|
3610
|
-
|
|
3614
|
+
/* @__PURE__ */ u(Ne, { gutter: 8, children: [
|
|
3615
|
+
/* @__PURE__ */ i(W, { span: 10, children: /* @__PURE__ */ i(
|
|
3616
|
+
Ae,
|
|
3611
3617
|
{
|
|
3612
3618
|
className: "w-full",
|
|
3613
3619
|
placeholder: "Mins",
|
|
@@ -3616,38 +3622,38 @@ function Rn(e) {
|
|
|
3616
3622
|
options: n
|
|
3617
3623
|
}
|
|
3618
3624
|
) }),
|
|
3619
|
-
/* @__PURE__ */ i(
|
|
3620
|
-
|
|
3625
|
+
/* @__PURE__ */ i(W, { span: 14, children: /* @__PURE__ */ i(
|
|
3626
|
+
Ae,
|
|
3621
3627
|
{
|
|
3622
3628
|
placeholder: "Escalate to",
|
|
3623
3629
|
className: "w-full",
|
|
3624
3630
|
value: A,
|
|
3625
|
-
onChange:
|
|
3631
|
+
onChange: B,
|
|
3626
3632
|
options: a
|
|
3627
3633
|
}
|
|
3628
3634
|
) })
|
|
3629
3635
|
] })
|
|
3630
3636
|
] }) }),
|
|
3631
|
-
/* @__PURE__ */ i(
|
|
3632
|
-
/* @__PURE__ */ i(
|
|
3637
|
+
/* @__PURE__ */ i(W, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ u("div", { children: [
|
|
3638
|
+
/* @__PURE__ */ i(Fe, { className: "text-gray-700 font-medium block mb-1", children: "Pick Actions" }),
|
|
3633
3639
|
/* @__PURE__ */ i(
|
|
3634
|
-
|
|
3640
|
+
Ae,
|
|
3635
3641
|
{
|
|
3636
3642
|
mode: "multiple",
|
|
3637
3643
|
placeholder: "Select response actions",
|
|
3638
3644
|
className: "w-full",
|
|
3639
|
-
value:
|
|
3640
|
-
onChange:
|
|
3645
|
+
value: U,
|
|
3646
|
+
onChange: L,
|
|
3641
3647
|
options: v,
|
|
3642
3648
|
maxTagCount: 1,
|
|
3643
|
-
maxTagPlaceholder:
|
|
3649
|
+
maxTagPlaceholder: M
|
|
3644
3650
|
}
|
|
3645
3651
|
)
|
|
3646
3652
|
] }) }),
|
|
3647
|
-
/* @__PURE__ */ i(
|
|
3648
|
-
/* @__PURE__ */ i(
|
|
3653
|
+
/* @__PURE__ */ i(W, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ u("div", { children: [
|
|
3654
|
+
/* @__PURE__ */ i(Fe, { className: "text-gray-700 font-medium block mb-1", children: "Third Party App" }),
|
|
3649
3655
|
/* @__PURE__ */ i(
|
|
3650
|
-
|
|
3656
|
+
Ae,
|
|
3651
3657
|
{
|
|
3652
3658
|
mode: "multiple",
|
|
3653
3659
|
placeholder: "Third Party app",
|
|
@@ -3659,14 +3665,14 @@ function Rn(e) {
|
|
|
3659
3665
|
)
|
|
3660
3666
|
] }) })
|
|
3661
3667
|
] }),
|
|
3662
|
-
/* @__PURE__ */
|
|
3663
|
-
/* @__PURE__ */ i(
|
|
3664
|
-
/* @__PURE__ */ i(
|
|
3665
|
-
/* @__PURE__ */ i(
|
|
3668
|
+
/* @__PURE__ */ u(Ne, { gutter: [16, 16], align: "bottom", className: "mt-4 items-center", children: [
|
|
3669
|
+
/* @__PURE__ */ i(W, { xs: 24, sm: 12, md: 8, lg: 7, children: /* @__PURE__ */ u("div", { className: "flex items-center h-full gap-8", children: [
|
|
3670
|
+
/* @__PURE__ */ i(Qe, { checked: H, onChange: (j) => K(j.target.checked), className: "w-full", children: "Human-In-The-Loop" }),
|
|
3671
|
+
/* @__PURE__ */ i(Qe, { checked: z, onChange: (j) => I(j.target.checked), className: "w-full", children: "Auto-expire in 5 minutes" })
|
|
3666
3672
|
] }) }),
|
|
3667
|
-
/* @__PURE__ */ i(
|
|
3673
|
+
/* @__PURE__ */ i(W, { xs: 24, sm: 12, md: 8, children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3668
3674
|
/* @__PURE__ */ i(Se, { onClick: T, children: "Clear" }),
|
|
3669
|
-
/* @__PURE__ */ i(Se, { type: "primary", onClick: k, loading: !!Y, disabled: !(!!t &&
|
|
3675
|
+
/* @__PURE__ */ i(Se, { type: "primary", onClick: k, loading: !!Y, disabled: !(!!t && F && !Y), children: "Save" })
|
|
3670
3676
|
] }) })
|
|
3671
3677
|
] })
|
|
3672
3678
|
] });
|
|
@@ -3674,7 +3680,7 @@ function Rn(e) {
|
|
|
3674
3680
|
function kn({ entries: e, userRoles: t, onEdit: s, loading: r }) {
|
|
3675
3681
|
const n = new Map(t.map((o) => [o.userRoleId, o.userRoleName])), a = (o) => o.map((l) => n.get(l) || String(l)).join(", ");
|
|
3676
3682
|
return /* @__PURE__ */ i(
|
|
3677
|
-
|
|
3683
|
+
Ct,
|
|
3678
3684
|
{
|
|
3679
3685
|
rowKey: "id",
|
|
3680
3686
|
dataSource: e,
|
|
@@ -3685,7 +3691,7 @@ function kn({ entries: e, userRoles: t, onEdit: s, loading: r }) {
|
|
|
3685
3691
|
{
|
|
3686
3692
|
title: "Level 1",
|
|
3687
3693
|
key: "l1",
|
|
3688
|
-
render: (o, l) => /* @__PURE__ */
|
|
3694
|
+
render: (o, l) => /* @__PURE__ */ u("span", { children: [
|
|
3689
3695
|
l.l1.minutes ? `Action taken in (${l.l1.minutes} Mins)` : "No Action taken in 0 Min",
|
|
3690
3696
|
l.l1.roles?.length ? `, Escalate to (${a(l.l1.roles)})` : ""
|
|
3691
3697
|
] })
|
|
@@ -3693,7 +3699,7 @@ function kn({ entries: e, userRoles: t, onEdit: s, loading: r }) {
|
|
|
3693
3699
|
{
|
|
3694
3700
|
title: "Level 2",
|
|
3695
3701
|
key: "l2",
|
|
3696
|
-
render: (o, l) => /* @__PURE__ */
|
|
3702
|
+
render: (o, l) => /* @__PURE__ */ u("span", { children: [
|
|
3697
3703
|
l.l2.minutes ? `Action taken in (${l.l2.minutes} Mins)` : "No Action taken in 0 Min",
|
|
3698
3704
|
l.l2.roles?.length ? `, Escalate to (${a(l.l2.roles)})` : ""
|
|
3699
3705
|
] })
|
|
@@ -3701,7 +3707,7 @@ function kn({ entries: e, userRoles: t, onEdit: s, loading: r }) {
|
|
|
3701
3707
|
{
|
|
3702
3708
|
title: "Level 3",
|
|
3703
3709
|
key: "l3",
|
|
3704
|
-
render: (o, l) => /* @__PURE__ */
|
|
3710
|
+
render: (o, l) => /* @__PURE__ */ u("span", { children: [
|
|
3705
3711
|
l.l3.minutes ? `Action taken in (${l.l3.minutes} Mins)` : "No Action taken in 0 Min",
|
|
3706
3712
|
l.l3.roles?.length ? `, Escalate to (${a(l.l3.roles)})` : ""
|
|
3707
3713
|
] })
|
|
@@ -3729,15 +3735,15 @@ function kn({ entries: e, userRoles: t, onEdit: s, loading: r }) {
|
|
|
3729
3735
|
{
|
|
3730
3736
|
title: "Actions",
|
|
3731
3737
|
key: "ops",
|
|
3732
|
-
render: (o, l) => /* @__PURE__ */ i(Se, { type: "text", onClick: () => s(l.id), children: /* @__PURE__ */ i(
|
|
3738
|
+
render: (o, l) => /* @__PURE__ */ i(Se, { type: "text", onClick: () => s(l.id), children: /* @__PURE__ */ i(Ys, {}) })
|
|
3733
3739
|
}
|
|
3734
3740
|
]
|
|
3735
3741
|
}
|
|
3736
3742
|
);
|
|
3737
3743
|
}
|
|
3738
|
-
const { Title: En } =
|
|
3744
|
+
const { Title: En } = ze;
|
|
3739
3745
|
function On({ userRoles: e, rules: t, rawRules: s }) {
|
|
3740
|
-
const { rules: r } =
|
|
3746
|
+
const { rules: r } = Re(), [n, a] = w(!1), [o, l] = w(s), [h, d] = w({}), c = ue(() => e.map((m) => ({ label: m.userRoleName, value: m.userRoleId })), [e]), S = ue(
|
|
3741
3747
|
() => (t || []).map((m, A) => ({
|
|
3742
3748
|
key: m.RuleId || m.Name || String(A),
|
|
3743
3749
|
ruleName: m.Name || "-",
|
|
@@ -3751,7 +3757,7 @@ function On({ userRoles: e, rules: t, rawRules: s }) {
|
|
|
3751
3757
|
try {
|
|
3752
3758
|
a(!0);
|
|
3753
3759
|
const A = await r.getRules();
|
|
3754
|
-
m || (l(Array.isArray(A) ? A : []),
|
|
3760
|
+
m || (l(Array.isArray(A) ? A : []), d({}));
|
|
3755
3761
|
} catch {
|
|
3756
3762
|
!m && Array.isArray(s) && l(s);
|
|
3757
3763
|
} finally {
|
|
@@ -3767,18 +3773,18 @@ function On({ userRoles: e, rules: t, rawRules: s }) {
|
|
|
3767
3773
|
if (!Array.isArray(o) || !o.length) return {};
|
|
3768
3774
|
const m = {};
|
|
3769
3775
|
for (const A of S) {
|
|
3770
|
-
const
|
|
3771
|
-
(
|
|
3772
|
-
|
|
3773
|
-
),
|
|
3774
|
-
|
|
3776
|
+
const B = o.find(
|
|
3777
|
+
(L) => L?.ruleId === A.key || L?.ruleName === A.key || L?.RuleId === A.key || L?.ruleName === A.ruleName || // fallback by name
|
|
3778
|
+
L?.Name === A.ruleName
|
|
3779
|
+
), U = Array.isArray(B?.userRoleIds) ? B.userRoleIds : [];
|
|
3780
|
+
U.length && (m[A.key] = U);
|
|
3775
3781
|
}
|
|
3776
3782
|
return m;
|
|
3777
3783
|
}, [o, S]);
|
|
3778
|
-
return /* @__PURE__ */
|
|
3784
|
+
return /* @__PURE__ */ u("div", { className: "w-full", children: [
|
|
3779
3785
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ i(En, { level: 4, className: "!mb-4", children: "Alert Assignment" }) }),
|
|
3780
3786
|
/* @__PURE__ */ i(
|
|
3781
|
-
|
|
3787
|
+
Ct,
|
|
3782
3788
|
{
|
|
3783
3789
|
rowKey: "key",
|
|
3784
3790
|
dataSource: S,
|
|
@@ -3791,13 +3797,13 @@ function On({ userRoles: e, rules: t, rawRules: s }) {
|
|
|
3791
3797
|
title: "Alert Notification To",
|
|
3792
3798
|
key: "assign",
|
|
3793
3799
|
render: (m, A) => /* @__PURE__ */ i(
|
|
3794
|
-
|
|
3800
|
+
Ae,
|
|
3795
3801
|
{
|
|
3796
3802
|
mode: "multiple",
|
|
3797
3803
|
placeholder: "Dropdown with Multi select",
|
|
3798
3804
|
className: "w-full",
|
|
3799
3805
|
value: h[A.key] ?? f[A.key] ?? [],
|
|
3800
|
-
onChange: (
|
|
3806
|
+
onChange: (B) => d((U) => ({ ...U, [A.key]: B })),
|
|
3801
3807
|
options: c
|
|
3802
3808
|
}
|
|
3803
3809
|
)
|
|
@@ -3805,9 +3811,9 @@ function On({ userRoles: e, rules: t, rawRules: s }) {
|
|
|
3805
3811
|
]
|
|
3806
3812
|
}
|
|
3807
3813
|
),
|
|
3808
|
-
/* @__PURE__ */
|
|
3814
|
+
/* @__PURE__ */ u(ke, { className: "mt-4", children: [
|
|
3809
3815
|
/* @__PURE__ */ i(Se, { onClick: () => {
|
|
3810
|
-
|
|
3816
|
+
d({});
|
|
3811
3817
|
}, disabled: n, children: "Clear" }),
|
|
3812
3818
|
/* @__PURE__ */ i(
|
|
3813
3819
|
Se,
|
|
@@ -3816,24 +3822,24 @@ function On({ userRoles: e, rules: t, rawRules: s }) {
|
|
|
3816
3822
|
onClick: async () => {
|
|
3817
3823
|
try {
|
|
3818
3824
|
if (!o || !Array.isArray(o) || Object.keys(h).length === 0) {
|
|
3819
|
-
|
|
3825
|
+
ve.info("No changes to save");
|
|
3820
3826
|
return;
|
|
3821
3827
|
}
|
|
3822
3828
|
a(!0);
|
|
3823
|
-
const m = Object.entries(h).map(async ([A,
|
|
3824
|
-
const
|
|
3829
|
+
const m = Object.entries(h).map(async ([A, B]) => {
|
|
3830
|
+
const U = o.find(
|
|
3825
3831
|
(K) => K?.ruleId === A || K?.ruleName === A || K?.RuleId === A
|
|
3826
|
-
),
|
|
3827
|
-
if (!
|
|
3832
|
+
), L = typeof U?.recordId == "number" ? U.recordId : void 0;
|
|
3833
|
+
if (!U || typeof L != "number")
|
|
3828
3834
|
throw new Error(`Unable to find recordId for rule ${A}`);
|
|
3829
|
-
const O = Array.isArray(
|
|
3835
|
+
const O = Array.isArray(B) ? B : [], Z = O.map((K) => {
|
|
3830
3836
|
const z = e.find((I) => I.userRoleId === K);
|
|
3831
3837
|
return {
|
|
3832
3838
|
id: K,
|
|
3833
3839
|
name: z?.userRoleName ?? String(K)
|
|
3834
3840
|
};
|
|
3835
|
-
}),
|
|
3836
|
-
...
|
|
3841
|
+
}), H = {
|
|
3842
|
+
...U,
|
|
3837
3843
|
ruleId: A,
|
|
3838
3844
|
// ensure ruleId matches the selected rule
|
|
3839
3845
|
userRoleIds: O,
|
|
@@ -3852,12 +3858,12 @@ function On({ userRoles: e, rules: t, rawRules: s }) {
|
|
|
3852
3858
|
}
|
|
3853
3859
|
]
|
|
3854
3860
|
};
|
|
3855
|
-
return r.updateRule(
|
|
3861
|
+
return r.updateRule(L, H);
|
|
3856
3862
|
});
|
|
3857
|
-
await Promise.all(m),
|
|
3863
|
+
await Promise.all(m), ve.success("Alert assignment saved");
|
|
3858
3864
|
try {
|
|
3859
3865
|
const A = await r.getRules();
|
|
3860
|
-
l(Array.isArray(A) ? A : []),
|
|
3866
|
+
l(Array.isArray(A) ? A : []), d({});
|
|
3861
3867
|
} catch (A) {
|
|
3862
3868
|
console.error("Failed to refresh rules after save", A);
|
|
3863
3869
|
}
|
|
@@ -3875,151 +3881,151 @@ function On({ userRoles: e, rules: t, rawRules: s }) {
|
|
|
3875
3881
|
] })
|
|
3876
3882
|
] });
|
|
3877
3883
|
}
|
|
3878
|
-
const { Title:
|
|
3879
|
-
function
|
|
3880
|
-
const { rules: a, alerts: o } =
|
|
3884
|
+
const { Title: os } = ze;
|
|
3885
|
+
function Mn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
3886
|
+
const { rules: a, alerts: o } = Re(), [l, h] = w("By Severity"), [d, c] = w("By severity"), [S, f] = w("By Severity"), [R, N] = w(!1), [m, A] = w(!1), [B, U] = w(!1), [L, O] = w(null), [Z, H] = w("rules"), [K, z] = w(), [I, T] = w(), [k, Y] = w(), [ee, E] = w(), [v, p] = w(), [x, y] = w(), [b, g] = w(), [M, F] = w(), [$, j] = w([]), [q, re] = w([]), [ae, oe] = w(!1), [pe, te] = w(!1), [le, xe] = w({}), [be, qe] = w({}), [he, Ee] = w(s || []), [Ze, C] = w([]), [G, ne] = w(!1), [Oe, J] = w(!1), [fe, Ge] = w(r || []);
|
|
3881
3887
|
de(() => {
|
|
3882
|
-
r && r.length &&
|
|
3888
|
+
r && r.length && Ge(r);
|
|
3883
3889
|
}, [r]), de(() => {
|
|
3884
|
-
if (!
|
|
3885
|
-
const
|
|
3886
|
-
if (
|
|
3887
|
-
const
|
|
3888
|
-
const
|
|
3890
|
+
if (!fe || !fe.length) return;
|
|
3891
|
+
const P = Object.keys(le).length > 0 || Object.keys(be).length > 0;
|
|
3892
|
+
if (Ze.length && !P) return;
|
|
3893
|
+
const X = fe.map((_, D) => {
|
|
3894
|
+
const V = t.find((ye) => ye.RuleId === (_.ruleId || _.ruleName))?.Name || _.ruleName || _.Name || "-", Q = _.escalationSettings || {}, se = typeof Q.level1UserRoleId == "number" && Q.level1UserRoleId > 0 ? [Q.level1UserRoleId] : [], Me = typeof Q.level2UserRoleId == "number" && Q.level2UserRoleId > 0 ? [Q.level2UserRoleId] : [], ut = typeof Q.level3UserRoleId == "number" && Q.level3UserRoleId > 0 ? [Q.level3UserRoleId] : [], Ut = (Array.isArray(Q.escalationSettingsActionTypeIds) ? Q.escalationSettingsActionTypeIds : []).map((ye) => le[ye] || String(ye)), $t = (Array.isArray(Q.thirdPartyId) ? Q.thirdPartyId : []).map((ye) => be[ye] || String(ye)), dt = typeof Q.humanLoop == "boolean" ? Q.humanLoop : null, ht = typeof Q.isAutoExpire == "boolean" ? Q.isAutoExpire : null;
|
|
3889
3895
|
return {
|
|
3890
|
-
id: String(_.ruleId || _.ruleName ||
|
|
3891
|
-
ruleOrSeverityLabel:
|
|
3896
|
+
id: String(_.ruleId || _.ruleName || D),
|
|
3897
|
+
ruleOrSeverityLabel: V,
|
|
3892
3898
|
l1: { minutes: Q.level1PostAssistTime ?? void 0, roles: se },
|
|
3893
|
-
l2: { minutes: Q.level2PostAssistTime ?? void 0, roles:
|
|
3894
|
-
l3: { minutes: Q.level3PostAssistTime ?? void 0, roles:
|
|
3895
|
-
actions:
|
|
3896
|
-
notify:
|
|
3897
|
-
humanLoop:
|
|
3898
|
-
isAutoExpire:
|
|
3899
|
+
l2: { minutes: Q.level2PostAssistTime ?? void 0, roles: Me },
|
|
3900
|
+
l3: { minutes: Q.level3PostAssistTime ?? void 0, roles: ut },
|
|
3901
|
+
actions: Ut,
|
|
3902
|
+
notify: $t,
|
|
3903
|
+
humanLoop: dt,
|
|
3904
|
+
isAutoExpire: ht
|
|
3899
3905
|
};
|
|
3900
3906
|
});
|
|
3901
|
-
C(
|
|
3902
|
-
}, [
|
|
3903
|
-
const
|
|
3904
|
-
() => e.map((
|
|
3907
|
+
C(X);
|
|
3908
|
+
}, [fe, t, le, be]);
|
|
3909
|
+
const we = ue(
|
|
3910
|
+
() => e.map((P) => ({ label: P.DisplayName, value: P.SeverityId })),
|
|
3905
3911
|
[e]
|
|
3906
|
-
),
|
|
3907
|
-
() => t.map((
|
|
3912
|
+
), ct = ue(
|
|
3913
|
+
() => t.map((P) => ({ label: P.Name, value: P.RuleId })),
|
|
3908
3914
|
[t]
|
|
3909
|
-
),
|
|
3910
|
-
() =>
|
|
3911
|
-
[
|
|
3912
|
-
),
|
|
3915
|
+
), Os = ue(
|
|
3916
|
+
() => he.map((P) => ({ label: P.userRoleName, value: P.userRoleId })),
|
|
3917
|
+
[he]
|
|
3918
|
+
), Ms = ue(() => [1, 3, 5, 10, 15, 20, 30, 45, 60].map((P) => ({ label: `${P}`, value: P })), []);
|
|
3913
3919
|
de(() => {
|
|
3914
|
-
let
|
|
3915
|
-
async function
|
|
3920
|
+
let P = !1;
|
|
3921
|
+
async function X() {
|
|
3916
3922
|
try {
|
|
3917
|
-
|
|
3923
|
+
U(!0), O(null);
|
|
3918
3924
|
const _ = await o.getAdminSettings();
|
|
3919
|
-
if (!
|
|
3920
|
-
const
|
|
3921
|
-
h(
|
|
3925
|
+
if (!P && _) {
|
|
3926
|
+
const D = fs(_.sortBy);
|
|
3927
|
+
h(D), f(D), N(!1);
|
|
3922
3928
|
}
|
|
3923
3929
|
} catch (_) {
|
|
3924
|
-
if (!
|
|
3925
|
-
const
|
|
3926
|
-
O(
|
|
3930
|
+
if (!P) {
|
|
3931
|
+
const D = _ instanceof Error ? _.message : "Failed to load admin settings";
|
|
3932
|
+
O(D);
|
|
3927
3933
|
}
|
|
3928
3934
|
} finally {
|
|
3929
|
-
|
|
3935
|
+
P || U(!1);
|
|
3930
3936
|
}
|
|
3931
3937
|
}
|
|
3932
|
-
return
|
|
3933
|
-
|
|
3938
|
+
return X(), () => {
|
|
3939
|
+
P = !0;
|
|
3934
3940
|
};
|
|
3935
3941
|
}, []), de(() => {
|
|
3936
3942
|
if (!I) return;
|
|
3937
|
-
const
|
|
3938
|
-
const Q = Number(
|
|
3943
|
+
const P = (V) => {
|
|
3944
|
+
const Q = Number(V);
|
|
3939
3945
|
return !isNaN(Q) && Q > 0 ? Q : void 0;
|
|
3940
|
-
},
|
|
3941
|
-
const Q = Number(
|
|
3946
|
+
}, X = (V) => {
|
|
3947
|
+
const Q = Number(V);
|
|
3942
3948
|
return !isNaN(Q) && Q > 0 ? Q : void 0;
|
|
3943
|
-
},
|
|
3944
|
-
(
|
|
3949
|
+
}, D = (fe || []).find(
|
|
3950
|
+
(V) => V?.ruleId === I || V?.ruleName === I || V?.RuleId === I
|
|
3945
3951
|
)?.escalationSettings;
|
|
3946
|
-
if (
|
|
3947
|
-
Y(
|
|
3948
|
-
const
|
|
3949
|
-
|
|
3952
|
+
if (D && typeof D == "object") {
|
|
3953
|
+
Y(X(D.level1PostAssistTime)), E(P(D.level1UserRoleId)), p(X(D.level2PostAssistTime)), y(P(D.level2UserRoleId)), g(X(D.level3PostAssistTime)), F(P(D.level3UserRoleId));
|
|
3954
|
+
const V = Array.isArray(D.escalationSettingsActionTypeIds) ? D.escalationSettingsActionTypeIds : [];
|
|
3955
|
+
j(V.map((Q) => String(Q))), re(Array.isArray(D.thirdPartyId) ? D.thirdPartyId : []), oe(!!D.humanLoop), te(!!D.isAutoExpire);
|
|
3950
3956
|
}
|
|
3951
|
-
}, [Z, I,
|
|
3952
|
-
const
|
|
3957
|
+
}, [Z, I, fe]);
|
|
3958
|
+
const Ps = async () => {
|
|
3953
3959
|
try {
|
|
3954
|
-
|
|
3955
|
-
const
|
|
3956
|
-
|
|
3957
|
-
const _ =
|
|
3958
|
-
const Q = t.find((
|
|
3960
|
+
J(!0);
|
|
3961
|
+
const P = await a.getRules(), X = Array.isArray(P) ? P : Array.isArray(P?.data) ? P.data : [];
|
|
3962
|
+
Ge(X);
|
|
3963
|
+
const _ = X.map((D, V) => {
|
|
3964
|
+
const Q = t.find((ye) => ye.RuleId === (D.ruleId || D.ruleName))?.Name || D.ruleName || D.Name || "-", se = D.escalationSettings || {}, Me = typeof se.level1UserRoleId == "number" && se.level1UserRoleId > 0 ? [se.level1UserRoleId] : [], ut = typeof se.level2UserRoleId == "number" && se.level2UserRoleId > 0 ? [se.level2UserRoleId] : [], Ft = typeof se.level3UserRoleId == "number" && se.level3UserRoleId > 0 ? [se.level3UserRoleId] : [], Lt = (Array.isArray(se.escalationSettingsActionTypeIds) ? se.escalationSettingsActionTypeIds : []).map((ye) => le[ye] || String(ye)), dt = (Array.isArray(se.thirdPartyId) ? se.thirdPartyId : []).map((ye) => be[ye] || String(ye)), ht = typeof se.humanLoop == "boolean" ? se.humanLoop : null;
|
|
3959
3965
|
return {
|
|
3960
|
-
id: String(
|
|
3966
|
+
id: String(D.ruleId || D.ruleName || V),
|
|
3961
3967
|
ruleOrSeverityLabel: Q,
|
|
3962
|
-
l1: { minutes: se.level1PostAssistTime ?? void 0, roles:
|
|
3963
|
-
l2: { minutes: se.level2PostAssistTime ?? void 0, roles:
|
|
3964
|
-
l3: { minutes: se.level3PostAssistTime ?? void 0, roles:
|
|
3965
|
-
actions:
|
|
3966
|
-
notify:
|
|
3967
|
-
humanLoop:
|
|
3968
|
+
l1: { minutes: se.level1PostAssistTime ?? void 0, roles: Me },
|
|
3969
|
+
l2: { minutes: se.level2PostAssistTime ?? void 0, roles: ut },
|
|
3970
|
+
l3: { minutes: se.level3PostAssistTime ?? void 0, roles: Ft },
|
|
3971
|
+
actions: Lt,
|
|
3972
|
+
notify: dt,
|
|
3973
|
+
humanLoop: ht
|
|
3968
3974
|
};
|
|
3969
3975
|
});
|
|
3970
3976
|
C(_);
|
|
3971
|
-
} catch (
|
|
3972
|
-
console.error("Failed to refetch entries",
|
|
3977
|
+
} catch (P) {
|
|
3978
|
+
console.error("Failed to refetch entries", P);
|
|
3973
3979
|
} finally {
|
|
3974
|
-
|
|
3980
|
+
J(!1);
|
|
3975
3981
|
}
|
|
3976
3982
|
};
|
|
3977
3983
|
return de(() => {
|
|
3978
|
-
let
|
|
3984
|
+
let P = !1;
|
|
3979
3985
|
return (async () => {
|
|
3980
3986
|
try {
|
|
3981
|
-
const
|
|
3982
|
-
if (
|
|
3987
|
+
const X = await a.getLookups();
|
|
3988
|
+
if (P || !X) return;
|
|
3983
3989
|
const _ = {};
|
|
3984
|
-
if (Array.isArray(
|
|
3985
|
-
for (const
|
|
3986
|
-
typeof
|
|
3987
|
-
|
|
3988
|
-
const
|
|
3989
|
-
userRoleId:
|
|
3990
|
-
userRoleName:
|
|
3990
|
+
if (Array.isArray(X.thirdParties))
|
|
3991
|
+
for (const V of X.thirdParties)
|
|
3992
|
+
typeof V.thirdPartyId == "number" && (_[V.thirdPartyId] = V.thirdPartyName);
|
|
3993
|
+
qe(_);
|
|
3994
|
+
const D = Array.isArray(X.userRoles) ? X.userRoles.map((V) => ({
|
|
3995
|
+
userRoleId: V.userRoleId ?? V.id,
|
|
3996
|
+
userRoleName: V.userRoleName ?? V.name
|
|
3991
3997
|
})) : [];
|
|
3992
|
-
|
|
3993
|
-
} catch (
|
|
3994
|
-
console.error("Error loading lookups",
|
|
3998
|
+
P || Ee(D.length ? D : s || []);
|
|
3999
|
+
} catch (X) {
|
|
4000
|
+
console.error("Error loading lookups", X);
|
|
3995
4001
|
}
|
|
3996
4002
|
})(), () => {
|
|
3997
|
-
|
|
4003
|
+
P = !0;
|
|
3998
4004
|
};
|
|
3999
|
-
}, []), /* @__PURE__ */
|
|
4000
|
-
/* @__PURE__ */
|
|
4001
|
-
/* @__PURE__ */ i(
|
|
4002
|
-
/* @__PURE__ */
|
|
4003
|
-
|
|
4005
|
+
}, []), /* @__PURE__ */ u("div", { className: "w-full", children: [
|
|
4006
|
+
/* @__PURE__ */ u("div", { className: "mb-6", children: [
|
|
4007
|
+
/* @__PURE__ */ i(os, { level: 4, className: "!mb-2", children: "Admin Settings" }),
|
|
4008
|
+
/* @__PURE__ */ u(Tt, { spinning: B, children: [
|
|
4009
|
+
L ? /* @__PURE__ */ u("div", { className: "text-sm text-red-600 mb-2", children: [
|
|
4004
4010
|
"Failed to load settings: ",
|
|
4005
|
-
|
|
4011
|
+
L
|
|
4006
4012
|
] }) : null,
|
|
4007
4013
|
/* @__PURE__ */ i(
|
|
4008
4014
|
In,
|
|
4009
4015
|
{
|
|
4010
4016
|
sortBy: l,
|
|
4011
|
-
groupBy:
|
|
4012
|
-
onChange: (
|
|
4013
|
-
|
|
4017
|
+
groupBy: d,
|
|
4018
|
+
onChange: (P) => {
|
|
4019
|
+
P.sortBy && (h(P.sortBy), N(!0)), P.groupBy && (c(P.groupBy), N(!0));
|
|
4014
4020
|
},
|
|
4015
4021
|
showActions: R,
|
|
4016
4022
|
onSave: async () => {
|
|
4017
4023
|
A(!0);
|
|
4018
4024
|
try {
|
|
4019
|
-
const
|
|
4020
|
-
|
|
4021
|
-
} catch (
|
|
4022
|
-
console.error("Error saving admin settings",
|
|
4025
|
+
const P = await o.setAdminSettings({ sortBy: l, groupBy: "string" });
|
|
4026
|
+
P?.responseStatus && P?.data && ve.success(P.data), f(l), N(!1);
|
|
4027
|
+
} catch (P) {
|
|
4028
|
+
console.error("Error saving admin settings", P);
|
|
4023
4029
|
} finally {
|
|
4024
4030
|
A(!1);
|
|
4025
4031
|
}
|
|
@@ -4032,25 +4038,25 @@ function Pn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
4032
4038
|
)
|
|
4033
4039
|
] })
|
|
4034
4040
|
] }),
|
|
4035
|
-
/* @__PURE__ */ i(
|
|
4036
|
-
/* @__PURE__ */
|
|
4037
|
-
/* @__PURE__ */ i(
|
|
4041
|
+
/* @__PURE__ */ i(We, { className: "my-6" }),
|
|
4042
|
+
/* @__PURE__ */ u("div", { children: [
|
|
4043
|
+
/* @__PURE__ */ i(os, { level: 4, className: "!mb-4", children: "Escalation Settings" }),
|
|
4038
4044
|
/* @__PURE__ */ i(
|
|
4039
4045
|
Rn,
|
|
4040
4046
|
{
|
|
4041
4047
|
escBasis: Z,
|
|
4042
|
-
setEscBasis:
|
|
4048
|
+
setEscBasis: H,
|
|
4043
4049
|
selectedSeverity: K,
|
|
4044
4050
|
setSelectedSeverity: z,
|
|
4045
4051
|
selectedRule: I,
|
|
4046
4052
|
setSelectedRule: T,
|
|
4047
|
-
severityOptions:
|
|
4048
|
-
ruleOptions:
|
|
4049
|
-
minsOptions:
|
|
4050
|
-
roleOptions:
|
|
4053
|
+
severityOptions: we,
|
|
4054
|
+
ruleOptions: ct,
|
|
4055
|
+
minsOptions: Ms,
|
|
4056
|
+
roleOptions: Os,
|
|
4051
4057
|
l1mins: k,
|
|
4052
4058
|
setL1mins: Y,
|
|
4053
|
-
l1role:
|
|
4059
|
+
l1role: ee,
|
|
4054
4060
|
setL1role: E,
|
|
4055
4061
|
l2mins: v,
|
|
4056
4062
|
setL2mins: p,
|
|
@@ -4058,41 +4064,41 @@ function Pn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
4058
4064
|
setL2role: y,
|
|
4059
4065
|
l3mins: b,
|
|
4060
4066
|
setL3mins: g,
|
|
4061
|
-
l3role:
|
|
4062
|
-
setL3role:
|
|
4063
|
-
actions:
|
|
4064
|
-
setActions:
|
|
4067
|
+
l3role: M,
|
|
4068
|
+
setL3role: F,
|
|
4069
|
+
actions: $,
|
|
4070
|
+
setActions: j,
|
|
4065
4071
|
thirdPartyIds: q,
|
|
4066
|
-
setThirdPartyIds:
|
|
4067
|
-
humanLoop:
|
|
4072
|
+
setThirdPartyIds: re,
|
|
4073
|
+
humanLoop: ae,
|
|
4068
4074
|
setHumanLoop: oe,
|
|
4069
4075
|
onClear: () => {
|
|
4070
|
-
h("By Severity"), c("By severity"),
|
|
4076
|
+
h("By Severity"), c("By severity"), H("rules"), z(void 0), T(void 0), Y(void 0), E(void 0), p(void 0), y(void 0), g(void 0), F(void 0), j([]), re([]), oe(!1), te(!1);
|
|
4071
4077
|
},
|
|
4072
4078
|
onSave: async () => {
|
|
4073
|
-
|
|
4079
|
+
ne(!0), n?.({
|
|
4074
4080
|
ruleId: I,
|
|
4075
4081
|
levels: [
|
|
4076
|
-
{ minutes: k, role:
|
|
4082
|
+
{ minutes: k, role: ee },
|
|
4077
4083
|
{ minutes: v, role: x },
|
|
4078
|
-
{ minutes: b, role:
|
|
4084
|
+
{ minutes: b, role: M }
|
|
4079
4085
|
],
|
|
4080
|
-
actions:
|
|
4086
|
+
actions: $,
|
|
4081
4087
|
thirdPartyIds: q,
|
|
4082
|
-
humanLoop:
|
|
4083
|
-
isAutoExpire:
|
|
4088
|
+
humanLoop: ae,
|
|
4089
|
+
isAutoExpire: pe
|
|
4084
4090
|
});
|
|
4085
4091
|
try {
|
|
4086
4092
|
if (I) {
|
|
4087
|
-
const _ = Array.isArray(
|
|
4088
|
-
(
|
|
4089
|
-
),
|
|
4090
|
-
if (!
|
|
4091
|
-
|
|
4093
|
+
const _ = Array.isArray($) ? $.map((Me) => Number(Me)) : [], D = (fe || []).find(
|
|
4094
|
+
(Me) => Me?.ruleId === I || Me?.ruleName === I || Me?.RuleId === I
|
|
4095
|
+
), V = typeof D?.recordId == "number" ? D.recordId : void 0;
|
|
4096
|
+
if (!D || typeof V != "number") {
|
|
4097
|
+
ve.error("Unable to find rule recordId for update");
|
|
4092
4098
|
return;
|
|
4093
4099
|
}
|
|
4094
4100
|
const Q = {
|
|
4095
|
-
...
|
|
4101
|
+
...D,
|
|
4096
4102
|
actions: [
|
|
4097
4103
|
//this will definitely be remoed
|
|
4098
4104
|
{
|
|
@@ -4108,84 +4114,84 @@ function Pn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
4108
4114
|
}
|
|
4109
4115
|
],
|
|
4110
4116
|
escalationSettings: {
|
|
4111
|
-
level1UserRoleId:
|
|
4117
|
+
level1UserRoleId: ee ?? 0,
|
|
4112
4118
|
level1PostAssistTime: k ?? 0,
|
|
4113
4119
|
level2UserRoleId: x ?? 0,
|
|
4114
4120
|
level2PostAssistTime: v ?? 0,
|
|
4115
|
-
level3UserRoleId:
|
|
4121
|
+
level3UserRoleId: M ?? 0,
|
|
4116
4122
|
level3PostAssistTime: b ?? 0,
|
|
4117
4123
|
escalationSettingsActionTypeIds: _,
|
|
4118
4124
|
thirdPartyId: Array.isArray(q) ? q : [],
|
|
4119
|
-
humanLoop:
|
|
4120
|
-
isAutoExpire:
|
|
4125
|
+
humanLoop: ae,
|
|
4126
|
+
isAutoExpire: pe
|
|
4121
4127
|
}
|
|
4122
|
-
}, se = await a.updateRule(
|
|
4128
|
+
}, se = await a.updateRule(V, Q);
|
|
4123
4129
|
if (se?.responseStatus || se?.ok || se) {
|
|
4124
|
-
|
|
4130
|
+
ve.success("Escalation settings saved"), await Ps(), T(void 0), Y(void 0), E(void 0), p(void 0), y(void 0), g(void 0), F(void 0), j([]), re([]), oe(!1), te(!1);
|
|
4125
4131
|
return;
|
|
4126
4132
|
}
|
|
4127
4133
|
}
|
|
4128
4134
|
} catch (_) {
|
|
4129
4135
|
console.error("Error saving escalation settings", _);
|
|
4130
4136
|
} finally {
|
|
4131
|
-
|
|
4137
|
+
ne(!1);
|
|
4132
4138
|
}
|
|
4133
|
-
const
|
|
4139
|
+
const X = t.find((_) => _.RuleId === I)?.Name || "-";
|
|
4134
4140
|
C((_) => [
|
|
4135
4141
|
..._,
|
|
4136
4142
|
{
|
|
4137
4143
|
id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
4138
|
-
ruleOrSeverityLabel:
|
|
4139
|
-
l1: { minutes: k, roles:
|
|
4144
|
+
ruleOrSeverityLabel: X,
|
|
4145
|
+
l1: { minutes: k, roles: ee ? [ee] : [] },
|
|
4140
4146
|
l2: { minutes: v, roles: x ? [x] : [] },
|
|
4141
|
-
l3: { minutes: b, roles:
|
|
4142
|
-
actions: (Array.isArray(
|
|
4143
|
-
const
|
|
4144
|
-
return le[
|
|
4147
|
+
l3: { minutes: b, roles: M ? [M] : [] },
|
|
4148
|
+
actions: (Array.isArray($) ? $ : []).map((D) => {
|
|
4149
|
+
const V = Number(D);
|
|
4150
|
+
return le[V] || String(D);
|
|
4145
4151
|
}),
|
|
4146
|
-
notify: (Array.isArray(q) ? q : []).map((
|
|
4147
|
-
humanLoop: !!
|
|
4148
|
-
isAutoExpire: !!
|
|
4152
|
+
notify: (Array.isArray(q) ? q : []).map((D) => be[D] || String(D)),
|
|
4153
|
+
humanLoop: !!ae,
|
|
4154
|
+
isAutoExpire: !!pe
|
|
4149
4155
|
}
|
|
4150
4156
|
]);
|
|
4151
4157
|
},
|
|
4152
|
-
saving:
|
|
4153
|
-
onActionTypesLoaded: (
|
|
4154
|
-
const
|
|
4155
|
-
for (const _ of
|
|
4156
|
-
typeof _.actionTypeId == "number" && (
|
|
4157
|
-
|
|
4158
|
+
saving: G,
|
|
4159
|
+
onActionTypesLoaded: (P) => {
|
|
4160
|
+
const X = {};
|
|
4161
|
+
for (const _ of P)
|
|
4162
|
+
typeof _.actionTypeId == "number" && (X[_.actionTypeId] = _.name);
|
|
4163
|
+
xe(X);
|
|
4158
4164
|
},
|
|
4159
|
-
isAutoExpire:
|
|
4160
|
-
setAutoExpire:
|
|
4165
|
+
isAutoExpire: pe,
|
|
4166
|
+
setAutoExpire: te
|
|
4161
4167
|
}
|
|
4162
4168
|
)
|
|
4163
4169
|
] }),
|
|
4164
|
-
/* @__PURE__ */ i(
|
|
4170
|
+
/* @__PURE__ */ i(We, { className: "my-6" }),
|
|
4165
4171
|
/* @__PURE__ */ i(
|
|
4166
4172
|
kn,
|
|
4167
4173
|
{
|
|
4168
|
-
entries:
|
|
4169
|
-
userRoles:
|
|
4170
|
-
loading:
|
|
4171
|
-
onEdit: (
|
|
4172
|
-
|
|
4173
|
-
const
|
|
4174
|
-
T(_ ? _.RuleId :
|
|
4174
|
+
entries: Ze,
|
|
4175
|
+
userRoles: he,
|
|
4176
|
+
loading: Oe,
|
|
4177
|
+
onEdit: (P) => {
|
|
4178
|
+
H("rules");
|
|
4179
|
+
const X = Ze.find((D) => D.id === P), _ = t.find((D) => D.RuleId === P) || (X ? t.find((D) => D.Name === X.ruleOrSeverityLabel) : void 0);
|
|
4180
|
+
T(_ ? _.RuleId : P);
|
|
4175
4181
|
}
|
|
4176
4182
|
}
|
|
4177
4183
|
),
|
|
4178
|
-
/* @__PURE__ */ i(
|
|
4179
|
-
/* @__PURE__ */ i(On, { userRoles:
|
|
4180
|
-
/* @__PURE__ */ i(
|
|
4184
|
+
/* @__PURE__ */ i(We, { className: "my-6" }),
|
|
4185
|
+
/* @__PURE__ */ i(On, { userRoles: he, rules: t, rawRules: r }),
|
|
4186
|
+
/* @__PURE__ */ i(We, {})
|
|
4181
4187
|
] });
|
|
4182
4188
|
}
|
|
4183
|
-
const { Title:
|
|
4184
|
-
function
|
|
4185
|
-
const { rules: n, alerts: a } =
|
|
4189
|
+
const { Title: ls, Text: st } = ze;
|
|
4190
|
+
function Pn({ severities: e, rules: t, onSave: s, onCancel: r }) {
|
|
4191
|
+
const { rules: n, alerts: a } = Re(), o = [
|
|
4186
4192
|
{ label: "By Severity", value: "By Severity" },
|
|
4187
4193
|
{ label: "By Created Date", value: "By Created Date" }
|
|
4188
|
-
], [l, h] = w("By Severity"), [
|
|
4194
|
+
], [l, h] = w("By Severity"), [d, c] = w(/* @__PURE__ */ new Set()), [S, f] = w(null), [R, N] = w(null), [m, A] = w({ inApp: !1, sms: !1, email: !1 }), [B, U] = w([]), [L, O] = w(!0), [Z, H] = w(!1);
|
|
4189
4195
|
de(() => {
|
|
4190
4196
|
let I = !1;
|
|
4191
4197
|
return (async () => {
|
|
@@ -4198,8 +4204,8 @@ function Mn({ severities: e, rules: t, onSave: s, onCancel: r }) {
|
|
|
4198
4204
|
sms: !!T.sms,
|
|
4199
4205
|
email: !!T.email
|
|
4200
4206
|
});
|
|
4201
|
-
const k =
|
|
4202
|
-
h(k === "By Created Date" ? "By Created Date" : "By Severity"), f(
|
|
4207
|
+
const k = fs(T.sortBy);
|
|
4208
|
+
h(k === "By Created Date" ? "By Created Date" : "By Severity"), f(Kt(T.doNotDisturbStart)), N(Kt(T.doNotDisturbEnd)), Array.isArray(T.anomalyIds) && c(new Set(T.anomalyIds.map((Y) => String(Y))));
|
|
4203
4209
|
} catch (T) {
|
|
4204
4210
|
console.error("Error in loading my preferences: ", T);
|
|
4205
4211
|
}
|
|
@@ -4214,7 +4220,7 @@ function Mn({ severities: e, rules: t, onSave: s, onCancel: r }) {
|
|
|
4214
4220
|
const T = await n.getLookups();
|
|
4215
4221
|
if (I || !T) return;
|
|
4216
4222
|
const k = Array.isArray(T.anomalies) ? T.anomalies : [];
|
|
4217
|
-
|
|
4223
|
+
U(k);
|
|
4218
4224
|
} catch (T) {
|
|
4219
4225
|
console.error("Failed to load anomalies lookups", T);
|
|
4220
4226
|
} finally {
|
|
@@ -4232,7 +4238,7 @@ function Mn({ severities: e, rules: t, onSave: s, onCancel: r }) {
|
|
|
4232
4238
|
}, z = async () => {
|
|
4233
4239
|
s?.({
|
|
4234
4240
|
sortBy: l,
|
|
4235
|
-
subscribedRuleIds: Array.from(
|
|
4241
|
+
subscribedRuleIds: Array.from(d),
|
|
4236
4242
|
dnd: {
|
|
4237
4243
|
from: S,
|
|
4238
4244
|
to: R
|
|
@@ -4240,8 +4246,8 @@ function Mn({ severities: e, rules: t, onSave: s, onCancel: r }) {
|
|
|
4240
4246
|
channels: m
|
|
4241
4247
|
});
|
|
4242
4248
|
try {
|
|
4243
|
-
|
|
4244
|
-
const I = S ? S.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", T = R ? R.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", k = Array.from(
|
|
4249
|
+
H(!0);
|
|
4250
|
+
const I = S ? S.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", T = R ? R.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", k = Array.from(d).map((ee) => Number(ee)).filter((ee) => Number.isFinite(ee)), Y = await a.setPreferenceSettings({
|
|
4245
4251
|
anomalyIds: k,
|
|
4246
4252
|
doNotDisturbStart: I,
|
|
4247
4253
|
doNotDisturbEnd: T,
|
|
@@ -4250,48 +4256,48 @@ function Mn({ severities: e, rules: t, onSave: s, onCancel: r }) {
|
|
|
4250
4256
|
email: !!m.email,
|
|
4251
4257
|
sortBy: l
|
|
4252
4258
|
});
|
|
4253
|
-
Y?.responseStatus &&
|
|
4259
|
+
Y?.responseStatus && ve.success(Y?.data || "Preferences updated successfully.");
|
|
4254
4260
|
} catch (I) {
|
|
4255
4261
|
console.error("Error in saving my preferences: ", I);
|
|
4256
4262
|
} finally {
|
|
4257
|
-
|
|
4263
|
+
H(!1);
|
|
4258
4264
|
}
|
|
4259
4265
|
};
|
|
4260
|
-
return /* @__PURE__ */
|
|
4261
|
-
/* @__PURE__ */ i(
|
|
4262
|
-
/* @__PURE__ */ i(
|
|
4263
|
-
/* @__PURE__ */ i(
|
|
4266
|
+
return /* @__PURE__ */ u("div", { className: "w-full", children: [
|
|
4267
|
+
/* @__PURE__ */ i(Ne, { gutter: [16, 16], align: "middle", className: "mb-4", children: /* @__PURE__ */ i(W, { xs: 24, md: 8, children: /* @__PURE__ */ u(ke, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
|
|
4268
|
+
/* @__PURE__ */ i(st, { className: "text-gray-600", children: "Sort By:" }),
|
|
4269
|
+
/* @__PURE__ */ i(Ae, { className: "w-[240px]", value: l, options: o, onChange: h })
|
|
4264
4270
|
] }) }) }),
|
|
4265
|
-
/* @__PURE__ */
|
|
4266
|
-
/* @__PURE__ */ i(
|
|
4267
|
-
|
|
4271
|
+
/* @__PURE__ */ u("div", { className: "mb-4", children: [
|
|
4272
|
+
/* @__PURE__ */ i(ls, { level: 5, className: "!mb-2", children: "Anomalies" }),
|
|
4273
|
+
L ? /* @__PURE__ */ i("div", { className: "py-4", children: /* @__PURE__ */ i(Tt, {}) }) : /* @__PURE__ */ i(ke, { direction: "vertical", size: 10, className: "w-full", children: (Array.isArray(B) ? B : []).map((I) => {
|
|
4268
4274
|
const T = String(I.recordId), k = I.anomalyName;
|
|
4269
|
-
return /* @__PURE__ */ i(
|
|
4275
|
+
return /* @__PURE__ */ i(Qe, { checked: d.has(T), onChange: () => K(T), children: k }, T);
|
|
4270
4276
|
}) })
|
|
4271
4277
|
] }),
|
|
4272
|
-
/* @__PURE__ */
|
|
4273
|
-
/* @__PURE__ */ i(
|
|
4274
|
-
/* @__PURE__ */ i(
|
|
4275
|
-
/* @__PURE__ */ i(
|
|
4276
|
-
/* @__PURE__ */
|
|
4277
|
-
/* @__PURE__ */
|
|
4278
|
-
/* @__PURE__ */ i(
|
|
4279
|
-
/* @__PURE__ */ i(
|
|
4278
|
+
/* @__PURE__ */ u("div", { className: "mb-4", children: [
|
|
4279
|
+
/* @__PURE__ */ i(ls, { level: 5, className: "!mb-2", children: "Notification Timing & Channels" }),
|
|
4280
|
+
/* @__PURE__ */ i(Ne, { gutter: [16, 16], align: "middle", className: "mb-3", children: /* @__PURE__ */ i(W, { xs: 24, md: 12, children: /* @__PURE__ */ u(ke, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
|
|
4281
|
+
/* @__PURE__ */ i(st, { children: "Do Not Disturb mode:" }),
|
|
4282
|
+
/* @__PURE__ */ u(ke, { size: 12, className: "w-full", children: [
|
|
4283
|
+
/* @__PURE__ */ u(ke, { direction: "horizontal", size: 8, className: "items-center", children: [
|
|
4284
|
+
/* @__PURE__ */ i(st, { children: "From" }),
|
|
4285
|
+
/* @__PURE__ */ i(jt, { value: S, onChange: (I) => f(I), format: "HH:mm" })
|
|
4280
4286
|
] }),
|
|
4281
|
-
/* @__PURE__ */
|
|
4282
|
-
/* @__PURE__ */ i(
|
|
4283
|
-
/* @__PURE__ */ i(
|
|
4287
|
+
/* @__PURE__ */ u(ke, { direction: "horizontal", size: 8, className: "items-center", children: [
|
|
4288
|
+
/* @__PURE__ */ i(st, { children: "To" }),
|
|
4289
|
+
/* @__PURE__ */ i(jt, { value: R, onChange: (I) => N(I), format: "HH:mm" })
|
|
4284
4290
|
] })
|
|
4285
4291
|
] })
|
|
4286
4292
|
] }) }) }),
|
|
4287
|
-
/* @__PURE__ */
|
|
4288
|
-
/* @__PURE__ */ i(
|
|
4289
|
-
/* @__PURE__ */ i(
|
|
4290
|
-
/* @__PURE__ */ i(
|
|
4293
|
+
/* @__PURE__ */ u(Ne, { gutter: [24, 12], children: [
|
|
4294
|
+
/* @__PURE__ */ i(W, { children: /* @__PURE__ */ i(Qe, { checked: m.inApp, onChange: (I) => A({ ...m, inApp: I.target.checked }), children: "In-app" }) }),
|
|
4295
|
+
/* @__PURE__ */ i(W, { children: /* @__PURE__ */ i(Qe, { checked: m.sms, onChange: (I) => A({ ...m, sms: I.target.checked }), children: "SMS" }) }),
|
|
4296
|
+
/* @__PURE__ */ i(W, { children: /* @__PURE__ */ i(Qe, { checked: m.email, onChange: (I) => A({ ...m, email: I.target.checked }), children: "Email" }) })
|
|
4291
4297
|
] })
|
|
4292
4298
|
] }),
|
|
4293
|
-
/* @__PURE__ */ i(
|
|
4294
|
-
/* @__PURE__ */
|
|
4299
|
+
/* @__PURE__ */ i(We, {}),
|
|
4300
|
+
/* @__PURE__ */ u(ke, { className: "gap-3", children: [
|
|
4295
4301
|
/* @__PURE__ */ i(Se, { onClick: r, disabled: Z, children: "Cancel" }),
|
|
4296
4302
|
/* @__PURE__ */ i(Se, { type: "primary", onClick: z, loading: Z, children: "Save" })
|
|
4297
4303
|
] })
|
|
@@ -4299,8 +4305,8 @@ function Mn({ severities: e, rules: t, onSave: s, onCancel: r }) {
|
|
|
4299
4305
|
}
|
|
4300
4306
|
function Dn({ severities: e, rules: t, userRoles: s, rawRules: r }) {
|
|
4301
4307
|
const [n, a] = w("global");
|
|
4302
|
-
return /* @__PURE__ */
|
|
4303
|
-
/* @__PURE__ */
|
|
4308
|
+
return /* @__PURE__ */ u("div", { className: "w-full", children: [
|
|
4309
|
+
/* @__PURE__ */ u("div", { className: "inline-flex rounded-xl overflow-hidden border border-gray-200 mb-4", children: [
|
|
4304
4310
|
/* @__PURE__ */ i(
|
|
4305
4311
|
"button",
|
|
4306
4312
|
{
|
|
@@ -4319,15 +4325,15 @@ function Dn({ severities: e, rules: t, userRoles: s, rawRules: r }) {
|
|
|
4319
4325
|
}
|
|
4320
4326
|
)
|
|
4321
4327
|
] }),
|
|
4322
|
-
n === "global" ? /* @__PURE__ */ i(
|
|
4328
|
+
n === "global" ? /* @__PURE__ */ i(Mn, { severities: e, rules: t, userRoles: s, rawRules: r }) : /* @__PURE__ */ i(Pn, { severities: e, rules: t })
|
|
4323
4329
|
] });
|
|
4324
4330
|
}
|
|
4325
4331
|
const Fn = "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=", Un = "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";
|
|
4326
4332
|
function Ln(e) {
|
|
4327
4333
|
const t = (e.status || "").toLowerCase() === "completed" ? /* @__PURE__ */ i("img", { src: Fn, alt: "completed", style: { width: 20, height: 20 } }) : /* @__PURE__ */ i("img", { src: Un, alt: "pending", style: { width: 20, height: 20 } });
|
|
4328
4334
|
return {
|
|
4329
|
-
title: /* @__PURE__ */
|
|
4330
|
-
/* @__PURE__ */
|
|
4335
|
+
title: /* @__PURE__ */ u("div", { className: "flex flex-col gap-0 min-w-0", children: [
|
|
4336
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col", children: [
|
|
4331
4337
|
/* @__PURE__ */ i("span", { className: "block text-sm break-words mb-1 overflow-visible whitespace-normal", children: /* @__PURE__ */ i("b", { children: e.title }) }),
|
|
4332
4338
|
e.description ? /* @__PURE__ */ i("span", { className: "text-gray-500 text-xs", children: e.description }) : null
|
|
4333
4339
|
] }),
|
|
@@ -4339,32 +4345,32 @@ function Ln(e) {
|
|
|
4339
4345
|
}
|
|
4340
4346
|
function $n({ data: e }) {
|
|
4341
4347
|
return /* @__PURE__ */ i("div", { className: "w-full", children: /* @__PURE__ */ i(
|
|
4342
|
-
|
|
4348
|
+
It,
|
|
4343
4349
|
{
|
|
4344
4350
|
type: "card",
|
|
4345
4351
|
items: [
|
|
4346
4352
|
{
|
|
4347
4353
|
key: "action",
|
|
4348
4354
|
label: "Action Taken",
|
|
4349
|
-
children: /* @__PURE__ */
|
|
4350
|
-
/* @__PURE__ */ i(
|
|
4351
|
-
/* @__PURE__ */
|
|
4355
|
+
children: /* @__PURE__ */ u("div", { className: "w-full", children: [
|
|
4356
|
+
/* @__PURE__ */ i(ft, { className: "mb-4 rounded-md p-4", bordered: !0, children: /* @__PURE__ */ u("div", { className: "grid grid-cols-4 gap-6 text-xs", children: [
|
|
4357
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col gap-1", children: [
|
|
4352
4358
|
/* @__PURE__ */ i("span", { className: "text-gray-500", children: "Alert ID" }),
|
|
4353
4359
|
/* @__PURE__ */ i("span", { className: "text-black", children: e.summary.alertNumber })
|
|
4354
4360
|
] }),
|
|
4355
|
-
/* @__PURE__ */
|
|
4361
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col gap-1", children: [
|
|
4356
4362
|
/* @__PURE__ */ i("span", { className: "text-gray-500", children: "Severity" }),
|
|
4357
4363
|
/* @__PURE__ */ i("span", { className: "text-black", children: e.summary.severity })
|
|
4358
4364
|
] }),
|
|
4359
|
-
/* @__PURE__ */
|
|
4365
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col gap-1", children: [
|
|
4360
4366
|
/* @__PURE__ */ i("span", { className: "text-gray-500", children: "Location" }),
|
|
4361
4367
|
/* @__PURE__ */ i("span", { className: "text-black", children: e.summary.location })
|
|
4362
4368
|
] })
|
|
4363
4369
|
] }) }),
|
|
4364
|
-
/* @__PURE__ */
|
|
4370
|
+
/* @__PURE__ */ u(ft, { className: "rounded-md p-4", bordered: !0, children: [
|
|
4365
4371
|
/* @__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" }) }),
|
|
4366
4372
|
/* @__PURE__ */ i("div", { className: "mt-2", children: /* @__PURE__ */ i(
|
|
4367
|
-
|
|
4373
|
+
qs,
|
|
4368
4374
|
{
|
|
4369
4375
|
direction: "vertical",
|
|
4370
4376
|
size: "small",
|
|
@@ -4378,43 +4384,43 @@ function $n({ data: e }) {
|
|
|
4378
4384
|
{
|
|
4379
4385
|
key: "notification",
|
|
4380
4386
|
label: "Notification Sent",
|
|
4381
|
-
children: /* @__PURE__ */
|
|
4382
|
-
(e.notifications || []).map((t, s) => /* @__PURE__ */
|
|
4383
|
-
/* @__PURE__ */
|
|
4384
|
-
/* @__PURE__ */
|
|
4387
|
+
children: /* @__PURE__ */ u("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
4388
|
+
(e.notifications || []).map((t, s) => /* @__PURE__ */ u(ft, { className: "rounded-md p-4", bordered: !0, children: [
|
|
4389
|
+
/* @__PURE__ */ u("div", { className: "flex items-start justify-between", children: [
|
|
4390
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col", children: [
|
|
4385
4391
|
/* @__PURE__ */ i("h4", { className: "text-sm text-black font-medium", children: t.channelLabel }),
|
|
4386
|
-
/* @__PURE__ */ i("span", { className: "text-xs text-gray-500 mt-1", children:
|
|
4392
|
+
/* @__PURE__ */ i("span", { className: "text-xs text-gray-500 mt-1", children: hs(t.sentAt)?.format("MM/DD/YYYY HH:mm:ss") })
|
|
4387
4393
|
] }),
|
|
4388
|
-
/* @__PURE__ */
|
|
4394
|
+
/* @__PURE__ */ u("span", { className: "text-[11px] px-2 py-1 rounded-full bg-green-50 text-green-700 border border-green-200", children: [
|
|
4389
4395
|
t.delivered,
|
|
4390
4396
|
"/",
|
|
4391
4397
|
t.total,
|
|
4392
4398
|
" Delivered"
|
|
4393
4399
|
] })
|
|
4394
4400
|
] }),
|
|
4395
|
-
/* @__PURE__ */
|
|
4396
|
-
/* @__PURE__ */
|
|
4401
|
+
/* @__PURE__ */ u("div", { className: "mt-4 text-xs", children: [
|
|
4402
|
+
/* @__PURE__ */ u("div", { className: "text-black", children: [
|
|
4397
4403
|
" ",
|
|
4398
4404
|
t.messageTitle
|
|
4399
4405
|
] }),
|
|
4400
4406
|
t.messageBody ? /* @__PURE__ */ i("div", { className: "text-gray-600", children: t.messageBody }) : null
|
|
4401
4407
|
] }),
|
|
4402
|
-
/* @__PURE__ */
|
|
4403
|
-
/* @__PURE__ */
|
|
4408
|
+
/* @__PURE__ */ u("div", { className: "mt-4", children: [
|
|
4409
|
+
/* @__PURE__ */ u("div", { className: "text-xs text-black font-medium", children: [
|
|
4404
4410
|
"Recipients (",
|
|
4405
4411
|
t.total,
|
|
4406
4412
|
")"
|
|
4407
4413
|
] }),
|
|
4408
4414
|
/* @__PURE__ */ i("div", { className: "mt-2 flex flex-col gap-3 text-xs", children: (t.recipients || []).map((r, n) => {
|
|
4409
4415
|
const a = String(r?.notificationReceipientType || "").toLowerCase() === "EscalationNotification".toLowerCase();
|
|
4410
|
-
return /* @__PURE__ */
|
|
4411
|
-
/* @__PURE__ */
|
|
4412
|
-
/* @__PURE__ */
|
|
4416
|
+
return /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
4417
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col", children: [
|
|
4418
|
+
/* @__PURE__ */ u("span", { className: "text-black", children: [
|
|
4413
4419
|
r.name,
|
|
4414
4420
|
" - ",
|
|
4415
4421
|
/* @__PURE__ */ i("span", { style: { color: a ? "#FF3B30" : "#FFB86A" }, children: a ? "Escalation Notification" : "Alert Notification" })
|
|
4416
4422
|
] }),
|
|
4417
|
-
/* @__PURE__ */
|
|
4423
|
+
/* @__PURE__ */ u("span", { className: "text-gray-500", children: [
|
|
4418
4424
|
r.role,
|
|
4419
4425
|
" . ",
|
|
4420
4426
|
r.phone
|
|
@@ -4466,7 +4472,7 @@ const Bn = ({
|
|
|
4466
4472
|
location: r || "",
|
|
4467
4473
|
alertNumber: n ?? ""
|
|
4468
4474
|
}, h = a?.length ? a.map((c) => {
|
|
4469
|
-
const S = (c?.status || c?.eventStatus || "").toLowerCase() === "completed" ? "Completed" : "Inprogress", f = c?.createdDate ?
|
|
4475
|
+
const S = (c?.status || c?.eventStatus || "").toLowerCase() === "completed" ? "Completed" : "Inprogress", f = c?.createdDate ? xt(c.createdDate) : c?.timestamp ? xt(c.timestamp) : "";
|
|
4470
4476
|
return {
|
|
4471
4477
|
status: S,
|
|
4472
4478
|
title: c?.status || c?.eventStatus || "Status Update",
|
|
@@ -4483,10 +4489,10 @@ const Bn = ({
|
|
|
4483
4489
|
const jn = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), qn = (e) => e.replace(
|
|
4484
4490
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
4485
4491
|
(t, s, r) => r ? r.toUpperCase() : s.toLowerCase()
|
|
4486
|
-
),
|
|
4492
|
+
), cs = (e) => {
|
|
4487
4493
|
const t = qn(e);
|
|
4488
4494
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
4489
|
-
},
|
|
4495
|
+
}, Is = (...e) => e.filter((t, s, r) => !!t && t.trim() !== "" && r.indexOf(t) === s).join(" ").trim(), _n = (e) => {
|
|
4490
4496
|
for (const t in e)
|
|
4491
4497
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
4492
4498
|
return !0;
|
|
@@ -4502,7 +4508,7 @@ var Qn = {
|
|
|
4502
4508
|
strokeLinecap: "round",
|
|
4503
4509
|
strokeLinejoin: "round"
|
|
4504
4510
|
};
|
|
4505
|
-
const Hn =
|
|
4511
|
+
const Hn = us(
|
|
4506
4512
|
({
|
|
4507
4513
|
color: e = "currentColor",
|
|
4508
4514
|
size: t = 24,
|
|
@@ -4512,7 +4518,7 @@ const Hn = ls(
|
|
|
4512
4518
|
children: a,
|
|
4513
4519
|
iconNode: o,
|
|
4514
4520
|
...l
|
|
4515
|
-
}, h) =>
|
|
4521
|
+
}, h) => yt(
|
|
4516
4522
|
"svg",
|
|
4517
4523
|
{
|
|
4518
4524
|
ref: h,
|
|
@@ -4521,43 +4527,43 @@ const Hn = ls(
|
|
|
4521
4527
|
height: t,
|
|
4522
4528
|
stroke: e,
|
|
4523
4529
|
strokeWidth: r ? Number(s) * 24 / Number(t) : s,
|
|
4524
|
-
className:
|
|
4530
|
+
className: Is("lucide", n),
|
|
4525
4531
|
...!a && !_n(l) && { "aria-hidden": "true" },
|
|
4526
4532
|
...l
|
|
4527
4533
|
},
|
|
4528
4534
|
[
|
|
4529
|
-
...o.map(([
|
|
4535
|
+
...o.map(([d, c]) => yt(d, c)),
|
|
4530
4536
|
...Array.isArray(a) ? a : [a]
|
|
4531
4537
|
]
|
|
4532
4538
|
)
|
|
4533
4539
|
);
|
|
4534
|
-
const
|
|
4535
|
-
const s =
|
|
4536
|
-
({ className: r, ...n }, a) =>
|
|
4540
|
+
const Rs = (e, t) => {
|
|
4541
|
+
const s = us(
|
|
4542
|
+
({ className: r, ...n }, a) => yt(Hn, {
|
|
4537
4543
|
ref: a,
|
|
4538
4544
|
iconNode: t,
|
|
4539
|
-
className:
|
|
4540
|
-
`lucide-${jn(
|
|
4545
|
+
className: Is(
|
|
4546
|
+
`lucide-${jn(cs(e))}`,
|
|
4541
4547
|
`lucide-${e}`,
|
|
4542
4548
|
r
|
|
4543
4549
|
),
|
|
4544
4550
|
...n
|
|
4545
4551
|
})
|
|
4546
4552
|
);
|
|
4547
|
-
return s.displayName =
|
|
4553
|
+
return s.displayName = cs(e), s;
|
|
4548
4554
|
};
|
|
4549
4555
|
const Gn = [
|
|
4550
4556
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
4551
4557
|
["path", { d: "m21 3-7 7", key: "1l2asr" }],
|
|
4552
4558
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
4553
4559
|
["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
|
|
4554
|
-
],
|
|
4560
|
+
], ks = Rs("maximize-2", Gn);
|
|
4555
4561
|
const Wn = [
|
|
4556
4562
|
["path", { d: "m14 10 7-7", key: "oa77jy" }],
|
|
4557
4563
|
["path", { d: "M20 10h-6V4", key: "mjg0md" }],
|
|
4558
4564
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
4559
4565
|
["path", { d: "M4 14h6v6", key: "rmj7iw" }]
|
|
4560
|
-
], Kn =
|
|
4566
|
+
], Kn = Rs("minimize-2", Wn), Yn = ({ isOpen: e, onClose: t, src: s, type: r = "image" }) => {
|
|
4561
4567
|
const [n, a] = w(!1), [o, l] = w(!1);
|
|
4562
4568
|
return de(() => {
|
|
4563
4569
|
e && l(!1);
|
|
@@ -4575,7 +4581,7 @@ const Wn = [
|
|
|
4575
4581
|
(h.key === "Enter" || h.key === " ") && (h.preventDefault(), t());
|
|
4576
4582
|
},
|
|
4577
4583
|
onTouchStart: t,
|
|
4578
|
-
children: /* @__PURE__ */
|
|
4584
|
+
children: /* @__PURE__ */ u(
|
|
4579
4585
|
"div",
|
|
4580
4586
|
{
|
|
4581
4587
|
className: `relative ${n ? "w-full h-full" : "max-w-5xl max-h-[90vh] w-full"} flex items-center justify-center`,
|
|
@@ -4611,7 +4617,7 @@ const Wn = [
|
|
|
4611
4617
|
{
|
|
4612
4618
|
onClick: () => a(!n),
|
|
4613
4619
|
className: "absolute bottom-3 right-3 text-white bg-black/50 rounded-full p-2 hover:bg-black/70",
|
|
4614
|
-
children: n ? /* @__PURE__ */ i(Kn, { size: 20 }) : /* @__PURE__ */ i(
|
|
4620
|
+
children: n ? /* @__PURE__ */ i(Kn, { size: 20 }) : /* @__PURE__ */ i(ks, { size: 20 })
|
|
4615
4621
|
}
|
|
4616
4622
|
)
|
|
4617
4623
|
]
|
|
@@ -4625,7 +4631,7 @@ function zn(e) {
|
|
|
4625
4631
|
const t = e.split("?")[0].toLowerCase();
|
|
4626
4632
|
return t.endsWith(".mp4") || t.endsWith(".webm") || t.endsWith(".ogg") || t.endsWith(".m3u8");
|
|
4627
4633
|
}
|
|
4628
|
-
function
|
|
4634
|
+
function pt(e) {
|
|
4629
4635
|
const t = (e?.mediaType || e?.type || "").toString().toLowerCase();
|
|
4630
4636
|
return t === "video" || t === "mp4" ? !0 : zn(e?.mediaUrl || e);
|
|
4631
4637
|
}
|
|
@@ -4644,7 +4650,7 @@ const Vn = {
|
|
|
4644
4650
|
Medium: "#FEF9C2",
|
|
4645
4651
|
Low: "#E0EDFF"
|
|
4646
4652
|
}, Xn = ({ isModalOpen: e, handleModalClose: t, selectedRow: s, fetchAlertLogs: r, alertStatusList: n = [], alertStatusLoading: a = !1, initialTab: o = "details", sourceTab: l }) => {
|
|
4647
|
-
const [h,
|
|
4653
|
+
const [h, d] = w(), [c, S] = w(""), [f, R] = w(!1), N = Ls(null), [m, A] = w("details"), [B, U] = w(void 0), L = Ts(), { alerts: O } = Re(), [Z, H] = w(!1), [K, z] = w(void 0), [I, T] = w(void 0), [k, Y] = w({}), ee = s?.originalData || {}, {
|
|
4648
4654
|
eventName: E,
|
|
4649
4655
|
alertId: v,
|
|
4650
4656
|
timestamp: p,
|
|
@@ -4652,91 +4658,91 @@ const Vn = {
|
|
|
4652
4658
|
spaceName: y,
|
|
4653
4659
|
assignTeam: b,
|
|
4654
4660
|
priority: g,
|
|
4655
|
-
statusType:
|
|
4656
|
-
id:
|
|
4657
|
-
alertDetails:
|
|
4658
|
-
statusHistory:
|
|
4661
|
+
statusType: M,
|
|
4662
|
+
id: F,
|
|
4663
|
+
alertDetails: $,
|
|
4664
|
+
statusHistory: j,
|
|
4659
4665
|
mediaDetails: q,
|
|
4660
|
-
alertNumber:
|
|
4661
|
-
} =
|
|
4662
|
-
const
|
|
4663
|
-
return
|
|
4666
|
+
alertNumber: re
|
|
4667
|
+
} = ee, ae = (C) => {
|
|
4668
|
+
const G = String(C || "").toLowerCase();
|
|
4669
|
+
return G === "delivered" || G === "sent" ? "Delivered" : G === "failed" ? "Failed" : "Queued";
|
|
4664
4670
|
}, oe = (C) => ({
|
|
4665
4671
|
name: C?.receipientName || C?.recipientName || "-",
|
|
4666
4672
|
role: C?.receipientRoleName || "",
|
|
4667
4673
|
phone: C?.receipentPhoneNumber || C?.recipientPhoneNumber || C?.receipientEmail || C?.recipientEmail || "",
|
|
4668
|
-
status:
|
|
4674
|
+
status: ae(C?.messageStatus),
|
|
4669
4675
|
notificationReceipientType: C?.notificationReceipientType || ""
|
|
4670
|
-
}),
|
|
4671
|
-
const
|
|
4676
|
+
}), pe = (C, G) => {
|
|
4677
|
+
const ne = G.map(oe), Oe = ne.filter((we) => we.status === "Delivered").length, J = G.map((we) => we?.sentAt).filter(Boolean).sort((we, ct) => new Date(ct).getTime() - new Date(we).getTime())[0], fe = G[0] || {}, Ge = [fe?.severityName, fe?.anomalyName].filter(Boolean).join(" - ") || `${C} Notification`;
|
|
4672
4678
|
return {
|
|
4673
4679
|
channelLabel: `${C} Notification`,
|
|
4674
|
-
sentAt:
|
|
4675
|
-
messageTitle:
|
|
4680
|
+
sentAt: J || "",
|
|
4681
|
+
messageTitle: Ge,
|
|
4676
4682
|
messageBody: "",
|
|
4677
|
-
total:
|
|
4678
|
-
delivered:
|
|
4679
|
-
recipients:
|
|
4683
|
+
total: ne.length,
|
|
4684
|
+
delivered: Oe,
|
|
4685
|
+
recipients: ne
|
|
4680
4686
|
};
|
|
4681
|
-
},
|
|
4682
|
-
const
|
|
4683
|
-
return (C || []).forEach((
|
|
4684
|
-
const
|
|
4685
|
-
|
|
4686
|
-
}), Array.from(
|
|
4687
|
+
}, te = (C) => {
|
|
4688
|
+
const G = /* @__PURE__ */ new Map();
|
|
4689
|
+
return (C || []).forEach((ne) => {
|
|
4690
|
+
const Oe = String(ne?.notificationType || "Unknown"), J = G.get(Oe) || [];
|
|
4691
|
+
J.push(ne), G.set(Oe, J);
|
|
4692
|
+
}), Array.from(G.entries()).map(([ne, Oe]) => pe(ne, Oe));
|
|
4687
4693
|
}, le = async (C) => {
|
|
4688
4694
|
try {
|
|
4689
|
-
const
|
|
4690
|
-
|
|
4695
|
+
const G = await O.getAlertNotifications(C), ne = te(G);
|
|
4696
|
+
U(ne);
|
|
4691
4697
|
} catch {
|
|
4692
|
-
|
|
4698
|
+
U(void 0);
|
|
4693
4699
|
}
|
|
4694
4700
|
};
|
|
4695
4701
|
de(() => {
|
|
4696
|
-
if (m !== "track" || !
|
|
4702
|
+
if (m !== "track" || !F) return;
|
|
4697
4703
|
let C = !1;
|
|
4698
|
-
return le(
|
|
4699
|
-
C &&
|
|
4704
|
+
return le(F).then(() => {
|
|
4705
|
+
C && U(void 0);
|
|
4700
4706
|
}), () => {
|
|
4701
4707
|
C = !0;
|
|
4702
4708
|
};
|
|
4703
|
-
}, [m,
|
|
4709
|
+
}, [m, F]), de(() => {
|
|
4704
4710
|
e && A(o);
|
|
4705
4711
|
}, [e, o]);
|
|
4706
|
-
const
|
|
4707
|
-
const
|
|
4708
|
-
return
|
|
4709
|
-
},
|
|
4710
|
-
const
|
|
4711
|
-
return typeof l < "u" ? l === "archived" ?
|
|
4712
|
-
}).map((C) => ({ value: C.value, label: C.statusName })),
|
|
4712
|
+
const be = l === "archived" || ["completed", "false positive"].includes(String(M || "").toLowerCase()), qe = (C) => {
|
|
4713
|
+
const G = String(C?.value || "").toLowerCase(), ne = String(C?.statusName || "").toLowerCase();
|
|
4714
|
+
return G.includes("reopen") || ne.includes("reopen");
|
|
4715
|
+
}, he = (n || []).filter((C) => {
|
|
4716
|
+
const G = qe(C);
|
|
4717
|
+
return typeof l < "u" ? l === "archived" ? G : !G : be ? G : !G;
|
|
4718
|
+
}).map((C) => ({ value: C.value, label: C.statusName })), Ee = ue(() => Zn(q), [q]);
|
|
4713
4719
|
return de(() => {
|
|
4714
4720
|
let C = !1;
|
|
4715
|
-
const
|
|
4716
|
-
if (
|
|
4717
|
-
C || Y((
|
|
4721
|
+
const G = new AbortController(), ne = async (J) => {
|
|
4722
|
+
if (J) {
|
|
4723
|
+
C || Y((fe) => ({ ...fe, [J]: !1 }));
|
|
4718
4724
|
try {
|
|
4719
|
-
const
|
|
4720
|
-
if (
|
|
4721
|
-
C || Y((
|
|
4725
|
+
const fe = await fetch(J, { method: "HEAD", signal: G.signal });
|
|
4726
|
+
if (fe.ok) {
|
|
4727
|
+
C || Y((we) => ({ ...we, [J]: !0 }));
|
|
4722
4728
|
return;
|
|
4723
4729
|
}
|
|
4724
|
-
if (
|
|
4725
|
-
C || Y((
|
|
4730
|
+
if (fe.status === 404) {
|
|
4731
|
+
C || Y((we) => ({ ...we, [J]: !1 }));
|
|
4726
4732
|
return;
|
|
4727
4733
|
}
|
|
4728
|
-
if (!(await fetch(
|
|
4729
|
-
C || Y((
|
|
4734
|
+
if (!(await fetch(J, { method: "GET", signal: G.signal })).ok) throw new Error("Media not available");
|
|
4735
|
+
C || Y((we) => ({ ...we, [J]: !0 }));
|
|
4730
4736
|
} catch {
|
|
4731
|
-
C || Y((
|
|
4737
|
+
C || Y((fe) => ({ ...fe, [J]: !1 }));
|
|
4732
4738
|
}
|
|
4733
4739
|
}
|
|
4734
4740
|
};
|
|
4735
|
-
return Y({}),
|
|
4736
|
-
C = !0,
|
|
4741
|
+
return Y({}), Ee.filter((J) => !pt(J)).map((J) => J?.mediaUrl || J).filter((J) => typeof J == "string" && J.length > 0).forEach((J) => ne(J)), () => {
|
|
4742
|
+
C = !0, G.abort();
|
|
4737
4743
|
};
|
|
4738
|
-
}, [
|
|
4739
|
-
|
|
4744
|
+
}, [Ee]), /* @__PURE__ */ i(
|
|
4745
|
+
_s,
|
|
4740
4746
|
{
|
|
4741
4747
|
open: e,
|
|
4742
4748
|
onCancel: t,
|
|
@@ -4747,7 +4753,7 @@ const Vn = {
|
|
|
4747
4753
|
overflowY: "auto"
|
|
4748
4754
|
}
|
|
4749
4755
|
},
|
|
4750
|
-
footer: m === "details" ? /* @__PURE__ */
|
|
4756
|
+
footer: m === "details" ? /* @__PURE__ */ u("div", { className: "flex flex-row gap-2 justify-start", children: [
|
|
4751
4757
|
/* @__PURE__ */ i(Se, { onClick: t, className: "bg-[#6C757D] text-white", children: "Cancel" }),
|
|
4752
4758
|
/* @__PURE__ */ i(
|
|
4753
4759
|
Se,
|
|
@@ -4758,25 +4764,25 @@ const Vn = {
|
|
|
4758
4764
|
R(!0);
|
|
4759
4765
|
const C = {
|
|
4760
4766
|
alertUniqueId: v,
|
|
4761
|
-
alertId:
|
|
4767
|
+
alertId: F,
|
|
4762
4768
|
status: h ? String(h) : void 0,
|
|
4763
4769
|
notes: c.trim(),
|
|
4764
4770
|
modifiedBy: 0
|
|
4765
|
-
},
|
|
4766
|
-
if (
|
|
4767
|
-
const
|
|
4768
|
-
|
|
4771
|
+
}, G = await L.mutateAsync(C);
|
|
4772
|
+
if (G?.responseStatus) {
|
|
4773
|
+
const ne = G?.data || "Alert updated successfully.";
|
|
4774
|
+
ve.success(ne, {
|
|
4769
4775
|
autoClose: 1500,
|
|
4770
4776
|
onClose: () => {
|
|
4771
4777
|
r(), t();
|
|
4772
4778
|
}
|
|
4773
|
-
}),
|
|
4779
|
+
}), d(void 0), S("");
|
|
4774
4780
|
} else {
|
|
4775
|
-
const
|
|
4776
|
-
|
|
4781
|
+
const ne = G?.errorMessage || "Failed to update alert status";
|
|
4782
|
+
ve.error(ne);
|
|
4777
4783
|
}
|
|
4778
4784
|
} catch (C) {
|
|
4779
|
-
console.error("Error updating alert status:", C),
|
|
4785
|
+
console.error("Error updating alert status:", C), ve.error("Failed to update alert status. Please try again.");
|
|
4780
4786
|
} finally {
|
|
4781
4787
|
R(!1);
|
|
4782
4788
|
}
|
|
@@ -4787,7 +4793,7 @@ const Vn = {
|
|
|
4787
4793
|
)
|
|
4788
4794
|
] }) : null,
|
|
4789
4795
|
children: s && /* @__PURE__ */ i(
|
|
4790
|
-
|
|
4796
|
+
It,
|
|
4791
4797
|
{
|
|
4792
4798
|
activeKey: m,
|
|
4793
4799
|
onChange: (C) => A(C),
|
|
@@ -4795,37 +4801,37 @@ const Vn = {
|
|
|
4795
4801
|
{
|
|
4796
4802
|
key: "details",
|
|
4797
4803
|
label: "Alert Detail",
|
|
4798
|
-
children: /* @__PURE__ */
|
|
4799
|
-
/* @__PURE__ */
|
|
4804
|
+
children: /* @__PURE__ */ u("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
4805
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col gap-2", children: [
|
|
4800
4806
|
/* @__PURE__ */ i("div", { className: "text-sm font-bold", children: E || "Alert Event" }),
|
|
4801
|
-
|
|
4807
|
+
$?.firstName ? /* @__PURE__ */ u("div", { className: "text-sm text-gray-500", children: [
|
|
4802
4808
|
"Resident ID/Name: ",
|
|
4803
|
-
|
|
4809
|
+
$?.firstName,
|
|
4804
4810
|
" ",
|
|
4805
|
-
|
|
4811
|
+
$?.lastName || "",
|
|
4806
4812
|
" ",
|
|
4807
|
-
|
|
4813
|
+
$?.residentId || ""
|
|
4808
4814
|
] }) : null,
|
|
4809
|
-
/* @__PURE__ */
|
|
4815
|
+
/* @__PURE__ */ u("div", { className: "text-sm text-gray-500", children: [
|
|
4810
4816
|
"Timestamp: ",
|
|
4811
|
-
|
|
4817
|
+
xt(p)
|
|
4812
4818
|
] }),
|
|
4813
|
-
/* @__PURE__ */
|
|
4819
|
+
/* @__PURE__ */ u("div", { className: "font-sm text-gray-500", children: [
|
|
4814
4820
|
/* @__PURE__ */ i("b", { className: "text-black text-sm/6", children: "Description:" }),
|
|
4815
4821
|
" ",
|
|
4816
4822
|
x || "No description available"
|
|
4817
4823
|
] }),
|
|
4818
|
-
y && /* @__PURE__ */
|
|
4824
|
+
y && /* @__PURE__ */ u("div", { className: "font-sm text-gray-500", children: [
|
|
4819
4825
|
"Space: ",
|
|
4820
4826
|
y
|
|
4821
4827
|
] }),
|
|
4822
|
-
b && /* @__PURE__ */
|
|
4828
|
+
b && /* @__PURE__ */ u("div", { className: "font-sm text-gray-500", children: [
|
|
4823
4829
|
"Assigned to: ",
|
|
4824
4830
|
b
|
|
4825
4831
|
] }),
|
|
4826
|
-
/* @__PURE__ */
|
|
4827
|
-
/* @__PURE__ */
|
|
4828
|
-
|
|
4832
|
+
/* @__PURE__ */ u("div", { className: "flex gap-2 justify-start mt-3", children: [
|
|
4833
|
+
/* @__PURE__ */ u(
|
|
4834
|
+
Ke,
|
|
4829
4835
|
{
|
|
4830
4836
|
className: "font-sm text-gray-500 rounded-[8px] py-2 px-3",
|
|
4831
4837
|
style: {
|
|
@@ -4838,31 +4844,31 @@ const Vn = {
|
|
|
4838
4844
|
]
|
|
4839
4845
|
}
|
|
4840
4846
|
),
|
|
4841
|
-
/* @__PURE__ */
|
|
4842
|
-
|
|
4847
|
+
/* @__PURE__ */ u(
|
|
4848
|
+
Ke,
|
|
4843
4849
|
{
|
|
4844
4850
|
className: "font-sm text-gray-500 rounded-[8px] py-2 px-3",
|
|
4845
|
-
style: String(
|
|
4851
|
+
style: String(M || "").toLowerCase() === "completed" ? { background: "#E7F6EC", border: "0.68px solid var(--Green, #34C759)" } : { background: "#E0EDFF", border: "1px solid var(--Grays-Gray-4, #D1D1D6)" },
|
|
4846
4852
|
children: [
|
|
4847
4853
|
"Status: ",
|
|
4848
|
-
|
|
4854
|
+
M || "N/A"
|
|
4849
4855
|
]
|
|
4850
4856
|
}
|
|
4851
4857
|
)
|
|
4852
4858
|
] }),
|
|
4853
|
-
/* @__PURE__ */ i("div", { className: "w-full flex flex-col justify-start items-start mt-2 font-bold", children: /* @__PURE__ */
|
|
4859
|
+
/* @__PURE__ */ i("div", { className: "w-full flex flex-col justify-start items-start mt-2 font-bold", children: /* @__PURE__ */ u("div", { className: "w-full mt-4", children: [
|
|
4854
4860
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ i(
|
|
4855
|
-
|
|
4861
|
+
Ae,
|
|
4856
4862
|
{
|
|
4857
4863
|
placeholder: "Change Status",
|
|
4858
4864
|
className: "w-full text-gray-500",
|
|
4859
|
-
onChange: (C) =>
|
|
4865
|
+
onChange: (C) => d(C),
|
|
4860
4866
|
value: h,
|
|
4861
|
-
options:
|
|
4867
|
+
options: he,
|
|
4862
4868
|
loading: a
|
|
4863
4869
|
}
|
|
4864
4870
|
) }),
|
|
4865
|
-
/* @__PURE__ */
|
|
4871
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col gap-2 mt-3", children: [
|
|
4866
4872
|
/* @__PURE__ */ i("label", { htmlFor: "action-details-input", className: "text-xs text-gray-500 font-medium", children: "Action Taken (Comments)" }),
|
|
4867
4873
|
/* @__PURE__ */ i(
|
|
4868
4874
|
"textarea",
|
|
@@ -4877,10 +4883,10 @@ const Vn = {
|
|
|
4877
4883
|
] })
|
|
4878
4884
|
] }) })
|
|
4879
4885
|
] }),
|
|
4880
|
-
/* @__PURE__ */ i("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */
|
|
4881
|
-
/* @__PURE__ */
|
|
4886
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ u("div", { className: "w-full mt-1", children: [
|
|
4887
|
+
/* @__PURE__ */ u("div", { className: "w-full flex items-center justify-between", children: [
|
|
4882
4888
|
/* @__PURE__ */ i("h3", { className: "text-black font-bold text-sm", children: "Camera Footage" }),
|
|
4883
|
-
|
|
4889
|
+
Ee.length > 1 ? /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
4884
4890
|
/* @__PURE__ */ i(
|
|
4885
4891
|
"button",
|
|
4886
4892
|
{
|
|
@@ -4888,7 +4894,7 @@ const Vn = {
|
|
|
4888
4894
|
onClick: () => N.current?.prev?.(),
|
|
4889
4895
|
className: "w-6 h-6 flex items-center justify-center rounded-full bg-gray-200 hover:bg-gray-300 text-gray-600",
|
|
4890
4896
|
"aria-label": "Previous media",
|
|
4891
|
-
children: /* @__PURE__ */ i(
|
|
4897
|
+
children: /* @__PURE__ */ i(zs, { style: { fontSize: 12 } })
|
|
4892
4898
|
}
|
|
4893
4899
|
),
|
|
4894
4900
|
/* @__PURE__ */ i(
|
|
@@ -4898,13 +4904,13 @@ const Vn = {
|
|
|
4898
4904
|
onClick: () => N.current?.next?.(),
|
|
4899
4905
|
className: "w-6 h-6 flex items-center justify-center rounded-full bg-gray-200 hover:bg-gray-300 text-gray-600",
|
|
4900
4906
|
"aria-label": "Next media",
|
|
4901
|
-
children: /* @__PURE__ */ i(
|
|
4907
|
+
children: /* @__PURE__ */ i(Zs, { style: { fontSize: 12 } })
|
|
4902
4908
|
}
|
|
4903
4909
|
)
|
|
4904
4910
|
] }) : null
|
|
4905
4911
|
] }),
|
|
4906
|
-
|
|
4907
|
-
|
|
4912
|
+
Ee.length ? /* @__PURE__ */ i("div", { className: "w-full", children: /* @__PURE__ */ i(Qs, { ref: N, dots: !0, className: "w-full", children: Ee.map((C, G) => /* @__PURE__ */ u("div", { className: "flex justify-center items-center", children: [
|
|
4913
|
+
pt(C) ? /* @__PURE__ */ u(
|
|
4908
4914
|
"video",
|
|
4909
4915
|
{
|
|
4910
4916
|
width: "240",
|
|
@@ -4920,28 +4926,28 @@ const Vn = {
|
|
|
4920
4926
|
"img",
|
|
4921
4927
|
{
|
|
4922
4928
|
src: C.mediaUrl || C,
|
|
4923
|
-
alt: C.caption || `media-${
|
|
4929
|
+
alt: C.caption || `media-${G}`,
|
|
4924
4930
|
className: "max-w-full max-h-[90vh] object-contain rounded-lg shadow-lg"
|
|
4925
4931
|
}
|
|
4926
4932
|
),
|
|
4927
4933
|
C.caption && /* @__PURE__ */ i("p", { className: "text-xs text-gray-500 mt-1", children: C.caption }),
|
|
4928
|
-
!
|
|
4934
|
+
!pt(C) && k[String(C.mediaUrl || C)] ? /* @__PURE__ */ i(
|
|
4929
4935
|
"button",
|
|
4930
4936
|
{
|
|
4931
4937
|
onClick: () => {
|
|
4932
|
-
|
|
4938
|
+
H(!0), z(C.mediaUrl || C), T(C.type || "image");
|
|
4933
4939
|
},
|
|
4934
4940
|
className: "absolute bottom-3 right-3 text-white bg-black/50 rounded-full p-2 hover:bg-black/70",
|
|
4935
|
-
children: /* @__PURE__ */ i(
|
|
4941
|
+
children: /* @__PURE__ */ i(ks, { size: 20 })
|
|
4936
4942
|
}
|
|
4937
4943
|
) : null
|
|
4938
|
-
] },
|
|
4944
|
+
] }, G)) }) }) : null
|
|
4939
4945
|
] }) }),
|
|
4940
4946
|
/* @__PURE__ */ i(
|
|
4941
4947
|
Yn,
|
|
4942
4948
|
{
|
|
4943
4949
|
isOpen: Z,
|
|
4944
|
-
onClose: () =>
|
|
4950
|
+
onClose: () => H(!1),
|
|
4945
4951
|
src: K || "",
|
|
4946
4952
|
type: I || "image"
|
|
4947
4953
|
}
|
|
@@ -4955,12 +4961,12 @@ const Vn = {
|
|
|
4955
4961
|
Bn,
|
|
4956
4962
|
{
|
|
4957
4963
|
alertId: v,
|
|
4958
|
-
id:
|
|
4964
|
+
id: F,
|
|
4959
4965
|
priority: g,
|
|
4960
4966
|
spaceName: y,
|
|
4961
|
-
alertNumber:
|
|
4962
|
-
statusHistory:
|
|
4963
|
-
notifGroups:
|
|
4967
|
+
alertNumber: re,
|
|
4968
|
+
statusHistory: j,
|
|
4969
|
+
notifGroups: B
|
|
4964
4970
|
}
|
|
4965
4971
|
)
|
|
4966
4972
|
}
|
|
@@ -4971,7 +4977,7 @@ const Vn = {
|
|
|
4971
4977
|
);
|
|
4972
4978
|
};
|
|
4973
4979
|
function ei() {
|
|
4974
|
-
const { alerts: e } =
|
|
4980
|
+
const { alerts: e } = Re(), t = lt({
|
|
4975
4981
|
queryKey: ["alerts", "statusList"],
|
|
4976
4982
|
queryFn: () => e.getAlertStatusList(),
|
|
4977
4983
|
staleTime: 5 * 6e4
|
|
@@ -4984,7 +4990,7 @@ function ei() {
|
|
|
4984
4990
|
};
|
|
4985
4991
|
}
|
|
4986
4992
|
function ti() {
|
|
4987
|
-
const { alerts: e } =
|
|
4993
|
+
const { alerts: e } = Re(), t = lt({
|
|
4988
4994
|
queryKey: ["alerts", "timeZoneMasters"],
|
|
4989
4995
|
queryFn: () => e.getTimeZoneMasters ? e.getTimeZoneMasters() : Promise.resolve([]),
|
|
4990
4996
|
staleTime: 30 * 6e4,
|
|
@@ -4996,24 +5002,24 @@ function ti() {
|
|
|
4996
5002
|
error: t.error
|
|
4997
5003
|
};
|
|
4998
5004
|
}
|
|
4999
|
-
function
|
|
5000
|
-
const [n, a] = w(!1), [o, l] = w(null), [h,
|
|
5005
|
+
function Es({ alerts: e, loading: t = !1, columns: s, onRefetch: r }) {
|
|
5006
|
+
const [n, a] = w(!1), [o, l] = w(null), [h, d] = w("details"), { list: c, loading: S } = ei(), { timeZoneMasters: f } = ti(), R = ue(() => {
|
|
5001
5007
|
const O = "America/New_York";
|
|
5002
5008
|
if (!e.length || !f.length)
|
|
5003
5009
|
return { label: "USA", ianaTimeZoneId: O };
|
|
5004
5010
|
const Z = e[0].timeZoneUniqueId;
|
|
5005
5011
|
if (!Z)
|
|
5006
5012
|
return { label: "USA", ianaTimeZoneId: O };
|
|
5007
|
-
const
|
|
5008
|
-
return
|
|
5013
|
+
const H = f.find((K) => K.timeZoneUniqueId === Z);
|
|
5014
|
+
return H ? { label: H.timeZoneName, ianaTimeZoneId: H.ianaTimeZoneId } : { label: "USA", ianaTimeZoneId: O };
|
|
5009
5015
|
}, [e, f]);
|
|
5010
|
-
function N(
|
|
5011
|
-
l(
|
|
5016
|
+
function N(L, O) {
|
|
5017
|
+
l(L), d(O?.tab ?? "details"), B(O?.sourceTab ?? "active"), a(!0);
|
|
5012
5018
|
}
|
|
5013
5019
|
function m() {
|
|
5014
5020
|
a(!1);
|
|
5015
5021
|
}
|
|
5016
|
-
const [A,
|
|
5022
|
+
const [A, B] = w("active"), U = o ? {
|
|
5017
5023
|
originalData: {
|
|
5018
5024
|
// include the full selected alert so alll modal fieldsare present
|
|
5019
5025
|
...o,
|
|
@@ -5022,25 +5028,25 @@ function Rs({ alerts: e, loading: t = !1, columns: s, onRefetch: r }) {
|
|
|
5022
5028
|
mediaDetails: o.mediaDetails
|
|
5023
5029
|
}
|
|
5024
5030
|
} : null;
|
|
5025
|
-
return /* @__PURE__ */
|
|
5026
|
-
/* @__PURE__ */
|
|
5031
|
+
return /* @__PURE__ */ u("div", { className: "p-6 flex flex-col items-start justify-start min-h-screen w-full overflow-auto", children: [
|
|
5032
|
+
/* @__PURE__ */ u("div", { className: "w-1/2 flex items-center justify-between mb-4", children: [
|
|
5027
5033
|
/* @__PURE__ */ i("h1", { className: "text-xl font-bold text-black", children: "Alert Console" }),
|
|
5028
5034
|
/* @__PURE__ */ i(wn, { label: R.label, timeZone: R.ianaTimeZoneId })
|
|
5029
5035
|
] }),
|
|
5030
5036
|
/* @__PURE__ */ i(
|
|
5031
|
-
|
|
5037
|
+
It,
|
|
5032
5038
|
{
|
|
5033
5039
|
defaultActiveKey: "active",
|
|
5034
5040
|
className: "w-full",
|
|
5035
5041
|
tabBarStyle: { fontSize: "medium" },
|
|
5036
|
-
onChange: (
|
|
5037
|
-
|
|
5042
|
+
onChange: (L) => {
|
|
5043
|
+
L === "active" && r?.();
|
|
5038
5044
|
},
|
|
5039
5045
|
items: [
|
|
5040
5046
|
{
|
|
5041
5047
|
key: "active",
|
|
5042
5048
|
label: "Active",
|
|
5043
|
-
children: /* @__PURE__ */ i(
|
|
5049
|
+
children: /* @__PURE__ */ i(ys, { data: e, loading: t, pageSize: 10, columns: s || [], onAlertIdClick: N, onRefetch: r })
|
|
5044
5050
|
},
|
|
5045
5051
|
{
|
|
5046
5052
|
key: "archived",
|
|
@@ -5065,7 +5071,7 @@ function Rs({ alerts: e, loading: t = !1, columns: s, onRefetch: r }) {
|
|
|
5065
5071
|
{
|
|
5066
5072
|
isModalOpen: n,
|
|
5067
5073
|
handleModalClose: m,
|
|
5068
|
-
selectedRow:
|
|
5074
|
+
selectedRow: U,
|
|
5069
5075
|
fetchAlertLogs: () => {
|
|
5070
5076
|
},
|
|
5071
5077
|
alertStatusList: c,
|
|
@@ -5077,7 +5083,7 @@ function Rs({ alerts: e, loading: t = !1, columns: s, onRefetch: r }) {
|
|
|
5077
5083
|
] });
|
|
5078
5084
|
}
|
|
5079
5085
|
function si() {
|
|
5080
|
-
const [e, t] = w([]), [s, r] = w([]), [n, a] = w([]), { rules: o } =
|
|
5086
|
+
const [e, t] = w([]), [s, r] = w([]), [n, a] = w([]), { rules: o } = Re();
|
|
5081
5087
|
return de(() => {
|
|
5082
5088
|
let l = !0;
|
|
5083
5089
|
return (async () => {
|
|
@@ -5085,24 +5091,24 @@ function si() {
|
|
|
5085
5091
|
const h = await o.getRules();
|
|
5086
5092
|
if (!l) return;
|
|
5087
5093
|
a(Array.isArray(h) ? h : []);
|
|
5088
|
-
const
|
|
5094
|
+
const d = (h || []).map((c, S) => ({
|
|
5089
5095
|
RuleId: c.ruleId || c.ruleName || String(S),
|
|
5090
5096
|
Name: c.ruleName || c.Name || "-",
|
|
5091
5097
|
Description: c.ruleDesc || c.Description || "",
|
|
5092
5098
|
SeverityId: 0
|
|
5093
5099
|
}));
|
|
5094
|
-
t(
|
|
5100
|
+
t(d.length ? d : _e.rules);
|
|
5095
5101
|
try {
|
|
5096
5102
|
const c = await o.getLookups(), S = Array.isArray(c?.userRoles) ? c.userRoles.map((f) => ({
|
|
5097
5103
|
userRoleId: f.userRoleId ?? f.id,
|
|
5098
5104
|
userRoleName: f.userRoleName ?? f.name
|
|
5099
5105
|
})) : [];
|
|
5100
|
-
r(S.length ? S :
|
|
5106
|
+
r(S.length ? S : _e.userRoles);
|
|
5101
5107
|
} catch {
|
|
5102
|
-
r(
|
|
5108
|
+
r(_e.userRoles);
|
|
5103
5109
|
}
|
|
5104
5110
|
} catch {
|
|
5105
|
-
t(
|
|
5111
|
+
t(_e.rules), r(_e.userRoles);
|
|
5106
5112
|
}
|
|
5107
5113
|
})(), () => {
|
|
5108
5114
|
l = !1;
|
|
@@ -5110,7 +5116,7 @@ function si() {
|
|
|
5110
5116
|
}, []), /* @__PURE__ */ i(
|
|
5111
5117
|
Dn,
|
|
5112
5118
|
{
|
|
5113
|
-
severities:
|
|
5119
|
+
severities: _e.severities,
|
|
5114
5120
|
rules: e,
|
|
5115
5121
|
userRoles: s,
|
|
5116
5122
|
rawRules: n
|
|
@@ -5118,7 +5124,7 @@ function si() {
|
|
|
5118
5124
|
);
|
|
5119
5125
|
}
|
|
5120
5126
|
function ri() {
|
|
5121
|
-
const { alerts: e } =
|
|
5127
|
+
const { alerts: e } = Re(), t = lt({
|
|
5122
5128
|
queryKey: ["alerts", "list"],
|
|
5123
5129
|
queryFn: () => e.listAlerts(),
|
|
5124
5130
|
staleTime: 3e4
|
|
@@ -5132,7 +5138,7 @@ function ri() {
|
|
|
5132
5138
|
}
|
|
5133
5139
|
function ni(e) {
|
|
5134
5140
|
const { alerts: t, loading: s, refetch: r } = ri();
|
|
5135
|
-
return /* @__PURE__ */ i(
|
|
5141
|
+
return /* @__PURE__ */ i(Es, { alerts: t, loading: s, columns: e.columns, onRefetch: r });
|
|
5136
5142
|
}
|
|
5137
5143
|
function mi({
|
|
5138
5144
|
tenant: e,
|
|
@@ -5151,10 +5157,10 @@ function mi({
|
|
|
5151
5157
|
}),
|
|
5152
5158
|
[t, s, r]
|
|
5153
5159
|
);
|
|
5154
|
-
return /* @__PURE__ */ i(tn, { client: l, children: /* @__PURE__ */ i(
|
|
5160
|
+
return /* @__PURE__ */ i(tn, { client: l, children: /* @__PURE__ */ i(vr, { tenant: e, override: h, children: Array.isArray(n) ? /* @__PURE__ */ i(Es, { alerts: n, loading: !!a, columns: o }) : /* @__PURE__ */ i(ni, { columns: o }) }) });
|
|
5155
5161
|
}
|
|
5156
5162
|
function pi(e) {
|
|
5157
|
-
const { alerts: t } =
|
|
5163
|
+
const { alerts: t } = Re(), s = lt({
|
|
5158
5164
|
queryKey: ["alerts", "report", e],
|
|
5159
5165
|
queryFn: () => t.getAlertsReport(e),
|
|
5160
5166
|
staleTime: 6e4
|
|
@@ -5175,21 +5181,21 @@ const yi = [
|
|
|
5175
5181
|
];
|
|
5176
5182
|
export {
|
|
5177
5183
|
On as AlertAssignment,
|
|
5178
|
-
|
|
5184
|
+
Es as AlertConsole,
|
|
5179
5185
|
mi as AlertConsoleWidget,
|
|
5180
|
-
|
|
5181
|
-
|
|
5186
|
+
ys as AlertsTable,
|
|
5187
|
+
vr as ApiProvider,
|
|
5182
5188
|
An as ArchivedTable,
|
|
5183
5189
|
wn as Clock,
|
|
5184
5190
|
Er as DataTable,
|
|
5185
|
-
|
|
5186
|
-
|
|
5191
|
+
Pn as MyPreferencesPanel,
|
|
5192
|
+
Mn as SettingsPanel,
|
|
5187
5193
|
Dn as SettingsTabs,
|
|
5188
5194
|
yi as exampleAlertColumns,
|
|
5189
5195
|
ei as useAlertStatusList,
|
|
5190
5196
|
ri as useAlerts,
|
|
5191
5197
|
pi as useAlertsReport,
|
|
5192
|
-
|
|
5193
|
-
|
|
5198
|
+
Re as useApi,
|
|
5199
|
+
Ts as useUpdateAlertStatus
|
|
5194
5200
|
};
|
|
5195
5201
|
//# sourceMappingURL=index.es.js.map
|