@evolver-fi/evolver-basics-admin-components 0.0.8

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.
Files changed (69) hide show
  1. package/dist/ArrowBack-C8PcQDeL.js +161 -0
  2. package/dist/ArrowBack-C8PcQDeL.js.map +1 -0
  3. package/dist/BreadCrumbs-EFff4Rip.js +19 -0
  4. package/dist/BreadCrumbs-EFff4Rip.js.map +1 -0
  5. package/dist/BreadCrumbs.css +1 -0
  6. package/dist/ConfirmButton-jayUa8_J.js +16 -0
  7. package/dist/ConfirmButton-jayUa8_J.js.map +1 -0
  8. package/dist/ExpandMore-CCOUGfS4.js +14 -0
  9. package/dist/ExpandMore-CCOUGfS4.js.map +1 -0
  10. package/dist/JwtTokensRoute-C7ue3mI1.js +2334 -0
  11. package/dist/JwtTokensRoute-C7ue3mI1.js.map +1 -0
  12. package/dist/ScheduledTaskFormRoute-CcBBzEsv.js +1038 -0
  13. package/dist/ScheduledTaskFormRoute-CcBBzEsv.js.map +1 -0
  14. package/dist/SingleLogMessageRoute-yVcnPuBs.js +245 -0
  15. package/dist/SingleLogMessageRoute-yVcnPuBs.js.map +1 -0
  16. package/dist/SingleMessageRoute-wSsAUDru.js +254 -0
  17. package/dist/SingleMessageRoute-wSsAUDru.js.map +1 -0
  18. package/dist/TriggerablesRoute-i4z1o99f.js +3536 -0
  19. package/dist/TriggerablesRoute-i4z1o99f.js.map +1 -0
  20. package/dist/breadcrumbs/index.js +5 -0
  21. package/dist/breadcrumbs/index.js.map +1 -0
  22. package/dist/createSvgIcon-DHqCx8A0.js +5533 -0
  23. package/dist/createSvgIcon-DHqCx8A0.js.map +1 -0
  24. package/dist/jsx-runtime-B6kdoens.js +635 -0
  25. package/dist/jsx-runtime-B6kdoens.js.map +1 -0
  26. package/dist/jwt-tokens/index.js +7 -0
  27. package/dist/jwt-tokens/index.js.map +1 -0
  28. package/dist/main/index.js +34 -0
  29. package/dist/main/index.js.map +1 -0
  30. package/dist/message-log/index.js +10 -0
  31. package/dist/message-log/index.js.map +1 -0
  32. package/dist/message-sending/index.js +10 -0
  33. package/dist/message-sending/index.js.map +1 -0
  34. package/dist/scheduled-tasks/index.js +10 -0
  35. package/dist/scheduled-tasks/index.js.map +1 -0
  36. package/dist/triggerables/index.js +7 -0
  37. package/dist/triggerables/index.js.map +1 -0
  38. package/dist/types/admin-components/src/components/breadcrumbs/BreadCrumbs.d.ts +10 -0
  39. package/dist/types/admin-components/src/components/breadcrumbs/index.d.ts +1 -0
  40. package/dist/types/admin-components/src/index.d.ts +6 -0
  41. package/dist/types/admin-components/src/routes/jwt-tokens/JwtTokensRoute.d.ts +2 -0
  42. package/dist/types/admin-components/src/routes/jwt-tokens/index.d.ts +2 -0
  43. package/dist/types/admin-components/src/routes/jwt-tokens/loader.d.ts +11 -0
  44. package/dist/types/admin-components/src/routes/message-log/MessageLogRoute.d.ts +2 -0
  45. package/dist/types/admin-components/src/routes/message-log/SingleLogMessageRoute.d.ts +2 -0
  46. package/dist/types/admin-components/src/routes/message-log/index.d.ts +3 -0
  47. package/dist/types/admin-components/src/routes/message-log/loader.d.ts +7 -0
  48. package/dist/types/admin-components/src/routes/message-sending/MessageSendingRoute.d.ts +2 -0
  49. package/dist/types/admin-components/src/routes/message-sending/SingleMessageRoute.d.ts +2 -0
  50. package/dist/types/admin-components/src/routes/message-sending/index.d.ts +3 -0
  51. package/dist/types/admin-components/src/routes/message-sending/loader.d.ts +6 -0
  52. package/dist/types/admin-components/src/routes/scheduled-tasks/ScheduledTaskFormRoute.d.ts +2 -0
  53. package/dist/types/admin-components/src/routes/scheduled-tasks/ScheduledTasksRoute.d.ts +2 -0
  54. package/dist/types/admin-components/src/routes/scheduled-tasks/index.d.ts +3 -0
  55. package/dist/types/admin-components/src/routes/scheduled-tasks/loader.d.ts +9 -0
  56. package/dist/types/admin-components/src/routes/triggerables/TriggerablesRoute.d.ts +2 -0
  57. package/dist/types/admin-components/src/routes/triggerables/index.d.ts +2 -0
  58. package/dist/types/admin-components/src/routes/triggerables/loader.d.ts +9 -0
  59. package/dist/types/admin-ui/src/front-page/FrontPage.d.ts +2 -0
  60. package/dist/types/breadcrumbs.d.ts +2 -0
  61. package/dist/types/jwt-tokens.d.ts +2 -0
  62. package/dist/types/main.d.ts +2 -0
  63. package/dist/types/message-log.d.ts +2 -0
  64. package/dist/types/message-sending.d.ts +2 -0
  65. package/dist/types/scheduled-tasks.d.ts +2 -0
  66. package/dist/types/triggerables.d.ts +2 -0
  67. package/dist/validation-C1lKYJJR.js +6112 -0
  68. package/dist/validation-C1lKYJJR.js.map +1 -0
  69. package/package.json +82 -0
