@epam/ai-dial-skill-editor 1.3.0-dev.321 → 1.3.0-dev.325

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,10 +1,10 @@
1
1
  import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as t, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as n, RESIZABLE_TEXTAREA_CLASS_NAME as r, TAG_INPUT_TAG_CLASS_NAME as i, TextRefinementField as a, buildCssVars as o, formatFileSize as s, mergeClasses as c, useAvailableHeightCap as l, useControlErrorAssociation as u, useIsMobile as d, useTextRefinement as f } from "@epam/ai-dial-chat-shared";
2
- import { Accordion as p, BottomSheet as m, ButtonAppearance as h, ButtonDropdown as g, ButtonVariant as _, CaptionText as v, DIAL_ICON_SIZE as y, DIAL_KIT_ICON_STROKE as b, DangerIconButton as x, EditorThemes as S, ElementSize as C, ErrorMessageNotification as w, ErrorText as T, FileDropzone as E, FileName as D, GhostButton as O, GhostIconButton as ee, Input as k, Label as A, LinkButton as j, LiveRegion as te, LiveRegionElement as ne, LiveRegionPoliteness as re, NeutralButton as M, Popup as ie, PopupSize as ae, PrimaryButton as oe, RadioGroup as se, ResizeHandle as N, Select as ce, Spinner as le, TagInput as ue, Textarea as de, TextareaResize as fe } from "@epam/ai-dial-ui-kit";
2
+ import { Accordion as p, BottomSheet as m, Breadcrumbs as h, ButtonAppearance as g, ButtonDropdown as _, ButtonVariant as v, CaptionText as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE as x, DangerIconButton as S, DialItemType as C, EditorThemes as w, ElementSize as T, ErrorMessageNotification as E, ErrorText as D, FileDropzone as O, FileName as k, GhostButton as A, GhostIconButton as ee, Input as j, Label as te, LinkButton as ne, LiveRegion as re, LiveRegionElement as ie, LiveRegionPoliteness as M, NeutralButton as ae, NoDataContent as oe, Popup as N, PopupSize as se, PrimaryButton as ce, RadioGroup as le, ResizeHandle as ue, Select as de, Spinner as fe, TagInput as pe, Textarea as me, TextareaResize as he } from "@epam/ai-dial-ui-kit";
3
3
  import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
4
- import { IconArrowNarrowLeft as pe, IconDatabase as me, IconFileZip as he, IconFolderPlus as ge, IconPhoto as L, IconPlus as _e, IconTrashX as ve, IconUpload as ye } from "@tabler/icons-react";
5
- import { Suspense as be, lazy as xe, memo as Se, useCallback as R, useEffect as z, useId as Ce, useMemo as B, useRef as V, useState as H } from "react";
6
- import { DialFileNodeType as we, DialFoldersTree as Te } from "@epam/ai-dial-react-file-manager";
7
- import { LazyMarkdownEditor as Ee } from "@epam/ai-dial-ui-kit/editors";
4
+ import { IconArrowNarrowLeft as ge, IconDatabase as _e, IconFileZip as ve, IconFolderPlus as ye, IconPhoto as be, IconPlus as xe, IconTrashX as Se, IconUpload as Ce } from "@tabler/icons-react";
5
+ import { Suspense as we, lazy as Te, memo as Ee, useCallback as L, useEffect as De, useId as Oe, useMemo as R, useRef as z, useState as B } from "react";
6
+ import { DialFileNodeType as ke, DialFoldersTree as Ae } from "@epam/ai-dial-react-file-manager";
7
+ import { LazyMarkdownEditor as je } from "@epam/ai-dial-ui-kit/editors";
8
8
  c("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", {
9
9
  body: "_body_1xd7h_2",
10
10
  sideColumn: "_sideColumn_1xd7h_6",
@@ -12,70 +12,70 @@ c("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", {
12
12
  }.sideColumn);
13
13
  //#endregion
14
14
  //#region ../builder-form/src/constants/public-class-names.ts
15
- var U = {
15
+ var V = {
16
16
  layout: "dial-builder-form-layout",
17
17
  section: "dial-builder-form-section",
18
18
  metadataSection: "dial-builder-form-metadata-section",
19
19
  setupSection: "dial-builder-form-setup-section",
20
20
  asideSection: "dial-builder-form-aside-section"
21
- }, De = {
21
+ }, Me = {
22
22
  section: "_section_l1mnx_1",
23
23
  title: "_title_l1mnx_5"
24
- }, Oe = ({ title: e, children: t, styles: n, className: r }) => {
24
+ }, Ne = ({ title: e, children: t, styles: n, className: r }) => {
25
25
  let i = o({
26
26
  "--es-border-color": n?.colors?.borderColor,
27
27
  "--es-title-color": n?.colors?.titleColor
28
28
  });
29
29
  return /* @__PURE__ */ I("section", {
30
- className: c("flex h-full flex-col gap-4 rounded border", De.section, r, U.section),
30
+ className: c("flex h-full flex-col gap-4 rounded border", Me.section, r, V.section),
31
31
  style: i,
32
32
  children: [e != null && /* @__PURE__ */ F("h2", {
33
- className: c(n?.typography?.titleClassName ?? "dial-h3-text", De.title),
33
+ className: c(n?.typography?.titleClassName ?? "dial-h3-text", Me.title),
34
34
  children: e
35
35
  }), t]
36
36
  });
37
- }, W = (e, { min: t = 280, max: n = 640, containerWidth: r } = {}) => {
37
+ }, Pe = (e, { min: t = 280, max: n = 640, containerWidth: r } = {}) => {
38
38
  let i = r != null && r > 0 ? r - 360 : n;
39
39
  return Math.round(Math.min(Math.max(t, Math.min(n, i)), Math.max(t, Number.isFinite(e) ? e : t)));
40
- }, ke = {
40
+ }, H = {
41
41
  headerBorder: "_headerBorder_1adw2_1",
42
42
  footerBorder: "_footerBorder_1adw2_5",
43
43
  columnBorder: "_columnBorder_1adw2_10"
44
- }, Ae = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: i, centerContent: a, rightContent: s, resizableLeftColumn: l, isSaving: u = !1, labels: d, styles: f, dir: p }) => {
45
- let m = Ce(), h = u ? d?.savingStatusLabel ?? "Saving" : "", g = V(null), [_, v] = H(), x = l != null && a != null, S = l?.minWidth, C = l?.maxWidth, w = {
44
+ }, Fe = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: i, centerContent: a, rightContent: s, resizableLeftColumn: l, isSaving: u = !1, labels: d, styles: f, dir: p }) => {
45
+ let m = Oe(), h = u ? d?.savingStatusLabel ?? "Saving" : "", g = z(null), [_, v] = B(), y = l != null && a != null, S = l?.minWidth, C = l?.maxWidth, w = {
46
46
  min: S,
47
47
  max: C,
48
48
  containerWidth: _
49
- }, T = x ? W(l.width, w) : void 0, E = W(C ?? 640, w);
50
- z(() => {
49
+ }, T = y ? Pe(l.width, w) : void 0, E = Pe(C ?? 640, w);
50
+ De(() => {
51
51
  let e = g.current;
52
- if (!x || e == null || typeof ResizeObserver > "u") return;
52
+ if (!y || e == null || typeof ResizeObserver > "u") return;
53
53
  let t = new ResizeObserver(() => v(e.clientWidth));
54
54
  return t.observe(e), () => t.disconnect();
55
- }, [x]);
55
+ }, [y]);
56
56
  let D = o({
57
57
  "--el-header-border-color": f?.colors?.headerBorderColor,
58
58
  "--el-sidebar-border-color": f?.colors?.sidebarBorderColor
59
59
  });
