@epam/ai-dial-scheduled-tasks 1.1.0-dev.128 → 1.1.0-dev.130

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