@@ -0,0 +1,1038 @@
1
+ import { j as d } from "./jsx-runtime-B6kdoens.js";
2
+ import { useState as X } from "react";
3
+ import { g as E, c as V, a as me, r as F, i as P, b as ve, d as ge } from "./createSvgIcon-DHqCx8A0.js";
4
+ import { TableHead as ye, TableRow as ee, TableCell as W, Tooltip as A, IconButton as N, CircularProgress as Te, Alert as te, TableContainer as xe, Table as Se, TableBody as ke, TablePagination as Oe, TextField as C, Box as L, Button as J, Typography as be, Select as z, MenuItem as R, Collapse as we } from "@mui/material";
5
+ import { D as H, c as U } from "./validation-C1lKYJJR.js";
6
+ import { useRevalidator as _e, useNavigation as je, useSearchParams as Xe, useLoaderData as ne, useParams as Ee, useNavigate as Me } from "react-router-dom";
7
+ import { C as Ce } from "./ConfirmButton-jayUa8_J.js";
8
+ const Ie = (r) => {
9
+ const c = new URLSearchParams();
10
+ return r && Object.keys(r).forEach((o) => {
11
+ const S = r[o];
12
+ S && c.append(o, S.toString());
13
+ }), c;
14
+ }, re = (r, c) => {
15
+ const o = c || E(), S = Ie(r), g = `schedule${[...S.keys()].length > 0 ? "?" : ""}${S.toString()}`;
16
+ return o.get(g);
17
+ }, De = (r, c) => (c || E()).get(`schedule/${r}`), Ae = async (r, c) => ({
18
+ status: (await E().post("schedule", r)).status
19
+ }), Ne = async (r, c) => ({
20
+ status: (await E().post(`schedule/${r}/delete`)).status
21
+ }), ie = (r) => E().post(`schedule/${r}/run`), ae = (r, c) => E().post(`schedule/${r}/state/${c}`), Le = [
22
+ "PAUSED",
23
+ "RUNNING",
24
+ "WAITING"
25
+ ], oe = ["SKIP_ALL", "RUN_ONCE", "RUN_ALL"], Re = () => ({
26
+ id: 0,
27
+ name: "",
28
+ state: "WAITING",
29
+ cronExpression: "",
30
+ timeZone: "",
31
+ triggerable: "",
32
+ priority: 0,
33
+ timeoutMs: 0,
34
+ missPolicy: "SKIP_ALL",
35
+ args: {}
36
+ }), $ = V("scheduledTasks/fetchScheduledTasks", async (r, c) => {
37
+ const o = await re(r);
38
+ return o.status !== 200 ? c.rejectWithValue({
39
+ message: "Failed to fetch scheduled tasks"
40
+ }) : {
41
+ totalElementsCount: o.data.totalElements,
42
+ scheduledTasks: o.data.content
43
+ };
44
+ }), K = V("scheduledTasks/trigger", async (r, c) => (await ie(r)).status > 399 ? c.rejectWithValue({
45
+ message: `Failed to trigger scheduled task with id ${r}`
46
+ }) : `Successfully triggered scheduled task with id ${r}`), Q = V("scheduledTasks/updateState", async ({ id: r, state: c }, o) => (await ae(r, c)).status > 399 ? o.rejectWithValue({
47
+ message: `Failed to update scheduled task ${r} to ${c}`
48
+ }) : `Successfully updated scheduled task ${r} to ${c}`), Ue = {
49
+ scheduledTasks: [],
50
+ scheduledTasksTotalCount: 0,
51
+ status: "loading",
52
+ filters: {
53
+ page: 0,
54
+ size: 100
55
+ }
56
+ };
57
+ me({
58
+ name: "scheduledTask",
59
+ initialState: Ue,
60
+ reducers: {
61
+ updateFilters(r, { payload: c }) {
62
+ r.filters = { ...r.filters, ...c };
63
+ }
64
+ },
65
+ extraReducers: (r) => {
66
+ r.addCase($.pending, (c) => {
67
+ c.status = "loading", c.error = "undefined";
68
+ }), r.addCase($.fulfilled, (c, { payload: o }) => {
69
+ c.scheduledTasks = o.scheduledTasks, c.scheduledTasksTotalCount = o.totalElementsCount, c.status = "succeeded";
70
+ }), r.addCase($.rejected, (c, { payload: o }) => {
71
+ o && (c.error = o.message), c.status = "failed", c.scheduledTaskNotification = "Failed fetching scheduled actions";
72
+ }), r.addCase(Q.fulfilled, (c, { payload: o }) => {
73
+ c.scheduledTaskNotification = o;
74
+ }), r.addCase(Q.rejected, (c, { payload: o }) => {
75
+ c.scheduledTaskNotification = o ? o.message : "Failed updating scheduled task state";
76
+ }), r.addCase(K.fulfilled, (c, { payload: o }) => {
77
+ c.scheduledTaskNotification = o;
78
+ }), r.addCase(K.rejected, (c, { payload: o }) => {
79
+ c.scheduledTaskNotification = o ? o.message : "Failed triggering scheduled task";
80
+ });
81
+ }
82
+ });
83
+ const se = [
84
+ { id: "name", label: "Name", minWidth: 250 },
85
+ { id: "state", label: "State", minWidth: 100 },
86
+ { id: "cronExpression", label: "Cron expression", minWidth: 200 },
87
+ { id: "timeZone", label: "Time zone" },
88
+ {
89
+ id: "lastFiredTime",
90
+ label: "Last fired time",
91
+ minWidth: 250,
92
+ cellRenderer: (r) => H.fromMillis(r || 0, { zone: "utc" }).toISO({ suppressMilliseconds: !0 }) || r
93
+ },
94
+ {
95
+ id: "lastFinishedTime",
96
+ label: "Last finished time",
97
+ minWidth: 250,
98
+ cellRenderer: (r) => H.fromMillis(r || 0, { zone: "utc" }).toISO({ suppressMilliseconds: !0 }) || r
99
+ },
100
+ {
101
+ id: "nextFireTime",
102
+ label: "Next fire time",
103
+ minWidth: 250,
104
+ cellRenderer: (r) => H.fromMillis(r || 0, { zone: "utc" }).toISO({ suppressMilliseconds: !0 }) || r
105
+ },
106
+ { id: "triggerable", label: "Triggerable", minWidth: 150 },
107
+ { id: "priority", label: "Priority", minWidth: 150 },
108
+ { id: "timeoutMs", label: "Timeout (ms)", minWidth: 150 },
109
+ { id: "missPolicy", label: "Miss policy", minWidth: 150 }
110
+ ], We = () => d.jsx(ye, { children: d.jsxs(ee, { children: [se.map((r) => d.jsx(W, { sx: {
111
+ backgroundColor: "primary.main",
112
+ color: "common.white",
113
+ fontSize: 18
114
+ }, style: { width: r.minWidth }, children: r.label }, r.id)), d.jsx(W, { sx: {
115
+ backgroundColor: "primary.main",
116
+ color: "common.white",
117
+ fontSize: 18
118
+ }, style: { width: 100 } }, "submit-cell")] }) });
119
+ var Z = {}, Fe = P;
120
+ Object.defineProperty(Z, "__esModule", {
121
+ value: !0
122
+ });
123
+ var ce = Z.default = void 0, Pe = Fe(F()), ze = d;
124
+ ce = Z.default = (0, Pe.default)(/* @__PURE__ */ (0, ze.jsx)("path", {
125
+ d: "M7 2v11h3v9l7-12h-4l4-8z"
126
+ }), "FlashOn");
127
+ var q = {}, He = P;
128
+ Object.defineProperty(q, "__esModule", {
129
+ value: !0
130
+ });
131
+ var ue = q.default = void 0, $e = He(F()), Be = d;
132
+ ue = q.default = (0, $e.default)(/* @__PURE__ */ (0, Be.jsx)("path", {
133
+ d: "M6 19h4V5H6zm8-14v14h4V5z"
134
+ }), "Pause");
135
+ var Y = {}, Ve = P;
136
+ Object.defineProperty(Y, "__esModule", {
137
+ value: !0
138
+ });
139
+ var le = Y.default = void 0, Ze = Ve(F()), qe = d;
140
+ le = Y.default = (0, Ze.default)(/* @__PURE__ */ (0, qe.jsx)("path", {
141
+ d: "M8 5v14l11-7z"
142
+ }), "PlayArrow");
143
+ var G = {}, Ye = P;
144
+ Object.defineProperty(G, "__esModule", {
145
+ value: !0
146
+ });
147
+ var de = G.default = void 0, Ge = Ye(F()), Je = d;
148
+ de = G.default = (0, Ge.default)(/* @__PURE__ */ (0, Je.jsx)("path", {
149
+ d: "M6 6h12v12H6z"
150
+ }), "Stop");
151
+ var he = { exports: {} };
152
+ (function(r, c) {
153
+ (function(S, y) {
154
+ r.exports = y();
155
+ })(globalThis, () => (
156
+ /******/
157
+ (() => {
158
+ var o = {
159
+ /***/
160
+ 949: (
161
+ /***/
162
+ (v, p, T) => {
163
+ Object.defineProperty(p, "__esModule", { value: !0 }), p.CronParser = void 0;
164
+ var n = T(515), k = function() {
165
+ function m(t, e, i) {
166
+ e === void 0 && (e = !0), i === void 0 && (i = !1), this.expression = t, this.dayOfWeekStartIndexZero = e, this.monthStartIndexZero = i;
167
+ }
168
+ return m.prototype.parse = function() {
169
+ var t, e, i = (t = this.expression) !== null && t !== void 0 ? t : "";
170
+ if (i.startsWith("@")) {
171
+ var a = this.parseSpecial(this.expression);
172
+ e = this.extractParts(a);
173
+ } else
174
+ e = this.extractParts(this.expression);
175
+ return this.normalize(e), this.validate(e), e;
176
+ }, m.prototype.parseSpecial = function(t) {
177
+ var e = {
178
+ "@yearly": "0 0 1 1 *",
179
+ "@annually": "0 0 1 1 *",
180
+ "@monthly": "0 0 1 * *",
181
+ "@weekly": "0 0 * * 0",
182
+ "@daily": "0 0 * * *",
183
+ "@midnight": "0 0 * * *",
184
+ "@hourly": "0 * * * *"
185
+ }, i = e[t];
186
+ if (!i)
187
+ throw new Error("Unknown special expression.");
188
+ return i;
189
+ }, m.prototype.extractParts = function(t) {
190
+ if (!this.expression)
191
+ throw new Error("cron expression is empty");
192
+ for (var e = t.trim().split(/[ ]+/), i = 0; i < e.length; i++)
193
+ if (e[i].includes(",")) {
194
+ var a = e[i].split(",").map(function(u) {
195
+ return u.trim();
196
+ }).filter(function(u) {
197
+ return u !== "";
198
+ }).map(function(u) {
199
+ return isNaN(Number(u)) ? u : Number(u);
200
+ }).filter(function(u) {
201
+ return u !== null && u !== "";
202
+ });
203
+ a.length === 0 && a.push("*"), a.sort(function(u, l) {
204
+ return u !== null && l !== null ? u - l : 0;
205
+ }), e[i] = a.map(function(u) {
206
+ return u !== null ? u.toString() : "";
207
+ }).join(",");
208
+ }
209
+ if (e.length < 5)
210
+ throw new Error("Expression has only ".concat(e.length, " part").concat(e.length == 1 ? "" : "s", ". At least 5 parts are required."));
211
+ if (e.length == 5)
212
+ e.unshift(""), e.push("");
213
+ else if (e.length == 6) {
214
+ var s = /\d{4}$/.test(e[5]) || e[4] == "?" || e[2] == "?";
215
+ s ? e.unshift("") : e.push("");
216
+ } else if (e.length > 7)
217
+ throw new Error("Expression has ".concat(e.length, " parts; too many!"));
218
+ return e;
219
+ }, m.prototype.normalize = function(t) {
220
+ var e = this;
221
+ if (t[3] = t[3].replace("?", "*"), t[5] = t[5].replace("?", "*"), t[2] = t[2].replace("?", "*"), t[0].indexOf("0/") == 0 && (t[0] = t[0].replace("0/", "*/")), t[1].indexOf("0/") == 0 && (t[1] = t[1].replace("0/", "*/")), t[2].indexOf("0/") == 0 && (t[2] = t[2].replace("0/", "*/")), t[3].indexOf("1/") == 0 && (t[3] = t[3].replace("1/", "*/")), t[4].indexOf("1/") == 0 && (t[4] = t[4].replace("1/", "*/")), t[6].indexOf("1/") == 0 && (t[6] = t[6].replace("1/", "*/")), t[5] = t[5].replace(/(^\d)|([^#/\s]\d)/g, function(x) {
222
+ var b = x.replace(/\D/, ""), h = b;
223
+ return e.dayOfWeekStartIndexZero ? b == "7" && (h = "0") : h = (parseInt(b) - 1).toString(), x.replace(b, h);
224
+ }), t[5] == "L" && (t[5] = "6"), t[3] == "?" && (t[3] = "*"), t[3].indexOf("W") > -1 && (t[3].indexOf(",") > -1 || t[3].indexOf("-") > -1))
225
+ throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");
226
+ var i = {
227
+ SUN: 0,
228
+ MON: 1,
229
+ TUE: 2,
230
+ WED: 3,
231
+ THU: 4,
232
+ FRI: 5,
233
+ SAT: 6
234
+ };
235
+ for (var a in i)
236
+ t[5] = t[5].replace(new RegExp(a, "gi"), i[a].toString());
237
+ t[4] = t[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g, function(x) {
238
+ var b = x.replace(/\D/, ""), h = b;
239
+ return e.monthStartIndexZero && (h = (parseInt(b) + 1).toString()), x.replace(b, h);
240
+ });
241
+ var s = {
242
+ JAN: 1,
243
+ FEB: 2,
244
+ MAR: 3,
245
+ APR: 4,
246
+ MAY: 5,
247
+ JUN: 6,
248
+ JUL: 7,
249
+ AUG: 8,
250
+ SEP: 9,
251
+ OCT: 10,
252
+ NOV: 11,
253
+ DEC: 12
254
+ };
255
+ for (var u in s)
256
+ t[4] = t[4].replace(new RegExp(u, "gi"), s[u].toString());
257
+ t[0] == "0" && (t[0] = ""), !/\*|\-|\,|\//.test(t[2]) && (/\*|\//.test(t[1]) || /\*|\//.test(t[0])) && (t[2] += "-".concat(t[2]));
258
+ for (var l = 0; l < t.length; l++)
259
+ if (t[l].indexOf(",") != -1 && (t[l] = t[l].split(",").filter(function(x) {
260
+ return x !== "";
261
+ }).join(",") || "*"), t[l] == "*/1" && (t[l] = "*"), t[l].indexOf("/") > -1 && !/^\*|\-|\,/.test(t[l])) {
262
+ var f = null;
263
+ switch (l) {
264
+ case 4:
265
+ f = "12";
266
+ break;
267
+ case 5:
268
+ f = "6";
269
+ break;
270
+ case 6:
271
+ f = "9999";
272
+ break;
273
+ default:
274
+ f = null;
275
+ break;
276
+ }
277
+ if (f !== null) {
278
+ var O = t[l].split("/");
279
+ t[l] = "".concat(O[0], "-").concat(f, "/").concat(O[1]);
280
+ }
281
+ }
282
+ }, m.prototype.validate = function(t) {
283
+ this.assertNoInvalidCharacters("DOW", t[5]), this.assertNoInvalidCharacters("DOM", t[3]), this.validateRange(t);
284
+ }, m.prototype.validateRange = function(t) {
285
+ n.default.secondRange(t[0]), n.default.minuteRange(t[1]), n.default.hourRange(t[2]), n.default.dayOfMonthRange(t[3]), n.default.monthRange(t[4], this.monthStartIndexZero), n.default.dayOfWeekRange(t[5], this.dayOfWeekStartIndexZero);
286
+ }, m.prototype.assertNoInvalidCharacters = function(t, e) {
287
+ var i = e.match(/[A-KM-VX-Z]+/gi);
288
+ if (i && i.length)
289
+ throw new Error("".concat(t, " part contains invalid values: '").concat(i.toString(), "'"));
290
+ }, m;
291
+ }();
292
+ p.CronParser = k;
293
+ }
294
+ ),
295
+ /***/
296
+ 333: (
297
+ /***/
298
+ (v, p, T) => {
299
+ Object.defineProperty(p, "__esModule", { value: !0 }), p.ExpressionDescriptor = void 0;
300
+ var n = T(823), k = T(949), m = function() {
301
+ function t(e, i) {
302
+ if (this.expression = e, this.options = i, this.expressionParts = new Array(5), !this.options.locale && t.defaultLocale && (this.options.locale = t.defaultLocale), !t.locales[this.options.locale]) {
303
+ var a = Object.keys(t.locales)[0];
304
+ console.warn("Locale '".concat(this.options.locale, "' could not be found; falling back to '").concat(a, "'.")), this.options.locale = a;
305
+ }
306
+ this.i18n = t.locales[this.options.locale], i.use24HourTimeFormat === void 0 && (i.use24HourTimeFormat = this.i18n.use24HourTimeFormatByDefault());
307
+ }
308
+ return t.toString = function(e, i) {
309
+ var a = i === void 0 ? {} : i, s = a.throwExceptionOnParseError, u = s === void 0 ? !0 : s, l = a.verbose, f = l === void 0 ? !1 : l, O = a.dayOfWeekStartIndexZero, x = O === void 0 ? !0 : O, b = a.monthStartIndexZero, h = b === void 0 ? !1 : b, _ = a.use24HourTimeFormat, w = a.locale, I = w === void 0 ? null : w, j = a.tzOffset, D = j === void 0 ? 0 : j, M = {
310
+ throwExceptionOnParseError: u,
311
+ verbose: f,
312
+ dayOfWeekStartIndexZero: x,
313
+ monthStartIndexZero: h,
314
+ use24HourTimeFormat: _,
315
+ locale: I,
316
+ tzOffset: D
317
+ }, pe = new t(e, M);
318
+ return pe.getFullDescription();
319
+ }, t.initialize = function(e, i) {
320
+ i === void 0 && (i = "en"), t.specialCharacters = ["/", "-", ",", "*"], t.defaultLocale = i, e.load(t.locales);
321
+ }, t.prototype.getFullDescription = function() {
322
+ var e = "";
323
+ try {
324
+ var i = new k.CronParser(this.expression, this.options.dayOfWeekStartIndexZero, this.options.monthStartIndexZero);
325
+ this.expressionParts = i.parse();
326
+ var a = this.getTimeOfDayDescription(), s = this.getDayOfMonthDescription(), u = this.getMonthDescription(), l = this.getDayOfWeekDescription(), f = this.getYearDescription();
327
+ e += a + s + l + u + f, e = this.transformVerbosity(e, !!this.options.verbose), e = e.charAt(0).toLocaleUpperCase() + e.substr(1);
328
+ } catch (O) {
329
+ if (!this.options.throwExceptionOnParseError)
330
+ e = this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();
331
+ else
332
+ throw "".concat(O);
333
+ }
334
+ return e;
335
+ }, t.prototype.getTimeOfDayDescription = function() {
336
+ var e = this.expressionParts[0], i = this.expressionParts[1], a = this.expressionParts[2], s = "";
337
+ if (!n.StringUtilities.containsAny(i, t.specialCharacters) && !n.StringUtilities.containsAny(a, t.specialCharacters) && !n.StringUtilities.containsAny(e, t.specialCharacters))
338
+ s += this.i18n.atSpace() + this.formatTime(a, i, e);
339
+ else if (!e && i.indexOf("-") > -1 && !(i.indexOf(",") > -1) && !(i.indexOf("/") > -1) && !n.StringUtilities.containsAny(a, t.specialCharacters)) {
340
+ var u = i.split("-");
341
+ s += n.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(), this.formatTime(a, u[0], ""), this.formatTime(a, u[1], ""));
342
+ } else if (!e && a.indexOf(",") > -1 && a.indexOf("-") == -1 && a.indexOf("/") == -1 && !n.StringUtilities.containsAny(i, t.specialCharacters)) {
343
+ var l = a.split(",");
344
+ s += this.i18n.at();
345
+ for (var f = 0; f < l.length; f++)
346
+ s += " ", s += this.formatTime(l[f], i, ""), f < l.length - 2 && (s += ","), f == l.length - 2 && (s += this.i18n.spaceAnd());
347
+ } else {
348
+ var O = this.getSecondsDescription(), x = this.getMinutesDescription(), b = this.getHoursDescription();
349
+ if (s += O, s && x && (s += ", "), s += x, x === b)
350
+ return s;
351
+ s && b && (s += ", "), s += b;
352
+ }
353
+ return s;
354
+ }, t.prototype.getSecondsDescription = function() {
355
+ var e = this, i = this.getSegmentDescription(this.expressionParts[0], this.i18n.everySecond(), function(a) {
356
+ return a;
357
+ }, function(a) {
358
+ return n.StringUtilities.format(e.i18n.everyX0Seconds(a), a);
359
+ }, function(a) {
360
+ return e.i18n.secondsX0ThroughX1PastTheMinute();
361
+ }, function(a) {
362
+ return a == "0" ? "" : parseInt(a) < 20 ? e.i18n.atX0SecondsPastTheMinute(a) : e.i18n.atX0SecondsPastTheMinuteGt20() || e.i18n.atX0SecondsPastTheMinute(a);
363
+ });
364
+ return i;
365
+ }, t.prototype.getMinutesDescription = function() {
366
+ var e = this, i = this.expressionParts[0], a = this.expressionParts[2], s = this.getSegmentDescription(this.expressionParts[1], this.i18n.everyMinute(), function(u) {
367
+ return u;
368
+ }, function(u) {
369
+ return n.StringUtilities.format(e.i18n.everyX0Minutes(u), u);
370
+ }, function(u) {
371
+ return e.i18n.minutesX0ThroughX1PastTheHour();
372
+ }, function(u) {
373
+ try {
374
+ return u == "0" && a.indexOf("/") == -1 && i == "" ? e.i18n.everyHour() : parseInt(u) < 20 ? e.i18n.atX0MinutesPastTheHour(u) : e.i18n.atX0MinutesPastTheHourGt20() || e.i18n.atX0MinutesPastTheHour(u);
375
+ } catch {
376
+ return e.i18n.atX0MinutesPastTheHour(u);
377
+ }
378
+ });
379
+ return s;
380
+ }, t.prototype.getHoursDescription = function() {
381
+ var e = this, i = this.expressionParts[2], a = this.getSegmentDescription(i, this.i18n.everyHour(), function(l) {
382
+ return e.formatTime(l, "0", "");
383
+ }, function(l) {
384
+ return n.StringUtilities.format(e.i18n.everyX0Hours(l), l);
385
+ }, function(l) {
386
+ return e.i18n.betweenX0AndX1();
387
+ }, function(l) {
388
+ return e.i18n.atX0();
389
+ });
390
+ if (a && i.includes("-") && this.expressionParts[1] != "0") {
391
+ var s = Array.from(a.matchAll(/:00/g));
392
+ if (s.length > 1) {
393
+ var u = s[s.length - 1].index;
394
+ a = a.substring(0, u) + ":59" + a.substring(u + 3);
395
+ }
396
+ }
397
+ return a;
398
+ }, t.prototype.getDayOfWeekDescription = function() {
399
+ var e = this, i = this.i18n.daysOfTheWeek(), a = null;
400
+ return this.expressionParts[5] == "*" ? a = "" : a = this.getSegmentDescription(this.expressionParts[5], this.i18n.commaEveryDay(), function(s, u) {
401
+ var l = s;
402
+ s.indexOf("#") > -1 ? l = s.substring(0, s.indexOf("#")) : s.indexOf("L") > -1 && (l = l.replace("L", ""));
403
+ var f = parseInt(l);
404
+ if (e.options.tzOffset) {
405
+ var O = e.expressionParts[2], x = parseInt(O) + (e.options.tzOffset ? e.options.tzOffset : 0);
406
+ x >= 24 ? f++ : x < 0 && f--, f > 6 ? f = 0 : f < 0 && (f = 6);
407
+ }
408
+ var b = e.i18n.daysOfTheWeekInCase ? e.i18n.daysOfTheWeekInCase(u)[f] : i[f];
409
+ if (s.indexOf("#") > -1) {
410
+ var h = null, _ = s.substring(s.indexOf("#") + 1), w = s.substring(0, s.indexOf("#"));
411
+ switch (_) {
412
+ case "1":
413
+ h = e.i18n.first(w);
414
+ break;
415
+ case "2":
416
+ h = e.i18n.second(w);
417
+ break;
418
+ case "3":
419
+ h = e.i18n.third(w);
420
+ break;
421
+ case "4":
422
+ h = e.i18n.fourth(w);
423
+ break;
424
+ case "5":
425
+ h = e.i18n.fifth(w);
426
+ break;
427
+ }
428
+ b = h + " " + b;
429
+ }
430
+ return b;
431
+ }, function(s) {
432
+ return parseInt(s) == 1 ? "" : n.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(s), s);
433
+ }, function(s) {
434
+ var u = s.substring(0, s.indexOf("-")), l = e.expressionParts[3] != "*";
435
+ return l ? e.i18n.commaAndX0ThroughX1(u) : e.i18n.commaX0ThroughX1(u);
436
+ }, function(s) {
437
+ var u = null;
438
+ if (s.indexOf("#") > -1) {
439
+ var l = s.substring(s.indexOf("#") + 1), f = s.substring(0, s.indexOf("#"));
440
+ u = e.i18n.commaOnThe(l, f).trim() + e.i18n.spaceX0OfTheMonth();
441
+ } else if (s.indexOf("L") > -1)
442
+ u = e.i18n.commaOnTheLastX0OfTheMonth(s.replace("L", ""));
443
+ else {
444
+ var O = e.expressionParts[3] != "*";
445
+ u = O ? e.i18n.commaAndOnX0() : e.i18n.commaOnlyOnX0(s);
446
+ }
447
+ return u;
448
+ }), a;
449
+ }, t.prototype.getMonthDescription = function() {
450
+ var e = this, i = this.i18n.monthsOfTheYear(), a = this.getSegmentDescription(this.expressionParts[4], "", function(s, u) {
451
+ return u && e.i18n.monthsOfTheYearInCase ? e.i18n.monthsOfTheYearInCase(u)[parseInt(s) - 1] : i[parseInt(s) - 1];
452
+ }, function(s) {
453
+ return parseInt(s) == 1 ? "" : n.StringUtilities.format(e.i18n.commaEveryX0Months(s), s);
454
+ }, function(s) {
455
+ return e.i18n.commaMonthX0ThroughMonthX1() || e.i18n.commaX0ThroughX1();
456
+ }, function(s) {
457
+ return e.i18n.commaOnlyInMonthX0 ? e.i18n.commaOnlyInMonthX0() : e.i18n.commaOnlyInX0();
458
+ });
459
+ return a;
460
+ }, t.prototype.getDayOfMonthDescription = function() {
461
+ var e = this, i = null, a = this.expressionParts[3];
462
+ switch (a) {
463
+ case "L":
464
+ i = this.i18n.commaOnTheLastDayOfTheMonth();
465
+ break;
466
+ case "WL":
467
+ case "LW":
468
+ i = this.i18n.commaOnTheLastWeekdayOfTheMonth();
469
+ break;
470
+ default:
471
+ var s = a.match(/(\d{1,2}W)|(W\d{1,2})/);
472
+ if (s) {
473
+ var u = parseInt(s[0].replace("W", "")), l = u == 1 ? this.i18n.firstWeekday() : n.StringUtilities.format(this.i18n.weekdayNearestDayX0(), u.toString());
474
+ i = n.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(), l);
475
+ break;
476
+ } else {
477
+ var f = a.match(/L-(\d{1,2})/);
478
+ if (f) {
479
+ var O = f[1];
480
+ i = n.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(O), O);
481
+ break;
482
+ } else {
483
+ if (a == "*" && this.expressionParts[5] != "*")
484
+ return "";
485
+ i = this.getSegmentDescription(a, this.i18n.commaEveryDay(), function(x) {
486
+ return x == "L" ? e.i18n.lastDay() : e.i18n.dayX0 ? n.StringUtilities.format(e.i18n.dayX0(), x) : x;
487
+ }, function(x) {
488
+ return x == "1" ? e.i18n.commaEveryDay() : e.i18n.commaEveryX0Days(x);
489
+ }, function(x) {
490
+ return e.i18n.commaBetweenDayX0AndX1OfTheMonth(x);
491
+ }, function(x) {
492
+ return e.i18n.commaOnDayX0OfTheMonth(x);
493
+ });
494
+ }
495
+ break;
496
+ }
497
+ }
498
+ return i;
499
+ }, t.prototype.getYearDescription = function() {
500
+ var e = this, i = this.getSegmentDescription(this.expressionParts[6], "", function(a) {
501
+ return /^\d+$/.test(a) ? new Date(parseInt(a), 1).getFullYear().toString() : a;
502
+ }, function(a) {
503
+ return n.StringUtilities.format(e.i18n.commaEveryX0Years(a), a);
504
+ }, function(a) {
505
+ return e.i18n.commaYearX0ThroughYearX1() || e.i18n.commaX0ThroughX1();
506
+ }, function(a) {
507
+ return e.i18n.commaOnlyInYearX0 ? e.i18n.commaOnlyInYearX0() : e.i18n.commaOnlyInX0();
508
+ });
509
+ return i;
510
+ }, t.prototype.getSegmentDescription = function(e, i, a, s, u, l) {
511
+ var f = null, O = e.indexOf("/") > -1, x = e.indexOf("-") > -1, b = e.indexOf(",") > -1;
512
+ if (!e)
513
+ f = "";
514
+ else if (e === "*")
515
+ f = i;
516
+ else if (!O && !x && !b)
517
+ f = n.StringUtilities.format(l(e), a(e));
518
+ else if (b) {
519
+ for (var h = e.split(","), _ = "", w = 0; w < h.length; w++)
520
+ if (w > 0 && h.length > 2 && (_ += ",", w < h.length - 1 && (_ += " ")), w > 0 && h.length > 1 && (w == h.length - 1 || h.length == 2) && (_ += "".concat(this.i18n.spaceAnd(), " ")), h[w].indexOf("/") > -1 || h[w].indexOf("-") > -1) {
521
+ var I = h[w].indexOf("-") > -1 && h[w].indexOf("/") == -1, j = this.getSegmentDescription(h[w], i, a, s, I ? this.i18n.commaX0ThroughX1 : u, l);
522
+ I && (j = j.replace(", ", "")), _ += j;
523
+ } else O ? _ += this.getSegmentDescription(h[w], i, a, s, u, l) : _ += a(h[w]);
524
+ O ? f = _ : f = n.StringUtilities.format(l(e), _);
525
+ } else if (O) {
526
+ var h = e.split("/");
527
+ if (f = n.StringUtilities.format(s(h[1]), h[1]), h[0].indexOf("-") > -1) {
528
+ var D = this.generateRangeSegmentDescription(h[0], u, a);
529
+ D.indexOf(", ") != 0 && (f += ", "), f += D;
530
+ } else if (h[0].indexOf("*") == -1) {
531
+ var M = n.StringUtilities.format(l(h[0]), a(h[0]));
532
+ M = M.replace(", ", ""), f += n.StringUtilities.format(this.i18n.commaStartingX0(), M);
533
+ }
534
+ } else x && (f = this.generateRangeSegmentDescription(e, u, a));
535
+ return f;
536
+ }, t.prototype.generateRangeSegmentDescription = function(e, i, a) {
537
+ var s = "", u = e.split("-"), l = a(u[0], 1), f = a(u[1], 2), O = i(e);
538
+ return s += n.StringUtilities.format(O, l, f), s;
539
+ }, t.prototype.formatTime = function(e, i, a) {
540
+ var s = 0, u = 0;
541
+ this.options.tzOffset && (s = this.options.tzOffset > 0 ? Math.floor(this.options.tzOffset) : Math.ceil(this.options.tzOffset), u = parseFloat((this.options.tzOffset % 1).toFixed(2)), u != 0 && (u *= 60));
542
+ var l = parseInt(e) + s, f = parseInt(i) + u;
543
+ f >= 60 ? (f -= 60, l += 1) : f < 0 && (f += 60, l -= 1), l >= 24 ? l = l - 24 : l < 0 && (l = 24 + l);
544
+ var O = "", x = !1;
545
+ this.options.use24HourTimeFormat || (x = !!(this.i18n.setPeriodBeforeTime && this.i18n.setPeriodBeforeTime()), O = x ? "".concat(this.getPeriod(l), " ") : " ".concat(this.getPeriod(l)), l > 12 && (l -= 12), l === 0 && (l = 12));
546
+ var b = "";
547
+ return a && (b = ":".concat(("00" + a).substring(a.length))), "".concat(x ? O : "").concat(("00" + l.toString()).substring(l.toString().length), ":").concat(("00" + f.toString()).substring(f.toString().length)).concat(b).concat(x ? "" : O);
548
+ }, t.prototype.transformVerbosity = function(e, i) {
549
+ return i || (e = e.replace(new RegExp(", ".concat(this.i18n.everyMinute()), "g"), ""), e = e.replace(new RegExp(", ".concat(this.i18n.everyHour()), "g"), ""), e = e.replace(new RegExp(this.i18n.commaEveryDay(), "g"), ""), e = e.replace(/\, ?$/, "")), e;
550
+ }, t.prototype.getPeriod = function(e) {
551
+ return e >= 12 ? this.i18n.pm && this.i18n.pm() || "PM" : this.i18n.am && this.i18n.am() || "AM";
552
+ }, t.locales = {}, t;
553
+ }();
554
+ p.ExpressionDescriptor = m;
555
+ }
556
+ ),
557
+ /***/
558
+ 747: (
559
+ /***/
560
+ (v, p, T) => {
561
+ Object.defineProperty(p, "__esModule", { value: !0 }), p.enLocaleLoader = void 0;
562
+ var n = T(486), k = function() {
563
+ function m() {
564
+ }
565
+ return m.prototype.load = function(t) {
566
+ t.en = new n.en();
567
+ }, m;
568
+ }();
569
+ p.enLocaleLoader = k;
570
+ }
571
+ ),
572
+ /***/
573
+ 486: (
574
+ /***/
575
+ (v, p) => {
576
+ Object.defineProperty(p, "__esModule", { value: !0 }), p.en = void 0;
577
+ var T = function() {
578
+ function n() {
579
+ }
580
+ return n.prototype.atX0SecondsPastTheMinuteGt20 = function() {
581
+ return null;
582
+ }, n.prototype.atX0MinutesPastTheHourGt20 = function() {
583
+ return null;
584
+ }, n.prototype.commaMonthX0ThroughMonthX1 = function() {
585
+ return null;
586
+ }, n.prototype.commaYearX0ThroughYearX1 = function() {
587
+ return null;
588
+ }, n.prototype.use24HourTimeFormatByDefault = function() {
589
+ return !1;
590
+ }, n.prototype.anErrorOccuredWhenGeneratingTheExpressionD = function() {
591
+ return "An error occured when generating the expression description. Check the cron expression syntax.";
592
+ }, n.prototype.everyMinute = function() {
593
+ return "every minute";
594
+ }, n.prototype.everyHour = function() {
595
+ return "every hour";
596
+ }, n.prototype.atSpace = function() {
597
+ return "At ";
598
+ }, n.prototype.everyMinuteBetweenX0AndX1 = function() {
599
+ return "Every minute between %s and %s";
600
+ }, n.prototype.at = function() {
601
+ return "At";
602
+ }, n.prototype.spaceAnd = function() {
603
+ return " and";
604
+ }, n.prototype.everySecond = function() {
605
+ return "every second";
606
+ }, n.prototype.everyX0Seconds = function() {
607
+ return "every %s seconds";
608
+ }, n.prototype.secondsX0ThroughX1PastTheMinute = function() {
609
+ return "seconds %s through %s past the minute";
610
+ }, n.prototype.atX0SecondsPastTheMinute = function() {
611
+ return "at %s seconds past the minute";
612
+ }, n.prototype.everyX0Minutes = function() {
613
+ return "every %s minutes";
614
+ }, n.prototype.minutesX0ThroughX1PastTheHour = function() {
615
+ return "minutes %s through %s past the hour";
616
+ }, n.prototype.atX0MinutesPastTheHour = function() {
617
+ return "at %s minutes past the hour";
618
+ }, n.prototype.everyX0Hours = function() {
619
+ return "every %s hours";
620
+ }, n.prototype.betweenX0AndX1 = function() {
621
+ return "between %s and %s";
622
+ }, n.prototype.atX0 = function() {
623
+ return "at %s";
624
+ }, n.prototype.commaEveryDay = function() {
625
+ return ", every day";
626
+ }, n.prototype.commaEveryX0DaysOfTheWeek = function() {
627
+ return ", every %s days of the week";
628
+ }, n.prototype.commaX0ThroughX1 = function() {
629
+ return ", %s through %s";
630
+ }, n.prototype.commaAndX0ThroughX1 = function() {
631
+ return ", %s through %s";
632
+ }, n.prototype.first = function() {
633
+ return "first";
634
+ }, n.prototype.second = function() {
635
+ return "second";
636
+ }, n.prototype.third = function() {
637
+ return "third";
638
+ }, n.prototype.fourth = function() {
639
+ return "fourth";
640
+ }, n.prototype.fifth = function() {
641
+ return "fifth";
642
+ }, n.prototype.commaOnThe = function() {
643
+ return ", on the ";
644
+ }, n.prototype.spaceX0OfTheMonth = function() {
645
+ return " %s of the month";
646
+ }, n.prototype.lastDay = function() {
647
+ return "the last day";
648
+ }, n.prototype.commaOnTheLastX0OfTheMonth = function() {
649
+ return ", on the last %s of the month";
650
+ }, n.prototype.commaOnlyOnX0 = function() {
651
+ return ", only on %s";
652
+ }, n.prototype.commaAndOnX0 = function() {
653
+ return ", and on %s";
654
+ }, n.prototype.commaEveryX0Months = function() {
655
+ return ", every %s months";
656
+ }, n.prototype.commaOnlyInX0 = function() {
657
+ return ", only in %s";
658
+ }, n.prototype.commaOnTheLastDayOfTheMonth = function() {
659
+ return ", on the last day of the month";
660
+ }, n.prototype.commaOnTheLastWeekdayOfTheMonth = function() {
661
+ return ", on the last weekday of the month";
662
+ }, n.prototype.commaDaysBeforeTheLastDayOfTheMonth = function() {
663
+ return ", %s days before the last day of the month";
664
+ }, n.prototype.firstWeekday = function() {
665
+ return "first weekday";
666
+ }, n.prototype.weekdayNearestDayX0 = function() {
667
+ return "weekday nearest day %s";
668
+ }, n.prototype.commaOnTheX0OfTheMonth = function() {
669
+ return ", on the %s of the month";
670
+ }, n.prototype.commaEveryX0Days = function() {
671
+ return ", every %s days";
672
+ }, n.prototype.commaBetweenDayX0AndX1OfTheMonth = function() {
673
+ return ", between day %s and %s of the month";
674
+ }, n.prototype.commaOnDayX0OfTheMonth = function() {
675
+ return ", on day %s of the month";
676
+ }, n.prototype.commaEveryHour = function() {
677
+ return ", every hour";
678
+ }, n.prototype.commaEveryX0Years = function() {
679
+ return ", every %s years";
680
+ }, n.prototype.commaStartingX0 = function() {
681
+ return ", starting %s";
682
+ }, n.prototype.daysOfTheWeek = function() {
683
+ return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
684
+ }, n.prototype.monthsOfTheYear = function() {
685
+ return [
686
+ "January",
687
+ "February",
688
+ "March",
689
+ "April",
690
+ "May",
691
+ "June",
692
+ "July",
693
+ "August",
694
+ "September",
695
+ "October",
696
+ "November",
697
+ "December"
698
+ ];
699
+ }, n;
700
+ }();
701
+ p.en = T;
702
+ }
703
+ ),
704
+ /***/
705
+ 515: (
706
+ /***/
707
+ (v, p) => {
708
+ Object.defineProperty(p, "__esModule", { value: !0 });
709
+ function T(k, m) {
710
+ if (!k)
711
+ throw new Error(m);
712
+ }
713
+ var n = function() {
714
+ function k() {
715
+ }
716
+ return k.secondRange = function(m) {
717
+ for (var t = m.split(","), e = 0; e < t.length; e++)
718
+ if (!isNaN(parseInt(t[e], 10))) {
719
+ var i = parseInt(t[e], 10);
720
+ T(i >= 0 && i <= 59, "seconds part must be >= 0 and <= 59");
721
+ }
722
+ }, k.minuteRange = function(m) {
723
+ for (var t = m.split(","), e = 0; e < t.length; e++)
724
+ if (!isNaN(parseInt(t[e], 10))) {
725
+ var i = parseInt(t[e], 10);
726
+ T(i >= 0 && i <= 59, "minutes part must be >= 0 and <= 59");
727
+ }
728
+ }, k.hourRange = function(m) {
729
+ for (var t = m.split(","), e = 0; e < t.length; e++)
730
+ if (!isNaN(parseInt(t[e], 10))) {
731
+ var i = parseInt(t[e], 10);
732
+ T(i >= 0 && i <= 23, "hours part must be >= 0 and <= 23");
733
+ }
734
+ }, k.dayOfMonthRange = function(m) {
735
+ for (var t = m.split(","), e = 0; e < t.length; e++)
736
+ if (!isNaN(parseInt(t[e], 10))) {
737
+ var i = parseInt(t[e], 10);
738
+ T(i >= 1 && i <= 31, "DOM part must be >= 1 and <= 31");
739
+ }
740
+ }, k.monthRange = function(m, t) {
741
+ for (var e = m.split(","), i = 0; i < e.length; i++)
742
+ if (!isNaN(parseInt(e[i], 10))) {
743
+ var a = parseInt(e[i], 10);
744
+ T(a >= 1 && a <= 12, t ? "month part must be >= 0 and <= 11" : "month part must be >= 1 and <= 12");
745
+ }
746
+ }, k.dayOfWeekRange = function(m, t) {
747
+ for (var e = m.split(","), i = 0; i < e.length; i++)
748
+ if (!isNaN(parseInt(e[i], 10))) {
749
+ var a = parseInt(e[i], 10);
750
+ T(a >= 0 && a <= 6, t ? "DOW part must be >= 0 and <= 6" : "DOW part must be >= 1 and <= 7");
751
+ }
752
+ }, k;
753
+ }();
754
+ p.default = n;
755
+ }
756
+ ),
757
+ /***/
758
+ 823: (
759
+ /***/
760
+ (v, p) => {
761
+ Object.defineProperty(p, "__esModule", { value: !0 }), p.StringUtilities = void 0;
762
+ var T = function() {
763
+ function n() {
764
+ }
765
+ return n.format = function(k) {
766
+ for (var m = [], t = 1; t < arguments.length; t++)
767
+ m[t - 1] = arguments[t];
768
+ return k.replace(/%s/g, function(e) {
769
+ return m.shift();
770
+ });
771
+ }, n.containsAny = function(k, m) {
772
+ return m.some(function(t) {
773
+ return k.indexOf(t) > -1;
774
+ });
775
+ }, n;
776
+ }();
777
+ p.StringUtilities = T;
778
+ }
779
+ )
780
+ /******/
781
+ }, S = {};
782
+ function y(v) {
783
+ var p = S[v];
784
+ if (p !== void 0)
785
+ return p.exports;
786
+ var T = S[v] = {
787
+ /******/
788
+ // no module.id needed
789
+ /******/
790
+ // no module.loaded needed
791
+ /******/
792
+ exports: {}
793
+ /******/
794
+ };
795
+ return o[v](T, T.exports, y), T.exports;
796
+ }
797
+ var g = {};
798
+ return (() => {
799
+ var v = g;
800
+ Object.defineProperty(v, "__esModule", { value: !0 }), v.toString = void 0;
801
+ var p = y(333), T = y(747);
802
+ p.ExpressionDescriptor.initialize(new T.enLocaleLoader()), v.default = p.ExpressionDescriptor;
803
+ var n = p.ExpressionDescriptor.toString;
804
+ v.toString = n;
805
+ })(), g;
806
+ })()
807
+ ));
808
+ })(he);
809
+ var Ke = he.exports;
810
+ const B = /* @__PURE__ */ ve(Ke), Qe = ({ scheduledTaskRows: r, triggerTask: c, updateTaskState: o, onClickRowAction: S }) => {
811
+ const y = (g, v) => {
812
+ S && S(g, v.ctrlKey || v.button === 1);
813
+ };
814
+ return d.jsx(d.Fragment, { children: r.map((g) => d.jsxs(ee, { sx: {
815
+ "&:nth-of-type(odd)": {
816
+ backgroundColor: "action.hover"
817
+ // TODO: use something that doesn't osbcure the hover effect
818
+ },
819
+ "&:hover": {
820
+ cursor: "pointer"
821
+ }
822
+ }, hover: !0, role: "checkbox", tabIndex: -1, onClick: (v) => y(g.id, v), children: [se.map((v) => {
823
+ const p = g[v.id];
824
+ let T;
825
+ v.id === "cronExpression" && (T = B.toString(p, {
826
+ use24HourTimeFormat: !0
827
+ }));
828
+ let n;
829
+ return v.cellRenderer && (n = v.cellRenderer(p)), d.jsx(W, { title: T, children: n || p }, v.id);
830
+ }), d.jsx(W, { sx: { display: "flex", flexDirection: "row" }, children: g.state === "PAUSED" ? d.jsx(A, { title: "Activate task", children: d.jsx(N, { onClick: () => o(g.id, "WAITING"), "aria-label": "activate task", children: d.jsx(le, {}) }) }) : g.state === "WAITING" ? d.jsxs(d.Fragment, { children: [d.jsx(A, { title: "Trigger task", children: d.jsx(N, { onClick: () => c(g.id), "aria-label": "trigger task", children: d.jsx(ce, {}) }) }), d.jsx(A, { title: "Pause task", children: d.jsx(N, { onClick: () => o(g.id, "PAUSED"), "aria-label": "pause task", children: d.jsx(ue, {}) }) })] }) : g.state === "RUNNING" && d.jsx(A, { title: "Stop task", children: d.jsx(N, { onClick: () => o(g.id, "WAITING"), "aria-label": "stop task", children: d.jsx(de, {}) }) }) }, `${g.id}-action-cell`)] }, g.id)) });
831
+ }, et = ({ fetchStatus: r, scheduledTasks: c, scheduledTaskFilters: o, scheduledTasksTotalCount: S, scheduledTaskNotification: y, handlePageChange: g, triggerTask: v, updateTaskState: p, handleFilterFormSubmit: T, onClickRowAction: n }) => {
832
+ const [k, m] = X(!0), t = (e, i) => {
833
+ g(i);
834
+ };
835
+ return r === "loading" ? d.jsx(Te, {}) : d.jsxs(d.Fragment, { children: [y && k && d.jsx(te, { onClose: () => m(!1), sx: {
836
+ marginBottom: 20
837
+ }, elevation: 6, severity: "info", variant: "filled", children: y }), d.jsx("form", { onSubmit: T, children: d.jsx(xe, { sx: {
838
+ maxHeight: 1200
839
+ }, children: d.jsxs(Se, { stickyHeader: !0, "aria-label": "sticky table", children: [d.jsx(We, {}), d.jsx(ke, { children: d.jsx(Qe, { scheduledTaskRows: c, triggerTask: v, updateTaskState: p, onClickRowAction: n }) })] }) }) }), d.jsx(Oe, { component: "div", count: S, rowsPerPage: o.size || 100, page: o.page, onPageChange: t, rowsPerPageOptions: [] })] });
840
+ }, tt = ({ label: r, value: c, name: o, onChange: S, errorTextOverride: y, helperTextOverride: g, options: v }) => {
841
+ const [p, T] = X(U(c, v)), [n, k] = X(U(c, v) ? "" : B.toString(c)), m = (t) => {
842
+ const e = t.target.value;
843
+ if (S && S(e), e) {
844
+ const i = U(e, v);
845
+ T(i), i || k(B.toString(e));
846
+ } else
847
+ T(void 0);
848
+ };
849
+ return d.jsx(C, { name: o, label: r, onChange: m, defaultValue: c, error: !!y || !!p, helperText: y || p || g || n });
850
+ }, nt = (r) => {
851
+ if (!r)
852
+ return "Name is required";
853
+ }, rt = (r) => {
854
+ if (!r)
855
+ return "Timezone is required";
856
+ try {
857
+ Intl.DateTimeFormat(void 0, { timeZone: r });
858
+ return;
859
+ } catch {
860
+ return "Invalid timezone";
861
+ }
862
+ }, it = (r) => {
863
+ if (!r)
864
+ return "Triggerable is required";
865
+ }, at = (r) => {
866
+ if (!r && r !== 0)
867
+ return "Priority is required";
868
+ }, ot = (r) => {
869
+ if (!r && r !== 0)
870
+ return "Timeout is required";
871
+ if (r < 0)
872
+ return "Timeout must be non-negative";
873
+ }, st = (r) => {
874
+ if (!r)
875
+ return "Miss policy is required";
876
+ if (!oe.find((c) => c === r))
877
+ return "Invalid miss policy";
878
+ }, ct = (r, c) => {
879
+ const o = {};
880
+ return o.name = nt(r.name), o.cronExpression = U(r.cronExpression, c), o.timeZone = rt(r.timeZone), o.triggerable = it(r.triggerable), o.priority = at(r.priority), o.timeoutMs = ot(r.timeoutMs), o.missPolicy = st(r.missPolicy), o;
881
+ }, ut = ge(/* @__PURE__ */ d.jsx("path", {
882
+ d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"
883
+ }), "ArrowBack"), lt = ({ task: r, onSave: c, onDelete: o, onBack: S }) => {
884
+ const [y, g] = X(r), { id: v, name: p, state: T, cronExpression: n, timeZone: k, triggerable: m, timeoutMs: t, priority: e, missPolicy: i, args: a, nextFireTime: s, lastFinishedTime: u, lastFiredTime: l } = y, f = ct(y, { requireSeconds: !0 }), O = Object.values(f).some((h) => !!h), x = v ? "Create a new task" : `Edit task ${p}, id: ${v}`, b = () => {
885
+ O || c(y);
886
+ };
887
+ return console.log(f), d.jsxs(L, { sx: {
888
+ display: "flex",
889
+ flexDirection: "column",
890
+ gap: "1em",
891
+ padding: "1em"
892
+ }, children: [d.jsx(J, { sx: { maxWidth: "100px" }, variant: "contained", onClick: S, startIcon: d.jsx(ut, {}), children: "Back" }), d.jsx(be, { variant: "h2", children: x }), d.jsxs(L, { sx: {
893
+ display: "flex",
894
+ flexDirection: "row",
895
+ flexWrap: "wrap",
896
+ gap: "2em",
897
+ "& > *": {
898
+ height: "100%",
899
+ minWidth: "300px"
900
+ }
901
+ }, children: [d.jsx(C, { onChange: (h) => {
902
+ g({ ...y, name: h.target.value });
903
+ }, label: "Task name", value: y.name, helperText: f.name, error: !!f.name }), d.jsx(z, { onChange: (h) => {
904
+ g({ ...y, state: h.target.value });
905
+ }, label: "Task state", value: T || "", children: Le.map((h) => d.jsx(R, { value: h, children: h }, h)) }), d.jsx(tt, { label: "Cron expression", value: n, onChange: (h) => {
906
+ g({ ...y, cronExpression: h });
907
+ }, options: { requireSeconds: !0 } }), d.jsxs(z, { name: "time-zone", label: "Time zone", onChange: (h) => {
908
+ g({ ...y, timeZone: h.target.value });
909
+ }, value: k || "", children: [d.jsx(R, { value: "Europe/Helsinki", children: "Europe/Helsinki" }), d.jsx(R, { value: "UTC", children: "UTC" })] }), d.jsx(C, { label: "Triggerable task to schedule", value: m || "", helperText: f.triggerable, error: !!f.triggerable, onChange: (h) => {
910
+ g({ ...y, triggerable: h.target.value });
911
+ }, sx: {
912
+ minWidth: "500px"
913
+ } }), d.jsx(C, { type: "number", label: "priority", onChange: (h) => {
914
+ g({ ...y, priority: parseInt(h.target.value, 10) });
915
+ }, value: (e == null ? void 0 : e.toString()) || "" }), d.jsx(C, { type: "number", label: "Timeout (ms)", onChange: (h) => {
916
+ g({ ...y, timeoutMs: parseInt(h.target.value, 10) });
917
+ }, value: (t == null ? void 0 : t.toString()) || "", helperText: f.timeoutMs, error: !!f.timeoutMs }), d.jsx(z, { label: "Miss policy", onChange: (h) => {
918
+ g({ ...y, missPolicy: h.target.value });
919
+ }, value: i || "", children: oe.map((h) => d.jsx(R, { value: h, children: h }, h)) })] }), d.jsxs(L, { sx: {
920
+ display: "flex",
921
+ flexDirection: "row",
922
+ gap: "1em",
923
+ justifyContent: "flex-end",
924
+ "& >*": {
925
+ minWidth: "200px",
926
+ height: "40px"
927
+ }
928
+ }, children: [d.jsx(J, { disabled: O, variant: "contained", onClick: b, children: "Save" }), d.jsx(Ce, { color: "error", variant: "outlined", confirmVariant: "contained", onConfirmed: o, confirmChildren: "Confirm deleting scheduled task", timeout: 4e3, children: "Delete scheduled task" })] }), d.jsxs(L, { children: [d.jsxs("pre", { children: ["args: ", JSON.stringify(a, null, 2)] }), d.jsxs("pre", { children: ["Last fired time: ", l || "-"] }), d.jsxs("pre", { children: ["Last finished time: ", u || "-"] }), d.jsxs("pre", { children: ["Next fire time: ", s || "-"] })] })] });
929
+ }, dt = (r) => {
930
+ const c = new URLSearchParams();
931
+ return r.page !== 0 && c.set("page", r.page.toString()), r.size && r.size !== 100 && c.set("size", r.size.toString()), c;
932
+ }, fe = (r) => {
933
+ const c = {
934
+ page: 0,
935
+ size: 100
936
+ };
937
+ if (r.has("page"))
938
+ try {
939
+ const o = parseInt(r.get("page") ?? "", 10);
940
+ isNaN(o) || (c.page = o);
941
+ } catch {
942
+ }
943
+ if (r.has("size"))
944
+ try {
945
+ const o = parseInt(r.get("size") ?? "", 10);
946
+ isNaN(o) || (c.size = o);
947
+ } catch {
948
+ }
949
+ return c;
950
+ }, ht = (r) => async ({ params: c }) => {
951
+ const o = c.id;
952
+ if (console.log("id", o), o === "new")
953
+ return Re();
954
+ if (!o && o !== "0" || Number.isNaN(parseInt(o, 10)))
955
+ throw console.log("no id or id is not a number", o), new Response("", {
956
+ status: 404,
957
+ statusText: "Not found"
958
+ });
959
+ const S = parseInt(o, 10), y = await De(S, r), { data: g, status: v } = y;
960
+ if (v >= 400 || !g)
961
+ throw console.log("failed to fetch task", v, o), new Error("Failed to fetch scheduled task");
962
+ return g;
963
+ }, St = ht(), ft = (r) => async ({ request: c }) => {
964
+ try {
965
+ const o = new URL(c.url), S = fe(
966
+ o.searchParams
967
+ ), y = await re(
968
+ S,
969
+ r
970
+ ), { data: g } = y;
971
+ return g;
972
+ } catch (o) {
973
+ throw console.error(o), new Error("Failed to fetch scheduled tasks");
974
+ }
975
+ }, kt = ft(), Ot = () => {
976
+ const r = _e(), c = je(), [o, S] = Xe(), y = fe(o), g = c.state, v = ne(), { content: p, totalElements: T } = v, n = (e) => {
977
+ const i = dt({
978
+ ...y,
979
+ page: e
980
+ });
981
+ S(i);
982
+ }, k = async (e) => {
983
+ await ie(e), r.revalidate();
984
+ }, m = async (e, i) => {
985
+ await ae(e, i), r.revalidate();
986
+ }, t = (e) => {
987
+ e.preventDefault(), r.revalidate();
988
+ };
989
+ return /* @__PURE__ */ d.jsx(
990
+ et,
991
+ {
992
+ fetchStatus: g,
993
+ scheduledTasks: p || [],
994
+ scheduledTaskFilters: y,
995
+ scheduledTasksTotalCount: T || 0,
996
+ handlePageChange: n,
997
+ triggerTask: k,
998
+ updateTaskState: m,
999
+ handleFilterFormSubmit: t
1000
+ }
1001
+ );
1002
+ }, bt = () => {
1003
+ const [r, c] = X(!1), [o, S] = X(null), y = ne(), g = Ee(), { id: v } = g, p = Me(), T = async () => {
1004
+ if (r || v === "new") return;
1005
+ const k = await Ne(y.id), { status: m } = k;
1006
+ m === 204 && (c(!0), S({ severity: "success", message: "Task deleted" }), setTimeout(() => {
1007
+ p("/scheduled-tasks");
1008
+ }, 3e3)), m === 404 && S({ severity: "error", message: "Task not found" }), m === 500 && S({ severity: "error", message: "Server error" });
1009
+ }, n = async (k) => {
1010
+ if (r) return;
1011
+ (await Ae(k)).status === 204 ? v === "new" ? (S({ severity: "success", message: "Task created" }), setTimeout(() => {
1012
+ p("/scheduled-tasks");
1013
+ }, 3e3)) : S({ severity: "success", message: "Task updated" }) : S({ severity: "error", message: "Failed to save task" });
1014
+ };
1015
+ return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
1016
+ /* @__PURE__ */ d.jsx(we, { in: o !== null, unmountOnExit: !0, children: /* @__PURE__ */ d.jsx(te, { severity: o == null ? void 0 : o.severity, children: o == null ? void 0 : o.message }) }),
1017
+ /* @__PURE__ */ d.jsx(
1018
+ lt,
1019
+ {
1020
+ task: y,
1021
+ onSave: n,
1022
+ onDelete: T,
1023
+ onBack: () => {
1024
+ p("/scheduled-tasks");
1025
+ }
1026
+ }
1027
+ )
1028
+ ] });
1029
+ };
1030
+ export {
1031
+ Ot as S,
1032
+ kt as a,
1033
+ ft as b,
1034
+ bt as c,
1035
+ ht as g,
1036
+ St as s
1037
+ };
1038
+ //# sourceMappingURL=ScheduledTaskFormRoute-CcBBzEsv.js.map