60
60
  return /* @__PURE__ */ I("div", {
61
61
  dir: p,
62
- className: c("flex min-h-0 flex-1 flex-col", U.layout),
62
+ className: c("flex min-h-0 flex-1 flex-col", V.layout),
63
63
  style: D,
64
64
  children: [
65
- /* @__PURE__ */ F(te, {
65
+ /* @__PURE__ */ F(re, {
66
66
  visuallyHidden: !0,
67
- as: ne.Span,
67
+ as: ie.Span,
68
68
  id: m,
69
69
  children: h
70
70
  }),
71
71
  /* @__PURE__ */ I("div", {
72
- className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3", ke.headerBorder),
72
+ className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3", H.headerBorder),
73
73
  children: [/* @__PURE__ */ I("div", {
74
74
  className: "flex min-w-0 flex-1 items-center gap-2",
75
75
  children: [/* @__PURE__ */ F(ee, {
76
- icon: /* @__PURE__ */ F(pe, {
77
- size: y.LG,
78
- stroke: b,
76
+ icon: /* @__PURE__ */ F(ge, {
77
+ size: b.LG,
78
+ stroke: x,
79
79
  "aria-hidden": !0,
80
80
  className: "rtl:scale-x-[-1]"
81
81
  }),
@@ -95,13 +95,13 @@ var U = {
95
95
  className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
96
96
  children: [
97
97
  /* @__PURE__ */ F("div", {
98
- className: c(a == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", a != null && !x && "desktop:w-[400px]", x && "desktop:relative desktop:w-(--el-left-width)", "desktop:overflow-y-auto", a == null ? void 0 : ke.columnBorder),
98
+ className: c(a == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", a != null && !y && "desktop:w-[400px]", y && "desktop:relative desktop:w-(--el-left-width)", "desktop:overflow-y-auto", a == null ? void 0 : H.columnBorder),
99
99
  style: T == null ? void 0 : { "--el-left-width": `${T}px` },
100
100
  children: i
101
101
  }),
102
- x && T != null && /* @__PURE__ */ F("div", {
102
+ y && T != null && /* @__PURE__ */ F("div", {
103
103
  className: "relative hidden w-0 shrink-0 desktop:block",
104
- children: /* @__PURE__ */ F(N, {
104
+ children: /* @__PURE__ */ F(ue, {
105
105
  width: T,
106
106
  minWidth: S ?? 280,
107
107
  maxWidth: E,
@@ -116,22 +116,22 @@ var U = {
116
116
  children: a
117
117
  }),
118
118
  s != null && /* @__PURE__ */ F("div", {
119
- className: c("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", ke.columnBorder),
119
+ className: c("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", H.columnBorder),
120
120
  children: s
121
121
  })
122
122
  ]
123
123
  }),
124
124
  r != null && /* @__PURE__ */ F("div", {
125
- className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 *:flex-1 desktop:hidden", ke.footerBorder),
125
+ className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 *:flex-1 desktop:hidden", H.footerBorder),
126
126
  children: r
127
127
  })
128
128
  ]
129
129
  });
130
- }, je = {
130
+ }, Ie = {
131
131
  box: "_box_c9as8_1",
132
132
  icon: "_icon_c9as8_6",
133
133
  caption: "_caption_c9as8_10"
134
- }, G = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: i = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: a, captionClassName: s = "dial-tiny-text", styles: l, className: u }) => {
134
+ }, Le = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: i = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: a, captionClassName: s = "dial-tiny-text", styles: l, className: u }) => {
135
135
  let d = o({
136
136
  "--aa-box-bg": l?.colors?.boxBackgroundColor,
137
137
  "--aa-box-border": l?.colors?.boxBorderColor,
@@ -141,56 +141,56 @@ var U = {
141
141
  return /* @__PURE__ */ I("div", {
142
142
  className: c("flex flex-col gap-2", u),
143
143
  style: d,
144
- children: [/* @__PURE__ */ F(A, { label: e }), /* @__PURE__ */ I("div", {
144
+ children: [/* @__PURE__ */ F(te, { label: e }), /* @__PURE__ */ I("div", {
145
145
  className: "flex items-start gap-3",
146
146
  children: [/* @__PURE__ */ F("div", {
147
- className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", je.box),
147
+ className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", Ie.box),
148
148
  children: t ? /* @__PURE__ */ F("img", {
149
149
  src: t,
150
150
  alt: n,
151
151
  className: "h-16 w-16 object-cover"
152
- }) : /* @__PURE__ */ F(L, {
153
- size: y.LG,
154
- stroke: b,
152
+ }) : /* @__PURE__ */ F(be, {
153
+ size: b.LG,
154
+ stroke: x,
155
155
  "aria-hidden": !0,
156
- className: je.icon
156
+ className: Ie.icon
157
157
  })
158
158
  }), /* @__PURE__ */ I("div", {
159
159
  className: "flex flex-col gap-3",
160
- children: [/* @__PURE__ */ F(O, {
161
- size: C.Small,
162
- iconBefore: /* @__PURE__ */ F(_e, {
163
- size: y.SM,
164
- stroke: b,
160
+ children: [/* @__PURE__ */ F(A, {
161
+ size: T.Small,
162
+ iconBefore: /* @__PURE__ */ F(xe, {
163
+ size: b.SM,
164
+ stroke: x,
165
165
  "aria-hidden": !0
166
166
  }),
167
167
  className: "w-fit",
168
168
  label: r,
169
169
  onClick: a
170
170
  }), /* @__PURE__ */ F("span", {
171
- className: c(s, je.caption),
171
+ className: c(s, Ie.caption),
172
172
  children: i
173
173
  })]
174
174
  })]
175
175
  })]
176
176
  });
177
- }, Me = {
177
+ }, Re = {
178
178
  confirmText: "_confirmText_19ec1_1",
179
179
  confirmItem: "_confirmItem_19ec1_5"
180
- }, Ne = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: s, labels: l, confirmBodyClassName: u = "dial-small-text", styles: d }) => {
181
- let f = d?.colors?.confirmText, p = d?.colors?.confirmItemText, m = R((e) => e.length === 1 ? l.deleteConfirmTitleSingle : l.deleteConfirmTitleMultiple, [l.deleteConfirmTitleSingle, l.deleteConfirmTitleMultiple]), h = R((e) => /* @__PURE__ */ F("div", {
180
+ }, ze = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: s, labels: l, confirmBodyClassName: u = "dial-small-text", styles: d }) => {
181
+ let f = d?.colors?.confirmText, p = d?.colors?.confirmItemText, m = L((e) => e.length === 1 ? l.deleteConfirmTitleSingle : l.deleteConfirmTitleMultiple, [l.deleteConfirmTitleSingle, l.deleteConfirmTitleMultiple]), h = L((e) => /* @__PURE__ */ F("div", {
182
182
  className: c(u, "px-6 py-3"),
183
183
  style: o({
184
184
  "--apm-confirm-text": f,
185
185
  "--apm-confirm-item-text": p
186
186
  }),
187
187
  children: /* @__PURE__ */ F("p", {
188
- className: c("mb-3", Me.confirmText),
188
+ className: c("mb-3", Re.confirmText),
189
189
  children: e.length === 1 ? /* @__PURE__ */ I(P, { children: [
190
190
  l.deleteConfirmSingleText,
191
191
  " ",
192
192
  /* @__PURE__ */ I("span", {
193
- className: c("wrap-break-word", Me.confirmItem),
193
+ className: c("wrap-break-word", Re.confirmItem),
194
194
  children: [
195
195
  "\"",
196
196
  e[0].split("/").pop(),
@@ -201,7 +201,7 @@ var U = {
201
201
  l.deleteConfirmMultipleText,
202
202
  " ",
203
203
  /* @__PURE__ */ I("span", {
204
- className: Me.confirmItem,
204
+ className: Re.confirmItem,
205
205
  children: [
206
206
  e.length,
207
207
  " ",
@@ -218,7 +218,7 @@ var U = {
218
218
  p,
219
219
  u
220
220
  ]);
221
- return /* @__PURE__ */ F(be, {
221
+ return /* @__PURE__ */ F(we, {
222
222
  fallback: null,
223
223
  children: e && /* @__PURE__ */ F(i, {
224
224
  isOpen: e,
@@ -251,202 +251,209 @@ var U = {
251
251
  deleteCancelLabel: l.deleteCancelLabel
252
252
  })
253
253
  });
254
- }, K = /* @__PURE__ */ function(e) {
254
+ }, U = /* @__PURE__ */ function(e) {
255
255
  return e.Avatar = "avatar", e.Name = "name", e.Version = "version", e.Description = "description", e.Locales = "locales", e.Tags = "tags", e;
256
- }({}), Pe = [
256
+ }({}), Be = [
257
257
  "avatar",
258
258
  "name",
259
259
  "version",
260
260
  "description",
261
261
  "locales",
262
262
  "tags"
263
- ], Fe = {
263
+ ], Ve = {
264
264
  summary: "_summary_1hlc9_1",
265
265
  rowLabel: "_rowLabel_1hlc9_5"
266
- }, Ie = (e, t, n) => ({
266
+ }, He = (e, t, n) => ({
267
267
  id: e,
268
268
  language: n.find((e) => !t.has(e.code))?.code ?? "",
269
269
  name: "",
270
270
  description: ""
271
- }), Le = ({ value: e, onChange: t, availableLocaleOptions: n = [], labels: i, className: a, summaryClassName: s = "dial-body-text", rowLabelClassName: l = "dial-tiny-lead-text", colors: u }) => {
272
- let d = o({
273
- "--dlf-summary-text": u?.summaryText,
274
- "--dlf-row-label-text": u?.rowLabelText
275
- }), { summaryLabel: f, addLabel: p, editLabel: m, popupTitle: g, addLocaleLabel: v, localeRowLabel: S = "Locale", languageLabel: w, nameLabel: T, namePlaceholder: E, descriptionLabel: D, descriptionPlaceholder: O, deleteAriaLabel: ee, cancelLabel: A = "Cancel", saveLabel: te = "Save" } = i, [ne, re] = H(!1), [M, ae] = H([]), oe = V(0);
276
- z(() => {
277
- ne && ae(e.length > 0 ? e : [Ie(`locale-row-${++oe.current}`, /* @__PURE__ */ new Set(), n)]);
271
+ }), Ue = (e) => e.toUpperCase(), We = ({ value: e, onChange: t, availableLocaleOptions: n = [], formatLocaleLabel: i = Ue, labels: a, className: s, summaryClassName: l = "dial-body-text", rowLabelClassName: u = "dial-tiny-lead-text", colors: d }) => {
272
+ let f = o({
273
+ "--dlf-summary-text": d?.summaryText,
274
+ "--dlf-row-label-text": d?.rowLabelText
275
+ }), { summaryLabel: p, addLabel: m, editLabel: h, popupTitle: _, addLocaleLabel: y, localeRowLabel: C = "Locale", languageLabel: w, nameLabel: E, namePlaceholder: D, descriptionLabel: O, descriptionPlaceholder: k, deleteAriaLabel: A, cancelLabel: ee = "Cancel", saveLabel: te = "Save" } = a, [re, ie] = B(!1), [M, ae] = B([]), oe = z(0);
276
+ De(() => {
277
+ re && ae(e.length > 0 ? e : [He(`locale-row-${++oe.current}`, /* @__PURE__ */ new Set(), n)]);
278
278
  }, [
279
- ne,
279
+ re,
280
280
  e,
281
281
  n
282
282
  ]);
283
- let se = () => re(!0), N = () => re(!1), le = () => {
284
- t(M.filter((e) => e.language && e.name)), re(!1);
283
+ let se = () => ie(!0), ce = () => ie(!1), le = () => {
284
+ t(M.filter((e) => e.language && e.name)), ie(!1);
285
285
  }, ue = () => {
286
286
  let e = new Set(M.map((e) => e.language).filter(Boolean));
287
- ae((t) => [...t, Ie(`locale-row-${++oe.current}`, e, n)]);
288
- }, P = (e, t) => {
287
+ ae((t) => [...t, He(`locale-row-${++oe.current}`, e, n)]);
288
+ }, fe = (e, t) => {
289
289
  ae((n) => n.map((n) => n.id === e ? {
290
290
  ...n,
291
291
  ...t
292
292
  } : n));
293
293
  }, pe = (e) => {
294
294
  ae((t) => t.filter((t) => t.id !== e));
295
- }, me = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), he = M.some((e) => !e.language || !e.name);
296
- return n.length === 0 ? null : /* @__PURE__ */ I("div", {
297
- className: c("flex items-center gap-2", a),
298
- style: d,
295
+ }, P = new Set(n.map((e) => e.code)), ge = (e) => e !== "" && !P.has(e), _e = e.some((e) => ge(e.language)), ve = new Set(M.map((e) => e.language).filter((e) => P.has(e))).size, ye = (t, r) => {
296
+ let a = e.find((e) => e.id === t.id)?.language, o = [...new Set([a ?? "", t.language].filter(ge))];
297
+ return [...n.map((e) => ({
298
+ value: e.code,
299
+ label: e.label,
300
+ disabled: r.has(e.code)
301
+ })), ...o.map((e) => ({
302
+ value: e,
303
+ label: i(e),
304
+ disabled: r.has(e)
305
+ }))];
306
+ }, be = M.some((e) => !e.language || !e.name);
307
+ return n.length === 0 && !_e ? null : /* @__PURE__ */ I("div", {
308
+ className: c("flex items-center gap-2", s),
309
+ style: f,
299
310
  children: [
300
311
  e.length > 0 && /* @__PURE__ */ F("span", {
301
- className: c(Fe.summary, s),
302
- children: `${f}: ${e.map((e) => `[${me(e.language)}]`).join(", ")}`
312
+ className: c(Ve.summary, l),
313
+ children: `${p}: ${e.map((e) => `[${e.language.toUpperCase()}]`).join(", ")}`
303
314
  }),
304
- /* @__PURE__ */ F(j, {
305
- label: e.length > 0 ? m : p,
306
- iconBefore: /* @__PURE__ */ F(_e, {
307
- size: y.SM,
315
+ /* @__PURE__ */ F(ne, {
316
+ label: e.length > 0 ? h : m,
317
+ iconBefore: /* @__PURE__ */ F(xe, {
318
+ size: b.SM,
308
319
  "aria-hidden": !0,
309
- stroke: b
320
+ stroke: x
310
321
  }),
311
322
  className: "px-0!",
312
323
  onClick: se
313
324
  }),
314
- /* @__PURE__ */ F(ie, {
315
- open: ne,
316
- header: g,
317
- onClose: N,
325
+ /* @__PURE__ */ F(N, {
326
+ open: re,
327
+ header: _,
328
+ onClose: ce,
318
329
  mainButtons: [{
319
- label: A,
320
- onClick: N
330
+ label: ee,
331
+ onClick: ce
321
332
  }, {
322
333
  label: te,
323
- variant: _.Primary,
324
- disabled: he,
334
+ variant: v.Primary,
335
+ disabled: be,
325
336
  onClick: le
326
337
  }],
327
338
  children: /* @__PURE__ */ I("div", {
328
339
  className: "flex flex-col gap-8 px-6 py-3",
329
- style: d,
340
+ style: f,
330
341
  children: [M.map((e, t) => {
331
- let i = new Set(M.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
342
+ let n = new Set(M.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
332
343
  return /* @__PURE__ */ I("div", {
333
344
  className: "flex flex-col gap-2",
334
345
  children: [/* @__PURE__ */ I("div", {
335
346
  className: "flex items-center justify-between",
336
347
  children: [/* @__PURE__ */ I("span", {
337
- className: c(Fe.rowLabel, l),
348
+ className: c(Ve.rowLabel, u),
338
349
  children: [
339
- S,
350
+ C,
340
351
  " ",
341
352
  t + 1
342
353
  ]
343
- }), /* @__PURE__ */ F(x, {
344
- appearance: h.Ghost,
345
- size: C.Small,
346
- icon: /* @__PURE__ */ F(ve, {
347
- size: y.SM,
354
+ }), /* @__PURE__ */ F(S, {
355
+ appearance: g.Ghost,
356
+ size: T.Small,
357
+ icon: /* @__PURE__ */ F(Se, {
358
+ size: b.SM,
348
359
  "aria-hidden": !0,
349
- stroke: b
360
+ stroke: x
350
361
  }),
351
- "aria-label": `${ee} ${t + 1}`,
362
+ "aria-label": `${A} ${t + 1}`,
352
363
  onClick: () => pe(e.id)
353
364
  })]
354
365
  }), /* @__PURE__ */ I("div", {
355
366
  role: "group",
356
- "aria-label": `${S} ${t + 1}`,
367
+ "aria-label": `${C} ${t + 1}`,
357
368
  className: "flex flex-col gap-5",
358
369
  children: [/* @__PURE__ */ I("div", {
359
370
  className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
360
- children: [/* @__PURE__ */ F(ce, {
371
+ children: [/* @__PURE__ */ F(de, {
361
372
  id: `${e.id}-language`,
362
373
  labelProps: {
363
374
  label: w,
364
375
  required: !0
365
376
  },
366
377
  className: "desktop:shrink-0 desktop:basis-40",
367
- options: n.map((e) => ({
368
- value: e.code,
369
- label: e.label,
370
- disabled: i.has(e.code)
371
- })),
378
+ options: ye(e, n),
372
379
  value: e.language,
373
- onChange: (t) => P(e.id, { language: t })
374
- }), /* @__PURE__ */ F(k, {
380
+ onChange: (t) => fe(e.id, { language: t })
381
+ }), /* @__PURE__ */ F(j, {
375
382
  id: `${e.id}-name`,
376
383
  containerClassName: "min-w-0 flex-1",
377
384
  required: !0,
378
385
  value: e.name,
379
- onChange: (t) => P(e.id, { name: t ?? "" }),
386
+ onChange: (t) => fe(e.id, { name: t ?? "" }),
380
387
  labelProps: {
381
- label: T,
388
+ label: E,
382
389
  required: !0
383
390
  },
384
- placeholder: E
391
+ placeholder: D
385
392
  })]
386
- }), /* @__PURE__ */ F(de, {
393
+ }), /* @__PURE__ */ F(me, {
387
394
  id: `${e.id}-description`,
388
395
  className: r,
389
- resize: fe.Vertical,
396
+ resize: he.Vertical,
390
397
  value: e.description,
391
- onChange: (t) => P(e.id, { description: t }),
392
- labelProps: { label: D },
393
- placeholder: O
398
+ onChange: (t) => fe(e.id, { description: t }),
399
+ labelProps: { label: O },
400
+ placeholder: k
394
401
  })]
395
402
  })]
396
403
  }, e.id);
397
- }), /* @__PURE__ */ F(j, {
398
- label: v,
399
- iconBefore: /* @__PURE__ */ F(_e, {
400
- size: y.SM,
404
+ }), /* @__PURE__ */ F(ne, {
405
+ label: y,
406
+ iconBefore: /* @__PURE__ */ F(xe, {
407
+ size: b.SM,
401
408
  "aria-hidden": !0,
402
- stroke: b
409
+ stroke: x
403
410
  }),
404
411
  className: "self-start",
405
412
  onClick: ue,
406
- disabled: M.length >= n.length
413
+ disabled: ve >= n.length
407
414
  })]
408
415
  })
409
416
  })
410
417
  ]
411
418
  });
412
- }, Re = "Add tags, comma separated", ze = "deployment-creation-form-description", Be = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = Pe, isNameReadOnly: m = !1, nameReadOnlyTooltip: h, nameCaption: g, isDescriptionRequired: _ = !1, descriptionCaption: v, renderDescription: y, focusRequestKey: b }) => {
413
- let x = V(null), S = V(null), C = V(null), w = V(!1), T = (e) => p.includes(e), E = T(K.Name), D = T(K.Version), O = !!(t.name || t.version || t.description), ee = V(b);
414
- z(() => {
419
+ }, Ge = "Add tags, comma separated", Ke = "deployment-creation-form-description", qe = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], formatLocaleLabel: p, fields: m = Be, isNameReadOnly: h = !1, nameReadOnlyTooltip: g, nameCaption: _, isDescriptionRequired: v = !1, descriptionCaption: y, renderDescription: b, focusRequestKey: x }) => {
420
+ let S = z(null), C = z(null), w = z(null), T = z(!1), E = (e) => m.includes(e), D = E(U.Name), O = E(U.Version), k = !!(t.name || t.version || t.description), A = z(x);
421
+ De(() => {
415
422
  let e = () => {
416
- t.name ? x.current?.focus() : t.version ? S.current?.focus() : t.description && C.current?.focus();
423
+ t.name ? S.current?.focus() : t.version ? C.current?.focus() : t.description && w.current?.focus();
417
424
  };
418
- b === void 0 ? (O && !w.current && e(), w.current = O) : b !== ee.current && (ee.current = b, e());
425
+ x === void 0 ? (k && !T.current && e(), T.current = k) : x !== A.current && (A.current = x, e());
419
426
  }, [
420
- b,
421
- O,
427
+ x,
428
+ k,
422
429
  t.name,
423
430
  t.version,
424
431
  t.description
425
432
  ]);
426
- let A = /* @__PURE__ */ F(de, {
427
- id: ze,
428
- ref: C,
433
+ let ee = /* @__PURE__ */ F(me, {
434
+ id: Ke,
435
+ ref: w,
429
436
  value: e.description,
430
437
  onChange: (e) => n({ description: e }),
431
- "aria-required": _ || void 0,
432
- labelProps: y ? void 0 : {
438
+ "aria-required": v || void 0,
439
+ labelProps: b ? void 0 : {
433
440
  label: u.description.label,
434
- required: _
441
+ required: v
435
442
  },
436
443
  placeholder: u.description.placeholder,
437
- caption: v,
444
+ caption: y,
438
445
  error: t.description || void 0,
439
446
  invalid: !!t.description,
440
- containerClassName: y ? void 0 : d?.field,
447
+ containerClassName: b ? void 0 : d?.field,
441
448
  className: r,
442
- resize: fe.Vertical
449
+ resize: he.Vertical
443
450
  });
444
451
  return /* @__PURE__ */ I("div", {
445
452
  role: u.ariaLabel ? "group" : void 0,
446
453
  "aria-label": u.ariaLabel,
447
454
  className: c("flex flex-col gap-4", d?.root),
448
455
  children: [
449
- T(K.Avatar) && /* @__PURE__ */ F(G, {
456
+ E(U.Avatar) && /* @__PURE__ */ F(Le, {
450
457
  label: u.iconUrl.label,
451
458
  avatarUrl: s,
452
459
  addAvatarLabel: u.iconUrl.addAvatarLabel,
@@ -454,28 +461,28 @@ var U = {
454
461
  onAddAvatarClick: l,
455
462
  className: d?.field
456
463
  }),
457
- (E || D) && /* @__PURE__ */ I("div", {
464
+ (D || O) && /* @__PURE__ */ I("div", {
458
465
  className: c("flex items-start gap-4", d?.field),
459
- children: [E && /* @__PURE__ */ F(k, {
466
+ children: [D && /* @__PURE__ */ F(j, {
460
467
  id: "deployment-creation-form-name",
461
- inputRef: x,
468
+ inputRef: S,
462
469
  value: e.name,
463
470
  onChange: (e) => n({ name: e ?? "" }),
464
471
  onBlur: a,
465
- disabled: m,
466
- tooltipText: m ? h : void 0,
472
+ disabled: h,
473
+ tooltipText: h ? g : void 0,
467
474
  labelProps: {
468
475
  label: u.name.label,
469
476
  required: !0
470
477
  },
471
478
  placeholder: u.name.placeholder,
472
- caption: g,
479
+ caption: _,
473
480
  error: t.name || void 0,
474
481
  invalid: !!t.name,
475
- containerClassName: D ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
476
- }), D && /* @__PURE__ */ F(k, {
482
+ containerClassName: O ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
483
+ }), O && /* @__PURE__ */ F(j, {
477
484
  id: "deployment-creation-form-version",
478
- inputRef: S,
485
+ inputRef: C,
479
486
  value: e.version,
480
487
  onChange: (e) => n({ version: e ?? "" }),
481
488
  onBlur: o,
@@ -483,27 +490,28 @@ var U = {
483
490
  placeholder: u.version.placeholder,
484
491
  error: t.version || void 0,
485
492
  invalid: !!t.version,
486
- containerClassName: E ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
493
+ containerClassName: D ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
487
494
  })]
488
495
  }),
489
- T(K.Description) && (y ? /* @__PURE__ */ F("div", {
496
+ E(U.Description) && (b ? /* @__PURE__ */ F("div", {
490
497
  className: d?.field,
491
- children: y(A, ze)
492
- }) : A),
493
- T(K.Locales) && /* @__PURE__ */ F(Le, {
498
+ children: b(ee, Ke)
499
+ }) : ee),
500
+ E(U.Locales) && /* @__PURE__ */ F(We, {
494
501
  value: e.otherLocales,
495
502
  onChange: (e) => n({ otherLocales: e }),
496
503
  availableLocaleOptions: f,
504
+ formatLocaleLabel: p,
497
505
  labels: u.otherLocales,
498
506
  className: d?.field,
499
507
  colors: d?.localesColors
500
508
  }),
501
- T(K.Tags) && /* @__PURE__ */ F("div", {
509
+ E(U.Tags) && /* @__PURE__ */ F("div", {
502
510
  className: d?.field,
503
- children: /* @__PURE__ */ F(ue, {
511
+ children: /* @__PURE__ */ F(pe, {
504
512
  id: "deployment-creation-form-topics",
505
513
  labelProps: { label: u.topics.label },
506
- placeholder: u.topics.placeholder ?? Re,
514
+ placeholder: u.topics.placeholder ?? Ge,
507
515
  value: e.topics,
508
516
  onChange: (e) => n({ topics: e }),
509
517
  tagClassName: i
@@ -511,13 +519,13 @@ var U = {
511
519
  })
512
520
  ]
513
521
  });
514
- }, Ve = "border-0 p-4 desktop:p-8", He = "border-0", Ue = "desktop:flex-1", We = "px-4 pt-4 desktop:px-6 desktop:pt-6", Ge = Se(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: s, hideStandardActions: l = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, asideData: h, asideTitle: g, asideSectionClassName: _, alert: v, resizableLeftColumn: y, metadataSectionClassName: b, setupSectionClassName: x, hasSetupSectionPadding: S = !0, labels: C, styles: w, dir: T }) => {
515
- let E = /* @__PURE__ */ F(te, {
516
- politeness: re.Assertive,
517
- className: v == null ? void 0 : We,
522
+ }, Je = "border-0 p-4 desktop:p-8", Ye = "border-0", Xe = "desktop:flex-1", Ze = "px-4 pt-4 desktop:px-6 desktop:pt-6", Qe = Ee(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: s, hideStandardActions: l = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, asideData: h, asideTitle: g, asideSectionClassName: _, alert: v, resizableLeftColumn: y, metadataSectionClassName: b, setupSectionClassName: x, hasSetupSectionPadding: S = !0, labels: C, styles: w, dir: T }) => {
523
+ let E = /* @__PURE__ */ F(re, {
524
+ politeness: M.Assertive,
525
+ className: v == null ? void 0 : Ze,
518
526
  children: v
519
527
  }), D = p != null;
520
- return /* @__PURE__ */ F(Ae, {
528
+ return /* @__PURE__ */ F(Fe, {
521
529
  title: e,
522
530
  onBack: t,
523
531
  backAriaLabel: C?.backAriaLabel ?? "Back",
@@ -528,41 +536,41 @@ var U = {
528
536
  resizeHandleLabel: C?.resizeHandleLabel,
529
537
  resizeHandleTooltip: C?.resizeHandleTooltip
530
538
  },
531
- rightContent: h == null ? void 0 : /* @__PURE__ */ F(Oe, {
539
+ rightContent: h == null ? void 0 : /* @__PURE__ */ F(Ne, {
532
540
  title: g,
533
541
  styles: w?.section,
534
- className: c(Ve, _, U.asideSection),
542
+ className: c(Je, _, V.asideSection),
535
543
  children: h
536
544
  }),
537
545
  styles: w?.layout,
538
546
  dir: T,
539
- actions: /* @__PURE__ */ I(P, { children: [s, !l && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(M, {
547
+ actions: /* @__PURE__ */ I(P, { children: [s, !l && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(ae, {
540
548
  label: C?.cancelLabel ?? "Cancel",
541
549
  disabled: a,
542
550
  onClick: n
543
- }), /* @__PURE__ */ F(oe, {
551
+ }), /* @__PURE__ */ F(ce, {
544
552
  label: i,
545
553
  disabled: a || o,
546
554
  onClick: r
547
555
  })] })] }),
548
556
  leftContent: /* @__PURE__ */ I(P, { children: [
549
557
  !D && E,
550
- /* @__PURE__ */ F(Oe, {
558
+ /* @__PURE__ */ F(Ne, {
551
559
  title: d === null ? void 0 : d ?? C?.metadataTitle ?? "Metadata",
552
560
  styles: w?.section,
553
- className: c(Ve, b, U.metadataSection),
561
+ className: c(Je, b, V.metadataSection),
554
562
  children: u
555
563
  }),
556
564
  f
557
565
  ] }),
558
- centerContent: D ? /* @__PURE__ */ I(P, { children: [E, /* @__PURE__ */ F(Oe, {
566
+ centerContent: D ? /* @__PURE__ */ I(P, { children: [E, /* @__PURE__ */ F(Ne, {
559
567
  title: m === null ? void 0 : m ?? C?.setupTitle ?? "Setup",
560
568
  styles: w?.section,
561
- className: c(S ? Ve : He, Ue, x, U.setupSection),
569
+ className: c(S ? Je : Ye, Xe, x, V.setupSection),
562
570
  children: p
563
571
  })] }) : void 0
564
572
  });
565
- }), Ke = {
573
+ }), $e = {
566
574
  name: {
567
575
  label: "Name",
568
576
  placeholder: "Enter name"
@@ -601,7 +609,7 @@ var U = {
601
609
  saveLabel: "Save"
602
610
  },
603
611
  ariaLabel: "Metadata"
604
- }, qe = {
612
+ }, et = {
605
613
  title: "Add avatar",
606
614
  attachLabel: "Attach",
607
615
  emptyTitle: "This folder is empty",
@@ -625,82 +633,83 @@ var U = {
625
633
  deleteConfirmItemsLabel: "items?",
626
634
  deleteConfirmLabel: "Delete",
627
635
  deleteCancelLabel: "Cancel"
628
- }, Je = Se(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Pe, isNameReadOnly: c, nameReadOnlyTooltip: l, nameCaption: u, isDescriptionRequired: d, descriptionCaption: f, renderDescription: p, focusRequestKey: m, labels: h }) => {
629
- let [g, _] = H(!1), v = B(() => a ? s : s.filter((e) => e !== K.Avatar), [a, s]), y = e.iconUrl, b = a?.resolveIconUrl, x = B(() => b ? b(y) : void 0, [y, b]), S = R(() => _(!0), []), C = R(() => _(!1), []), w = a?.resolveAttachedIconUrl, T = R((e) => {
630
- let t = w?.(e);
631
- t && n({ iconUrl: t }), _(!1);
632
- }, [n, w]);
633
- return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Be, {
636
+ }, tt = Ee(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, formatLocaleLabel: s, fields: c = Be, isNameReadOnly: l, nameReadOnlyTooltip: u, nameCaption: d, isDescriptionRequired: f, descriptionCaption: p, renderDescription: m, focusRequestKey: h, labels: g }) => {
637
+ let [_, v] = B(!1), y = R(() => a ? c : c.filter((e) => e !== U.Avatar), [a, c]), b = e.iconUrl, x = a?.resolveIconUrl, S = R(() => x ? x(b) : void 0, [b, x]), C = L(() => v(!0), []), w = L(() => v(!1), []), T = a?.resolveAttachedIconUrl, E = L((e) => {
638
+ let t = T?.(e);
639
+ t && n({ iconUrl: t }), v(!1);
640
+ }, [n, T]);
641
+ return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(qe, {
634
642
  values: e,
635
643
  errors: t,
636
644
  onChange: n,
637
645
  onNameBlur: r,
638
646
  onVersionBlur: i,
639
- iconPreviewUrl: x,
640
- onAddAvatarClick: S,
641
- labels: h?.form ?? Ke,
647
+ iconPreviewUrl: S,
648
+ onAddAvatarClick: C,
649
+ labels: g?.form ?? $e,
642
650
  availableLocaleOptions: o,
643
- fields: v,
644
- isNameReadOnly: c,
645
- nameReadOnlyTooltip: l,
646
- nameCaption: u,
647
- isDescriptionRequired: d,
648
- descriptionCaption: f,
649
- renderDescription: p,
650
- focusRequestKey: m
651
- }), a && /* @__PURE__ */ F(Ne, {
652
- isOpen: g,
653
- onClose: C,
654
- onAttach: T,
651
+ formatLocaleLabel: s,
652
+ fields: y,
653
+ isNameReadOnly: l,
654
+ nameReadOnlyTooltip: u,
655
+ nameCaption: d,
656
+ isDescriptionRequired: f,
657
+ descriptionCaption: p,
658
+ renderDescription: m,
659
+ focusRequestKey: h
660
+ }), a && /* @__PURE__ */ F(ze, {
661
+ isOpen: _,
662
+ onClose: w,
663
+ onAttach: E,
655
664
  bucket: a.bucket,
656
665
  FileManagerModal: a.FileManagerModal,
657
666
  allowedMimeTypes: a.allowedMimeTypes,
658
667
  maxFileSizeBytes: a.maxFileSizeBytes,
659
- labels: h?.avatarPicker ?? qe
668
+ labels: g?.avatarPicker ?? et
660
669
  })] });
661
- }), Ye = /* @__PURE__ */ function(e) {
670
+ }), nt = /* @__PURE__ */ function(e) {
662
671
  return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
663
672
  }({});
664
- Ye.TooLong, Ye.ControlCharacters;
673
+ nt.TooLong, nt.ControlCharacters;
665
674
  //#endregion
666
675
  //#region src/constants/public-class-names.ts
667
- var Xe = {
676
+ var rt = {
668
677
  root: "dial-skill-editor-root",
669
678
  refineFeedback: "dial-skill-editor-refine-feedback"
670
- }, Ze = "SKILL.md", Qe = /* @__PURE__ */ function(e) {
679
+ }, W = "SKILL.md", G = /* @__PURE__ */ function(e) {
671
680
  return e.File = "file", e.Folder = "folder", e;
672
- }({}), $e = /* @__PURE__ */ function(e) {
681
+ }({}), it = /* @__PURE__ */ function(e) {
673
682
  return e.Header = "header", e.Child = "child", e;
674
- }({}), et = (e) => {
683
+ }({}), K = (e) => {
675
684
  let t = e.lastIndexOf("/");
676
685
  return t === -1 ? null : e.slice(0, t);
677
- }, tt = (e) => {
686
+ }, q = (e) => {
678
687
  let t = e.lastIndexOf("/");
679
688
  return t === -1 ? e : e.slice(t + 1);
680
- }, nt = (e) => {
689
+ }, at = (e) => {
681
690
  let t = /* @__PURE__ */ new Map(), n = (e) => {
682
691
  let n = t.get(e);
683
692
  if (n) return n;
684
693
  let r = {
685
694
  path: e,
686
- name: tt(e),
687
- nodeType: we.FOLDER,
688
- parentPath: et(e),
695
+ name: q(e),
696
+ nodeType: ke.FOLDER,
697
+ parentPath: K(e),
689
698
  folderId: e,
690
699
  items: []
691
700
  };
692
701
  return t.set(e, r), r;
693
702
  };
694
- for (let r of e) r.kind === Qe.Folder ? n(r.path).name = r.name : t.set(r.path, {
703
+ for (let r of e) r.kind === G.Folder ? n(r.path).name = r.name : t.set(r.path, {
695
704
  path: r.path,
696
705
  name: r.name,
697
- nodeType: we.ITEM,
698
- parentPath: et(r.path),
699
- folderId: et(r.path) ?? ""
706
+ nodeType: ke.ITEM,
707
+ parentPath: K(r.path),
708
+ folderId: K(r.path) ?? ""
700
709
  });
701
710
  for (let t of [...e]) {
702
- let e = et(t.path);
703
- for (; e != null;) n(e), e = et(e);
711
+ let e = K(t.path);
712
+ for (; e != null;) n(e), e = K(e);
704
713
  }
705
714
  let r = [];
706
715
  for (let e of t.values()) {
@@ -712,47 +721,61 @@ var Xe = {
712
721
  n ? n.items = [...n.items ?? [], e] : r.push(e);
713
722
  }
714
723
  return r;
715
- }, rt = (e, t) => e ? `${e}/${t}` : t, it = (e, t) => {
716
- let n = e.lastIndexOf("/"), r = n === -1 ? "" : e.slice(0, n), i = e.slice(n + 1), a = i.lastIndexOf("."), o = a > 0, s = o ? i.slice(0, a) : i, c = o ? i.slice(a) : "", l = 1, u = rt(r, `${s} (${l})${c}`);
717
- for (; t.has(u);) l += 1, u = rt(r, `${s} (${l})${c}`);
724
+ }, ot = (e, t) => e ? `${e}/${t}` : t, st = (e, t) => {
725
+ let n = e.lastIndexOf("/"), r = n === -1 ? "" : e.slice(0, n), i = e.slice(n + 1), a = i.lastIndexOf("."), o = a > 0, s = o ? i.slice(0, a) : i, c = o ? i.slice(a) : "", l = 1, u = ot(r, `${s} (${l})${c}`);
726
+ for (; t.has(u);) l += 1, u = ot(r, `${s} (${l})${c}`);
718
727
  return u;
719
- }, at = (e, t) => {
728
+ }, ct = (e, t) => {
720
729
  if (!t) return "";
721
730
  switch (e) {
722
- case $e.Child: return t.path;
723
- case $e.Header: return t.kind === Qe.Folder ? t.path : "";
724
- }
725
- }, q = (e, t) => {
726
- let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
727
- for (let { path: i } of e) {
728
- if (!i.startsWith(n) || i === t) continue;
729
- let e = i.slice(n.length);
730
- r.add(e.split("/")[0]);
731
+ case it.Child: return t.path;
732
+ case it.Header: return t.kind === G.Folder ? t.path : "";
731
733
  }
732
- return r;
733
- }, ot = (e, t, n) => {
734
+ }, lt = (e, t) => new Set(dt(e, t).map((e) => e.name)), ut = (e, t, n) => {
734
735
  let r = e.trim();
735
736
  if (!r) return n.required;
736
737
  if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
737
738
  if (t.has(r)) return n.duplicate;
738
- }, st = "\\new-folder", ct = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
739
- let [o, s] = H(null), c = o?.parentPath ?? null, l = V([]), u = c == null ? void 0 : rt(c, st), d = B(() => u == null ? void 0 : {
739
+ }, dt = (e, t) => {
740
+ let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
741
+ for (let a of e) {
742
+ if (!a.path.startsWith(n) || a.path === t) continue;
743
+ let e = a.path.slice(n.length), o = e.indexOf("/"), s = o === -1, c = s ? e : e.slice(0, o), l = `${n}${c}`, u = s && a.kind === G.File ? G.File : G.Folder;
744
+ if (r.has(l) || r.set(l, {
745
+ path: l,
746
+ name: c,
747
+ kind: u,
748
+ childCount: 0
749
+ }), !s) {
750
+ let t = o + 1, n = e.indexOf("/", t), r = e.slice(t, n === -1 ? void 0 : n);
751
+ i.set(l, (i.get(l) ?? /* @__PURE__ */ new Set()).add(r));
752
+ }
753
+ }
754
+ return [...r.values()].map((e) => ({
755
+ ...e,
756
+ childCount: i.get(e.path)?.size ?? 0
757
+ })).sort((e, t) => e.kind === t.kind ? e.name.localeCompare(t.name) : e.kind === G.Folder ? -1 : 1);
758
+ }, ft = (e) => {
759
+ let t = e.split("/").slice(0, -1);
760
+ return t.map((e, n) => t.slice(0, n + 1).join("/"));
761
+ }, pt = "\\new-folder", mt = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
762
+ let [o, s] = B(null), c = o?.parentPath ?? null, l = z([]), u = c == null ? void 0 : ot(c, pt), d = R(() => u == null ? void 0 : {
740
763
  path: u,
741
764
  name: n,
742
- kind: Qe.Folder
743
- }, [u, n]), f = R((n, i) => {
744
- let a = q(e, i);
745
- return i === "" && a.add(Ze), ot(n, a, r) ?? t.validateFolderPath?.(rt(i, n.trim()));
765
+ kind: G.Folder
766
+ }, [u, n]), f = L((n, i) => {
767
+ let a = lt(e, i);
768
+ return i === "" && a.add(W), ut(n, a, r) ?? t.validateFolderPath?.(ot(i, n.trim()));
746
769
  }, [
747
770
  e,
748
771
  r,
749
772
  t
750
- ]), p = R((e, t) => {
773
+ ]), p = L((e, t) => {
751
774
  l.current = [], s({
752
775
  parentPath: e,
753
776
  pane: t
754
777
  }), e !== "" && i(e);
755
- }, [i]), m = R((e, t) => {
778
+ }, [i]), m = L((e, t) => {
756
779
  if (c == null || t.path !== u) return null;
757
780
  let n = f(e, c);
758
781
  return l.current = [...l.current.slice(-1), {
@@ -763,16 +786,16 @@ var Xe = {
763
786
  c,
764
787
  u,
765
788
  f
766
- ]), h = R(() => {
789
+ ]), h = L(() => {
767
790
  l.current = [], s(null);
768
- }, []), g = R((e, n) => {
769
- let r = rt(n, e.trim());
791
+ }, []), g = L((e, n) => {
792
+ let r = ot(n, e.trim());
770
793
  t.onCreateFolder?.(r), n !== "" && i(n), a(r);
771
794
  }, [
772
795
  t,
773
796
  i,
774
797
  a
775
- ]), _ = R((e) => {
798
+ ]), _ = L((e) => {
776
799
  if (c == null) return;
777
800
  let [t] = l.current;
778
801
  l.current.length === 2 && t != null && !t.isValid && t.value !== e || f(e, c) != null ? h() : (h(), g(e, c));
@@ -793,47 +816,47 @@ var Xe = {
793
816
  validateNewFolder: f,
794
817
  createFolder: g
795
818
  };
796
- }, lt = (e) => !!e.dataTransfer?.types.includes("Files"), ut = (e) => {
797
- let [t, n] = H(!1), r = V(0);
819
+ }, ht = (e) => !!e.dataTransfer?.types.includes("Files"), gt = (e) => {
820
+ let [t, n] = B(!1), r = z(0);
798
821
  return {
799
822
  isDragActive: t,
800
823
  dropZoneHandlers: {
801
- onDragEnter: R((e) => {
802
- lt(e) && (e.preventDefault(), r.current += 1, n(!0));
824
+ onDragEnter: L((e) => {
825
+ ht(e) && (e.preventDefault(), r.current += 1, n(!0));
803
826
  }, []),
804
- onDragLeave: R((e) => {
805
- lt(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
827
+ onDragLeave: L((e) => {
828
+ ht(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
806
829
  }, []),
807
- onDragOver: R((e) => {
808
- lt(e) && e.preventDefault();
830
+ onDragOver: L((e) => {
831
+ ht(e) && e.preventDefault();
809
832
  }, []),
810
- onDrop: R((t) => {
811
- if (!lt(t)) return;
833
+ onDrop: L((t) => {
834
+ if (!ht(t)) return;
812
835
  t.preventDefault(), r.current = 0, n(!1);
813
836
  let i = Array.from(t.dataTransfer?.files ?? []);
814
837
  i.length > 0 && e(i);
815
838
  }, [e])
816
839
  }
817
840
  };
818
- }, dt = /* @__PURE__ */ function(e) {
841
+ }, _t = /* @__PURE__ */ function(e) {
819
842
  return e.Files = "files", e.Archive = "archive", e;
820
843
  }({}), J = /* @__PURE__ */ function(e) {
821
844
  return e.Mobile = "mobile", e.Desktop = "desktop", e;
822
- }({}), ft = (e, t, n = y.MD, r) => /* @__PURE__ */ F(e, {
845
+ }({}), vt = (e, t, n = b.MD, r) => /* @__PURE__ */ F(e, {
823
846
  size: n,
824
847
  className: t,
825
848
  style: r,
826
849
  "aria-hidden": !0,
827
- stroke: b
828
- }), pt = { footer: "_footer_hn1ri_7" }, mt = ({ isOpen: e, title: t, closeAriaLabel: n, onClose: r, confirmLabel: i, onConfirm: a, cancelLabel: s, onCancel: l, isConfirmDisabled: u = !1, isConfirming: f = !1, children: p, colors: g }) => {
829
- let v = d(), y = f ? /* @__PURE__ */ F(le, {
850
+ stroke: x
851
+ }), yt = { footer: "_footer_hn1ri_7" }, bt = ({ isOpen: e, title: t, closeAriaLabel: n, onClose: r, confirmLabel: i, onConfirm: a, cancelLabel: s, onCancel: l, isConfirmDisabled: u = !1, isConfirming: f = !1, children: p, colors: h }) => {
852
+ let _ = d(), y = f ? /* @__PURE__ */ F(fe, {
830
853
  size: 16,
831
854
  ariaLabel: ""
832
855
  }) : void 0;
833
- if (v) {
856
+ if (_) {
834
857
  let d = o({
835
- "--se-dialog-footer-bg": g?.footerBackground,
836
- "--se-dialog-footer-border": g?.footerBorder
858
+ "--se-dialog-footer-bg": h?.footerBackground,
859
+ "--se-dialog-footer-border": h?.footerBorder
837
860
  });
838
861
  return /* @__PURE__ */ I(m, {
839
862
  open: e,
@@ -841,15 +864,15 @@ var Xe = {
841
864
  closeAriaLabel: n,
842
865
  onClose: r,
843
866
  children: [p, /* @__PURE__ */ I("div", {
844
- className: c("sticky bottom-0 flex gap-3 border-t p-4", pt.footer),
867
+ className: c("sticky bottom-0 flex gap-3 border-t p-4", yt.footer),
845
868
  style: d,
846
- children: [/* @__PURE__ */ F(oe, {
869
+ children: [/* @__PURE__ */ F(ce, {
847
870
  className: "flex-1",
848
871
  label: i,
849
872
  iconBefore: y,
850
873
  disabled: u,
851
874
  onClick: a
852
- }), /* @__PURE__ */ F(M, {
875
+ }), /* @__PURE__ */ F(ae, {
853
876
  className: "flex-1",
854
877
  label: s,
855
878
  onClick: l
@@ -857,35 +880,35 @@ var Xe = {
857
880
  })]
858
881
  });
859
882
  }
860
- return /* @__PURE__ */ F(ie, {
883
+ return /* @__PURE__ */ F(N, {
861
884
  open: e,
862
885
  header: t,
863
- size: ae.Sm,
886
+ size: se.Sm,
864
887
  closeAriaLabel: n,
865
888
  onClose: r,
866
889
  mainButtons: [{
867
890
  label: s,
868
- variant: _.Primary,
869
- appearance: h.Ghost,
891
+ variant: v.Primary,
892
+ appearance: g.Ghost,
870
893
  onClick: l
871
894
  }, {
872
895
  label: i,
873
- variant: _.Primary,
896
+ variant: v.Primary,
874
897
  iconBefore: y,
875
898
  onClick: a,
876
899
  disabled: u
877
900
  }],
878
901
  children: p
879
902
  });
880
- }, ht = ({ isOpen: e, onClose: t, validateName: n, onCreate: r, title: i, nameLabel: a, namePlaceholder: o, createLabel: s, cancelLabel: c, closeAriaLabel: l, dialogColors: u }) => {
881
- let d = Ce(), [f, p] = H(""), [m, h] = H(!1);
882
- z(() => {
903
+ }, xt = ({ isOpen: e, onClose: t, validateName: n, onCreate: r, title: i, nameLabel: a, namePlaceholder: o, createLabel: s, cancelLabel: c, closeAriaLabel: l, dialogColors: u }) => {
904
+ let d = Oe(), [f, p] = B(""), [m, h] = B(!1);
905
+ De(() => {
883
906
  e && (p(""), h(!1));
884
907
  }, [e]);
885
908
  let g = m ? n(f) : void 0, _ = () => {
886
909
  h(!0), n(f) ?? (r(f), t());
887
910
  };
888
- return /* @__PURE__ */ F(mt, {
911
+ return /* @__PURE__ */ F(bt, {
889
912
  isOpen: e,
890
913
  title: i,
891
914
  closeAriaLabel: l,
@@ -900,7 +923,7 @@ var Xe = {
900
923
  onSubmit: (e) => {
901
924
  e.preventDefault(), _();
902
925
  },
903
- children: /* @__PURE__ */ F(k, {
926
+ children: /* @__PURE__ */ F(j, {
904
927
  id: d,
905
928
  labelProps: {
906
929
  label: a,
@@ -915,10 +938,10 @@ var Xe = {
915
938
  })
916
939
  })
917
940
  });
918
- }, gt = { icon: "_icon_1p1f5_1" }, _t = ({ isVisible: e, labels: t, titleClassName: n = "dial-h3-text", subtitleClassName: r = "dial-small-text" }) => {
919
- let i = t ?? {}, a = i.dropOverlayTitle ?? "Upload files", o = i.dropOverlaySubtitle ?? "Drop files here to add them to this skill", s = /* @__PURE__ */ F(te, {
941
+ }, St = { icon: "_icon_1p1f5_1" }, Ct = ({ isVisible: e, labels: t, titleClassName: n = "dial-h3-text", subtitleClassName: r = "dial-small-text" }) => {
942
+ let i = t ?? {}, a = i.dropOverlayTitle ?? "Upload files", o = i.dropOverlaySubtitle ?? "Drop files here to add them to this skill", s = /* @__PURE__ */ F(re, {
920
943
  visuallyHidden: !0,
921
- as: ne.Span,
944
+ as: ie.Span,
922
945
  children: e ? `${a}. ${o}` : ""
923
946
  });
924
947
  return e ? /* @__PURE__ */ I(P, { children: [s, /* @__PURE__ */ F("div", {
@@ -927,11 +950,11 @@ var Xe = {
927
950
  "aria-hidden": !0,
928
951
  className: "flex flex-col items-center text-center",
929
952
  children: [
930
- /* @__PURE__ */ F(ye, {
953
+ /* @__PURE__ */ F(Ce, {
931
954
  size: 100,
932
- className: gt.icon,
955
+ className: St.icon,
933
956
  "aria-hidden": !0,
934
- stroke: b
957
+ stroke: x
935
958
  }),
936
959
  /* @__PURE__ */ F("span", {
937
960
  className: c("mt-5", n),
@@ -944,53 +967,53 @@ var Xe = {
944
967
  ]
945
968
  })
946
969
  })] }) : s;
947
- }, vt = {
970
+ }, Y = {
948
971
  card: "_card_1tr87_2",
949
972
  label: "_label_1tr87_7",
950
973
  fileName: "_fileName_1tr87_11",
951
974
  header: "_header_1tr87_16"
952
- }, yt = ({ label: e, fileName: t, isExpanded: n, onToggle: r, children: i, labelClassName: a = "dial-tiny-lead-text", fileNameClassName: o = "dial-small-text" }) => /* @__PURE__ */ F(p, {
975
+ }, wt = ({ label: e, fileName: t, isExpanded: n, onToggle: r, children: i, labelClassName: a = "dial-tiny-lead-text", fileNameClassName: o = "dial-small-text" }) => /* @__PURE__ */ F(p, {
953
976
  expanded: n,
954
977
  onToggle: r,
955
978
  title: /* @__PURE__ */ F("span", {
956
- className: c("block", vt.label, a),
979
+ className: c("block", Y.label, a),
957
980
  children: e
958
981
  }),
959
- description: /* @__PURE__ */ F(D, {
982
+ description: /* @__PURE__ */ F(k, {
960
983
  name: t,
961
- nameClassName: c(vt.fileName, o)
984
+ nameClassName: c(Y.fileName, o)
962
985
  }),
963
- className: c("rounded-lg border py-0 shadow-xs", vt.card),
964
- headerClassName: c("gap-4 rounded-lg py-2 ps-3 pe-2 text-start [&>span]:flex-1 [&>span]:gap-1 [&>svg]:size-6", n ? "[&>svg]:-rotate-90" : "[&>svg]:rotate-90", vt.header),
986
+ className: c("rounded-lg border py-0 shadow-xs", Y.card),
987
+ headerClassName: c("gap-4 rounded-lg py-2 ps-3 pe-2 text-start [&>span]:flex-1 [&>span]:gap-1 [&>svg]:size-6", n ? "[&>svg]:-rotate-90" : "[&>svg]:rotate-90", Y.header),
965
988
  contentClassName: "max-h-[416px] overflow-y-auto pt-4 pb-2 ps-3 pe-2",
966
989
  children: i
967
- }), bt = /* @__PURE__ */ function(e) {
990
+ }), Tt = /* @__PURE__ */ function(e) {
968
991
  return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
969
- }({}), Y = /* @__PURE__ */ function(e) {
992
+ }({}), Et = /* @__PURE__ */ function(e) {
970
993
  return e.Valid = "valid", e.Invalid = "invalid", e;
971
994
  }({}), X = /* @__PURE__ */ function(e) {
972
995
  return e.Replace = "replace", e.Duplicate = "duplicate", e;
973
- }({}), xt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), St = {
996
+ }({}), Dt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), Z = {
974
997
  invalidDropZone: "_invalidDropZone_j9j9q_1",
975
998
  row: "_row_j9j9q_5"
976
- }, Ct = ".zip,application/zip", wt = [], Tt = 0, Z = () => `skill-file-candidate-${++Tt}`, Q = (e, t, n) => ({
977
- id: Z(),
999
+ }, Q = ".zip,application/zip", $ = [], Ot = 0, kt = () => `skill-file-candidate-${++Ot}`, At = (e, t, n) => ({
1000
+ id: kt(),
978
1001
  file: e,
979
- path: rt(n, t.replace(/\\/g, "/"))
980
- }), Et = ({ isOpen: e, onClose: t, fileActions: n, mode: r = dt.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: l, existingFilePaths: u = wt, onCommitted: d, messageClassName: f = "dial-small-text", rowCaptionClassName: p, labels: m, dialogColors: h, colors: g }) => {
981
- let _ = m ?? {}, [y, x] = H([]), [S, C] = H([]), [w, O] = H(X.Replace), k = B(() => new Set(u), [u]), [A, j] = H(/* @__PURE__ */ new Map()), [M, ie] = H([]), [ae, oe] = H(!1), [N, ce] = H(), [ue, de] = H(!1), [fe, pe] = H(), [me, he] = H(0), ge = V(0), L = r === dt.Archive, _e = _.uploadArchiveErrorMessage ?? "Couldn't read this archive", ye = Ce(), be = Ce(), xe = Ce(), Se = V(null), R = V(!1), we = S[0]?.id;
982
- z(() => {
983
- e && (we == null ? R.current && (R.current = !1, document.getElementById(be)?.focus()) : (R.current = !0, Se.current?.focus()));
1002
+ path: ot(n, t.replace(/\\/g, "/"))
1003
+ }), jt = ({ isOpen: e, onClose: t, fileActions: n, mode: r = _t.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: l, existingFilePaths: u = $, onCommitted: d, messageClassName: f = "dial-small-text", rowCaptionClassName: p, labels: m, dialogColors: h, colors: g }) => {
1004
+ let _ = m ?? {}, [v, b] = B([]), [S, C] = B([]), [w, T] = B(X.Replace), E = R(() => new Set(u), [u]), [A, j] = B(/* @__PURE__ */ new Map()), [te, ne] = B([]), [ae, oe] = B(!1), [N, se] = B(), [ce, ue] = B(!1), [de, pe] = B(), [me, he] = B(0), ge = z(0), _e = r === _t.Archive, ve = _.uploadArchiveErrorMessage ?? "Couldn't read this archive", ye = Oe(), be = Oe(), xe = Oe(), Ce = z(null), we = z(!1), Te = S[0]?.id;
1005
+ De(() => {
1006
+ e && (Te == null ? we.current && (we.current = !1, document.getElementById(be)?.focus()) : (we.current = !0, Ce.current?.focus()));
984
1007
  }, [
985
- we,
1008
+ Te,
986
1009
  e,
987
1010
  be
988
1011
  ]);
989
- let Te = (e) => e.path !== "SKILL.md" && k.has(e.path), Ee = (e) => {
990
- ce(void 0), x((t) => [...t, ...e.filter((e) => !Te(e))]), C((t) => [...t, ...e.filter(Te)]);
991
- }, U = (e) => {
1012
+ let Ee = (e) => e.path !== "SKILL.md" && E.has(e.path), L = (e) => {
1013
+ se(void 0), b((t) => [...t, ...e.filter((e) => !Ee(e))]), C((t) => [...t, ...e.filter(Ee)]);
1014
+ }, ke = (e) => {
992
1015
  let [t, ...n] = S;
993
- t && (C(n), O(X.Replace), e != null && (ce(void 0), x((r) => {
1016
+ t && (C(n), T(X.Replace), e != null && (se(void 0), b((r) => {
994
1017
  if (e === X.Replace) return [...r, {
995
1018
  ...t,
996
1019
  replacesExisting: !0
@@ -1002,10 +1025,10 @@ var Xe = {
1002
1025
  ]);
1003
1026
  return [...r, {
1004
1027
  ...t,
1005
- path: it(t.path, i)
1028
+ path: st(t.path, i)
1006
1029
  }];
1007
1030
  })));
1008
- }, De = async (e) => {
1031
+ }, Ae = async (e) => {
1009
1032
  let { extractArchive: t } = n;
1010
1033
  if (!t) return;
1011
1034
  let r = ge.current;
@@ -1018,76 +1041,76 @@ var Xe = {
1018
1041
  pe(_.uploadArchiveEmptyMessage ?? "This archive has no files");
1019
1042
  return;
1020
1043
  }
1021
- Ee(a.map((e) => Q(e.file, e.path, i)));
1044
+ L(a.map((e) => At(e.file, e.path, i)));
1022
1045
  } catch {
1023
1046
  if (r !== ge.current) return;
1024
- pe(_e);
1047
+ pe(ve);
1025
1048
  } finally {
1026
1049
  r === ge.current && he((e) => e - 1);
1027
1050
  }
1028
- }, Oe = (e) => {
1029
- L ? De(e) : Ee(e.map((e) => Q(e, xt(e), i)));
1030
- }, W = (e) => {
1031
- x((t) => t.filter((t) => t.id !== e));
1051
+ }, je = (e) => {
1052
+ _e ? Ae(e) : L(e.map((e) => At(e, Dt(e), i)));
1053
+ }, V = (e) => {
1054
+ b((t) => t.filter((t) => t.id !== e));
1032
1055
  };
1033
- z(() => {
1056
+ De(() => {
1034
1057
  if (!e) return;
1035
1058
  ge.current += 1;
1036
- let t = [...(a ?? []).map((e) => Q(e, xt(e), i)), ...(l ?? []).map((e) => Q(e.file, e.path, i))];
1037
- x(t.filter((e) => !Te(e))), C(t.filter(Te)), O(X.Replace), j(/* @__PURE__ */ new Map()), ie([]), ce(void 0), pe(void 0), he(0);
1038
- }, [e]), z(() => {
1059
+ let t = [...(a ?? []).map((e) => At(e, Dt(e), i)), ...(l ?? []).map((e) => At(e.file, e.path, i))];
1060
+ b(t.filter((e) => !Ee(e))), C(t.filter(Ee)), T(X.Replace), j(/* @__PURE__ */ new Map()), ne([]), se(void 0), pe(void 0), he(0);
1061
+ }, [e]), De(() => {
1039
1062
  if (!e) return;
1040
1063
  let t = !1;
1041
- if (y.length === 0) j(/* @__PURE__ */ new Map()), ie([]);
1042
- else return oe(!0), n.validateBatch(y).then(({ results: e, batchErrors: n }) => {
1043
- t || (j(new Map(e.map((e) => [e.candidateId, e]))), ie(n.map((e) => e.message)));
1064
+ if (v.length === 0) j(/* @__PURE__ */ new Map()), ne([]);
1065
+ else return oe(!0), n.validateBatch(v).then(({ results: e, batchErrors: n }) => {
1066
+ t || (j(new Map(e.map((e) => [e.candidateId, e]))), ne(n.map((e) => e.message)));
1044
1067
  }).finally(() => {
1045
1068
  t || oe(!1);
1046
1069
  }), () => {
1047
1070
  t = !0;
1048
1071
  };
1049
- }, [y, e]);
1050
- let ke = y.some((e) => A.get(e.id)?.status === Y.Invalid), Ae = y.length > 0 && y.every((e) => A.get(e.id)?.status === Y.Invalid), je = [...M, ...y.flatMap((e) => {
1072
+ }, [v, e]);
1073
+ let Me = v.some((e) => A.get(e.id)?.status === Et.Invalid), Ne = v.length > 0 && v.every((e) => A.get(e.id)?.status === Et.Invalid), Pe = [...te, ...v.flatMap((e) => {
1051
1074
  let t = A.get(e.id);
1052
- return t?.status === Y.Invalid && t.error ? [`${e.path}: ${t.error}`] : [];
1053
- })], G = y.length > 0 && !ke && M.length === 0 && !ae && !ue && me === 0, Me = async () => {
1054
- de(!0), ce(void 0);
1075
+ return t?.status === Et.Invalid && t.error ? [`${e.path}: ${t.error}`] : [];
1076
+ })], H = v.length > 0 && !Me && te.length === 0 && !ae && !ce && me === 0, Fe = async () => {
1077
+ ue(!0), se(void 0);
1055
1078
  try {
1056
- let { results: e, batchErrors: r } = await n.validateBatch(y), i = new Map(e.map((e) => [e.candidateId, e]));
1057
- if (j(i), ie(r.map((e) => e.message)), y.some((e) => i.get(e.id)?.status === Y.Invalid) || r.length > 0) return;
1058
- let a = await n.commitBatch(y);
1079
+ let { results: e, batchErrors: r } = await n.validateBatch(v), i = new Map(e.map((e) => [e.candidateId, e]));
1080
+ if (j(i), ne(r.map((e) => e.message)), v.some((e) => i.get(e.id)?.status === Et.Invalid) || r.length > 0) return;
1081
+ let a = await n.commitBatch(v);
1059
1082
  if (a.error) {
1060
- ce(a.error);
1083
+ se(a.error);
1061
1084
  return;
1062
1085
  }
1063
- d?.(y), t();
1086
+ d?.(v), t();
1064
1087
  } finally {
1065
- de(!1);
1088
+ ue(!1);
1066
1089
  }
1067
- }, Ne = _.uploadDialogCloseAriaLabel ?? "Close", K = _.uploadCancelLabel ?? "Cancel", [Pe] = S;
1068
- if (Pe) {
1090
+ }, Ie = _.uploadDialogCloseAriaLabel ?? "Close", Le = _.uploadCancelLabel ?? "Cancel", [Re] = S;
1091
+ if (Re) {
1069
1092
  let t = _.uploadConflictTitle ?? "Replace or duplicate it?";
1070
- return /* @__PURE__ */ F(mt, {
1093
+ return /* @__PURE__ */ F(bt, {
1071
1094
  isOpen: e,
1072
1095
  title: t,
1073
- closeAriaLabel: Ne,
1074
- onClose: () => U(null),
1096
+ closeAriaLabel: Ie,
1097
+ onClose: () => ke(null),
1075
1098
  confirmLabel: _.uploadConflictConfirmLabel ?? "Confirm",
1076
- onConfirm: () => U(w),
1077
- cancelLabel: K,
1078
- onCancel: () => U(null),
1099
+ onConfirm: () => ke(w),
1100
+ cancelLabel: Le,
1101
+ onCancel: () => ke(null),
1079
1102
  colors: h,
1080
1103
  children: /* @__PURE__ */ I("div", {
1081
1104
  className: "flex flex-col gap-4 px-4 py-4 desktop:px-6",
1082
1105
  children: [/* @__PURE__ */ F("p", {
1083
- ref: Se,
1106
+ ref: Ce,
1084
1107
  tabIndex: -1,
1085
1108
  className: c("outline-hidden", f),
1086
- children: _.uploadConflictMessage?.(Pe.path) ?? `Item with the same name "${Pe.path}" already exists.`
1087
- }), /* @__PURE__ */ F(se, {
1109
+ children: _.uploadConflictMessage?.(Re.path) ?? `Item with the same name "${Re.path}" already exists.`
1110
+ }), /* @__PURE__ */ F(le, {
1088
1111
  ariaLabel: t,
1089
1112
  value: w,
1090
- onChange: (e) => O(e === X.Duplicate ? X.Duplicate : X.Replace),
1113
+ onChange: (e) => T(e === X.Duplicate ? X.Duplicate : X.Replace),
1091
1114
  items: [{
1092
1115
  value: X.Replace,
1093
1116
  label: _.uploadConflictReplaceLabel ?? "Replace"
@@ -1099,16 +1122,16 @@ var Xe = {
1099
1122
  })
1100
1123
  });
1101
1124
  }
1102
- return /* @__PURE__ */ F(mt, {
1125
+ return /* @__PURE__ */ F(bt, {
1103
1126
  isOpen: e,
1104
- title: L ? _.uploadArchiveDialogTitle ?? "Upload archive from device" : _.uploadDialogTitle ?? "Upload files from device",
1105
- closeAriaLabel: Ne,
1127
+ title: _e ? _.uploadArchiveDialogTitle ?? "Upload archive from device" : _.uploadDialogTitle ?? "Upload files from device",
1128
+ closeAriaLabel: Ie,
1106
1129
  onClose: t,
1107
1130
  confirmLabel: _.uploadConfirmLabel ?? "Add",
1108
- onConfirm: () => void Me(),
1109
- isConfirmDisabled: !G,
1110
- isConfirming: ue,
1111
- cancelLabel: K,
1131
+ onConfirm: () => void Fe(),
1132
+ isConfirmDisabled: !H,
1133
+ isConfirming: ce,
1134
+ cancelLabel: Le,
1112
1135
  onCancel: t,
1113
1136
  colors: h,
1114
1137
  children: /* @__PURE__ */ I("div", {
@@ -1118,198 +1141,249 @@ var Xe = {
1118
1141
  "--se-upload-row-border": g?.rowBorder
1119
1142
  }),
1120
1143
  children: [
1121
- /* @__PURE__ */ F(E, {
1144
+ /* @__PURE__ */ F(O, {
1122
1145
  label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
1123
1146
  className: "desktop:hidden",
1124
- children: L ? _.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : _.uploadDropZoneMobileLabel ?? "Click here to upload"
1147
+ children: _e ? _.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : _.uploadDropZoneMobileLabel ?? "Click here to upload"
1125
1148
  }), /* @__PURE__ */ F("span", {
1126
1149
  className: "hidden desktop:inline",
1127
- children: L ? _.uploadArchiveDropZoneLabel ?? "Drag and drop a .zip archive or click here to upload" : _.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
1150
+ children: _e ? _.uploadArchiveDropZoneLabel ?? "Drag and drop a .zip archive or click here to upload" : _.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
1128
1151
  })] }),
1129
- description: L ? _.uploadArchiveDropZoneDescription : _.uploadDropZoneDescription,
1152
+ description: _e ? _.uploadArchiveDropZoneDescription : _.uploadDropZoneDescription,
1130
1153
  id: be,
1131
1154
  ariaLabel: _.uploadDropZoneAriaLabel ?? "Upload files",
1132
1155
  multiple: !0,
1133
- accept: L ? Ct : void 0,
1134
- className: Ae ? St.invalidDropZone : void 0,
1135
- onChange: Oe,
1136
- onReject: L ? () => pe(_e) : void 0
1156
+ accept: _e ? Q : void 0,
1157
+ className: Ne ? Z.invalidDropZone : void 0,
1158
+ onChange: je,
1159
+ onReject: _e ? () => pe(ve) : void 0
1137
1160
  }),
1138
- me > 0 && /* @__PURE__ */ F(le, { ariaLabel: _.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
1139
- /* @__PURE__ */ F(T, {
1140
- text: fe,
1141
- announce: re.Assertive
1161
+ me > 0 && /* @__PURE__ */ F(fe, { ariaLabel: _.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
1162
+ /* @__PURE__ */ F(D, {
1163
+ text: de,
1164
+ announce: M.Assertive
1142
1165
  }),
1143
- /* @__PURE__ */ F(te, {
1166
+ /* @__PURE__ */ F(re, {
1144
1167
  visuallyHidden: !0,
1145
- as: ne.Span,
1168
+ as: ie.Span,
1146
1169
  id: ye,
1147
- children: je.map((e) => `${_.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
1170
+ children: Pe.map((e) => `${_.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
1148
1171
  }),
1149
- M.map((e) => /* @__PURE__ */ F(T, { text: e }, e)),
1150
- y.length > 0 && /* @__PURE__ */ F("ul", {
1172
+ te.map((e) => /* @__PURE__ */ F(D, { text: e }, e)),
1173
+ v.length > 0 && /* @__PURE__ */ F("ul", {
1151
1174
  className: "flex flex-col gap-2",
1152
- children: y.map((e) => {
1153
- let t = A.get(e.id), n = t?.kind === bt.Manifest, r = t?.status === Y.Invalid, i = r ? t?.error : void 0, a = `${xe}${e.id}`;
1175
+ children: v.map((e) => {
1176
+ let t = A.get(e.id), n = t?.kind === Tt.Manifest, r = t?.status === Et.Invalid, i = r ? t?.error : void 0, a = `${xe}${e.id}`;
1154
1177
  return /* @__PURE__ */ I("li", {
1155
- className: c("flex items-center gap-2 rounded-lg border p-2", St.row),
1156
- children: [/* @__PURE__ */ F(D, {
1178
+ className: c("flex items-center gap-2 rounded-lg border p-2", Z.row),
1179
+ children: [/* @__PURE__ */ F(k, {
1157
1180
  name: e.path,
1158
1181
  className: "min-w-0 flex-1",
1159
1182
  details: /* @__PURE__ */ I(P, { children: [
1160
- /* @__PURE__ */ F(v, {
1183
+ /* @__PURE__ */ F(y, {
1161
1184
  className: p,
1162
1185
  text: s(e.file.size)
1163
1186
  }),
1164
- /* @__PURE__ */ F(T, {
1187
+ /* @__PURE__ */ F(D, {
1165
1188
  id: a,
1166
1189
  text: i
1167
1190
  }),
1168
- n && !r && /* @__PURE__ */ F(v, {
1191
+ n && !r && /* @__PURE__ */ F(y, {
1169
1192
  className: p,
1170
1193
  text: _.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
1171
1194
  }),
1172
- e.replacesExisting && !r && /* @__PURE__ */ F(v, {
1195
+ e.replacesExisting && !r && /* @__PURE__ */ F(y, {
1173
1196
  className: p,
1174
1197
  text: _.uploadReplaceRowNote ?? "Will replace the existing file"
1175
1198
  })
1176
1199
  ] })
1177
1200
  }), /* @__PURE__ */ F(ee, {
1178
- icon: /* @__PURE__ */ F(ve, {
1201
+ icon: /* @__PURE__ */ F(Se, {
1179
1202
  size: 16,
1180
1203
  "aria-hidden": !0,
1181
- stroke: b
1204
+ stroke: x
1182
1205
  }),
1183
1206
  "aria-label": _.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
1184
1207
  "aria-describedby": i ? a : void 0,
1185
- onClick: () => W(e.id)
1208
+ onClick: () => V(e.id)
1186
1209
  })]
1187
1210
  }, e.id);
1188
1211
  })
1189
1212
  }),
1190
- /* @__PURE__ */ F(T, {
1213
+ /* @__PURE__ */ F(D, {
1191
1214
  text: N,
1192
- announce: re.Assertive
1215
+ announce: M.Assertive
1193
1216
  })
1194
1217
  ]
1195
1218
  })
1196
1219
  });
1197
- }, Dt = {
1220
+ }, Mt = {
1221
+ list: "_list_1hpyi_1",
1222
+ row: "_row_1hpyi_5",
1223
+ count: "_count_1hpyi_14"
1224
+ }, Nt = (e) => e === 1 ? "1 item" : `${e} items`, Pt = ({ folderPath: e, entries: t, onOpen: n, rootLabel: r = "Skill", breadcrumbAriaLabel: i = "Folder path", overflowAriaLabel: a = "Show hidden path segments", listAriaLabel: o = "Folder content", emptyTitle: s = "This folder is empty", emptyDescription: l = "Use Add to upload files or create a subfolder.", itemCountLabel: u = Nt, itemCountClassName: d = "dial-tiny-text" }) => {
1225
+ let f = e.split("/"), p = [{
1226
+ label: r,
1227
+ onClick: () => n("", G.Folder)
1228
+ }, ...f.map((e, t) => {
1229
+ let r = f.slice(0, t + 1).join("/");
1230
+ return t === f.length - 1 ? { label: e } : {
1231
+ label: e,
1232
+ onClick: () => n(r, G.Folder)
1233
+ };
1234
+ })];
1235
+ return /* @__PURE__ */ I("div", {
1236
+ className: "flex min-h-0 flex-1 flex-col gap-4",
1237
+ children: [/* @__PURE__ */ F(h, {
1238
+ items: p,
1239
+ ariaLabel: i,
1240
+ overflowAriaLabel: a
1241
+ }), t.length === 0 ? /* @__PURE__ */ F(oe, {
1242
+ title: s,
1243
+ description: l,
1244
+ live: !0
1245
+ }) : /* @__PURE__ */ F("ul", {
1246
+ "aria-label": o,
1247
+ className: c("m-0 flex list-none flex-col overflow-hidden rounded-lg border p-0", Mt.list),
1248
+ children: t.map((e) => {
1249
+ let t = e.kind === G.Folder;
1250
+ return /* @__PURE__ */ F("li", {
1251
+ className: "m-0 p-0",
1252
+ children: /* @__PURE__ */ I("button", {
1253
+ type: "button",
1254
+ onClick: () => n(e.path, e.kind),
1255
+ className: c("flex w-full cursor-pointer items-center justify-between gap-4 border-b bg-transparent px-3 py-2 text-start last:border-b-0", Mt.row),
1256
+ children: [/* @__PURE__ */ F(k, {
1257
+ name: e.name,
1258
+ type: t ? C.Folder : C.File,
1259
+ className: "min-w-0 flex-1"
1260
+ }), t && /* @__PURE__ */ F("span", {
1261
+ className: c("shrink-0", Mt.count, d),
1262
+ children: u(e.childCount)
1263
+ })]
1264
+ })
1265
+ }, e.path);
1266
+ })
1267
+ })]
1268
+ });
1269
+ }, Ft = {
1198
1270
  title: "_title_lgmx6_1",
1199
1271
  helperText: "_helperText_lgmx6_5",
1200
1272
  refineFeedback: "_refineFeedback_lgmx6_9",
1201
1273
  refineError: "_refineError_lgmx6_13",
1202
1274
  menuIcon: "_menuIcon_lgmx6_17"
1203
- }, Ot = {
1204
- mode: dt.Files,
1275
+ }, It = {
1276
+ mode: _t.Files,
1205
1277
  targetFolderPath: ""
1206
- }, kt = [K.Name, K.Description], At = 24, jt = 300, Mt = "pb-0 desktop:px-8 desktop:py-6", Nt = "desktop:px-8 desktop:py-6", Pt = "gap-4 px-4 pt-5 pb-6 desktop:gap-5 desktop:px-8 desktop:py-6", Ft = xe(async () => {
1207
- let { MarkdownEditor: e } = await Ee();
1278
+ }, Lt = [U.Name, U.Description], Rt = 24, zt = 300, Bt = "pb-0 desktop:px-8 desktop:py-6", Vt = "desktop:px-8 desktop:py-6", Ht = "gap-4 px-4 pt-5 pb-6 desktop:gap-5 desktop:px-8 desktop:py-6", Ut = Te(async () => {
1279
+ let { MarkdownEditor: e } = await je();
1208
1280
  return { default: e };
1209
- }), $ = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: d, expandedPaths: p, onExpandedPathsChange: m, isLoading: x = !1, hasLoadError: E = !1, isSubmitting: D = !1, errors: k, submitError: j, conflict: te, onReloadLatest: ne, isNameReadOnly: re = !1, onDirtyChange: M, onValuesChange: ie, onRefineDescription: ae, onRefineInstructions: se, fileActions: N, supportingFileContent: ce, asideData: ue, onSubmit: de, onCancel: fe, onBack: pe, backAriaLabel: L, title: _e, onRetry: xe, onRetrySubmit: Se, labels: Ee, styles: U, dir: De, instructionsEditorTheme: Oe = S.light }) => {
1210
- let [W, ke] = H({
1281
+ }), Wt = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: d, expandedPaths: p, onExpandedPathsChange: m, isLoading: h = !1, hasLoadError: S = !1, isSubmitting: C = !1, errors: O, submitError: k, conflict: j, onReloadLatest: ne, isNameReadOnly: re = !1, onDirtyChange: ie, onValuesChange: M, onRefineDescription: ae, onRefineInstructions: oe, fileActions: N, supportingFileContent: se, asideData: le, onSubmit: ue, onCancel: de, onBack: pe, backAriaLabel: me, title: he, onRetry: ge, onRetrySubmit: be, labels: xe, styles: Te, dir: Ee, instructionsEditorTheme: je = w.light }) => {
1282
+ let [V, Me] = B({
1211
1283
  name: r?.name ?? "",
1212
1284
  description: r?.description ?? "",
1213
1285
  instructions: r?.instructions ?? ""
1214
- }), Ae = Ce(), je = Ce();
1215
- u(() => document.getElementById(Ae), je, !!k?.instructions);
1216
- let G = V(void 0), Me = l({
1217
- bottomGap: At,
1218
- minHeight: jt
1219
- }), Ne = V(W), K = (e) => {
1286
+ }), Ne = Oe(), Pe = Oe();
1287
+ u(() => document.getElementById(Ne), Pe, !!O?.instructions);
1288
+ let H = z(void 0), Fe = l({
1289
+ bottomGap: Rt,
1290
+ minHeight: zt
1291
+ }), Ie = z(V), Le = (e) => {
1220
1292
  let t = {
1221
- ...Ne.current,
1293
+ ...Ie.current,
1222
1294
  ...e
1223
1295
  };
1224
- Ne.current = t, ke(t), ie?.(t);
1225
- }, Pe = (e) => e ? async (t, n) => {
1226
- if (G.current && !G.current.aborted) throw new DOMException("Busy", "AbortError");
1227
- G.current = n;
1296
+ Ie.current = t, Me(t), M?.(t);
1297
+ }, Re = (e) => e ? async (t, n) => {
1298
+ if (H.current && !H.current.aborted) throw new DOMException("Busy", "AbortError");
1299
+ H.current = n;
1228
1300
  try {
1229
1301
  return await e(t, n);
1230
1302
  } finally {
1231
- G.current === n && (G.current = void 0);
1303
+ H.current === n && (H.current = void 0);
1232
1304
  }
1233
- } : void 0, Fe = f({
1234
- value: W.description,
1235
- onChange: (e) => K({ description: e }),
1236
- onRefine: Pe(ae),
1237
- disabled: D || x || E,
1305
+ } : void 0, ze = f({
1306
+ value: V.description,
1307
+ onChange: (e) => Le({ description: e }),
1308
+ onRefine: Re(ae),
1309
+ disabled: C || h || S,
1238
1310
  resetKey: r
1239
- }), Ie = f({
1240
- value: W.instructions,
1241
- onChange: (e) => K({ instructions: e }),
1242
- onRefine: Pe(se),
1243
- disabled: D || x || E,
1311
+ }), U = f({
1312
+ value: V.instructions,
1313
+ onChange: (e) => Le({ instructions: e }),
1314
+ onRefine: Re(oe),
1315
+ disabled: C || h || S,
1244
1316
  resetKey: r
1245
- }), Le = Fe.isPending || Ie.isPending, Re = () => {
1246
- Fe.reset(), Ie.reset();
1247
- }, ze = () => {
1248
- Re(), fe();
1249
- }, Be = () => {
1250
- Re(), pe();
1251
- }, Ve = () => {
1252
- D || x || E || G.current && !G.current.aborted || de(W);
1253
- }, He = V(r), Ue = He.current !== r, We = V(i), [qe, Ye] = H(!1);
1254
- z(() => {
1255
- He.current = r;
1317
+ }), Be = ze.isPending || U.isPending, Ve = () => {
1318
+ ze.reset(), U.reset();
1319
+ }, He = () => {
1320
+ Ve(), de();
1321
+ }, Ue = () => {
1322
+ Ve(), pe();
1323
+ }, We = () => {
1324
+ C || h || S || H.current && !H.current.aborted || ue(V);
1325
+ }, Ge = z(r), Ke = Ge.current !== r, qe = z(i), [Je, Ye] = B(!1);
1326
+ De(() => {
1327
+ Ge.current = r;
1256
1328
  let e = {
1257
1329
  name: r?.name ?? "",
1258
1330
  description: r?.description ?? "",
1259
1331
  instructions: r?.instructions ?? ""
1260
1332
  };
1261
- Ne.current = e, ke(e), We.current = i, Ye(!1);
1333
+ Ie.current = e, Me(e), qe.current = i, Ye(!1);
1262
1334
  }, [r]);
1263
- let et = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), tt = V(!1);
1264
- z(() => {
1265
- if (Ue) return;
1335
+ let Xe = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), Ze = z(!1);
1336
+ De(() => {
1337
+ if (Ke) return;
1266
1338
  let e = {
1267
1339
  name: r?.name ?? "",
1268
1340
  description: r?.description ?? "",
1269
1341
  instructions: r?.instructions ?? ""
1270
- }, t = JSON.stringify(W) !== JSON.stringify(e) || et(i) !== et(We.current) || qe;
1271
- t !== tt.current && (tt.current = t, M?.(t));
1342
+ }, t = JSON.stringify(V) !== JSON.stringify(e) || Xe(i) !== Xe(qe.current) || Je;
1343
+ t !== Ze.current && (Ze.current = t, ie?.(t));
1272
1344
  }, [
1273
- W,
1345
+ V,
1274
1346
  i,
1275
1347
  r,
1276
- Ue,
1277
- qe,
1278
- M
1348
+ Ke,
1349
+ Je,
1350
+ ie
1279
1351
  ]);
1280
- let [rt, it] = H(Ze), q = s ?? rt, ot = R((e) => {
1281
- it(e), d?.(e);
1282
- }, [d]), [st, lt] = H([]), pt = p ?? st, mt = B(() => new Set(pt), [pt]), gt = R((e) => {
1352
+ let [et, nt] = B(W), K = s ?? et, q = L((e) => {
1353
+ nt(e), d?.(e);
1354
+ }, [d]), [ot, st] = B([]), lt = p ?? ot, ut = R(() => new Set(lt), [lt]), pt = L((e) => {
1283
1355
  let t = [...e];
1284
- lt(t), m?.(t);
1285
- }, [m]), [vt, bt] = H(!1), [Y, X] = H(Ot), xt = R((e) => {
1286
- X(e), bt(!0);
1287
- }, []), [St, Ct] = H(!1), { isDragActive: wt, dropZoneHandlers: Tt } = ut(R((e) => {
1288
- vt || xt({
1289
- ...Ot,
1356
+ st(t), m?.(t);
1357
+ }, [m]), [ht, yt] = B(!1), [bt, St] = B(It), Y = L((e) => {
1358
+ St(e), yt(!0);
1359
+ }, []), [Tt, Et] = B(!1), { isDragActive: X, dropZoneHandlers: Dt } = gt(L((e) => {
1360
+ ht || Y({
1361
+ ...It,
1290
1362
  initialFiles: e
1291
1363
  });
1292
- }, [vt, xt])), Z = Ee ?? {}, Q = U?.colors, $ = U?.typography ?? {}, It = $.titleClassName ?? "dial-body-semi-text", Lt = $.helperTextClassName ?? "dial-tiny-semi-text", Rt = $.removeIconClassName, zt = B(() => o({ "--se-menu-icon": Q?.menuIcon }), [Q?.menuIcon]), Bt = o({
1364
+ }, [ht, Y])), Z = xe ?? {}, Q = Te?.colors, $ = Te?.typography ?? {}, Ot = $.titleClassName ?? "dial-body-semi-text", kt = $.helperTextClassName ?? "dial-tiny-semi-text", At = $.removeIconClassName, Mt = R(() => o({ "--se-menu-icon": Q?.menuIcon }), [Q?.menuIcon]), Nt = o({
1293
1365
  "--se-title-color": Q?.title,
1294
1366
  "--se-helper-text-color": Q?.helperText,
1295
1367
  "--se-refine-action-text": Q?.refineActionText,
1296
1368
  "--se-refine-error-text": Q?.refineErrorText,
1297
1369
  "--se-files-card-bg": Q?.filesCardBackground,
1298
1370
  "--se-files-card-border": Q?.filesCardBorder,
1371
+ "--se-folder-row-border": Q?.folderRowBorder,
1372
+ "--se-folder-row-hover-bg": Q?.folderRowHoverBackground,
1299
1373
  "--se-drop-overlay-icon": Q?.dropOverlayIcon
1300
- }), Vt = {
1374
+ }), Wt = {
1301
1375
  footerBackground: Q?.dialogFooterBackground,
1302
1376
  footerBorder: Q?.dialogFooterBorder
1303
- }, Ht = {
1304
- feedbackClassName: c(Q?.refineActionText && Dt.refineFeedback, $.refineFeedbackClassName, Xe.refineFeedback),
1305
- errorClassName: Dt.refineError
1306
- }, Ut = {
1377
+ }, Gt = {
1378
+ feedbackClassName: c(Q?.refineActionText && Ft.refineFeedback, $.refineFeedbackClassName, rt.refineFeedback),
1379
+ errorClassName: Ft.refineError
1380
+ }, Kt = {
1307
1381
  layout: Q?.border ? { colors: {
1308
1382
  headerBorderColor: Q.border,
1309
1383
  sidebarBorderColor: Q.border
1310
1384
  } } : void 0,
1311
1385
  section: Q?.title ? { colors: { titleColor: Q.title } } : void 0
1312
- }, Wt = B(() => ({
1386
+ }, qt = R(() => ({
1313
1387
  required: Z.folderNameRequiredError ?? "Enter a folder name",
1314
1388
  invalid: Z.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
1315
1389
  duplicate: Z.folderNameDuplicateError ?? "An item with this name already exists here"
@@ -1317,187 +1391,198 @@ var Xe = {
1317
1391
  Z.folderNameRequiredError,
1318
1392
  Z.folderNameInvalidError,
1319
1393
  Z.folderNameDuplicateError
1320
- ]), Gt = R((e) => {
1321
- mt.has(e) || gt(/* @__PURE__ */ new Set([...mt, e]));
1322
- }, [mt, gt]), Kt = Y.targetFolderPath, qt = B(() => ({
1394
+ ]), Jt = L((e) => {
1395
+ ut.has(e) || pt(/* @__PURE__ */ new Set([...ut, e]));
1396
+ }, [ut, pt]), Yt = bt.targetFolderPath, Xt = R(() => ({
1323
1397
  ...N,
1324
1398
  commitBatch: async (e) => {
1325
1399
  let t = await N.commitBatch(e);
1326
- return !t.error && Kt !== "" && Gt(Kt), t;
1400
+ return !t.error && Yt !== "" && Jt(Yt), t;
1327
1401
  }
1328
1402
  }), [
1329
1403
  N,
1330
- Kt,
1331
- Gt
1332
- ]), Jt = ct({
1404
+ Yt,
1405
+ Jt
1406
+ ]), Zt = mt({
1333
1407
  files: i,
1334
1408
  fileActions: N,
1335
1409
  defaultName: Z.newFolderDefaultName ?? "New folder",
1336
- messages: Wt,
1337
- onRevealFolder: Gt,
1338
- onCreated: ot
1339
- }), { draftNode: Yt, draftPath: Xt, draftPane: Zt } = Jt, Qt = B(() => nt([{
1340
- path: Ze,
1341
- name: Ze,
1342
- kind: Qe.File
1343
- }, ...i]), [i]), $t = B(() => Yt ? nt([
1410
+ messages: qt,
1411
+ onRevealFolder: Jt,
1412
+ onCreated: q
1413
+ }), { draftNode: Qt, draftPath: $t, draftPane: en } = Zt, tn = R(() => at([{
1414
+ path: W,
1415
+ name: W,
1416
+ kind: G.File
1417
+ }, ...i]), [i]), nn = R(() => Qt ? at([
1344
1418
  {
1345
- path: Ze,
1346
- name: Ze,
1347
- kind: Qe.File
1419
+ path: W,
1420
+ name: W,
1421
+ kind: G.File
1348
1422
  },
1349
1423
  ...i,
1350
- Yt
1351
- ]) : Qt, [
1352
- i,
1353
- Yt,
1354
1424
  Qt
1355
- ]), en = B(() => i.find((e) => e.path === q), [i, q]), tn = R((e) => {
1356
- e.path !== Xt && ot(e.path);
1357
- }, [ot, Xt]), nn = R((e) => {
1358
- N.onRemoveNode(e), q === e && ot(Ze);
1425
+ ]) : tn, [
1426
+ i,
1427
+ Qt,
1428
+ tn
1429
+ ]), rn = R(() => i.find((e) => e.path === K), [i, K]), an = R(() => dt(i, K), [i, K]), on = rn?.kind === G.Folder || an.length > 0, sn = L((e) => {
1430
+ e.path !== $t && q(e.path);
1431
+ }, [q, $t]), cn = L((e, t) => {
1432
+ if (e === "") {
1433
+ q(W);
1434
+ return;
1435
+ }
1436
+ let n = [...ft(e), ...t === G.Folder ? [e] : []].filter((e) => !ut.has(e));
1437
+ n.length > 0 && pt(/* @__PURE__ */ new Set([...ut, ...n])), q(e);
1438
+ }, [
1439
+ ut,
1440
+ pt,
1441
+ q
1442
+ ]), ln = L((e) => {
1443
+ N.onRemoveNode(e), (K === e || K.startsWith(`${e}/`)) && q(W);
1359
1444
  }, [
1360
1445
  N,
1361
- q,
1362
- ot
1363
- ]), { startDraft: rn } = Jt, { onCreateFolder: an, extractArchive: on, pickFromFileSystem: sn } = N, [cn, ln] = H(null), un = R((e, t) => {
1364
- t === J.Mobile ? ln(e) : rn(e, t);
1365
- }, [rn]), dn = B(() => i.filter((e) => e.kind === Qe.File).map((e) => e.path), [i]), fn = R(async (e) => {
1366
- if (!sn) return;
1367
- let t = await sn();
1368
- t?.length && xt({
1369
- mode: dt.Files,
1446
+ K,
1447
+ q
1448
+ ]), { startDraft: un } = Zt, { onCreateFolder: dn, extractArchive: fn, pickFromFileSystem: pn } = N, [mn, hn] = B(null), gn = L((e, t) => {
1449
+ t === J.Mobile ? hn(e) : un(e, t);
1450
+ }, [un]), _n = R(() => i.filter((e) => e.kind === G.File).map((e) => e.path), [i]), vn = L(async (e) => {
1451
+ if (!pn) return;
1452
+ let t = await pn();
1453
+ t?.length && Y({
1454
+ mode: _t.Files,
1370
1455
  targetFolderPath: e,
1371
1456
  initialEntries: t
1372
1457
  });
1373
- }, [sn, xt]), pn = R((e, t) => {
1374
- let n = (e) => ft(e, Dt.menuIcon, void 0, zt), r = [];
1375
- return an && r.push({
1458
+ }, [pn, Y]), yn = L((e, t) => {
1459
+ let n = (e) => vt(e, Ft.menuIcon, void 0, Mt), r = [];
1460
+ return dn && r.push({
1376
1461
  key: "create-folder",
1377
1462
  label: Z.createFolderLabel ?? "Create folder",
1378
- icon: n(ge),
1379
- onClick: () => un(e, t)
1463
+ icon: n(ye),
1464
+ onClick: () => gn(e, t)
1380
1465
  }), r.push({
1381
1466
  key: "upload-files",
1382
1467
  label: Z.uploadFilesLabel ?? "Upload files from device",
1383
- icon: n(ye),
1384
- onClick: () => xt({
1385
- mode: dt.Files,
1468
+ icon: n(Ce),
1469
+ onClick: () => Y({
1470
+ mode: _t.Files,
1386
1471
  targetFolderPath: e
1387
1472
  })
1388
- }), on && r.push({
1473
+ }), fn && r.push({
1389
1474
  key: "upload-archive",
1390
1475
  label: Z.uploadArchiveLabel ?? "Upload archive from device",
1391
- icon: n(he),
1392
- onClick: () => xt({
1393
- mode: dt.Archive,
1476
+ icon: n(ve),
1477
+ onClick: () => Y({
1478
+ mode: _t.Archive,
1394
1479
  targetFolderPath: e
1395
1480
  })
1396
- }), sn && r.push({
1481
+ }), pn && r.push({
1397
1482
  key: "open-file-system",
1398
1483
  label: Z.openFileSystemLabel ?? "Open DIAL file system",
1399
- icon: n(me),
1400
- onClick: () => void fn(e)
1484
+ icon: n(_e),
1485
+ onClick: () => void vn(e)
1401
1486
  }), r;
1402
1487
  }, [
1403
- zt,
1404
- an,
1405
- on,
1406
- sn,
1488
+ Mt,
1489
+ dn,
1490
+ fn,
1491
+ pn,
1407
1492
  Z.createFolderLabel,
1408
1493
  Z.uploadFilesLabel,
1409
1494
  Z.uploadArchiveLabel,
1410
1495
  Z.openFileSystemLabel,
1411
- un,
1412
- xt,
1413
- fn
1414
- ]), mn = B(() => {
1415
- let e = at($e.Header, i.find((e) => e.path === q));
1496
+ gn,
1497
+ Y,
1498
+ vn
1499
+ ]), bn = R(() => {
1500
+ let e = ct(it.Header, i.find((e) => e.path === K));
1416
1501
  return {
1417
- [J.Mobile]: pn(e, J.Mobile),
1418
- [J.Desktop]: pn(e, J.Desktop)
1502
+ [J.Mobile]: yn(e, J.Mobile),
1503
+ [J.Desktop]: yn(e, J.Desktop)
1419
1504
  };
1420
1505
  }, [
1421
- pn,
1506
+ yn,
1422
1507
  i,
1423
- q
1424
- ]), hn = R((e, t) => {
1425
- if (e.path === Xt || e.nodeType !== we.FOLDER) return [];
1508
+ K
1509
+ ]), xn = L((e, t) => {
1510
+ if (e.path === $t || e.nodeType !== ke.FOLDER) return [];
1426
1511
  let n = {
1427
1512
  path: e.path,
1428
1513
  name: e.name,
1429
- kind: Qe.Folder
1430
- }, r = pn(at($e.Child, n), t);
1514
+ kind: G.Folder
1515
+ }, r = yn(ct(it.Child, n), t);
1431
1516
  return r.push({
1432
1517
  key: "delete",
1433
1518
  label: Z.deleteLabel ?? "Delete",
1434
1519
  danger: !0,
1435
- icon: ft(ve, Rt),
1436
- onClick: () => nn(e.path)
1520
+ icon: vt(Se, At),
1521
+ onClick: () => ln(e.path)
1437
1522
  }), r;
1438
1523
  }, [
1439
- Xt,
1524
+ $t,
1440
1525
  Z.deleteLabel,
1441
- Rt,
1442
- pn,
1443
- nn
1444
- ]), gn = B(() => ({
1445
- [J.Mobile]: (e) => hn(e, J.Mobile),
1446
- [J.Desktop]: (e) => hn(e, J.Desktop)
1447
- }), [hn]), _n = R((e) => e.nodeType === we.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ F(ee, {
1448
- size: C.Small,
1449
- icon: ft(ve, Rt, y.SM),
1526
+ At,
1527
+ yn,
1528
+ ln
1529
+ ]), Sn = R(() => ({
1530
+ [J.Mobile]: (e) => xn(e, J.Mobile),
1531
+ [J.Desktop]: (e) => xn(e, J.Desktop)
1532
+ }), [xn]), Cn = L((e) => e.nodeType === ke.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ F(ee, {
1533
+ size: T.Small,
1534
+ icon: vt(Se, At, b.SM),
1450
1535
  "aria-label": Z.deleteLabel ?? "Delete",
1451
- onClick: () => nn(e.path)
1536
+ onClick: () => ln(e.path)
1452
1537
  }), [
1453
1538
  Z.deleteLabel,
1454
- Rt,
1455
- nn
1456
- ]), vn = (e) => /* @__PURE__ */ I("div", {
1539
+ At,
1540
+ ln
1541
+ ]), wn = (e) => /* @__PURE__ */ I("div", {
1457
1542
  className: "flex flex-col gap-2 desktop:gap-5",
1458
1543
  children: [/* @__PURE__ */ I("div", {
1459
1544
  className: "flex items-center justify-between",
1460
1545
  children: [/* @__PURE__ */ F("span", {
1461
- className: c(Dt.title, It),
1546
+ className: c(Ft.title, Ot),
1462
1547
  children: Z.filesHeading ?? "Files"
1463
- }), /* @__PURE__ */ F(g, {
1548
+ }), /* @__PURE__ */ F(_, {
1464
1549
  label: Z.addLabel ?? "Add",
1465
- variant: _.Neutral,
1466
- appearance: h.Solid,
1467
- size: C.Small,
1468
- items: mn[e]
1550
+ variant: v.Neutral,
1551
+ appearance: g.Solid,
1552
+ size: T.Small,
1553
+ items: bn[e]
1469
1554
  })]
1470
1555
  }), /* @__PURE__ */ F("div", {
1471
1556
  role: "tree",
1472
1557
  "aria-label": Z.filesTreeAriaLabel ?? "Skill files",
1473
- children: /* @__PURE__ */ F(Te, {
1474
- items: Zt === e ? $t : Qt,
1558
+ children: /* @__PURE__ */ F(Ae, {
1559
+ items: en === e ? nn : tn,
1475
1560
  showFiles: !0,
1476
- selectedPath: q,
1477
- expandedPaths: mt,
1478
- onExpandedPathsChange: gt,
1479
- onItemClick: tn,
1480
- getContextMenuItems: gn[e],
1481
- renderItemActions: _n,
1482
- renamedPath: Zt === e ? Xt : void 0,
1483
- onRenameSave: Jt.handleSave,
1484
- onRenameCancel: Jt.handleCancel,
1485
- onRenameValidate: Jt.handleValidate,
1561
+ selectedPath: K,
1562
+ expandedPaths: ut,
1563
+ onExpandedPathsChange: pt,
1564
+ onItemClick: sn,
1565
+ getContextMenuItems: Sn[e],
1566
+ renderItemActions: Cn,
1567
+ renamedPath: en === e ? $t : void 0,
1568
+ onRenameSave: Zt.handleSave,
1569
+ onRenameCancel: Zt.handleCancel,
1570
+ onRenameValidate: Zt.handleValidate,
1486
1571
  rootItemPath: ""
1487
1572
  })
1488
1573
  })]
1489
- }), yn = B(() => ({
1490
- name: W.name,
1491
- description: W.description,
1574
+ }), Tn = R(() => ({
1575
+ name: V.name,
1576
+ description: V.description,
1492
1577
  iconUrl: "",
1493
1578
  version: "",
1494
1579
  topics: [],
1495
1580
  otherLocales: []
1496
- }), [W.name, W.description]), bn = B(() => ({
1497
- name: k?.name,
1498
- description: k?.description
1499
- }), [k?.name, k?.description]), xn = B(() => ({ form: {
1500
- ...Ke,
1581
+ }), [V.name, V.description]), En = R(() => ({
1582
+ name: O?.name,
1583
+ description: O?.description
1584
+ }), [O?.name, O?.description]), Dn = R(() => ({ form: {
1585
+ ...$e,
1501
1586
  name: {
1502
1587
  label: Z.nameLabel ?? "Name",
1503
1588
  placeholder: Z.namePlaceholder ?? "good-morning-breakfast"
@@ -1512,209 +1597,221 @@ var Xe = {
1512
1597
  Z.namePlaceholder,
1513
1598
  Z.descriptionLabel,
1514
1599
  Z.descriptionPlaceholder
1515
- ]), Sn = (e) => {
1516
- e.name !== void 0 && K({ name: e.name }), e.description !== void 0 && (Fe.reset(), K({ description: e.description }));
1517
- }, Cn = ae ? (e, t) => /* @__PURE__ */ F(a, {
1600
+ ]), On = (e) => {
1601
+ e.name !== void 0 && Le({ name: e.name }), e.description !== void 0 && (ze.reset(), Le({ description: e.description }));
1602
+ }, kn = ae ? (e, t) => /* @__PURE__ */ F(a, {
1518
1603
  isEnabled: !0,
1519
1604
  fieldId: t,
1520
1605
  required: !0,
1521
1606
  label: Z.descriptionLabel ?? "Description",
1522
1607
  labels: Z,
1523
- refinement: Fe,
1524
- disabled: Le || D,
1525
- ...Ht,
1608
+ refinement: ze,
1609
+ disabled: Be || C,
1610
+ ...Gt,
1526
1611
  children: e
1527
- }) : void 0, wn = {
1528
- title: _e,
1529
- onBack: Be,
1530
- onCancel: ze,
1531
- onSubmit: Ve,
1612
+ }) : void 0, An = {
1613
+ title: he,
1614
+ onBack: Ue,
1615
+ onCancel: He,
1616
+ onSubmit: We,
1532
1617
  submitLabel: Z.createLabel ?? "Create",
1533
- isSubmitDisabled: Le || x || E,
1618
+ isSubmitDisabled: Be || h || S,
1534
1619
  labels: {
1535
1620
  cancelLabel: Z.cancelLabel ?? "Cancel",
1536
- backAriaLabel: L ?? "Back",
1621
+ backAriaLabel: me ?? "Back",
1537
1622
  savingStatusLabel: Z.savingStatusLabel ?? "Saving"
1538
1623
  },
1539
- styles: Ut,
1624
+ styles: Kt,
1540
1625
  metadataTitle: null
1541
1626
  };
1542
- if (x) return /* @__PURE__ */ F("div", {
1543
- dir: De,
1627
+ if (h) return /* @__PURE__ */ F("div", {
1628
+ dir: Ee,
1544
1629
  className: "relative flex min-h-0 flex-1 flex-col",
1545
- children: /* @__PURE__ */ F(Ge, {
1546
- ...wn,
1630
+ children: /* @__PURE__ */ F(Qe, {
1631
+ ...An,
1547
1632
  metadata: /* @__PURE__ */ F("div", {
1548
1633
  className: "flex flex-1 items-center justify-center p-8",
1549
- children: /* @__PURE__ */ F(le, { ariaLabel: Z.loadingAriaLabel ?? "Loading skill" })
1634
+ children: /* @__PURE__ */ F(fe, { ariaLabel: Z.loadingAriaLabel ?? "Loading skill" })
1550
1635
  })
1551
1636
  })
1552
1637
  });
1553
- if (E) return /* @__PURE__ */ F("div", {
1554
- dir: De,
1638
+ if (S) return /* @__PURE__ */ F("div", {
1639
+ dir: Ee,
1555
1640
  className: "relative flex min-h-0 flex-1 flex-col",
1556
- children: /* @__PURE__ */ F(Ge, {
1557
- ...wn,
1641
+ children: /* @__PURE__ */ F(Qe, {
1642
+ ...An,
1558
1643
  metadata: /* @__PURE__ */ F("div", {
1559
1644
  className: "p-8",
1560
- children: /* @__PURE__ */ F(w, {
1645
+ children: /* @__PURE__ */ F(E, {
1561
1646
  message: Z.loadErrorMessage ?? "Couldn't load this skill. Please try again.",
1562
- iconStroke: b,
1563
- action: /* @__PURE__ */ F(oe, {
1647
+ iconStroke: x,
1648
+ action: /* @__PURE__ */ F(ce, {
1564
1649
  label: Z.retryLabel ?? "Retry",
1565
- onClick: xe
1650
+ onClick: ge
1566
1651
  })
1567
1652
  })
1568
1653
  })
1569
1654
  })
1570
1655
  });
1571
- let Tn = q === Ze, En = Tn ? Ze : Z.selectedFileHeading?.(en?.name ?? q) ?? en?.name ?? q, Dn = j != null || te != null ? /* @__PURE__ */ I("div", {
1656
+ let jn = K === W, Mn = rn?.name ?? K.slice(K.lastIndexOf("/") + 1), Nn = jn ? W : Z.selectedFileHeading?.(Mn) ?? Mn, Pn = k != null || j != null ? /* @__PURE__ */ I("div", {
1572
1657
  className: "flex flex-col gap-2",
1573
- children: [j != null && /* @__PURE__ */ I("div", {
1658
+ children: [k != null && /* @__PURE__ */ I("div", {
1574
1659
  className: "flex items-center gap-2",
1575
- children: [/* @__PURE__ */ F(T, { text: j }), Se != null && /* @__PURE__ */ F(O, {
1660
+ children: [/* @__PURE__ */ F(D, { text: k }), be != null && /* @__PURE__ */ F(A, {
1576
1661
  label: Z.retryLabel ?? "Retry",
1577
- onClick: Se
1662
+ onClick: be
1578
1663
  })]
1579
- }), te != null && /* @__PURE__ */ I("div", {
1664
+ }), j != null && /* @__PURE__ */ I("div", {
1580
1665
  className: "flex items-center gap-2",
1581
- children: [/* @__PURE__ */ F(T, { text: te.message }), /* @__PURE__ */ F(O, {
1666
+ children: [/* @__PURE__ */ F(D, { text: j.message }), /* @__PURE__ */ F(A, {
1582
1667
  label: Z.reloadLatestLabel ?? "Reload latest",
1583
1668
  onClick: ne
1584
1669
  })]
1585
1670
  })]
1586
- }) : void 0, On = /* @__PURE__ */ F(a, {
1587
- isEnabled: !!se,
1588
- fieldId: Ae,
1671
+ }) : void 0, Fn = /* @__PURE__ */ F(a, {
1672
+ isEnabled: !!oe,
1673
+ fieldId: Ne,
1589
1674
  required: !0,
1590
- labelClassName: c(Dt.helperText, Lt),
1675
+ labelClassName: c(Ft.helperText, kt),
1591
1676
  label: Z.instructionsLabel ?? "Instructions",
1592
1677
  labels: Z,
1593
- refinement: Ie,
1594
- disabled: Le || D,
1595
- ...Ht,
1678
+ refinement: U,
1679
+ disabled: Be || C,
1680
+ ...Gt,
1596
1681
  children: /* @__PURE__ */ I("div", {
1597
1682
  className: "flex flex-1 flex-col gap-2",
1598
1683
  children: [
1599
- !se && /* @__PURE__ */ F(A, {
1600
- htmlFor: Ae,
1601
- className: c(Dt.helperText, Lt),
1684
+ !oe && /* @__PURE__ */ F(te, {
1685
+ htmlFor: Ne,
1686
+ className: c(Ft.helperText, kt),
1602
1687
  label: Z.instructionsLabel ?? "Instructions",
1603
1688
  required: !0
1604
1689
  }),
1605
1690
  /* @__PURE__ */ F("div", {
1606
- ref: Me,
1691
+ ref: Fe,
1607
1692
  className: c(t, e, n),
1608
- children: /* @__PURE__ */ F(be, {
1609
- fallback: /* @__PURE__ */ F(le, { ariaLabel: Z.instructionsLoadingAriaLabel ?? "Loading" }),
1610
- children: /* @__PURE__ */ F(Ft, {
1611
- id: Ae,
1693
+ children: /* @__PURE__ */ F(we, {
1694
+ fallback: /* @__PURE__ */ F(fe, { ariaLabel: Z.instructionsLoadingAriaLabel ?? "Loading" }),
1695
+ children: /* @__PURE__ */ F(Ut, {
1696
+ id: Ne,
1612
1697
  ariaLabel: Z.instructionsLabel ?? "Instructions",
1613
- value: W.instructions,
1698
+ value: V.instructions,
1614
1699
  onChange: (e) => {
1615
- Ie.reset(), K({ instructions: e });
1700
+ U.reset(), Le({ instructions: e });
1616
1701
  },
1617
- theme: Oe,
1702
+ theme: je,
1618
1703
  showDragbar: !1,
1619
1704
  placeholder: Z.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
1620
1705
  })
1621
1706
  })
1622
1707
  }),
1623
- k?.instructions != null && /* @__PURE__ */ F(T, {
1624
- id: je,
1625
- text: k.instructions
1708
+ O?.instructions != null && /* @__PURE__ */ F(D, {
1709
+ id: Pe,
1710
+ text: O.instructions
1626
1711
  })
1627
1712
  ]
1628
1713
  })
1629
1714
  });
1630
1715
  return /* @__PURE__ */ I("div", {
1631
- dir: De,
1632
- className: c("relative flex min-h-0 min-w-0 flex-1 flex-col", Xe.root),
1633
- style: Bt,
1634
- ...Tt,
1716
+ dir: Ee,
1717
+ className: c("relative flex min-h-0 min-w-0 flex-1 flex-col", rt.root),
1718
+ style: Nt,
1719
+ ...Dt,
1635
1720
  children: [
1636
- /* @__PURE__ */ F(_t, {
1637
- isVisible: wt && !vt,
1638
- labels: Ee,
1721
+ /* @__PURE__ */ F(Ct, {
1722
+ isVisible: X && !ht,
1723
+ labels: xe,
1639
1724
  titleClassName: $.dropOverlayTitleClassName,
1640
1725
  subtitleClassName: $.dropOverlaySubtitleClassName
1641
1726
  }),
1642
- /* @__PURE__ */ F(Ge, {
1643
- ...wn,
1644
- asideData: ue,
1645
- asideSectionClassName: Nt,
1646
- isSubmitting: D,
1647
- metadataSectionClassName: Mt,
1727
+ /* @__PURE__ */ F(Qe, {
1728
+ ...An,
1729
+ asideData: le,
1730
+ asideSectionClassName: Vt,
1731
+ isSubmitting: C,
1732
+ metadataSectionClassName: Bt,
1648
1733
  metadata: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
1649
1734
  className: "desktop:hidden",
1650
- children: /* @__PURE__ */ F(yt, {
1735
+ children: /* @__PURE__ */ F(wt, {
1651
1736
  label: Z.editingFileLabel ?? "Editing file",
1652
- fileName: en?.name ?? "SKILL.md",
1653
- isExpanded: St,
1654
- onToggle: Ct,
1737
+ fileName: jn ? W : Mn,
1738
+ isExpanded: Tt,
1739
+ onToggle: Et,
1655
1740
  labelClassName: $.editingFileLabelClassName,
1656
1741
  fileNameClassName: $.editingFileNameClassName,
1657
- children: vn(J.Mobile)
1742
+ children: wn(J.Mobile)
1658
1743
  })
1659
1744
  }), /* @__PURE__ */ F("div", {
1660
1745
  className: "hidden desktop:block",
1661
- children: vn(J.Desktop)
1746
+ children: wn(J.Desktop)
1662
1747
  })] }),
1663
- alert: Dn,
1664
- setupTitle: En,
1665
- setupSectionClassName: Pt,
1666
- setup: Tn ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Je, {
1667
- values: yn,
1668
- errors: bn,
1669
- onChange: Sn,
1670
- fields: kt,
1748
+ alert: Pn,
1749
+ setupTitle: Nn,
1750
+ setupSectionClassName: Ht,
1751
+ setup: jn ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(tt, {
1752
+ values: Tn,
1753
+ errors: En,
1754
+ onChange: On,
1755
+ fields: Lt,
1671
1756
  isDescriptionRequired: !0,
1672
1757
  isNameReadOnly: re,
1673
1758
  nameReadOnlyTooltip: Z.nameReadOnlyTooltip ?? "The skill name can't be changed after creation",
1674
- nameCaption: k?.name ? void 0 : Z.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
1675
- renderDescription: Cn,
1676
- labels: xn
1677
- }), On] }) : /* @__PURE__ */ F(P, { children: en?.kind === Qe.File && /* @__PURE__ */ F("div", {
1759
+ nameCaption: O?.name ? void 0 : Z.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
1760
+ renderDescription: kn,
1761
+ labels: Dn
1762
+ }), Fn] }) : /* @__PURE__ */ I(P, { children: [on && K !== $t && /* @__PURE__ */ F(Pt, {
1763
+ folderPath: K,
1764
+ entries: an,
1765
+ onOpen: cn,
1766
+ rootLabel: Z.folderPreviewRootLabel,
1767
+ breadcrumbAriaLabel: Z.folderPreviewBreadcrumbAriaLabel,
1768
+ overflowAriaLabel: Z.folderPreviewOverflowAriaLabel,
1769
+ listAriaLabel: Z.folderPreviewListAriaLabel,
1770
+ emptyTitle: Z.folderEmptyTitle,
1771
+ emptyDescription: Z.folderEmptyDescription,
1772
+ itemCountLabel: Z.folderItemCountLabel,
1773
+ itemCountClassName: $.folderItemCountClassName
1774
+ }), rn?.kind === G.File && /* @__PURE__ */ F("div", {
1678
1775
  className: "flex h-[max(320px,60dvh)] min-h-0 min-w-0 flex-none flex-col desktop:h-auto desktop:flex-1",
1679
- children: ce ?? /* @__PURE__ */ F(v, { text: Z.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." })
1680
- }) })
1776
+ children: se ?? /* @__PURE__ */ F(y, { text: Z.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." })
1777
+ })] })
1681
1778
  }),
1682
- /* @__PURE__ */ F(Et, {
1683
- isOpen: vt,
1684
- onClose: () => bt(!1),
1685
- fileActions: qt,
1686
- mode: Y.mode,
1687
- targetFolderPath: Y.targetFolderPath,
1688
- initialFiles: Y.initialFiles,
1689
- initialEntries: Y.initialEntries,
1690
- existingFilePaths: dn,
1779
+ /* @__PURE__ */ F(jt, {
1780
+ isOpen: ht,
1781
+ onClose: () => yt(!1),
1782
+ fileActions: Xt,
1783
+ mode: bt.mode,
1784
+ targetFolderPath: bt.targetFolderPath,
1785
+ initialFiles: bt.initialFiles,
1786
+ initialEntries: bt.initialEntries,
1787
+ existingFilePaths: _n,
1691
1788
  onCommitted: (e) => {
1692
1789
  e.some((e) => e.replacesExisting) && Ye(!0);
1693
1790
  },
1694
1791
  messageClassName: $.uploadMessageClassName,
1695
1792
  rowCaptionClassName: $.uploadRowCaptionClassName,
1696
- labels: Ee,
1697
- dialogColors: Vt,
1793
+ labels: xe,
1794
+ dialogColors: Wt,
1698
1795
  colors: {
1699
1796
  invalidDropZoneBorder: Q?.uploadInvalidDropZoneBorder,
1700
1797
  rowBorder: Q?.uploadRowBorder
1701
1798
  }
1702
1799
  }),
1703
- /* @__PURE__ */ F(ht, {
1704
- isOpen: cn != null,
1705
- onClose: () => ln(null),
1706
- validateName: (e) => Jt.validateNewFolder(e, cn ?? ""),
1707
- onCreate: (e) => Jt.createFolder(e, cn ?? ""),
1800
+ /* @__PURE__ */ F(xt, {
1801
+ isOpen: mn != null,
1802
+ onClose: () => hn(null),
1803
+ validateName: (e) => Zt.validateNewFolder(e, mn ?? ""),
1804
+ onCreate: (e) => Zt.createFolder(e, mn ?? ""),
1708
1805
  title: Z.createFolderLabel ?? "Create folder",
1709
1806
  nameLabel: Z.createFolderNameLabel ?? "Name",
1710
1807
  namePlaceholder: Z.createFolderNamePlaceholder ?? "Enter folder name",
1711
1808
  createLabel: Z.createFolderConfirmLabel ?? "Create",
1712
1809
  cancelLabel: Z.cancelLabel ?? "Cancel",
1713
1810
  closeAriaLabel: Z.createFolderCloseAriaLabel ?? "Close",
1714
- dialogColors: Vt
1811
+ dialogColors: Wt
1715
1812
  })
1716
1813
  ]
1717
1814
  });
1718
1815
  };
1719
1816
  //#endregion
1720
- export { Xe as SKILL_EDITOR_CLASS, $ as SkillEditor, bt as SkillFileCandidateKind, Qe as SkillFileNodeKind, dt as SkillFileUploadMode, Y as SkillFileValidationStatus };
1817
+ export { rt as SKILL_EDITOR_CLASS, Wt as SkillEditor, Tt as SkillFileCandidateKind, G as SkillFileNodeKind, _t as SkillFileUploadMode, Et as SkillFileValidationStatus };