@epam/ai-dial-skill-editor 1.3.0-dev.305 → 1.3.0-dev.309

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