@ssgc/alert-console 2.6.6 → 2.6.7
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 +425 -414
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as c, jsxs as h, Fragment as ga } from "react/jsx-runtime";
|
|
2
|
-
import { useContext as pa, useMemo as Se, createContext as Sa, useState as
|
|
2
|
+
import { useContext as pa, useMemo as Se, createContext as Sa, useState as b, useEffect as ve, forwardRef as ar, createElement as $s, useRef as wa } from "react";
|
|
3
3
|
import { Select as Oe, Table as Js, Row as Ee, Col as j, Input as va, Tag as Nt, Space as Je, Tooltip as hn, Button as De, Progress as Aa, Dropdown as Ta, Typography as Pt, Spin as us, Checkbox as wt, Divider as Dt, TimePicker as yn, Tabs as Ks, Card as bs, Steps as Na, Modal as ba, Carousel as ka } from "antd";
|
|
4
4
|
import { MessageOutlined as Ia, MailOutlined as xa, MoreOutlined as Oa, PlusOutlined as Ma, EditOutlined as Ea, LeftOutlined as Da, RightOutlined as Ca } from "@ant-design/icons";
|
|
5
5
|
import { toast as Te } from "react-toastify";
|
|
@@ -285,98 +285,98 @@ function Xa() {
|
|
|
285
285
|
(function(s, n) {
|
|
286
286
|
t.exports = n();
|
|
287
287
|
})(Qa, (function() {
|
|
288
|
-
var s = 1e3, n = 6e4, r = 36e5, a = "millisecond", i = "second", o = "minute", l = "hour", u = "day", m = "week", d = "month", g = "quarter", f = "year",
|
|
289
|
-
var
|
|
290
|
-
return "[" + D + (
|
|
291
|
-
} }, te = function(D,
|
|
288
|
+
var s = 1e3, n = 6e4, r = 36e5, a = "millisecond", i = "second", o = "minute", l = "hour", u = "day", m = "week", d = "month", g = "quarter", f = "year", v = "date", O = "Invalid Date", C = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, J = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, _ = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(D) {
|
|
289
|
+
var w = ["th", "st", "nd", "rd"], p = D % 100;
|
|
290
|
+
return "[" + D + (w[(p - 20) % 10] || w[p] || w[0]) + "]";
|
|
291
|
+
} }, te = function(D, w, p) {
|
|
292
292
|
var I = String(D);
|
|
293
|
-
return !I || I.length >=
|
|
293
|
+
return !I || I.length >= w ? D : "" + Array(w + 1 - I.length).join(p) + D;
|
|
294
294
|
}, k = { s: te, z: function(D) {
|
|
295
|
-
var
|
|
296
|
-
return (
|
|
297
|
-
}, m: function D(
|
|
298
|
-
if (
|
|
299
|
-
var I = 12 * (p.year() -
|
|
300
|
-
return +(-(I + (p -
|
|
295
|
+
var w = -D.utcOffset(), p = Math.abs(w), I = Math.floor(p / 60), A = p % 60;
|
|
296
|
+
return (w <= 0 ? "+" : "-") + te(I, 2, "0") + ":" + te(A, 2, "0");
|
|
297
|
+
}, m: function D(w, p) {
|
|
298
|
+
if (w.date() < p.date()) return -D(p, w);
|
|
299
|
+
var I = 12 * (p.year() - w.year()) + (p.month() - w.month()), A = w.clone().add(I, d), L = p - A < 0, T = w.clone().add(I + (L ? -1 : 1), d);
|
|
300
|
+
return +(-(I + (p - A) / (L ? A - T : T - A)) || 0);
|
|
301
301
|
}, a: function(D) {
|
|
302
302
|
return D < 0 ? Math.ceil(D) || 0 : Math.floor(D);
|
|
303
303
|
}, p: function(D) {
|
|
304
|
-
return { M: d, y: f, w: m, d: u, D:
|
|
304
|
+
return { M: d, y: f, w: m, d: u, D: v, h: l, m: o, s: i, ms: a, Q: g }[D] || String(D || "").toLowerCase().replace(/s$/, "");
|
|
305
305
|
}, u: function(D) {
|
|
306
306
|
return D === void 0;
|
|
307
307
|
} }, R = "en", V = {};
|
|
308
308
|
V[R] = _;
|
|
309
|
-
var U = "$isDayjsObject",
|
|
309
|
+
var U = "$isDayjsObject", G = function(D) {
|
|
310
310
|
return D instanceof de || !(!D || !D[U]);
|
|
311
|
-
}, y = function D(
|
|
312
|
-
var
|
|
313
|
-
if (!
|
|
314
|
-
if (typeof
|
|
315
|
-
var L =
|
|
316
|
-
V[L] && (
|
|
317
|
-
var
|
|
318
|
-
if (!
|
|
311
|
+
}, y = function D(w, p, I) {
|
|
312
|
+
var A;
|
|
313
|
+
if (!w) return R;
|
|
314
|
+
if (typeof w == "string") {
|
|
315
|
+
var L = w.toLowerCase();
|
|
316
|
+
V[L] && (A = L), p && (V[L] = p, A = L);
|
|
317
|
+
var T = w.split("-");
|
|
318
|
+
if (!A && T.length > 1) return D(T[0]);
|
|
319
319
|
} else {
|
|
320
|
-
var M =
|
|
321
|
-
V[M] =
|
|
320
|
+
var M = w.name;
|
|
321
|
+
V[M] = w, A = M;
|
|
322
322
|
}
|
|
323
|
-
return !I &&
|
|
324
|
-
},
|
|
325
|
-
if (
|
|
326
|
-
var p = typeof
|
|
323
|
+
return !I && A && (R = A), A || !I && R;
|
|
324
|
+
}, S = function(D, w) {
|
|
325
|
+
if (G(D)) return D.clone();
|
|
326
|
+
var p = typeof w == "object" ? w : {};
|
|
327
327
|
return p.date = D, p.args = arguments, new de(p);
|
|
328
328
|
}, E = k;
|
|
329
|
-
E.l = y, E.i =
|
|
330
|
-
return
|
|
329
|
+
E.l = y, E.i = G, E.w = function(D, w) {
|
|
330
|
+
return S(D, { locale: w.$L, utc: w.$u, x: w.$x, $offset: w.$offset });
|
|
331
331
|
};
|
|
332
332
|
var de = (function() {
|
|
333
333
|
function D(p) {
|
|
334
334
|
this.$L = y(p.locale, null, !0), this.parse(p), this.$x = this.$x || p.x || {}, this[U] = !0;
|
|
335
335
|
}
|
|
336
|
-
var
|
|
337
|
-
return
|
|
336
|
+
var w = D.prototype;
|
|
337
|
+
return w.parse = function(p) {
|
|
338
338
|
this.$d = (function(I) {
|
|
339
|
-
var
|
|
340
|
-
if (
|
|
341
|
-
if (E.u(
|
|
342
|
-
if (
|
|
343
|
-
if (typeof
|
|
344
|
-
var
|
|
345
|
-
if (
|
|
346
|
-
var M =
|
|
347
|
-
return L ? new Date(Date.UTC(
|
|
339
|
+
var A = I.date, L = I.utc;
|
|
340
|
+
if (A === null) return /* @__PURE__ */ new Date(NaN);
|
|
341
|
+
if (E.u(A)) return /* @__PURE__ */ new Date();
|
|
342
|
+
if (A instanceof Date) return new Date(A);
|
|
343
|
+
if (typeof A == "string" && !/Z$/i.test(A)) {
|
|
344
|
+
var T = A.match(C);
|
|
345
|
+
if (T) {
|
|
346
|
+
var M = T[2] - 1 || 0, W = (T[7] || "0").substring(0, 3);
|
|
347
|
+
return L ? new Date(Date.UTC(T[1], M, T[3] || 1, T[4] || 0, T[5] || 0, T[6] || 0, W)) : new Date(T[1], M, T[3] || 1, T[4] || 0, T[5] || 0, T[6] || 0, W);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
return new Date(
|
|
350
|
+
return new Date(A);
|
|
351
351
|
})(p), this.init();
|
|
352
|
-
},
|
|
352
|
+
}, w.init = function() {
|
|
353
353
|
var p = this.$d;
|
|
354
354
|
this.$y = p.getFullYear(), this.$M = p.getMonth(), this.$D = p.getDate(), this.$W = p.getDay(), this.$H = p.getHours(), this.$m = p.getMinutes(), this.$s = p.getSeconds(), this.$ms = p.getMilliseconds();
|
|
355
|
-
},
|
|
355
|
+
}, w.$utils = function() {
|
|
356
356
|
return E;
|
|
357
|
-
},
|
|
357
|
+
}, w.isValid = function() {
|
|
358
358
|
return this.$d.toString() !== O;
|
|
359
|
-
},
|
|
360
|
-
var
|
|
361
|
-
return this.startOf(I) <=
|
|
362
|
-
},
|
|
363
|
-
return
|
|
364
|
-
},
|
|
365
|
-
return this.endOf(I) <
|
|
366
|
-
},
|
|
367
|
-
return E.u(p) ? this[I] : this.set(
|
|
368
|
-
},
|
|
359
|
+
}, w.isSame = function(p, I) {
|
|
360
|
+
var A = S(p);
|
|
361
|
+
return this.startOf(I) <= A && A <= this.endOf(I);
|
|
362
|
+
}, w.isAfter = function(p, I) {
|
|
363
|
+
return S(p) < this.startOf(I);
|
|
364
|
+
}, w.isBefore = function(p, I) {
|
|
365
|
+
return this.endOf(I) < S(p);
|
|
366
|
+
}, w.$g = function(p, I, A) {
|
|
367
|
+
return E.u(p) ? this[I] : this.set(A, p);
|
|
368
|
+
}, w.unix = function() {
|
|
369
369
|
return Math.floor(this.valueOf() / 1e3);
|
|
370
|
-
},
|
|
370
|
+
}, w.valueOf = function() {
|
|
371
371
|
return this.$d.getTime();
|
|
372
|
-
},
|
|
373
|
-
var
|
|
374
|
-
var Ae = E.w(
|
|
372
|
+
}, w.startOf = function(p, I) {
|
|
373
|
+
var A = this, L = !!E.u(I) || I, T = E.p(p), M = function(le, me) {
|
|
374
|
+
var Ae = E.w(A.$u ? Date.UTC(A.$y, me, le) : new Date(A.$y, me, le), A);
|
|
375
375
|
return L ? Ae : Ae.endOf(u);
|
|
376
|
-
}, W = function(
|
|
377
|
-
return E.w(
|
|
376
|
+
}, W = function(le, me) {
|
|
377
|
+
return E.w(A.toDate()[le].apply(A.toDate("s"), (L ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(me)), A);
|
|
378
378
|
}, Z = this.$W, z = this.$M, Y = this.$D, X = "set" + (this.$u ? "UTC" : "");
|
|
379
|
-
switch (
|
|
379
|
+
switch (T) {
|
|
380
380
|
case f:
|
|
381
381
|
return L ? M(1, 0) : M(31, 11);
|
|
382
382
|
case d:
|
|
@@ -385,7 +385,7 @@ function Xa() {
|
|
|
385
385
|
var ie = this.$locale().weekStart || 0, Ne = (Z < ie ? Z + 7 : Z) - ie;
|
|
386
386
|
return M(L ? Y - Ne : Y + (6 - Ne), z);
|
|
387
387
|
case u:
|
|
388
|
-
case
|
|
388
|
+
case v:
|
|
389
389
|
return W(X + "Hours", 0);
|
|
390
390
|
case l:
|
|
391
391
|
return W(X + "Minutes", 1);
|
|
@@ -396,42 +396,42 @@ function Xa() {
|
|
|
396
396
|
default:
|
|
397
397
|
return this.clone();
|
|
398
398
|
}
|
|
399
|
-
},
|
|
399
|
+
}, w.endOf = function(p) {
|
|
400
400
|
return this.startOf(p, !1);
|
|
401
|
-
},
|
|
402
|
-
var
|
|
401
|
+
}, w.$set = function(p, I) {
|
|
402
|
+
var A, L = E.p(p), T = "set" + (this.$u ? "UTC" : ""), M = (A = {}, A[u] = T + "Date", A[v] = T + "Date", A[d] = T + "Month", A[f] = T + "FullYear", A[l] = T + "Hours", A[o] = T + "Minutes", A[i] = T + "Seconds", A[a] = T + "Milliseconds", A)[L], W = L === u ? this.$D + (I - this.$W) : I;
|
|
403
403
|
if (L === d || L === f) {
|
|
404
|
-
var Z = this.clone().set(
|
|
405
|
-
Z.$d[M](W), Z.init(), this.$d = Z.set(
|
|
404
|
+
var Z = this.clone().set(v, 1);
|
|
405
|
+
Z.$d[M](W), Z.init(), this.$d = Z.set(v, Math.min(this.$D, Z.daysInMonth())).$d;
|
|
406
406
|
} else M && this.$d[M](W);
|
|
407
407
|
return this.init(), this;
|
|
408
|
-
},
|
|
408
|
+
}, w.set = function(p, I) {
|
|
409
409
|
return this.clone().$set(p, I);
|
|
410
|
-
},
|
|
410
|
+
}, w.get = function(p) {
|
|
411
411
|
return this[E.p(p)]();
|
|
412
|
-
},
|
|
413
|
-
var
|
|
412
|
+
}, w.add = function(p, I) {
|
|
413
|
+
var A, L = this;
|
|
414
414
|
p = Number(p);
|
|
415
|
-
var
|
|
416
|
-
var Y =
|
|
415
|
+
var T = E.p(I), M = function(z) {
|
|
416
|
+
var Y = S(L);
|
|
417
417
|
return E.w(Y.date(Y.date() + Math.round(z * p)), L);
|
|
418
418
|
};
|
|
419
|
-
if (
|
|
420
|
-
if (
|
|
421
|
-
if (
|
|
422
|
-
if (
|
|
423
|
-
var W = (
|
|
419
|
+
if (T === d) return this.set(d, this.$M + p);
|
|
420
|
+
if (T === f) return this.set(f, this.$y + p);
|
|
421
|
+
if (T === u) return M(1);
|
|
422
|
+
if (T === m) return M(7);
|
|
423
|
+
var W = (A = {}, A[o] = n, A[l] = r, A[i] = s, A)[T] || 1, Z = this.$d.getTime() + p * W;
|
|
424
424
|
return E.w(Z, this);
|
|
425
|
-
},
|
|
425
|
+
}, w.subtract = function(p, I) {
|
|
426
426
|
return this.add(-1 * p, I);
|
|
427
|
-
},
|
|
428
|
-
var I = this,
|
|
429
|
-
if (!this.isValid()) return
|
|
430
|
-
var L = p || "YYYY-MM-DDTHH:mm:ssZ",
|
|
427
|
+
}, w.format = function(p) {
|
|
428
|
+
var I = this, A = this.$locale();
|
|
429
|
+
if (!this.isValid()) return A.invalidDate || O;
|
|
430
|
+
var L = p || "YYYY-MM-DDTHH:mm:ssZ", T = E.z(this), M = this.$H, W = this.$m, Z = this.$M, z = A.weekdays, Y = A.months, X = A.meridiem, ie = function(me, Ae, Ie, Fe) {
|
|
431
431
|
return me && (me[Ae] || me(I, L)) || Ie[Ae].slice(0, Fe);
|
|
432
432
|
}, Ne = function(me) {
|
|
433
433
|
return E.s(M % 12 || 12, me, "0");
|
|
434
|
-
},
|
|
434
|
+
}, le = X || function(me, Ae, Ie) {
|
|
435
435
|
var Fe = me < 12 ? "AM" : "PM";
|
|
436
436
|
return Ie ? Fe.toLowerCase() : Fe;
|
|
437
437
|
};
|
|
@@ -447,7 +447,7 @@ function Xa() {
|
|
|
447
447
|
case "MM":
|
|
448
448
|
return E.s(Z + 1, 2, "0");
|
|
449
449
|
case "MMM":
|
|
450
|
-
return ie(
|
|
450
|
+
return ie(A.monthsShort, Z, Y, 3);
|
|
451
451
|
case "MMMM":
|
|
452
452
|
return ie(Y, Z);
|
|
453
453
|
case "D":
|
|
@@ -457,9 +457,9 @@ function Xa() {
|
|
|
457
457
|
case "d":
|
|
458
458
|
return String(I.$W);
|
|
459
459
|
case "dd":
|
|
460
|
-
return ie(
|
|
460
|
+
return ie(A.weekdaysMin, I.$W, z, 2);
|
|
461
461
|
case "ddd":
|
|
462
|
-
return ie(
|
|
462
|
+
return ie(A.weekdaysShort, I.$W, z, 3);
|
|
463
463
|
case "dddd":
|
|
464
464
|
return z[I.$W];
|
|
465
465
|
case "H":
|
|
@@ -471,9 +471,9 @@ function Xa() {
|
|
|
471
471
|
case "hh":
|
|
472
472
|
return Ne(2);
|
|
473
473
|
case "a":
|
|
474
|
-
return
|
|
474
|
+
return le(M, W, !0);
|
|
475
475
|
case "A":
|
|
476
|
-
return
|
|
476
|
+
return le(M, W, !1);
|
|
477
477
|
case "m":
|
|
478
478
|
return String(W);
|
|
479
479
|
case "mm":
|
|
@@ -485,16 +485,16 @@ function Xa() {
|
|
|
485
485
|
case "SSS":
|
|
486
486
|
return E.s(I.$ms, 3, "0");
|
|
487
487
|
case "Z":
|
|
488
|
-
return
|
|
488
|
+
return T;
|
|
489
489
|
}
|
|
490
490
|
return null;
|
|
491
|
-
})(me) ||
|
|
491
|
+
})(me) || T.replace(":", "");
|
|
492
492
|
}));
|
|
493
|
-
},
|
|
493
|
+
}, w.utcOffset = function() {
|
|
494
494
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
495
|
-
},
|
|
496
|
-
var L,
|
|
497
|
-
return E.m(
|
|
495
|
+
}, w.diff = function(p, I, A) {
|
|
496
|
+
var L, T = this, M = E.p(I), W = S(p), Z = (W.utcOffset() - this.utcOffset()) * n, z = this - W, Y = function() {
|
|
497
|
+
return E.m(T, W);
|
|
498
498
|
};
|
|
499
499
|
switch (M) {
|
|
500
500
|
case f:
|
|
@@ -524,36 +524,36 @@ function Xa() {
|
|
|
524
524
|
default:
|
|
525
525
|
L = z;
|
|
526
526
|
}
|
|
527
|
-
return
|
|
528
|
-
},
|
|
527
|
+
return A ? L : E.a(L);
|
|
528
|
+
}, w.daysInMonth = function() {
|
|
529
529
|
return this.endOf(d).$D;
|
|
530
|
-
},
|
|
530
|
+
}, w.$locale = function() {
|
|
531
531
|
return V[this.$L];
|
|
532
|
-
},
|
|
532
|
+
}, w.locale = function(p, I) {
|
|
533
533
|
if (!p) return this.$L;
|
|
534
|
-
var
|
|
535
|
-
return L && (
|
|
536
|
-
},
|
|
534
|
+
var A = this.clone(), L = y(p, I, !0);
|
|
535
|
+
return L && (A.$L = L), A;
|
|
536
|
+
}, w.clone = function() {
|
|
537
537
|
return E.w(this.$d, this);
|
|
538
|
-
},
|
|
538
|
+
}, w.toDate = function() {
|
|
539
539
|
return new Date(this.valueOf());
|
|
540
|
-
},
|
|
540
|
+
}, w.toJSON = function() {
|
|
541
541
|
return this.isValid() ? this.toISOString() : null;
|
|
542
|
-
},
|
|
542
|
+
}, w.toISOString = function() {
|
|
543
543
|
return this.$d.toISOString();
|
|
544
|
-
},
|
|
544
|
+
}, w.toString = function() {
|
|
545
545
|
return this.$d.toUTCString();
|
|
546
546
|
}, D;
|
|
547
|
-
})(),
|
|
548
|
-
return
|
|
549
|
-
|
|
550
|
-
return this.$g(
|
|
547
|
+
})(), ue = de.prototype;
|
|
548
|
+
return S.prototype = ue, [["$ms", a], ["$s", i], ["$m", o], ["$H", l], ["$W", u], ["$M", d], ["$y", f], ["$D", v]].forEach((function(D) {
|
|
549
|
+
ue[D[1]] = function(w) {
|
|
550
|
+
return this.$g(w, D[0], D[1]);
|
|
551
551
|
};
|
|
552
|
-
})),
|
|
553
|
-
return D.$i || (D(
|
|
554
|
-
},
|
|
555
|
-
return
|
|
556
|
-
},
|
|
552
|
+
})), S.extend = function(D, w) {
|
|
553
|
+
return D.$i || (D(w, de, S), D.$i = !0), S;
|
|
554
|
+
}, S.locale = y, S.isDayjs = G, S.unix = function(D) {
|
|
555
|
+
return S(1e3 * D);
|
|
556
|
+
}, S.en = V[R], S.Ls = V, S.p = {}, S;
|
|
557
557
|
}));
|
|
558
558
|
})(ts)), ts.exports;
|
|
559
559
|
}
|
|
@@ -889,41 +889,50 @@ function oi(t) {
|
|
|
889
889
|
u,
|
|
890
890
|
m,
|
|
891
891
|
d
|
|
892
|
-
] = await Promise.allSettled(a), g = (y) =>
|
|
892
|
+
] = await Promise.allSettled(a), g = (y) => {
|
|
893
|
+
if (y.status !== "fulfilled") return [];
|
|
894
|
+
const S = y.value;
|
|
895
|
+
return Array.isArray(S) ? S : Array.isArray(S?.Data) ? S.Data : Array.isArray(S?.data) ? S.data : [];
|
|
896
|
+
}, f = g(i), v = g(o), O = g(l), C = g(u), J = g(m), _ = d.status === "fulfilled" ? d.value : null;
|
|
893
897
|
let te = [];
|
|
894
898
|
Array.isArray(_) ? te = _ : Array.isArray(_?.Data) ? te = _.Data : Array.isArray(_?.data) && (te = _.data);
|
|
895
899
|
const k = f.map((y) => ({
|
|
896
900
|
actionTypeId: Number(y?.ActionTypeId),
|
|
897
901
|
name: y?.DisplayName ?? y?.Name ?? ""
|
|
898
|
-
})), R =
|
|
902
|
+
})), R = v.map((y) => ({
|
|
899
903
|
recordId: y?.AnomalyId,
|
|
900
904
|
anomalyName: y?.DisplayName ?? y?.Name ?? ""
|
|
901
905
|
})), V = O.map((y) => ({
|
|
902
|
-
|
|
906
|
+
thirdPartyIds: Number(y?.ThirdPartyId),
|
|
903
907
|
thirdPartyName: y?.ThirdPartyName ?? y?.Name ?? ""
|
|
904
908
|
})), U = te.map((y) => ({
|
|
905
909
|
userRoleId: y.UserRoleId ?? y.userRoleId ?? y.Id ?? y.id ?? 0,
|
|
906
910
|
userRoleName: y.UserRoleName ?? y.userRoleName ?? y.Name ?? y.name ?? ""
|
|
907
|
-
})),
|
|
911
|
+
})), G = {
|
|
908
912
|
actionTypes: k,
|
|
909
913
|
anomalies: R,
|
|
910
914
|
thirdParties: V
|
|
911
915
|
};
|
|
912
|
-
return C.length && (
|
|
916
|
+
return C.length && (G.severities = C), J.length && (G.scheduleTypes = J), U.length && (G.userRoles = U), G;
|
|
913
917
|
},
|
|
914
918
|
async updateRule(n, r) {
|
|
915
|
-
const a = `${s}/${n}`, { escalationSettings: i,
|
|
916
|
-
return Qe(a, {
|
|
919
|
+
const a = `${s}/${n}`, { escalationSettings: i, Anomaly: o, Severity: l, ...u } = r ?? {};
|
|
920
|
+
return console.log("payload", r), Qe(a, {
|
|
917
921
|
method: "PUT",
|
|
918
922
|
headers: e,
|
|
919
923
|
body: JSON.stringify({
|
|
920
|
-
...
|
|
924
|
+
...u,
|
|
921
925
|
CustomerId: "99e5c8b5-b9d4-4d35-8885-7f121c532664",
|
|
922
926
|
Version: {
|
|
923
927
|
DeDupWindowSeconds: 0,
|
|
924
928
|
IncludeSubjectInHash: !0
|
|
925
929
|
},
|
|
926
|
-
|
|
930
|
+
AnomalyId: o?.AnomalyId,
|
|
931
|
+
SeverityId: l?.SeverityId,
|
|
932
|
+
EscalationSettings: i ? {
|
|
933
|
+
...i,
|
|
934
|
+
ThirdPartyIds: i.thirdPartyId ?? []
|
|
935
|
+
} : {}
|
|
927
936
|
})
|
|
928
937
|
});
|
|
929
938
|
}
|
|
@@ -1002,15 +1011,15 @@ function ci(t) {
|
|
|
1002
1011
|
m
|
|
1003
1012
|
] = await Promise.allSettled(a), d = (U) => {
|
|
1004
1013
|
if (U.status !== "fulfilled") return [];
|
|
1005
|
-
const
|
|
1006
|
-
return Array.isArray(
|
|
1007
|
-
}, g = d(i), f = d(o),
|
|
1014
|
+
const G = U.value;
|
|
1015
|
+
return Array.isArray(G) ? G : Array.isArray(G?.data) ? G.data : [];
|
|
1016
|
+
}, g = d(i), f = d(o), v = d(l), O = d(u), C = m.status === "fulfilled" ? m.value : null, J = g.map((U) => ({
|
|
1008
1017
|
actionTypeId: U?.ActionTypeUniqueId,
|
|
1009
1018
|
name: U?.Name ?? ""
|
|
1010
1019
|
})), _ = f.map((U) => ({
|
|
1011
1020
|
recordId: U?.AnomalyId,
|
|
1012
1021
|
anomalyName: U?.DisplayName ?? U?.Name ?? ""
|
|
1013
|
-
})), te =
|
|
1022
|
+
})), te = v.map((U) => ({
|
|
1014
1023
|
thirdPartyId: Number(U?.ThirdPartyId),
|
|
1015
1024
|
thirdPartyName: U?.ThirdPartyName ?? U?.Name ?? ""
|
|
1016
1025
|
}));
|
|
@@ -1030,7 +1039,7 @@ function ci(t) {
|
|
|
1030
1039
|
}))), R.length && (V.userRoles = R), V;
|
|
1031
1040
|
},
|
|
1032
1041
|
async updateRule(n, r) {
|
|
1033
|
-
const a = new URL("/update-rule", t.baseUrl).toString(), { escalationSettings: i, ruleId: o, ruleName: l, ruleDesc: u, ...m } = r ?? {}, d = i ?? {}, g = (d.escalationSettingsActionTypeIds ?? []).filter((
|
|
1042
|
+
const a = new URL("/update-rule", t.baseUrl).toString(), { escalationSettings: i, ruleId: o, ruleName: l, ruleDesc: u, ...m } = r ?? {}, d = i ?? {}, g = (d.escalationSettingsActionTypeIds ?? []).filter((v) => v != null && !Number.isNaN(v)), f = {
|
|
1034
1043
|
Level1UserRoleId: d.level1UserRoleId ?? 0,
|
|
1035
1044
|
Level1PostAssistTime: d.level1PostAssistTime ?? 0,
|
|
1036
1045
|
Level2UserRoleId: d.level2UserRoleId ?? 0,
|
|
@@ -1381,45 +1390,45 @@ function bi({
|
|
|
1381
1390
|
] });
|
|
1382
1391
|
}
|
|
1383
1392
|
function ur({ data: t, loading: e = !1, pageSize: s = 10, columns: n, severityOptions: r, spaceOptions: a, renderActions: i, onAlertIdClick: o, onRefetch: l, onPageChange: u, excludeCompleted: m = !0 }) {
|
|
1384
|
-
const [d, g] =
|
|
1393
|
+
const [d, g] = b("All"), [f, v] = b("All"), [O, C] = b("All"), [J, _] = b("All"), [te, k] = b(""), [R, V] = b([{ label: "All", value: "All" }]), [U, G] = b(/* @__PURE__ */ new Set()), { rules: y, alerts: S } = He(), E = {
|
|
1385
1394
|
6: { title: "Email", kind: "icon", icon: /* @__PURE__ */ c(xa, {}) },
|
|
1386
1395
|
7: { title: "SMS", kind: "icon", icon: /* @__PURE__ */ c(Ia, {}) }
|
|
1387
|
-
}, de = Se(() => yi(t), [t]),
|
|
1396
|
+
}, de = Se(() => yi(t), [t]), ue = Se(() => gi(t), [t]);
|
|
1388
1397
|
ve(() => {
|
|
1389
|
-
let
|
|
1398
|
+
let T = !0;
|
|
1390
1399
|
return (async () => {
|
|
1391
1400
|
try {
|
|
1392
1401
|
const M = await y.getLookups(), Z = (Array.isArray(M.thirdParties) ? M.thirdParties : []).map((z) => ({
|
|
1393
1402
|
label: z.thirdPartyName,
|
|
1394
1403
|
value: String(z.thirdPartyId)
|
|
1395
1404
|
}));
|
|
1396
|
-
|
|
1405
|
+
T && V([{ label: "All", value: "All" }, ...Z]);
|
|
1397
1406
|
} catch (M) {
|
|
1398
1407
|
console.error("Error loading third party options", M);
|
|
1399
1408
|
}
|
|
1400
1409
|
})(), () => {
|
|
1401
|
-
|
|
1410
|
+
T = !1;
|
|
1402
1411
|
};
|
|
1403
1412
|
}, [y]);
|
|
1404
1413
|
const D = Se(
|
|
1405
|
-
() => (t || []).some((
|
|
1414
|
+
() => (t || []).some((T) => Sn(T).length > 0),
|
|
1406
1415
|
[t]
|
|
1407
|
-
),
|
|
1408
|
-
const M = d === "All" ||
|
|
1416
|
+
), w = Se(() => (t || []).filter((T) => {
|
|
1417
|
+
const M = d === "All" || T.priority === d, W = `${T.id} ${T.description} ${T.statusType}`.toLowerCase(), Z = !te || W.includes(te.toLowerCase()), z = f === "All" || (T.anomalyName || "").toLowerCase() === f.toLowerCase(), Y = O === "All" || (T.spaceName || "").toLowerCase() === O.toLowerCase(), X = !D || J === "All" || Sn(T).includes(Number(J)), ie = !m || !["completed", "false positive"].includes(String(T.statusType || "").toLowerCase());
|
|
1409
1418
|
return M && Z && z && Y && X && ie;
|
|
1410
|
-
}), [t, d, te, f, O, J, D, m]), p = de, I = a?.length ? a :
|
|
1419
|
+
}), [t, d, te, f, O, J, D, m]), p = de, I = a?.length ? a : ue, A = [
|
|
1411
1420
|
{
|
|
1412
1421
|
title: "Severity",
|
|
1413
1422
|
dataIndex: "priority",
|
|
1414
1423
|
key: "priority",
|
|
1415
1424
|
width: 120,
|
|
1416
|
-
render: (
|
|
1425
|
+
render: (T) => /* @__PURE__ */ c(Nt, { className: "px-[10px] py-[2px]", style: { border: `2px solid ${hi[T]}`, backgroundColor: fi[T] }, children: T })
|
|
1417
1426
|
},
|
|
1418
1427
|
{
|
|
1419
1428
|
title: "Tracker",
|
|
1420
1429
|
key: "tracker",
|
|
1421
1430
|
width: 140,
|
|
1422
|
-
render: (
|
|
1431
|
+
render: (T, M) => /* @__PURE__ */ c(
|
|
1423
1432
|
"a",
|
|
1424
1433
|
{
|
|
1425
1434
|
onClick: (W) => {
|
|
@@ -1434,23 +1443,23 @@ function ur({ data: t, loading: e = !1, pageSize: s = 10, columns: n, severityOp
|
|
|
1434
1443
|
title: "Call to action/Human in the loop",
|
|
1435
1444
|
key: "actions",
|
|
1436
1445
|
width: 320,
|
|
1437
|
-
render: (
|
|
1446
|
+
render: (T, M) => {
|
|
1438
1447
|
if (i) return /* @__PURE__ */ c(ga, { children: i(M) });
|
|
1439
1448
|
const W = async (Fe, st) => {
|
|
1440
1449
|
const ht = ks(M.id, Fe);
|
|
1441
|
-
|
|
1450
|
+
G((ge) => new Set(ge).add(ht));
|
|
1442
1451
|
try {
|
|
1443
|
-
const ge = await
|
|
1452
|
+
const ge = await S.sendSMSorEmailNotifications?.(M.id, Fe, st);
|
|
1444
1453
|
ge?.responseStatus || ge?.Success || ge?.success ? (Te.success(ge?.message || ge.data || (Fe ? "Email sent successfully" : "SMS sent successfully")), l?.()) : Te.error(ge?.message || ge?.data || ge?.errorMessage || "Failed to send notification");
|
|
1445
1454
|
} catch (ge) {
|
|
1446
1455
|
Te.error(ge?.message || "Failed to send notification");
|
|
1447
1456
|
} finally {
|
|
1448
|
-
|
|
1457
|
+
G((ge) => {
|
|
1449
1458
|
const yt = new Set(ge);
|
|
1450
1459
|
return yt.delete(ht), yt;
|
|
1451
1460
|
});
|
|
1452
1461
|
}
|
|
1453
|
-
}, Z = Xs, z = en, Y = E[Z], X = E[z], ie = bn(Z, M, Y?.title), Ne = bn(z, M, X?.title),
|
|
1462
|
+
}, Z = Xs, z = en, Y = E[Z], X = E[z], ie = bn(Z, M, Y?.title), Ne = bn(z, M, X?.title), le = ks(M.id, !0), me = ks(M.id, !1), Ae = jt(Z) && U.has(le), Ie = jt(z) && U.has(me);
|
|
1454
1463
|
return /* @__PURE__ */ h(Je, { size: "middle", children: [
|
|
1455
1464
|
/* @__PURE__ */ c(hn, { title: ie.tooltipTitle, children: /* @__PURE__ */ c(
|
|
1456
1465
|
De,
|
|
@@ -1486,7 +1495,7 @@ function ur({ data: t, loading: e = !1, pageSize: s = 10, columns: n, severityOp
|
|
|
1486
1495
|
dataIndex: "timestamp",
|
|
1487
1496
|
key: "timestamp",
|
|
1488
1497
|
width: 220,
|
|
1489
|
-
render: (
|
|
1498
|
+
render: (T, M) => {
|
|
1490
1499
|
const W = M?.timeElapsed, Z = M?.timeRemaining, z = W ? pn(W) : 0, Y = Z ? pn(Z) : 0, X = Math.round(z / (z + Y) * 100);
|
|
1491
1500
|
return /* @__PURE__ */ h("div", { children: [
|
|
1492
1501
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1511,7 +1520,7 @@ function ur({ data: t, loading: e = !1, pageSize: s = 10, columns: n, severityOp
|
|
|
1511
1520
|
title: "Description",
|
|
1512
1521
|
dataIndex: "description",
|
|
1513
1522
|
key: "description",
|
|
1514
|
-
render: (
|
|
1523
|
+
render: (T, M) => /* @__PURE__ */ h("div", { children: [
|
|
1515
1524
|
/* @__PURE__ */ c(
|
|
1516
1525
|
"a",
|
|
1517
1526
|
{
|
|
@@ -1522,15 +1531,15 @@ function ur({ data: t, loading: e = !1, pageSize: s = 10, columns: n, severityOp
|
|
|
1522
1531
|
children: M.alertNumber
|
|
1523
1532
|
}
|
|
1524
1533
|
),
|
|
1525
|
-
/* @__PURE__ */ c("div", { className: "text-black/65", children:
|
|
1534
|
+
/* @__PURE__ */ c("div", { className: "text-black/65", children: T })
|
|
1526
1535
|
] })
|
|
1527
1536
|
}
|
|
1528
|
-
], L = n && n.length ? n :
|
|
1537
|
+
], L = n && n.length ? n : A;
|
|
1529
1538
|
return /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
1530
1539
|
bi,
|
|
1531
1540
|
{
|
|
1532
1541
|
rowKey: "id",
|
|
1533
|
-
data:
|
|
1542
|
+
data: w,
|
|
1534
1543
|
columns: L,
|
|
1535
1544
|
loading: e,
|
|
1536
1545
|
pageSize: s,
|
|
@@ -1542,7 +1551,7 @@ function ur({ data: t, loading: e = !1, pageSize: s = 10, columns: n, severityOp
|
|
|
1542
1551
|
] }) }),
|
|
1543
1552
|
/* @__PURE__ */ c(j, { flex: "none", children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1544
1553
|
/* @__PURE__ */ c("span", { children: "Anomaly type" }),
|
|
1545
|
-
/* @__PURE__ */ c(vi, { value: f, onChange:
|
|
1554
|
+
/* @__PURE__ */ c(vi, { value: f, onChange: v, options: p })
|
|
1546
1555
|
] }) }),
|
|
1547
1556
|
/* @__PURE__ */ c(j, { flex: "none", children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1548
1557
|
/* @__PURE__ */ c("span", { children: "Space" }),
|
|
@@ -1559,7 +1568,7 @@ function ur({ data: t, loading: e = !1, pageSize: s = 10, columns: n, severityOp
|
|
|
1559
1568
|
allowClear: !0,
|
|
1560
1569
|
placeholder: "Search",
|
|
1561
1570
|
onSearch: k,
|
|
1562
|
-
onChange: (
|
|
1571
|
+
onChange: (T) => k(T.target.value),
|
|
1563
1572
|
className: "w-[260px] ",
|
|
1564
1573
|
enterButton: !0
|
|
1565
1574
|
}
|
|
@@ -1608,130 +1617,130 @@ class at extends ft {
|
|
|
1608
1617
|
super("Zone is an abstract class");
|
|
1609
1618
|
}
|
|
1610
1619
|
}
|
|
1611
|
-
const
|
|
1612
|
-
year:
|
|
1613
|
-
month:
|
|
1614
|
-
day:
|
|
1620
|
+
const N = "numeric", je = "short", Le = "long", as = {
|
|
1621
|
+
year: N,
|
|
1622
|
+
month: N,
|
|
1623
|
+
day: N
|
|
1615
1624
|
}, fr = {
|
|
1616
|
-
year:
|
|
1625
|
+
year: N,
|
|
1617
1626
|
month: je,
|
|
1618
|
-
day:
|
|
1627
|
+
day: N
|
|
1619
1628
|
}, Oi = {
|
|
1620
|
-
year:
|
|
1629
|
+
year: N,
|
|
1621
1630
|
month: je,
|
|
1622
|
-
day:
|
|
1631
|
+
day: N,
|
|
1623
1632
|
weekday: je
|
|
1624
1633
|
}, hr = {
|
|
1625
|
-
year:
|
|
1634
|
+
year: N,
|
|
1626
1635
|
month: Le,
|
|
1627
|
-
day:
|
|
1636
|
+
day: N
|
|
1628
1637
|
}, yr = {
|
|
1629
|
-
year:
|
|
1638
|
+
year: N,
|
|
1630
1639
|
month: Le,
|
|
1631
|
-
day:
|
|
1640
|
+
day: N,
|
|
1632
1641
|
weekday: Le
|
|
1633
1642
|
}, gr = {
|
|
1634
|
-
hour:
|
|
1635
|
-
minute:
|
|
1643
|
+
hour: N,
|
|
1644
|
+
minute: N
|
|
1636
1645
|
}, pr = {
|
|
1637
|
-
hour:
|
|
1638
|
-
minute:
|
|
1639
|
-
second:
|
|
1646
|
+
hour: N,
|
|
1647
|
+
minute: N,
|
|
1648
|
+
second: N
|
|
1640
1649
|
}, Sr = {
|
|
1641
|
-
hour:
|
|
1642
|
-
minute:
|
|
1643
|
-
second:
|
|
1650
|
+
hour: N,
|
|
1651
|
+
minute: N,
|
|
1652
|
+
second: N,
|
|
1644
1653
|
timeZoneName: je
|
|
1645
1654
|
}, wr = {
|
|
1646
|
-
hour:
|
|
1647
|
-
minute:
|
|
1648
|
-
second:
|
|
1655
|
+
hour: N,
|
|
1656
|
+
minute: N,
|
|
1657
|
+
second: N,
|
|
1649
1658
|
timeZoneName: Le
|
|
1650
1659
|
}, vr = {
|
|
1651
|
-
hour:
|
|
1652
|
-
minute:
|
|
1660
|
+
hour: N,
|
|
1661
|
+
minute: N,
|
|
1653
1662
|
hourCycle: "h23"
|
|
1654
1663
|
}, Ar = {
|
|
1655
|
-
hour:
|
|
1656
|
-
minute:
|
|
1657
|
-
second:
|
|
1664
|
+
hour: N,
|
|
1665
|
+
minute: N,
|
|
1666
|
+
second: N,
|
|
1658
1667
|
hourCycle: "h23"
|
|
1659
1668
|
}, Tr = {
|
|
1660
|
-
hour:
|
|
1661
|
-
minute:
|
|
1662
|
-
second:
|
|
1669
|
+
hour: N,
|
|
1670
|
+
minute: N,
|
|
1671
|
+
second: N,
|
|
1663
1672
|
hourCycle: "h23",
|
|
1664
1673
|
timeZoneName: je
|
|
1665
1674
|
}, Nr = {
|
|
1666
|
-
hour:
|
|
1667
|
-
minute:
|
|
1668
|
-
second:
|
|
1675
|
+
hour: N,
|
|
1676
|
+
minute: N,
|
|
1677
|
+
second: N,
|
|
1669
1678
|
hourCycle: "h23",
|
|
1670
1679
|
timeZoneName: Le
|
|
1671
1680
|
}, br = {
|
|
1672
|
-
year:
|
|
1673
|
-
month:
|
|
1674
|
-
day:
|
|
1675
|
-
hour:
|
|
1676
|
-
minute:
|
|
1681
|
+
year: N,
|
|
1682
|
+
month: N,
|
|
1683
|
+
day: N,
|
|
1684
|
+
hour: N,
|
|
1685
|
+
minute: N
|
|
1677
1686
|
}, kr = {
|
|
1678
|
-
year:
|
|
1679
|
-
month:
|
|
1680
|
-
day:
|
|
1681
|
-
hour:
|
|
1682
|
-
minute:
|
|
1683
|
-
second:
|
|
1687
|
+
year: N,
|
|
1688
|
+
month: N,
|
|
1689
|
+
day: N,
|
|
1690
|
+
hour: N,
|
|
1691
|
+
minute: N,
|
|
1692
|
+
second: N
|
|
1684
1693
|
}, Ir = {
|
|
1685
|
-
year:
|
|
1694
|
+
year: N,
|
|
1686
1695
|
month: je,
|
|
1687
|
-
day:
|
|
1688
|
-
hour:
|
|
1689
|
-
minute:
|
|
1696
|
+
day: N,
|
|
1697
|
+
hour: N,
|
|
1698
|
+
minute: N
|
|
1690
1699
|
}, xr = {
|
|
1691
|
-
year:
|
|
1700
|
+
year: N,
|
|
1692
1701
|
month: je,
|
|
1693
|
-
day:
|
|
1694
|
-
hour:
|
|
1695
|
-
minute:
|
|
1696
|
-
second:
|
|
1702
|
+
day: N,
|
|
1703
|
+
hour: N,
|
|
1704
|
+
minute: N,
|
|
1705
|
+
second: N
|
|
1697
1706
|
}, Mi = {
|
|
1698
|
-
year:
|
|
1707
|
+
year: N,
|
|
1699
1708
|
month: je,
|
|
1700
|
-
day:
|
|
1709
|
+
day: N,
|
|
1701
1710
|
weekday: je,
|
|
1702
|
-
hour:
|
|
1703
|
-
minute:
|
|
1711
|
+
hour: N,
|
|
1712
|
+
minute: N
|
|
1704
1713
|
}, Or = {
|
|
1705
|
-
year:
|
|
1714
|
+
year: N,
|
|
1706
1715
|
month: Le,
|
|
1707
|
-
day:
|
|
1708
|
-
hour:
|
|
1709
|
-
minute:
|
|
1716
|
+
day: N,
|
|
1717
|
+
hour: N,
|
|
1718
|
+
minute: N,
|
|
1710
1719
|
timeZoneName: je
|
|
1711
1720
|
}, Mr = {
|
|
1712
|
-
year:
|
|
1721
|
+
year: N,
|
|
1713
1722
|
month: Le,
|
|
1714
|
-
day:
|
|
1715
|
-
hour:
|
|
1716
|
-
minute:
|
|
1717
|
-
second:
|
|
1723
|
+
day: N,
|
|
1724
|
+
hour: N,
|
|
1725
|
+
minute: N,
|
|
1726
|
+
second: N,
|
|
1718
1727
|
timeZoneName: je
|
|
1719
1728
|
}, Er = {
|
|
1720
|
-
year:
|
|
1729
|
+
year: N,
|
|
1721
1730
|
month: Le,
|
|
1722
|
-
day:
|
|
1731
|
+
day: N,
|
|
1723
1732
|
weekday: Le,
|
|
1724
|
-
hour:
|
|
1725
|
-
minute:
|
|
1733
|
+
hour: N,
|
|
1734
|
+
minute: N,
|
|
1726
1735
|
timeZoneName: Le
|
|
1727
1736
|
}, Dr = {
|
|
1728
|
-
year:
|
|
1737
|
+
year: N,
|
|
1729
1738
|
month: Le,
|
|
1730
|
-
day:
|
|
1739
|
+
day: N,
|
|
1731
1740
|
weekday: Le,
|
|
1732
|
-
hour:
|
|
1733
|
-
minute:
|
|
1734
|
-
second:
|
|
1741
|
+
hour: N,
|
|
1742
|
+
minute: N,
|
|
1743
|
+
second: N,
|
|
1735
1744
|
timeZoneName: Le
|
|
1736
1745
|
};
|
|
1737
1746
|
class Wt {
|
|
@@ -2015,8 +2024,8 @@ class tt extends Wt {
|
|
|
2015
2024
|
millisecond: 0
|
|
2016
2025
|
});
|
|
2017
2026
|
let f = +s;
|
|
2018
|
-
const
|
|
2019
|
-
return f -=
|
|
2027
|
+
const v = f % 1e3;
|
|
2028
|
+
return f -= v >= 0 ? v : 1e3 + v, (g - f) / (60 * 1e3);
|
|
2020
2029
|
}
|
|
2021
2030
|
/**
|
|
2022
2031
|
* Return whether this Zone is equal to another zone
|
|
@@ -3158,12 +3167,12 @@ class ke {
|
|
|
3158
3167
|
return s > 0 && (r.padTo = s), n && (r.signDisplay = n), this.loc.numberFormatter(r).format(e);
|
|
3159
3168
|
}
|
|
3160
3169
|
formatDateTimeFromString(e, s) {
|
|
3161
|
-
const n = this.loc.listingMode() === "en", r = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", a = (f,
|
|
3162
|
-
|
|
3170
|
+
const n = this.loc.listingMode() === "en", r = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", a = (f, v) => this.loc.extract(e, f, v), i = (f) => e.isOffsetFixed && e.offset === 0 && f.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, f.format) : "", o = () => n ? uo(e) : a({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), l = (f, v) => n ? fo(e, f) : a(v ? { month: f } : { month: f, day: "numeric" }, "month"), u = (f, v) => n ? mo(e, f) : a(
|
|
3171
|
+
v ? { weekday: f } : { weekday: f, month: "long", day: "numeric" },
|
|
3163
3172
|
"weekday"
|
|
3164
3173
|
), m = (f) => {
|
|
3165
|
-
const
|
|
3166
|
-
return
|
|
3174
|
+
const v = ke.macroTokenToFormatOpts(f);
|
|
3175
|
+
return v ? this.formatWithSystemDefault(e, v) : f;
|
|
3167
3176
|
}, d = (f) => n ? ho(e, f) : a({ era: f }, "era"), g = (f) => {
|
|
3168
3177
|
switch (f) {
|
|
3169
3178
|
// ms
|
|
@@ -3334,9 +3343,9 @@ class ke {
|
|
|
3334
3343
|
}, a = (m, d) => (g) => {
|
|
3335
3344
|
const f = r(g);
|
|
3336
3345
|
if (f) {
|
|
3337
|
-
const
|
|
3346
|
+
const v = d.isNegativeDuration && f !== d.largestUnit ? n : 1;
|
|
3338
3347
|
let O;
|
|
3339
|
-
return this.opts.signMode === "negativeLargestOnly" && f !== d.largestUnit ? O = "never" : this.opts.signMode === "all" ? O = "always" : O = "auto", this.num(m.get(f) *
|
|
3348
|
+
return this.opts.signMode === "negativeLargestOnly" && f !== d.largestUnit ? O = "never" : this.opts.signMode === "all" ? O = "always" : O = "auto", this.num(m.get(f) * v, g.length, O);
|
|
3340
3349
|
} else
|
|
3341
3350
|
return g;
|
|
3342
3351
|
}, i = ke.parseFormat(s), o = i.reduce(
|
|
@@ -3416,7 +3425,7 @@ function Bt(t, e) {
|
|
|
3416
3425
|
}
|
|
3417
3426
|
const Io = RegExp(`^T?${on.source}$`), xo = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
|
|
3418
3427
|
function Oo(t) {
|
|
3419
|
-
const [e, s, n, r, a, i, o, l, u] = t, m = e[0] === "-", d = l && l[0] === "-", g = (f,
|
|
3428
|
+
const [e, s, n, r, a, i, o, l, u] = t, m = e[0] === "-", d = l && l[0] === "-", g = (f, v = !1) => f !== void 0 && (v || f && m) ? -f : f;
|
|
3420
3429
|
return [
|
|
3421
3430
|
{
|
|
3422
3431
|
years: g(ut(s)),
|
|
@@ -5683,28 +5692,28 @@ class $ {
|
|
|
5683
5692
|
const n = ot(s.zone, ye.defaultZone);
|
|
5684
5693
|
if (!n.isValid)
|
|
5685
5694
|
return $.invalid(Ut(n));
|
|
5686
|
-
const r = ne.fromObject(s), a = ls(e, Kn), { minDaysInFirstWeek: i, startOfWeek: o } = $n(a, r), l = ye.now(), u = P(s.specificOffset) ? n.offset(l) : s.specificOffset, m = !P(a.ordinal), d = !P(a.year), g = !P(a.month) || !P(a.day), f = d || g,
|
|
5687
|
-
if ((f || m) &&
|
|
5695
|
+
const r = ne.fromObject(s), a = ls(e, Kn), { minDaysInFirstWeek: i, startOfWeek: o } = $n(a, r), l = ye.now(), u = P(s.specificOffset) ? n.offset(l) : s.specificOffset, m = !P(a.ordinal), d = !P(a.year), g = !P(a.month) || !P(a.day), f = d || g, v = a.weekYear || a.weekNumber;
|
|
5696
|
+
if ((f || m) && v)
|
|
5688
5697
|
throw new vt(
|
|
5689
5698
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
5690
5699
|
);
|
|
5691
5700
|
if (g && m)
|
|
5692
5701
|
throw new vt("Can't mix ordinal dates with month/day");
|
|
5693
|
-
const O =
|
|
5702
|
+
const O = v || a.weekday && !f;
|
|
5694
5703
|
let C, J, _ = Qt(l, u);
|
|
5695
5704
|
O ? (C = Al, J = wl, _ = is(_, i, o)) : m ? (C = Tl, J = vl, _ = Ms(_)) : (C = ns, J = ma);
|
|
5696
5705
|
let te = !1;
|
|
5697
|
-
for (const
|
|
5698
|
-
const E = a[
|
|
5699
|
-
P(E) ? te ? a[
|
|
5706
|
+
for (const S of C) {
|
|
5707
|
+
const E = a[S];
|
|
5708
|
+
P(E) ? te ? a[S] = J[S] : a[S] = _[S] : te = !0;
|
|
5700
5709
|
}
|
|
5701
5710
|
const k = O ? Ki(a, i, o) : m ? Qi(a) : Pr(a), R = k || Wr(a);
|
|
5702
5711
|
if (R)
|
|
5703
5712
|
return $.invalid(R);
|
|
5704
|
-
const V = O ? Ln(a, i, o) : m ? Fn(a) : a, [U,
|
|
5713
|
+
const V = O ? Ln(a, i, o) : m ? Fn(a) : a, [U, G] = ss(V, u, n), y = new $({
|
|
5705
5714
|
ts: U,
|
|
5706
5715
|
zone: n,
|
|
5707
|
-
o:
|
|
5716
|
+
o: G,
|
|
5708
5717
|
loc: r
|
|
5709
5718
|
});
|
|
5710
5719
|
return a.weekday && f && e.weekday !== y.weekday ? $.invalid(
|
|
@@ -7152,11 +7161,11 @@ function Ml({
|
|
|
7152
7161
|
modifiedBy: 0
|
|
7153
7162
|
});
|
|
7154
7163
|
if (f?.responseStatus || f?.Success) {
|
|
7155
|
-
const
|
|
7156
|
-
Te.success(
|
|
7164
|
+
const v = f?.Message || f?.data || "Alert reopened successfully.";
|
|
7165
|
+
Te.success(v);
|
|
7157
7166
|
} else {
|
|
7158
|
-
const
|
|
7159
|
-
Te.error(
|
|
7167
|
+
const v = f?.errorMessage || f?.Message || "Failed to reopen alert";
|
|
7168
|
+
Te.error(v);
|
|
7160
7169
|
}
|
|
7161
7170
|
} catch {
|
|
7162
7171
|
Te.error("Failed to reopen alert. Please try again.");
|
|
@@ -7200,8 +7209,8 @@ function Ml({
|
|
|
7200
7209
|
/* @__PURE__ */ c(
|
|
7201
7210
|
"a",
|
|
7202
7211
|
{
|
|
7203
|
-
onClick: (
|
|
7204
|
-
|
|
7212
|
+
onClick: (v) => {
|
|
7213
|
+
v.preventDefault(), i?.(f, { sourceTab: "archived" });
|
|
7205
7214
|
},
|
|
7206
7215
|
className: "inline-block mb-1 text-blue-600",
|
|
7207
7216
|
children: f.alertNumber
|
|
@@ -7223,8 +7232,8 @@ function Ml({
|
|
|
7223
7232
|
items: [
|
|
7224
7233
|
{ key: "reopen", label: "Reopen" }
|
|
7225
7234
|
],
|
|
7226
|
-
onClick: ({ key:
|
|
7227
|
-
|
|
7235
|
+
onClick: ({ key: v }) => {
|
|
7236
|
+
v === "reopen" && u(f);
|
|
7228
7237
|
}
|
|
7229
7238
|
},
|
|
7230
7239
|
children: /* @__PURE__ */ c(De, { type: "text", icon: /* @__PURE__ */ c(Oa, {}) })
|
|
@@ -7278,7 +7287,7 @@ function El({
|
|
|
7278
7287
|
"aria-label": "Analog Clock",
|
|
7279
7288
|
children: [
|
|
7280
7289
|
[...Array(12)].map((m, d) => {
|
|
7281
|
-
const g = d * 30, f = 6,
|
|
7290
|
+
const g = d * 30, f = 6, v = u - 4, O = v - f, C = (g - 90) * (Math.PI / 180), J = u + O * Math.cos(C), _ = u + O * Math.sin(C), te = u + v * Math.cos(C), k = u + v * Math.sin(C);
|
|
7282
7291
|
return /* @__PURE__ */ c(
|
|
7283
7292
|
"svg",
|
|
7284
7293
|
{
|
|
@@ -7381,7 +7390,7 @@ function El({
|
|
|
7381
7390
|
);
|
|
7382
7391
|
}
|
|
7383
7392
|
function Dl({ label: t = "USA", timeZone: e = "America/New_York", updateIntervalMs: s = 1e3, className: n }) {
|
|
7384
|
-
const [r, a] =
|
|
7393
|
+
const [r, a] = b(/* @__PURE__ */ new Date());
|
|
7385
7394
|
ve(() => {
|
|
7386
7395
|
const u = setInterval(() => a(/* @__PURE__ */ new Date()), s);
|
|
7387
7396
|
return () => clearInterval(u);
|
|
@@ -7451,7 +7460,7 @@ function Ul(t) {
|
|
|
7451
7460
|
setL2mins: d,
|
|
7452
7461
|
l2role: g,
|
|
7453
7462
|
setL2role: f,
|
|
7454
|
-
l3mins:
|
|
7463
|
+
l3mins: v,
|
|
7455
7464
|
setL3mins: O,
|
|
7456
7465
|
l3role: C,
|
|
7457
7466
|
setL3role: J,
|
|
@@ -7461,34 +7470,34 @@ function Ul(t) {
|
|
|
7461
7470
|
setThirdPartyIds: R,
|
|
7462
7471
|
humanLoop: V,
|
|
7463
7472
|
setHumanLoop: U,
|
|
7464
|
-
isAutoExpire:
|
|
7473
|
+
isAutoExpire: G,
|
|
7465
7474
|
setAutoExpire: y,
|
|
7466
|
-
onClear:
|
|
7475
|
+
onClear: S,
|
|
7467
7476
|
onSave: E,
|
|
7468
7477
|
saving: de,
|
|
7469
|
-
onActionTypesLoaded:
|
|
7470
|
-
} = t, { rules: D } = He(), [
|
|
7478
|
+
onActionTypesLoaded: ue
|
|
7479
|
+
} = t, { rules: D } = He(), [w, p] = b([]), [I, A] = b([]), [L, T] = b(!1);
|
|
7471
7480
|
ve(() => {
|
|
7472
7481
|
let Y = !1;
|
|
7473
7482
|
return (async () => {
|
|
7474
7483
|
try {
|
|
7475
|
-
|
|
7484
|
+
T(!0);
|
|
7476
7485
|
const X = await D.getLookups();
|
|
7477
7486
|
if (Y || !X || !Array.isArray(X.actionTypes)) return;
|
|
7478
|
-
const ie = X.actionTypes.map((
|
|
7479
|
-
p(ie),
|
|
7480
|
-
const Ne = Array.isArray(X.thirdParties) ? X.thirdParties.map((
|
|
7481
|
-
|
|
7487
|
+
const ie = X.actionTypes.map((le) => ({ label: le.name, value: String(le.actionTypeId) }));
|
|
7488
|
+
p(ie), ue && ue(X.actionTypes);
|
|
7489
|
+
const Ne = Array.isArray(X.thirdParties) ? X.thirdParties.map((le) => ({ label: le.thirdPartyName, value: le.thirdPartyIds ?? le.thirdPartyId })) : [];
|
|
7490
|
+
A(Ne);
|
|
7482
7491
|
} catch (X) {
|
|
7483
7492
|
console.error("Error loading lookups", X);
|
|
7484
7493
|
} finally {
|
|
7485
|
-
Y ||
|
|
7494
|
+
Y || T(!1);
|
|
7486
7495
|
}
|
|
7487
7496
|
})(), () => {
|
|
7488
7497
|
Y = !0;
|
|
7489
7498
|
};
|
|
7490
7499
|
}, []);
|
|
7491
|
-
const M = typeof i == "number" || typeof l == "number", W = typeof m == "number" || typeof g == "number", Z = typeof i == "number" || typeof l == "number" || typeof m == "number" || typeof g == "number" || typeof
|
|
7500
|
+
const M = typeof i == "number" || typeof l == "number", W = typeof m == "number" || typeof g == "number", Z = typeof i == "number" || typeof l == "number" || typeof m == "number" || typeof g == "number" || typeof v == "number" || typeof C == "number" || Array.isArray(_) && _.length > 0 || Array.isArray(k) && k.length > 0 || !!V || !!G;
|
|
7492
7501
|
return /* @__PURE__ */ h(us, { spinning: !!de || L, children: [
|
|
7493
7502
|
/* @__PURE__ */ h(Ee, { gutter: [16, 16], align: "bottom", children: [
|
|
7494
7503
|
/* @__PURE__ */ c(j, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ h("div", { children: [
|
|
@@ -7571,7 +7580,7 @@ function Ul(t) {
|
|
|
7571
7580
|
{
|
|
7572
7581
|
className: "w-full",
|
|
7573
7582
|
placeholder: "Mins",
|
|
7574
|
-
value:
|
|
7583
|
+
value: v,
|
|
7575
7584
|
onChange: O,
|
|
7576
7585
|
options: r
|
|
7577
7586
|
}
|
|
@@ -7598,7 +7607,7 @@ function Ul(t) {
|
|
|
7598
7607
|
className: "w-full",
|
|
7599
7608
|
value: _,
|
|
7600
7609
|
onChange: te,
|
|
7601
|
-
options:
|
|
7610
|
+
options: w,
|
|
7602
7611
|
maxTagCount: 1,
|
|
7603
7612
|
maxTagPlaceholder: _s
|
|
7604
7613
|
}
|
|
@@ -7624,10 +7633,10 @@ function Ul(t) {
|
|
|
7624
7633
|
/* @__PURE__ */ h(Ee, { gutter: [16, 16], align: "bottom", className: "mt-4 items-center", children: [
|
|
7625
7634
|
/* @__PURE__ */ c(j, { xs: 24, sm: 12, md: 8, lg: 7, children: /* @__PURE__ */ h("div", { className: "flex items-center h-full gap-8", children: [
|
|
7626
7635
|
/* @__PURE__ */ c(wt, { checked: V, onChange: (Y) => U(Y.target.checked), className: "w-full", children: "Human-In-The-Loop" }),
|
|
7627
|
-
/* @__PURE__ */ c(wt, { checked:
|
|
7636
|
+
/* @__PURE__ */ c(wt, { checked: G, onChange: (Y) => y(Y.target.checked), className: "w-full", children: "Auto-expire in 5 minutes" })
|
|
7628
7637
|
] }) }),
|
|
7629
7638
|
/* @__PURE__ */ c(j, { xs: 24, sm: 12, md: 8, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
7630
|
-
/* @__PURE__ */ c(De, { onClick:
|
|
7639
|
+
/* @__PURE__ */ c(De, { onClick: S, children: "Clear" }),
|
|
7631
7640
|
/* @__PURE__ */ c(De, { type: "primary", onClick: E, loading: !!de, disabled: !(!!e && Z && !de), children: "Save" })
|
|
7632
7641
|
] }) })
|
|
7633
7642
|
] })
|
|
@@ -7703,7 +7712,7 @@ function Ll({ entries: t, userRoles: e, onEdit: s, loading: n }) {
|
|
|
7703
7712
|
}
|
|
7704
7713
|
const { Title: Fl, Text: Ls } = Pt;
|
|
7705
7714
|
function $l({ userRoles: t, rules: e, rawRules: s }) {
|
|
7706
|
-
const { rules: n } = He(), [r, a] =
|
|
7715
|
+
const { rules: n } = He(), [r, a] = b(!1), [i, o] = b(!1), [l, u] = b(s), [m, d] = b(), [g, f] = b([]), v = Se(() => t.map((k) => ({ label: k.userRoleName, value: k.userRoleId })), [t]), O = Se(() => (e || []).map((k) => ({ label: k.Name || "-", value: k.RuleId || k.Name || "" })), [e]), C = Se(
|
|
7707
7716
|
() => (e || []).map((k, R) => ({
|
|
7708
7717
|
key: k.RuleId || k.Name || String(R),
|
|
7709
7718
|
ruleName: k.Name || "-",
|
|
@@ -7744,8 +7753,8 @@ function $l({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
7744
7753
|
for (const R of C) {
|
|
7745
7754
|
const V = l.find(
|
|
7746
7755
|
(y) => y?.ruleId === R.key || y?.ruleName === R.key || y?.RuleId === R.key || y?.ruleName === R.ruleName || y?.Name === R.ruleName
|
|
7747
|
-
), U = V?.userRoleIds ?? V?.UserRoleIds,
|
|
7748
|
-
|
|
7756
|
+
), U = V?.userRoleIds ?? V?.UserRoleIds, G = Array.isArray(U) ? U : [];
|
|
7757
|
+
G.length && (k[R.key] = G);
|
|
7749
7758
|
}
|
|
7750
7759
|
return k;
|
|
7751
7760
|
}, [l, C]);
|
|
@@ -7775,7 +7784,7 @@ function $l({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
7775
7784
|
className: "w-full",
|
|
7776
7785
|
value: g,
|
|
7777
7786
|
onChange: f,
|
|
7778
|
-
options:
|
|
7787
|
+
options: v,
|
|
7779
7788
|
maxTagCount: 1,
|
|
7780
7789
|
maxTagPlaceholder: _s
|
|
7781
7790
|
}
|
|
@@ -7802,16 +7811,16 @@ function $l({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
7802
7811
|
if (!k || !R)
|
|
7803
7812
|
throw new Error(`Unable to find rule identifier for rule ${m}`);
|
|
7804
7813
|
const V = g.map((y) => {
|
|
7805
|
-
const
|
|
7806
|
-
return { id: y, name:
|
|
7814
|
+
const S = t.find((E) => E.userRoleId === y);
|
|
7815
|
+
return { id: y, name: S?.userRoleName ?? String(y) };
|
|
7807
7816
|
}), U = {
|
|
7808
7817
|
...k,
|
|
7809
7818
|
ruleId: m,
|
|
7810
7819
|
userRoleIds: g,
|
|
7811
7820
|
userRoles: V
|
|
7812
|
-
},
|
|
7813
|
-
if (!
|
|
7814
|
-
Te.error(
|
|
7821
|
+
}, G = await n.updateRule(R, U);
|
|
7822
|
+
if (!G?.responseStatus && !G?.Success && !G?.success)
|
|
7823
|
+
Te.error(G?.errorMessage || G?.Message || "Error saving Alert Assignment");
|
|
7815
7824
|
else {
|
|
7816
7825
|
Te.success("Alert assignment saved"), d(void 0), f([]);
|
|
7817
7826
|
try {
|
|
@@ -7854,8 +7863,8 @@ function $l({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
7854
7863
|
render: (k, R) => {
|
|
7855
7864
|
const V = J[R.key] ?? [];
|
|
7856
7865
|
return V.length ? /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-1", children: V.map((U) => {
|
|
7857
|
-
const
|
|
7858
|
-
return /* @__PURE__ */ c(Nt, { children:
|
|
7866
|
+
const G = t.find((y) => y.userRoleId === U);
|
|
7867
|
+
return /* @__PURE__ */ c(Nt, { children: G?.userRoleName ?? String(U) }, U);
|
|
7859
7868
|
}) }) : /* @__PURE__ */ c(Ls, { type: "secondary", children: "—" });
|
|
7860
7869
|
}
|
|
7861
7870
|
}
|
|
@@ -7874,13 +7883,13 @@ function Fs(t) {
|
|
|
7874
7883
|
level3UserRoleId: t.level3UserRoleId ?? t.Level3UserRoleId,
|
|
7875
7884
|
level3PostAssistTime: t.level3PostAssistTime ?? t.Level3PostAssistTime,
|
|
7876
7885
|
escalationSettingsActionTypeIds: t.escalationSettingsActionTypeIds ?? t.EscalationSettingsActionTypeIds,
|
|
7877
|
-
thirdPartyId: t.thirdPartyId ?? t.ThirdPartyIds,
|
|
7886
|
+
thirdPartyId: t.thirdPartyId ?? t.ThirdPartyId ?? t.ThirdPartyIds,
|
|
7878
7887
|
humanLoop: t.humanLoop ?? t.HumanLoop,
|
|
7879
7888
|
isAutoExpire: t.isAutoExpire ?? t.IsAutoExpire
|
|
7880
7889
|
};
|
|
7881
7890
|
}
|
|
7882
7891
|
function Pl({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules: r, onSave: a }) {
|
|
7883
|
-
const { rules: i, alerts: o } = He(), [l, u] =
|
|
7892
|
+
const { rules: i, alerts: o } = He(), [l, u] = b("By Severity"), [m, d] = b("By severity"), [g, f] = b("By Severity"), [v, O] = b(!1), [C, J] = b(!1), [_, te] = b(!1), [k, R] = b(null), [V, U] = b("rules"), [G, y] = b(), [S, E] = b(), [de, ue] = b(), [D, w] = b(), [p, I] = b(), [A, L] = b(), [T, M] = b(), [W, Z] = b(), [z, Y] = b([]), [X, ie] = b([]), [Ne, le] = b(!1), [me, Ae] = b(!1), [Ie, Fe] = b({}), [st, ht] = b({}), [ge, yt] = b(s || []), [Mt, zt] = b([]), [ct, ws] = b(!1), [x, q] = b(!1), [K, we] = b(n || []);
|
|
7884
7893
|
ve(() => {
|
|
7885
7894
|
n && n.length && we(n);
|
|
7886
7895
|
}, [n]), ve(() => {
|
|
@@ -7888,13 +7897,13 @@ function Pl({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
7888
7897
|
const F = Object.keys(Ie).length > 0 || Object.keys(st).length > 0;
|
|
7889
7898
|
if (Mt.length && !F) return;
|
|
7890
7899
|
const re = K.map((Q, B) => {
|
|
7891
|
-
const
|
|
7900
|
+
const ce = e.find((xe) => xe.RuleId === (Q.ruleId || Q.ruleName))?.Name || Q.ruleName || Q.Name || "-", H = Fs(Q.escalationSettings), ae = typeof H.level1UserRoleId == "number" && H.level1UserRoleId > 0 ? [H.level1UserRoleId] : [], vs = typeof H.level2UserRoleId == "number" && H.level2UserRoleId > 0 ? [H.level2UserRoleId] : [], As = typeof H.level3UserRoleId == "number" && H.level3UserRoleId > 0 ? [H.level3UserRoleId] : [], dn = (Array.isArray(H.escalationSettingsActionTypeIds) ? H.escalationSettingsActionTypeIds : []).map((xe) => Ie[xe] || String(xe)), fn = (Array.isArray(H.thirdPartyId) ? H.thirdPartyId : []).map((xe) => st[xe] || String(xe)), Ts = typeof H.humanLoop == "boolean" ? H.humanLoop : null, Ns = typeof H.isAutoExpire == "boolean" ? H.isAutoExpire : null;
|
|
7892
7901
|
return {
|
|
7893
7902
|
id: String(Q.ruleId || Q.ruleName || B),
|
|
7894
|
-
ruleOrSeverityLabel:
|
|
7895
|
-
l1: { minutes:
|
|
7896
|
-
l2: { minutes:
|
|
7897
|
-
l3: { minutes:
|
|
7903
|
+
ruleOrSeverityLabel: ce,
|
|
7904
|
+
l1: { minutes: H.level1PostAssistTime ?? void 0, roles: ae },
|
|
7905
|
+
l2: { minutes: H.level2PostAssistTime ?? void 0, roles: vs },
|
|
7906
|
+
l3: { minutes: H.level3PostAssistTime ?? void 0, roles: As },
|
|
7898
7907
|
actions: dn,
|
|
7899
7908
|
notify: fn,
|
|
7900
7909
|
humanLoop: Ts,
|
|
@@ -7936,32 +7945,32 @@ function Pl({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
7936
7945
|
F = !0;
|
|
7937
7946
|
};
|
|
7938
7947
|
}, []), ve(() => {
|
|
7939
|
-
if (!
|
|
7940
|
-
const F = (
|
|
7941
|
-
const
|
|
7942
|
-
return !isNaN(
|
|
7943
|
-
}, re = (
|
|
7944
|
-
const
|
|
7945
|
-
return !isNaN(
|
|
7948
|
+
if (!S) return;
|
|
7949
|
+
const F = (ce) => {
|
|
7950
|
+
const H = Number(ce);
|
|
7951
|
+
return !isNaN(H) && H > 0 ? H : void 0;
|
|
7952
|
+
}, re = (ce) => {
|
|
7953
|
+
const H = Number(ce);
|
|
7954
|
+
return !isNaN(H) && H > 0 ? H : void 0;
|
|
7946
7955
|
}, Q = (K || []).find(
|
|
7947
|
-
(
|
|
7956
|
+
(ce) => ce?.ruleId === S || ce?.ruleName === S || ce?.RuleId === S
|
|
7948
7957
|
), B = Fs(Q?.escalationSettings);
|
|
7949
7958
|
if (B && typeof B == "object") {
|
|
7950
|
-
|
|
7951
|
-
const
|
|
7952
|
-
Y(
|
|
7959
|
+
ue(re(B.level1PostAssistTime)), w(F(B.level1UserRoleId)), I(re(B.level2PostAssistTime)), L(F(B.level2UserRoleId)), M(re(B.level3PostAssistTime)), Z(F(B.level3UserRoleId));
|
|
7960
|
+
const ce = Array.isArray(B.escalationSettingsActionTypeIds) ? B.escalationSettingsActionTypeIds : [];
|
|
7961
|
+
Y(ce.map((H) => String(H))), ie(Array.isArray(B.thirdPartyId) ? B.thirdPartyId : []), le(!!B.humanLoop), Ae(!!B.isAutoExpire);
|
|
7953
7962
|
}
|
|
7954
|
-
}, [V,
|
|
7963
|
+
}, [V, S, K]);
|
|
7955
7964
|
const Ke = async () => {
|
|
7956
7965
|
try {
|
|
7957
|
-
|
|
7966
|
+
q(!0);
|
|
7958
7967
|
const F = await i.getRules(), re = Array.isArray(F) ? F : Array.isArray(F?.data) ? F.data : [];
|
|
7959
7968
|
we(re);
|
|
7960
|
-
const Q = re.map((B,
|
|
7961
|
-
const
|
|
7969
|
+
const Q = re.map((B, ce) => {
|
|
7970
|
+
const H = e.find((xe) => xe.RuleId === (B.ruleId || B.ruleName))?.Name || B.ruleName || B.Name || "-", ae = Fs(B.escalationSettings ?? B.EscalationSettings), vs = typeof ae.level1UserRoleId == "number" && ae.level1UserRoleId > 0 ? [ae.level1UserRoleId] : [], As = typeof ae.level2UserRoleId == "number" && ae.level2UserRoleId > 0 ? [ae.level2UserRoleId] : [], un = typeof ae.level3UserRoleId == "number" && ae.level3UserRoleId > 0 ? [ae.level3UserRoleId] : [], mn = (Array.isArray(ae.escalationSettingsActionTypeIds) ? ae.escalationSettingsActionTypeIds : []).map((xe) => Ie[xe] || String(xe)), Ts = (Array.isArray(ae.thirdPartyId) ? ae.thirdPartyId : []).map((xe) => st[xe] || String(xe)), Ns = typeof ae.humanLoop == "boolean" ? ae.humanLoop : null;
|
|
7962
7971
|
return {
|
|
7963
|
-
id: String(B.ruleId || B.ruleName ||
|
|
7964
|
-
ruleOrSeverityLabel:
|
|
7972
|
+
id: String(B.ruleId || B.ruleName || ce),
|
|
7973
|
+
ruleOrSeverityLabel: H,
|
|
7965
7974
|
l1: { minutes: ae.level1PostAssistTime ?? void 0, roles: vs },
|
|
7966
7975
|
l2: { minutes: ae.level2PostAssistTime ?? void 0, roles: As },
|
|
7967
7976
|
l3: { minutes: ae.level3PostAssistTime ?? void 0, roles: un },
|
|
@@ -7974,7 +7983,7 @@ function Pl({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
7974
7983
|
} catch (F) {
|
|
7975
7984
|
console.error("Failed to refetch entries", F);
|
|
7976
7985
|
} finally {
|
|
7977
|
-
|
|
7986
|
+
q(!1);
|
|
7978
7987
|
}
|
|
7979
7988
|
};
|
|
7980
7989
|
return ve(() => {
|
|
@@ -7985,12 +7994,14 @@ function Pl({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
7985
7994
|
if (F || !re) return;
|
|
7986
7995
|
const Q = {};
|
|
7987
7996
|
if (Array.isArray(re.thirdParties))
|
|
7988
|
-
for (const
|
|
7989
|
-
|
|
7997
|
+
for (const ce of re.thirdParties) {
|
|
7998
|
+
const H = ce.thirdPartyIds ?? ce.thirdPartyId;
|
|
7999
|
+
typeof H == "number" && (Q[H] = ce.thirdPartyName);
|
|
8000
|
+
}
|
|
7990
8001
|
ht(Q);
|
|
7991
|
-
const B = Array.isArray(re.userRoles) ? re.userRoles.map((
|
|
7992
|
-
userRoleId:
|
|
7993
|
-
userRoleName:
|
|
8002
|
+
const B = Array.isArray(re.userRoles) ? re.userRoles.map((ce) => ({
|
|
8003
|
+
userRoleId: ce.userRoleId ?? ce.id,
|
|
8004
|
+
userRoleName: ce.userRoleName ?? ce.name
|
|
7994
8005
|
})) : [];
|
|
7995
8006
|
F || yt(B.length ? B : s || []);
|
|
7996
8007
|
} catch (re) {
|
|
@@ -8015,7 +8026,7 @@ function Pl({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8015
8026
|
onChange: (F) => {
|
|
8016
8027
|
F.sortBy && (u(F.sortBy), O(!0)), F.groupBy && (d(F.groupBy), O(!0));
|
|
8017
8028
|
},
|
|
8018
|
-
showActions:
|
|
8029
|
+
showActions: v,
|
|
8019
8030
|
onSave: async () => {
|
|
8020
8031
|
J(!0);
|
|
8021
8032
|
try {
|
|
@@ -8043,23 +8054,23 @@ function Pl({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8043
8054
|
{
|
|
8044
8055
|
escBasis: V,
|
|
8045
8056
|
setEscBasis: U,
|
|
8046
|
-
selectedSeverity:
|
|
8057
|
+
selectedSeverity: G,
|
|
8047
8058
|
setSelectedSeverity: y,
|
|
8048
|
-
selectedRule:
|
|
8059
|
+
selectedRule: S,
|
|
8049
8060
|
setSelectedRule: E,
|
|
8050
8061
|
severityOptions: Ce,
|
|
8051
8062
|
ruleOptions: oe,
|
|
8052
8063
|
minsOptions: nt,
|
|
8053
8064
|
roleOptions: _e,
|
|
8054
8065
|
l1mins: de,
|
|
8055
|
-
setL1mins:
|
|
8066
|
+
setL1mins: ue,
|
|
8056
8067
|
l1role: D,
|
|
8057
|
-
setL1role:
|
|
8068
|
+
setL1role: w,
|
|
8058
8069
|
l2mins: p,
|
|
8059
8070
|
setL2mins: I,
|
|
8060
|
-
l2role:
|
|
8071
|
+
l2role: A,
|
|
8061
8072
|
setL2role: L,
|
|
8062
|
-
l3mins:
|
|
8073
|
+
l3mins: T,
|
|
8063
8074
|
setL3mins: M,
|
|
8064
8075
|
l3role: W,
|
|
8065
8076
|
setL3role: Z,
|
|
@@ -8068,17 +8079,17 @@ function Pl({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8068
8079
|
thirdPartyIds: X,
|
|
8069
8080
|
setThirdPartyIds: ie,
|
|
8070
8081
|
humanLoop: Ne,
|
|
8071
|
-
setHumanLoop:
|
|
8082
|
+
setHumanLoop: le,
|
|
8072
8083
|
onClear: () => {
|
|
8073
|
-
u("By Severity"), d("By severity"), U("rules"), y(void 0), E(void 0),
|
|
8084
|
+
u("By Severity"), d("By severity"), U("rules"), y(void 0), E(void 0), ue(void 0), w(void 0), I(void 0), L(void 0), M(void 0), Z(void 0), Y([]), ie([]), le(!1), Ae(!1);
|
|
8074
8085
|
},
|
|
8075
8086
|
onSave: async () => {
|
|
8076
8087
|
ws(!0), a?.({
|
|
8077
|
-
ruleId:
|
|
8088
|
+
ruleId: S,
|
|
8078
8089
|
levels: [
|
|
8079
8090
|
{ minutes: de, role: D },
|
|
8080
|
-
{ minutes: p, role:
|
|
8081
|
-
{ minutes:
|
|
8091
|
+
{ minutes: p, role: A },
|
|
8092
|
+
{ minutes: T, role: W }
|
|
8082
8093
|
],
|
|
8083
8094
|
actions: z,
|
|
8084
8095
|
thirdPartyIds: X,
|
|
@@ -8086,30 +8097,30 @@ function Pl({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8086
8097
|
isAutoExpire: me
|
|
8087
8098
|
});
|
|
8088
8099
|
try {
|
|
8089
|
-
if (
|
|
8100
|
+
if (S) {
|
|
8090
8101
|
const re = Array.isArray(z) ? z.map((ae) => Number.isNaN(Number(ae)) ? ae : Number(ae)) : [], Q = (K || []).find(
|
|
8091
|
-
(ae) => ae?.ruleId ===
|
|
8102
|
+
(ae) => ae?.ruleId === S || ae?.ruleName === S || ae?.RuleId === S
|
|
8092
8103
|
), B = typeof Q?.recordId == "number" ? Q.recordId : Q?.ruleId || Q?.RuleId || void 0;
|
|
8093
8104
|
if (!Q || !B) {
|
|
8094
8105
|
Te.error("Unable to find rule identifier for update");
|
|
8095
8106
|
return;
|
|
8096
8107
|
}
|
|
8097
|
-
const
|
|
8108
|
+
const ce = {
|
|
8098
8109
|
...Q,
|
|
8099
8110
|
escalationSettings: {
|
|
8100
8111
|
level1UserRoleId: D ?? 0,
|
|
8101
8112
|
level1PostAssistTime: de ?? 0,
|
|
8102
|
-
level2UserRoleId:
|
|
8113
|
+
level2UserRoleId: A ?? 0,
|
|
8103
8114
|
level2PostAssistTime: p ?? 0,
|
|
8104
8115
|
level3UserRoleId: W ?? 0,
|
|
8105
|
-
level3PostAssistTime:
|
|
8116
|
+
level3PostAssistTime: T ?? 0,
|
|
8106
8117
|
escalationSettingsActionTypeIds: re,
|
|
8107
8118
|
thirdPartyId: Array.isArray(X) ? X : [],
|
|
8108
8119
|
humanLoop: Ne,
|
|
8109
8120
|
isAutoExpire: me
|
|
8110
8121
|
}
|
|
8111
|
-
},
|
|
8112
|
-
|
|
8122
|
+
}, H = await i.updateRule(B, ce);
|
|
8123
|
+
H?.responseStatus || H?.Success || H?.success ? (Te.success("Escalation settings saved"), await Ke(), E(void 0), ue(void 0), w(void 0), I(void 0), L(void 0), M(void 0), Z(void 0), Y([]), ie([]), le(!1), Ae(!1)) : Te.error(H?.errorMessage || H?.Message || "Error saving Escalation Settings");
|
|
8113
8124
|
}
|
|
8114
8125
|
} catch (re) {
|
|
8115
8126
|
console.error("Error saving escalation settings", re);
|
|
@@ -8153,23 +8164,23 @@ function bc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8153
8164
|
const { rules: r, alerts: a } = He(), i = [
|
|
8154
8165
|
{ label: "By Severity", value: "By Severity" },
|
|
8155
8166
|
{ label: "By Created Date", value: "By Created Date" }
|
|
8156
|
-
], [o, l] =
|
|
8167
|
+
], [o, l] = b("By Severity"), [u, m] = b(/* @__PURE__ */ new Set()), [d, g] = b(null), [f, v] = b(null), [O, C] = b({ inApp: !1, sms: !1, email: !1 }), [J, _] = b([]), [te, k] = b(!0), [R, V] = b(!1);
|
|
8157
8168
|
ve(() => {
|
|
8158
8169
|
let y = !1;
|
|
8159
8170
|
return (async () => {
|
|
8160
8171
|
try {
|
|
8161
|
-
const
|
|
8162
|
-
if (y || !
|
|
8172
|
+
const S = await a.getPreferenceSettings();
|
|
8173
|
+
if (y || !S) return;
|
|
8163
8174
|
C({
|
|
8164
|
-
inApp: !!
|
|
8175
|
+
inApp: !!S.inApp,
|
|
8165
8176
|
//convert to bool - as the resp is str
|
|
8166
|
-
sms: !!
|
|
8167
|
-
email: !!
|
|
8177
|
+
sms: !!S.sms,
|
|
8178
|
+
email: !!S.email
|
|
8168
8179
|
});
|
|
8169
|
-
const E = or(
|
|
8170
|
-
l(E === "By Created Date" ? "By Created Date" : "By Severity"), g(Tn(
|
|
8171
|
-
} catch (
|
|
8172
|
-
console.error("Error in loading my preferences: ",
|
|
8180
|
+
const E = or(S.sortBy);
|
|
8181
|
+
l(E === "By Created Date" ? "By Created Date" : "By Severity"), g(Tn(S.doNotDisturbStart)), v(Tn(S.doNotDisturbEnd)), Array.isArray(S.anomalyIds) && m(new Set(S.anomalyIds.map((de) => String(de))));
|
|
8182
|
+
} catch (S) {
|
|
8183
|
+
console.error("Error in loading my preferences: ", S);
|
|
8173
8184
|
}
|
|
8174
8185
|
})(), () => {
|
|
8175
8186
|
y = !0;
|
|
@@ -8179,12 +8190,12 @@ function bc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8179
8190
|
return (async () => {
|
|
8180
8191
|
try {
|
|
8181
8192
|
k(!0);
|
|
8182
|
-
const
|
|
8183
|
-
if (y || !
|
|
8184
|
-
const E = Array.isArray(
|
|
8193
|
+
const S = await r.getLookups();
|
|
8194
|
+
if (y || !S) return;
|
|
8195
|
+
const E = Array.isArray(S.anomalies) ? S.anomalies : [];
|
|
8185
8196
|
_(E);
|
|
8186
|
-
} catch (
|
|
8187
|
-
console.error("Failed to load anomalies lookups",
|
|
8197
|
+
} catch (S) {
|
|
8198
|
+
console.error("Failed to load anomalies lookups", S);
|
|
8188
8199
|
} finally {
|
|
8189
8200
|
y || k(!1);
|
|
8190
8201
|
}
|
|
@@ -8193,11 +8204,11 @@ function bc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8193
8204
|
};
|
|
8194
8205
|
}, []);
|
|
8195
8206
|
const U = (y) => {
|
|
8196
|
-
m((
|
|
8197
|
-
const E = new Set(
|
|
8207
|
+
m((S) => {
|
|
8208
|
+
const E = new Set(S);
|
|
8198
8209
|
return E.has(y) ? E.delete(y) : E.add(y), E;
|
|
8199
8210
|
});
|
|
8200
|
-
},
|
|
8211
|
+
}, G = async () => {
|
|
8201
8212
|
s?.({
|
|
8202
8213
|
sortBy: o,
|
|
8203
8214
|
subscribedRuleIds: Array.from(u),
|
|
@@ -8209,10 +8220,10 @@ function bc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8209
8220
|
});
|
|
8210
8221
|
try {
|
|
8211
8222
|
V(!0);
|
|
8212
|
-
const y = d ? d.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00",
|
|
8223
|
+
const y = d ? d.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", S = f ? f.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", E = Array.from(u).map((ue) => Number(ue)).filter((ue) => Number.isFinite(ue)), de = await a.setPreferenceSettings({
|
|
8213
8224
|
anomalyIds: E,
|
|
8214
8225
|
doNotDisturbStart: y,
|
|
8215
|
-
doNotDisturbEnd:
|
|
8226
|
+
doNotDisturbEnd: S,
|
|
8216
8227
|
inApp: !!O.inApp,
|
|
8217
8228
|
sms: !!O.sms,
|
|
8218
8229
|
email: !!O.email,
|
|
@@ -8233,8 +8244,8 @@ function bc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8233
8244
|
/* @__PURE__ */ h("div", { className: "mb-4", children: [
|
|
8234
8245
|
/* @__PURE__ */ c(sr, { level: 5, className: "!mb-2", children: "Anomalies" }),
|
|
8235
8246
|
te ? /* @__PURE__ */ c("div", { className: "py-4", children: /* @__PURE__ */ c(us, {}) }) : /* @__PURE__ */ c(Je, { direction: "vertical", size: 10, className: "w-full", children: (Array.isArray(J) ? J : []).map((y) => {
|
|
8236
|
-
const
|
|
8237
|
-
return /* @__PURE__ */ c(wt, { checked: u.has(
|
|
8247
|
+
const S = String(y.recordId), E = y.anomalyName;
|
|
8248
|
+
return /* @__PURE__ */ c(wt, { checked: u.has(S), onChange: () => U(S), children: E }, S);
|
|
8238
8249
|
}) })
|
|
8239
8250
|
] }),
|
|
8240
8251
|
/* @__PURE__ */ h("div", { className: "mb-4", children: [
|
|
@@ -8248,7 +8259,7 @@ function bc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8248
8259
|
] }),
|
|
8249
8260
|
/* @__PURE__ */ h(Je, { direction: "horizontal", size: 8, className: "items-center", children: [
|
|
8250
8261
|
/* @__PURE__ */ c(es, { children: "To" }),
|
|
8251
|
-
/* @__PURE__ */ c(yn, { value: f, onChange: (y) =>
|
|
8262
|
+
/* @__PURE__ */ c(yn, { value: f, onChange: (y) => v(y), format: "HH:mm" })
|
|
8252
8263
|
] })
|
|
8253
8264
|
] })
|
|
8254
8265
|
] }) }) }),
|
|
@@ -8261,7 +8272,7 @@ function bc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8261
8272
|
/* @__PURE__ */ c(Dt, {}),
|
|
8262
8273
|
/* @__PURE__ */ h(Je, { className: "gap-3", children: [
|
|
8263
8274
|
/* @__PURE__ */ c(De, { onClick: n, disabled: R, children: "Cancel" }),
|
|
8264
|
-
/* @__PURE__ */ c(De, { type: "primary", onClick:
|
|
8275
|
+
/* @__PURE__ */ c(De, { type: "primary", onClick: G, loading: R, children: "Save" })
|
|
8265
8276
|
] })
|
|
8266
8277
|
] });
|
|
8267
8278
|
}
|
|
@@ -8527,7 +8538,7 @@ const tc = [
|
|
|
8527
8538
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
8528
8539
|
["path", { d: "M4 14h6v6", key: "rmj7iw" }]
|
|
8529
8540
|
], sc = Ss("minimize-2", tc), nc = ({ isOpen: t, onClose: e, src: s, type: n = "image" }) => {
|
|
8530
|
-
const [r, a] =
|
|
8541
|
+
const [r, a] = b(!1), [i, o] = b(!1);
|
|
8531
8542
|
return ve(() => {
|
|
8532
8543
|
t && o(!1);
|
|
8533
8544
|
}, [t, s]), ve(() => {
|
|
@@ -8626,7 +8637,7 @@ const oc = {
|
|
|
8626
8637
|
Medium: "#FEF9C2",
|
|
8627
8638
|
Low: "#E0EDFF"
|
|
8628
8639
|
}, cc = ({ isModalOpen: t, handleModalClose: e, selectedRow: s, fetchAlertLogs: n, alertStatusList: r = [], alertStatusLoading: a = !1, initialTab: i = "details", sourceTab: o }) => {
|
|
8629
|
-
const [l, u] =
|
|
8640
|
+
const [l, u] = b(), [m, d] = b(""), [g, f] = b(!1), v = wa(null), [O, C] = b("details"), [J, _] = b(void 0), te = dr(), { alerts: k } = He(), { timeZoneDetails: R } = ps(), [V, U] = b(!1), [G, y] = b(void 0), [S, E] = b(void 0), [de, ue] = b({}), [D, w] = b({}), p = (x, q, K) => {
|
|
8630
8641
|
const we = D[x];
|
|
8631
8642
|
return de[x] === !1 && !we ? /* @__PURE__ */ h("div", { className: "w-full flex flex-col items-center justify-center min-h-[200px] bg-gray-100 rounded-lg gap-2 text-gray-400", children: [
|
|
8632
8643
|
/* @__PURE__ */ c(Kl, { size: 40 }),
|
|
@@ -8637,18 +8648,18 @@ const oc = {
|
|
|
8637
8648
|
"img",
|
|
8638
8649
|
{
|
|
8639
8650
|
src: x,
|
|
8640
|
-
alt:
|
|
8651
|
+
alt: q.caption || `media-${K}`,
|
|
8641
8652
|
className: `max-w-full max-h-[90vh] object-contain rounded-lg shadow-lg transition-opacity duration-200 ${we ? "opacity-0" : "opacity-100"}`,
|
|
8642
|
-
onLoad: () =>
|
|
8643
|
-
onError: () =>
|
|
8653
|
+
onLoad: () => w((Ce) => ({ ...Ce, [x]: !1 })),
|
|
8654
|
+
onError: () => w((Ce) => ({ ...Ce, [x]: !1 }))
|
|
8644
8655
|
},
|
|
8645
8656
|
x
|
|
8646
8657
|
)
|
|
8647
8658
|
] });
|
|
8648
8659
|
}, I = s?.originalData || {}, {
|
|
8649
|
-
eventName:
|
|
8660
|
+
eventName: A,
|
|
8650
8661
|
alertId: L,
|
|
8651
|
-
timestamp:
|
|
8662
|
+
timestamp: T,
|
|
8652
8663
|
description: M,
|
|
8653
8664
|
spaceName: W,
|
|
8654
8665
|
assignTeam: Z,
|
|
@@ -8657,19 +8668,19 @@ const oc = {
|
|
|
8657
8668
|
id: X,
|
|
8658
8669
|
alertDetails: ie,
|
|
8659
8670
|
statusHistory: Ne,
|
|
8660
|
-
mediaDetails:
|
|
8671
|
+
mediaDetails: le,
|
|
8661
8672
|
alertNumber: me
|
|
8662
8673
|
} = I, Ae = (x) => {
|
|
8663
|
-
const
|
|
8664
|
-
return
|
|
8674
|
+
const q = String(x || "").toLowerCase();
|
|
8675
|
+
return q === "delivered" || q === "sent" ? "Delivered" : q === "failed" ? "Failed" : "Queued";
|
|
8665
8676
|
}, Ie = (x) => ({
|
|
8666
8677
|
name: x?.receipientName || x?.recipientName || "-",
|
|
8667
8678
|
role: x?.receipientRoleName || "",
|
|
8668
8679
|
phone: x?.receipentPhoneNumber || x?.recipientPhoneNumber || x?.receipientEmail || x?.recipientEmail || "",
|
|
8669
8680
|
status: Ae(x?.messageStatus),
|
|
8670
8681
|
notificationReceipientType: x?.notificationReceipientType || ""
|
|
8671
|
-
}), Fe = (x,
|
|
8672
|
-
const K =
|
|
8682
|
+
}), Fe = (x, q) => {
|
|
8683
|
+
const K = q.map(Ie), we = K.filter((nt) => nt.status === "Delivered").length, Ce = q.map((nt) => nt?.sentAt).filter(Boolean).sort((nt, Ke) => new Date(Ke).getTime() - new Date(nt).getTime())[0], oe = q[0] || {}, _e = [oe?.severityName, oe?.anomalyName].filter(Boolean).join(" - ") || `${x} Notification`;
|
|
8673
8684
|
return {
|
|
8674
8685
|
channelLabel: `${x} Notification`,
|
|
8675
8686
|
sentAt: Ce || "",
|
|
@@ -8680,14 +8691,14 @@ const oc = {
|
|
|
8680
8691
|
recipients: K
|
|
8681
8692
|
};
|
|
8682
8693
|
}, st = (x) => {
|
|
8683
|
-
const
|
|
8694
|
+
const q = /* @__PURE__ */ new Map();
|
|
8684
8695
|
return (x || []).forEach((K) => {
|
|
8685
|
-
const we = String(K?.notificationType || "Unknown"), Ce =
|
|
8686
|
-
Ce.push(K),
|
|
8687
|
-
}), Array.from(
|
|
8696
|
+
const we = String(K?.notificationType || "Unknown"), Ce = q.get(we) || [];
|
|
8697
|
+
Ce.push(K), q.set(we, Ce);
|
|
8698
|
+
}), Array.from(q.entries()).map(([K, we]) => Fe(K, we));
|
|
8688
8699
|
}, ht = async (x) => {
|
|
8689
8700
|
try {
|
|
8690
|
-
const
|
|
8701
|
+
const q = await k.getAlertNotifications(x), K = st(q);
|
|
8691
8702
|
_(K);
|
|
8692
8703
|
} catch {
|
|
8693
8704
|
_(void 0);
|
|
@@ -8705,40 +8716,40 @@ const oc = {
|
|
|
8705
8716
|
t && C(i);
|
|
8706
8717
|
}, [t, i]);
|
|
8707
8718
|
const yt = o === "archived" || ["completed", "false positive"].includes(String(Y || "").toLowerCase()), Mt = (x) => {
|
|
8708
|
-
const
|
|
8709
|
-
return
|
|
8719
|
+
const q = String(x?.value || "").toLowerCase(), K = String(x?.statusName || "").toLowerCase();
|
|
8720
|
+
return q.includes("reopen") || K.includes("reopen");
|
|
8710
8721
|
}, zt = (r || []).filter((x) => {
|
|
8711
|
-
const
|
|
8712
|
-
return typeof o < "u" ? o === "archived" ?
|
|
8713
|
-
}).map((x) => ({ value: x.value, label: x.statusName })), ct = Se(() => ic(
|
|
8722
|
+
const q = Mt(x);
|
|
8723
|
+
return typeof o < "u" ? o === "archived" ? q : !q : yt ? q : !q;
|
|
8724
|
+
}).map((x) => ({ value: x.value, label: x.statusName })), ct = Se(() => ic(le), [le]);
|
|
8714
8725
|
return ve(() => {
|
|
8715
8726
|
let x = !1;
|
|
8716
|
-
const
|
|
8727
|
+
const q = new AbortController(), K = async (oe) => {
|
|
8717
8728
|
if (oe) {
|
|
8718
|
-
x ||
|
|
8729
|
+
x || ue((_e) => ({ ..._e, [oe]: !1 }));
|
|
8719
8730
|
try {
|
|
8720
|
-
const _e = await fetch(oe, { method: "HEAD", signal:
|
|
8731
|
+
const _e = await fetch(oe, { method: "HEAD", signal: q.signal });
|
|
8721
8732
|
if (_e.ok) {
|
|
8722
|
-
x ||
|
|
8733
|
+
x || ue((Ke) => ({ ...Ke, [oe]: !0 }));
|
|
8723
8734
|
return;
|
|
8724
8735
|
}
|
|
8725
8736
|
if (_e.status === 404) {
|
|
8726
|
-
x ||
|
|
8737
|
+
x || ue((Ke) => ({ ...Ke, [oe]: !1 }));
|
|
8727
8738
|
return;
|
|
8728
8739
|
}
|
|
8729
|
-
if (!(await fetch(oe, { method: "GET", signal:
|
|
8730
|
-
x ||
|
|
8740
|
+
if (!(await fetch(oe, { method: "GET", signal: q.signal })).ok) throw new Error("Media not available");
|
|
8741
|
+
x || ue((Ke) => ({ ...Ke, [oe]: !0 }));
|
|
8731
8742
|
} catch {
|
|
8732
|
-
x ||
|
|
8743
|
+
x || ue((_e) => ({ ..._e, [oe]: !1 }));
|
|
8733
8744
|
}
|
|
8734
8745
|
}
|
|
8735
8746
|
};
|
|
8736
|
-
|
|
8747
|
+
ue({});
|
|
8737
8748
|
const we = ct.filter((oe) => !rr(oe)).map((oe) => oe?.mediaUrl || oe).filter((oe) => typeof oe == "string" && oe.length > 0), Ce = {};
|
|
8738
8749
|
return we.forEach((oe) => {
|
|
8739
8750
|
Ce[oe] = !0;
|
|
8740
|
-
}),
|
|
8741
|
-
x = !0,
|
|
8751
|
+
}), w(Ce), we.forEach((oe) => K(oe)), () => {
|
|
8752
|
+
x = !0, q.abort();
|
|
8742
8753
|
};
|
|
8743
8754
|
}, [ct]), /* @__PURE__ */ c(
|
|
8744
8755
|
ba,
|
|
@@ -8761,9 +8772,9 @@ const oc = {
|
|
|
8761
8772
|
status: l ? String(l) : void 0,
|
|
8762
8773
|
notes: m.trim(),
|
|
8763
8774
|
modifiedBy: 0
|
|
8764
|
-
},
|
|
8765
|
-
if (
|
|
8766
|
-
const K =
|
|
8775
|
+
}, q = await te.mutateAsync(x);
|
|
8776
|
+
if (q?.responseStatus || q?.Success) {
|
|
8777
|
+
const K = q?.Message || q?.data || "Alert updated successfully.";
|
|
8767
8778
|
Te.success(K, {
|
|
8768
8779
|
autoClose: 1500,
|
|
8769
8780
|
onClose: () => {
|
|
@@ -8771,7 +8782,7 @@ const oc = {
|
|
|
8771
8782
|
}
|
|
8772
8783
|
}), u(void 0), d("");
|
|
8773
8784
|
} else {
|
|
8774
|
-
const K =
|
|
8785
|
+
const K = q?.errorMessage || q?.Message || "Failed to update alert status";
|
|
8775
8786
|
Te.error(K);
|
|
8776
8787
|
}
|
|
8777
8788
|
} catch (x) {
|
|
@@ -8796,7 +8807,7 @@ const oc = {
|
|
|
8796
8807
|
label: "Alert Detail",
|
|
8797
8808
|
children: /* @__PURE__ */ h("div", { className: "grid grid-cols-2 gap-2", style: { maxHeight: "50vh", overflowY: "auto" }, children: [
|
|
8798
8809
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-2", children: [
|
|
8799
|
-
/* @__PURE__ */ c("div", { className: "text-sm font-bold", children:
|
|
8810
|
+
/* @__PURE__ */ c("div", { className: "text-sm font-bold", children: A || "Alert Event" }),
|
|
8800
8811
|
ie?.firstName ? /* @__PURE__ */ h("div", { className: "text-sm text-gray-500", children: [
|
|
8801
8812
|
"Resident ID/Name: ",
|
|
8802
8813
|
ie?.firstName,
|
|
@@ -8807,7 +8818,7 @@ const oc = {
|
|
|
8807
8818
|
] }) : null,
|
|
8808
8819
|
/* @__PURE__ */ h("div", { className: "text-sm text-gray-500", children: [
|
|
8809
8820
|
"Timestamp: ",
|
|
8810
|
-
cs(
|
|
8821
|
+
cs(T, R?.ianaTimeZoneId)
|
|
8811
8822
|
] }),
|
|
8812
8823
|
/* @__PURE__ */ h("div", { className: "font-sm text-gray-500", children: [
|
|
8813
8824
|
/* @__PURE__ */ c("b", { className: "text-black text-sm/6", children: "Description:" }),
|
|
@@ -8884,7 +8895,7 @@ const oc = {
|
|
|
8884
8895
|
"button",
|
|
8885
8896
|
{
|
|
8886
8897
|
type: "button",
|
|
8887
|
-
onClick: () =>
|
|
8898
|
+
onClick: () => v.current?.prev?.(),
|
|
8888
8899
|
className: "w-6 h-6 flex items-center justify-center rounded-full bg-gray-200 hover:bg-gray-300 text-gray-600",
|
|
8889
8900
|
"aria-label": "Previous media",
|
|
8890
8901
|
children: /* @__PURE__ */ c(Da, { style: { fontSize: 12 } })
|
|
@@ -8894,7 +8905,7 @@ const oc = {
|
|
|
8894
8905
|
"button",
|
|
8895
8906
|
{
|
|
8896
8907
|
type: "button",
|
|
8897
|
-
onClick: () =>
|
|
8908
|
+
onClick: () => v.current?.next?.(),
|
|
8898
8909
|
className: "w-6 h-6 flex items-center justify-center rounded-full bg-gray-200 hover:bg-gray-300 text-gray-600",
|
|
8899
8910
|
"aria-label": "Next media",
|
|
8900
8911
|
children: /* @__PURE__ */ c(Ca, { style: { fontSize: 12 } })
|
|
@@ -8902,7 +8913,7 @@ const oc = {
|
|
|
8902
8913
|
)
|
|
8903
8914
|
] }) : null
|
|
8904
8915
|
] }),
|
|
8905
|
-
ct.length ? /* @__PURE__ */ c("div", { className: "w-full", children: /* @__PURE__ */ c(ka, { ref:
|
|
8916
|
+
ct.length ? /* @__PURE__ */ c("div", { className: "w-full", children: /* @__PURE__ */ c(ka, { ref: v, dots: !0, className: "w-full", children: ct.map((x, q) => {
|
|
8906
8917
|
const K = x.mediaUrl || x, we = rr(x);
|
|
8907
8918
|
return /* @__PURE__ */ h("div", { className: "flex justify-center items-center relative", children: [
|
|
8908
8919
|
we ? /* @__PURE__ */ h(
|
|
@@ -8917,7 +8928,7 @@ const oc = {
|
|
|
8917
8928
|
"Your browser does not support the video tag."
|
|
8918
8929
|
]
|
|
8919
8930
|
}
|
|
8920
|
-
) : p(String(K), x,
|
|
8931
|
+
) : p(String(K), x, q),
|
|
8921
8932
|
x.caption && /* @__PURE__ */ c("p", { className: "text-xs text-gray-500 mt-1", children: x.caption }),
|
|
8922
8933
|
!we && de[String(K)] ? /* @__PURE__ */ c(
|
|
8923
8934
|
"button",
|
|
@@ -8929,7 +8940,7 @@ const oc = {
|
|
|
8929
8940
|
children: /* @__PURE__ */ c(ha, { size: 20 })
|
|
8930
8941
|
}
|
|
8931
8942
|
) : null
|
|
8932
|
-
] }, String(K) ||
|
|
8943
|
+
] }, String(K) || q);
|
|
8933
8944
|
}) }) }) : null
|
|
8934
8945
|
] }) }),
|
|
8935
8946
|
/* @__PURE__ */ c(
|
|
@@ -8937,8 +8948,8 @@ const oc = {
|
|
|
8937
8948
|
{
|
|
8938
8949
|
isOpen: V,
|
|
8939
8950
|
onClose: () => U(!1),
|
|
8940
|
-
src:
|
|
8941
|
-
type:
|
|
8951
|
+
src: G || "",
|
|
8952
|
+
type: S || "image"
|
|
8942
8953
|
}
|
|
8943
8954
|
)
|
|
8944
8955
|
] })
|
|
@@ -8979,14 +8990,14 @@ function uc() {
|
|
|
8979
8990
|
};
|
|
8980
8991
|
}
|
|
8981
8992
|
function ya({ alerts: t, loading: e = !1, columns: s, onRefetch: n, onPageChange: r }) {
|
|
8982
|
-
const [a, i] =
|
|
8993
|
+
const [a, i] = b(!1), [o, l] = b(null), [u, m] = b("details"), { list: d, loading: g } = uc(), { timeZoneDetails: f } = ps(), v = f?.timeZoneName ?? "UTC", O = f?.ianaTimeZoneId ?? "UTC";
|
|
8983
8994
|
function C(R, V) {
|
|
8984
8995
|
l(R), m(V?.tab ?? "details"), te(V?.sourceTab ?? "active"), i(!0);
|
|
8985
8996
|
}
|
|
8986
8997
|
function J() {
|
|
8987
8998
|
i(!1);
|
|
8988
8999
|
}
|
|
8989
|
-
const [_, te] =
|
|
9000
|
+
const [_, te] = b("active"), k = o ? {
|
|
8990
9001
|
originalData: {
|
|
8991
9002
|
// include the full selected alert so alll modal fieldsare present
|
|
8992
9003
|
...o,
|
|
@@ -8998,7 +9009,7 @@ function ya({ alerts: t, loading: e = !1, columns: s, onRefetch: n, onPageChange
|
|
|
8998
9009
|
return /* @__PURE__ */ h("div", { className: "p-6 flex flex-col items-start justify-start min-h-screen w-full overflow-auto", children: [
|
|
8999
9010
|
/* @__PURE__ */ h("div", { className: "w-full grid grid-cols-3 sm:grid-cols-1 items-center mb-4", children: [
|
|
9000
9011
|
/* @__PURE__ */ c("h1", { className: "text-xl font-bold text-black", children: "Alert Console" }),
|
|
9001
|
-
/* @__PURE__ */ c("div", { className: "flex items-center justify-start sm:justify-center", children: /* @__PURE__ */ c(Dl, { label:
|
|
9012
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-start sm:justify-center", children: /* @__PURE__ */ c(Dl, { label: v, timeZone: O }) })
|
|
9002
9013
|
] }),
|
|
9003
9014
|
/* @__PURE__ */ c(
|
|
9004
9015
|
Ks,
|
|
@@ -9050,7 +9061,7 @@ function ya({ alerts: t, loading: e = !1, columns: s, onRefetch: n, onPageChange
|
|
|
9050
9061
|
] });
|
|
9051
9062
|
}
|
|
9052
9063
|
function dc() {
|
|
9053
|
-
const [t, e] =
|
|
9064
|
+
const [t, e] = b([]), [s, n] = b([]), [r, a] = b([]), [i, o] = b([]), [l, u] = b(!0), { rules: m } = He();
|
|
9054
9065
|
return ve(() => {
|
|
9055
9066
|
let d = !0;
|
|
9056
9067
|
return (async () => {
|
|
@@ -9058,19 +9069,19 @@ function dc() {
|
|
|
9058
9069
|
const g = await m.getRules();
|
|
9059
9070
|
if (!d) return;
|
|
9060
9071
|
o(Array.isArray(g) ? g : []);
|
|
9061
|
-
const f = (g || []).map((
|
|
9062
|
-
RuleId:
|
|
9063
|
-
Name:
|
|
9064
|
-
Description:
|
|
9072
|
+
const f = (g || []).map((v, O) => ({
|
|
9073
|
+
RuleId: v.ruleId || v.ruleName || String(O),
|
|
9074
|
+
Name: v.ruleName || v.Name || "-",
|
|
9075
|
+
Description: v.ruleDesc || v.Description || "",
|
|
9065
9076
|
SeverityId: 0
|
|
9066
9077
|
}));
|
|
9067
9078
|
e(f);
|
|
9068
9079
|
try {
|
|
9069
|
-
const
|
|
9080
|
+
const v = await m.getLookups(), O = Array.isArray(v?.userRoles) ? v.userRoles.map((C) => ({
|
|
9070
9081
|
userRoleId: C.userRoleId ?? C.id,
|
|
9071
9082
|
userRoleName: C.userRoleName ?? C.name
|
|
9072
9083
|
})) : [];
|
|
9073
|
-
n(O), a(Array.isArray(
|
|
9084
|
+
n(O), a(Array.isArray(v?.severities) ? v.severities : []);
|
|
9074
9085
|
} catch {
|
|
9075
9086
|
}
|
|
9076
9087
|
} catch {
|
|
@@ -9105,7 +9116,7 @@ function mc(t = 1) {
|
|
|
9105
9116
|
};
|
|
9106
9117
|
}
|
|
9107
9118
|
function fc(t) {
|
|
9108
|
-
const [e, s] =
|
|
9119
|
+
const [e, s] = b(1), { alerts: n, loading: r, refetch: a } = mc(e);
|
|
9109
9120
|
return /* @__PURE__ */ c(ya, { alerts: n, loading: r, columns: t.columns, onRefetch: a, onPageChange: s });
|
|
9110
9121
|
}
|
|
9111
9122
|
function kc({
|
|
@@ -9119,7 +9130,7 @@ function kc({
|
|
|
9119
9130
|
loading: o,
|
|
9120
9131
|
columns: l
|
|
9121
9132
|
}) {
|
|
9122
|
-
const [u] =
|
|
9133
|
+
const [u] = b(() => new La()), m = Se(
|
|
9123
9134
|
() => ({
|
|
9124
9135
|
alertsBaseUrl: e,
|
|
9125
9136
|
rulesBaseUrl: s || e,
|