@epam/ai-dial-scheduled-tasks 1.1.0-dev.113 → 1.1.0-dev.116
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/components/ScheduledTaskCard/ScheduledTaskCard.d.ts.map +1 -1
- package/components/ScheduledTaskCardGrid/ScheduledTaskCardGrid.d.ts.map +1 -1
- package/components/ScheduledTaskCardSkeleton/ScheduledTaskCardSkeleton.d.ts.map +1 -1
- package/components/ScheduledTaskCreateForm/ScheduledTaskCreateForm.d.ts.map +1 -1
- package/components/ScheduledTaskDetailView/ScheduledTaskDetailView.d.ts +11 -0
- package/components/ScheduledTaskDetailView/ScheduledTaskDetailView.d.ts.map +1 -0
- package/components/ScheduledTasks/ScheduledTasks.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +5 -1
- package/index.d.ts.map +1 -1
- package/index.js +622 -310
- package/models/scheduled-task-card-grid-props.d.ts +2 -0
- package/models/scheduled-task-card-grid-props.d.ts.map +1 -1
- package/models/scheduled-task-card-props.d.ts +3 -1
- package/models/scheduled-task-card-props.d.ts.map +1 -1
- package/models/scheduled-task-create-form-props.d.ts +16 -0
- package/models/scheduled-task-create-form-props.d.ts.map +1 -1
- package/models/scheduled-task-detail-view-props.d.ts +130 -0
- package/models/scheduled-task-detail-view-props.d.ts.map +1 -0
- package/models/scheduled-task-item.d.ts +0 -9
- package/models/scheduled-task-item.d.ts.map +1 -1
- package/models/scheduled-task-run-item.d.ts +15 -0
- package/models/scheduled-task-run-item.d.ts.map +1 -0
- package/models/scheduled-tasks-props.d.ts +2 -0
- package/models/scheduled-tasks-props.d.ts.map +1 -1
- package/package.json +3 -3
- package/types/scheduled-task-run-status.d.ts +12 -0
- package/types/scheduled-task-run-status.d.ts.map +1 -0
- package/types/scheduled-tasks-sort-key.d.ts +9 -5
- package/types/scheduled-tasks-sort-key.d.ts.map +1 -1
- package/utils/calendar-value.d.ts +4 -0
- package/utils/calendar-value.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Input as
|
|
3
|
-
import { Calendar as
|
|
4
|
-
import { IconArrowLeft as
|
|
5
|
-
import { Suspense as
|
|
6
|
-
import { Fragment as
|
|
1
|
+
import { MDMessageViewer as e, PanelEmptyState as t, buildCssVars as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { Input as i, SearchBar as a, Textarea as o } from "@epam/ai-dial-kit";
|
|
3
|
+
import { Calendar as s, CalendarMode as c, CardShell as l, DIAL_ICON_SIZE as u, DialDropdown as d, DialSelectField as f, DialSkeleton as p, DialSkeletonVariant as m, DialSpinner as h, FolderPath as g, GhostButton as _, GhostIconButton as v, Highlight as y, IconButton as b, LazyDialMarkdownEditor as x, NeutralButton as S, PrimaryButton as C } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { IconAlertTriangle as w, IconArrowLeft as T, IconArrowsSort as E, IconCalendarTime as D, IconCheck as O, IconChevronUp as k, IconCircleCheck as A, IconCircleX as j, IconDotsVertical as M, IconEdit as N, IconPlayerPlay as P, IconPlus as F, IconTrash as I } from "@tabler/icons-react";
|
|
5
|
+
import { Suspense as L, lazy as R, useEffect as ee, useMemo as z, useRef as te } from "react";
|
|
6
|
+
import { Fragment as ne, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
7
7
|
//#region src/models/scheduled-task-item.ts
|
|
8
|
-
var
|
|
8
|
+
var H = /* @__PURE__ */ function(e) {
|
|
9
9
|
return e.Shared = "shared", e.MyTasks = "myTasks", e;
|
|
10
|
-
}({}),
|
|
10
|
+
}({}), U = {
|
|
11
11
|
title: "_title_14goq_1",
|
|
12
12
|
description: "_description_14goq_5",
|
|
13
13
|
schedulePill: "_schedulePill_14goq_9",
|
|
@@ -16,191 +16,206 @@ var R = /* @__PURE__ */ function(e) {
|
|
|
16
16
|
locationLeaf: "_locationLeaf_14goq_22",
|
|
17
17
|
newBadge: "_newBadge_14goq_26",
|
|
18
18
|
locationDivider: "_locationDivider_14goq_31"
|
|
19
|
-
},
|
|
20
|
-
let
|
|
21
|
-
"--stc-title-text":
|
|
22
|
-
"--stc-desc-text":
|
|
23
|
-
"--stc-pill-bg":
|
|
24
|
-
"--stc-pill-border":
|
|
25
|
-
"--stc-schedule-label-text":
|
|
26
|
-
"--stc-location-label-text":
|
|
27
|
-
"--stc-location-leaf-text":
|
|
28
|
-
"--stc-new-badge-bg":
|
|
29
|
-
"--stc-new-badge-text":
|
|
30
|
-
"--stc-location-divider-border":
|
|
31
|
-
}),
|
|
32
|
-
|
|
19
|
+
}, W = ({ item: e, searchQuery: t = "", onEdit: i, onRunNow: a, onDelete: o, onCardClick: s, labels: c, styles: f, className: p }) => {
|
|
20
|
+
let m = c?.newBadgeLabel ?? "NEW", h = c?.actionsLabel ?? "More actions", _ = c?.editActionLabel ?? "Edit", v = c?.runNowActionLabel ?? "Run now", x = c?.deleteActionLabel ?? "Delete", { colors: S, typography: C } = f ?? {}, w = C?.titleClassName ?? "dial-body-semi-text", T = C?.descriptionClassName ?? "dial-small-text", E = C?.scheduleLabelClassName ?? "dial-tiny-text", D = C?.locationLabelClassName ?? "dial-tiny-text", O = C?.locationLeafClassName ?? "dial-tiny-semi-text", k = C?.newBadgeClassName ?? "dial-tiny-semi-text", A = n({
|
|
21
|
+
"--stc-title-text": S?.titleText,
|
|
22
|
+
"--stc-desc-text": S?.descriptionText,
|
|
23
|
+
"--stc-pill-bg": S?.schedulePillBackground,
|
|
24
|
+
"--stc-pill-border": S?.schedulePillBorder,
|
|
25
|
+
"--stc-schedule-label-text": S?.scheduleLabelText,
|
|
26
|
+
"--stc-location-label-text": S?.locationLabelText,
|
|
27
|
+
"--stc-location-leaf-text": S?.locationLeafText,
|
|
28
|
+
"--stc-new-badge-bg": S?.newBadgeBackground,
|
|
29
|
+
"--stc-new-badge-text": S?.newBadgeText,
|
|
30
|
+
"--stc-location-divider-border": S?.locationDividerBorder
|
|
31
|
+
}), j = [];
|
|
32
|
+
i && j.push({
|
|
33
33
|
key: "edit",
|
|
34
|
-
label:
|
|
35
|
-
icon: /* @__PURE__ */
|
|
36
|
-
size:
|
|
34
|
+
label: _,
|
|
35
|
+
icon: /* @__PURE__ */ B(N, {
|
|
36
|
+
size: u.SM,
|
|
37
37
|
"aria-hidden": !0
|
|
38
38
|
}),
|
|
39
|
-
onClick: () =>
|
|
40
|
-
|
|
39
|
+
onClick: ({ domEvent: t }) => {
|
|
40
|
+
t.stopPropagation(), i(e.id);
|
|
41
|
+
}
|
|
42
|
+
}), a && j.push({
|
|
41
43
|
key: "runNow",
|
|
42
|
-
label:
|
|
43
|
-
icon: /* @__PURE__ */
|
|
44
|
-
size:
|
|
44
|
+
label: v,
|
|
45
|
+
icon: /* @__PURE__ */ B(P, {
|
|
46
|
+
size: u.SM,
|
|
45
47
|
"aria-hidden": !0
|
|
46
48
|
}),
|
|
47
|
-
onClick: () =>
|
|
48
|
-
|
|
49
|
+
onClick: ({ domEvent: t }) => {
|
|
50
|
+
t.stopPropagation(), a(e.id);
|
|
51
|
+
}
|
|
52
|
+
}), o && j.push({
|
|
49
53
|
key: "delete",
|
|
50
|
-
label:
|
|
51
|
-
icon: /* @__PURE__ */ I
|
|
52
|
-
size:
|
|
54
|
+
label: x,
|
|
55
|
+
icon: /* @__PURE__ */ B(I, {
|
|
56
|
+
size: u.SM,
|
|
53
57
|
"aria-hidden": !0
|
|
54
58
|
}),
|
|
55
59
|
danger: !0,
|
|
56
|
-
onClick: () =>
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
onClick: ({ domEvent: t }) => {
|
|
61
|
+
t.stopPropagation(), o(e.id);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
let F = s ? {
|
|
65
|
+
tabIndex: 0,
|
|
66
|
+
onClick: () => s(e.id),
|
|
67
|
+
onKeyDown: (t) => {
|
|
68
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), s(e.id));
|
|
69
|
+
}
|
|
70
|
+
} : {};
|
|
71
|
+
return /* @__PURE__ */ V(l, {
|
|
72
|
+
role: s ? "button" : "group",
|
|
59
73
|
"aria-label": e.displayName,
|
|
60
|
-
style:
|
|
61
|
-
className:
|
|
74
|
+
style: A,
|
|
75
|
+
className: r("h-[232px]", s && "cursor-pointer", p),
|
|
76
|
+
...F,
|
|
62
77
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ V("div", {
|
|
64
79
|
className: "flex shrink-0 items-start justify-between gap-2",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ V("div", {
|
|
66
81
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ B(y, {
|
|
68
83
|
text: e.displayName,
|
|
69
|
-
query:
|
|
84
|
+
query: t,
|
|
70
85
|
maxLines: 1,
|
|
71
|
-
className:
|
|
72
|
-
}), e.isNew && /* @__PURE__ */
|
|
73
|
-
className:
|
|
74
|
-
children:
|
|
86
|
+
className: r(w, U.title)
|
|
87
|
+
}), e.isNew && /* @__PURE__ */ B("span", {
|
|
88
|
+
className: r("shrink-0 rounded-full px-2 py-0.5", k, U.newBadge),
|
|
89
|
+
children: m
|
|
75
90
|
})]
|
|
76
|
-
}),
|
|
77
|
-
items:
|
|
91
|
+
}), j.length > 0 && /* @__PURE__ */ B(d, {
|
|
92
|
+
items: j,
|
|
78
93
|
matchReferenceWidth: !1,
|
|
79
94
|
placement: "bottom-end",
|
|
80
|
-
children: /* @__PURE__ */
|
|
81
|
-
icon: /* @__PURE__ */
|
|
82
|
-
size:
|
|
95
|
+
children: /* @__PURE__ */ B(b, {
|
|
96
|
+
icon: /* @__PURE__ */ B(M, {
|
|
97
|
+
size: u.SM,
|
|
83
98
|
"aria-hidden": !0
|
|
84
99
|
}),
|
|
85
|
-
"aria-label":
|
|
86
|
-
className: "shrink-0"
|
|
100
|
+
"aria-label": h,
|
|
101
|
+
className: "shrink-0",
|
|
102
|
+
onClick: (e) => e.stopPropagation()
|
|
87
103
|
})
|
|
88
104
|
})]
|
|
89
105
|
}),
|
|
90
|
-
e.descriptionPreview && /* @__PURE__ */
|
|
91
|
-
className:
|
|
106
|
+
e.descriptionPreview && /* @__PURE__ */ B("p", {
|
|
107
|
+
className: r("line-clamp-4 min-h-0 flex-1 overflow-hidden !leading-[22px]", T, U.description),
|
|
92
108
|
children: e.descriptionPreview
|
|
93
109
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ V("div", {
|
|
95
111
|
className: "mt-auto flex shrink-0 flex-col gap-3",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ B("div", {
|
|
97
113
|
className: "flex min-h-[28px] items-center",
|
|
98
|
-
children: /* @__PURE__ */
|
|
99
|
-
className:
|
|
114
|
+
children: /* @__PURE__ */ B("span", {
|
|
115
|
+
className: r("inline-block rounded-lg border px-2 py-1", U.schedulePill, E, U.scheduleLabel),
|
|
100
116
|
children: e.scheduleLabel
|
|
101
117
|
})
|
|
102
|
-
}), e.locationSegments && e.locationSegments.length > 0 && /* @__PURE__ */
|
|
118
|
+
}), e.locationSegments && e.locationSegments.length > 0 && /* @__PURE__ */ B(g, {
|
|
103
119
|
segments: e.locationSegments,
|
|
104
|
-
labelClassName:
|
|
105
|
-
leafClassName:
|
|
106
|
-
className:
|
|
120
|
+
labelClassName: r(D, U.locationLabel),
|
|
121
|
+
leafClassName: r(O, U.locationLeaf),
|
|
122
|
+
className: r("pt-3", U.locationDivider)
|
|
107
123
|
})]
|
|
108
124
|
})
|
|
109
125
|
]
|
|
110
126
|
});
|
|
111
|
-
},
|
|
127
|
+
}, G = { card: "_card_1a43j_1" }, re = [
|
|
112
128
|
"100%",
|
|
113
129
|
"100%",
|
|
114
130
|
"61%"
|
|
115
|
-
],
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
});
|
|
146
|
-
}, U = ({ items: e, searchQuery: t, onEdit: n, onRunNow: r, onDelete: i, labels: a, cardStyles: o, trailingSkeletonCount: s = 0, skeletonStyles: c }) => /* @__PURE__ */ L("div", {
|
|
131
|
+
], K = "var(--stcs-skeleton-bg)", ie = ({ styles: e }) => /* @__PURE__ */ V(l, {
|
|
132
|
+
"aria-hidden": !0,
|
|
133
|
+
style: n({ "--stcs-skeleton-bg": e?.colors?.skeletonColor }),
|
|
134
|
+
className: r("h-[232px]", G.card),
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ B(p, {
|
|
137
|
+
variant: m.Rectangular,
|
|
138
|
+
width: "60%",
|
|
139
|
+
height: "20px",
|
|
140
|
+
color: K,
|
|
141
|
+
className: "shrink-0"
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ B("div", {
|
|
144
|
+
className: "flex min-h-0 flex-1 flex-col gap-3 overflow-hidden",
|
|
145
|
+
children: re.map((e, t) => /* @__PURE__ */ B(p, {
|
|
146
|
+
variant: m.Rectangular,
|
|
147
|
+
width: e,
|
|
148
|
+
height: "16px",
|
|
149
|
+
color: K
|
|
150
|
+
}, t))
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ B(p, {
|
|
153
|
+
variant: m.Rectangular,
|
|
154
|
+
width: "110px",
|
|
155
|
+
height: "28px",
|
|
156
|
+
color: K,
|
|
157
|
+
className: "shrink-0 rounded-lg"
|
|
158
|
+
})
|
|
159
|
+
]
|
|
160
|
+
}), ae = ({ items: e, searchQuery: t, onEdit: n, onRunNow: r, onDelete: i, onCardClick: a, labels: o, cardStyles: s, trailingSkeletonCount: c = 0, skeletonStyles: l }) => /* @__PURE__ */ V("div", {
|
|
147
161
|
className: "grid grid-cols-1 gap-5 desktop:grid-cols-3",
|
|
148
|
-
children: [e.map((e) => /* @__PURE__ */
|
|
162
|
+
children: [e.map((e) => /* @__PURE__ */ B(W, {
|
|
149
163
|
item: e,
|
|
150
164
|
searchQuery: t,
|
|
151
165
|
onEdit: n,
|
|
152
166
|
onRunNow: r,
|
|
153
167
|
onDelete: i,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}),
|
|
158
|
-
|
|
168
|
+
onCardClick: a,
|
|
169
|
+
labels: o,
|
|
170
|
+
styles: s
|
|
171
|
+
}, e.id)), Array.from({ length: c }, (e, t) => /* @__PURE__ */ B(ie, { styles: l }, `skeleton-${t}`))]
|
|
172
|
+
}), oe = { countBadge: "_countBadge_5ysac_1" }, se = ({ title: e, count: t, children: i, styles: a }) => {
|
|
173
|
+
let o = a?.typography?.titleClassName ?? "dial-small-semi-text", s = a?.typography?.countBadgeClassName ?? "dial-tiny-text", c = n({
|
|
159
174
|
"--sts-badge-bg": a?.colors?.countBadgeBackground,
|
|
160
175
|
"--sts-badge-text": a?.colors?.countBadgeText
|
|
161
176
|
});
|
|
162
|
-
return /* @__PURE__ */
|
|
177
|
+
return /* @__PURE__ */ V("section", {
|
|
163
178
|
...e ? { "aria-label": e } : {},
|
|
164
179
|
style: c,
|
|
165
180
|
className: "flex flex-col gap-3",
|
|
166
|
-
children: [e && /* @__PURE__ */
|
|
181
|
+
children: [e && /* @__PURE__ */ V("div", {
|
|
167
182
|
className: "flex items-center gap-2 rtl:flex-row-reverse",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ B("h2", {
|
|
169
184
|
className: o,
|
|
170
185
|
children: e
|
|
171
|
-
}), /* @__PURE__ */
|
|
172
|
-
className:
|
|
173
|
-
children:
|
|
186
|
+
}), /* @__PURE__ */ B("span", {
|
|
187
|
+
className: r("rounded-full px-2 py-0.5", s, oe.countBadge),
|
|
188
|
+
children: t
|
|
174
189
|
})]
|
|
175
190
|
}), i]
|
|
176
191
|
});
|
|
177
|
-
},
|
|
192
|
+
}, q = {
|
|
178
193
|
container: "_container_sac6a_1",
|
|
179
194
|
subtitle: "_subtitle_sac6a_5",
|
|
180
195
|
sortButton: "_sortButton_sac6a_9"
|
|
181
|
-
},
|
|
196
|
+
}, ce = [H.Shared, H.MyTasks], le = (e, t, n, r, i, a) => {
|
|
182
197
|
if (!e) return t ? a.loadingMoreLabel : n ? a.errorLabel : r > 0 ? `${r}` : i ? a.noResultsLabel : a.emptyStateLabel;
|
|
183
|
-
},
|
|
198
|
+
}, ue = (e) => {
|
|
184
199
|
if (!e || e === document.body) return null;
|
|
185
200
|
let { overflow: t, overflowY: n } = getComputedStyle(e);
|
|
186
|
-
return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e :
|
|
187
|
-
},
|
|
188
|
-
let { colors: M, typography: N, emptyStateIconSize: P = 48 } =
|
|
201
|
+
return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e : ue(e.parentElement);
|
|
202
|
+
}, de = ({ labels: e, onCreateClick: i, searchQuery: o, onSearchQueryChange: s, sortKey: c, onSortChange: l, items: f, isLoading: p = !1, error: m, onRetry: g, hasMore: v = !1, isLoadingMore: y = !1, skeletonCount: b = 6, onLoadMore: x, onEdit: S, onRunNow: w, onDelete: T, onCardClick: A, styles: j }) => {
|
|
203
|
+
let { colors: M, typography: N, emptyStateIconSize: P = 48 } = j ?? {}, I = N?.titleClassName ?? "dial-h1-text", L = N?.subtitleClassName ?? "dial-body-text", R = n({
|
|
189
204
|
"--st-bg": M?.background,
|
|
190
205
|
"--st-subtitle-text": M?.subtitleText,
|
|
191
206
|
"--st-sort-text": M?.sortButtonText
|
|
192
|
-
}),
|
|
193
|
-
let
|
|
194
|
-
return
|
|
195
|
-
key:
|
|
196
|
-
title: e
|
|
197
|
-
items: f.filter((
|
|
207
|
+
}), ne = e.sortOptions.find((e) => e.key === c)?.label ?? "", U = z(() => {
|
|
208
|
+
let t = { [H.Shared]: e.sharedSectionTitle };
|
|
209
|
+
return ce.map((e) => ({
|
|
210
|
+
key: e,
|
|
211
|
+
title: t[e],
|
|
212
|
+
items: f.filter((t) => t.sectionKey === e)
|
|
198
213
|
})).filter((e) => e.items.length > 0);
|
|
199
|
-
}, [f,
|
|
214
|
+
}, [f, e.sharedSectionTitle]), W = le(p, y, !!m, f.length, o.trim().length > 0, e), G = te(null);
|
|
200
215
|
ee(() => {
|
|
201
|
-
let e =
|
|
216
|
+
let e = G.current;
|
|
202
217
|
if (!e || !x) return;
|
|
203
|
-
let t =
|
|
218
|
+
let t = ue(e.parentElement);
|
|
204
219
|
if (!t) return;
|
|
205
220
|
let n = () => {
|
|
206
221
|
if (y || p || !v) return;
|
|
@@ -214,88 +229,89 @@ var R = /* @__PURE__ */ function(e) {
|
|
|
214
229
|
p,
|
|
215
230
|
x
|
|
216
231
|
]);
|
|
217
|
-
let
|
|
218
|
-
if (p) return /* @__PURE__ */
|
|
219
|
-
if (
|
|
232
|
+
let re = () => {
|
|
233
|
+
if (p) return /* @__PURE__ */ B(h, {});
|
|
234
|
+
if (m) return /* @__PURE__ */ V("div", {
|
|
220
235
|
className: "flex flex-col items-center gap-3",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
222
|
-
className:
|
|
223
|
-
children:
|
|
224
|
-
}), /* @__PURE__ */
|
|
225
|
-
label:
|
|
226
|
-
onClick:
|
|
236
|
+
children: [/* @__PURE__ */ B("p", {
|
|
237
|
+
className: r(L, q.subtitle),
|
|
238
|
+
children: e.errorLabel
|
|
239
|
+
}), /* @__PURE__ */ B(_, {
|
|
240
|
+
label: e.retryLabel,
|
|
241
|
+
onClick: g
|
|
227
242
|
})]
|
|
228
243
|
});
|
|
229
|
-
if (f.length === 0) return o.trim() ? /* @__PURE__ */
|
|
230
|
-
className:
|
|
231
|
-
children:
|
|
232
|
-
}) : /* @__PURE__ */
|
|
233
|
-
icon: /* @__PURE__ */
|
|
244
|
+
if (f.length === 0) return o.trim() ? /* @__PURE__ */ B("p", {
|
|
245
|
+
className: r(L, q.subtitle),
|
|
246
|
+
children: e.noResultsLabel
|
|
247
|
+
}) : /* @__PURE__ */ B(t, {
|
|
248
|
+
icon: /* @__PURE__ */ B(D, {
|
|
234
249
|
"aria-hidden": !0,
|
|
235
250
|
size: P,
|
|
236
251
|
stroke: 1
|
|
237
252
|
}),
|
|
238
|
-
label:
|
|
253
|
+
label: e.emptyStateLabel
|
|
239
254
|
});
|
|
240
|
-
let
|
|
241
|
-
return /* @__PURE__ */
|
|
255
|
+
let n = U.length - 1;
|
|
256
|
+
return /* @__PURE__ */ V("div", {
|
|
242
257
|
className: "flex w-full flex-col gap-6",
|
|
243
|
-
children: [
|
|
244
|
-
title:
|
|
245
|
-
count:
|
|
246
|
-
children: /* @__PURE__ */
|
|
247
|
-
items:
|
|
258
|
+
children: [U.map((t, r) => /* @__PURE__ */ B(se, {
|
|
259
|
+
title: t.title,
|
|
260
|
+
count: t.items.length,
|
|
261
|
+
children: /* @__PURE__ */ B(ae, {
|
|
262
|
+
items: t.items,
|
|
248
263
|
searchQuery: o,
|
|
249
|
-
onEdit:
|
|
250
|
-
onRunNow:
|
|
251
|
-
onDelete:
|
|
252
|
-
|
|
253
|
-
|
|
264
|
+
onEdit: S,
|
|
265
|
+
onRunNow: w,
|
|
266
|
+
onDelete: T,
|
|
267
|
+
onCardClick: A,
|
|
268
|
+
labels: e.cardLabels,
|
|
269
|
+
trailingSkeletonCount: y && r === n ? b : 0,
|
|
254
270
|
skeletonStyles: { colors: { skeletonColor: M?.skeletonColor } }
|
|
255
271
|
})
|
|
256
|
-
},
|
|
257
|
-
ref:
|
|
272
|
+
}, t.key)), /* @__PURE__ */ B("div", {
|
|
273
|
+
ref: G,
|
|
258
274
|
"aria-hidden": !0,
|
|
259
275
|
className: "h-px w-full"
|
|
260
276
|
})]
|
|
261
277
|
});
|
|
262
|
-
},
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
style:
|
|
265
|
-
className:
|
|
278
|
+
}, K = p || !!m || f.length === 0;
|
|
279
|
+
return /* @__PURE__ */ V("div", {
|
|
280
|
+
style: R,
|
|
281
|
+
className: r("flex h-full w-full flex-col gap-6 overflow-y-auto px-8 py-4", q.container),
|
|
266
282
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ V("div", {
|
|
268
284
|
className: "flex items-start justify-between gap-4",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ V("div", {
|
|
270
286
|
className: "min-w-0 gap-2",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
272
|
-
className:
|
|
273
|
-
children:
|
|
274
|
-
}), /* @__PURE__ */
|
|
275
|
-
className:
|
|
276
|
-
children:
|
|
287
|
+
children: [/* @__PURE__ */ B("h1", {
|
|
288
|
+
className: r("truncate", I),
|
|
289
|
+
children: e.title
|
|
290
|
+
}), /* @__PURE__ */ B("p", {
|
|
291
|
+
className: r("mt-1", L, q.subtitle),
|
|
292
|
+
children: e.subtitle
|
|
277
293
|
})]
|
|
278
|
-
}), /* @__PURE__ */
|
|
279
|
-
label:
|
|
280
|
-
iconBefore: /* @__PURE__ */
|
|
281
|
-
size:
|
|
294
|
+
}), /* @__PURE__ */ B(C, {
|
|
295
|
+
label: e.createButtonLabel,
|
|
296
|
+
iconBefore: /* @__PURE__ */ B(F, {
|
|
297
|
+
size: u.SM,
|
|
282
298
|
"aria-hidden": !0
|
|
283
299
|
}),
|
|
284
|
-
onClick:
|
|
300
|
+
onClick: i,
|
|
285
301
|
className: "shrink-0"
|
|
286
302
|
})]
|
|
287
303
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ V("div", {
|
|
289
305
|
className: "flex flex-wrap items-center gap-3",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
306
|
+
children: [/* @__PURE__ */ B("div", {
|
|
291
307
|
className: "flex-1",
|
|
292
|
-
children: /* @__PURE__ */
|
|
308
|
+
children: /* @__PURE__ */ B(a, {
|
|
293
309
|
value: o,
|
|
294
310
|
onChange: s,
|
|
295
311
|
labels: {
|
|
296
|
-
placeholder:
|
|
297
|
-
ariaLabel:
|
|
298
|
-
clearLabel:
|
|
312
|
+
placeholder: e.searchPlaceholder,
|
|
313
|
+
ariaLabel: e.searchAriaLabel,
|
|
314
|
+
clearLabel: e.clearSearchLabel
|
|
299
315
|
},
|
|
300
316
|
iconSize: 18,
|
|
301
317
|
iconStrokeWidth: 1.8,
|
|
@@ -305,292 +321,588 @@ var R = /* @__PURE__ */ function(e) {
|
|
|
305
321
|
clearButtonClassName: "size-11 desktop:size-auto"
|
|
306
322
|
}
|
|
307
323
|
})
|
|
308
|
-
}),
|
|
324
|
+
}), e.sortOptions.length > 0 && /* @__PURE__ */ B(d, {
|
|
309
325
|
matchReferenceWidth: !1,
|
|
310
326
|
placement: "bottom-end",
|
|
311
327
|
listClassName: "cp-dropdown-overlay",
|
|
312
|
-
items:
|
|
328
|
+
items: e.sortOptions.map((e) => ({
|
|
313
329
|
key: e.key,
|
|
314
|
-
label: /* @__PURE__ */
|
|
330
|
+
label: /* @__PURE__ */ V("span", {
|
|
315
331
|
className: "flex w-full items-center justify-between gap-2",
|
|
316
|
-
children: [e.label, e.key === c && /* @__PURE__ */
|
|
317
|
-
size:
|
|
332
|
+
children: [e.label, e.key === c && /* @__PURE__ */ B(O, {
|
|
333
|
+
size: u.SM,
|
|
318
334
|
"aria-hidden": !0
|
|
319
335
|
})]
|
|
320
336
|
}),
|
|
321
|
-
onClick: () =>
|
|
337
|
+
onClick: () => l(e.key)
|
|
322
338
|
})),
|
|
323
|
-
children: /* @__PURE__ */
|
|
324
|
-
label:
|
|
325
|
-
"aria-label":
|
|
326
|
-
className:
|
|
327
|
-
iconBefore: /* @__PURE__ */
|
|
339
|
+
children: /* @__PURE__ */ B(_, {
|
|
340
|
+
label: ne,
|
|
341
|
+
"aria-label": e.sortLabel,
|
|
342
|
+
className: r("rounded-[4px]", q.sortButton),
|
|
343
|
+
iconBefore: /* @__PURE__ */ B(E, {
|
|
328
344
|
size: 20,
|
|
329
345
|
"aria-hidden": !0
|
|
330
346
|
}),
|
|
331
|
-
iconAfter: /* @__PURE__ */
|
|
347
|
+
iconAfter: /* @__PURE__ */ B(k, {
|
|
332
348
|
size: 20,
|
|
333
349
|
"aria-hidden": !0
|
|
334
350
|
})
|
|
335
351
|
})
|
|
336
352
|
})]
|
|
337
353
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ B("span", {
|
|
339
355
|
role: "status",
|
|
340
356
|
"aria-live": "polite",
|
|
341
357
|
className: "sr-only",
|
|
342
358
|
children: W
|
|
343
359
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
className:
|
|
346
|
-
children:
|
|
360
|
+
/* @__PURE__ */ B("div", {
|
|
361
|
+
className: r("mx-auto flex size-full w-full max-w-[1180px] flex-col", K && "items-center justify-center"),
|
|
362
|
+
children: re()
|
|
347
363
|
})
|
|
348
364
|
]
|
|
349
365
|
});
|
|
350
|
-
},
|
|
366
|
+
}, fe = /* @__PURE__ */ function(e) {
|
|
351
367
|
return e.FirstToRun = "firstToRun", e.LastToRun = "lastToRun", e.Newest = "newest", e.NameAZ = "nameAZ", e;
|
|
352
|
-
}({}),
|
|
368
|
+
}({}), pe = 500, J = /* @__PURE__ */ function(e) {
|
|
353
369
|
return e.Once = "once", e.Recurring = "recurring", e;
|
|
354
|
-
}({}),
|
|
370
|
+
}({}), Y = /* @__PURE__ */ function(e) {
|
|
355
371
|
return e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e;
|
|
356
|
-
}({}),
|
|
372
|
+
}({}), X = (e) => String(e).padStart(2, "0"), me = (e) => e ? new Date(e) : null, he = (e) => {
|
|
357
373
|
if (e == null) return "";
|
|
358
374
|
let t = e instanceof Date ? e : new Date(e);
|
|
359
|
-
return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${
|
|
360
|
-
},
|
|
375
|
+
return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${X(t.getMonth() + 1)}-${X(t.getDate())}T${X(t.getHours())}:${X(t.getMinutes())}`;
|
|
376
|
+
}, ge = (e) => {
|
|
377
|
+
if (!e) return null;
|
|
378
|
+
let [t, n, r] = e.split("-").map(Number);
|
|
379
|
+
return new Date(t, n - 1, r);
|
|
380
|
+
}, _e = (e) => {
|
|
381
|
+
if (e == null) return "";
|
|
382
|
+
let t = e instanceof Date ? e : new Date(e);
|
|
383
|
+
return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${X(t.getMonth() + 1)}-${X(t.getDate())}`;
|
|
384
|
+
}, ve = (e) => {
|
|
361
385
|
let t = Number(e);
|
|
362
386
|
return e && Number.isFinite(t) ? String(t + 1) : null;
|
|
363
|
-
},
|
|
387
|
+
}, ye = (e) => {
|
|
364
388
|
let t = typeof e == "string" ? Number(e) : NaN;
|
|
365
389
|
return Number.isFinite(t) ? String(t - 1) : "";
|
|
366
|
-
},
|
|
390
|
+
}, Z = {
|
|
367
391
|
container: "_container_1wply_1",
|
|
368
392
|
header: "_header_1wply_5",
|
|
369
393
|
detailsColumn: "_detailsColumn_1wply_9",
|
|
370
394
|
sectionSubtitle: "_sectionSubtitle_1wply_13",
|
|
371
395
|
instructionsError: "_instructionsError_1wply_17"
|
|
372
|
-
},
|
|
373
|
-
let { colors:
|
|
374
|
-
"--stcf-bg":
|
|
375
|
-
"--stcf-header-border":
|
|
376
|
-
"--stcf-details-border":
|
|
377
|
-
"--stcf-subtitle-text":
|
|
378
|
-
"--stcf-error-text":
|
|
379
|
-
}), M =
|
|
380
|
-
return /* @__PURE__ */
|
|
396
|
+
}, be = (e) => `${e} *`, xe = R(async () => ({ default: (await x()).DialMarkdownEditor })), Se = ({ labels: e, values: t, errors: a, modelOptions: l, onFieldChange: d, onBack: p, onCancel: m, onSubmit: g, isSubmitting: _ = !1, markdownEditorTheme: y, styles: b }) => {
|
|
397
|
+
let { colors: x, typography: w } = b ?? {}, E = w?.titleClassName ?? "dial-h1-text", D = w?.sectionTitleClassName ?? "dial-body-semi-text", O = w?.sectionSubtitleClassName ?? "dial-tiny-text", k = w?.scheduleSectionLabelClassName ?? "dial-body-semi-text mb-1", A = w?.instructionsErrorClassName ?? "dial-small-text", j = n({
|
|
398
|
+
"--stcf-bg": x?.background,
|
|
399
|
+
"--stcf-header-border": x?.headerBorder,
|
|
400
|
+
"--stcf-details-border": x?.detailsColumnBorder,
|
|
401
|
+
"--stcf-subtitle-text": x?.sectionSubtitleText,
|
|
402
|
+
"--stcf-error-text": x?.instructionsErrorText
|
|
403
|
+
}), M = _ || !t.displayName.trim() || !t.modelId || !t.prompt.trim();
|
|
404
|
+
return /* @__PURE__ */ V("div", {
|
|
381
405
|
style: j,
|
|
382
|
-
className:
|
|
383
|
-
children: [/* @__PURE__ */
|
|
384
|
-
className:
|
|
385
|
-
children: [/* @__PURE__ */
|
|
406
|
+
className: r("flex h-full w-full flex-col overflow-y-auto", Z.container),
|
|
407
|
+
children: [/* @__PURE__ */ V("div", {
|
|
408
|
+
className: r("flex h-16 items-center justify-between gap-6 border-b px-8", Z.header),
|
|
409
|
+
children: [/* @__PURE__ */ V("div", {
|
|
386
410
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
387
|
-
children: [/* @__PURE__ */
|
|
388
|
-
icon: /* @__PURE__ */
|
|
389
|
-
size:
|
|
411
|
+
children: [/* @__PURE__ */ B(v, {
|
|
412
|
+
icon: /* @__PURE__ */ B(T, {
|
|
413
|
+
size: u.LG,
|
|
390
414
|
className: "rtl:scale-x-[-1]",
|
|
391
415
|
"aria-hidden": !0
|
|
392
416
|
}),
|
|
393
417
|
"aria-label": e.backButtonLabel,
|
|
394
418
|
onClick: p
|
|
395
|
-
}), /* @__PURE__ */
|
|
396
|
-
className:
|
|
419
|
+
}), /* @__PURE__ */ B("h1", {
|
|
420
|
+
className: r("truncate", E),
|
|
397
421
|
children: e.pageTitle
|
|
398
422
|
})]
|
|
399
|
-
}), /* @__PURE__ */
|
|
423
|
+
}), /* @__PURE__ */ V("div", {
|
|
400
424
|
className: "flex items-center gap-2",
|
|
401
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ B(S, {
|
|
402
426
|
label: e.cancelButtonLabel,
|
|
403
|
-
onClick:
|
|
404
|
-
disabled:
|
|
405
|
-
}), /* @__PURE__ */
|
|
427
|
+
onClick: m,
|
|
428
|
+
disabled: _
|
|
429
|
+
}), /* @__PURE__ */ B(C, {
|
|
406
430
|
label: e.createButtonLabel,
|
|
407
431
|
onClick: g,
|
|
408
432
|
disabled: M
|
|
409
433
|
})]
|
|
410
434
|
})]
|
|
411
|
-
}), /* @__PURE__ */
|
|
435
|
+
}), /* @__PURE__ */ V("div", {
|
|
412
436
|
className: "flex flex-1 flex-col desktop:flex-row",
|
|
413
437
|
children: [
|
|
414
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ V("div", {
|
|
415
439
|
role: "group",
|
|
416
440
|
"aria-label": e.detailsSectionTitle,
|
|
417
|
-
className:
|
|
441
|
+
className: r("flex w-full flex-col gap-5 border-e px-8 py-6 desktop:w-[360px] desktop:shrink-0", Z.detailsColumn),
|
|
418
442
|
children: [
|
|
419
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ V("div", {
|
|
420
444
|
className: "flex flex-col gap-1",
|
|
421
|
-
children: [/* @__PURE__ */
|
|
445
|
+
children: [/* @__PURE__ */ B("h2", {
|
|
422
446
|
className: D,
|
|
423
447
|
children: e.detailsSectionTitle
|
|
424
|
-
}), /* @__PURE__ */
|
|
425
|
-
className:
|
|
448
|
+
}), /* @__PURE__ */ B("p", {
|
|
449
|
+
className: r(O, Z.sectionSubtitle),
|
|
426
450
|
children: e.detailsSectionSubtitle
|
|
427
451
|
})]
|
|
428
452
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ B(i, {
|
|
430
454
|
id: "scheduled-task-display-name",
|
|
431
|
-
value:
|
|
432
|
-
onChange: (e) =>
|
|
455
|
+
value: t.displayName,
|
|
456
|
+
onChange: (e) => d("displayName", e ?? ""),
|
|
433
457
|
labelProps: {
|
|
434
458
|
label: e.displayNameLabel,
|
|
435
459
|
required: !0
|
|
436
460
|
},
|
|
437
|
-
invalid: !!
|
|
438
|
-
error:
|
|
461
|
+
invalid: !!a.displayName,
|
|
462
|
+
error: a.displayName
|
|
439
463
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ B(o, {
|
|
441
465
|
id: "scheduled-task-description",
|
|
442
|
-
value:
|
|
443
|
-
onChange: (e) =>
|
|
466
|
+
value: t.description ?? "",
|
|
467
|
+
onChange: (e) => d("description", e),
|
|
444
468
|
labelProps: { label: e.descriptionLabel },
|
|
445
469
|
maxLength: 500,
|
|
446
|
-
invalid: !!
|
|
447
|
-
error:
|
|
448
|
-
caption:
|
|
470
|
+
invalid: !!a.description,
|
|
471
|
+
error: a.description,
|
|
472
|
+
caption: t.description ? `${t.description.length}/500` : void 0
|
|
449
473
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ B(f, {
|
|
451
475
|
label: e.modelOrAgentLabel,
|
|
452
476
|
required: !0,
|
|
453
|
-
value:
|
|
477
|
+
value: t.modelId,
|
|
454
478
|
placeholder: e.modelPlaceholder,
|
|
455
|
-
onChange: (e) =>
|
|
456
|
-
error:
|
|
457
|
-
options:
|
|
479
|
+
onChange: (e) => d("modelId", e),
|
|
480
|
+
error: a.modelId,
|
|
481
|
+
options: l.map((e) => ({
|
|
458
482
|
value: e.id,
|
|
459
483
|
label: e.label
|
|
460
484
|
}))
|
|
461
485
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ V("fieldset", {
|
|
463
487
|
className: "flex flex-col gap-3",
|
|
464
488
|
children: [
|
|
465
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ B("legend", {
|
|
466
490
|
className: k,
|
|
467
491
|
children: e.scheduleSectionLabel
|
|
468
492
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ B(f, {
|
|
470
494
|
label: e.scheduleTypeAriaLabel,
|
|
471
|
-
value:
|
|
472
|
-
onChange: (e) =>
|
|
495
|
+
value: t.scheduleType,
|
|
496
|
+
onChange: (e) => d("scheduleType", e),
|
|
473
497
|
options: [{
|
|
474
|
-
value:
|
|
498
|
+
value: J.Once,
|
|
475
499
|
label: e.scheduleTypeOnceLabel
|
|
476
500
|
}, {
|
|
477
|
-
value:
|
|
501
|
+
value: J.Recurring,
|
|
478
502
|
label: e.scheduleTypeRecurringLabel
|
|
479
503
|
}]
|
|
480
504
|
}),
|
|
481
|
-
|
|
505
|
+
t.scheduleType === J.Once && /* @__PURE__ */ V("div", {
|
|
482
506
|
className: "flex flex-col gap-1",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
507
|
+
children: [/* @__PURE__ */ B(s, {
|
|
484
508
|
id: "scheduled-task-run-at",
|
|
485
|
-
mode:
|
|
486
|
-
value:
|
|
487
|
-
onChange: (e) =>
|
|
488
|
-
label:
|
|
489
|
-
invalid: !!
|
|
490
|
-
}),
|
|
491
|
-
className:
|
|
492
|
-
children:
|
|
509
|
+
mode: c.DateTime,
|
|
510
|
+
value: me(t.runAt),
|
|
511
|
+
onChange: (e) => d("runAt", he(e)),
|
|
512
|
+
label: be(e.runAtLabel),
|
|
513
|
+
invalid: !!a.runAt
|
|
514
|
+
}), a.runAt && /* @__PURE__ */ B("p", {
|
|
515
|
+
className: r(A, Z.instructionsError),
|
|
516
|
+
children: a.runAt
|
|
493
517
|
})]
|
|
494
518
|
}),
|
|
495
|
-
|
|
496
|
-
/* @__PURE__ */
|
|
519
|
+
t.scheduleType === J.Recurring && /* @__PURE__ */ V(ne, { children: [
|
|
520
|
+
/* @__PURE__ */ B(f, {
|
|
497
521
|
label: e.frequencyLabel,
|
|
498
|
-
value:
|
|
499
|
-
onChange: (e) =>
|
|
522
|
+
value: t.frequency,
|
|
523
|
+
onChange: (e) => d("frequency", e),
|
|
500
524
|
options: e.frequencyOptions.map((e) => ({
|
|
501
525
|
value: e.key,
|
|
502
526
|
label: e.label
|
|
503
527
|
}))
|
|
504
528
|
}),
|
|
505
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ V("div", {
|
|
506
530
|
className: "flex flex-col gap-1",
|
|
507
|
-
children: [/* @__PURE__ */
|
|
531
|
+
children: [/* @__PURE__ */ B(s, {
|
|
508
532
|
id: "scheduled-task-time",
|
|
509
|
-
mode:
|
|
510
|
-
value:
|
|
511
|
-
onChange: (e) =>
|
|
512
|
-
label:
|
|
513
|
-
invalid: !!
|
|
514
|
-
}),
|
|
515
|
-
className:
|
|
516
|
-
children:
|
|
533
|
+
mode: c.Time,
|
|
534
|
+
value: t.time,
|
|
535
|
+
onChange: (e) => d("time", typeof e == "string" ? e : ""),
|
|
536
|
+
label: be(e.timeLabel),
|
|
537
|
+
invalid: !!a.time
|
|
538
|
+
}), a.time && /* @__PURE__ */ B("p", {
|
|
539
|
+
className: r(A, Z.instructionsError),
|
|
540
|
+
children: a.time
|
|
517
541
|
})]
|
|
518
542
|
}),
|
|
519
|
-
|
|
543
|
+
t.frequency === Y.Weekly && /* @__PURE__ */ V("div", {
|
|
520
544
|
className: "flex flex-col gap-1",
|
|
521
|
-
children: [/* @__PURE__ */
|
|
545
|
+
children: [/* @__PURE__ */ B(s, {
|
|
522
546
|
id: "scheduled-task-day-of-week",
|
|
523
|
-
mode:
|
|
524
|
-
value:
|
|
525
|
-
onChange: (e) =>
|
|
526
|
-
label:
|
|
527
|
-
invalid: !!
|
|
528
|
-
}),
|
|
529
|
-
className:
|
|
530
|
-
children:
|
|
547
|
+
mode: c.Weekday,
|
|
548
|
+
value: ve(t.dayOfWeek),
|
|
549
|
+
onChange: (e) => d("dayOfWeek", ye(e)),
|
|
550
|
+
label: be(e.dayOfWeekLabel),
|
|
551
|
+
invalid: !!a.dayOfWeek
|
|
552
|
+
}), a.dayOfWeek && /* @__PURE__ */ B("p", {
|
|
553
|
+
className: r(A, Z.instructionsError),
|
|
554
|
+
children: a.dayOfWeek
|
|
531
555
|
})]
|
|
532
556
|
}),
|
|
533
|
-
|
|
557
|
+
t.frequency === Y.Monthly && /* @__PURE__ */ B(i, {
|
|
534
558
|
id: "scheduled-task-day-of-month",
|
|
535
|
-
value:
|
|
536
|
-
onChange: (e) =>
|
|
559
|
+
value: t.dayOfMonth ?? "",
|
|
560
|
+
onChange: (e) => d("dayOfMonth", e ?? ""),
|
|
537
561
|
labelProps: {
|
|
538
562
|
label: e.dayOfMonthLabel,
|
|
539
563
|
required: !0
|
|
540
564
|
},
|
|
541
|
-
invalid: !!
|
|
542
|
-
error:
|
|
565
|
+
invalid: !!a.dayOfMonth,
|
|
566
|
+
error: a.dayOfMonth
|
|
567
|
+
}),
|
|
568
|
+
/* @__PURE__ */ V("div", {
|
|
569
|
+
className: "flex flex-col gap-3 desktop:flex-row",
|
|
570
|
+
children: [/* @__PURE__ */ V("div", {
|
|
571
|
+
className: "flex flex-1 flex-col gap-1",
|
|
572
|
+
children: [/* @__PURE__ */ B(s, {
|
|
573
|
+
id: "scheduled-task-start-date",
|
|
574
|
+
mode: c.Date,
|
|
575
|
+
value: ge(t.startDate),
|
|
576
|
+
onChange: (e) => d("startDate", _e(e)),
|
|
577
|
+
label: e.startDateLabel,
|
|
578
|
+
placeholder: e.startDatePlaceholder,
|
|
579
|
+
invalid: !!a.startDate
|
|
580
|
+
}), a.startDate && /* @__PURE__ */ B("p", {
|
|
581
|
+
className: r(A, Z.instructionsError),
|
|
582
|
+
children: a.startDate
|
|
583
|
+
})]
|
|
584
|
+
}), /* @__PURE__ */ V("div", {
|
|
585
|
+
className: "flex flex-1 flex-col gap-1",
|
|
586
|
+
children: [/* @__PURE__ */ B(s, {
|
|
587
|
+
id: "scheduled-task-end-date",
|
|
588
|
+
mode: c.Date,
|
|
589
|
+
value: ge(t.endDate),
|
|
590
|
+
onChange: (e) => d("endDate", _e(e)),
|
|
591
|
+
label: e.endDateLabel,
|
|
592
|
+
placeholder: e.endDatePlaceholder,
|
|
593
|
+
invalid: !!a.endDate
|
|
594
|
+
}), a.endDate && /* @__PURE__ */ B("p", {
|
|
595
|
+
className: r(A, Z.instructionsError),
|
|
596
|
+
children: a.endDate
|
|
597
|
+
})]
|
|
598
|
+
})]
|
|
543
599
|
})
|
|
544
600
|
] })
|
|
545
601
|
]
|
|
546
602
|
})
|
|
547
603
|
]
|
|
548
604
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ V("div", {
|
|
550
606
|
role: "group",
|
|
551
607
|
"aria-label": e.configurationSectionTitle,
|
|
552
608
|
className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
|
|
553
|
-
children: [/* @__PURE__ */
|
|
609
|
+
children: [/* @__PURE__ */ V("div", {
|
|
554
610
|
className: "flex flex-col gap-1",
|
|
555
|
-
children: [/* @__PURE__ */
|
|
611
|
+
children: [/* @__PURE__ */ B("h2", {
|
|
556
612
|
className: D,
|
|
557
613
|
children: e.configurationSectionTitle
|
|
558
|
-
}), /* @__PURE__ */
|
|
559
|
-
className:
|
|
614
|
+
}), /* @__PURE__ */ B("p", {
|
|
615
|
+
className: r(O, Z.sectionSubtitle),
|
|
560
616
|
children: e.configurationSectionSubtitle
|
|
561
617
|
})]
|
|
562
|
-
}), /* @__PURE__ */
|
|
618
|
+
}), /* @__PURE__ */ V("div", {
|
|
563
619
|
role: "group",
|
|
564
620
|
"aria-label": e.instructionsLabel,
|
|
565
621
|
className: "flex flex-1 flex-col gap-1",
|
|
566
622
|
children: [
|
|
567
|
-
/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ B("span", {
|
|
568
624
|
className: k,
|
|
569
625
|
children: e.instructionsLabel
|
|
570
626
|
}),
|
|
571
|
-
/* @__PURE__ */
|
|
572
|
-
fallback: /* @__PURE__ */
|
|
573
|
-
children: /* @__PURE__ */
|
|
574
|
-
value:
|
|
575
|
-
onChange: (e) =>
|
|
627
|
+
/* @__PURE__ */ B(L, {
|
|
628
|
+
fallback: /* @__PURE__ */ B(h, {}),
|
|
629
|
+
children: /* @__PURE__ */ B(xe, {
|
|
630
|
+
value: t.prompt,
|
|
631
|
+
onChange: (e) => d("prompt", e),
|
|
576
632
|
height: 480,
|
|
577
633
|
theme: y
|
|
578
634
|
})
|
|
579
635
|
}),
|
|
580
|
-
|
|
581
|
-
className:
|
|
582
|
-
children:
|
|
636
|
+
a.prompt && /* @__PURE__ */ B("p", {
|
|
637
|
+
className: r(A, Z.instructionsError),
|
|
638
|
+
children: a.prompt
|
|
583
639
|
})
|
|
584
640
|
]
|
|
585
641
|
})]
|
|
586
642
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
643
|
+
/* @__PURE__ */ B("div", {
|
|
588
644
|
"aria-hidden": !0,
|
|
589
645
|
className: "hidden desktop:block desktop:w-[360px] desktop:shrink-0"
|
|
590
646
|
})
|
|
591
647
|
]
|
|
592
648
|
})]
|
|
593
649
|
});
|
|
650
|
+
}, Q = /* @__PURE__ */ function(e) {
|
|
651
|
+
return e.Success = "success", e.Error = "error", e.InProgress = "inProgress", e.Missed = "missed", e;
|
|
652
|
+
}({}), $ = {
|
|
653
|
+
container: "_container_maf1p_1",
|
|
654
|
+
header: "_header_maf1p_5",
|
|
655
|
+
detailsColumn: "_detailsColumn_maf1p_9",
|
|
656
|
+
subtitleText: "_subtitleText_maf1p_13",
|
|
657
|
+
successIcon: "_successIcon_maf1p_17",
|
|
658
|
+
errorIcon: "_errorIcon_maf1p_21",
|
|
659
|
+
missedIcon: "_missedIcon_maf1p_25",
|
|
660
|
+
historyCard: "_historyCard_maf1p_29"
|
|
661
|
+
}, Ce = (e) => {
|
|
662
|
+
if (!e || e === document.body) return null;
|
|
663
|
+
let { overflow: t, overflowY: n } = getComputedStyle(e);
|
|
664
|
+
return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e : Ce(e.parentElement);
|
|
665
|
+
}, we = ({ status: e }) => {
|
|
666
|
+
switch (e) {
|
|
667
|
+
case Q.Success: return /* @__PURE__ */ B(A, {
|
|
668
|
+
size: u.SM,
|
|
669
|
+
className: $.successIcon,
|
|
670
|
+
"aria-hidden": !0
|
|
671
|
+
});
|
|
672
|
+
case Q.Error: return /* @__PURE__ */ B(j, {
|
|
673
|
+
size: u.SM,
|
|
674
|
+
className: $.errorIcon,
|
|
675
|
+
"aria-hidden": !0
|
|
676
|
+
});
|
|
677
|
+
case Q.InProgress: return /* @__PURE__ */ B("span", {
|
|
678
|
+
"aria-hidden": !0,
|
|
679
|
+
children: /* @__PURE__ */ B(h, { size: u.SM })
|
|
680
|
+
});
|
|
681
|
+
case Q.Missed: return /* @__PURE__ */ B(w, {
|
|
682
|
+
size: u.SM,
|
|
683
|
+
className: $.missedIcon,
|
|
684
|
+
"aria-hidden": !0
|
|
685
|
+
});
|
|
686
|
+
default: return null;
|
|
687
|
+
}
|
|
688
|
+
}, Te = ({ labels: t, onBack: i, displayName: a, isLoading: o = !1, error: s, onRetry: c, description: l, modelLabel: d, repeatsLabel: f, activeWindowLabel: g, nextRunLabel: y, instructionsMarkdown: b, renderInstructions: x, runs: S, runsIsLoading: C = !1, runsIsLoadingMore: w = !1, runsSkeletonCount: E = 6, runsError: D, onRunsRetry: O, runsHasMore: k = !1, onRunsLoadMore: A, onRunClick: j, styles: M }) => {
|
|
689
|
+
let { colors: N, typography: P } = M ?? {}, F = P?.titleClassName ?? "dial-h1-text", I = P?.sectionTitleClassName ?? "dial-body-semi-text", L = P?.fieldLabelClassName ?? "dial-tiny-text", R = P?.fieldValueClassName ?? "dial-body-text", z = P?.runTimestampClassName ?? "dial-small-text", ne = n({
|
|
690
|
+
"--stdv-bg": N?.background,
|
|
691
|
+
"--stdv-header-border": N?.headerBorder,
|
|
692
|
+
"--stdv-details-border": N?.detailsColumnBorder,
|
|
693
|
+
"--stdv-subtitle-text": N?.subtitleText,
|
|
694
|
+
"--stdv-success-icon": N?.successIconColor,
|
|
695
|
+
"--stdv-error-icon": N?.errorIconColor,
|
|
696
|
+
"--stdv-missed-icon": N?.missedIconColor,
|
|
697
|
+
"--stdv-history-bg": N?.historyCardBackground
|
|
698
|
+
}), H = te(null);
|
|
699
|
+
ee(() => {
|
|
700
|
+
let e = H.current;
|
|
701
|
+
if (!e || !A) return;
|
|
702
|
+
let t = Ce(e.parentElement);
|
|
703
|
+
if (!t) return;
|
|
704
|
+
let n = () => {
|
|
705
|
+
if (w || C || !k) return;
|
|
706
|
+
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
707
|
+
r.top < n.bottom && r.bottom > n.top && A();
|
|
708
|
+
};
|
|
709
|
+
return t.addEventListener("scroll", n, { passive: !0 }), n(), () => t.removeEventListener("scroll", n);
|
|
710
|
+
}, [
|
|
711
|
+
k,
|
|
712
|
+
w,
|
|
713
|
+
C,
|
|
714
|
+
A
|
|
715
|
+
]);
|
|
716
|
+
let U = (t) => x ? x(t) : /* @__PURE__ */ B(e, { content: t }), W = (e) => {
|
|
717
|
+
let n = `${t.runStatusLabels[e.status]} ${e.timestampLabel}`, i = !!j;
|
|
718
|
+
return /* @__PURE__ */ V("li", {
|
|
719
|
+
...i ? {
|
|
720
|
+
role: "button",
|
|
721
|
+
tabIndex: 0,
|
|
722
|
+
onClick: () => j?.(e.id),
|
|
723
|
+
onKeyDown: (t) => {
|
|
724
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), j?.(e.id));
|
|
725
|
+
}
|
|
726
|
+
} : {},
|
|
727
|
+
"aria-label": n,
|
|
728
|
+
className: r("flex h-8 items-center justify-between gap-2 rounded-full pe-2 ps-5", i && "cursor-pointer"),
|
|
729
|
+
children: [/* @__PURE__ */ B("span", {
|
|
730
|
+
className: r(z, "truncate"),
|
|
731
|
+
children: e.timestampLabel
|
|
732
|
+
}), /* @__PURE__ */ B("span", {
|
|
733
|
+
className: "flex h-8 w-14 shrink-0 items-center justify-end",
|
|
734
|
+
children: /* @__PURE__ */ B(we, { status: e.status })
|
|
735
|
+
})]
|
|
736
|
+
}, e.id);
|
|
737
|
+
}, G = (e) => Array.from({ length: e }, (e, t) => /* @__PURE__ */ V("li", {
|
|
738
|
+
"aria-hidden": "true",
|
|
739
|
+
className: "flex h-8 items-center justify-between gap-2 pe-2 ps-5",
|
|
740
|
+
children: [/* @__PURE__ */ B(p, {
|
|
741
|
+
variant: m.Rectangular,
|
|
742
|
+
width: "160px",
|
|
743
|
+
height: "16px"
|
|
744
|
+
}), /* @__PURE__ */ B(p, {
|
|
745
|
+
variant: m.Rectangular,
|
|
746
|
+
width: "16px",
|
|
747
|
+
height: "16px",
|
|
748
|
+
className: "shrink-0 rounded-full"
|
|
749
|
+
})]
|
|
750
|
+
}, `history-skeleton-${t}`));
|
|
751
|
+
return /* @__PURE__ */ V("div", {
|
|
752
|
+
style: ne,
|
|
753
|
+
className: r("flex h-full w-full flex-col overflow-y-auto", $.container),
|
|
754
|
+
children: [
|
|
755
|
+
/* @__PURE__ */ V("div", {
|
|
756
|
+
className: r("flex h-16 shrink-0 items-center gap-2 border-b px-8", $.header),
|
|
757
|
+
children: [/* @__PURE__ */ B(v, {
|
|
758
|
+
icon: /* @__PURE__ */ B(T, {
|
|
759
|
+
size: u.LG,
|
|
760
|
+
className: "rtl:scale-x-[-1]",
|
|
761
|
+
"aria-hidden": !0
|
|
762
|
+
}),
|
|
763
|
+
"aria-label": t.backAriaLabel,
|
|
764
|
+
onClick: i
|
|
765
|
+
}), /* @__PURE__ */ B("h1", {
|
|
766
|
+
className: r("truncate", F),
|
|
767
|
+
children: a
|
|
768
|
+
})]
|
|
769
|
+
}),
|
|
770
|
+
o && /* @__PURE__ */ B("div", {
|
|
771
|
+
className: "flex flex-1 items-center justify-center",
|
|
772
|
+
children: /* @__PURE__ */ B(h, {})
|
|
773
|
+
}),
|
|
774
|
+
!o && s && /* @__PURE__ */ V("div", {
|
|
775
|
+
className: "flex flex-1 flex-col items-center justify-center gap-3",
|
|
776
|
+
children: [/* @__PURE__ */ B("p", {
|
|
777
|
+
className: r(R, $.subtitleText),
|
|
778
|
+
children: t.errorLabel
|
|
779
|
+
}), /* @__PURE__ */ B(_, {
|
|
780
|
+
label: t.retryLabel,
|
|
781
|
+
onClick: c
|
|
782
|
+
})]
|
|
783
|
+
}),
|
|
784
|
+
!o && !s && /* @__PURE__ */ V("div", {
|
|
785
|
+
className: "flex flex-1 flex-col desktop:flex-row",
|
|
786
|
+
children: [
|
|
787
|
+
/* @__PURE__ */ V("div", {
|
|
788
|
+
role: "group",
|
|
789
|
+
"aria-label": t.detailsTitle,
|
|
790
|
+
className: r("flex w-full flex-col gap-5 border-e px-8 py-6 desktop:w-[360px] desktop:shrink-0", $.detailsColumn),
|
|
791
|
+
children: [
|
|
792
|
+
/* @__PURE__ */ B("h2", {
|
|
793
|
+
className: I,
|
|
794
|
+
children: t.detailsTitle
|
|
795
|
+
}),
|
|
796
|
+
l && /* @__PURE__ */ V("div", {
|
|
797
|
+
className: "flex flex-col gap-1",
|
|
798
|
+
children: [/* @__PURE__ */ B("span", {
|
|
799
|
+
className: L,
|
|
800
|
+
children: t.descriptionLabel
|
|
801
|
+
}), /* @__PURE__ */ B("p", {
|
|
802
|
+
className: R,
|
|
803
|
+
children: l
|
|
804
|
+
})]
|
|
805
|
+
}),
|
|
806
|
+
d && /* @__PURE__ */ V("div", {
|
|
807
|
+
className: "flex flex-col gap-1",
|
|
808
|
+
children: [/* @__PURE__ */ B("span", {
|
|
809
|
+
className: L,
|
|
810
|
+
children: t.modelLabel
|
|
811
|
+
}), /* @__PURE__ */ B("p", {
|
|
812
|
+
className: R,
|
|
813
|
+
children: d
|
|
814
|
+
})]
|
|
815
|
+
}),
|
|
816
|
+
f && /* @__PURE__ */ V("div", {
|
|
817
|
+
className: "flex flex-col gap-1",
|
|
818
|
+
children: [/* @__PURE__ */ B("span", {
|
|
819
|
+
className: L,
|
|
820
|
+
children: t.repeatsLabel
|
|
821
|
+
}), /* @__PURE__ */ B("p", {
|
|
822
|
+
className: R,
|
|
823
|
+
children: f
|
|
824
|
+
})]
|
|
825
|
+
}),
|
|
826
|
+
g && /* @__PURE__ */ V("div", {
|
|
827
|
+
className: "flex flex-col gap-1",
|
|
828
|
+
children: [/* @__PURE__ */ B("span", {
|
|
829
|
+
className: L,
|
|
830
|
+
children: t.activeWindowLabel
|
|
831
|
+
}), /* @__PURE__ */ B("p", {
|
|
832
|
+
className: R,
|
|
833
|
+
children: g
|
|
834
|
+
})]
|
|
835
|
+
})
|
|
836
|
+
]
|
|
837
|
+
}),
|
|
838
|
+
/* @__PURE__ */ V("div", {
|
|
839
|
+
className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
|
|
840
|
+
children: [/* @__PURE__ */ B("h2", {
|
|
841
|
+
className: I,
|
|
842
|
+
children: t.configurationTitle
|
|
843
|
+
}), /* @__PURE__ */ V("div", {
|
|
844
|
+
role: "group",
|
|
845
|
+
"aria-label": t.instructionsLabel,
|
|
846
|
+
className: "flex flex-col gap-1",
|
|
847
|
+
children: [/* @__PURE__ */ B("span", {
|
|
848
|
+
className: L,
|
|
849
|
+
children: t.instructionsLabel
|
|
850
|
+
}), b && U(b)]
|
|
851
|
+
})]
|
|
852
|
+
}),
|
|
853
|
+
/* @__PURE__ */ B("div", {
|
|
854
|
+
className: "flex w-full justify-center p-6 desktop:w-auto desktop:items-start",
|
|
855
|
+
children: /* @__PURE__ */ V("div", {
|
|
856
|
+
className: r("flex w-full flex-col gap-4 overflow-y-auto rounded-xl px-6 py-5 shadow-md desktop:max-h-[70vh] desktop:w-[360px]", $.historyCard),
|
|
857
|
+
children: [
|
|
858
|
+
/* @__PURE__ */ B("h2", {
|
|
859
|
+
className: I,
|
|
860
|
+
children: t.historyTitle
|
|
861
|
+
}),
|
|
862
|
+
y && /* @__PURE__ */ B("p", {
|
|
863
|
+
className: r(z, $.subtitleText),
|
|
864
|
+
children: y
|
|
865
|
+
}),
|
|
866
|
+
t.historyLoadingMoreLabel && /* @__PURE__ */ B("span", {
|
|
867
|
+
role: "status",
|
|
868
|
+
"aria-live": "polite",
|
|
869
|
+
className: "sr-only",
|
|
870
|
+
children: w ? t.historyLoadingMoreLabel : ""
|
|
871
|
+
}),
|
|
872
|
+
C && S.length === 0 ? /* @__PURE__ */ B("ul", {
|
|
873
|
+
"aria-label": t.historyTitle,
|
|
874
|
+
children: G(E)
|
|
875
|
+
}) : D ? /* @__PURE__ */ V("div", {
|
|
876
|
+
className: "flex flex-col items-start gap-3",
|
|
877
|
+
children: [/* @__PURE__ */ B("p", {
|
|
878
|
+
className: r(R, $.subtitleText),
|
|
879
|
+
children: t.historyErrorLabel
|
|
880
|
+
}), /* @__PURE__ */ B(_, {
|
|
881
|
+
label: t.historyRetryLabel,
|
|
882
|
+
onClick: O
|
|
883
|
+
})]
|
|
884
|
+
}) : S.length === 0 ? /* @__PURE__ */ B("p", {
|
|
885
|
+
className: r(R, $.subtitleText),
|
|
886
|
+
children: t.historyEmptyLabel
|
|
887
|
+
}) : /* @__PURE__ */ V("ul", {
|
|
888
|
+
"aria-label": t.historyTitle,
|
|
889
|
+
children: [
|
|
890
|
+
S.map(W),
|
|
891
|
+
w && G(E),
|
|
892
|
+
/* @__PURE__ */ B("li", {
|
|
893
|
+
ref: H,
|
|
894
|
+
"aria-hidden": !0,
|
|
895
|
+
className: "h-px w-full"
|
|
896
|
+
})
|
|
897
|
+
]
|
|
898
|
+
})
|
|
899
|
+
]
|
|
900
|
+
})
|
|
901
|
+
})
|
|
902
|
+
]
|
|
903
|
+
})
|
|
904
|
+
]
|
|
905
|
+
});
|
|
594
906
|
};
|
|
595
907
|
//#endregion
|
|
596
|
-
export {
|
|
908
|
+
export { pe as DESCRIPTION_MAX_LENGTH, W as ScheduledTaskCard, ae as ScheduledTaskCardGrid, ie as ScheduledTaskCardSkeleton, Se as ScheduledTaskCreateForm, Te as ScheduledTaskDetailView, Y as ScheduledTaskFrequency, Q as ScheduledTaskRunStatus, J as ScheduledTaskScheduleType, se as ScheduledTaskSection, H as ScheduledTaskSectionKey, de as ScheduledTasks, fe as ScheduledTasksSortKey };
|