@epam/ai-dial-skill-editor 1.3.0-dev.165 → 1.3.0-dev.170

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